diff --git a/src/components/Template/CustomTable.vue b/src/components/Template/CustomTable.vue index b36964d..672beaf 100644 --- a/src/components/Template/CustomTable.vue +++ b/src/components/Template/CustomTable.vue @@ -732,19 +732,7 @@ export default { errors: errors }; }, - // 判断值是否为空 - isValueEmpty(value) { - if (value === null || value === undefined || value === '') { - return true; - } - if (typeof value === 'string' && value.trim() === '') { - return true; - } - if (Array.isArray(value) && value.length === 0) { - return true; - } - return false; - }, + // 表头选择器变化 onHeaderSelectChange(col, value) { if (col.headerSelectTo) { @@ -943,6 +931,9 @@ export default { this.isIndeterminate = false; this.$emit('selectionChange', this.selectedRows); }, + updateHeaderSelectFields(fields) { + this.headerSelectFields = {...this.headerSelectFields, ...fields}; + }, // 更新数据方法,可在formData变更时调用,也可由父组件调用 updateDataSource(dataSource = []) { this.oldLocalDataSource = JSON.parse(JSON.stringify(this.localDataSource)); diff --git a/src/components/Template/Step.vue b/src/components/Template/Step.vue index d039871..e12be5f 100644 --- a/src/components/Template/Step.vue +++ b/src/components/Template/Step.vue @@ -436,6 +436,7 @@ export default { type: '', formData: {} }) + justUpdateFilledFormData(); this.$emit('step-added', this.steps.length) } catch (error) { console.error('添加步骤失败:', error) @@ -447,6 +448,7 @@ export default { if (this.steps.length > 1) { const removedStep = this.steps.splice(index, 1)[0] + justUpdateFilledFormData(); this.$emit('step-removed', { index, step: removedStep, remaining: this.steps.length }) } else { this.$message.warning('至少需要保留一个步骤') diff --git a/src/views/business/comps/template/comps/sp/SP00456.vue b/src/views/business/comps/template/comps/sp/SP00456.vue index 648c2c6..248877e 100644 --- a/src/views/business/comps/template/comps/sp/SP00456.vue +++ b/src/views/business/comps/template/comps/sp/SP00456.vue @@ -40,8 +40,18 @@
+ + /> +
@@ -152,9 +162,10 @@ import { getLadderColumnsConfig, getParallelColumnsConfig, getLadderFormConfig, getBaseInfoFormConfig, getRemarkFormConfig, getStorageConditionFormConfig, getParalleStepFormConfig ,getJcbColumnsConfig } from "../../formConfig/paralleAndLadderConfig.js"; +import LadderConfig from "@/views/business/comps/template/comps/sp/comps/LadderConfig.vue"; export default { name: "SP00456", - components: { BaseInfoFormPackage, LineLabel, TableList, Step, CustomTable, SelectReagentDialog, TableOpertaion, TableOpertaionDelete }, + components: { LadderConfig,BaseInfoFormPackage, LineLabel, TableList, Step, CustomTable, SelectReagentDialog, TableOpertaion, TableOpertaionDelete, LadderConfig }, mixins: [templateMixin], props: { fillType: { @@ -684,14 +695,16 @@ export default { if (this.formData.ladderConfigs && this.formData.ladderConfigs.length > 0) { for (let i = 0; i < this.formData.ladderConfigs.length; i++) { const id = this.formData.ladderConfigs[i].id; - const ladderFormData = this.$refs[`ladderStepFormPackageRef_${i}`][0].getFilledFormData(); - const ladderTableFormData = this.$refs[`ladderStepTableRef_${i}`][0].getFilledFormData(); - const ladderStepData = this.$refs[`ladderStepRef_${i}`][0].getFilledFormData(); + const { + baseFormData, + tableData, + stepData, + } = this.$refs[`ladderRef_${i}`][0].getFilledFormData(); ladderConfigsData.push({ - ...ladderFormData, - ...ladderTableFormData, - ladderStepData: ladderStepData.stepData, + ...baseFormData, + ...tableData, + ladderStepData: stepData, showLadderConfig: true, id }); diff --git a/src/views/business/comps/template/comps/sp/comps/LadderConfig.vue b/src/views/business/comps/template/comps/sp/comps/LadderConfig.vue new file mode 100644 index 0000000..2912f44 --- /dev/null +++ b/src/views/business/comps/template/comps/sp/comps/LadderConfig.vue @@ -0,0 +1,338 @@ + + + + + \ No newline at end of file diff --git a/src/views/business/comps/template/mixins/templateMixin.js b/src/views/business/comps/template/mixins/templateMixin.js index 126a174..a4407f1 100644 --- a/src/views/business/comps/template/mixins/templateMixin.js +++ b/src/views/business/comps/template/mixins/templateMixin.js @@ -372,10 +372,8 @@ export default { }, //统一校验form表单是否填写 async validFormFields(refArr = []) { - console.log(refArr,2121) let result = {} const refs = refArr.map((ref) => { - console.log(ref,312312321) let refData = {} if (this.$refs[ref][0]) { refData = this.$refs[ref][0]?.getFormData() || {}