tranManagementReceivingloading.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680
  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. ><img
  15. width="6"
  16. height="10"
  17. style="vertical-align: bottom; margin-right: 3px"
  18. src="../../../public/img/lujing.png"
  19. alt=""
  20. />返回</el-button
  21. >
  22. </el-col>
  23. </el-row>
  24. <div class="center">
  25. <ws-form ref="deptBudgetList" :model="deptBudgetList" :rules="rules">
  26. <div class="basicInformation">
  27. <div class="small-title" style="font-size: 16px">任务详情</div>
  28. <ws-info-table>
  29. <!-- 任务编号 -->
  30. <ws-form-item label="任务编号" span="1" prop="processNo">
  31. {{ deptBudgetList.processNo }}
  32. </ws-form-item>
  33. <!-- 货名 -->
  34. <ws-form-item label="货名" span="1">
  35. {{ deptBudgetList.goodsName }}
  36. </ws-form-item>
  37. <!--重量(吨)-->
  38. <ws-form-item
  39. label="重量(吨)"
  40. span="1"
  41. prop="tare"
  42. class="readonly"
  43. >
  44. {{ deptBudgetList.weight }}
  45. </ws-form-item>
  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. >
  81. {{ deptBudgetList.deliveryDateStart }}
  82. </ws-form-item>
  83. <!--最晚发货日期-->
  84. <ws-form-item
  85. label="最晚发货日期"
  86. span="1"
  87. prop="inOutDate"
  88. class="deliverydate"
  89. >
  90. {{ deptBudgetList.deliveryDateEnd }}
  91. </ws-form-item>
  92. <!--合同编号-->
  93. <ws-form-item label="合同编号" span="1" prop="contractNo">
  94. {{ deptBudgetList.contractNo }}
  95. </ws-form-item>
  96. <ws-form-item label="运输方式" span="1" prop="contractNo">
  97. {{ deptBudgetList.contractNo }}
  98. </ws-form-item>
  99. </ws-info-table>
  100. <div class="small-title" style="font-size: 16px">卸车详情</div>
  101. <div
  102. class="driver position liaison"
  103. v-for="(item, index) in deptBudgetList.tranCarInfoList"
  104. >
  105. <ws-info-table>
  106. <div class="catNos" v-show="item.temporaryDriverFlag == 0">司机-{{index+1}}</div>
  107. <div class="catNos catNosCor" v-show="item.temporaryDriverFlag != 0">司机-{{index+1}}(临)</div>
  108. <!--姓名-->
  109. <ws-form-item
  110. label="姓名:"
  111. span="1"
  112. prop="driver"
  113. >
  114. <span v-show="item.temporaryDriverFlag == 0"
  115. >
  116. {{ item.driver }}
  117. </span>
  118. </ws-form-item>
  119. <!--电话-->
  120. <ws-form-item label="电话:" span="1" prop="driverPhone">
  121. <!-- <ws-input
  122. v-show="item.temporaryDriverFlag != 0"
  123. v-model="item.driverPhone"
  124. maxlength="20"
  125. size="small"
  126. /> -->
  127. <span v-show="item.temporaryDriverFlag == 0"
  128. >{{ item.driverPhone }}
  129. </span>
  130. </ws-form-item>
  131. <!--车牌号-->
  132. <ws-form-item label="车牌号:" span="1" prop="carNo">
  133. <!-- <ws-input
  134. v-show="item.temporaryDriverFlag != 0"
  135. v-model="item.carNo"
  136. maxlength="20"
  137. size="small"
  138. /> -->
  139. <span v-show="item.temporaryDriverFlag == 0"
  140. >{{ item.carNo }}
  141. </span>
  142. </ws-form-item>
  143. <!--装车净重-->
  144. <ws-form-item label="装车(吨):" span="1" prop="loadNetWeight">
  145. <!-- <ws-input
  146. v-model="item.loadNetWeight"
  147. placeholder="请输入装车(吨)"
  148. maxlength="20"
  149. size="small"
  150. /> -->
  151. {{item.loadNetWeight}}
  152. </ws-form-item>
  153. <!--卸车净重(吨)-->
  154. <ws-form-item label="卸车净重(吨):" span="1" prop="unloadNetWeight">
  155. <ws-input
  156. v-model="item.unloadNetWeight"
  157. placeholder="请输入卸车净重"
  158. maxlength="20"
  159. size="small"
  160. />
  161. </ws-form-item>
  162. <!--磅单-->
  163. <ws-form-item label="磅单:" span="1" prop="loadPoundImg">
  164. <template slot-scope="scope">
  165. <img
  166. width="18"
  167. height="20"
  168. style="
  169. vertical-align: text-top;
  170. position: relative;
  171. top: -1px;
  172. "
  173. src="../../../public/img/fujian.png"
  174. @click="fujian(scope.row)"
  175. alt=""
  176. />
  177. <span v-if="scope.row.loadPoundImgArray.length >0">{{scope.row.loadPoundImgArray.length}}</span>
  178. <!-- <div v-show="item.temporaryDriverFlag == 0">
  179. {{ item.signStatus }}
  180. </div> -->
  181. </template>
  182. </ws-form-item>
  183. </ws-info-table>
  184. <!-- <span
  185. v-show="!item.temporaryDriverFlag"
  186. width="22"
  187. height="22"
  188. class="del"
  189. @click="del(index)"
  190. src="../../../public/img/del.png"
  191. alt=""
  192. >×</span
  193. > -->
  194. </div>
  195. <div style="text-align: right; color: #8890b1; font-size: 16px">
  196. 合计{{ total }}/{{ deptBudgetList.weight }}
  197. </div>
  198. <!-- <el-button class="add" type="primary" size="small" @click="add()">
  199. <img
  200. width="22"
  201. height="22"
  202. @click="add"
  203. src="../../../public/img/add.png"
  204. alt=""
  205. />
  206. <div class="spans">添加司机</div>
  207. </el-button
  208. > -->
  209. <div style="text-align: right; padding: 10px">
  210. <el-button
  211. class="bg-bottom-up"
  212. type="primary"
  213. size="small"
  214. @click="submit()"
  215. >提交</el-button
  216. >
  217. </div>
  218. </div>
  219. </ws-form>
  220. </div>
  221. </div>
  222. </template>
  223. <script>
  224. import Pagination from '@/components/Pagination'
  225. import WsUpload from '@/components/WsUpload'
  226. import {
  227. seeCat,
  228. packList,
  229. feedback
  230. } from '@/model/transport/index'
  231. // import { dayjs, fmoney, EventBus } from 'base-core-lib'
  232. import { dayjs, EventBus } from 'base-core-lib'
  233. export default {
  234. name: 'viewSpareMoney',
  235. components: {
  236. WsUpload,
  237. Pagination,
  238. },
  239. watch: {
  240. // vesselId(val) {
  241. // this.getList()
  242. // },
  243. isShow(val) {
  244. this.showType = val
  245. },
  246. },
  247. data() {
  248. return {
  249. // 是否显示
  250. showType: true,
  251. deptBudgetTotal: 0,
  252. currentPage: 1,
  253. pageSize: 10,
  254. searchType: 1,
  255. startDate: null,
  256. endDate: null,
  257. carList: [],
  258. // 提交类型
  259. readonly: true,
  260. appendixIdsAdd: '',
  261. onChange: {},
  262. gradeList: [],
  263. rules: {
  264. netWeight: [
  265. {
  266. required: true,
  267. type: 'number',
  268. message: '请输入活动名称',
  269. trigger: 'blur',
  270. },
  271. ],
  272. },
  273. size: 10,
  274. compId: sessionStorage.getItem('ws-pf_compId'),
  275. deptCircularPage: {},
  276. packtypeList: {},
  277. date: {
  278. year: dayjs().format('YYYY'),
  279. month: dayjs().format('MM'),
  280. },
  281. contractList: [],
  282. deptBudgetList: {
  283. tranCarInfoList: [],
  284. },
  285. historyList: [],
  286. pickerBeginDateBefore: {
  287. disabledDate: (time) => {
  288. return time.getTime() > Date.now()
  289. },
  290. },
  291. accessoryTFs: false,
  292. }
  293. },
  294. activated() {
  295. this.getList()
  296. },
  297. computed: {
  298. total: function () {
  299. var maxStorage = 0
  300. for (var i = 0; i < this.deptBudgetList.tranCarInfoList.length; i++) {
  301. maxStorage += Number(this.deptBudgetList.tranCarInfoList[i].loadWeight)
  302. }
  303. return maxStorage
  304. },
  305. },
  306. mounted() {
  307. this.deptBudgetList.id = this.$route.query.id
  308. this.getList()
  309. },
  310. methods: {
  311. //返回按钮
  312. revert() {
  313. this.$router.push({ path: 'tranManagementReceivingFeedback' })
  314. },
  315. del(index) {
  316. if (this.deptBudgetList.tranCarInfoList.length > 1) {
  317. this.deptBudgetList.tranCarInfoList.splice(index, 1)
  318. }
  319. },
  320. fujian(row){
  321. if (row.loadPoundImg === null || row.loadPoundImg ==='') {
  322. EventBus.$emit(
  323. 'warning',
  324. this.$t('system.noticeCircular.NoInformation')
  325. )
  326. }else{
  327. this.accessoryTFs = true
  328. }
  329. },
  330. selectwaterContent() {},
  331. //提交按钮
  332. submit() {
  333. for(var i = 0 ; i < this.freightspace.length ; i++){
  334. if(this.freightspace[i].unloadNetWeight==null){
  335. this.$message({
  336. message:"卸重不能为空!",
  337. type: "warning"
  338. })
  339. return
  340. }
  341. }
  342. this.$confirm(`所有车辆完成卸车任务后,请及时修改任务状态,确定提交卸车信息?`, {
  343. cancelButtonText: '取消',
  344. confirmButtonText: '确定',
  345. type: 'warning',
  346. })
  347. .then(() => {
  348. this.$refs.deptBudgetList.validate((valid) => {
  349. if (valid) {
  350. // this.deptBudgetList.totalStorage = this.totalStorage
  351. this.tranCarInfoList = this.freightspace
  352. this.tranCarInfoList.driver = this.deptBudgetList.driver
  353. this.tranCarInfoList.driverPhone = this.deptBudgetList.driverPhone
  354. this.tranCarInfoList.carNo = this.deptBudgetList.carNo
  355. this.tranCarInfoList.loadNetWeight =
  356. this.deptBudgetList.loadNetWeight
  357. this.tranCarInfoList.tranType = this.tranType
  358. this.tranCarInfoList.loadPoundImg =
  359. this.deptBudgetList.loadPoundImg
  360. // this.tranCarInfoList.boxNo = this.arr.toString()
  361. for (var i = 0; i < this.tranCarInfoList.length; i++) {
  362. this.tranCarInfoList[i].id = this.freightspace[i].id
  363. if (this.tranCarInfoList[i].temporaryDriverFlag != 0) {
  364. this.tranCarInfoList[i].temporaryDriverFlag = 1
  365. this.tranCarInfoList[i].tranType = this.tranType
  366. }
  367. }
  368. var tranProcessInfo = {}
  369. tranProcessInfo.id = this.deptBudgetList.id
  370. tranProcessInfo.infoId = this.deptBudgetList.infoId
  371. tranProcessInfo.tranCarInfoList = this.tranCarInfoList
  372. // dispatchCat({tranCarInfo:{tranCarInfoList:[this.tranCarInfoList],id:this.deptBudgetList.id}
  373. feedback(tranProcessInfo)
  374. .toPromise()
  375. .then((response) => {
  376. this.$message.success('提交成功')
  377. this.deptBudgetList = {}
  378. this.freightspace = {}
  379. this.selectedOptions = ''
  380. this.$router.push({
  381. path: 'tranManagementReceivingFeedback',
  382. })
  383. })
  384. } else {
  385. // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  386. return false
  387. }
  388. })
  389. })
  390. .catch(() => {
  391. return false
  392. })
  393. },
  394. handleClose() {
  395. this.accessoryTFs = false
  396. },
  397. getList() {
  398. seeCat({ id: this.deptBudgetList.id })
  399. .toPromise()
  400. .then((response) => {
  401. this.deptBudgetList = response
  402. // this.deptBudgetList.tranCarInfoList = response.tranCarInfoList
  403. this.freightspace = response.tranCarInfoList
  404. for (var i = 0; i < this.freightspace.length; i++) {
  405. if (!this.freightspace[i].loadNetWeight) {
  406. this.freightspace[i].loadNetWeight = 0
  407. }
  408. }
  409. })
  410. },
  411. carchange(val, index) {
  412. for (var i = 0; i < this.carList.length; i++) {
  413. if (this.carList[i].driverName == val) {
  414. this.deptBudgetList.tranCarInfoList[index].driverPhone =
  415. this.carList[i].driverPhone
  416. arrange({ id: this.carList[i].id })
  417. .toPromise()
  418. .then((response) => {
  419. console.log(this, response)
  420. this.deptBudgetList.tranCarInfoList[index].carNo =
  421. response.carNumber
  422. if (response.carLoad != null) {
  423. this.deptBudgetList.tranCarInfoList[index].loadWeight =
  424. response.carLoad
  425. } else {
  426. this.deptBudgetList.tranCarInfoList[index].loadWeight = 0
  427. }
  428. this.deptBudgetList.tranCarInfoList[index].carModel =
  429. response.carModel
  430. this.deptBudgetList.tranCarInfoList[index].carLength =
  431. response.carLength
  432. this.deptBudgetList.tranCarInfoList[index].carLengthKey =
  433. response.carLengthKey
  434. this.deptBudgetList.tranCarInfoList[index].carModelKey =
  435. response.carModelKey
  436. })
  437. }
  438. }
  439. }
  440. },
  441. phonechange(val, index) {
  442. for (var i = 0; i < this.carList.length; i++) {
  443. if (this.carList[i].driverPhone == val) {
  444. this.deptBudgetList.tranCarInfoList[index].driver =
  445. this.carList[i].driver
  446. arrange({ id: this.carList[i].id })
  447. .toPromise()
  448. .then((response) => {
  449. console.log(this, response)
  450. this.deptBudgetList.tranCarInfoList[index].carNo =
  451. response.carNumber
  452. if (response.carLoad != null) {
  453. this.deptBudgetList.tranCarInfoList[index].loadWeight =
  454. response.carLoad
  455. } else {
  456. this.deptBudgetList.tranCarInfoList[index].loadWeight = 0
  457. }
  458. this.deptBudgetList.tranCarInfoList[index].carModel =
  459. response.carModel
  460. this.deptBudgetList.tranCarInfoList[index].carLength =
  461. response.carLength
  462. this.deptBudgetList.tranCarInfoList[index].carLengthKey =
  463. response.carLengthKey
  464. this.deptBudgetList.tranCarInfoList[index].carModelKey =
  465. response.carModelKey
  466. })
  467. }
  468. }
  469. },
  470. selecttaskType(e) {
  471. for (var i = 0; i < this.taskTypeList.length; i++) {
  472. if (this.taskTypeList[i].value == e) {
  473. this.searchType = this.taskTypeList[i].type
  474. }
  475. }
  476. },
  477. approve() {},
  478. listQuery() {},
  479. }
  480. </script>
  481. <style lang="scss" scoped>
  482. /deep/.basicInformation {
  483. .ws-info-table {
  484. border: none;
  485. }
  486. .el-form-item {
  487. width: 33.3333%;
  488. border: none;
  489. height: 50px;
  490. .el-form-item__label {
  491. background: transparent;
  492. border: none;
  493. }
  494. .el-form-item__content {
  495. border: none;
  496. }
  497. }
  498. }
  499. .title {
  500. position: relative;
  501. padding-left: 10px;
  502. }
  503. .title::before {
  504. content: '';
  505. display: inline-block;
  506. width: 5px;
  507. height: 30px;
  508. background: #5473e8;
  509. position: absolute;
  510. left: 0;
  511. }
  512. .el-form {
  513. padding: 0 10%;
  514. }
  515. .el-button--primary {
  516. background-color: #5878e8;
  517. border-color: #5878e8;
  518. }
  519. .el-col {
  520. background: #f6f7fc;
  521. }
  522. .bg-right {
  523. text-align: right;
  524. padding: 16px 20px;
  525. }
  526. .center {
  527. width: 90%;
  528. margin: 0 auto;
  529. }
  530. //表格文字
  531. /deep/.ws-info-table .el-form-item .el-form-item__label {
  532. text-align: left;
  533. font-size: 14px;
  534. font-weight: 400;
  535. color: #8890b1;
  536. line-height: 16px;
  537. }
  538. //蓝标
  539. .small-title {
  540. position: relative;
  541. padding: 10px;
  542. font-weight: 600;
  543. }
  544. .small-title::before {
  545. position: absolute;
  546. content: '';
  547. display: block;
  548. background: #5473e8;
  549. width: 4px;
  550. height: 14px;
  551. left: 0px;
  552. top: 13px;
  553. padding: 4px 2px;
  554. }
  555. .position {
  556. position: relative;
  557. }
  558. .position .zaizhong {
  559. width: 16%;
  560. }
  561. //减号
  562. .del {
  563. position: absolute;
  564. // right: -38px;
  565. top: 9px;
  566. cursor: pointer;
  567. right: 0;
  568. display: inline-block;
  569. font-size: 20px;
  570. width: 20px;
  571. height: 10px;
  572. line-height: 0px;
  573. }
  574. .driver .el-form-item {
  575. width: 16.63%;
  576. }
  577. /deep/.ws-info-table .el-form-item .el-form-item__content {
  578. background: #f5f7fa;
  579. border-radius: 4px;
  580. color: #8890b1;
  581. font-size: 14px;
  582. }
  583. /deep/.driver .ws-info-table .el-form-item .el-form-item__label {
  584. width: 72px;
  585. }
  586. /deep/.liaison .ws-info-table .el-form-item {
  587. width: 16.66%;
  588. color: #8890b1;
  589. font-size: 14px;
  590. }
  591. /deep/.ws-info-table .el-form-item {
  592. border: none;
  593. height: 50px;
  594. }
  595. /deep/.liaison .ws-info-table .el-form-item .el-form-item__label {
  596. width: 40%;
  597. border: 0px solid #d8dce6;
  598. background: #f5f7fa;
  599. text-align: center;
  600. }
  601. /deep/.liaison {
  602. background: #f5f7fa;
  603. border-radius: 4px;
  604. border: 0px solid #d8dce6;
  605. }
  606. /deep/.liaison .ws-info-table .el-form-item .el-form-item__content {
  607. border: none;
  608. background: #f5f7fa;
  609. }
  610. .catNos {
  611. width: 100%;
  612. height: 30px;
  613. margin-top: 10px;
  614. margin-left: 20px;
  615. font-size: 14px;
  616. }
  617. /deep/.liaison .ws-info-table .el-form-item .el-form-item__content {
  618. // border: 0px solid #d8dce6;
  619. border-radius: 0px;
  620. border-left: none;
  621. border-bottom: none;
  622. border-top: none;
  623. }
  624. /deep/.liaison .ws-info-table{
  625. background: #F6F7FC;
  626. border-radius: 4px;
  627. border: 1px solid #D8DCE6;
  628. margin-top: 20px;
  629. }
  630. //送达/未送达
  631. .noservice,
  632. .service {
  633. display: inline-block;
  634. border-radius: 4px;
  635. border: 1px solid #d8dce6;
  636. padding: 2px;
  637. font-size: 12px;
  638. }
  639. .noservice {
  640. background: #c4cada;
  641. color: #ffffff;
  642. }
  643. .service {
  644. background: #e5f1f7;
  645. color: #50cad4;
  646. }
  647. //添加司机
  648. .add {
  649. width: 100px;
  650. height: 34px;
  651. background: #f6f7fb;
  652. border-radius: 17px;
  653. color: #5473e8;
  654. font-size: 14px;
  655. border: none;
  656. }
  657. .add img {
  658. display: inline-block;
  659. margin-top: 3px;
  660. margin-left: -12px;
  661. }
  662. .add .spans {
  663. display: table-caption;
  664. width: 56px;
  665. height: 20px;
  666. line-height: 18px;
  667. }
  668. </style>