detailDialog.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722
  1. <template>
  2. <div>
  3. <!-- <div class="switch">
  4. <div class="switch_left">
  5. <ul>
  6. <li
  7. v-for="item in tabOptions"
  8. :key="item.key"
  9. :class="{ active: activeComp == item.key }"
  10. @click="changeActive(item)"
  11. >
  12. {{ item.name }}
  13. </li>
  14. </ul>
  15. </div>
  16. </div> -->
  17. <!-- <div v-show="activeComp == 'main'"> -->
  18. <el-form ref="form" :model="form" :rules="rules" label-width="120px">
  19. <div class="title"> 发货单信息</div>
  20. <el-row>
  21. <el-col :span="8">
  22. <el-form-item
  23. label="客户名称:"
  24. prop="contactName"
  25. style="margin-bottom: 5px"
  26. >
  27. {{ form.contactName }}
  28. </el-form-item>
  29. <el-form-item
  30. label="客户联系人:"
  31. prop="linkName"
  32. style="margin-bottom: 5px"
  33. >
  34. {{ form.linkName }}
  35. </el-form-item>
  36. <el-form-item
  37. label="客户电话:"
  38. prop="linkPhone"
  39. style="margin-bottom: 5px"
  40. >
  41. {{ form.linkPhone }}
  42. </el-form-item>
  43. <el-form-item
  44. label="客户地址:"
  45. prop="partaAddress"
  46. style="margin-bottom: 5px"
  47. >
  48. {{ form.receiveAddress }}
  49. </el-form-item>
  50. <el-form-item
  51. label="打印编码:"
  52. prop="printNo"
  53. style="margin-bottom: 5px"
  54. >
  55. {{ form.printNo }}
  56. </el-form-item>
  57. </el-col>
  58. <el-col :span="8">
  59. <el-form-item
  60. label="车牌号:"
  61. prop="carNo"
  62. style="margin-bottom: 5px"
  63. >
  64. {{ form.carNo }}
  65. </el-form-item>
  66. <el-form-item
  67. label="发货单据编码:"
  68. prop="docNo"
  69. style="margin-bottom: 5px"
  70. >
  71. {{ form.docNo }}
  72. </el-form-item>
  73. <el-form-item
  74. label="制单人:"
  75. prop="makerName"
  76. style="margin-bottom: 5px"
  77. >
  78. {{ form.makerName }}
  79. </el-form-item>
  80. <el-form-item prop="orderNo" label="订单编码:">
  81. {{ form.orderNo }}
  82. </el-form-item>
  83. <el-form-item label="生产要求:" prop="productionRequirements">
  84. {{ form.productionRequirements }}
  85. </el-form-item>
  86. </el-col>
  87. <el-col :span="8">
  88. <el-form-item prop="replied" label="是否回执:">
  89. {{ form.replied == 1 ? '是' : '否' }}
  90. </el-form-item>
  91. <el-form-item
  92. label="审核状态:"
  93. prop="reviewStatus"
  94. style="margin-bottom: 5px"
  95. >
  96. {{ reviewStatusEnum[form.reviewStatus]?.label }}
  97. </el-form-item>
  98. <el-form-item
  99. label="发货附件:"
  100. prop="sendFiles"
  101. style="margin-bottom: 5px"
  102. >
  103. <fileMain v-model="detailData.sendFiles" type="view"></fileMain>
  104. </el-form-item>
  105. <el-form-item
  106. label="回执附件:"
  107. prop="sendFiles"
  108. style="margin-bottom: 5px"
  109. >
  110. <fileMain v-model="detailData.repliedFiles" type="view"></fileMain>
  111. </el-form-item>
  112. </el-col>
  113. </el-row>
  114. </el-form>
  115. <headerTitle title="物品清单"></headerTitle>
  116. <ele-pro-table
  117. ref="table"
  118. :needPage="false"
  119. :columns="columns"
  120. @columns-change="handleColumnChange"
  121. :cache-key="cacheKeyUrl"
  122. :datasource="detailData.productList"
  123. row-key="id"
  124. show-summary
  125. :summary-method="getSummaries"
  126. >
  127. <template v-slot:stockLedger="scope">
  128. <el-popover placement="right" width="60%" trigger="hover">
  129. <ele-pro-table
  130. :ref="'childrenTable' + scope.$index"
  131. row-key="id"
  132. max-height="300px"
  133. :needPage="false"
  134. :columns="childrenColumns"
  135. :toolkit="[]"
  136. :datasource="scope.row.sendProductDetail"
  137. class="time-form"
  138. >
  139. </ele-pro-table>
  140. <el-button type="text" slot="reference">明细</el-button>
  141. </el-popover>
  142. </template>
  143. <template v-slot:industryArtFiles="{ row, $index }">
  144. <el-form-item
  145. style="margin-bottom: 20px"
  146. :prop="'datasource.' + $index + '.industryArtFiles'"
  147. >
  148. <fileMain v-model="row.industryArtFiles" type="view"></fileMain>
  149. </el-form-item>
  150. </template>
  151. <template v-slot:otherFiles="{ row, $index }">
  152. <el-form-item
  153. style="margin-bottom: 20px"
  154. :prop="'datasource.' + $index + '.otherFiles'"
  155. >
  156. <fileMain v-model="row.otherFiles" type="view"></fileMain>
  157. </el-form-item>
  158. </template>
  159. <template v-slot:technicalDrawings="{ row }">
  160. <fileMain v-model="row.technicalDrawings" type="view"></fileMain>
  161. </template>
  162. </ele-pro-table>
  163. <div class="title" v-if="!isView && taskDefinitionKey == 'storemanApprove'">
  164. 出库单信息</div
  165. >
  166. <keep-alive>
  167. <add
  168. ref="add"
  169. :form="form"
  170. :sourceBizNo="form.docNo"
  171. :bizType="3"
  172. :saleProductList="form.productList"
  173. type="销售发货出库"
  174. v-if="!isView && taskDefinitionKey == 'storemanApprove' && form.docNo"
  175. :isEdit="false"
  176. ></add>
  177. </keep-alive>
  178. <detailDialog
  179. type="sourceBizNo"
  180. :businessId="form.returnNo"
  181. ref="outgoingDetai"
  182. v-if="isView"
  183. ></detailDialog>
  184. </div>
  185. </template>
  186. <script>
  187. import { getFile } from '@/api/system/file';
  188. import dictMixins from '@/mixins/dictMixins';
  189. import {
  190. getSendSaleOrderrecordDetail,
  191. getByIdOnlyReplace
  192. } from '@/api/bpm/components/saleManage/saleorder';
  193. import { reviewStatusEnum } from '@/enum/dict';
  194. import { copyObj } from '@/utils/util';
  195. import add from '@/views/bpm/outgoingManagement/outbound.vue';
  196. // import fileMain from '@/components/addDoc/index.vue';
  197. import { lbjtList } from '@/enum/dict.js';
  198. import detailDialog from '@/views/bpm/outgoingManagement/details.vue';
  199. import tabMixins from '@/mixins/tableColumnsMixin';
  200. import { levelList } from '@/enum/dict.js';
  201. import { getSummaries } from '@/utils/util.js';
  202. export default {
  203. mixins: [dictMixins, tabMixins],
  204. components: {
  205. // fileMain,
  206. add,
  207. detailDialog
  208. },
  209. data() {
  210. return {
  211. cacheKeyUrl: 'wt-saleManage-invoice-inventoryTableDetail',
  212. columnsVersion: 0,
  213. activeComp: 'main',
  214. tabOptions: [{ key: 'main', name: '发货单详情' }],
  215. reviewStatusEnum,
  216. visible: false,
  217. detailId: '',
  218. title: '详情',
  219. row: {},
  220. activeName: 'base',
  221. form: {
  222. orderFiles: []
  223. },
  224. rules: {},
  225. detailData: {},
  226. childrenColumns: [
  227. {
  228. width: 80,
  229. type: 'index',
  230. columnKey: 'index',
  231. align: 'center',
  232. fixed: 'left'
  233. },
  234. {
  235. minWidth: 100,
  236. prop: 'code',
  237. label: '编码',
  238. align: 'center'
  239. },
  240. {
  241. minWidth: 140,
  242. prop: 'barcodes',
  243. label: '发货条码',
  244. align: 'center'
  245. },
  246. {
  247. minWidth: 100,
  248. prop: 'engrave',
  249. label: '刻码',
  250. align: 'center'
  251. }
  252. ]
  253. };
  254. },
  255. computed: {
  256. columns() {
  257. let columnsVersion = this.columnsVersion;
  258. return [
  259. {
  260. width: 65,
  261. type: 'index',
  262. columnKey: 'index',
  263. align: 'center',
  264. fixed: 'left'
  265. },
  266. {
  267. width: 200,
  268. prop: 'productName',
  269. label: '名称',
  270. slot: 'productName',
  271. align: 'center'
  272. },
  273. {
  274. width: 120,
  275. prop: 'productCode',
  276. label: '编码',
  277. slot: 'productCode',
  278. align: 'center'
  279. },
  280. {
  281. width: 200,
  282. prop: 'productCategoryName',
  283. label: '类型',
  284. slot: 'productCategoryName',
  285. align: 'center'
  286. },
  287. {
  288. width: 160,
  289. prop: 'batchNo',
  290. label: '批次号',
  291. slot: 'batchNo',
  292. align: 'center'
  293. },
  294. {
  295. width: 160,
  296. prop: 'productBrand',
  297. label: '牌号',
  298. slot: 'productBrand',
  299. align: 'center'
  300. },
  301. {
  302. width: 120,
  303. prop: 'modelType',
  304. label: '型号',
  305. slot: 'modelType',
  306. align: 'center'
  307. },
  308. {
  309. width: 120,
  310. prop: 'specification',
  311. label: '规格',
  312. slot: 'specification',
  313. align: 'center'
  314. },
  315. {
  316. minWidth: 120,
  317. prop: 'modelKey',
  318. label: '机型',
  319. showOverflowTooltip: true,
  320. align: 'center'
  321. },
  322. {
  323. minWidth: 120,
  324. prop: 'colorKey',
  325. showOverflowTooltip: true,
  326. label: '颜色',
  327. align: 'center'
  328. },
  329. {
  330. minWidth: 160,
  331. prop: 'productionCodes',
  332. label: '生产编号',
  333. align: 'center'
  334. },
  335. {
  336. minWidth: 280,
  337. prop: 'productionRequirements',
  338. label: '生产要求',
  339. align: 'center'
  340. },
  341. {
  342. width: 120,
  343. prop: 'imgCode',
  344. align: 'center',
  345. label: '图号/件号',
  346. showOverflowTooltip: true
  347. },
  348. {
  349. width: 120,
  350. prop: 'produceType',
  351. align: 'center',
  352. label: '属性类型',
  353. formatter: (row, column) => {
  354. if (row.produceType) {
  355. return row.produceType
  356. .map((item) => {
  357. return lbjtList[item];
  358. })
  359. .toString();
  360. }
  361. },
  362. showOverflowTooltip: true
  363. },
  364. {
  365. minWidth: 120,
  366. prop: 'goodsLevel',
  367. label: '物品级别',
  368. formatter: (_row, _column, cellValue) => {
  369. return levelList.find((item) => item.value == _row.goodsLevel)
  370. ?.label;
  371. },
  372. align: 'center'
  373. },
  374. {
  375. width: 120,
  376. prop: 'customerMark',
  377. label: '客户代号',
  378. slot: 'customerMark',
  379. align: 'center'
  380. },
  381. {
  382. width: 200,
  383. prop: 'warehouseName',
  384. label: '仓库名称',
  385. slot: 'warehouseName',
  386. align: 'center'
  387. },
  388. {
  389. width: 150,
  390. prop: 'saleCount',
  391. label: '发货数量',
  392. slot: 'saleCount',
  393. headerSlot: 'headerTotalCount',
  394. align: 'center'
  395. },
  396. {
  397. width: 150,
  398. prop: 'saleUnit',
  399. label: '单位',
  400. slot: 'saleUnit',
  401. headerSlot: 'headerTotalCount',
  402. align: 'center'
  403. },
  404. {
  405. width: 120,
  406. prop: 'totalCount',
  407. label: '计量数量',
  408. slot: 'totalCount',
  409. headerSlot: 'headerTotalCount',
  410. align: 'center'
  411. },
  412. {
  413. width: 120,
  414. prop: 'orderTotalCount',
  415. label: '订单数量',
  416. slot: 'orderTotalCount',
  417. align: 'center'
  418. },
  419. {
  420. width: 80,
  421. prop: 'measuringUnit',
  422. label: '计量单位',
  423. slot: 'measuringUnit',
  424. align: 'center'
  425. },
  426. this.$store.state.user.info.clientEnvironmentId == '4'
  427. ? {
  428. width: 120,
  429. prop: 'blockCount',
  430. label: '发货块数',
  431. slot: 'blockCount',
  432. align: 'center'
  433. }
  434. : {
  435. width: 1
  436. },
  437. {
  438. width: 120,
  439. prop: 'singleWeight',
  440. label: '单重',
  441. slot: 'singleWeight',
  442. align: 'center'
  443. },
  444. {
  445. width: 200,
  446. prop: 'receiveTotalWeight',
  447. label: '收货总重',
  448. slot: 'receiveTotalWeight',
  449. align: 'center',
  450. headerSlot: 'headerTotalCount'
  451. },
  452. {
  453. width: 100,
  454. prop: 'sendTotalWeight',
  455. label: '发货总重',
  456. slot: 'sendTotalWeight',
  457. align: 'center'
  458. },
  459. {
  460. width: 100,
  461. prop: 'increaseTotalWeight',
  462. label: '增重重量',
  463. slot: 'increaseTotalWeight',
  464. align: 'center'
  465. },
  466. {
  467. width: 100,
  468. prop: 'weightUnit',
  469. label: '重量单位',
  470. slot: 'weightUnit',
  471. align: 'center'
  472. },
  473. // {
  474. // width: 160,
  475. // prop: 'pricingWay',
  476. // label: '计价方式',
  477. // slot: 'pricingWay',
  478. // align: 'center',
  479. // formatter: (row, column) => {
  480. // return row.pricingWay == 1
  481. // ? '按数量计费'
  482. // : row.pricingWay == 2
  483. // ? '按重量计费'
  484. // : '';
  485. // }
  486. // },
  487. {
  488. width: 160,
  489. prop: 'singlePrice',
  490. label: '单价',
  491. slot: 'singlePrice',
  492. align: 'center'
  493. },
  494. {
  495. width: 160,
  496. prop: 'taxRate',
  497. label: '税率',
  498. formatter: (_row, _column, cellValue) => {
  499. return _row.taxRate ? _row.taxRate + '%' : '';
  500. },
  501. align: 'center'
  502. },
  503. {
  504. width: 160,
  505. prop: 'notaxSinglePrice',
  506. label: '不含税单价',
  507. align: 'center'
  508. },
  509. {
  510. width: 160,
  511. prop: 'discountSinglePrice',
  512. label: '折后单价',
  513. slot: 'discountSinglePrice',
  514. align: 'center'
  515. },
  516. {
  517. width: 120,
  518. prop: 'totalPrice',
  519. label: '合计',
  520. slot: 'totalPrice',
  521. align: 'center'
  522. },
  523. {
  524. width: 120,
  525. prop: 'discountTotalPrice',
  526. label: '折后合计',
  527. slot: 'discountTotalPrice',
  528. align: 'center'
  529. },
  530. // {
  531. // width: 120,
  532. // prop: 'deliveryDays',
  533. // label: '交期(天)',
  534. // slot: 'deliveryDays',
  535. // align: 'center'
  536. // },
  537. {
  538. width: 200,
  539. prop: 'guaranteePeriod',
  540. label: '有效期',
  541. slot: 'guaranteePeriod',
  542. formatter: (_row, _column, cellValue) => {
  543. return (
  544. (_row.guaranteePeriod || '') + _row.guaranteePeriodUnitName
  545. );
  546. },
  547. align: 'center'
  548. },
  549. {
  550. width: 160,
  551. prop: 'guaranteePeriodDeadline',
  552. label: '有效期截止日期',
  553. slot: 'guaranteePeriodDeadline',
  554. align: 'center'
  555. },
  556. {
  557. prop: 'provenance',
  558. label: '产地',
  559. slot: 'provenance',
  560. align: 'center',
  561. // show:this.contractBookType==2,
  562. minWidth: 200,
  563. showOverflowTooltip: true,
  564. formatter: (row, column) => {
  565. return row.provenance && row.provenance.length
  566. ? row.provenance
  567. .map((item) => this.getDictValue('产地', item))
  568. .join(',')
  569. : '';
  570. }
  571. },
  572. {
  573. width: 130,
  574. prop: 'technicalAnswerName',
  575. label: '技术答疑人',
  576. slot: 'technicalAnswerName',
  577. align: 'center'
  578. },
  579. {
  580. width: 220,
  581. prop: 'technicalParams',
  582. label: '技术参数',
  583. slot: 'technicalParams',
  584. align: 'center'
  585. },
  586. {
  587. width: 240,
  588. prop: 'technicalDrawings',
  589. label: '技术图纸',
  590. slot: 'technicalDrawings',
  591. align: 'center'
  592. },
  593. {
  594. width: 220,
  595. prop: 'remark',
  596. label: '备注',
  597. slot: 'remark',
  598. align: 'center'
  599. }
  600. ];
  601. }
  602. },
  603. props: {
  604. businessId: {
  605. default: ''
  606. },
  607. taskDefinitionKey: {},
  608. isView: ''
  609. },
  610. async created() {
  611. await this.getDetailData(this.businessId);
  612. this.requestDict('产地');
  613. this.requestDict('生产类型');
  614. if (this.taskDefinitionKey == 'storemanApprove') {
  615. this.tabOptions.push({ key: 'outBound', name: '出库单' });
  616. this.activeComp = 'outBound';
  617. this.$emit('activeCompChange', 'outBound');
  618. // this.$nextTick(() => {
  619. // this.$refs.add.eomSuccess(this.form);
  620. // });
  621. }
  622. },
  623. methods: {
  624. getSummaries(param) {
  625. return getSummaries(
  626. param,
  627. ['saleCount', 'blockCount', 'totalCount'],
  628. ' '
  629. );
  630. },
  631. changeActive(item) {
  632. this.activeComp = item.key;
  633. this.$emit('activeCompChange', item.key);
  634. // if (
  635. // this.taskDefinitionKey == 'storemanApprove' &&
  636. // item.key == 'outBound'
  637. // ) {
  638. // this.$nextTick(() => {
  639. // this.$refs.add.eomSuccess(this.form);
  640. // });
  641. // }
  642. },
  643. save(data) {
  644. this.$refs.add.handleNewSave(data);
  645. },
  646. success() {
  647. this.$emit('handleClose');
  648. },
  649. cancel() {
  650. this.$nextTick(() => {
  651. // 关闭后,销毁所有的表单数据
  652. (this.form = copyObj(this.formDef)),
  653. (this.otherForm = copyObj(this.otherFormDef)),
  654. (this.tableBankData = []);
  655. this.tableLinkData = [];
  656. this.visible = false;
  657. });
  658. },
  659. downloadFile(file) {
  660. getFile({ objectName: file.storePath }, file.name);
  661. },
  662. async getTableValue() {
  663. return {
  664. form: this.form,
  665. returnStorageData:
  666. this.$refs.add && (await this.$refs.add.getReturnStorage())
  667. };
  668. },
  669. async getDetailData(id) {
  670. this.loading = true;
  671. const data = await getByIdOnlyReplace(id);
  672. this.loading = false;
  673. if (data) {
  674. data.categoryLevelTopId = data.topCategoryIds;
  675. this.form = data;
  676. this.detailData = data;
  677. this.$nextTick(() => {
  678. // this.$refs.add?.initFormData();
  679. this.$refs.outgoingDetai?._getInfo(data.docNo);
  680. });
  681. }
  682. }
  683. }
  684. };
  685. </script>
  686. <style scoped lang="scss">
  687. .title {
  688. font-size: 22px;
  689. font-weight: 800;
  690. margin-top: 15px;
  691. }
  692. .ele-dialog-form {
  693. .el-form-item {
  694. margin-bottom: 10px;
  695. }
  696. }
  697. .headbox {
  698. display: flex;
  699. justify-content: flex-start;
  700. align-items: center;
  701. .amount {
  702. font-size: 14px;
  703. font-weight: bold;
  704. margin-right: 20px;
  705. }
  706. }
  707. </style>