details.vue 35 KB

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