Browse Source

feat:[模板管理][update]

ouqian
luojie 1 month ago
parent
commit
070d02094a
1 changed files with 96 additions and 70 deletions
  1. +96
    -70
      src/views/business/comps/template/comps/sp/SP00456.vue

+ 96
- 70
src/views/business/comps/template/comps/sp/SP00456.vue View File

@ -24,14 +24,13 @@
</template>
</CustomTable>
</div>
<LineLabel :label="isLba ? 'template.lba.lba005.bzqxpz' : 'template.common.operationSteps'" />
<LineLabel :label="getOperationStepsLabel()" />
<div v-if="fillType === 'preFill'" class="mt-20">
<el-button type="primary" @click="handleAddParalle">{{ $t('template.common.xzpxpz')
<el-button type="primary" @click="handleAddConfig('paralleConfigs')">{{ $t('template.common.xzpxpz')
}}</el-button>
<el-button type="primary" @click="handleAddLadder">{{ $t('template.common.xzjtpz')
<el-button type="primary" @click="handleAddConfig('ladderConfigs')">{{ $t('template.common.xzjtpz')
}}</el-button>
</div>
<!-- 阶梯配制区域 -->
<div v-for="(ladderConfig, ladderIndex) in formData.ladderConfigs"
:key="'ladder_' + ladderConfig.id">
@ -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" />
</div>
<!-- 平行配制区域 -->
<div :label="$t('template.common.pxpz')"
<div
v-for="(paralleConfig, paralleIndex) in formData.paralleConfigs"
:key="'paralle_' + paralleConfig.id">
<LadderConfig :currentFormConfig="paralleStepFormConfig" :currentFormData="paralleConfig"
:showOperation="fillType === 'actFill' || fillType === 'preFill'"
:tableColumns="paralleStepColumns" :prefixKey="'paralle_' + paralleIndex"
:configType="'paralle'"
:ref="`paralleRef_${paralleIndex}`" :fieldItemLabel="$t('template.common.pxpz')"
:ref="`paralleRef_${paralleIndex}`" :fieldItemLabel="'template.common.pxpz'"
@deleteConfig="deleteConfig('paralleConfigs',paralleConfig)"
:fillType="fillType" />
</div>
<template v-if="sn === 'LBA005'">
<LineLabel :label="$t('template.lba.lba005.zkpz')" />
<div v-if="fillType === 'preFill'" class="mt-20">
<el-button type="primary" @click="handleAddConfig('paralleConfigs_1')">{{ $t('template.common.xzpxpz')
}}</el-button>
<el-button type="primary" @click="handleAddConfig('ladderConfigs_1')">{{ $t('template.common.xzjtpz')
}}</el-button>
</div>
<!-- 阶梯配制区域 -->
<div v-for="(ladderConfig, ladderIndex) in formData.ladderConfigs_1"
:key="'ladder_1_' + ladderConfig.id">
<LadderConfig :currentFormConfig="ladderStepFormConfig" :currentFormData="ladderConfig"
:showOperation="fillType === 'actFill' || fillType === 'preFill'"
:tableColumns="ladderStepColumns" :prefixKey="'ladder_1_' + ladderIndex"
:configType="'ladder'"
:ref="`ladderRef_1_${ladderIndex}`" :fieldItemLabel="'template.common.jtpz'"
@deleteConfig="deleteConfig('ladderConfigs_1',ladderConfig)"
:fillType="fillType" />
</div>
<!-- 平行配制区域 -->
<div
v-for="(paralleConfig, paralleIndex) in formData.paralleConfigs_1"
:key="'paralle_1_' + paralleConfig.id">
<LadderConfig :currentFormConfig="paralleStepFormConfig" :currentFormData="paralleConfig"
:showOperation="fillType === 'actFill' || fillType === 'preFill'"
:tableColumns="paralleStepColumns" :prefixKey="'paralle_1_' + paralleIndex"
:configType="'paralle'"
:ref="`paralleRef_1_${paralleIndex}`" :fieldItemLabel="'template.common.pxpz'"
@deleteConfig="deleteConfig('paralleConfigs_1',paralleConfig)"
:fillType="fillType" />
</div>
</template>
<BaseInfoFormPackage fieldItemLabel="template.common.remark" label="template.common.remark"
ref="remarkRef" :formConfig="remarkConig" :formData="formData" />
@ -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() {
//

Loading…
Cancel
Save