detailDialog.vue 19 KB

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