From 3ef6a3a2bac778e2a224d6e437305b9f71d3799c Mon Sep 17 00:00:00 2001 From: 曹睿 <360930172@qq.com> Date: 星期一, 07 七月 2025 15:30:23 +0800 Subject: [PATCH] feat: 【来票台账】添加附件上传 --- src/views/procurementManagement/procurementInvoiceLedger/index.vue | 37 ++++++++++++++++++++++++++----------- 1 files changed, 26 insertions(+), 11 deletions(-) diff --git a/src/views/procurementManagement/procurementInvoiceLedger/index.vue b/src/views/procurementManagement/procurementInvoiceLedger/index.vue index 4149e50..bbbce7c 100644 --- a/src/views/procurementManagement/procurementInvoiceLedger/index.vue +++ b/src/views/procurementManagement/procurementInvoiceLedger/index.vue @@ -59,14 +59,15 @@ @pagination="changePage" > <template #commonFilesRef="{ row }"> - <el-dropdown - v-if="row.commonFiles.length !== 0" - @command="(command) => handleCommand(command, row)" - > + <el-dropdown @command="(command) => handleCommand(command, row)"> <el-button link :icon="Files" type="danger"> 闄勪欢 </el-button> <template #dropdown> <el-dropdown-menu> - <el-dropdown-item :icon="Download" command="download"> + <el-dropdown-item + v-if="row.commonFiles.length !== 0" + :icon="Download" + command="download" + > 涓嬭浇 </el-dropdown-item> <el-dropdown-item :icon="Upload" command="upload"> @@ -75,11 +76,10 @@ </el-dropdown-menu> </template> </el-dropdown> - <el-text v-else type="danger">鏆傛棤闄勪欢</el-text> </template> </PIMTable> </div> - <Modal ref="modalRef"></Modal> + <Modal ref="modalRef" @uploadSuccess="uploadSuccess"></Modal> </div> </template> @@ -87,7 +87,10 @@ import { ref, getCurrentInstance } from "vue"; import { usePaginationApi } from "@/hooks/usePaginationApi"; import { Files, Download, Search, Upload } from "@element-plus/icons-vue"; -import { productRecordPage } from "@/api/procurementManagement/procurementInvoiceLedger.js"; +import { + productRecordPage, + productUploadFile, +} from "@/api/procurementManagement/procurementInvoiceLedger.js"; import { onMounted } from "vue"; import { ElMessageBox } from "element-plus"; import Modal from "./Modal/UploadModal.vue"; @@ -260,13 +263,25 @@ break; case "upload": console.log(row.commonFiles); - openModal(); + openModal(row.ticketRegistrationId); break; } }; -const openModal = () => { - modalRef.value.handleImport(); +const openModal = (id) => { + modalRef.value.handleImport(id); +}; + +// 涓婁紶鎴愬姛鍚庡仛浠�涔� +const uploadSuccess = async (data) => { + const { code } = await productUploadFile({ + ticketRegistrationId: data.id, + tempFileIds: data.tempFileIds, + }); + if (code === 200) { + proxy.$modal.msgSuccess("鎻愪氦鎴愬姛"); + getTableData(); + } }; onMounted(() => { -- Gitblit v1.9.3