detailDialog.vue 20 KB

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