details.vue 34 KB

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