details.vue 36 KB

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