diff --git a/src/views/business/comps/template/comps/sp/SP00456.vue b/src/views/business/comps/template/comps/sp/SP00456.vue index 2aacc99..30d3992 100644 --- a/src/views/business/comps/template/comps/sp/SP00456.vue +++ b/src/views/business/comps/template/comps/sp/SP00456.vue @@ -24,14 +24,13 @@ - +
- {{ $t('template.common.xzpxpz') + {{ $t('template.common.xzpxpz') }} - {{ $t('template.common.xzjtpz') + {{ $t('template.common.xzjtpz') }}
-
@@ -39,23 +38,56 @@ :showOperation="fillType === 'actFill' || fillType === 'preFill'" :tableColumns="ladderStepColumns" :prefixKey="'ladder_' + ladderIndex" :configType="'ladder'" - :ref="`ladderRef_${ladderIndex}`" :fieldItemLabel="$t('template.common.jtpz')" + :ref="`ladderRef_${ladderIndex}`" :fieldItemLabel="'template.common.jtpz'" @deleteConfig="deleteConfig('ladderConfigs',ladderConfig)" :fillType="fillType" />
-
+ @@ -86,6 +118,28 @@ import { getBaseInfoFormConfig, getRemarkFormConfig, getStorageConditionFormConfig, getParalleStepFormConfig, getJcbColumnsConfig } from "../../formConfig/paralleAndLadderConfig.js"; import LadderConfig from "@/views/business/comps/template/comps/sp/comps/LadderConfig.vue"; +const configTyps =[ + { + configType: "paralle", + ref: "paralleRef", + configName: "paralleConfigs", + }, + { + configType: "ladder", + ref: "ladderRef", + configName: "ladderConfigs", + }, + { + configType: "paralle", + ref: "paralleRef_1", + configName: "paralleConfigs_1", + }, + { + configType: "ladder", + ref: "ladderRef_1", + configName: "ladderConfigs_1", + }, +] export default { name: "SP00456", components: { LadderConfig, BaseInfoFormPackage, LineLabel, TableList, Step, CustomTable, SelectReagentDialog, TableOpertaion, TableOpertaionDelete, LadderConfig }, @@ -141,7 +195,7 @@ export default { }, }, data() { - const labArr = ["LBA005", "LBA007"] + const labArr = ["LBA005", "LBA007"]; return { subSolutionVisible: false, currentSubKey: "",//当前点击的子项key @@ -164,6 +218,14 @@ export default { } }, methods: { + // 获取操作步骤标签 + getOperationStepsLabel() { + const obj = { + "LBA005": "template.lba.lba005.bzqxpz",//标准曲线配制 + "LBA007": "template.lba.lba005.bzqxpz",// + } + return obj[this.sn] || 'template.common.operationSteps';//操作步骤 + }, deleteJcbRow(rowIndex) { const jcbRef = this.$refs['jcbRef']; if (jcbRef) { @@ -228,13 +290,13 @@ export default { }) }, //新增平行配制 - handleAddParalle() { + handleAddConfig(configType) { // 初始化平行配制配置列表 - if (!this.formData.paralleConfigs) { - this.$set(this.formData, 'paralleConfigs', []); + if (!this.formData[configType]) { + this.$set(this.formData, configType, []); } // 添加新的平行配制配置 - this.formData.paralleConfigs.push({ + this.formData[configType].push({ id: getuuid(), stepData: [], paralleTableFormData: [], @@ -242,22 +304,6 @@ export default { }); this.justUpdateFilledFormData(); }, - //新增阶梯配制 - handleAddLadder() { - // 初始化阶梯配制配置列表 - if (!this.formData.ladderConfigs) { - this.$set(this.formData, 'ladderConfigs', []); - } - - // 添加新的阶梯配制配置 - this.formData.ladderConfigs.push({ - id: getuuid(), - stepData: [], - ladderTableFormData: [], - showLadderConfig: true - }); - this.justUpdateFilledFormData(); - }, // 删除阶梯配制配置 deleteConfig(type, con) { const configIndex = this.formData[type].findIndex(config => config.id === con.id); @@ -301,61 +347,41 @@ export default { }, getFilledFormData() { const baseData = this.$refs.baseInfoRef.getFilledFormData(); - let conditionData = {}; + let conditionData = {},jcbData = []; if (!this.isLba) { conditionData = this.$refs.storageConditionRef.getFilledFormData(); + }else{ + jcbData = this.$refs.jcbRef.getFilledFormData(); } - - // 获取所有阶梯配制数据 - const ladderConfigsData = []; - 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 { - baseFormData, - tableData, - stepData, - } = this.$refs[`ladderRef_${i}`][0].getFilledFormData(); - - ladderConfigsData.push({ - ...baseFormData, - ...tableData, - stepData: stepData, - showLadderConfig: true, - id - }); - } + const remarkData = this.$refs.remarkRef.getFilledFormData(); + const paramsData = { + ...baseData, + ...conditionData, + ...jcbData, + ...remarkData } - - // 获取所有平行配制数据 - const paralleConfigsData = []; - if (this.formData.paralleConfigs && this.formData.paralleConfigs.length > 0) { - for (let i = 0; i < this.formData.paralleConfigs.length; i++) { - const id = this.formData.paralleConfigs[i].id; + configTyps.map((item)=>{ + const { ref, configName } = item; + const configs = this.formData[configName] || []; + const configData= []; + configs.map((sItem,index)=>{ + const {id} = sItem; const { baseFormData, tableData, stepData, - } = this.$refs[`paralleRef_${i}`][0].getFilledFormData(); - - paralleConfigsData.push({ + } = this.$refs[`${ref}_${index}`][0].getFilledFormData(); + configData.push({ ...baseFormData, ...tableData, stepData: stepData, - showParalleConfig: true, + showLadderConfig: true, id }); - } - } - - const remarkData = this.$refs.remarkRef.getFilledFormData(); - return { - ...baseData, - ...conditionData, - ladderConfigs: ladderConfigsData, - paralleConfigs: paralleConfigsData, - ...remarkData - } + }) + paramsData[configName] = configData; + }) + return paramsData }, async getFormData() { //先校验再获取值