tranManagementReceivingloading.vue 20 KB

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