details.vue 36 KB

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