details.vue 37 KB

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