detailDialog.vue 16 KB

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