From a0006eaf98f4659e24dc23538111d1c1a794622b Mon Sep 17 00:00:00 2001 From: "han\\hanst" Date: Thu, 23 Jul 2026 11:33:39 +0800 Subject: [PATCH] site --- src/views/modules/common/uploadFileList1.vue | 24 ++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/src/views/modules/common/uploadFileList1.vue b/src/views/modules/common/uploadFileList1.vue index 8cb4914..fb27aac 100644 --- a/src/views/modules/common/uploadFileList1.vue +++ b/src/views/modules/common/uploadFileList1.vue @@ -95,7 +95,7 @@ export default { }, site:{ type: [String,Number], - default: '' + required: true }, bu:{ type: [String,Number], @@ -185,6 +185,12 @@ export default { } }, methods: { + resolveUploadSite () { + if (this.site !== null && this.site !== undefined && this.site !== '') { + return this.site + } + return '' + }, triggerUpload() { this.fileName = ''; // 清空文件名称 this.$refs.uploadFile.clearFiles(); // 清空上传文件列表 @@ -219,6 +225,11 @@ export default { } }, upload() { + const currentSite = this.resolveUploadSite() + if (currentSite === '') { + this.$message.warning("未获取到工厂,请重新选择数据后再上传") + return; + } if (this.fileList.length === 0) { this.$message.warning("未选择需要上传的文件") return; @@ -233,7 +244,7 @@ export default { } let data = new FormData(); data.append("file", this.fileList[0].raw); - data.append("orderRef1", this.$store.state.user.site); + data.append("orderRef1", currentSite); data.append("orderRef2", this.proofingId); data.append("orderRef3", this.id); data.append("orderRef4", this.projectId); @@ -314,8 +325,13 @@ export default { }); }, getProofDocument() { + const currentSite = this.resolveUploadSite() + if (currentSite === '') { + this.proofDocumentList = [] + return + } let tempData = { - site: this.$store.state.user.site, + site: currentSite, username: this.$store.state.user.name, buNo: this.bu, proofingId: this.proofingId, @@ -332,7 +348,7 @@ export default { if (data && data.code === 0) { this.proofDocumentList = data.page.list for (let i = 0; i < this.proofDocumentList.length; i++) { - this.proofDocumentList[i].buNo = this.proofDocumenCurrentRow.buNo + this.proofDocumentList[i].buNo = this.bu } } else { this.proofDocumentList = []