detailDialog.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716
  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. ></add>
  176. </keep-alive>
  177. <detailDialog
  178. type="sourceBizNo"
  179. :businessId="form.returnNo"
  180. ref="outgoingDetai"
  181. v-if="isView"
  182. ></detailDialog>
  183. </div>
  184. </template>
  185. <script>
  186. import { getFile } from '@/api/system/file';
  187. import dictMixins from '@/mixins/dictMixins';
  188. import {
  189. getSendSaleOrderrecordDetail,
  190. getByIdOnlyReplace
  191. } from '@/api/bpm/components/saleManage/saleorder';
  192. import { reviewStatusEnum } from '@/enum/dict';
  193. import { copyObj } from '@/utils/util';
  194. import add from '@/views/bpm/outgoingManagement/outbound.vue';
  195. // import fileMain from '@/components/addDoc/index.vue';
  196. import { lbjtList } from '@/enum/dict.js';
  197. import detailDialog from '@/views/bpm/outgoingManagement/details.vue';
  198. import tabMixins from '@/mixins/tableColumnsMixin';
  199. import { levelList } from '@/enum/dict.js';
  200. import { getSummaries } from '@/utils/util.js';
  201. export default {
  202. mixins: [dictMixins, tabMixins],
  203. components: {
  204. // fileMain,
  205. add,
  206. detailDialog
  207. },
  208. data() {
  209. return {
  210. cacheKeyUrl: 'wt-saleManage-invoice-inventoryTableDetail',
  211. columnsVersion: 0,
  212. activeComp: 'main',
  213. tabOptions: [{ key: 'main', name: '发货单详情' }],
  214. reviewStatusEnum,
  215. visible: false,
  216. detailId: '',
  217. title: '详情',
  218. row: {},
  219. activeName: 'base',
  220. form: {
  221. orderFiles: []
  222. },
  223. rules: {},
  224. detailData: {},
  225. childrenColumns: [
  226. {
  227. width: 80,
  228. type: 'index',
  229. columnKey: 'index',
  230. align: 'center',
  231. fixed: 'left'
  232. },
  233. {
  234. minWidth: 100,
  235. prop: 'code',
  236. label: '编码',
  237. align: 'center'
  238. },
  239. {
  240. minWidth: 140,
  241. prop: 'barcodes',
  242. label: '发货条码',
  243. align: 'center'
  244. },
  245. {
  246. minWidth: 100,
  247. prop: 'engrave',
  248. label: '刻码',
  249. align: 'center'
  250. }
  251. ]
  252. };
  253. },
  254. computed: {
  255. columns() {
  256. let columnsVersion = this.columnsVersion;
  257. return [
  258. {
  259. width: 65,
  260. type: 'index',
  261. columnKey: 'index',
  262. align: 'center',
  263. fixed: 'left'
  264. },
  265. {
  266. width: 200,
  267. prop: 'productName',
  268. label: '名称',
  269. slot: 'productName',
  270. align: 'center'
  271. },
  272. {
  273. width: 120,
  274. prop: 'productCode',
  275. label: '编码',
  276. slot: 'productCode',
  277. align: 'center'
  278. },
  279. {
  280. width: 200,
  281. prop: 'productCategoryName',
  282. label: '类型',
  283. slot: 'productCategoryName',
  284. align: 'center'
  285. },
  286. {
  287. width: 160,
  288. prop: 'batchNo',
  289. label: '批次号',
  290. slot: 'batchNo',
  291. align: 'center'
  292. },
  293. {
  294. width: 160,
  295. prop: 'productBrand',
  296. label: '牌号',
  297. slot: 'productBrand',
  298. align: 'center'
  299. },
  300. {
  301. width: 120,
  302. prop: 'modelType',
  303. label: '型号',
  304. slot: 'modelType',
  305. align: 'center'
  306. },
  307. {
  308. width: 120,
  309. prop: 'specification',
  310. label: '规格',
  311. slot: 'specification',
  312. align: 'center'
  313. },
  314. {
  315. minWidth: 120,
  316. prop: 'modelKey',
  317. label: '机型',
  318. showOverflowTooltip: true,
  319. align: 'center'
  320. },
  321. {
  322. minWidth: 120,
  323. prop: 'colorKey',
  324. showOverflowTooltip: true,
  325. label: '颜色',
  326. align: 'center'
  327. },
  328. {
  329. minWidth: 160,
  330. prop: 'productionCodes',
  331. label: '生产编号',
  332. align: 'center'
  333. },
  334. {
  335. width: 120,
  336. prop: 'imgCode',
  337. align: 'center',
  338. label: '图号/件号',
  339. showOverflowTooltip: true
  340. },
  341. {
  342. width: 120,
  343. prop: 'produceType',
  344. align: 'center',
  345. label: '属性类型',
  346. formatter: (row, column) => {
  347. if (row.produceType) {
  348. return row.produceType
  349. .map((item) => {
  350. return lbjtList[item];
  351. })
  352. .toString();
  353. }
  354. },
  355. showOverflowTooltip: true
  356. },
  357. {
  358. minWidth: 120,
  359. prop: 'goodsLevel',
  360. label: '物品级别',
  361. formatter: (_row, _column, cellValue) => {
  362. return levelList.find((item) => item.value == _row.goodsLevel)
  363. ?.label;
  364. },
  365. align: 'center'
  366. },
  367. {
  368. width: 120,
  369. prop: 'customerMark',
  370. label: '客户代号',
  371. slot: 'customerMark',
  372. align: 'center'
  373. },
  374. {
  375. width: 200,
  376. prop: 'warehouseName',
  377. label: '仓库名称',
  378. slot: 'warehouseName',
  379. align: 'center'
  380. },
  381. {
  382. width: 150,
  383. prop: 'saleCount',
  384. label: '发货数量',
  385. slot: 'saleCount',
  386. headerSlot: 'headerTotalCount',
  387. align: 'center'
  388. },
  389. {
  390. width: 150,
  391. prop: 'saleUnit',
  392. label: '单位',
  393. slot: 'saleUnit',
  394. headerSlot: 'headerTotalCount',
  395. align: 'center'
  396. },
  397. {
  398. width: 120,
  399. prop: 'totalCount',
  400. label: '计量数量',
  401. slot: 'totalCount',
  402. headerSlot: 'headerTotalCount',
  403. align: 'center'
  404. },
  405. {
  406. width: 120,
  407. prop: 'orderTotalCount',
  408. label: '订单数量',
  409. slot: 'orderTotalCount',
  410. align: 'center'
  411. },
  412. {
  413. width: 80,
  414. prop: 'measuringUnit',
  415. label: '计量单位',
  416. slot: 'measuringUnit',
  417. align: 'center'
  418. },
  419. this.$store.state.user.info.clientEnvironmentId== '4'
  420. ? {
  421. width: 120,
  422. prop: 'blockCount',
  423. label: '发货块数',
  424. slot: 'blockCount',
  425. align: 'center'
  426. }
  427. : {
  428. width: 1
  429. },
  430. {
  431. width: 120,
  432. prop: 'singleWeight',
  433. label: '单重',
  434. slot: 'singleWeight',
  435. align: 'center'
  436. },
  437. {
  438. width: 200,
  439. prop: 'receiveTotalWeight',
  440. label: '收货总重',
  441. slot: 'receiveTotalWeight',
  442. align: 'center',
  443. headerSlot: 'headerTotalCount'
  444. },
  445. {
  446. width: 100,
  447. prop: 'sendTotalWeight',
  448. label: '发货总重',
  449. slot: 'sendTotalWeight',
  450. align: 'center'
  451. },
  452. {
  453. width: 100,
  454. prop: 'increaseTotalWeight',
  455. label: '增重重量',
  456. slot: 'increaseTotalWeight',
  457. align: 'center'
  458. },
  459. {
  460. width: 100,
  461. prop: 'weightUnit',
  462. label: '重量单位',
  463. slot: 'weightUnit',
  464. align: 'center'
  465. },
  466. // {
  467. // width: 160,
  468. // prop: 'pricingWay',
  469. // label: '计价方式',
  470. // slot: 'pricingWay',
  471. // align: 'center',
  472. // formatter: (row, column) => {
  473. // return row.pricingWay == 1
  474. // ? '按数量计费'
  475. // : row.pricingWay == 2
  476. // ? '按重量计费'
  477. // : '';
  478. // }
  479. // },
  480. {
  481. width: 160,
  482. prop: 'singlePrice',
  483. label: '单价',
  484. slot: 'singlePrice',
  485. align: 'center'
  486. },
  487. {
  488. width: 160,
  489. prop: 'taxRate',
  490. label: '税率',
  491. formatter: (_row, _column, cellValue) => {
  492. return _row.taxRate ? _row.taxRate + '%' : '';
  493. },
  494. align: 'center'
  495. },
  496. {
  497. width: 160,
  498. prop: 'notaxSinglePrice',
  499. label: '不含税单价',
  500. align: 'center'
  501. },
  502. {
  503. width: 160,
  504. prop: 'discountSinglePrice',
  505. label: '折后单价',
  506. slot: 'discountSinglePrice',
  507. align: 'center'
  508. },
  509. {
  510. width: 120,
  511. prop: 'totalPrice',
  512. label: '合计',
  513. slot: 'totalPrice',
  514. align: 'center'
  515. },
  516. {
  517. width: 120,
  518. prop: 'discountTotalPrice',
  519. label: '折后合计',
  520. slot: 'discountTotalPrice',
  521. align: 'center'
  522. },
  523. // {
  524. // width: 120,
  525. // prop: 'deliveryDays',
  526. // label: '交期(天)',
  527. // slot: 'deliveryDays',
  528. // align: 'center'
  529. // },
  530. {
  531. width: 200,
  532. prop: 'guaranteePeriod',
  533. label: '有效期',
  534. slot: 'guaranteePeriod',
  535. formatter: (_row, _column, cellValue) => {
  536. return (
  537. (_row.guaranteePeriod || '') + _row.guaranteePeriodUnitName
  538. );
  539. },
  540. align: 'center'
  541. },
  542. {
  543. width: 160,
  544. prop: 'guaranteePeriodDeadline',
  545. label: '有效期截止日期',
  546. slot: 'guaranteePeriodDeadline',
  547. align: 'center'
  548. },
  549. {
  550. prop: 'provenance',
  551. label: '产地',
  552. slot: 'provenance',
  553. align: 'center',
  554. // show:this.contractBookType==2,
  555. minWidth: 200,
  556. showOverflowTooltip: true,
  557. formatter: (row, column) => {
  558. return row.provenance && row.provenance.length
  559. ? row.provenance
  560. .map((item) => this.getDictValue('产地', item))
  561. .join(',')
  562. : '';
  563. }
  564. },
  565. {
  566. width: 130,
  567. prop: 'technicalAnswerName',
  568. label: '技术答疑人',
  569. slot: 'technicalAnswerName',
  570. align: 'center'
  571. },
  572. {
  573. width: 220,
  574. prop: 'technicalParams',
  575. label: '技术参数',
  576. slot: 'technicalParams',
  577. align: 'center'
  578. },
  579. {
  580. width: 240,
  581. prop: 'technicalDrawings',
  582. label: '技术图纸',
  583. slot: 'technicalDrawings',
  584. align: 'center'
  585. },
  586. {
  587. width: 220,
  588. prop: 'remark',
  589. label: '备注',
  590. slot: 'remark',
  591. align: 'center'
  592. }
  593. ];
  594. }
  595. },
  596. props: {
  597. businessId: {
  598. default: ''
  599. },
  600. taskDefinitionKey: {},
  601. isView: ''
  602. },
  603. async created() {
  604. await this.getDetailData(this.businessId);
  605. this.requestDict('产地');
  606. this.requestDict('生产类型');
  607. if (this.taskDefinitionKey == 'storemanApprove') {
  608. this.tabOptions.push({ key: 'outBound', name: '出库单' });
  609. this.activeComp = 'outBound';
  610. this.$emit('activeCompChange', 'outBound');
  611. // this.$nextTick(() => {
  612. // this.$refs.add.eomSuccess(this.form);
  613. // });
  614. }
  615. },
  616. methods: {
  617. getSummaries(param) {
  618. return getSummaries(
  619. param,
  620. ['saleCount', 'blockCount', 'totalCount'],
  621. ' '
  622. );
  623. },
  624. changeActive(item) {
  625. this.activeComp = item.key;
  626. this.$emit('activeCompChange', item.key);
  627. // if (
  628. // this.taskDefinitionKey == 'storemanApprove' &&
  629. // item.key == 'outBound'
  630. // ) {
  631. // this.$nextTick(() => {
  632. // this.$refs.add.eomSuccess(this.form);
  633. // });
  634. // }
  635. },
  636. save(data) {
  637. this.$refs.add.handleNewSave(data);
  638. },
  639. success() {
  640. this.$emit('handleClose');
  641. },
  642. cancel() {
  643. this.$nextTick(() => {
  644. // 关闭后,销毁所有的表单数据
  645. (this.form = copyObj(this.formDef)),
  646. (this.otherForm = copyObj(this.otherFormDef)),
  647. (this.tableBankData = []);
  648. this.tableLinkData = [];
  649. this.visible = false;
  650. });
  651. },
  652. downloadFile(file) {
  653. getFile({ objectName: file.storePath }, file.name);
  654. },
  655. async getTableValue() {
  656. return {
  657. form: this.form,
  658. returnStorageData:
  659. this.$refs.add && (await this.$refs.add.getReturnStorage())
  660. };
  661. },
  662. async getDetailData(id) {
  663. this.loading = true;
  664. const data = await getByIdOnlyReplace(id);
  665. this.loading = false;
  666. if (data) {
  667. data.categoryLevelTopId = data.topCategoryIds;
  668. this.form = data;
  669. this.detailData = data;
  670. this.$nextTick(() => {
  671. // this.$refs.add?.initFormData();
  672. this.$refs.outgoingDetai?._getInfo(data.docNo);
  673. });
  674. }
  675. }
  676. }
  677. };
  678. </script>
  679. <style scoped lang="scss">
  680. .title {
  681. font-size: 22px;
  682. font-weight: 800;
  683. margin-top: 15px;
  684. }
  685. .ele-dialog-form {
  686. .el-form-item {
  687. margin-bottom: 10px;
  688. }
  689. }
  690. .headbox {
  691. display: flex;
  692. justify-content: flex-start;
  693. align-items: center;
  694. .amount {
  695. font-size: 14px;
  696. font-weight: bold;
  697. margin-right: 20px;
  698. }
  699. }
  700. </style>