tranManagementReceivingloading.vue 19 KB

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