details.vue 35 KB

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