details.vue 35 KB

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