detailDialog.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758
  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="true"
  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: 180,
  390. prop: 'saleCount',
  391. label: '发货数量',
  392. slot: 'saleCount',
  393. formatter: (row, column) => {
  394. if (row.saleCount) {
  395. return row.saleCount + ' ' + row.saleUnit;
  396. }
  397. },
  398. headerSlot: 'headerTotalCount',
  399. align: 'center'
  400. },
  401. // {
  402. // width: 150,
  403. // prop: 'saleUnit',
  404. // label: '单位',
  405. // slot: 'saleUnit',
  406. // headerSlot: 'headerTotalCount',
  407. // align: 'center'
  408. // },
  409. {
  410. width: 120,
  411. prop: 'totalCount',
  412. label: '计量数量',
  413. slot: 'totalCount',
  414. formatter: (row, column) => {
  415. if (row.totalCount) {
  416. return row.totalCount + ' ' + row.measuringUnit;
  417. }
  418. },
  419. headerSlot: 'headerTotalCount',
  420. align: 'center'
  421. },
  422. {
  423. width: 120,
  424. prop: 'orderTotalCount',
  425. label: '订单数量',
  426. slot: 'orderTotalCount',
  427. formatter: (row, column) => {
  428. if (row.orderTotalCount) {
  429. return row.orderTotalCount + ' ' + row.measuringUnit;
  430. }
  431. },
  432. align: 'center'
  433. },
  434. // {
  435. // width: 80,
  436. // prop: 'measuringUnit',
  437. // label: '计量单位',
  438. // slot: 'measuringUnit',
  439. // align: 'center'
  440. // },
  441. this.$store.state.user.info.clientEnvironmentId == '4'
  442. ? {
  443. width: 120,
  444. prop: 'blockCount',
  445. label: '发货块数',
  446. slot: 'blockCount',
  447. align: 'center'
  448. }
  449. : {
  450. width: 1
  451. },
  452. {
  453. width: 120,
  454. prop: 'singleWeight',
  455. label: '单重',
  456. slot: 'singleWeight',
  457. formatter: (row, column) => {
  458. if (row.singleWeight) {
  459. return row.singleWeight + ' ' + row.weightUnit;
  460. }
  461. },
  462. align: 'center'
  463. },
  464. {
  465. width: 200,
  466. prop: 'receiveTotalWeight',
  467. label: '收货总重',
  468. slot: 'receiveTotalWeight',
  469. formatter: (row, column) => {
  470. if (row.receiveTotalWeight) {
  471. return row.receiveTotalWeight + ' ' + row.weightUnit;
  472. }
  473. },
  474. align: 'center',
  475. headerSlot: 'headerTotalCount'
  476. },
  477. {
  478. width: 100,
  479. prop: 'sendTotalWeight',
  480. label: '发货总重',
  481. slot: 'sendTotalWeight',
  482. formatter: (row, column) => {
  483. if (row.sendTotalWeight) {
  484. return row.sendTotalWeight + ' ' + row.weightUnit;
  485. }
  486. },
  487. align: 'center'
  488. },
  489. {
  490. width: 100,
  491. prop: 'increaseTotalWeight',
  492. label: '增重重量',
  493. slot: 'increaseTotalWeight',
  494. formatter: (row, column) => {
  495. if (row.increaseTotalWeight) {
  496. return row.increaseTotalWeight + ' ' + row.weightUnit;
  497. }
  498. },
  499. align: 'center'
  500. },
  501. // {
  502. // width: 100,
  503. // prop: 'weightUnit',
  504. // label: '重量单位',
  505. // slot: 'weightUnit',
  506. // align: 'center'
  507. // },
  508. // {
  509. // width: 160,
  510. // prop: 'pricingWay',
  511. // label: '计价方式',
  512. // slot: 'pricingWay',
  513. // align: 'center',
  514. // formatter: (row, column) => {
  515. // return row.pricingWay == 1
  516. // ? '按数量计费'
  517. // : row.pricingWay == 2
  518. // ? '按重量计费'
  519. // : '';
  520. // }
  521. // },
  522. {
  523. width: 160,
  524. prop: 'singlePrice',
  525. label: '单价',
  526. slot: 'singlePrice',
  527. align: 'center'
  528. },
  529. {
  530. width: 160,
  531. prop: 'taxRate',
  532. label: '税率',
  533. formatter: (_row, _column, cellValue) => {
  534. return _row.taxRate ? _row.taxRate + '%' : '';
  535. },
  536. align: 'center'
  537. },
  538. {
  539. width: 160,
  540. prop: 'notaxSinglePrice',
  541. label: '不含税单价',
  542. align: 'center'
  543. },
  544. {
  545. width: 160,
  546. prop: 'discountSinglePrice',
  547. label: '折后单价',
  548. slot: 'discountSinglePrice',
  549. align: 'center'
  550. },
  551. {
  552. width: 120,
  553. prop: 'totalPrice',
  554. label: '合计',
  555. slot: 'totalPrice',
  556. align: 'center'
  557. },
  558. {
  559. width: 120,
  560. prop: 'discountTotalPrice',
  561. label: '折后合计',
  562. slot: 'discountTotalPrice',
  563. align: 'center'
  564. },
  565. // {
  566. // width: 120,
  567. // prop: 'deliveryDays',
  568. // label: '交期(天)',
  569. // slot: 'deliveryDays',
  570. // align: 'center'
  571. // },
  572. {
  573. width: 200,
  574. prop: 'guaranteePeriod',
  575. label: '有效期',
  576. slot: 'guaranteePeriod',
  577. formatter: (_row, _column, cellValue) => {
  578. return (
  579. (_row.guaranteePeriod || '') + _row.guaranteePeriodUnitName
  580. );
  581. },
  582. align: 'center'
  583. },
  584. {
  585. width: 160,
  586. prop: 'guaranteePeriodDeadline',
  587. label: '有效期截止日期',
  588. slot: 'guaranteePeriodDeadline',
  589. align: 'center'
  590. },
  591. {
  592. prop: 'provenance',
  593. label: '产地',
  594. slot: 'provenance',
  595. align: 'center',
  596. // show:this.contractBookType==2,
  597. minWidth: 200,
  598. showOverflowTooltip: true,
  599. formatter: (row, column) => {
  600. return row.provenance && row.provenance.length
  601. ? row.provenance
  602. .map((item) => this.getDictValue('产地', item))
  603. .join(',')
  604. : '';
  605. }
  606. },
  607. {
  608. width: 130,
  609. prop: 'technicalAnswerName',
  610. label: '技术答疑人',
  611. slot: 'technicalAnswerName',
  612. align: 'center'
  613. },
  614. {
  615. width: 220,
  616. prop: 'technicalParams',
  617. label: '技术参数',
  618. slot: 'technicalParams',
  619. align: 'center'
  620. },
  621. {
  622. width: 240,
  623. prop: 'technicalDrawings',
  624. label: '技术图纸',
  625. slot: 'technicalDrawings',
  626. align: 'center'
  627. },
  628. {
  629. width: 220,
  630. prop: 'remark',
  631. label: '备注',
  632. slot: 'remark',
  633. align: 'center'
  634. }
  635. ];
  636. }
  637. },
  638. props: {
  639. businessId: {
  640. default: ''
  641. },
  642. taskDefinitionKey: {},
  643. isView: ''
  644. },
  645. async created() {
  646. await this.getDetailData(this.businessId);
  647. this.requestDict('产地');
  648. this.requestDict('生产类型');
  649. if (this.taskDefinitionKey == 'storemanApprove') {
  650. this.tabOptions.push({ key: 'outBound', name: '出库单' });
  651. this.activeComp = 'outBound';
  652. this.$emit('activeCompChange', 'outBound');
  653. // this.$nextTick(() => {
  654. // this.$refs.add.eomSuccess(this.form);
  655. // });
  656. }
  657. },
  658. methods: {
  659. getSummaries(param) {
  660. return getSummaries(
  661. param,
  662. ['saleCount', 'blockCount', 'totalCount'],
  663. ' '
  664. );
  665. },
  666. changeActive(item) {
  667. this.activeComp = item.key;
  668. this.$emit('activeCompChange', item.key);
  669. // if (
  670. // this.taskDefinitionKey == 'storemanApprove' &&
  671. // item.key == 'outBound'
  672. // ) {
  673. // this.$nextTick(() => {
  674. // this.$refs.add.eomSuccess(this.form);
  675. // });
  676. // }
  677. },
  678. save(data) {
  679. this.$refs.add.handleNewSave(data);
  680. },
  681. success() {
  682. this.$emit('handleClose');
  683. },
  684. cancel() {
  685. this.$nextTick(() => {
  686. // 关闭后,销毁所有的表单数据
  687. (this.form = copyObj(this.formDef)),
  688. (this.otherForm = copyObj(this.otherFormDef)),
  689. (this.tableBankData = []);
  690. this.tableLinkData = [];
  691. this.visible = false;
  692. });
  693. },
  694. downloadFile(file) {
  695. getFile({ objectName: file.storePath }, file.name);
  696. },
  697. async getTableValue() {
  698. return {
  699. form: this.form,
  700. returnStorageData:
  701. this.$refs.add && (await this.$refs.add.getReturnStorage())
  702. };
  703. },
  704. async getDetailData(id) {
  705. this.loading = true;
  706. const data = await getByIdOnlyReplace(id);
  707. this.loading = false;
  708. if (data) {
  709. data.categoryLevelTopId = data.topCategoryIds;
  710. this.form = data;
  711. this.detailData = data;
  712. console.log('this.form~~~', this.form);
  713. this.$nextTick(() => {
  714. // this.$refs.add?.initFormData();
  715. this.$refs.outgoingDetai?._getInfo(data.docNo);
  716. });
  717. }
  718. }
  719. }
  720. };
  721. </script>
  722. <style scoped lang="scss">
  723. .title {
  724. font-size: 22px;
  725. font-weight: 800;
  726. margin-top: 15px;
  727. }
  728. .ele-dialog-form {
  729. .el-form-item {
  730. margin-bottom: 10px;
  731. }
  732. }
  733. .headbox {
  734. display: flex;
  735. justify-content: flex-start;
  736. align-items: center;
  737. .amount {
  738. font-size: 14px;
  739. font-weight: bold;
  740. margin-right: 20px;
  741. }
  742. }
  743. </style>