From 65fc038b7c41ddaba8d4ed34893301e84bcd9180 Mon Sep 17 00:00:00 2001 From: chenhao Date: Wed, 3 Dec 2025 10:36:41 +0800 Subject: [PATCH] =?UTF-8?q?fix(order):=20=E7=BB=9F=E4=B8=80=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E6=8E=92=E5=BA=8F=E5=AD=97=E6=AE=B5=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E4=B8=BA=E5=AD=97=E7=AC=A6=E4=B8=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将 contractTableData 中的 fileSort 字段统一改为字符串类型 - 修改上传文件时的 fileSort 赋值逻辑,确保类型一致性 - 更新文件查找逻辑,使用 == 进行比较以兼容字符串和数字类型 - 修复上传输入框点击事件中的 sortNum 类型处理 - 确保所有版本 tab 初始化时 fileSort 使用字符串值 --- .../src/views/project/order/OrderDetail.vue | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/oms_web/oms_vue/src/views/project/order/OrderDetail.vue b/oms_web/oms_vue/src/views/project/order/OrderDetail.vue index 6a7875f2..8552e44b 100644 --- a/oms_web/oms_vue/src/views/project/order/OrderDetail.vue +++ b/oms_web/oms_vue/src/views/project/order/OrderDetail.vue @@ -372,12 +372,12 @@ export default { const files = this.form.contractTableData[currentVersion]; const existingSorts = new Set(files.map(f => String(f.fileSort))); if (this.canUpdate) { - if (!existingSorts.has('0')) files.push({id: -1, fileSort: 0}); - if (!existingSorts.has('1')) files.push({id: -1, fileSort: 1}); - if (!existingSorts.has('2')) files.push({id: -1, fileSort: 2}); + if (!existingSorts.has('0')) files.push({id: -1, fileSort: "0"}); + if (!existingSorts.has('1')) files.push({id: -1, fileSort: "1"}); + if (!existingSorts.has('2')) files.push({id: -1, fileSort: "2"}); } if (this.uploadFinalFile) { - if (!existingSorts.has('3')) files.push({id: -1, fileSort: 3}); + if (!existingSorts.has('3')) files.push({id: -1, fileSort: "3"}); } if (this.uniqueVersions.length > 0) this.activeVersionTab = String(this.uniqueVersions[0]); @@ -393,9 +393,9 @@ export default { const currentVersion = String(this.form.versionCode); this.$set(this.form, 'contractTableData', { [currentVersion]: [ - { id: -1, fileSort: 0 }, - { id: -1, fileSort: 1 }, - { id: -1, fileSort: 2 } + { id: -1, fileSort: "0" }, + { id: -1, fileSort: "1" }, + { id: -1, fileSort: "2" } ] }); this.activeContractVersionTab = currentVersion; @@ -565,12 +565,12 @@ export default { this.$modal.alertWarning("请先保存订单,再上传合同信息"); return; } - this.fileSort = sortNum; + this.fileSort = String(sortNum); document.getElementById(`uploadInput${sortNum > 1 ? 2 : sortNum}`).click(); }, addFile(data) { const currentVersionFiles = this.groupedContractFiles[String(this.form.versionCode)].files; - const fileIndex = currentVersionFiles.findIndex(file => file.fileSort === data.fileSort); + const fileIndex = currentVersionFiles.findIndex(file => file.fileSort == data.fileSort); if (fileIndex !== -1) this.$set(currentVersionFiles, fileIndex, data); else currentVersionFiles.push(data); }, @@ -581,7 +581,7 @@ export default { const currentVersionFiles = this.groupedContractFiles[String(this.activeContractVersionTab)].files; const fileIndex = currentVersionFiles.findIndex(file => file.id === id); if (fileIndex !== -1) { - this.$set(currentVersionFiles, fileIndex, { id: -1, fileSort: sortNum }); + this.$set(currentVersionFiles, fileIndex, { id: -1, fileSort: String(sortNum) }); } }); });