detailDialog.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645
  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="130px">
  19. <headerTitle title="收货信息"></headerTitle>
  20. <el-row>
  21. <el-col :span="12">
  22. <el-form-item
  23. label="供应商名称:"
  24. prop="supplierName"
  25. style="margin-bottom: 16px"
  26. >
  27. {{ form.supplierName }}
  28. </el-form-item>
  29. <el-form-item
  30. label="供应商联系人:"
  31. prop="linkName"
  32. style="margin-bottom: 16px"
  33. >
  34. {{ form.linkName }}
  35. </el-form-item>
  36. <el-form-item
  37. label="供应商电话:"
  38. prop="linkPhone"
  39. style="margin-bottom: 16px"
  40. >
  41. {{ form.linkPhone }}
  42. </el-form-item>
  43. <!-- <el-form-item
  44. label="客户地址:"
  45. prop="partaAddress"
  46. style="margin-bottom: 16px"
  47. >
  48. {{ form.receiveAddress }}
  49. </el-form-item> -->
  50. <el-form-item
  51. label="车牌号:"
  52. prop="carNo"
  53. style="margin-bottom: 16px"
  54. >
  55. {{ form.carNo }}
  56. </el-form-item>
  57. <el-form-item prop="receiveDate" label="收货日期:">
  58. {{ form.receiveDate }}
  59. </el-form-item>
  60. <el-form-item
  61. label="附件:"
  62. prop="receiveFiles"
  63. style="margin-bottom: 16px"
  64. >
  65. <fileMain v-model="form.receiveFiles" type="view"></fileMain>
  66. <!-- <div v-if="detailData.sendFiles && detailData.sendFiles?.length">-->
  67. <!-- <el-link-->
  68. <!-- v-for="link in detailData.sendFiles"-->
  69. <!-- :key="link.id"-->
  70. <!-- type="primary"-->
  71. <!-- :underline="false"-->
  72. <!-- @click="downloadFile(link)"-->
  73. <!-- >-->
  74. <!-- {{ link.name }}</el-link-->
  75. <!-- >-->
  76. <!-- </div>-->
  77. </el-form-item>
  78. </el-col>
  79. <el-col :span="12">
  80. <!-- <el-form-item-->
  81. <!-- label="采购单类型:"-->
  82. <!-- prop="receiveTypeName"-->
  83. <!-- style="margin-bottom: 16px"-->
  84. <!-- >-->
  85. <!-- {{ form.receiveTypeName }}-->
  86. <!-- </el-form-item>-->
  87. <el-form-item
  88. label="收货单编码:"
  89. prop="receiveNo"
  90. style="margin-bottom: 16px"
  91. >
  92. {{ form.receiveNo }}
  93. </el-form-item>
  94. <el-form-item prop="orderNo" label="订单编码:">
  95. {{ form.orderNo }}
  96. </el-form-item>
  97. <el-form-item prop="outsourceSendCode" label="委外发货单编码:">
  98. {{ form.outsourceSendCode }}
  99. </el-form-item>
  100. <el-form-item prop="pricingWay" label="计价方式:">
  101. {{ form.pricingWay == 1 ? '按数量计费' : '按重量计费' }}
  102. </el-form-item>
  103. <el-form-item
  104. label="制单人:"
  105. prop="makerName"
  106. style="margin-bottom: 16px"
  107. >
  108. {{ form.makerName }}
  109. </el-form-item>
  110. <el-form-item
  111. label="审核状态:"
  112. prop="reviewStatus"
  113. style="margin-bottom: 16px"
  114. >
  115. {{ reviewStatusEnum[form.reviewStatus]?.label }}
  116. </el-form-item>
  117. <!-- <el-form-item prop="replied" label="是否回执:">
  118. {{ form.replied == 1 ? '是' : '否' }}
  119. </el-form-item> -->
  120. </el-col>
  121. </el-row>
  122. </el-form>
  123. <headerTitle title="产品清单"></headerTitle>
  124. <ele-pro-table
  125. ref="table"
  126. :needPage="false"
  127. :columns="columns"
  128. :toolkit="[]"
  129. :datasource="detailData.productList"
  130. row-key="id"
  131. >
  132. <!-- <template v-slot:toolbar>
  133. <div class="headbox">
  134. <span class="amount">总计:{{detailData.totalAmount}}元</span>
  135. <span class="amount">应付金额:{{detailData.payAmount}}元</span>
  136. </div>
  137. </template> -->
  138. <template v-slot:technicalDrawings="{ row }">
  139. <fileMain v-model="row.receiveFiles" type="view"></fileMain>
  140. <!-- <div v-if="row.technicalDrawings && row.technicalDrawings?.length">-->
  141. <!-- <el-link-->
  142. <!-- v-for="link in row.technicalDrawings"-->
  143. <!-- :key="link.id"-->
  144. <!-- type="primary"-->
  145. <!-- :underline="false"-->
  146. <!-- @click="downloadFile(link)"-->
  147. <!-- >-->
  148. <!-- {{ link.name }}</el-link-->
  149. <!-- >-->
  150. <!-- </div>-->
  151. </template>
  152. </ele-pro-table>
  153. </div>
  154. <!-- <detailDialog
  155. v-if="activeComp == 'inoutBoundView'"
  156. :businessId="form.receiveNo"
  157. type="sourceBizNo"
  158. ref="detailDialog"
  159. :taskDefinitionKey="taskDefinitionKey"
  160. ></detailDialog> -->
  161. <!-- <procurementWarehousing
  162. v-if="activeComp == 'inoutBoundEdit'"
  163. :businessId="form.receiveNo"
  164. type="sourceBizNo"
  165. :infoData="form"
  166. ref="procurementWarehousing"
  167. :taskDefinitionKey="taskDefinitionKey"
  168. >
  169. </procurementWarehousing> -->
  170. <!-- <keep-alive>
  171. <add
  172. ref="add"
  173. v-if="activeComp == 'inoutBound'"
  174. :inboundType="form.sourceType"
  175. type="sourceBizNo"
  176. @success="success"
  177. ></add>
  178. </keep-alive> -->
  179. <keep-alive>
  180. <add
  181. ref="add"
  182. v-if="activeComp == 'inoutBound'"
  183. :form="form"
  184. :sourceBizNo="form.receiveNo"
  185. :saleProductList="form.productList"
  186. :bizType="2"
  187. :detailProductList="detailData.productList"
  188. ></add>
  189. </keep-alive>
  190. <detailDialog
  191. :bizType="2"
  192. v-if="activeComp == 'inoutBoundView'"
  193. :businessId="form.receiveNo"
  194. :isUpload="isUpload"
  195. ref="detailDialog"
  196. ></detailDialog>
  197. <procurementWarehousing
  198. v-if="activeComp == 'inoutBoundEdit'"
  199. :businessId="form.receiveNo"
  200. :qualityInspectionItems="qualityInspectionItems"
  201. ref="procurementWarehousing"
  202. >
  203. </procurementWarehousing>
  204. </div>
  205. </template>
  206. <script>
  207. import { getFile } from '@/api/system/file';
  208. import dictMixins from '@/mixins/dictMixins';
  209. import { reviewStatusEnum } from '@/enum/dict';
  210. import { getReceiveSaleOrderrecordDetail } from '@/api/bpm/components/purchasingManage/purchaseorderreceive';
  211. // import detailDialog from '@/views/bpm/handleTask/components/inoutBound/detailDialog.vue';
  212. import detailDialog from '@/views/bpm/stockManagement/details.vue';
  213. // import procurementWarehousing from '@/views/bpm/handleTask/components/purchaseOrder/invoice/procurementWarehousing';
  214. import procurementWarehousing from '@/views/bpm/stockManagement/quality.vue';
  215. // import add from './procurementStorage.vue';
  216. import add from '@/views/bpm/stockManagement/storage.vue';
  217. // import { getOutInBySourceBizNoOrError } from '@/api/classifyManage';
  218. import storageApi from '@/api/warehouseManagement';
  219. import fileMain from '@/components/addDoc/index.vue';
  220. export default {
  221. props: {
  222. businessId: {
  223. default: ''
  224. },
  225. taskId: {
  226. default: ''
  227. },
  228. taskDefinitionKey: {
  229. default: ''
  230. }
  231. },
  232. components: {
  233. fileMain,
  234. detailDialog,
  235. procurementWarehousing,
  236. add
  237. },
  238. mixins: [dictMixins],
  239. data() {
  240. return {
  241. qualityInspectionItems: [
  242. 'materielDesignation',
  243. 'clientCode',
  244. 'engrave',
  245. 'weight',
  246. 'result'
  247. ],
  248. isUpload: false,
  249. activeComp: 'main',
  250. tabOptions: [{ key: 'main', name: '收货单详情' }],
  251. reviewStatusEnum,
  252. visible: false,
  253. detailId: '',
  254. title: '详情',
  255. row: {},
  256. activeName: 'base',
  257. form: {
  258. orderFiles: [{ name: '222' }]
  259. },
  260. rules: {},
  261. detailData: {},
  262. columns: [
  263. {
  264. width: 45,
  265. type: 'index',
  266. columnKey: 'index',
  267. align: 'center',
  268. fixed: 'left'
  269. },
  270. {
  271. width: 200,
  272. prop: 'productName',
  273. label: '名称',
  274. slot: 'productName',
  275. align: 'center'
  276. },
  277. {
  278. width: 120,
  279. prop: 'productCode',
  280. label: '编码',
  281. slot: 'productCode',
  282. align: 'center'
  283. },
  284. {
  285. width: 200,
  286. prop: 'productCategoryName',
  287. label: '类型',
  288. slot: 'productCategoryName',
  289. align: 'center'
  290. },
  291. {
  292. width: 160,
  293. prop: 'productBrand',
  294. label: '牌号',
  295. slot: 'productBrand',
  296. align: 'center'
  297. },
  298. {
  299. width: 120,
  300. prop: 'modelType',
  301. label: '型号',
  302. slot: 'modelType',
  303. align: 'center'
  304. },
  305. {
  306. width: 120,
  307. prop: 'specification',
  308. label: '规格',
  309. slot: 'specification',
  310. align: 'center'
  311. },
  312. {
  313. width: 200,
  314. prop: 'warehouseName',
  315. label: '仓库名称',
  316. slot: 'warehouseName',
  317. align: 'center'
  318. },
  319. {
  320. width: 80,
  321. prop: 'totalCount',
  322. label: '进货数量',
  323. slot: 'totalCount',
  324. align: 'center'
  325. },
  326. {
  327. width: 120,
  328. prop: 'orderTotalCount',
  329. label: '总数量',
  330. slot: 'orderTotalCount',
  331. align: 'center'
  332. },
  333. {
  334. width: 80,
  335. prop: 'measuringUnit',
  336. label: '计量单位',
  337. slot: 'measuringUnit',
  338. align: 'center'
  339. },
  340. {
  341. width: 120,
  342. prop: 'singleWeight',
  343. label: '单重',
  344. slot: 'singleWeight',
  345. align: 'center'
  346. },
  347. {
  348. width: 200,
  349. prop: 'sendTotalWeight',
  350. label: '发货总重',
  351. slot: 'sendTotalWeight',
  352. align: 'center',
  353. headerSlot: 'headerTotalCount'
  354. },
  355. {
  356. width: 100,
  357. prop: 'receiveTotalWeight',
  358. label: '收货总重',
  359. slot: 'receiveTotalWeight',
  360. align: 'center'
  361. },
  362. {
  363. width: 100,
  364. prop: 'increaseTotalWeight',
  365. label: '增重重量',
  366. slot: 'increaseTotalWeight',
  367. align: 'center'
  368. },
  369. {
  370. width: 100,
  371. prop: 'weightUnit',
  372. label: '重量单位',
  373. slot: 'weightUnit',
  374. align: 'center'
  375. },
  376. {
  377. width: 160,
  378. prop: 'pricingWay',
  379. label: '计价方式',
  380. slot: 'pricingWay',
  381. align: 'center',
  382. formatter: (row, column) => {
  383. return row.pricingWay == 1 ? '数量' : row.pricingWay == 2 ? '重量':'';
  384. }
  385. },
  386. {
  387. width: 160,
  388. prop: 'singlePrice',
  389. label: '单价',
  390. slot: 'singlePrice',
  391. align: 'center'
  392. },
  393. {
  394. width: 120,
  395. prop: 'taxRate',
  396. label: '税率',
  397. slot: 'taxRate',
  398. align: 'center',
  399. },
  400. {
  401. width: 160,
  402. prop: 'discountSinglePrice',
  403. label: '折后单价',
  404. slot: 'discountSinglePrice',
  405. align: 'center'
  406. },
  407. {
  408. width: 120,
  409. prop: 'totalPrice',
  410. label: '合计',
  411. slot: 'totalPrice',
  412. align: 'center'
  413. },
  414. {
  415. width: 160,
  416. prop: 'discountTotalPrice',
  417. label: '折后合计',
  418. slot: 'discountTotalPrice',
  419. align: 'center'
  420. },
  421. {
  422. width: 80,
  423. prop: 'deliveryDays',
  424. label: '交期(天)',
  425. slot: 'deliveryDays',
  426. align: 'center'
  427. },
  428. {
  429. width: 160,
  430. prop: 'deliveryDeadline',
  431. label: '交期截止日期',
  432. slot: 'deliveryDeadline',
  433. align: 'center'
  434. },
  435. {
  436. width: 200,
  437. prop: 'guaranteePeriod',
  438. label: '质保期',
  439. slot: 'guaranteePeriod',
  440. align: 'center'
  441. },
  442. {
  443. width: 160,
  444. prop: 'guaranteePeriodDeadline',
  445. label: '质保截止日期',
  446. slot: 'guaranteePeriodDeadline',
  447. align: 'center'
  448. },
  449. {
  450. width: 130,
  451. prop: 'technicalAnswerName',
  452. label: '技术答疑人',
  453. slot: 'technicalAnswerName',
  454. align: 'center'
  455. },
  456. {
  457. width: 220,
  458. prop: 'technicalParams',
  459. label: '技术参数',
  460. slot: 'technicalParams',
  461. align: 'center'
  462. },
  463. {
  464. width: 240,
  465. prop: 'technicalDrawings',
  466. label: '技术图纸',
  467. slot: 'technicalDrawings',
  468. align: 'center'
  469. },
  470. {
  471. width: 220,
  472. prop: 'remark',
  473. label: '备注',
  474. slot: 'remark',
  475. align: 'center'
  476. }
  477. ]
  478. };
  479. },
  480. async created() {
  481. await this.getDetailData(this.businessId);
  482. // getOutInBySourceBizNoOrError(this.form.receiveNo)
  483. storageApi
  484. .getInfoBySourceBizNo(this.form.receiveNo)
  485. .then((res) => {
  486. console.log('-----------!_-------!_');
  487. console.log(res);
  488. if (JSON.stringify(res) == '{}') {
  489. // 未查询到相关信息(未入库)
  490. if (this.taskDefinitionKey == 'storeManagerApprove') {
  491. this.tabOptions.push({ key: 'inoutBound', name: '入库单' });
  492. this.activeComp = 'inoutBound';
  493. this.$emit('activeCompChange', 'inoutBound');
  494. // this.$nextTick(() => {
  495. // this.$refs.add.pickerSuccess(this.form);
  496. // });
  497. }
  498. } else {
  499. if (this.taskDefinitionKey == 'qualityInspection') {
  500. this.tabOptions.push({
  501. key: 'inoutBoundEdit',
  502. name: '入库单详情(已入库)'
  503. });
  504. this.activeComp = 'inoutBoundEdit';
  505. } else if (this.taskDefinitionKey == 'qualityInspectionFeedback') {
  506. this.tabOptions.push({
  507. key: 'inoutBoundView',
  508. name: '入库单详情'
  509. });
  510. this.isUpload = true;
  511. this.activeComp = 'inoutBoundView';
  512. } else {
  513. this.tabOptions.push({
  514. key: 'inoutBoundView',
  515. name: '入库单详情'
  516. });
  517. this.isUpload = false;
  518. this.activeComp = 'inoutBoundView';
  519. }
  520. // if (
  521. // ![
  522. // 'starter',
  523. // 'deptLeaderApprove',
  524. // 'storeManagerApprove',
  525. // 'qualityInspection'
  526. // ].includes(this.taskDefinitionKey)
  527. // ) {
  528. // this.tabOptions.push({
  529. // key: 'inoutBoundView',
  530. // name: '入库单详情'
  531. // });
  532. // this.isUpload = true;
  533. // this.activeComp = 'inoutBoundView';
  534. // } else {
  535. // this.tabOptions.push({
  536. // key: 'inoutBoundEdit',
  537. // name: '入库单详情(已入库)'
  538. // });
  539. // this.activeComp = 'inoutBoundEdit';
  540. // }
  541. }
  542. })
  543. .catch(() => {
  544. this.$message.error('获取入库单详情失败');
  545. });
  546. },
  547. methods: {
  548. changeActive(item) {
  549. console.log(item, '切换!!!!!!!!!!!!!!!!!!!!');
  550. this.activeComp = item.key;
  551. this.$emit('activeCompChange', item.key);
  552. // if (
  553. // this.taskDefinitionKey == 'storeManagerApprove' &&
  554. // item.key == 'inoutBound'
  555. // ) {
  556. // this.$nextTick(() => {
  557. // this.$refs.add.pickerSuccess(this.form);
  558. // });
  559. // }
  560. },
  561. save(data) {
  562. this.$refs.add.handleSave(data);
  563. },
  564. success() {
  565. // console.log(this.$parent,'this.$parent')
  566. // this.$parent.handleClose()
  567. this.$emit('handleClose');
  568. },
  569. downloadFile(file) {
  570. getFile({ objectName: file.storePath }, file.name);
  571. },
  572. // 判断质检状态是否全部已检
  573. allListChecked() {
  574. return (
  575. this.$refs.procurementWarehousing &&
  576. this.$refs.procurementWarehousing.getStatus()
  577. );
  578. },
  579. async getTableValue() {
  580. return {
  581. form: this.form,
  582. // packingList: this.$refs.procurementWarehousing &&
  583. // (await this.$refs.procurementWarehousing.getTableValue()),
  584. returnStorageData:
  585. this.$refs.add && (await this.$refs.add.getReturnStorage()),
  586. isAllChecked:
  587. this.$refs.procurementWarehousing &&
  588. (await this.$refs.procurementWarehousing.getStatus()),
  589. qualityInspector:
  590. (this.$refs.detailDialog &&
  591. this.$refs.detailDialog.getQualityFile()) ||
  592. {}
  593. // qualityInspector:
  594. // (this.$refs.detailDialog &&
  595. // this.$refs.detailDialog.getQualityFile()) ||
  596. // {}
  597. };
  598. },
  599. async getDetailData(id) {
  600. this.loading = true;
  601. const data = await getReceiveSaleOrderrecordDetail(id);
  602. this.loading = false;
  603. if (data) {
  604. this.form = data;
  605. this.detailData = data;
  606. console.log(
  607. this.detailData,
  608. 'this.detailDatathis.detailDatathis.detailDatathis.detailData'
  609. );
  610. }
  611. }
  612. }
  613. };
  614. </script>
  615. <style scoped lang="scss">
  616. .ele-dialog-form {
  617. .el-form-item {
  618. margin-bottom: 10px;
  619. }
  620. }
  621. .headbox {
  622. display: flex;
  623. justify-content: flex-start;
  624. align-items: center;
  625. .amount {
  626. font-size: 14px;
  627. font-weight: bold;
  628. margin-right: 20px;
  629. }
  630. }
  631. </style>