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 cadbcdd..8be46bc 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 @@ - + @@ -68,7 +68,7 @@ import { getLatestSn } from '@/api/template'; import { getSWYPFXFFXYPZBBTableConfig, getSWYPFXFFXYPZBBTQHSLTableConfig } from "../../../formConfig/SWYPFXFFXYPZBBTableConfig.js"; import TableOpertaion from "@/components/Template/operation/TableOpertaion.vue" import SelectReagentDialog from '../../../dialog/SelectReagentDialog.vue'; - +import { EventBus } from "@/utils/eventBus"; export default { name: "SWYPFXRYPZB", components: { BaseInfoFormPcakge, LineLabel, TableList, Step, CustomTable, TableOpertaion, SelectReagentDialog }, @@ -406,7 +406,6 @@ export default { resourceList: null, } setTimeout(() => { - debugger EventBus.$emit('onModifyRecord', params,) }, 10); } @@ -475,7 +474,8 @@ export default { return content; }, async onSave() { - const formData = await this.validFormFields(["rongyeTableRef", "tableRef"]) + const formData = 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 77167ae..b12698a 100644 --- a/src/views/business/comps/template/mixins/templateMixin.js +++ b/src/views/business/comps/template/mixins/templateMixin.js @@ -140,7 +140,18 @@ export default { let result = {} refArr.map((ref) => { const refData = this.$refs[ref]?.getFilledFormData() || {} - result = { ...result, ...refData } + for (const [key, value] of Object.entries(refData)) { + 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 },