details.vue 36 KB

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