details.vue 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999
  1. <template>
  2. <view class="wrap">
  3. <view>
  4. <view style='margin-left:10px;'>任务详情</view>
  5. <view class="content">
  6. <view class="row">
  7. <view class="left">任务编号</view>
  8. <view>{{detailData.processNo}}</view>
  9. </view>
  10. <view class="row">
  11. <view class="left">货名</view>
  12. <view>{{detailData.goodsName}}</view>
  13. </view>
  14. <view class="row">
  15. <view class="left">重量</view>
  16. <view>{{detailData.weight}}</view>
  17. </view>
  18. <view class="row">
  19. <view class="left">发货地址</view>
  20. <view>{{detailData.sendPrivate}}{{detailData.sendCity}}{{detailData.sendArea}}</view>
  21. </view>
  22. <view class="row">
  23. <view class="left">发货人</view>
  24. <view>{{detailData.sender}}</view>
  25. </view>
  26. <view class="row">
  27. <view class="left">发货人电话</view>
  28. <view>{{detailData.senderPhone}}</view>
  29. </view>
  30. <view class="row">
  31. <view class="left">收货地址</view>
  32. <view>{{detailData.receivePrivate}}{{detailData.receiveCity}}{{detailData.receiveArea}}</view>
  33. </view>
  34. <view class="row">
  35. <view class="left">收货人</view>
  36. <view>{{detailData.receiver}}</view>
  37. </view>
  38. <view class="row">
  39. <view class="left">收货人电话</view>
  40. <view>{{detailData.receiverPhone}}</view>
  41. </view>
  42. <view class="row">
  43. <view class="left">发货日期</view>
  44. <view>{{detailData.deliveryDateStart}}</view>
  45. </view>
  46. <view class="row">
  47. <view class="left">最晚到货日期</view>
  48. <view>{{detailData.deliveryDateEnd}}</view>
  49. </view>
  50. <view class="row">
  51. <view class="left">合同编号</view>
  52. <view>{{detailData.contractNo}}</view>
  53. </view>
  54. <view class="row">
  55. <view class="left">运输方式</view>
  56. <view>{{detailData.tranType}}</view>
  57. </view>
  58. </view>
  59. </view>
  60. <view>
  61. <view v-if='detailData.tranType=="火运"' style='margin-left:10px;'>联络员及车次</view>
  62. <view v-if='detailData.tranType=="火运"' class="content">
  63. <view class="row">
  64. <view class="left">姓名</view>
  65. <view>{{detailData.driver}}</view>
  66. </view>
  67. <view class="row">
  68. <view class="left">电话</view>
  69. <view>{{detailData.driverPhone}}</view>
  70. </view>
  71. <view class="row">
  72. <view class="left">发车日期</view>
  73. <view>
  74. <view @click='show1=true'>{{detailData.sendDateStart}}</view>
  75. <u-picker v-model="show1" mode="time" @confirm='dateChange($event)' :params="params">
  76. </u-picker>
  77. </view>
  78. </view>
  79. <view class="row">
  80. <view class="left">预计到站日期</view>
  81. <view>
  82. <view>{{detailData.receiveDateEnd}}</view>
  83. </view>
  84. </view>
  85. <view class="row">
  86. <view class="left">车型</view>
  87. <view>
  88. <view>{{detailData.carModel}}</view>
  89. </view>
  90. </view>
  91. </view>
  92. </view>
  93. <view v-if='detailData.tranType=="船运"' class="content">
  94. <view class="row">
  95. <view class="left">姓名</view>
  96. <view>{{detailData.driver}}</view>
  97. </view>
  98. <view class="row">
  99. <view class="left">电话</view>
  100. <view>{{detailData.driverPhone}}</view>
  101. </view>
  102. <view class="row">
  103. <view class="left">发船日期</view>
  104. <view>
  105. <view @click='show1=true'>{{detailData.sendDateStart}}</view>
  106. <u-picker v-model="show1" mode="time" @confirm='dateChange($event)' :params="params">
  107. </u-picker>
  108. </view>
  109. </view>
  110. <view class="row">
  111. <view class="left">预计到港日期</view>
  112. <view>
  113. <view>{{detailData.receiveDateEnd}}</view>
  114. </view>
  115. </view>
  116. <view class="row">
  117. <view class="left">船名</view>
  118. <view>
  119. <view>{{detailData.shipName}}</view>
  120. </view>
  121. </view>
  122. <view class="row">
  123. <view class="left">航次</view>
  124. <view>
  125. <view>{{detailData.shipNo}}</view>
  126. </view>
  127. </view>
  128. <view class="row">
  129. <view class="left">类型</view>
  130. <view>
  131. <view>{{detailData.shipType}}</view>
  132. </view>
  133. </view>
  134. <view v-if="detailData.shipType == '集装箱'" class="row">
  135. <view class="left">数量</view>
  136. <view>
  137. <view>{{detailData.boxNumber}}</view>
  138. </view>
  139. </view>
  140. </view>
  141. <view v-if='detailData.tranType=="火运"'>
  142. <view style='margin-left:10px;'>装车详情</view>
  143. <view v-for='(item,index) in freightspace' class="content">
  144. <view class="row">
  145. <view class="left">车厢号-{{index+1}}</view>
  146. <view>{{item.boxNo}}</view>
  147. </view>
  148. <view class="row">
  149. <view class="left">装车净重</view>
  150. <view v-if="item.status == '已装车' || item.status == '已送达'">{{item.loadNetWeight}}</view>
  151. <view style='text-align:right;' v-else>
  152. <input v-model='item.loadNetWeight' class="right-bottom"
  153. placeholder="输入毛重"></input>
  154. </view>
  155. </view>
  156. <view class="row">
  157. <view class="left">磅单</view>
  158. <view v-if="item.status == '已装车' || item.status == '已送达'">
  159. <image v-if="item.loadPoundImg" @click='shadeshow(item.loadPoundImg)' style='width:100px;height:100px;' :src="item.loadPoundImg" mode=""></image>
  160. <view v-else>暂无图片</view>
  161. </view>
  162. <view v-else>
  163. <upload class="upload" ref="upload" :action="action" :max-size="maxSize" :max-count="1" :file-list="imgUrl"
  164. :size-type="['compressed']" :imgIndex='index' @on-success="getImgUrl" @on-error="onError" @on-remove="onRemove"
  165. @on-uploaded="isAdd = true" :before-upload="filterFileType" @on-progress="onProgress"></upload>
  166. </view>
  167. </view>
  168. <view class="row">
  169. <view class="left">装车日期</view>
  170. <view>
  171. <view v-if="item.status == '已装车' || item.status == '已送达'">{{item.loadingDate}}</view>
  172. <view v-else @click='train(index)'>{{item.loadingDate?item.loadingDate:'请选择日期'}}</view>
  173. <u-picker v-model="item.show2" mode="time" @cancel='datecancel()' @confirm='dateChange1($event,item)' :params="params">
  174. </u-picker>
  175. </view>
  176. </view>
  177. <view style='text-align:right;' v-if="item.status == '已装车' || item.status == '已送达'">{{item.status}}</view>
  178. <u-button v-else @click='submit(index,2)' type="success">保存</u-button>
  179. </view>
  180. </view>
  181. <view v-if='detailData.tranType=="汽运"'>
  182. <view style='margin-left:10px;'>装车详情</view>
  183. <view v-for='(item,index) in freightspace' class="content">
  184. <view class="row">
  185. <view class="left">司机-{{index+1}}</view>
  186. <view>{{item.status}}</view>
  187. </view>
  188. <view class="row">
  189. <view class="left">姓名</view>
  190. <view>{{item.driver}}</view>
  191. </view>
  192. <view class="row">
  193. <view class="left">司机电话</view>
  194. <view>{{item.driverPhone}}</view>
  195. </view>
  196. <view class="row">
  197. <view class="left">车牌号</view>
  198. <view>{{item.carNo}}</view>
  199. </view>
  200. <view class="row">
  201. <view class="left">装车净重</view>
  202. <view v-if="item.status == '已装车' || item.status == '已送达'">{{item.loadNetWeight}}</view>
  203. <view style='text-align:right;' v-else>
  204. <input v-model='item.loadNetWeight' class="right-bottom"
  205. placeholder="输入毛重"></input>
  206. </view>
  207. </view>
  208. <view class="row">
  209. <view class="left">装车日期</view>
  210. <view>
  211. <view v-if="item.status == '已装车' || item.status == '已送达'">{{item.loadingDate}}</view>
  212. <view v-else @click='train(index)'>{{item.loadingDate?item.loadingDate:'请选择日期'}}</view>
  213. <u-picker v-model="item.show2" mode="time" @cancel='datecancel()' @confirm='dateChange1($event,index)' :params="params">
  214. </u-picker>
  215. </view>
  216. </view>
  217. <view class="row">
  218. <view class="left">磅单</view>
  219. <view v-if="item.loadPoundImg">
  220. <image style='width:100px;height:100px;' @click='shadeshow(item.loadPoundImg)' :src="item.loadPoundImg" mode=""></image>
  221. </view>
  222. <view v-else>
  223. <upload class="upload" ref="upload" :action="action" :max-size="maxSize" :max-count="1" :file-list="imgUrl"
  224. :size-type="['compressed']" :imgIndex='index' @on-success="getImgUrl" @on-error="onError" @on-remove="onRemove"
  225. @on-uploaded="isAdd = true" :before-upload="filterFileType" @on-progress="onProgress"></upload>
  226. </view>
  227. </view>
  228. <view class="row">
  229. <view class="left">箱号</view>
  230. <view>{{item.caseNo}}</view>
  231. </view>
  232. <view class="row">
  233. <view class="left">封号</view>
  234. <view>{{item.titleNo}}</view>
  235. </view>
  236. <view v-if="item.signStatus == '未签合同'">未签合同</view>
  237. <view v-if="item.signStatus == '已签合同'">已签合同</view>
  238. <u-button v-if="item.status != '已装车' && item.status != '已送达'" @click='submit(index,1)' type="success">保存</u-button>
  239. </view>
  240. </view>
  241. <view v-if='detailData.tranType=="船运"'>
  242. <view style='margin-left:10px;'>装船详情</view>
  243. <view v-for='(item,index) in freightspace' class="content">
  244. <view v-if="item.shipType == '集装箱'" class="row">
  245. <view class="left">集装箱-{{index+1}}</view>
  246. <view v-if="item.status == '未装车'">未装船</view>
  247. <view v-if="item.status == '已装车'">已装船</view>
  248. <view v-if="item.status == '已送达'">{{item.status}}</view>
  249. </view>
  250. <view v-if="item.shipType == '散船'" class="row">
  251. <view class="left">仓位号-{{index+1}}</view>
  252. <view v-if="item.status == '未装车'">未装船</view>
  253. <view v-if="item.status == '已装车'">已装船</view>
  254. <view v-if="item.status == '已送达'">{{item.status}}</view>
  255. </view>
  256. <view v-if="item.shipType == '集装箱'" class="row">
  257. <view class="left">箱号</view>
  258. <view style='text-align:right;'>
  259. <view v-if="item.status == '已装车' || item.status == '已送达'">{{item.caseNo}}</view>
  260. <input v-else placeholder="请输入箱号" v-model='item.caseNo' type="text">
  261. </view>
  262. </view>
  263. <view v-if="item.shipType == '集装箱'" class="row">
  264. <view class="left">封号</view>
  265. <view style='text-align:right;'>
  266. <view v-if="item.status == '已装车' || item.status == '已送达'">{{item.titleNo}}</view>
  267. <input v-else placeholder="请输入封号" v-model='item.titleNo' type="text">
  268. </view>
  269. </view>
  270. <view v-if="item.shipType == '散船'" class="row">
  271. <view class="left">仓位号</view>
  272. <view>
  273. <view>{{item.binNumber}}</view>
  274. </view>
  275. </view>
  276. <view v-if="item.shipType == '散船'" class="row">
  277. <view class="left">计划重量</view>
  278. <view>
  279. <view>{{item.positionWeight}}</view>
  280. </view>
  281. </view>
  282. <view class="row">
  283. <view class="left">装船净重</view>
  284. <view v-if="item.status == '已装车' || item.status == '已送达'">{{item.loadNetWeight}}</view>
  285. <view style='text-align:right;' v-else>
  286. <input v-model='item.loadNetWeight' class="right-bottom"
  287. placeholder="输入毛重"></input>
  288. </view>
  289. </view>
  290. <view class="row">
  291. <view class="left">装船日期</view>
  292. <view>
  293. <view v-if="item.status == '已装车' || item.status == '已送达'">{{item.loadingDate}}</view>
  294. <view v-else @click='train(index)'>{{item.loadingDate?item.loadingDate:'请选择日期'}}</view>
  295. <u-picker v-model="item.show2" mode="time" @cancel='datecancel()' @confirm='dateChange1($event,index)' :params="params">
  296. </u-picker>
  297. </view>
  298. </view>
  299. <view style='text-align:right;' v-if="item.status == '已装车' || item.status == '已送达'">{{item.status}}</view>
  300. <u-button v-else @click='submit(index,3)' type="success">保存</u-button>
  301. </view>
  302. <view class="row">
  303. <view style='margin-left:10px;' class="left">运单</view>
  304. <view v-if="pictureTotal.length>0">
  305. <image v-for='item in pictureTotal' @click='shadeshow(item)' style='width:100px;height:100px;' :src="item" mode=""></image>
  306. </view>
  307. <view v-else>
  308. <upload class="upload" ref="upload" :action="action" :max-size="maxSize" :max-count="1" :file-list="imgUrl"
  309. :size-type="['compressed']" @on-success="getImgUrl1" @on-error="onError" @on-remove="onRemove"
  310. @on-uploaded="isAdd = true" :before-upload="filterFileType" @on-progress="onProgress"></upload>
  311. </view>
  312. </view>
  313. </view>
  314. <view>合计吨:{{ total }}/{{ detailData.weight }}
  315. <text style='margin-left:10px;'
  316. class="noservice"
  317. v-show="detailData.receivingStatus == '执行中'">未完货</text>
  318. <text
  319. class="service"
  320. v-show="detailData.receivingStatus == '已完货'">{{ detailData.receivingStatus }}</text>
  321. </view>
  322. <view style='padding:10px;' class='flex bottom-btn'>
  323. <u-button @click='pass' type="error" class="btn1" hover-class='none'>提交</u-button>
  324. <u-button @click='finishedgoods' type="success" class="btn2">完货</u-button>
  325. </view>
  326. <view @click='imgShow=false' v-if="imgShow" class="shade">
  327. <image style='position:absolute;top:0;left:0;right:0;bottom:0;margin:auto;' :src="url" mode=""></image>
  328. </view>
  329. </view>
  330. </template>
  331. <script>
  332. import upload from '@/components/upload.vue';
  333. import helper from '@/common/helper.js';
  334. export default {
  335. components: {
  336. upload
  337. },
  338. data() {
  339. return {
  340. id:'',
  341. show1: false,
  342. show2: false,
  343. currentPage: 1,
  344. pageSize: 10,
  345. show1:false,
  346. positionId: "",
  347. binNumber: "",
  348. maxSize: 50 * 1024 * 1024,
  349. status: '执行中',
  350. positionName: '',
  351. pictureTotal:[],
  352. statusList: [
  353. {name:'执行中',value:1},
  354. {name:'已完货',value:2},
  355. {name:'全部任务',value:3},
  356. ],
  357. params: {
  358. year: true,
  359. month: true,
  360. day: true,
  361. },
  362. imgUrl:[],
  363. unloadPoundImg:'',
  364. action: this.$uploadUrl,
  365. freightspace:[],
  366. feedbackFlag:1,
  367. detailData:{},
  368. allWarehouse: [],
  369. showTime: '',
  370. index:0,
  371. imgShow:false,
  372. url:''
  373. }
  374. },
  375. onLoad(options) {
  376. this.id = options.id
  377. },
  378. onShow() {
  379. this.getList()
  380. },
  381. computed: {
  382. total: function () {
  383. var maxStorage = 0
  384. if(this.detailData.tranCarInfoList){
  385. for (var i = 0; i < this.detailData.tranCarInfoList.length; i++) {
  386. maxStorage += Number(
  387. this.detailData.tranCarInfoList[i].loadNetWeight
  388. )
  389. }
  390. }
  391. return maxStorage
  392. },
  393. },
  394. methods: {
  395. shadeshow(url){
  396. this.imgShow=true
  397. this.url=url
  398. },
  399. datecancel(){
  400. this.freightspace[this.index].show2=true
  401. this.$forceUpdate();
  402. },
  403. submit(index,status){
  404. var that = this
  405. if(this.detailData.tranType=='火运'){
  406. if (!this.freightspace[index].loadNetWeight) {
  407. this.$api.msg('装车净重不能为空!')
  408. return
  409. }
  410. if (
  411. this.freightspace[index].loadNetWeight < 0 ||
  412. this.freightspace[index].loadNetWeight > 10000
  413. ) {
  414. this.$api.msg('装车净重输入错误!')
  415. return
  416. }
  417. if (!this.freightspace[index].loadingDate) {
  418. this.$api.msg('装车日期不能为空!')
  419. return
  420. }
  421. var tranProcessInfo = {}
  422. tranProcessInfo.flag=0
  423. tranProcessInfo.id=that.freightspace[index].id
  424. tranProcessInfo.infoId = that.detailData.infoId
  425. tranProcessInfo.processId = that.detailData.id
  426. tranProcessInfo.driver = that.detailData.driver
  427. tranProcessInfo.driverPhone = that.detailData.driverPhone
  428. tranProcessInfo.tranCarNo = that.detailData.tranCarNo
  429. tranProcessInfo.carNo = that.detailData.carNo
  430. tranProcessInfo.loadNetWeight = that.freightspace[index].loadNetWeight
  431. tranProcessInfo.loadingDate = that.freightspace[index].loadingDate
  432. tranProcessInfo.loadPoundImg = that.freightspace[index].loadPoundImg
  433. tranProcessInfo.tranType = status
  434. tranProcessInfo.contractNo = that.detailData.contractNo
  435. that.$api.doRequest('post', '/tranCarInfo/api/feedbackTranCar', tranProcessInfo).then(res => {
  436. if (res.data.code == 200) {
  437. that.$api.msg('保存成功')
  438. that.detailData = {}
  439. that.freightspace = {}
  440. uni.navigateBack({})
  441. }
  442. })
  443. // }
  444. // }
  445. // })
  446. }else if(this.detailData.tranType=='船运'){
  447. if (this.freightspace[index].shipType == '集装箱'&&!this.freightspace[index].caseNo) {
  448. this.$api.msg('箱号不能为空!')
  449. return
  450. }
  451. if (
  452. this.freightspace[index].shipType == '集装箱'&&this.freightspace[index].caseNo.length > 15 ||
  453. this.freightspace[index].shipType == '集装箱'&&this.freightspace[index].caseNo.length < 1) {
  454. this.$api.msg('箱号输入错误!')
  455. return
  456. }
  457. if (this.freightspace[index].shipType == '集装箱'&&!this.freightspace[index].titleNo) {
  458. this.$api.msg('封号不能为空!')
  459. return
  460. }
  461. if (
  462. this.freightspace[index].shipType == '集装箱'&&this.freightspace[index].titleNo.length > 15 ||
  463. this.freightspace[index].shipType == '集装箱'&&this.freightspace[index].titleNo.length < 1
  464. ) {
  465. this.$api.msg('封号输入错误!')
  466. return
  467. }
  468. if (!this.freightspace[index].loadNetWeight) {
  469. this.$api.msg('装船净重不能为空!')
  470. return
  471. }
  472. if (
  473. this.freightspace[index].loadNetWeight < 0 ||
  474. this.freightspace[index].loadNetWeight > 10000
  475. ) {
  476. this.$api.msg('装船净重输入错误!')
  477. return
  478. }
  479. if (!this.freightspace[index].loadingDate) {
  480. this.$api.msg('装船日期不能为空!')
  481. return
  482. }
  483. var tranProcessInfo = {}
  484. tranProcessInfo.flag=0
  485. tranProcessInfo.id=that.freightspace[index].id
  486. tranProcessInfo.infoId = that.detailData.infoId
  487. tranProcessInfo.processId = that.detailData.id
  488. tranProcessInfo.driver = that.detailData.driver
  489. tranProcessInfo.driverPhone = that.detailData.driverPhone
  490. tranProcessInfo.tranCarNo = that.detailData.tranCarNo
  491. tranProcessInfo.caseNo = that.freightspace[index].caseNo
  492. tranProcessInfo.titleNo = that.freightspace[index].titleNo
  493. tranProcessInfo.loadNetWeight = that.freightspace[index].loadNetWeight
  494. tranProcessInfo.loadingDate = that.freightspace[index].loadingDate
  495. tranProcessInfo.loadPoundImg = that.freightspace[index].loadPoundImg
  496. tranProcessInfo.tranType = status
  497. tranProcessInfo.contractNo = that.detailData.contractNo
  498. that.$api.doRequest('post', '/tranCarInfo/api/feedbackTranCar', tranProcessInfo).then(res => {
  499. if (res.data.code == 200) {
  500. that.$api.msg('保存成功')
  501. that.detailData = {}
  502. that.freightspace = {}
  503. uni.navigateBack({})
  504. }
  505. })
  506. }else if(this.detailData.tranType=='汽运'){
  507. if (!this.freightspace[index].driver) {
  508. that.$api.msg('司机姓名不能为空!')
  509. return
  510. }
  511. if (!this.freightspace[index].driverPhone) {
  512. that.$api.msg('司机电话不能为空!')
  513. return
  514. }
  515. if (!this.freightspace[index].carNo) {
  516. that.$api.msg('车牌号不能为空!')
  517. return
  518. }
  519. if (!this.freightspace[index].loadNetWeight) {
  520. that.$api.msg('装载净重不能为空!')
  521. return
  522. }
  523. var tranProcessInfo = {}
  524. tranProcessInfo.flag=0
  525. tranProcessInfo.id=that.freightspace[index].id
  526. tranProcessInfo.infoId = that.detailData.infoId
  527. tranProcessInfo.processId = that.detailData.id
  528. tranProcessInfo.driver = that.detailData.driver
  529. tranProcessInfo.driverPhone = that.detailData.driverPhone
  530. tranProcessInfo.tranCarNo = that.detailData.tranCarNo
  531. tranProcessInfo.carNo = that.freightspace[index].carNo
  532. tranProcessInfo.caseNo = that.freightspace[index].caseNo
  533. tranProcessInfo.titleNo = that.freightspace[index].titleNo
  534. tranProcessInfo.loadNetWeight = that.freightspace[index].loadNetWeight
  535. tranProcessInfo.loadingDate = that.freightspace[index].loadingDate
  536. tranProcessInfo.loadPoundImg = that.freightspace[index].loadPoundImg
  537. tranProcessInfo.tranType = status
  538. tranProcessInfo.contractNo = that.detailData.contractNo
  539. that.$api.doRequest('post', '/tranCarInfo/api/feedbackTranCar', tranProcessInfo).then(res => {
  540. if (res.data.code == 200) {
  541. that.$api.msg('保存成功')
  542. that.detailData = {}
  543. that.freightspace = {}
  544. uni.navigateBack({})
  545. }
  546. })
  547. }
  548. },
  549. finishedgoods(){
  550. var that = this
  551. if(this.detailData.tranType=='火运'){
  552. uni.showModal({
  553. content: "完货操作后,装车信息不可修改,是否确定完货?",
  554. success(res) {
  555. if (res.confirm) {
  556. that.tranCarInfoList = that.freightspace
  557. that.tranCarInfoList.driver = that.detailData.driver
  558. that.tranCarInfoList.driverPhone = that.detailData.driverPhone
  559. that.tranCarInfoList.tranCarNo = that.detailData.tranCarNo
  560. that.tranCarInfoList.carNo = that.detailData.carNo
  561. that.tranCarInfoList[0].sendDateStart = that.detailData.sendDateStart
  562. that.tranCarInfoList.loadNetWeight = that.detailData.loadNetWeight
  563. that.tranCarInfoList.tranType = that.tranType
  564. that.tranCarInfoList.loadPoundImg = that.detailData.loadPoundImg
  565. // this.tranCarInfoList.boxNo = this.arr.toString()
  566. for (var i = 0; i < that.tranCarInfoList.length; i++) {
  567. that.tranCarInfoList[i].id = that.freightspace[i].id
  568. if (that.tranCarInfoList[i].temporaryDriverFlag != 0) {
  569. that.tranCarInfoList[i].temporaryDriverFlag = 1
  570. that.tranCarInfoList[i].tranType = that.tranType
  571. }
  572. }
  573. var tranProcessInfo = {}
  574. tranProcessInfo.id = that.detailData.id
  575. tranProcessInfo.infoId = that.detailData.infoId
  576. tranProcessInfo.processNo = that.detailData.processNo
  577. tranProcessInfo.tranPrice = that.detailData.tranPrice
  578. tranProcessInfo.tranCarInfoList = that.tranCarInfoList
  579. that.$api.doRequest('post', '/tranProcessInfo/api/editFeedbackStatus', tranProcessInfo).then(res => {
  580. if (res.data.code == 200) {
  581. that.$api.msg('提交成功')
  582. that.detailData = {}
  583. that.freightspace = {}
  584. uni.navigateBack({})
  585. }
  586. })
  587. }
  588. }
  589. })
  590. }else if(this.detailData.tranType=='船运'){
  591. uni.showModal({
  592. content: "完货操作后,装船信息不可修改,是否确定完货?",
  593. success(res) {
  594. if (res.confirm) {
  595. var tranProcessInfo = {}
  596. tranProcessInfo.id = that.detailData.id
  597. that.$api.doRequest('post', '/tranProcessInfo/api/editFeedbackStatus', tranProcessInfo).then(res => {
  598. if (res.data.code == 200) {
  599. that.$api.msg('提交成功')
  600. that.detailData = {}
  601. that.freightspace = {}
  602. uni.navigateBack({})
  603. }
  604. })
  605. }
  606. }
  607. })
  608. }else if(this.detailData.tranType=='汽运'){
  609. uni.showModal({
  610. content: "完货操作后,装车信息不可修改,是否确定完货?",
  611. success(res) {
  612. if (res.confirm) {
  613. var tranProcessInfo = {}
  614. tranProcessInfo.id = that.detailData.id
  615. that.$api.doRequest('post', '/tranProcessInfo/api/editFeedbackStatus', tranProcessInfo).then(res => {
  616. if (res.data.code == 200) {
  617. that.$api.msg('提交成功')
  618. that.detailData = {}
  619. that.freightspace = {}
  620. uni.navigateBack({})
  621. }
  622. })
  623. }
  624. }
  625. })
  626. }
  627. },
  628. pass(){
  629. var that = this
  630. if(this.detailData.tranType=='火运'){
  631. for(var i=0;i<this.freightspace.length;i++){
  632. if (!this.freightspace[i].loadNetWeight) {
  633. this.$api.msg('装车净重不能为空!')
  634. return
  635. }
  636. if (
  637. this.freightspace[i].loadNetWeight < 0 ||
  638. this.freightspace[i].loadNetWeight > 10000
  639. ) {
  640. this.$api.msg('装车净重输入错误!')
  641. return
  642. }
  643. if (!this.freightspace[i].loadingDate) {
  644. this.$api.msg('装车日期不能为空!')
  645. return
  646. }
  647. }
  648. uni.showModal({
  649. content: "提交成功后提醒司机及时签订运输合同,确定提交装车信息?",
  650. success(res) {
  651. if (res.confirm) {
  652. that.tranCarInfoList = that.freightspace
  653. that.tranCarInfoList.driver = that.detailData.driver
  654. that.tranCarInfoList.driverPhone = that.detailData.driverPhone
  655. that.tranCarInfoList.tranCarNo = that.detailData.tranCarNo
  656. that.tranCarInfoList.carNo = that.detailData.carNo
  657. that.tranCarInfoList[0].sendDateStart = that.detailData.sendDateStart
  658. that.tranCarInfoList.loadNetWeight = that.detailData.loadNetWeight
  659. that.tranCarInfoList.tranType = that.tranType
  660. that.tranCarInfoList.loadPoundImg = that.detailData.loadPoundImg
  661. // this.tranCarInfoList.boxNo = this.arr.toString()
  662. for (var i = 0; i < that.tranCarInfoList.length; i++) {
  663. that.tranCarInfoList[i].id = that.freightspace[i].id
  664. if (that.tranCarInfoList[i].temporaryDriverFlag != 0) {
  665. that.tranCarInfoList[i].temporaryDriverFlag = 1
  666. that.tranCarInfoList[i].tranType = that.tranType
  667. }
  668. }
  669. var tranProcessInfo = {}
  670. tranProcessInfo.id = that.detailData.id
  671. tranProcessInfo.infoId = that.detailData.infoId
  672. tranProcessInfo.processNo = that.detailData.processNo
  673. tranProcessInfo.tranPrice = that.detailData.tranPrice
  674. tranProcessInfo.tranCarInfoList = that.tranCarInfoList
  675. that.$api.doRequest('post', '/tranProcessInfo/api/insertTranCar', tranProcessInfo).then(res => {
  676. if (res.data.code == 200) {
  677. that.$api.msg('提交成功')
  678. that.detailData = {}
  679. that.freightspace = {}
  680. uni.navigateBack({
  681. })
  682. }
  683. })
  684. }
  685. }
  686. })
  687. }else if(this.detailData.tranType=='船运'){
  688. for(var i=0;i<this.freightspace.length;i++){
  689. if (this.freightspace[i].loadNetWeight&&this.freightspace[i].loadNetWeight < 0 ||this.freightspace[i].loadNetWeight&&this.freightspace[i].loadNetWeight > 10000) {
  690. this.$api.msg('装船净重输入错误!')
  691. return
  692. }
  693. }
  694. uni.showModal({
  695. content: "提交成功后装船信息不可修改,是否确定提交?",
  696. success(res) {
  697. if (res.confirm) {
  698. that.tranCarInfoList = that.freightspace
  699. that.tranCarInfoList[0].sendDateStart = that.detailData.sendDateStart
  700. for (var i = 0; i < that.tranCarInfoList.length; i++) {
  701. that.tranCarInfoList[i].id = that.freightspace[i].id
  702. }
  703. var tranProcessInfo = {}
  704. tranProcessInfo.id = that.detailData.id
  705. tranProcessInfo.infoId = that.detailData.infoId
  706. tranProcessInfo.processNo = that.detailData.processNo
  707. tranProcessInfo.tranCarInfoList = that.tranCarInfoList
  708. that.$api.doRequest('post', '/tranProcessInfo/api/insertTranCar', tranProcessInfo).then(res => {
  709. if (res.data.code == 200) {
  710. that.$api.msg('提交成功')
  711. that.detailData = {}
  712. that.freightspace = {}
  713. uni.navigateBack({
  714. })
  715. }
  716. })
  717. }
  718. }
  719. })
  720. }else if(this.detailData.tranType=='汽运'){
  721. uni.showModal({
  722. content: "提交成功后提醒司机及时签订运输合同,确定提交装车信息?",
  723. success(res) {
  724. if (res.confirm) {
  725. that.tranCarInfoList = that.freightspace
  726. that.tranCarInfoList.driver = that.detailData.driver
  727. that.tranCarInfoList.driverPhone = that.detailData.driverPhone
  728. that.tranCarInfoList.tranCarNo = that.detailData.tranCarNo
  729. that.tranCarInfoList.carNo = that.detailData.carNo
  730. that.tranCarInfoList.loadNetWeight = that.detailData.loadNetWeight
  731. that.tranCarInfoList.tranType = that.tranType
  732. that.tranCarInfoList.loadPoundImg = that.detailData.loadPoundImg
  733. // this.tranCarInfoList.boxNo = this.arr.toString()
  734. for (var i = 0; i < that.tranCarInfoList.length; i++) {
  735. that.tranCarInfoList[i].id = that.freightspace[i].id
  736. if (that.tranCarInfoList[i].temporaryDriverFlag != 0) {
  737. that.tranCarInfoList[i].temporaryDriverFlag = 1
  738. that.tranCarInfoList[i].tranType = that.tranType
  739. }
  740. }
  741. var tranProcessInfo = {}
  742. tranProcessInfo.id = that.detailData.id
  743. tranProcessInfo.infoId = that.detailData.infoId
  744. tranProcessInfo.processNo = that.detailData.processNo
  745. tranProcessInfo.tranPrice = that.detailData.tranPrice
  746. tranProcessInfo.tranCarInfoList = that.tranCarInfoList
  747. that.$api.doRequest('post', '/tranProcessInfo/api/insertTranCar', tranProcessInfo).then(res => {
  748. if (res.data.code == 200) {
  749. that.$api.msg('提交成功')
  750. that.detailData = {}
  751. that.freightspace = {}
  752. uni.navigateBack({
  753. })
  754. }
  755. })
  756. }
  757. }
  758. })
  759. }
  760. },
  761. getList() {
  762. this.$api.doRequest('get', '/tranProcessInfo/getTranProcess', {
  763. id:this.id
  764. }).then(res => {
  765. if (res.data.code == 200) {
  766. this.detailData = res.data.data
  767. if(res.data.data.tranType=='火运'){
  768. if(res.data.data.tranCarInfoList.length>0){
  769. if(res.data.data.tranCarInfoList[0].driver){
  770. this.detailData.driver = res.data.data.tranCarInfoList[0].driver
  771. }
  772. for (var i = 0; i < res.data.data.tranCarInfoList.length; i++) {
  773. res.data.data.tranCarInfoList[i].show2=false
  774. }
  775. this.detailData.driverPhone =res.data.data.tranCarInfoList[0].driverPhone
  776. this.$set(this.detailData,'sendDateStart',res.data.data.tranCarInfoList[0].sendDateStart)
  777. this.detailData.receiveDateEnd =
  778. res.data.data.tranCarInfoList[0].receiveDateEnd
  779. this.detailData.carModel = res.data.data.tranCarInfoList[0].carModel
  780. this.freightspace=res.data.data.tranCarInfoList
  781. }
  782. }else if(res.data.data.tranType=='汽运'){
  783. for (var i = 0; i < res.data.data.tranCarInfoList.length; i++) {
  784. res.data.data.tranCarInfoList[i].show2=false
  785. }
  786. this.freightspace=res.data.data.tranCarInfoList
  787. }else if(res.data.data.tranType=='船运'){
  788. if (res.data.data.tranCarInfoList.length > 0) {
  789. for (var i = 0; i < res.data.data.tranCarInfoList.length; i++) {
  790. res.data.data.tranCarInfoList[i].show2=false
  791. }
  792. this.detailData.driver = res.data.data.tranCarInfoList[0].driver
  793. this.detailData.driverPhone =
  794. res.data.data.tranCarInfoList[0].driverPhone
  795. this.$set(
  796. this.detailData,
  797. 'sendDateStart',
  798. res.data.data.tranCarInfoList[0].sendDateStart
  799. )
  800. this.detailData.receiveDateEnd =
  801. res.data.data.tranCarInfoList[0].receiveDateEnd
  802. this.detailData.shipName = res.data.data.tranCarInfoList[0].shipName
  803. this.detailData.shipNo = res.data.data.tranCarInfoList[0].shipNo
  804. this.detailData.shipType = res.data.data.tranCarInfoList[0].shipType
  805. this.detailData.boxNumber = res.data.data.tranCarInfoList[0].boxNumber
  806. //上传附件计数
  807. if(this.detailData.tranCarInfoList[0].loadPoundImg){
  808. this.pictureTotal = this.detailData.tranCarInfoList[0].loadPoundImg.split(",")
  809. }
  810. this.freightspace = res.data.data.tranCarInfoList
  811. }
  812. }
  813. }
  814. })
  815. },
  816. getImgUrl(res1,res2,res3,res4) {
  817. // debugger
  818. this.freightspace[res4].loadPoundImg=res1
  819. // this.detailData.addressUrl = res
  820. // console.log(res)
  821. // console.log('------------res-----------')
  822. },
  823. setImgUrl(val){
  824. // debugger
  825. for(let i = 0;i<freightspace.length;i++){
  826. }
  827. },
  828. filterFileType(index, lists) {
  829. if (lists[index].fileType != 'jpg' && lists[index].fileType != 'png' && lists[index].fileType != 'gif') {
  830. lists.splice(index, 1);
  831. // 当前文件不支持
  832. uni.showModal({
  833. title: '暂不支持当前图片类型',
  834. showCancel: false
  835. });
  836. } else {
  837. this.isAdd = false;
  838. }
  839. },
  840. dateChange(e) {
  841. this.detailData.sendDateStart = e.year + "-" + e.month + "-" + e.day
  842. },
  843. train(index){
  844. console.log(index)
  845. this.freightspace[index].show2=true
  846. this.$forceUpdate();
  847. this.index=index
  848. },
  849. dateChange1(e){
  850. this.$set(this.freightspace[this.index],'loadingDate',e.year + "-" + e.month + "-" + e.day)
  851. },
  852. statuschange(e) {
  853. this.status = this.statusList[e[0]].name
  854. this.getList()
  855. },
  856. goDetail(val) {
  857. uni.navigateTo({
  858. url: '/pages/erp/deliveryfeedback/details?data=' + JSON.stringify(val),
  859. })
  860. }
  861. }
  862. }
  863. </script>
  864. <style scoped lang="scss">
  865. uni-page-body {
  866. overflow: hidden;
  867. }
  868. .content{
  869. margin:10px 0;
  870. }
  871. .wrap {
  872. margin: 10rpx;
  873. padding: 20rpx 20rpx 240rpx 20rpx;
  874. .top {
  875. display: flex;
  876. margin-bottom: 20rpx;
  877. .top-left {
  878. margin-right: 20rpx;
  879. }
  880. }
  881. }
  882. .bottom-btn {
  883. width: 100%;
  884. position: fixed;
  885. bottom:0;
  886. display: flex;
  887. z-index: 2;
  888. left: 0;
  889. background-color: #f8f8f8;
  890. flex-direction: column;
  891. .btn1,.btn2{
  892. width: 100%;
  893. margin-bottom: 26rpx;
  894. border-radius: 90rpx;
  895. }
  896. .btn1{
  897. background: white;
  898. color: #00C265;
  899. }
  900. }
  901. .content,
  902. .content1,
  903. .content2 {
  904. border-radius: 20rpx;
  905. background: white;
  906. padding: 20rpx;
  907. .title {
  908. font-size: 28rpx;
  909. font-weight: 600;
  910. color: #333333;
  911. }
  912. .row {
  913. display: flex;
  914. justify-content: space-between;
  915. // border-bottom: 1px solid #EEEEEE;
  916. padding: 21rpx 0;
  917. .right,
  918. input {
  919. font-size: 28rpx;
  920. color: #333333;
  921. }
  922. }
  923. .row-bottom {
  924. // border: 0;
  925. .right-bottom {
  926. width: 280rpx;
  927. text-align: right;
  928. }
  929. }
  930. }
  931. .content1 {
  932. margin-top: 20rpx;
  933. }
  934. .content2 {
  935. margin-top: 10px;
  936. // display: flex;
  937. align-items: center;
  938. .left {
  939. margin-right: 20px;
  940. }
  941. }
  942. .submit {
  943. width: 40%;
  944. background: #22C572;
  945. border-radius: 10rpx;
  946. }
  947. .edit-btn {
  948. background: #22C572;
  949. width: 100rpx;
  950. height: 50rpx;
  951. margin: 0;
  952. color: white;
  953. }
  954. .has-btn {
  955. align-items: center;
  956. }
  957. // .bottom-btn {
  958. // padding: 30rpx;
  959. // background: #FFFFFF;
  960. // width: 92%;
  961. // position: fixed;
  962. // bottom: 0rpx;
  963. // display: flex;
  964. // z-index: 9999;
  965. // }
  966. .shade{
  967. background:#000;
  968. position:fixed;
  969. top:0;left:0;
  970. width:100%;height:100%;
  971. z-index:10000;
  972. }
  973. </style>