details.vue 36 KB

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