index.vue 17 KB

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