detailDialog.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675
  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"> 出库单信息</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: 100,
  354. // prop: 'warehouseNum',
  355. // label: '库存',
  356. // align: 'center',
  357. // slot: 'warehouseNum',
  358. // headerSlot: 'headerWarehouseNum'
  359. // },
  360. // {
  361. // width: 100,
  362. // prop: 'stockLedger',
  363. // label: '发货明细',
  364. // slot: 'stockLedger',
  365. // align: 'center'
  366. // },
  367. {
  368. width: 120,
  369. prop: 'totalCount',
  370. label: '发货数量',
  371. slot: 'totalCount',
  372. headerSlot: 'headerTotalCount',
  373. align: 'center'
  374. },
  375. {
  376. width: 120,
  377. prop: 'orderTotalCount',
  378. label: '订单数量',
  379. slot: 'orderTotalCount',
  380. align: 'center'
  381. },
  382. {
  383. width: 80,
  384. prop: 'measuringUnit',
  385. label: '计量单位',
  386. slot: 'measuringUnit',
  387. align: 'center'
  388. },
  389. {
  390. width: 120,
  391. prop: 'blockCount',
  392. label: '发货块数',
  393. slot: 'blockCount',
  394. align: 'center',
  395. show: this.clientEnvironmentId == '4'
  396. },
  397. {
  398. width: 120,
  399. prop: 'singleWeight',
  400. label: '单重',
  401. slot: 'singleWeight',
  402. align: 'center'
  403. },
  404. {
  405. width: 200,
  406. prop: 'receiveTotalWeight',
  407. label: '收货总重',
  408. slot: 'receiveTotalWeight',
  409. align: 'center',
  410. headerSlot: 'headerTotalCount'
  411. },
  412. {
  413. width: 100,
  414. prop: 'sendTotalWeight',
  415. label: '发货总重',
  416. slot: 'sendTotalWeight',
  417. align: 'center'
  418. },
  419. {
  420. width: 100,
  421. prop: 'increaseTotalWeight',
  422. label: '增重重量',
  423. slot: 'increaseTotalWeight',
  424. align: 'center'
  425. },
  426. {
  427. width: 100,
  428. prop: 'weightUnit',
  429. label: '重量单位',
  430. slot: 'weightUnit',
  431. align: 'center'
  432. },
  433. // {
  434. // width: 160,
  435. // prop: 'pricingWay',
  436. // label: '计价方式',
  437. // slot: 'pricingWay',
  438. // align: 'center',
  439. // formatter: (row, column) => {
  440. // return row.pricingWay == 1
  441. // ? '按数量计费'
  442. // : row.pricingWay == 2
  443. // ? '按重量计费'
  444. // : '';
  445. // }
  446. // },
  447. // {
  448. // width: 160,
  449. // prop: 'singlePrice',
  450. // label: '单价',
  451. // slot: 'singlePrice',
  452. // align: 'center'
  453. // },
  454. // {
  455. // width: 160,
  456. // prop: 'taxRate',
  457. // label: '税率',
  458. // formatter: (_row, _column, cellValue) => {
  459. // return _row.taxRate ? _row.taxRate + '%' : '';
  460. // },
  461. // align: 'center'
  462. // },
  463. // {
  464. // width: 160,
  465. // prop: 'notaxSinglePrice',
  466. // label: '不含税单价',
  467. // align: 'center'
  468. // },
  469. // {
  470. // width: 160,
  471. // prop: 'discountSinglePrice',
  472. // label: '折后单价',
  473. // slot: 'discountSinglePrice',
  474. // align: 'center'
  475. // },
  476. // {
  477. // width: 120,
  478. // prop: 'totalPrice',
  479. // label: '合计',
  480. // slot: 'totalPrice',
  481. // align: 'center'
  482. // },
  483. // {
  484. // width: 120,
  485. // prop: 'discountTotalPrice',
  486. // label: '折后合计',
  487. // slot: 'discountTotalPrice',
  488. // align: 'center'
  489. // },
  490. {
  491. width: 120,
  492. prop: 'deliveryDays',
  493. label: '交期(天)',
  494. slot: 'deliveryDays',
  495. align: 'center'
  496. },
  497. {
  498. width: 200,
  499. prop: 'guaranteePeriod',
  500. label: '有效期',
  501. slot: 'guaranteePeriod',
  502. formatter: (_row, _column, cellValue) => {
  503. return (
  504. (_row.guaranteePeriod || '') + _row.guaranteePeriodUnitName
  505. );
  506. },
  507. align: 'center'
  508. },
  509. // {
  510. // width: 160,
  511. // prop: 'guaranteePeriodDeadline',
  512. // label: '质保截止日期',
  513. // slot: 'guaranteePeriodDeadline',
  514. // align: 'center'
  515. // },
  516. {
  517. prop: 'provenance',
  518. label: '产地',
  519. slot: 'provenance',
  520. align: 'center',
  521. // show:this.contractBookType==2,
  522. minWidth: 200,
  523. showOverflowTooltip: true,
  524. formatter: (row, column) => {
  525. return row.provenance && row.provenance.length
  526. ? row.provenance
  527. .map((item) => this.getDictValue('产地', item))
  528. .join(',')
  529. : '';
  530. }
  531. },
  532. {
  533. width: 130,
  534. prop: 'technicalAnswerName',
  535. label: '技术答疑人',
  536. slot: 'technicalAnswerName',
  537. align: 'center'
  538. },
  539. {
  540. width: 220,
  541. prop: 'technicalParams',
  542. label: '技术参数',
  543. slot: 'technicalParams',
  544. align: 'center'
  545. },
  546. {
  547. width: 240,
  548. prop: 'technicalDrawings',
  549. label: '技术图纸',
  550. slot: 'technicalDrawings',
  551. align: 'center'
  552. },
  553. {
  554. width: 220,
  555. prop: 'remark',
  556. label: '备注',
  557. slot: 'remark',
  558. align: 'center'
  559. }
  560. ]
  561. };
  562. },
  563. props: {
  564. businessId: {
  565. default: ''
  566. },
  567. taskDefinitionKey: {},
  568. isView: ''
  569. },
  570. async created() {
  571. await this.getDetailData(this.businessId);
  572. this.requestDict('产地');
  573. this.requestDict('生产类型');
  574. if (this.taskDefinitionKey == 'storemanApprove') {
  575. this.tabOptions.push({ key: 'outBound', name: '出库单' });
  576. this.activeComp = 'outBound';
  577. this.$emit('activeCompChange', 'outBound');
  578. // this.$nextTick(() => {
  579. // this.$refs.add.eomSuccess(this.form);
  580. // });
  581. }
  582. },
  583. methods: {
  584. changeActive(item) {
  585. this.activeComp = item.key;
  586. this.$emit('activeCompChange', item.key);
  587. // if (
  588. // this.taskDefinitionKey == 'storemanApprove' &&
  589. // item.key == 'outBound'
  590. // ) {
  591. // this.$nextTick(() => {
  592. // this.$refs.add.eomSuccess(this.form);
  593. // });
  594. // }
  595. },
  596. save(data) {
  597. this.$refs.add.handleNewSave(data);
  598. },
  599. success() {
  600. this.$emit('handleClose');
  601. },
  602. cancel() {
  603. this.$nextTick(() => {
  604. // 关闭后,销毁所有的表单数据
  605. (this.form = copyObj(this.formDef)),
  606. (this.otherForm = copyObj(this.otherFormDef)),
  607. (this.tableBankData = []);
  608. this.tableLinkData = [];
  609. this.visible = false;
  610. });
  611. },
  612. downloadFile(file) {
  613. getFile({ objectName: file.storePath }, file.name);
  614. },
  615. async getTableValue() {
  616. return {
  617. form: this.form,
  618. returnStorageData:
  619. this.$refs.add && (await this.$refs.add.getReturnStorage())
  620. };
  621. },
  622. async getDetailData(id) {
  623. this.loading = true;
  624. const data = await getByIdOnlyReplace(id);
  625. this.loading = false;
  626. if (data) {
  627. data.categoryLevelTopId = data.topCategoryIds;
  628. this.form = data;
  629. this.detailData = data;
  630. this.$nextTick(() => {
  631. this.$refs.add?.initFormData();
  632. this.$refs.outgoingDetai?._getInfo(data.docNo);
  633. });
  634. }
  635. }
  636. }
  637. };
  638. </script>
  639. <style scoped lang="scss">
  640. .title {
  641. font-size: 22px;
  642. font-weight: 800;
  643. margin-top: 15px;
  644. }
  645. .ele-dialog-form {
  646. .el-form-item {
  647. margin-bottom: 10px;
  648. }
  649. }
  650. .headbox {
  651. display: flex;
  652. justify-content: flex-start;
  653. align-items: center;
  654. .amount {
  655. font-size: 14px;
  656. font-weight: bold;
  657. margin-right: 20px;
  658. }
  659. }
  660. </style>