index.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868
  1. <template>
  2. <div class="my-container">
  3. <div class="bill-main" v-show="isShow==='home'" key="index">
  4. <module-view :propConfig="config" ref="moduleView" @pagination="getDataList" @search="getDataList"
  5. @resert="onRefresh" @onRefresh="onRefresh" @detail="openEdit">
  6. </module-view>
  7. </div>
  8. <!-- 新增/编辑弹窗 -->
  9. <div class="detail" v-show="isShow==='detail'" key="index2">
  10. <by-tool :propConfig="toolConfig" @clickHandle="insideTools" />
  11. <div class="box-shadow">
  12. <by-form :propConfig="detailConfig" ref="addFormId"></by-form>
  13. <by-table :propConfig="tableConfig" ref="table"></by-table>
  14. </div>
  15. </div>
  16. </div>
  17. </template>
  18. <script lang="ts">
  19. import { Component, Prop, Vue, Watch } from "vue-property-decorator";
  20. import { getShortBargePageData, getShortBargeSingleData } from '@/api/delivery';
  21. import Logistics from "@/components/Assembly/logistics.vue";
  22. import Logistics2 from "@/components/Assembly/logistics2.vue";
  23. import storeHouse from "@/components/Assembly/storeHouse.vue";
  24. @Component
  25. export default class myShortBarge extends Vue {
  26. timeNum = 0;
  27. calculateCount = 0;
  28. isShow : any = 'home'
  29. timer : any = null
  30. toolConfig = {
  31. tools: {
  32. return: true,
  33. },
  34. }
  35. config : any = {
  36. attr: {
  37. calculateH: true
  38. },
  39. search: {
  40. attr: {
  41. size: 'mini',
  42. },
  43. columns: [
  44. [{
  45. span: 6,
  46. label: '短驳单单号',
  47. prop: 'shortBargeCode',
  48. component: 'by-input',
  49. compConfig: {
  50. attr: {
  51. placeholder: '请输入短驳单单号',
  52. clearable: true
  53. },
  54. },
  55. }]
  56. ]
  57. },
  58. tool: {
  59. tools: {
  60. search: true,
  61. refresh: true
  62. }
  63. },
  64. table: {
  65. attr: {
  66. size: 'mini',
  67. align: 'left',
  68. },
  69. columns: [{
  70. title: '短驳单单号',
  71. field: 'shortBargeCode',
  72. width: 200,
  73. isDetail: true,
  74. fixed: 'left'
  75. },
  76. // {
  77. // width: 200,
  78. // title: 'WMS仓库编号',
  79. // field: 'wmsWarehouseCode',
  80. // },
  81. {
  82. width: 200,
  83. title: 'ERP单据类型',
  84. field: 'wmsSendType',
  85. component: Logistics,
  86. },
  87. {
  88. width: 200,
  89. title: 'TMS平台业务单号',
  90. field: 'tmsClientOrderNo',
  91. },
  92. {
  93. width: 200,
  94. title: '发货单状态',
  95. field: 'tmsOrderStatus',
  96. component: Logistics,
  97. },
  98. {
  99. width: 200,
  100. title: '开单时间',
  101. field: 'tmsBillingDate',
  102. },
  103. {
  104. width: 200,
  105. title: '业务员',
  106. field: 'tmsBusinessMan',
  107. },
  108. {
  109. width: 200,
  110. title: '业务员手机号',
  111. field: 'tmsBusinessPhone',
  112. },
  113. {
  114. width: 200,
  115. title: '运输方式',
  116. field: 'tmsTransportMethod',
  117. },
  118. {
  119. width: 200,
  120. title: '发货单位',
  121. field: 'tmsShipmentCompanyName',
  122. },
  123. {
  124. width: 200,
  125. title: '发货省',
  126. field: 'tmsShipmentProvince',
  127. },
  128. // {
  129. // width: 200,
  130. // title: '发货省编码',
  131. // field: 'tmsShipmentProvinceNo',
  132. // },
  133. {
  134. width: 200,
  135. title: '发货市',
  136. field: 'tmsShipmentCity',
  137. },
  138. // {
  139. // width: 200,
  140. // title: '发货市编码',
  141. // field: 'tmsShipmentCityNo',
  142. // },
  143. {
  144. width: 200,
  145. title: '发货区(县)',
  146. field: 'tmsShipmentRegion',
  147. },
  148. // {
  149. // width: 200,
  150. // title: '发货区(县)编码',
  151. // field: 'tmsShipmentRegionNo',
  152. // },
  153. {
  154. width: 200,
  155. title: '发货街道',
  156. field: 'tmsShipmentStreet',
  157. },
  158. // {
  159. // width: 200,
  160. // title: '发货街道编码',
  161. // field: 'tmsShipmentStreetNo',
  162. // },
  163. {
  164. width: 200,
  165. title: '发货地址',
  166. field: 'tmsShipmentAddress',
  167. },
  168. {
  169. width: 200,
  170. title: '发货人',
  171. field: 'tmsShipmentConsignor',
  172. },
  173. {
  174. width: 200,
  175. title: '发货人联系方式',
  176. field: 'tmsShipmentContacts',
  177. },
  178. {
  179. width: 200,
  180. title: '发货点经度',
  181. field: 'tmsShipmentLng',
  182. },
  183. {
  184. width: 200,
  185. title: '发货点纬度',
  186. field: 'tmsShipmentLat',
  187. },
  188. {
  189. width: 200,
  190. title: '收货单位',
  191. field: 'tmsUnloadingCompanyName',
  192. },
  193. {
  194. width: 200,
  195. title: '收货省',
  196. field: 'tmsUnloadingProvince',
  197. },
  198. // {
  199. // width: 200,
  200. // title: '收货省编码',
  201. // field: 'tmsUnloadingProvinceNo',
  202. // },
  203. {
  204. width: 200,
  205. title: '收货市',
  206. field: 'tmsUnloadingCity',
  207. },
  208. // {
  209. // width: 200,
  210. // title: '收货市编码',
  211. // field: 'tmsUnloadingCityNo',
  212. // },
  213. {
  214. width: 200,
  215. title: '收货区(县)',
  216. field: 'tmsUnloadingRegion',
  217. },
  218. // {
  219. // width: 200,
  220. // title: '收货区(县)编码',
  221. // field: 'tmsUnloadingRegionNo',
  222. // },
  223. {
  224. width: 200,
  225. title: '收货街道',
  226. field: 'tmsUnloadingStreet',
  227. },
  228. // {
  229. // width: 200,
  230. // title: '收货街道编码',
  231. // field: 'tmsUnloadingStreetNo',
  232. // },
  233. {
  234. width: 200,
  235. title: '收货地址',
  236. field: 'tmsUnloadingAddress',
  237. },
  238. {
  239. width: 200,
  240. title: '收货人',
  241. field: 'tmsUnloadingConsignor',
  242. },
  243. {
  244. width: 200,
  245. title: '收货人联系方式',
  246. field: 'tmsUnloadingContacts',
  247. },
  248. {
  249. width: 200,
  250. title: '收货点经度',
  251. field: 'tmsUnloadingLng',
  252. },
  253. {
  254. width: 200,
  255. title: '收货点纬度',
  256. field: 'tmsUnloadingLat',
  257. },
  258. {
  259. width: 200,
  260. title: '要求提货时间',
  261. field: 'tmsDeliveryDate',
  262. },
  263. {
  264. width: 200,
  265. title: '要求送达时间',
  266. field: 'tmsArrivalDate',
  267. },
  268. {
  269. width: 200,
  270. title: '货物总数量',
  271. field: 'tmsTotalQuantity',
  272. },
  273. {
  274. width: 200,
  275. title: '货物总重量(kg)',
  276. field: 'tmsTotalWeight',
  277. },
  278. {
  279. width: 200,
  280. title: '货物总体积(cm³)',
  281. field: 'tmsTotalVolume',
  282. },
  283. {
  284. width: 200,
  285. title: '承运商名称',
  286. field: 'tmsCarrierName',
  287. },
  288. {
  289. width: 200,
  290. title: '车型要求',
  291. field: 'tmsNeedCarType',
  292. },
  293. {
  294. width: 200,
  295. title: '货物信息',
  296. field: 'tmsGoodsInfos',
  297. },
  298. {
  299. width: 200,
  300. title: '备注',
  301. field: 'tmsRemark',
  302. },
  303. {
  304. width: 200,
  305. title: '司机姓名',
  306. field: 'tmsDriverName',
  307. },
  308. {
  309. width: 200,
  310. title: '司机号码',
  311. field: 'tmsDriverPhone',
  312. },
  313. {
  314. width: 200,
  315. title: '派车时间',
  316. field: 'tmsDispatchTime',
  317. },
  318. ]
  319. },
  320. }
  321. detailConfig = {
  322. attr: {
  323. size: 'medium',
  324. readonly: true
  325. },
  326. columns: [
  327. [
  328. {
  329. span: 6,
  330. label: '短驳单单号',
  331. prop: 'shortBargeCode',
  332. component: 'by-input',
  333. },
  334. // {
  335. // span: 6,
  336. // labelWidth: '110px',
  337. // label: 'WMS仓库编号',
  338. // prop: 'wmsWarehouseCode',
  339. // component: 'by-input',
  340. // },
  341. {
  342. span: 6,
  343. label: 'ERP单据类型',
  344. prop: 'wmsSendType',
  345. component: Logistics2,
  346. },
  347. {
  348. span: 6,
  349. labelWidth: '128px',
  350. label: 'TMS平台业务单号',
  351. prop: 'tmsClientOrderNo',
  352. component: 'by-input',
  353. },
  354. ],
  355. [
  356. {
  357. span: 6,
  358. label: '发货单状态',
  359. prop: 'tmsOrderStatus',
  360. component: Logistics2,
  361. },
  362. {
  363. span: 6,
  364. label: '开单时间',
  365. prop: 'tmsBillingDate',
  366. component: 'by-input',
  367. },
  368. {
  369. span: 6,
  370. label: '业务员',
  371. prop: 'tmsBusinessMan',
  372. component: 'by-input',
  373. },
  374. {
  375. span: 6,
  376. label: '业务员手机号',
  377. prop: 'tmsBusinessPhone',
  378. component: 'by-input',
  379. },
  380. ],
  381. [
  382. {
  383. span: 6,
  384. label: '运输方式',
  385. prop: 'tmsTransportMethod',
  386. component: 'by-input',
  387. },
  388. {
  389. span: 6,
  390. label: '发货单位',
  391. prop: 'tmsShipmentCompanyName',
  392. component: 'by-input',
  393. },
  394. {
  395. span: 6,
  396. label: '发货省',
  397. prop: 'tmsShipmentProvince',
  398. component: 'by-input',
  399. },
  400. {
  401. span: 6,
  402. label: '发货省编码',
  403. prop: 'tmsShipmentProvinceNo',
  404. component: 'by-input',
  405. },
  406. ],
  407. [
  408. {
  409. span: 6,
  410. label: '发货市',
  411. prop: 'tmsShipmentCity',
  412. component: 'by-input',
  413. },
  414. {
  415. span: 6,
  416. label: '发货区(县)',
  417. prop: 'tmsShipmentRegion',
  418. component: 'by-input',
  419. },
  420. {
  421. span: 6,
  422. label: '发货街道',
  423. prop: 'tmsShipmentStreet',
  424. component: 'by-input',
  425. },
  426. {
  427. span: 6,
  428. label: '发货人',
  429. prop: 'tmsShipmentConsignor',
  430. component: 'by-input',
  431. },
  432. ],
  433. [
  434. {
  435. span: 6,
  436. label: '发货市编码',
  437. prop: 'tmsShipmentCityNo',
  438. component: 'by-input',
  439. },
  440. {
  441. span: 6,
  442. labelWidth: '128px',
  443. label: '发货区(县)编码',
  444. prop: 'tmsShipmentRegionNo',
  445. component: 'by-input',
  446. },
  447. {
  448. span: 6,
  449. label: '发货街道编码',
  450. prop: 'tmsShipmentStreetNo',
  451. component: 'by-input',
  452. },
  453. {
  454. span: 6,
  455. labelWidth: '110px',
  456. label: '发货人联系方式',
  457. prop: 'tmsShipmentContacts',
  458. component: 'by-input',
  459. },
  460. ],
  461. [
  462. {
  463. span: 6,
  464. label: '发货地址',
  465. prop: 'tmsShipmentAddress',
  466. component: 'by-input',
  467. },
  468. {
  469. span: 6,
  470. label: '发货点经度',
  471. prop: 'tmsShipmentLng',
  472. component: 'by-input',
  473. },
  474. {
  475. span: 6,
  476. label: '发货点纬度',
  477. prop: 'tmsShipmentLat',
  478. component: 'by-input',
  479. },
  480. {
  481. span: 6,
  482. label: '收货单位',
  483. prop: 'tmsUnloadingCompanyName',
  484. component: 'by-input',
  485. },
  486. ],
  487. [
  488. {
  489. span: 6,
  490. label: '收货省',
  491. prop: 'tmsUnloadingProvince',
  492. component: 'by-input',
  493. },
  494. {
  495. span: 6,
  496. label: '收货市',
  497. prop: 'tmsUnloadingCity',
  498. component: 'by-input',
  499. },
  500. {
  501. span: 6,
  502. label: '收货区(县)',
  503. prop: 'tmsUnloadingRegion',
  504. component: 'by-input',
  505. },
  506. {
  507. span: 6,
  508. label: '收货街道',
  509. prop: 'tmsUnloadingStreet',
  510. component: 'by-input',
  511. },
  512. ],
  513. [
  514. {
  515. span: 6,
  516. label: '收货省编码',
  517. prop: 'tmsUnloadingProvinceNo',
  518. component: 'by-input',
  519. },
  520. {
  521. span: 6,
  522. label: '收货市编码',
  523. prop: 'tmsUnloadingCityNo',
  524. component: 'by-input',
  525. },
  526. {
  527. span: 6,
  528. labelWidth: '128px',
  529. label: '收货区(县)编码',
  530. prop: 'tmsUnloadingRegionNo',
  531. component: 'by-input',
  532. },
  533. {
  534. span: 6,
  535. label: '收货街道编码',
  536. prop: 'tmsUnloadingStreetNo',
  537. component: 'by-input',
  538. },
  539. ],
  540. [
  541. {
  542. span: 6,
  543. label: '收货人',
  544. prop: 'tmsUnloadingConsignor',
  545. component: 'by-input',
  546. },
  547. {
  548. span: 6,
  549. labelWidth: '110px',
  550. label: '收货人联系方式',
  551. prop: 'tmsUnloadingContacts',
  552. component: 'by-input',
  553. },
  554. {
  555. span: 6,
  556. label: '收货地址',
  557. prop: 'tmsUnloadingAddress',
  558. component: 'by-input',
  559. },
  560. {
  561. span: 6,
  562. label: '收货点经度',
  563. prop: 'tmsUnloadingLng',
  564. component: 'by-input',
  565. },
  566. ],
  567. [
  568. {
  569. span: 6,
  570. label: '收货点纬度',
  571. prop: 'tmsUnloadingLat',
  572. component: 'by-input',
  573. },
  574. {
  575. span: 6,
  576. label: '要求提货时间',
  577. prop: 'tmsDeliveryDate',
  578. component: 'by-input',
  579. },
  580. {
  581. span: 6,
  582. label: '要求送达时间',
  583. prop: 'tmsArrivalDate',
  584. component: 'by-input',
  585. },
  586. {
  587. span: 6,
  588. label: '货物总数量',
  589. prop: 'tmsTotalQuantity',
  590. component: 'by-input',
  591. },
  592. ],
  593. [
  594. {
  595. span: 6,
  596. label: '货物总重量(kg)',
  597. prop: 'tmsTotalWeight',
  598. component: 'by-input',
  599. labelWidth: '110px',
  600. },
  601. {
  602. span: 6,
  603. label: '货物总体积(cm³)',
  604. prop: 'tmsTotalVolume',
  605. component: 'by-input',
  606. labelWidth: '116px',
  607. },
  608. {
  609. span: 6,
  610. label: '承运商名称',
  611. prop: 'tmsCarrierName',
  612. component: 'by-input',
  613. },
  614. {
  615. span: 6,
  616. label: '车型要求',
  617. prop: 'tmsNeedCarType',
  618. component: 'by-input',
  619. },
  620. ],
  621. [
  622. {
  623. span: 6,
  624. label: '货物信息',
  625. prop: 'tmsGoodsInfos',
  626. component: 'by-input',
  627. },
  628. {
  629. span: 6,
  630. label: '司机姓名',
  631. prop: 'tmsDriverName',
  632. component: 'by-input',
  633. },
  634. {
  635. span: 6,
  636. label: '司机号码',
  637. prop: 'tmsDriverPhone',
  638. component: 'by-input',
  639. },
  640. {
  641. span: 6,
  642. label: '派车时间',
  643. prop: 'tmsDispatchTime',
  644. component: 'by-input',
  645. },
  646. ],
  647. [
  648. {
  649. span: 30,
  650. label: '备注',
  651. prop: 'tmsRemark',
  652. component: 'by-input',
  653. compConfig: {
  654. attr: {
  655. type: 'textarea'
  656. },
  657. }
  658. }
  659. ]
  660. ]
  661. }
  662. tableConfig = {
  663. attr: {
  664. size: 'mini',
  665. align: 'left',
  666. readonly: true
  667. },
  668. columns:
  669. [{
  670. width: 250,
  671. title: '商品SKUID',
  672. field: 'skuId',
  673. },
  674. {
  675. width: 250,
  676. title: '商品名称',
  677. field: 'skuName',
  678. },
  679. {
  680. width: 250,
  681. title: '短驳出库仓库',
  682. field: 'wareHouseCode',
  683. component: storeHouse,
  684. },
  685. {
  686. width: 250,
  687. title: '短驳入库仓库',
  688. field: 'entryStoreHouseId',
  689. component: storeHouse,
  690. },
  691. {
  692. width: 180,
  693. title: '库存类型',
  694. field: 'stortType',
  695. component: Logistics,
  696. },
  697. {
  698. width: 180,
  699. title: '单价',
  700. field: 'tmsGoodsPrice',
  701. },
  702. {
  703. width: 180,
  704. title: '数量',
  705. field: 'tmsQuantity',
  706. },
  707. {
  708. width: 180,
  709. title: '数量单位',
  710. field: 'tmsQuantityUnit',
  711. },
  712. {
  713. width: 180,
  714. title: '商品过期日期',
  715. field: 'expireDate',
  716. },
  717. {
  718. width: 180,
  719. title: '货物型号',
  720. field: 'tmsGoodsModel',
  721. },
  722. {
  723. width: 180,
  724. title: '小计',
  725. field: 'tmsGoodsTotalPrice',
  726. },
  727. {
  728. width: 180,
  729. title: '重量(kg)',
  730. field: 'tmsWeight',
  731. },
  732. {
  733. width: 180,
  734. title: '体积(cm³)',
  735. field: 'tmsVolume',
  736. },
  737. ]
  738. }
  739. mounted() {
  740. this.timer = setInterval(() => {
  741. this.getDataList();
  742. this.initTable();
  743. }, 300)
  744. }
  745. // 计算高度
  746. initTable() {
  747. if (!this.$refs.moduleView) {
  748. this.calculateCount++;
  749. if (this.calculateCount > 5) return;
  750. setTimeout(() => {
  751. this.initTable()
  752. }, 500)
  753. return
  754. }
  755. let tableId : any = (this as any).$refs.moduleView.tableID;
  756. this.config.table.attr.height = window.innerHeight - 320;
  757. (this as any).$refs.moduleView.$refs[tableId].recalculate();
  758. }
  759. // 打开编辑
  760. openEdit(e : any) {
  761. let loading = this.$loading({ target: '.main-container' });
  762. getShortBargeSingleData({ id: e.id }).then((res : any) => {
  763. if (res.code === 200) {
  764. this.isShow = 'detail';
  765. loading.close();
  766. this.$nextTick(() => {
  767. (this as any).$refs.addFormId.setValue(res.data);
  768. (this as any).$refs.table.setValue(res.data.items);
  769. });
  770. } else loading.close();
  771. }).catch(() => loading.close());
  772. }
  773. // 获取列表数据
  774. getDataList() {
  775. if (!this.$refs.moduleView) {
  776. if (this.timeNum > 5) {
  777. clearInterval(this.timer)
  778. }
  779. this.timeNum++;
  780. return
  781. }
  782. clearInterval(this.timer)
  783. let query = (this.$refs.moduleView as any).getQuery();
  784. // console.log(query);
  785. this.getPageList(query);
  786. }
  787. getPageList(query : any) {
  788. let loading = this.$loading({ target: '.main-container' });
  789. getShortBargePageData(query).then((res : any) => {
  790. loading.close();
  791. if (res.code === 200) {
  792. (this.$refs.moduleView as any).setTableValue(res.data.records);
  793. let page = {
  794. pageNo: res.data.current, //当前页
  795. pageSize: res.data.size, //每页条数
  796. total: res.data.total //总条数
  797. };
  798. (this.$refs.moduleView as any).setPage(page);
  799. } else this.$message.error(res.msg);
  800. }).catch(() => loading.close());
  801. }
  802. // 内页工具栏方法
  803. insideTools(e : any) {
  804. if (e === 'onReturn') this.isShow = 'home';
  805. }
  806. // 刷新/重置
  807. onRefresh() {
  808. (this as any).$refs.moduleView.clearSearch();
  809. this.getDataList();
  810. }
  811. }
  812. </script>
  813. <style lang="scss" scoped>
  814. .my-container {
  815. width: 100%;
  816. box-sizing: border-box;
  817. display: flex;
  818. padding: 16px;
  819. height: 100%;
  820. .bill-left {
  821. position: relative;
  822. border-right: solid #EEE 1px;
  823. flex-shrink: 0;
  824. .bill-tab {
  825. width: 150px;
  826. height: 100%;
  827. transition: all .5s;
  828. overflow: hidden;
  829. }
  830. .tab-title {
  831. font-size: 16px;
  832. padding-bottom: 16px;
  833. width: 200px;
  834. }
  835. }
  836. .bill-main {
  837. width: 100%;
  838. box-sizing: border-box;
  839. position: relative;
  840. height: 100%;
  841. overflow-y: hidden;
  842. }
  843. .detail {
  844. width: 100%;
  845. padding: 16px;
  846. .box-shadow {
  847. box-shadow: 0 2px 12px 0 rgb(0 0 0 / 10%);
  848. padding: 20px;
  849. border-radius: 4px;
  850. border: 1px solid #e6ebf5;
  851. background-color: #fff;
  852. overflow: hidden;
  853. color: #303133;
  854. -webkit-transition: .3s;
  855. transition: .3s;
  856. margin-top: 20px;
  857. }
  858. }
  859. }
  860. </style>