tranManagementReceivingloading.vue 18 KB

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