detailDialog.vue 18 KB

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