detailDialog.vue 18 KB

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