tranManagementReceivingloading.vue 32 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069
  1. // 汽车卸车
  2. <template>
  3. <div class="container">
  4. <el-row>
  5. <el-col :span="20">
  6. <h2 class="bg-left title">汽运卸车反馈</h2>
  7. </el-col>
  8. <el-col :span="4" class="bg-right">
  9. <el-button
  10. class="bg-bottom"
  11. type="primary"
  12. size="small"
  13. @click="revert()"
  14. >
  15. <img
  16. width="6"
  17. height="10"
  18. style="vertical-align: bottom; margin-right: 3px"
  19. src="../../../public/img/lujing.png"
  20. alt
  21. />返回
  22. </el-button>
  23. </el-col>
  24. </el-row>
  25. <div class="center">
  26. <ws-form ref="deptBudgetList" :model="deptBudgetList" :rules="rules">
  27. <div class="basicInformation">
  28. <div class="small-title" style="font-size: 16px">任务详情</div>
  29. <ws-info-table>
  30. <!-- 任务编号 -->
  31. <ws-form-item label="任务编号" span="1" prop="processNo">{{
  32. deptBudgetList.processNo
  33. }}</ws-form-item>
  34. <!-- 货名 -->
  35. <ws-form-item label="货名" span="1">{{
  36. deptBudgetList.goodsName
  37. }}</ws-form-item>
  38. <!--重量(吨)-->
  39. <ws-form-item
  40. label="重量(吨)"
  41. span="1"
  42. prop="tare"
  43. class="readonly"
  44. >{{ deptBudgetList.weight }}</ws-form-item
  45. >
  46. <!--发货地址-->
  47. <!-- <ws-form-item label="发货地址" span="1" prop="netWeight">
  48. {{ deptBudgetList.sendPrivate }}{{ deptBudgetList.sendCity
  49. }}{{ deptBudgetList.sendArea
  50. }}{{ deptBudgetList.sendDetailedAddress }}
  51. </ws-form-item> -->
  52. <!--发货人-->
  53. <ws-form-item label="发货人" span="1" prop="agent">{{
  54. deptBudgetList.sender
  55. }}</ws-form-item>
  56. <!--发货人电话-->
  57. <ws-form-item label="发货人电话" span="1" prop="agent">{{
  58. deptBudgetList.senderPhone
  59. }}</ws-form-item>
  60. <!--收货地址-->
  61. <!-- <ws-form-item label="收货地址" span="1" prop="netWeight">
  62. {{ deptBudgetList.receivePrivate }}{{ deptBudgetList.receiveCity
  63. }}{{ deptBudgetList.receiveArea
  64. }}{{ deptBudgetList.receiveDetailedAddress }}
  65. </ws-form-item> -->
  66. <!--收货人-->
  67. <ws-form-item label="收货人" span="1" prop="receiver">{{
  68. deptBudgetList.receiver
  69. }}</ws-form-item>
  70. <!--收货人电话-->
  71. <ws-form-item label="收货人电话" span="1" prop="receiverPhone">{{
  72. deptBudgetList.receiverPhone
  73. }}</ws-form-item>
  74. <!--发货日期-->
  75. <ws-form-item
  76. label="发货日期"
  77. span="1"
  78. prop="inOutDate"
  79. class="deliverydate"
  80. >{{ deptBudgetList.deliveryDateStart }}</ws-form-item
  81. >
  82. <!--最晚发货日期-->
  83. <ws-form-item
  84. label="最晚到货日期"
  85. span="1"
  86. prop="inOutDate"
  87. class="deliverydate"
  88. >{{ deptBudgetList.deliveryDateEnd }}</ws-form-item
  89. >
  90. <!--合同编号-->
  91. <ws-form-item label="合同编号" span="1" prop="contractNo">{{
  92. deptBudgetList.contractNo
  93. }}</ws-form-item>
  94. <ws-form-item label="运输方式" span="1" prop="contractNo">{{
  95. deptBudgetList.tranType
  96. }}</ws-form-item>
  97. </ws-info-table>
  98. <div
  99. class="small-title"
  100. style="font-size: 16px; width: 50%; float: left"
  101. >
  102. 卸车详情
  103. </div>
  104. <!-- 导入 -->
  105. <div style="font-size: 16px; width: 100%; text-align: right;display:flex;justify-content:end;">
  106. <!-- <el-upload style="margin-left: 8px;"
  107. class=""
  108. :action="global.uploadPath"
  109. :show-file-list="false"
  110. :on-success="
  111. (res, file) => {
  112. uploadSuccessHandle(res)
  113. }
  114. "
  115. accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel"
  116. >
  117. <el-button type="primary">导入</el-button>
  118. </el-upload> -->
  119. <el-link
  120. href="https://taohaoliang.oss-cn-beijing.aliyuncs.com/pcfiles/%E5%8F%8D%E9%A6%88%E6%A8%A1%E6%9D%BF/%E6%B1%BD%E8%BF%90%E5%8D%B8%E8%BD%A6%E5%8F%8D%E9%A6%88%E6%A8%A1%E6%9D%BF.xlsx"
  121. style="margin-left: 8px;">
  122. <el-button type="primary">模板下载</el-button>
  123. </el-link>
  124. <el-upload
  125. style="margin-left: 8px"
  126. class="upload-demo inline-block margin-right-10"
  127. action=""
  128. :on-change="handleChange"
  129. :show-file-list="false"
  130. accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel"
  131. :auto-upload="false"
  132. >
  133. <el-button type="primary">导入</el-button>
  134. </el-upload>
  135. </div>
  136. <div
  137. class="driver position liaison"
  138. v-for="(item, index) in deptBudgetList.tranCarInfoList"
  139. :key="index"
  140. >
  141. <ws-info-table>
  142. <div class="catNos" v-show="item.temporaryDriverFlag == 0">
  143. 司机-{{ index + 1 }}
  144. <span class="noservice" v-show="item.status == '未装车'">{{
  145. item.status
  146. }}</span>
  147. <span class="service" v-show="item.status == '已装车'">
  148. 未卸车
  149. </span>
  150. <span class="serviced" v-show="item.status == '已送达'">
  151. 已卸车
  152. </span>
  153. </div>
  154. <div
  155. class="catNos catNosCor"
  156. v-show="item.temporaryDriverFlag != 0"
  157. >
  158. 司机-{{ index + 1 }}(临)
  159. </div>
  160. <!--姓名-->
  161. <ws-form-item
  162. label="姓名:"
  163. span="1"
  164. prop="driver"
  165. v-show="item.temporaryDriverFlag == 0"
  166. >
  167. <span v-show="item.temporaryDriverFlag == 0">{{
  168. item.driver
  169. }}</span>
  170. </ws-form-item>
  171. <!-- 姓名 -->
  172. <ws-form-item
  173. label="姓名:"
  174. span="1"
  175. prop="driver"
  176. v-show="item.temporaryDriverFlag != 0"
  177. >
  178. <span v-show="item.temporaryDriverFlag != 0">{{
  179. item.driver
  180. }}</span>
  181. </ws-form-item>
  182. <!-- 电话 -->
  183. <ws-form-item
  184. label="司机电话:"
  185. span="1"
  186. prop="driverPhone"
  187. style="width: 200px"
  188. >
  189. <span v-show="item.temporaryDriverFlag != 0">{{
  190. item.driverPhone
  191. }}</span>
  192. <span v-show="item.temporaryDriverFlag == 0">{{
  193. item.driverPhone
  194. }}</span>
  195. </ws-form-item>
  196. <!--车牌号-->
  197. <ws-form-item label="车牌号:" span="1" prop="carNo">
  198. <span v-show="item.temporaryDriverFlag != 0">{{
  199. item.carNo
  200. }}</span>
  201. <span v-show="item.temporaryDriverFlag == 0">{{
  202. item.carNo
  203. }}</span>
  204. </ws-form-item>
  205. <!--装车净重-->
  206. <ws-form-item
  207. label="装车(吨):"
  208. span="1"
  209. prop="loadNetWeight"
  210. style="width: 150px"
  211. >{{ item.loadNetWeight }}</ws-form-item
  212. >
  213. <!--卸车净重(吨)-->
  214. <ws-form-item
  215. label="卸车净重(吨):"
  216. span="1"
  217. prop="unloadNetWeight"
  218. >
  219. <ws-input
  220. v-if="item.status == '已送达' || item.status == '未装车'"
  221. v-model="item.unloadNetWeight"
  222. placeholder="请输入卸车净重"
  223. maxlength="20"
  224. :disabled="readonly"
  225. size="small"
  226. />
  227. <ws-input
  228. v-else
  229. v-model="item.unloadNetWeight"
  230. placeholder="请输入卸车净重"
  231. maxlength="20"
  232. size="small"
  233. />
  234. </ws-form-item>
  235. <!--扣重(吨)-->
  236. <ws-form-item
  237. label="扣重(吨):"
  238. span="1"
  239. prop="deductionWeight"
  240. >
  241. <ws-input
  242. v-if="item.status == '已送达' || item.status == '未装车'"
  243. v-model="item.deductionWeight"
  244. placeholder="请输入扣重"
  245. maxlength="20"
  246. :disabled="readonly"
  247. size="small"
  248. />
  249. <ws-input
  250. v-else
  251. v-model="item.deductionWeight"
  252. placeholder="请输入扣重"
  253. maxlength="20"
  254. size="small"
  255. />
  256. </ws-form-item>
  257. <!--装车日期-->
  258. <ws-form-item
  259. label="装车日期:"
  260. span="1"
  261. prop="loadingDate"
  262. style="width: 200px"
  263. >{{ item.loadingDate }}</ws-form-item
  264. >
  265. <!--卸车日期-->
  266. <ws-form-item
  267. label="卸车日期:"
  268. span="1"
  269. prop="unloadingDate"
  270. style="width: 340px"
  271. >
  272. <ws-date-picker
  273. v-model="item.unloadingDate"
  274. v-if="item.status == '已送达' || item.status == '未装车'"
  275. :disabled="readonly"
  276. type="date"
  277. value-format="yyyy-MM-dd"
  278. />
  279. <ws-date-picker
  280. v-model="item.unloadingDate"
  281. v-else
  282. type="date"
  283. placeholder="请选择日期"
  284. value-format="yyyy-MM-dd"
  285. />
  286. </ws-form-item>
  287. <!--磅单-->
  288. <ws-form-item label="磅单:" span="1" prop="unloadPoundImg">
  289. <template>
  290. <el-upload
  291. :action="global.uploadPath"
  292. :show-file-list="false"
  293. :on-success="
  294. (res) => {
  295. uploadSuccessHandle1(res, index)
  296. }
  297. "
  298. class="avatar-uploader"
  299. accept=".jpg, .jpeg, .png, .gif"
  300. >
  301. <img
  302. width="18"
  303. height="20"
  304. style="vertical-align: text-top; position: relative"
  305. src="../../../public/img/fujian.png"
  306. alt
  307. />
  308. </el-upload>
  309. <span
  310. v-if="
  311. deptBudgetList.tranCarInfoList[index].unloadPoundImg !=
  312. null
  313. "
  314. >1</span
  315. >
  316. <span
  317. v-if="
  318. deptBudgetList.tranCarInfoList[index].unloadPoundImg ==
  319. null
  320. "
  321. >未上传</span
  322. >
  323. <el-button v-if="deptBudgetList.tranCarInfoList[index].unloadPoundImg !=null"
  324. class="bg-bottom-preview" type="primary" size="small" :data-img="deptBudgetList.tranCarInfoList[index].unloadPoundImg" @click="$imgPreview">
  325. <span style="margin-left: -7px;">预览</span></el-button>
  326. </template>
  327. </ws-form-item>
  328. <!--箱号-->
  329. <ws-form-item label="箱号-1:" span="1" prop="caseNo">
  330. <span>{{ item.caseNo }}</span>
  331. </ws-form-item>
  332. <!--封号-->
  333. <ws-form-item label="封号-1:" span="1" prop="titleNo">
  334. <span>{{ item.titleNo }}</span>
  335. </ws-form-item>
  336. <!--箱号-->
  337. <ws-form-item label="箱号-2:" span="1" prop="caseNoOther">
  338. <span>{{ item.caseNoOther }}</span>
  339. </ws-form-item>
  340. <!--封号-->
  341. <ws-form-item label="封号-2:" span="1" prop="titleNoOther">
  342. <span>{{ item.titleNoOther }}</span>
  343. </ws-form-item>
  344. <!--单价 -->
  345. <ws-form-item label="单价(元/吨):" span="1" v-if="deptBudgetList.priceType!=null&&deptBudgetList.priceType=='随行就市'" prop="contractPrice">
  346. <ws-input
  347. v-model="item.contractPrice"
  348. placeholder="请输入单价"
  349. maxlength="20"
  350. size="small"
  351. />
  352. </ws-form-item>
  353. <div
  354. v-show="
  355. item.temporaryDriverFlag == 0 && item.signStatus == '未签合同'
  356. "
  357. class="signStatus"
  358. >
  359. {{ item.signStatus }}
  360. </div>
  361. <div
  362. v-show="
  363. item.temporaryDriverFlag == 0 && item.signStatus == '已签合同'
  364. "
  365. class="signStatus1"
  366. >
  367. {{ item.signStatus }}
  368. </div>
  369. </ws-info-table>
  370. </div>
  371. </div>
  372. <div style="text-align: right; color: #8890b1; font-size: 16px">
  373. 合计{{ total }}/{{ deptBudgetList.weight }}
  374. <!--阶段状态-->
  375. <span
  376. class="noservice"
  377. v-show="deptBudgetList.receivingStatus == '执行中'"
  378. >
  379. 未完货
  380. </span>
  381. <span
  382. class="service"
  383. v-show="deptBudgetList.receivingStatus == '已完货'"
  384. >{{ deptBudgetList.receivingStatus }}</span
  385. >
  386. </div>
  387. <div style="text-align: right; padding: 10px">
  388. <el-button
  389. class="bg-bottom-up"
  390. type="primary"
  391. size="small"
  392. @click="submit()"
  393. >提交</el-button
  394. >
  395. <el-button
  396. class="bg-bottom"
  397. type="primary"
  398. size="small"
  399. @click="finished(deptBudgetList)"
  400. >完货</el-button
  401. >
  402. </div>
  403. </ws-form>
  404. </div>
  405. </div>
  406. </template>
  407. <script>
  408. import Pagination from '@/components/Pagination'
  409. import WsUpload from '@/components/WsUpload'
  410. import {
  411. seeCat,
  412. packList,
  413. feedback,
  414. getbank,
  415. stateRec,
  416. } from '@/model/transport/index'
  417. // import { dayjs, fmoney, EventBus } from 'base-core-lib'
  418. import { dayjs, EventBus } from 'base-core-lib'
  419. export default {
  420. name: 'viewSpareMoney',
  421. components: {
  422. WsUpload,
  423. Pagination,
  424. },
  425. watch: {
  426. isShow(val) {
  427. this.showType = val
  428. },
  429. },
  430. data() {
  431. return {
  432. // 是否显示
  433. showType: true,
  434. deptBudgetTotal: 0,
  435. currentPage: 1,
  436. pageSize: 10,
  437. searchType: 1,
  438. startDate: null,
  439. endDate: null,
  440. carList: [],
  441. // 提交类型
  442. readonly: true,
  443. appendixIdsAdd: '',
  444. onChange: {},
  445. gradeList: [],
  446. rules: {
  447. netWeight: [
  448. {
  449. required: true,
  450. type: 'number',
  451. message: '请输入活动名称',
  452. trigger: 'blur',
  453. },
  454. ],
  455. },
  456. size: 10,
  457. compId: localStorage.getItem('ws-pf_compId'),
  458. deptCircularPage: {},
  459. packtypeList: {},
  460. date: {
  461. year: dayjs().format('YYYY'),
  462. month: dayjs().format('MM'),
  463. },
  464. contractList: [],
  465. deptBudgetList: {
  466. tranCarInfoList: [
  467. {
  468. unloadPoundImg: '',
  469. },
  470. ],
  471. },
  472. excelFreightspace: [],
  473. historyList: [],
  474. pickerBeginDateBefore: {
  475. disabledDate: (time) => {
  476. return time.getTime() > Date.now()
  477. },
  478. },
  479. accessoryTFs: false,
  480. }
  481. },
  482. activated() {
  483. this.deptBudgetList.id = this.$route.query.id
  484. this.getList()
  485. },
  486. computed: {
  487. total: function () {
  488. var maxStorage = 0
  489. for (var i = 0; i < this.deptBudgetList.tranCarInfoList.length; i++) {
  490. maxStorage += Number(
  491. this.deptBudgetList.tranCarInfoList[i].unloadNetWeight
  492. )
  493. }
  494. return maxStorage.toFixed(2)
  495. },
  496. },
  497. mounted() {
  498. this.deptBudgetList.id = this.$route.query.id
  499. this.getList()
  500. },
  501. methods: {
  502. handleChange(file, fileList) {
  503. this.fileTemp = file.raw
  504. let fileName = file.raw.name
  505. let fileType = fileName.substring(fileName.lastIndexOf('.') + 1)
  506. // 判断上传文件格式
  507. if (this.fileTemp) {
  508. if (fileType == 'xlsx' || fileType == 'xls') {
  509. this.importf(this.fileTemp)
  510. } else {
  511. this.$message({
  512. type: 'warning',
  513. message: '附件格式错误,请删除后重新上传!',
  514. })
  515. }
  516. } else {
  517. this.$message({
  518. type: 'warning',
  519. message: '请上传附件!',
  520. })
  521. }
  522. },
  523. importf(obj) {
  524. this.excelFreightspace = []
  525. this.dialogVisible = true
  526. let _this = this
  527. let inputDOM = this.$refs.inputer // 通过DOM取文件数据
  528. this.file = event.currentTarget.files[0]
  529. var rABS = false //是否将文件读取为二进制字符串
  530. var f = this.file
  531. var reader = new FileReader()
  532. //if (!FileReader.prototype.readAsBinaryString) {
  533. FileReader.prototype.readAsBinaryString = function (f) {
  534. var binary = ''
  535. var rABS = false //是否将文件读取为二进制字符串
  536. var pt = this
  537. var wb //读取完成的数据
  538. var outdata
  539. var reader = new FileReader()
  540. reader.onload = function (e) {
  541. var bytes = new Uint8Array(reader.result)
  542. var length = bytes.byteLength
  543. for (var i = 0; i < length; i++) {
  544. binary += String.fromCharCode(bytes[i])
  545. }
  546. var XLSX = require('xlsx')
  547. if (rABS) {
  548. wb = XLSX.read(btoa(fixdata(binary)), {
  549. //手动转化
  550. type: 'base64',
  551. cellDates: true,
  552. })
  553. } else {
  554. wb = XLSX.read(binary, {
  555. type: 'binary',
  556. })
  557. }
  558. // outdata就是你想要的东西 excel导入的数据
  559. outdata = XLSX.utils.sheet_to_json(wb.Sheets[wb.SheetNames[0]])
  560. // excel 数据再处理
  561. let arr = []
  562. outdata.map((v) => {
  563. // let jsonString = JSON.stringify(v).replace(/\*/g, '').replace(/\s/ig,'');
  564. let jsonString = JSON.stringify(v)
  565. .replace(/\//g, '')
  566. .replace(/\s/gi, '')
  567. console.log(jsonString)
  568. v = JSON.parse(jsonString)
  569. let obj = {}
  570. //xxx代表列名
  571. obj.caseNo = v.箱号
  572. obj.loadNetWeight = v.装车
  573. obj.titleNo = v.封号
  574. obj.driverPhone = v.司机电话
  575. obj.driver = v.司机姓名
  576. obj.unloadNetWeight = v.卸车净重
  577. obj.unloadingDate = v.卸车日期
  578. obj.status = v.状态
  579. obj.carNo = v.车牌号
  580. obj.unloadPoundImg = v.磅单
  581. console.log(obj)
  582. _this.excelFreightspace.push(obj)
  583. })
  584. // _this.freightspace.concat(arr)
  585. let _ispushData = true
  586. console.log(arr, _this.deptBudgetList.tranCarInfoList)
  587. for (let i = 0; i < _this.excelFreightspace.length; i++) {
  588. _ispushData = true
  589. for (let k = 0; k < _this.deptBudgetList.tranCarInfoList.length; k++) {
  590. if (
  591. _this.excelFreightspace[i].driverPhone ==
  592. _this.deptBudgetList.tranCarInfoList[k].driverPhone
  593. ) {
  594. _this.deptBudgetList.tranCarInfoList[k] = _this.excelFreightspace[i]
  595. _ispushData = false
  596. }
  597. }
  598. if (_ispushData) {
  599. _this.deptBudgetList.tranCarInfoList.push(_this.excelFreightspace[i])
  600. _ispushData = true
  601. }
  602. }
  603. _this.$forceUpdate();
  604. }
  605. reader.readAsArrayBuffer(f)
  606. }
  607. if (rABS) {
  608. reader.readAsArrayBuffer(f)
  609. } else {
  610. reader.readAsBinaryString(f)
  611. }
  612. console.log(reader)
  613. },
  614. //返回按钮
  615. revert() {
  616. this.$router.push({ path: 'tranManagementReceivingFeedback' })
  617. },
  618. del(index) {
  619. if (this.deptBudgetList.tranCarInfoList.length > 1) {
  620. this.deptBudgetList.tranCarInfoList.splice(index, 1)
  621. }
  622. },
  623. uploadSuccessHandle1(e, index) {
  624. this.deptBudgetList.tranCarInfoList[index].unloadPoundImg = e.data.url
  625. },
  626. selectwaterContent() {},
  627. //提交按钮
  628. submit() {
  629. for (var i = 0; i < this.freightspace.length; i++) {
  630. if (this.freightspace[i].unloadNetWeight == null) {
  631. this.$message({
  632. message: '卸车净重不能为空!',
  633. type: 'warning',
  634. })
  635. return
  636. }
  637. if (this.deptBudgetList.priceType!=null&&this.deptBudgetList.priceType=='随行就市'&&!this.freightspace[i].contractPrice&&this.freightspace[i].unloadNetWeight>0) {
  638. this.$message({
  639. message: '单价不能为空!',
  640. type: 'warning',
  641. })
  642. return
  643. }
  644. }
  645. this.$confirm(
  646. `所有车辆完成卸车任务后,请及时修改任务状态,确定提交卸车信息?`,
  647. {
  648. cancelButtonText: '取消',
  649. confirmButtonText: '确定',
  650. type: 'warning',
  651. }
  652. )
  653. .then(() => {
  654. this.$refs.deptBudgetList.validate((valid) => {
  655. if (valid) {
  656. // this.tranCarInfoList = this.freightspace
  657. this.tranCarInfoList = this.deptBudgetList.tranCarInfoList
  658. this.tranCarInfoList.driver = this.deptBudgetList.driver
  659. this.tranCarInfoList.driverPhone = this.deptBudgetList.driverPhone
  660. this.tranCarInfoList.carNo = this.deptBudgetList.carNo
  661. this.tranCarInfoList.loadNetWeight =
  662. this.deptBudgetList.loadNetWeight
  663. this.tranCarInfoList.tranType = this.tranType
  664. // this.tranCarInfoList.unloadPoundImg = this.deptBudgetList.tranCarInfoList.unloadPoundImg
  665. console.log(
  666. this.deptBudgetList.tranCarInfoList[0].unloadPoundImg,
  667. '图片'
  668. )
  669. this.tranCarInfoList.unloadNetWeight =
  670. this.deptBudgetList.unloadNetWeight
  671. this.tranCarInfoList.deductionWeight =this.deptBudgetList.deductionWeight
  672. for (var i = 0; i < this.tranCarInfoList.length; i++) {
  673. this.tranCarInfoList[i].id = this.freightspace[i].id
  674. if (this.tranCarInfoList[i].temporaryDriverFlag != 0) {
  675. this.tranCarInfoList[i].temporaryDriverFlag = 1
  676. this.tranCarInfoList[i].tranType = this.tranType
  677. }
  678. }
  679. console.log(this.tranCarInfoList, '12121212')
  680. var tranProcessInfo = {}
  681. tranProcessInfo.flag='1'
  682. tranProcessInfo.id = this.deptBudgetList.id
  683. tranProcessInfo.infoId = this.deptBudgetList.infoId
  684. tranProcessInfo.tranCarInfoList = this.tranCarInfoList
  685. feedback(tranProcessInfo)
  686. .toPromise()
  687. .then((response) => {
  688. this.$message.success('提交成功')
  689. this.deptBudgetList = {}
  690. this.freightspace = {}
  691. this.selectedOptions = ''
  692. this.$router.push({
  693. path: 'tranManagementReceivingFeedback',
  694. })
  695. })
  696. } else {
  697. // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  698. return false
  699. }
  700. })
  701. })
  702. .catch(() => {
  703. return false
  704. })
  705. },
  706. //导入
  707. finished() {
  708. this.$confirm(`完货操作后,卸车信息不可修改,是否确定完货?`, {
  709. confirmButtonText: '确定',
  710. cancelButtonText: '取消',
  711. type: 'warning',
  712. })
  713. .then(() => {
  714. this.$refs.deptBudgetList.validate((valid) => {
  715. if (valid) {
  716. var tranProcessInfo = {}
  717. tranProcessInfo.id = this.deptBudgetList.id
  718. tranProcessInfo.weight = this.total
  719. stateRec(tranProcessInfo)
  720. .toPromise()
  721. .then((response) => {
  722. this.$message.success('完货成功')
  723. this.deptBudgetList = {}
  724. this.freightspace = {}
  725. this.selectedOptions = ''
  726. this.$router.push({
  727. path: 'tranManagementReceivingFeedback',
  728. })
  729. })
  730. } else {
  731. return false
  732. }
  733. })
  734. })
  735. .catch(() => {
  736. return false
  737. })
  738. },
  739. handleClose() {
  740. this.accessoryTFs = false
  741. },
  742. getList() {
  743. seeCat({ id: this.deptBudgetList.id })
  744. .toPromise()
  745. .then((response) => {
  746. this.deptBudgetList = response
  747. if (response.tranCarInfoList) {
  748. this.freightspace = response.tranCarInfoList
  749. }
  750. for (var i = 0; i < this.freightspace.length; i++) {
  751. if (!this.freightspace[i].loadNetWeight) {
  752. this.freightspace[i].loadNetWeight = 0
  753. }
  754. }
  755. })
  756. },
  757. carchange(val, index) {
  758. for (var i = 0; i < this.carList.length; i++) {
  759. if (this.carList[i].driverName == val) {
  760. this.deptBudgetList.tranCarInfoList[index].driverPhone =
  761. this.carList[i].driverPhone
  762. arrange({ id: this.carList[i].id })
  763. .toPromise()
  764. .then((response) => {
  765. this.deptBudgetList.tranCarInfoList[index].carNo =
  766. response.carNumber
  767. if (response.carLoad != null) {
  768. this.deptBudgetList.tranCarInfoList[index].loadWeight =
  769. response.carLoad
  770. } else {
  771. this.deptBudgetList.tranCarInfoList[index].loadWeight = 0
  772. }
  773. this.deptBudgetList.tranCarInfoList[index].carModel =
  774. response.carModel
  775. this.deptBudgetList.tranCarInfoList[index].carLength =
  776. response.carLength
  777. this.deptBudgetList.tranCarInfoList[index].carLengthKey =
  778. response.carLengthKey
  779. this.deptBudgetList.tranCarInfoList[index].carModelKey =
  780. response.carModelKey
  781. })
  782. }
  783. }
  784. },
  785. },
  786. phonechange(val, index) {
  787. for (var i = 0; i < this.carList.length; i++) {
  788. if (this.carList[i].driverPhone == val) {
  789. this.deptBudgetList.tranCarInfoList[index].driver =
  790. this.carList[i].driver
  791. arrange({ id: this.carList[i].id })
  792. .toPromise()
  793. .then((response) => {
  794. this.deptBudgetList.tranCarInfoList[index].carNo =
  795. response.carNumber
  796. if (response.carLoad != null) {
  797. this.deptBudgetList.tranCarInfoList[index].loadWeight =
  798. response.carLoad
  799. } else {
  800. this.deptBudgetList.tranCarInfoList[index].loadWeight = 0
  801. }
  802. this.deptBudgetList.tranCarInfoList[index].carModel =
  803. response.carModel
  804. this.deptBudgetList.tranCarInfoList[index].carLength =
  805. response.carLength
  806. this.deptBudgetList.tranCarInfoList[index].carLengthKey =
  807. response.carLengthKey
  808. this.deptBudgetList.tranCarInfoList[index].carModelKey =
  809. response.carModelKey
  810. })
  811. }
  812. }
  813. },
  814. selecttaskType(e) {
  815. for (var i = 0; i < this.taskTypeList.length; i++) {
  816. if (this.taskTypeList[i].value == e) {
  817. this.searchType = this.taskTypeList[i].type
  818. }
  819. }
  820. },
  821. }
  822. </script>
  823. <style lang="scss" scoped>
  824. /deep/.basicInformation {
  825. .ws-info-table {
  826. border: none;
  827. }
  828. .el-form-item {
  829. width: 33.3333%;
  830. border: none;
  831. height: 50px;
  832. .el-form-item__label {
  833. background: transparent;
  834. border: none;
  835. }
  836. .el-form-item__content {
  837. border: none;
  838. }
  839. }
  840. }
  841. .title {
  842. position: relative;
  843. padding-left: 10px;
  844. }
  845. .title::before {
  846. content: '';
  847. display: inline-block;
  848. width: 5px;
  849. height: 30px;
  850. background: #5473e8;
  851. position: absolute;
  852. left: 0;
  853. }
  854. .el-form {
  855. padding: 42px 5%;
  856. }
  857. .el-button--primary {
  858. background-color: #5878e8;
  859. border-color: #5878e8;
  860. }
  861. .el-col {
  862. background: #f6f7fc;
  863. }
  864. .bg-right {
  865. text-align: right;
  866. padding: 16px 20px;
  867. }
  868. .center {
  869. width: 90%;
  870. margin: 0 auto;
  871. }
  872. //表格文字
  873. /deep/.ws-info-table .el-form-item .el-form-item__label {
  874. text-align: left;
  875. font-size: 13px;
  876. font-weight: 400;
  877. color: #8890b1;
  878. line-height: 16px;
  879. }
  880. //蓝标
  881. .small-title {
  882. position: relative;
  883. padding: 10px;
  884. font-weight: 600;
  885. }
  886. .small-title::before {
  887. position: absolute;
  888. content: '';
  889. display: block;
  890. background: #5473e8;
  891. width: 4px;
  892. height: 14px;
  893. left: 0px;
  894. top: 13px;
  895. padding: 4px 2px;
  896. }
  897. .position {
  898. position: relative;
  899. }
  900. .position .zaizhong {
  901. width: 16%;
  902. }
  903. //减号
  904. .del {
  905. position: absolute;
  906. // right: -38px;
  907. top: 9px;
  908. cursor: pointer;
  909. right: 0;
  910. display: inline-block;
  911. font-size: 20px;
  912. width: 20px;
  913. height: 10px;
  914. line-height: 0px;
  915. }
  916. .driver .el-form-item {
  917. width: 16.63%;
  918. }
  919. /deep/.ws-info-table .el-form-item .el-form-item__content {
  920. background: #f5f7fa;
  921. border-radius: 4px;
  922. color: #8890b1;
  923. font-size: 14px;
  924. font-weight: 400;
  925. }
  926. /deep/.driver .ws-info-table .el-form-item .el-form-item__label {
  927. width: 72px;
  928. }
  929. /deep/.liaison .ws-info-table .el-form-item {
  930. width: 15.66%;
  931. color: #8890b1;
  932. font-size: 14px;
  933. }
  934. /deep/.ws-info-table .el-form-item {
  935. border: none;
  936. height: 50px;
  937. }
  938. /deep/.liaison .ws-info-table .el-form-item .el-form-item__label {
  939. width: 53.46%;
  940. border: 0px solid #d8dce6;
  941. background: #f5f7fa;
  942. text-align: center;
  943. }
  944. /deep/.liaison {
  945. background: #f5f7fa;
  946. border-radius: 4px;
  947. border: 0px solid #d8dce6;
  948. }
  949. /deep/.liaison .ws-info-table .el-form-item .el-form-item__content {
  950. border: none;
  951. background: #f5f7fa;
  952. }
  953. .catNos {
  954. width: 100%;
  955. height: 30px;
  956. margin-top: 10px;
  957. margin-left: 20px;
  958. font-size: 14px;
  959. }
  960. /deep/.liaison .ws-info-table .el-form-item .el-form-item__content {
  961. // border: 0px solid #d8dce6;
  962. border-radius: 0px;
  963. border-left: none;
  964. border-bottom: none;
  965. border-top: none;
  966. }
  967. /deep/.liaison .ws-info-table {
  968. background: #f6f7fc;
  969. border-radius: 4px;
  970. border: 1px solid #d8dce6;
  971. margin-top: 20px;
  972. }
  973. //送达/未送达
  974. .noservice,
  975. .service,.serviced {
  976. display: inline-block;
  977. border-radius: 4px;
  978. border: 1px solid #d8dce6;
  979. padding: 2px;
  980. font-size: 12px;
  981. }
  982. .noservice {
  983. background: #c4cada;
  984. color: #ffffff;
  985. }
  986. .service {
  987. background: #e5f1f7;
  988. color: #50cad4;
  989. }
  990. .serviced {
  991. background: #e5f1f7;
  992. color: #5473E8;
  993. }
  994. //添加司机
  995. .add {
  996. width: 100px;
  997. height: 34px;
  998. background: #f6f7fb;
  999. border-radius: 17px;
  1000. color: #5473e8;
  1001. font-size: 14px;
  1002. border: none;
  1003. }
  1004. .add img {
  1005. display: inline-block;
  1006. margin-top: 3px;
  1007. margin-left: -12px;
  1008. }
  1009. .add .spans {
  1010. display: table-caption;
  1011. width: 56px;
  1012. height: 20px;
  1013. line-height: 18px;
  1014. }
  1015. .container {
  1016. overflow: scroll;
  1017. height: 93vh;
  1018. }
  1019. .line {
  1020. height: 26px;
  1021. margin-top: 6px;
  1022. left: 2px;
  1023. margin: 0 auto;
  1024. }
  1025. .signStatus {
  1026. height: 25px;
  1027. border-radius: 3px;
  1028. border: 1px solid #5473e8;
  1029. padding: 0 3px;
  1030. margin-left: 30px;
  1031. color: #ffffff;
  1032. background: #c4cada;
  1033. line-height: 24px;
  1034. }
  1035. .signStatus1 {
  1036. height: 25px;
  1037. background: #e6ebff;
  1038. border-radius: 3px;
  1039. border: 1px solid #5473e8;
  1040. padding: 0 3px;
  1041. margin-left: 30px;
  1042. color: #5473e8;
  1043. line-height: 24px;
  1044. }
  1045. /deep/.ws-info-table.el-form-item .el-form-item__label {
  1046. // background-color: #eee;
  1047. // padding-right: 8px;
  1048. // padding-left: 8px;
  1049. font-size: 13px;
  1050. font-weight: bold;
  1051. // color: #333;
  1052. // overflow: hidden;
  1053. // height: 40px;
  1054. /* text-overflow: ellipsis; */
  1055. // white-space: nowrap;
  1056. // width: 120px;
  1057. // line-height: 40px;
  1058. }
  1059. .bg-bottom-preview{
  1060. margin: 0 8px;
  1061. }
  1062. </style>