details.vue 36 KB

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