diff --git a/src/components/Template/CustomTable.vue b/src/components/Template/CustomTable.vue index 3efdc28..439367e 100644 --- a/src/components/Template/CustomTable.vue +++ b/src/components/Template/CustomTable.vue @@ -370,7 +370,7 @@ export default { } } // 检查其他输入框 - if (col.otherCode) { + if (col.otherCode && col.bodySubType !== 'span') { const otherValue = row[col.otherCode]; if (this.isValueEmpty(otherValue)) { diff --git a/src/views/business/comps/template/comps/sp/SWYPFXFFXYPZBB/Recovery.vue b/src/views/business/comps/template/comps/sp/SWYPFXFFXYPZBB/Recovery.vue index fcdb786..d38a62c 100644 --- a/src/views/business/comps/template/comps/sp/SWYPFXFFXYPZBB/Recovery.vue +++ b/src/views/business/comps/template/comps/sp/SWYPFXFFXYPZBB/Recovery.vue @@ -51,7 +51,7 @@ - + @@ -379,7 +379,6 @@ export default { console.log(content) //生成resource let tmpResource = [] - debugger //配置的试剂 tmpResource.push({ mc: content.targetName, @@ -403,7 +402,7 @@ export default { return content; }, async onSave() { - const formData = await this.getFilledFormData(); + const formData = await this.validFormFields(["rongyeTableRef", "tableRef"]) console.log(formData, "formData") }, diff --git a/src/views/business/comps/template/mixins/templateMixin.js b/src/views/business/comps/template/mixins/templateMixin.js index e701817..edd2fe0 100644 --- a/src/views/business/comps/template/mixins/templateMixin.js +++ b/src/views/business/comps/template/mixins/templateMixin.js @@ -155,7 +155,18 @@ export default { }) if (validFormData) { validFormData.forEach((item) => { - result = { ...result, ...item } + for (const [key, value] of Object.entries(item)) { + let index = 0; + // 如果当前键是可能重复的字段,且结果对象中已经存在该键,则添加索引后缀 + if ((key === 'headerSelectFields' || key === 'stepTableFormData') && result.hasOwnProperty(key)) { + // 为重复字段生成带索引的键名,从1开始(因为第一个组件不需要后缀) + const newKey = `${key}_${++index}`; + result[newKey] = value; + } else { + // 正常合并其他字段 + result[key] = value; + } + } }) return result }