|
|
@ -26,9 +26,11 @@ |
|
|
</div> |
|
|
</div> |
|
|
<LineLabel :label="getOperationStepsLabel()" /> |
|
|
<LineLabel :label="getOperationStepsLabel()" /> |
|
|
<div v-if="fillType === 'preFill'" class="mt-20"> |
|
|
<div v-if="fillType === 'preFill'" class="mt-20"> |
|
|
<el-button type="primary" @click="handleAddConfig('paralleConfigs')">{{ $t('template.common.xzpxpz') |
|
|
|
|
|
|
|
|
<el-button type="primary" @click="handleAddConfig('paralleConfigs')">{{ |
|
|
|
|
|
$t('template.common.xzpxpz') |
|
|
}}</el-button> |
|
|
}}</el-button> |
|
|
<el-button type="primary" @click="handleAddConfig('ladderConfigs')">{{ $t('template.common.xzjtpz') |
|
|
|
|
|
|
|
|
<el-button type="primary" @click="handleAddConfig('ladderConfigs')">{{ |
|
|
|
|
|
$t('template.common.xzjtpz') |
|
|
}}</el-button> |
|
|
}}</el-button> |
|
|
</div> |
|
|
</div> |
|
|
<!-- 阶梯配制区域 --> |
|
|
<!-- 阶梯配制区域 --> |
|
|
@ -37,30 +39,29 @@ |
|
|
<LadderConfig :currentFormConfig="ladderStepFormConfig" :currentFormData="ladderConfig" |
|
|
<LadderConfig :currentFormConfig="ladderStepFormConfig" :currentFormData="ladderConfig" |
|
|
:showOperation="fillType === 'actFill' || fillType === 'preFill'" |
|
|
:showOperation="fillType === 'actFill' || fillType === 'preFill'" |
|
|
:tableColumns="ladderStepColumns" :prefixKey="'ladder_' + ladderIndex" |
|
|
:tableColumns="ladderStepColumns" :prefixKey="'ladder_' + ladderIndex" |
|
|
:configType="'ladder'" |
|
|
|
|
|
:ref="`ladderRef_${ladderIndex}`" :fieldItemLabel="'template.common.jtpz'" |
|
|
|
|
|
@deleteConfig="deleteConfig('ladderConfigs',ladderConfig)" |
|
|
|
|
|
:fillType="fillType" /> |
|
|
|
|
|
|
|
|
:configType="'ladder'" :ref="`ladderRef_${ladderIndex}`" |
|
|
|
|
|
:fieldItemLabel="'template.common.jtpz'" |
|
|
|
|
|
@deleteConfig="deleteConfig('ladderConfigs', ladderConfig)" :fillType="fillType" /> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<!-- 平行配制区域 --> |
|
|
<!-- 平行配制区域 --> |
|
|
<div |
|
|
|
|
|
v-for="(paralleConfig, paralleIndex) in formData.paralleConfigs" |
|
|
|
|
|
|
|
|
<div v-for="(paralleConfig, paralleIndex) in formData.paralleConfigs" |
|
|
:key="'paralle_' + paralleConfig.id"> |
|
|
:key="'paralle_' + paralleConfig.id"> |
|
|
<LadderConfig :currentFormConfig="paralleStepFormConfig" :currentFormData="paralleConfig" |
|
|
<LadderConfig :currentFormConfig="paralleStepFormConfig" :currentFormData="paralleConfig" |
|
|
:showOperation="fillType === 'actFill' || fillType === 'preFill'" |
|
|
:showOperation="fillType === 'actFill' || fillType === 'preFill'" |
|
|
:tableColumns="paralleStepColumns" :prefixKey="'paralle_' + paralleIndex" |
|
|
:tableColumns="paralleStepColumns" :prefixKey="'paralle_' + paralleIndex" |
|
|
:configType="'paralle'" |
|
|
|
|
|
:ref="`paralleRef_${paralleIndex}`" :fieldItemLabel="'template.common.pxpz'" |
|
|
|
|
|
@deleteConfig="deleteConfig('paralleConfigs',paralleConfig)" |
|
|
|
|
|
:fillType="fillType" /> |
|
|
|
|
|
|
|
|
:configType="'paralle'" :ref="`paralleRef_${paralleIndex}`" |
|
|
|
|
|
:fieldItemLabel="'template.common.pxpz'" |
|
|
|
|
|
@deleteConfig="deleteConfig('paralleConfigs', paralleConfig)" :fillType="fillType" /> |
|
|
</div> |
|
|
</div> |
|
|
<template v-if="sn === 'LBA005'"> |
|
|
<template v-if="sn === 'LBA005'"> |
|
|
<LineLabel :label="$t('template.lba.lba005.zkpz')" /> |
|
|
<LineLabel :label="$t('template.lba.lba005.zkpz')" /> |
|
|
<div v-if="fillType === 'preFill'" class="mt-20"> |
|
|
<div v-if="fillType === 'preFill'" class="mt-20"> |
|
|
<el-button type="primary" @click="handleAddConfig('paralleConfigs_1')">{{ $t('template.common.xzpxpz') |
|
|
|
|
|
|
|
|
<el-button type="primary" @click="handleAddConfig('paralleConfigs_1')">{{ |
|
|
|
|
|
$t('template.common.xzpxpz') |
|
|
}}</el-button> |
|
|
}}</el-button> |
|
|
<el-button type="primary" @click="handleAddConfig('ladderConfigs_1')">{{ $t('template.common.xzjtpz') |
|
|
|
|
|
|
|
|
<el-button type="primary" @click="handleAddConfig('ladderConfigs_1')">{{ |
|
|
|
|
|
$t('template.common.xzjtpz') |
|
|
}}</el-button> |
|
|
}}</el-button> |
|
|
</div> |
|
|
</div> |
|
|
<!-- 阶梯配制区域 --> |
|
|
<!-- 阶梯配制区域 --> |
|
|
@ -69,23 +70,20 @@ |
|
|
<LadderConfig :currentFormConfig="ladderStepFormConfig" :currentFormData="ladderConfig" |
|
|
<LadderConfig :currentFormConfig="ladderStepFormConfig" :currentFormData="ladderConfig" |
|
|
:showOperation="fillType === 'actFill' || fillType === 'preFill'" |
|
|
:showOperation="fillType === 'actFill' || fillType === 'preFill'" |
|
|
:tableColumns="ladderStepColumns" :prefixKey="'ladder_1_' + ladderIndex" |
|
|
:tableColumns="ladderStepColumns" :prefixKey="'ladder_1_' + ladderIndex" |
|
|
:configType="'ladder'" |
|
|
|
|
|
:ref="`ladderRef_1_${ladderIndex}`" :fieldItemLabel="'template.common.jtpz'" |
|
|
|
|
|
@deleteConfig="deleteConfig('ladderConfigs_1',ladderConfig)" |
|
|
|
|
|
:fillType="fillType" /> |
|
|
|
|
|
|
|
|
:configType="'ladder'" :ref="`ladderRef_1_${ladderIndex}`" |
|
|
|
|
|
:fieldItemLabel="'template.common.jtpz'" |
|
|
|
|
|
@deleteConfig="deleteConfig('ladderConfigs_1', ladderConfig)" :fillType="fillType" /> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<!-- 平行配制区域 --> |
|
|
<!-- 平行配制区域 --> |
|
|
<div |
|
|
|
|
|
v-for="(paralleConfig, paralleIndex) in formData.paralleConfigs_1" |
|
|
|
|
|
|
|
|
<div v-for="(paralleConfig, paralleIndex) in formData.paralleConfigs_1" |
|
|
:key="'paralle_1_' + paralleConfig.id"> |
|
|
:key="'paralle_1_' + paralleConfig.id"> |
|
|
<LadderConfig :currentFormConfig="paralleStepFormConfig" :currentFormData="paralleConfig" |
|
|
<LadderConfig :currentFormConfig="paralleStepFormConfig" :currentFormData="paralleConfig" |
|
|
:showOperation="fillType === 'actFill' || fillType === 'preFill'" |
|
|
:showOperation="fillType === 'actFill' || fillType === 'preFill'" |
|
|
:tableColumns="paralleStepColumns" :prefixKey="'paralle_1_' + paralleIndex" |
|
|
:tableColumns="paralleStepColumns" :prefixKey="'paralle_1_' + paralleIndex" |
|
|
:configType="'paralle'" |
|
|
|
|
|
:ref="`paralleRef_1_${paralleIndex}`" :fieldItemLabel="'template.common.pxpz'" |
|
|
|
|
|
@deleteConfig="deleteConfig('paralleConfigs_1',paralleConfig)" |
|
|
|
|
|
:fillType="fillType" /> |
|
|
|
|
|
|
|
|
:configType="'paralle'" :ref="`paralleRef_1_${paralleIndex}`" |
|
|
|
|
|
:fieldItemLabel="'template.common.pxpz'" |
|
|
|
|
|
@deleteConfig="deleteConfig('paralleConfigs_1', paralleConfig)" :fillType="fillType" /> |
|
|
</div> |
|
|
</div> |
|
|
</template> |
|
|
</template> |
|
|
<BaseInfoFormPackage fieldItemLabel="template.common.remark" label="template.common.remark" |
|
|
<BaseInfoFormPackage fieldItemLabel="template.common.remark" label="template.common.remark" |
|
|
@ -109,8 +107,7 @@ import CustomTable from '@/components/Template/CustomTable.vue'; |
|
|
import SelectReagentDialog from '../../dialog/SelectReagentDialog.vue'; |
|
|
import SelectReagentDialog from '../../dialog/SelectReagentDialog.vue'; |
|
|
import TableOpertaion from "@/components/Template/operation/TableOpertaion.vue"; |
|
|
import TableOpertaion from "@/components/Template/operation/TableOpertaion.vue"; |
|
|
import TableOpertaionDelete from "@/components/Template/operation/TableOpertaionDelete.vue" |
|
|
import TableOpertaionDelete from "@/components/Template/operation/TableOpertaionDelete.vue" |
|
|
import { getExpireDate, duplicateResource } from "@/utils/index.js"; |
|
|
|
|
|
import { getuuid } from "@/utils/index.js"; |
|
|
|
|
|
|
|
|
import { getExpireDate, duplicateResource, justUpdateFilledFormData, getuuid } from "@/utils/index.js"; |
|
|
import { isCommonUnit } from "@/utils/conTools"; |
|
|
import { isCommonUnit } from "@/utils/conTools"; |
|
|
import { addTj, uniqeResource, uniqeResourceOne, addDecimals } from "@/utils/calUnitTools"; |
|
|
import { addTj, uniqeResource, uniqeResourceOne, addDecimals } from "@/utils/calUnitTools"; |
|
|
import { |
|
|
import { |
|
|
@ -118,7 +115,7 @@ import { |
|
|
getBaseInfoFormConfig, getRemarkFormConfig, getStorageConditionFormConfig, getParalleStepFormConfig, getJcbColumnsConfig |
|
|
getBaseInfoFormConfig, getRemarkFormConfig, getStorageConditionFormConfig, getParalleStepFormConfig, getJcbColumnsConfig |
|
|
} from "../../formConfig/paralleAndLadderConfig.js"; |
|
|
} from "../../formConfig/paralleAndLadderConfig.js"; |
|
|
import LadderConfig from "@/views/business/comps/template/comps/sp/comps/LadderConfig.vue"; |
|
|
import LadderConfig from "@/views/business/comps/template/comps/sp/comps/LadderConfig.vue"; |
|
|
const configTyps =[ |
|
|
|
|
|
|
|
|
const configTyps = [ |
|
|
{ |
|
|
{ |
|
|
configType: "paralle", |
|
|
configType: "paralle", |
|
|
ref: "paralleRef", |
|
|
ref: "paralleRef", |
|
|
@ -222,7 +219,7 @@ export default { |
|
|
getOperationStepsLabel() { |
|
|
getOperationStepsLabel() { |
|
|
const obj = { |
|
|
const obj = { |
|
|
"LBA005": "template.lba.lba005.bzqxpz",//标准曲线配制 |
|
|
"LBA005": "template.lba.lba005.bzqxpz",//标准曲线配制 |
|
|
"LBA007": "template.lba.lba005.bzqxpz",// |
|
|
|
|
|
|
|
|
// "LBA007": "template.lba.lba005.bzqxpz",// |
|
|
} |
|
|
} |
|
|
return obj[this.sn] || 'template.common.operationSteps';//操作步骤 |
|
|
return obj[this.sn] || 'template.common.operationSteps';//操作步骤 |
|
|
}, |
|
|
}, |
|
|
@ -234,15 +231,16 @@ export default { |
|
|
}, |
|
|
}, |
|
|
// 为指定的表单数据数组分配编号 |
|
|
// 为指定的表单数据数组分配编号 |
|
|
async assignNumbersToTableData(config) { |
|
|
async assignNumbersToTableData(config) { |
|
|
|
|
|
const { configType, ref, configName } = config; |
|
|
return new Promise(async (resolve, reject) => { |
|
|
return new Promise(async (resolve, reject) => { |
|
|
const configs = this.formData[config] |
|
|
|
|
|
|
|
|
const configs = this.formData[configName] |
|
|
const { startDate } = this.formData; |
|
|
const { startDate } = this.formData; |
|
|
// 检查paralleConfigs中的paralleTableFormData数组 |
|
|
// 检查paralleConfigs中的paralleTableFormData数组 |
|
|
if (configs && configs.length > 0) { |
|
|
if (configs && configs.length > 0) { |
|
|
for (let i = 0; i < configs.length; i++) { |
|
|
for (let i = 0; i < configs.length; i++) { |
|
|
const ref = config === "paralleConfigs" ? `paralleRef_${i}` : `ladderRef_${i}`; |
|
|
|
|
|
|
|
|
const currentRef = `${ref}_${i}`; |
|
|
const { stepTableFormData = [], effectivePeriod, effectivePeriodUnit, expireDate } = configs[i]; |
|
|
const { stepTableFormData = [], effectivePeriod, effectivePeriodUnit, expireDate } = configs[i]; |
|
|
if (!expireDate && config === "ladderConfigs") { |
|
|
|
|
|
|
|
|
if (!expireDate && configType === "ladder") { |
|
|
const date = getExpireDate(startDate, effectivePeriod, effectivePeriodUnit); |
|
|
const date = getExpireDate(startDate, effectivePeriod, effectivePeriodUnit); |
|
|
configs[i].expireDate = date; |
|
|
configs[i].expireDate = date; |
|
|
} |
|
|
} |
|
|
@ -257,13 +255,13 @@ export default { |
|
|
const snList = await this.getLatestSnArr(codes); |
|
|
const snList = await this.getLatestSnArr(codes); |
|
|
tableDataArray.forEach((row, idx) => { |
|
|
tableDataArray.forEach((row, idx) => { |
|
|
let expDate = {}; |
|
|
let expDate = {}; |
|
|
if (config === "paralleConfigs" && !row.targetSolutionExpirationDate) { |
|
|
|
|
|
|
|
|
if (configType === "paralle" && !row.targetSolutionExpirationDate) { |
|
|
let date = getExpireDate(startDate, row.targetSolutionCycle, row.targetSolutionCyclePrecision); |
|
|
let date = getExpireDate(startDate, row.targetSolutionCycle, row.targetSolutionCyclePrecision); |
|
|
expDate = { |
|
|
expDate = { |
|
|
targetSolutionExpirationDate: date |
|
|
targetSolutionExpirationDate: date |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
this.$refs[ref][0]?.updateDataSourceByRowIndex(idx, { subTargetSolutionCode: snList[idx], ...expDate }); |
|
|
|
|
|
|
|
|
this.$refs[currentRef][0]?.updateDataSourceByRowIndex(idx, { subTargetSolutionCode: snList[idx], ...expDate }); |
|
|
}); |
|
|
}); |
|
|
resolve() |
|
|
resolve() |
|
|
} else { |
|
|
} else { |
|
|
@ -272,37 +270,36 @@ export default { |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
} else { |
|
|
|
|
|
resolve() |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
async handleUpdateCode() { |
|
|
async handleUpdateCode() { |
|
|
Promise.all([this.assignNumbersToTableData("ladderConfigs"), this.assignNumbersToTableData("paralleConfigs") |
|
|
|
|
|
]).then(() => { |
|
|
|
|
|
|
|
|
const pros = configTyps.map(item => this.assignNumbersToTableData(item)); |
|
|
|
|
|
Promise.all(pros).then(() => { |
|
|
//通知后端保存数据 |
|
|
//通知后端保存数据 |
|
|
const params = { |
|
|
|
|
|
type: "fieldChanged", |
|
|
|
|
|
newRecord: null, |
|
|
|
|
|
resourceList: null, |
|
|
|
|
|
} |
|
|
|
|
|
EventBus.$emit('onModifyRecord', params,) |
|
|
|
|
|
|
|
|
justUpdateFilledFormData(); |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
//新增平行配制 |
|
|
//新增平行配制 |
|
|
handleAddConfig(configType) { |
|
|
handleAddConfig(configType) { |
|
|
// 初始化平行配制配置列表 |
|
|
// 初始化平行配制配置列表 |
|
|
if (!this.formData[configType]) { |
|
|
if (!this.formData[configType]) { |
|
|
|
|
|
// 新增配置的时候,把最新的formdata重新赋值一份,避免选板数据丢失的bug。 |
|
|
|
|
|
this.formData = { ...this.formData, ...this.getFilledFormData() }; |
|
|
this.$set(this.formData, configType, []); |
|
|
this.$set(this.formData, configType, []); |
|
|
|
|
|
// this.formData[configType] = []; |
|
|
} |
|
|
} |
|
|
// 添加新的平行配制配置 |
|
|
// 添加新的平行配制配置 |
|
|
this.formData[configType].push({ |
|
|
this.formData[configType].push({ |
|
|
id: getuuid(), |
|
|
id: getuuid(), |
|
|
stepData: [], |
|
|
stepData: [], |
|
|
paralleTableFormData: [], |
|
|
|
|
|
showParalleConfig: true |
|
|
showParalleConfig: true |
|
|
}); |
|
|
}); |
|
|
this.justUpdateFilledFormData(); |
|
|
|
|
|
|
|
|
justUpdateFilledFormData(); |
|
|
}, |
|
|
}, |
|
|
// 删除阶梯配制配置 |
|
|
// 删除阶梯配制配置 |
|
|
deleteConfig(type, con) { |
|
|
deleteConfig(type, con) { |
|
|
@ -314,12 +311,7 @@ export default { |
|
|
this.$set(this.formData, type, newConfigs); |
|
|
this.$set(this.formData, type, newConfigs); |
|
|
this.$nextTick(() => { |
|
|
this.$nextTick(() => { |
|
|
//通知后端保存数据 |
|
|
//通知后端保存数据 |
|
|
const params = { |
|
|
|
|
|
type: "fieldChanged", |
|
|
|
|
|
newRecord: null, |
|
|
|
|
|
resourceList: null, |
|
|
|
|
|
} |
|
|
|
|
|
EventBus.$emit('onModifyRecord', params,) |
|
|
|
|
|
|
|
|
justUpdateFilledFormData(); |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
@ -329,28 +321,37 @@ export default { |
|
|
const { isLba } = this; |
|
|
const { isLba } = this; |
|
|
const refsToValidate = isLba ? ["baseInfoRef", "jcbRef", "remarkRef"] : ["baseInfoRef", "storageConditionRef", "remarkRef"] |
|
|
const refsToValidate = isLba ? ["baseInfoRef", "jcbRef", "remarkRef"] : ["baseInfoRef", "storageConditionRef", "remarkRef"] |
|
|
// 构建需要验证的引用数组 |
|
|
// 构建需要验证的引用数组 |
|
|
|
|
|
configTyps.map((item) => { |
|
|
|
|
|
const { ref, configName } = item; |
|
|
|
|
|
const configs = this.formData[configName] || []; |
|
|
|
|
|
configs.map((config, i) => { |
|
|
|
|
|
if (this.$refs[`${ref}_${i}`]) { |
|
|
|
|
|
refsToValidate.push(`${ref}_${i}`); |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
// 添加阶梯配制相关的引用 |
|
|
|
|
|
if (this.formData.ladderConfigs && this.formData.ladderConfigs.length > 0) { |
|
|
|
|
|
for (let i = 0; i < this.formData.ladderConfigs.length; i++) { |
|
|
|
|
|
refsToValidate.push(`ladderRef_${i}`); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
}) |
|
|
|
|
|
// // 添加阶梯配制相关的引用 |
|
|
|
|
|
// if (this.formData.ladderConfigs && this.formData.ladderConfigs.length > 0) { |
|
|
|
|
|
// for (let i = 0; i < this.formData.ladderConfigs.length; i++) { |
|
|
|
|
|
// refsToValidate.push(`ladderRef_${i}`); |
|
|
|
|
|
// } |
|
|
|
|
|
// } |
|
|
|
|
|
|
|
|
// 添加平行配制相关的引用 |
|
|
|
|
|
if (this.formData.paralleConfigs && this.formData.paralleConfigs.length > 0) { |
|
|
|
|
|
for (let i = 0; i < this.formData.paralleConfigs.length; i++) { |
|
|
|
|
|
refsToValidate.push(`paralleRef_${i}`); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// // 添加平行配制相关的引用 |
|
|
|
|
|
// if (this.formData.paralleConfigs && this.formData.paralleConfigs.length > 0) { |
|
|
|
|
|
// for (let i = 0; i < this.formData.paralleConfigs.length; i++) { |
|
|
|
|
|
// refsToValidate.push(`paralleRef_${i}`); |
|
|
|
|
|
// } |
|
|
|
|
|
// } |
|
|
return await this.validFormFields(refsToValidate); |
|
|
return await this.validFormFields(refsToValidate); |
|
|
}, |
|
|
}, |
|
|
getFilledFormData() { |
|
|
getFilledFormData() { |
|
|
const baseData = this.$refs.baseInfoRef.getFilledFormData(); |
|
|
const baseData = this.$refs.baseInfoRef.getFilledFormData(); |
|
|
let conditionData = {},jcbData = []; |
|
|
|
|
|
|
|
|
let conditionData = {}, jcbData = []; |
|
|
if (!this.isLba) { |
|
|
if (!this.isLba) { |
|
|
conditionData = this.$refs.storageConditionRef.getFilledFormData(); |
|
|
conditionData = this.$refs.storageConditionRef.getFilledFormData(); |
|
|
}else{ |
|
|
|
|
|
|
|
|
} else { |
|
|
jcbData = this.$refs.jcbRef.getFilledFormData(); |
|
|
jcbData = this.$refs.jcbRef.getFilledFormData(); |
|
|
} |
|
|
} |
|
|
const remarkData = this.$refs.remarkRef.getFilledFormData(); |
|
|
const remarkData = this.$refs.remarkRef.getFilledFormData(); |
|
|
@ -360,12 +361,12 @@ export default { |
|
|
...jcbData, |
|
|
...jcbData, |
|
|
...remarkData |
|
|
...remarkData |
|
|
} |
|
|
} |
|
|
configTyps.map((item)=>{ |
|
|
|
|
|
|
|
|
configTyps.map((item) => { |
|
|
const { ref, configName } = item; |
|
|
const { ref, configName } = item; |
|
|
const configs = this.formData[configName] || []; |
|
|
const configs = this.formData[configName] || []; |
|
|
const configData= []; |
|
|
|
|
|
configs.map((sItem,index)=>{ |
|
|
|
|
|
const {id} = sItem; |
|
|
|
|
|
|
|
|
const configData = []; |
|
|
|
|
|
configs.map((sItem, index) => { |
|
|
|
|
|
const { id } = sItem; |
|
|
const { |
|
|
const { |
|
|
baseFormData, |
|
|
baseFormData, |
|
|
tableData, |
|
|
tableData, |
|
|
@ -391,16 +392,18 @@ export default { |
|
|
} |
|
|
} |
|
|
let content = this.getFilledFormData(); |
|
|
let content = this.getFilledFormData(); |
|
|
if (content) { |
|
|
if (content) { |
|
|
const { ladderConfigs = [], paralleConfigs = [] } = content; |
|
|
|
|
|
if (ladderConfigs.length > 0) { |
|
|
|
|
|
const ladderConUnitDiff = ladderConfigs.every(item => isCommonUnit(item.subTargetStartSolution, [item.headerSelectFields.actSolutionConcentrationUnit, item.headerSelectFields.targetSolutionConcentrationUnit])); |
|
|
|
|
|
|
|
|
const { ladderConfigs = [], paralleConfigs = [], paralleConfigs_1 = [], ladderConfigs_1 = [] } = content; |
|
|
|
|
|
const lConfig = ladderConfigs || ladderConfigs_1; |
|
|
|
|
|
const pConfig = paralleConfigs || paralleConfigs_1; |
|
|
|
|
|
if (lConfig.length > 0) { |
|
|
|
|
|
const ladderConUnitDiff = lConfig.every(item => isCommonUnit(item.subTargetStartSolution, [item.headerSelectFields.actSolutionConcentrationUnit, item.headerSelectFields.targetSolutionConcentrationUnit])); |
|
|
if (!ladderConUnitDiff) { |
|
|
if (!ladderConUnitDiff) { |
|
|
this.$message.error("起始浓度单位与目标浓度单位不符,请重新选择!"); |
|
|
this.$message.error("起始浓度单位与目标浓度单位不符,请重新选择!"); |
|
|
return false; |
|
|
return false; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
if (paralleConfigs.length > 0) { |
|
|
|
|
|
const paralleConUnitDiff = paralleConfigs.every(item => { |
|
|
|
|
|
|
|
|
if (pConfig.length > 0) { |
|
|
|
|
|
const paralleConUnitDiff = pConfig.every(item => { |
|
|
const { stepTableFormData = [], headerSelectFields = {} } = item; |
|
|
const { stepTableFormData = [], headerSelectFields = {} } = item; |
|
|
const conUnits = stepTableFormData.map(item => item.targetStartSolutionConcentrationPrecision); |
|
|
const conUnits = stepTableFormData.map(item => item.targetStartSolutionConcentrationPrecision); |
|
|
const { actSolutionConcentrationUnit, targetSolutionConcentrationUnit } = headerSelectFields; |
|
|
const { actSolutionConcentrationUnit, targetSolutionConcentrationUnit } = headerSelectFields; |
|
|
@ -419,175 +422,175 @@ export default { |
|
|
//生成resource |
|
|
//生成resource |
|
|
let tmpResource = [] |
|
|
let tmpResource = [] |
|
|
if (this.fillType === "actFill") { |
|
|
if (this.fillType === "actFill") { |
|
|
debugger |
|
|
|
|
|
//阶梯配置 |
|
|
|
|
|
if (content.ladderConfigs && content.ladderConfigs.length > 0) { |
|
|
|
|
|
for (let i = 0; i < content.ladderConfigs.length; i++) { |
|
|
|
|
|
let ladderConfigs = content.ladderConfigs[i] |
|
|
|
|
|
let stepTableFormData = ladderConfigs.stepTableFormData |
|
|
|
|
|
for (let j = 0; j < stepTableFormData.length; j++) { |
|
|
|
|
|
|
|
|
configTyps.map((item) => { |
|
|
|
|
|
const { configName, configType } = item; |
|
|
|
|
|
const configs = content[configName] || []; |
|
|
|
|
|
if (configType === "ladder") { |
|
|
|
|
|
for (let i = 0; i < configs.length; i++) { |
|
|
|
|
|
let ladderConfigs = configs[i] |
|
|
|
|
|
let stepTableFormData = ladderConfigs.stepTableFormData |
|
|
|
|
|
for (let j = 0; j < stepTableFormData.length; j++) { |
|
|
|
|
|
|
|
|
//分装 |
|
|
|
|
|
let fzTotal = 0//分装总量 |
|
|
|
|
|
let fzsj = stepTableFormData[j].fzsj |
|
|
|
|
|
if (fzsj && fzsj.fzList) { |
|
|
|
|
|
for (let k = 0; k < fzsj.fzList.length; k++) { |
|
|
|
|
|
let fzItem = fzsj.fzList[k] |
|
|
|
|
|
tmpResource.push({ |
|
|
|
|
|
mc: null, |
|
|
|
|
|
bh: fzsj.mybh + fzItem.preCode + fzItem.subCode, |
|
|
|
|
|
ph: null, |
|
|
|
|
|
nd: stepTableFormData[j].actSolutionConcentration, |
|
|
|
|
|
nddw: ladderConfigs.headerSelectFields.actSolutionConcentrationUnit, |
|
|
|
|
|
ndz: stepTableFormData[j].actSolutionConcentration + ladderConfigs.headerSelectFields.actSolutionConcentrationUnit, |
|
|
|
|
|
ly: 'ELN配制', |
|
|
|
|
|
sxrq: ladderConfigs.expireDate, |
|
|
|
|
|
kc: fzItem.num, |
|
|
|
|
|
kcdw: fzsj.dw, |
|
|
|
|
|
type: null, |
|
|
|
|
|
elnType: this.product, |
|
|
|
|
|
syl: null, |
|
|
|
|
|
syldw: ladderConfigs.headerSelectFields.actSolutionVolumeUnit, |
|
|
|
|
|
yxzq: ladderConfigs.effectivePeriod, |
|
|
|
|
|
yxzqdw: ladderConfigs.effectivePeriodUnit, |
|
|
|
|
|
}) |
|
|
|
|
|
fzTotal = addDecimals(fzTotal, fzItem.num) |
|
|
|
|
|
|
|
|
//分装 |
|
|
|
|
|
let fzTotal = 0//分装总量 |
|
|
|
|
|
let fzsj = stepTableFormData[j].fzsj |
|
|
|
|
|
if (fzsj && fzsj.fzList) { |
|
|
|
|
|
for (let k = 0; k < fzsj.fzList.length; k++) { |
|
|
|
|
|
let fzItem = fzsj.fzList[k] |
|
|
|
|
|
tmpResource.push({ |
|
|
|
|
|
mc: null, |
|
|
|
|
|
bh: fzsj.mybh + fzItem.preCode + fzItem.subCode, |
|
|
|
|
|
ph: null, |
|
|
|
|
|
nd: stepTableFormData[j].actSolutionConcentration, |
|
|
|
|
|
nddw: ladderConfigs.headerSelectFields.actSolutionConcentrationUnit, |
|
|
|
|
|
ndz: stepTableFormData[j].actSolutionConcentration + ladderConfigs.headerSelectFields.actSolutionConcentrationUnit, |
|
|
|
|
|
ly: 'ELN配制', |
|
|
|
|
|
sxrq: ladderConfigs.expireDate, |
|
|
|
|
|
kc: fzItem.num, |
|
|
|
|
|
kcdw: fzsj.dw, |
|
|
|
|
|
type: null, |
|
|
|
|
|
elnType: this.product, |
|
|
|
|
|
syl: null, |
|
|
|
|
|
syldw: ladderConfigs.headerSelectFields.actSolutionVolumeUnit, |
|
|
|
|
|
yxzq: ladderConfigs.effectivePeriod, |
|
|
|
|
|
yxzqdw: ladderConfigs.effectivePeriodUnit, |
|
|
|
|
|
}) |
|
|
|
|
|
fzTotal = addDecimals(fzTotal, fzItem.num) |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
//生成 |
|
|
|
|
|
//计算实际目标溶液体积(实际起始溶液体积+实际稀释液体积) |
|
|
|
|
|
const { total, unit } = addTj([stepTableFormData[j].actStartSolutionVolume, stepTableFormData[j].actDiluentVolume], [ladderConfigs.headerSelectFields.actStartSolutionVolumeUnit, ladderConfigs.headerSelectFields.actDiluentVolumeUnit]) |
|
|
|
|
|
tmpResource.push({ |
|
|
|
|
|
mc: null, |
|
|
|
|
|
bh: stepTableFormData[j].targetSolutionCode + stepTableFormData[j].subTargetSolutionCode, |
|
|
|
|
|
ph: null, |
|
|
|
|
|
ndz: stepTableFormData[j].actSolutionConcentration + ladderConfigs.headerSelectFields.actSolutionConcentrationUnit, |
|
|
|
|
|
nd: stepTableFormData[j].actSolutionConcentration, |
|
|
|
|
|
nddw: ladderConfigs.headerSelectFields.actSolutionConcentrationUnit, |
|
|
|
|
|
ly: 'ELN配制', |
|
|
|
|
|
sxrq: ladderConfigs.expireDate, |
|
|
|
|
|
kc: total, |
|
|
|
|
|
kcdw: unit, |
|
|
|
|
|
type: null, |
|
|
|
|
|
elnType: this.product, |
|
|
|
|
|
syl: fzTotal > 0 ? fzTotal : null, |
|
|
|
|
|
syldw: fzTotal > 0 ? fzsj.dw : unit, |
|
|
|
|
|
yxzq: ladderConfigs.effectivePeriod, |
|
|
|
|
|
yxzqdw: ladderConfigs.effectivePeriodUnit, |
|
|
|
|
|
}) |
|
|
|
|
|
//起始源溶液 |
|
|
|
|
|
tmpResource.push({ |
|
|
|
|
|
mc: null, |
|
|
|
|
|
bh: ladderConfigs.subStartSolution, |
|
|
|
|
|
ph: null, |
|
|
|
|
|
nd: null, |
|
|
|
|
|
nddw: null, |
|
|
|
|
|
ndz: null, |
|
|
|
|
|
ly: null, |
|
|
|
|
|
sxrq: null, |
|
|
|
|
|
kc: null, |
|
|
|
|
|
kcdw: null, |
|
|
|
|
|
type: 1, |
|
|
|
|
|
syl: stepTableFormData[j].actStartSolutionVolume, |
|
|
|
|
|
syldw: ladderConfigs.headerSelectFields.actStartSolutionVolumeUnit, |
|
|
|
|
|
yxzq: null, |
|
|
|
|
|
yxzqdw: null, |
|
|
|
|
|
}) |
|
|
|
|
|
//稀释液 |
|
|
|
|
|
tmpResource.push({ |
|
|
|
|
|
mc: null, |
|
|
|
|
|
bh: ladderConfigs.subSolution, |
|
|
|
|
|
ph: null, |
|
|
|
|
|
nd: null, |
|
|
|
|
|
nddw: null, |
|
|
|
|
|
ndz: null, |
|
|
|
|
|
ly: null, |
|
|
|
|
|
sxrq: null, |
|
|
|
|
|
kc: null, |
|
|
|
|
|
kcdw: null, |
|
|
|
|
|
type: 1, |
|
|
|
|
|
syl: stepTableFormData[j].actDiluentVolume, |
|
|
|
|
|
syldw: ladderConfigs.headerSelectFields.actDiluentVolumeUnit, |
|
|
|
|
|
yxzq: null, |
|
|
|
|
|
yxzqdw: null, |
|
|
|
|
|
}) |
|
|
} |
|
|
} |
|
|
//生成 |
|
|
|
|
|
//计算实际目标溶液体积(实际起始溶液体积+实际稀释液体积) |
|
|
|
|
|
const { total, unit } = addTj([stepTableFormData[j].actStartSolutionVolume, stepTableFormData[j].actDiluentVolume], [ladderConfigs.headerSelectFields.actStartSolutionVolumeUnit, ladderConfigs.headerSelectFields.actDiluentVolumeUnit]) |
|
|
|
|
|
tmpResource.push({ |
|
|
|
|
|
mc: null, |
|
|
|
|
|
bh: stepTableFormData[j].targetSolutionCode + stepTableFormData[j].subTargetSolutionCode, |
|
|
|
|
|
ph: null, |
|
|
|
|
|
ndz: stepTableFormData[j].actSolutionConcentration + ladderConfigs.headerSelectFields.actSolutionConcentrationUnit, |
|
|
|
|
|
nd: stepTableFormData[j].actSolutionConcentration, |
|
|
|
|
|
nddw: ladderConfigs.headerSelectFields.actSolutionConcentrationUnit, |
|
|
|
|
|
ly: 'ELN配制', |
|
|
|
|
|
sxrq: ladderConfigs.expireDate, |
|
|
|
|
|
kc: total, |
|
|
|
|
|
kcdw: unit, |
|
|
|
|
|
type: null, |
|
|
|
|
|
elnType: this.product, |
|
|
|
|
|
syl: fzTotal > 0 ? fzTotal : null, |
|
|
|
|
|
syldw: fzTotal > 0 ? fzsj.dw : unit, |
|
|
|
|
|
yxzq: ladderConfigs.effectivePeriod, |
|
|
|
|
|
yxzqdw: ladderConfigs.effectivePeriodUnit, |
|
|
|
|
|
}) |
|
|
|
|
|
//起始源溶液 |
|
|
|
|
|
tmpResource.push({ |
|
|
|
|
|
mc: null, |
|
|
|
|
|
bh: ladderConfigs.subStartSolution, |
|
|
|
|
|
ph: null, |
|
|
|
|
|
nd: null, |
|
|
|
|
|
nddw: null, |
|
|
|
|
|
ndz: null, |
|
|
|
|
|
ly: null, |
|
|
|
|
|
sxrq: null, |
|
|
|
|
|
kc: null, |
|
|
|
|
|
kcdw: null, |
|
|
|
|
|
type: 1, |
|
|
|
|
|
syl: stepTableFormData[j].actStartSolutionVolume, |
|
|
|
|
|
syldw: ladderConfigs.headerSelectFields.actStartSolutionVolumeUnit, |
|
|
|
|
|
yxzq: null, |
|
|
|
|
|
yxzqdw: null, |
|
|
|
|
|
}) |
|
|
|
|
|
//稀释液 |
|
|
|
|
|
tmpResource.push({ |
|
|
|
|
|
mc: null, |
|
|
|
|
|
bh: ladderConfigs.subSolution, |
|
|
|
|
|
ph: null, |
|
|
|
|
|
nd: null, |
|
|
|
|
|
nddw: null, |
|
|
|
|
|
ndz: null, |
|
|
|
|
|
ly: null, |
|
|
|
|
|
sxrq: null, |
|
|
|
|
|
kc: null, |
|
|
|
|
|
kcdw: null, |
|
|
|
|
|
type: 1, |
|
|
|
|
|
syl: stepTableFormData[j].actDiluentVolume, |
|
|
|
|
|
syldw: ladderConfigs.headerSelectFields.actDiluentVolumeUnit, |
|
|
|
|
|
yxzq: null, |
|
|
|
|
|
yxzqdw: null, |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
//平行配置 |
|
|
|
|
|
if (content.paralleConfigs && content.paralleConfigs.length > 0) { |
|
|
|
|
|
for (let i = 0; i < content.paralleConfigs.length; i++) { |
|
|
|
|
|
let paralleConfigs = content.paralleConfigs[i] |
|
|
|
|
|
let stepTableFormData = paralleConfigs.stepTableFormData |
|
|
|
|
|
for (let j = 0; j < stepTableFormData.length; j++) { |
|
|
|
|
|
//分装 |
|
|
|
|
|
let fzTotal = 0//分装总量 |
|
|
|
|
|
let fzsj = stepTableFormData[j].fzsj |
|
|
|
|
|
if (fzsj && fzsj.fzList) { |
|
|
|
|
|
for (let k = 0; k < fzsj.fzList.length; k++) { |
|
|
|
|
|
let fzItem = fzsj.fzList[k] |
|
|
|
|
|
tmpResource.push({ |
|
|
|
|
|
mc: null, |
|
|
|
|
|
bh: fzsj.mybh + fzItem.preCode + fzItem.subCode, |
|
|
|
|
|
ph: null, |
|
|
|
|
|
ndz: stepTableFormData[j].actSolutionConcentration + paralleConfigs.headerSelectFields.actSolutionConcentrationUnit, |
|
|
|
|
|
nd: stepTableFormData[j].actSolutionConcentration, |
|
|
|
|
|
nddw: paralleConfigs.headerSelectFields.actSolutionConcentrationUnit, |
|
|
|
|
|
ly: 'ELN配制', |
|
|
|
|
|
sxrq: paralleConfigs.expireDate, |
|
|
|
|
|
kc: fzItem.num, |
|
|
|
|
|
kcdw: fzsj.dw, |
|
|
|
|
|
type: null, |
|
|
|
|
|
elnType: this.product, |
|
|
|
|
|
syl: null, |
|
|
|
|
|
syldw: paralleConfigs.headerSelectFields.actSolutionVolumeUnit, |
|
|
|
|
|
yxzq: paralleConfigs.effectivePeriod, |
|
|
|
|
|
yxzqdw: paralleConfigs.effectivePeriodUnit, |
|
|
|
|
|
}) |
|
|
|
|
|
fzTotal = addDecimals(fzTotal, fzItem.num) |
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
for (let i = 0; i < configs.length; i++) { |
|
|
|
|
|
let paralleConfigs = configs[i] |
|
|
|
|
|
let stepTableFormData = paralleConfigs.stepTableFormData |
|
|
|
|
|
for (let j = 0; j < stepTableFormData.length; j++) { |
|
|
|
|
|
//分装 |
|
|
|
|
|
let fzTotal = 0//分装总量 |
|
|
|
|
|
let fzsj = stepTableFormData[j].fzsj |
|
|
|
|
|
if (fzsj && fzsj.fzList) { |
|
|
|
|
|
for (let k = 0; k < fzsj.fzList.length; k++) { |
|
|
|
|
|
let fzItem = fzsj.fzList[k] |
|
|
|
|
|
tmpResource.push({ |
|
|
|
|
|
mc: null, |
|
|
|
|
|
bh: fzsj.mybh + fzItem.preCode + fzItem.subCode, |
|
|
|
|
|
ph: null, |
|
|
|
|
|
ndz: stepTableFormData[j].actSolutionConcentration + paralleConfigs.headerSelectFields.actSolutionConcentrationUnit, |
|
|
|
|
|
nd: stepTableFormData[j].actSolutionConcentration, |
|
|
|
|
|
nddw: paralleConfigs.headerSelectFields.actSolutionConcentrationUnit, |
|
|
|
|
|
ly: 'ELN配制', |
|
|
|
|
|
sxrq: paralleConfigs.expireDate, |
|
|
|
|
|
kc: fzItem.num, |
|
|
|
|
|
kcdw: fzsj.dw, |
|
|
|
|
|
type: null, |
|
|
|
|
|
elnType: this.product, |
|
|
|
|
|
syl: null, |
|
|
|
|
|
syldw: paralleConfigs.headerSelectFields.actSolutionVolumeUnit, |
|
|
|
|
|
yxzq: paralleConfigs.effectivePeriod, |
|
|
|
|
|
yxzqdw: paralleConfigs.effectivePeriodUnit, |
|
|
|
|
|
}) |
|
|
|
|
|
fzTotal = addDecimals(fzTotal, fzItem.num) |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
//生成 |
|
|
|
|
|
const { total, unit } = addTj([stepTableFormData[j].actSolutionVolume, stepTableFormData[j].actDiluentVolume], [paralleConfigs.headerSelectFields.actSolutionVolumeUnit, paralleConfigs.headerSelectFields.actDiluentVolumeUnit]) |
|
|
|
|
|
tmpResource.push({ |
|
|
|
|
|
mc: null, |
|
|
|
|
|
bh: stepTableFormData[j].targetSolutionCode + stepTableFormData[j].subTargetSolutionCode, |
|
|
|
|
|
ph: null, |
|
|
|
|
|
nd: stepTableFormData[j].actSolutionConcentration, |
|
|
|
|
|
ndz: stepTableFormData[j].actSolutionConcentration + paralleConfigs.headerSelectFields.actSolutionConcentrationUnit, |
|
|
|
|
|
nddw: paralleConfigs.headerSelectFields.actSolutionConcentrationUnit, |
|
|
|
|
|
ly: 'ELN配制', |
|
|
|
|
|
sxrq: stepTableFormData[j].targetSolutionExpirationDate, |
|
|
|
|
|
kc: total, |
|
|
|
|
|
kcdw: unit, |
|
|
|
|
|
type: null, |
|
|
|
|
|
elnType: this.product, |
|
|
|
|
|
syl: fzTotal > 0 ? fzTotal : null, |
|
|
|
|
|
syldw: fzTotal > 0 ? fzsj.dw : unit, |
|
|
|
|
|
yxzq: stepTableFormData[j].targetSolutionCycle, |
|
|
|
|
|
yxzqdw: stepTableFormData[j].targetSolutionCyclePrecision, |
|
|
|
|
|
}) |
|
|
|
|
|
//稀释液 |
|
|
|
|
|
tmpResource.push({ |
|
|
|
|
|
mc: null, |
|
|
|
|
|
bh: paralleConfigs.subSolution, |
|
|
|
|
|
ph: null, |
|
|
|
|
|
nd: null, |
|
|
|
|
|
nddw: null, |
|
|
|
|
|
ndz: null, |
|
|
|
|
|
ly: null, |
|
|
|
|
|
sxrq: null, |
|
|
|
|
|
kc: null, |
|
|
|
|
|
kcdw: null, |
|
|
|
|
|
type: 1, |
|
|
|
|
|
syl: stepTableFormData[j].actDiluentVolume, |
|
|
|
|
|
syldw: paralleConfigs.headerSelectFields.actDiluentVolumeUnit, |
|
|
|
|
|
yxzq: null, |
|
|
|
|
|
yxzqdw: null, |
|
|
|
|
|
}) |
|
|
} |
|
|
} |
|
|
//生成 |
|
|
|
|
|
const { total, unit } = addTj([stepTableFormData[j].actSolutionVolume, stepTableFormData[j].actDiluentVolume], [paralleConfigs.headerSelectFields.actSolutionVolumeUnit, paralleConfigs.headerSelectFields.actDiluentVolumeUnit]) |
|
|
|
|
|
tmpResource.push({ |
|
|
|
|
|
mc: null, |
|
|
|
|
|
bh: stepTableFormData[j].targetSolutionCode + stepTableFormData[j].subTargetSolutionCode, |
|
|
|
|
|
ph: null, |
|
|
|
|
|
nd: stepTableFormData[j].actSolutionConcentration, |
|
|
|
|
|
ndz: stepTableFormData[j].actSolutionConcentration + paralleConfigs.headerSelectFields.actSolutionConcentrationUnit, |
|
|
|
|
|
nddw: paralleConfigs.headerSelectFields.actSolutionConcentrationUnit, |
|
|
|
|
|
ly: 'ELN配制', |
|
|
|
|
|
sxrq: stepTableFormData[j].targetSolutionExpirationDate, |
|
|
|
|
|
kc: total, |
|
|
|
|
|
kcdw: unit, |
|
|
|
|
|
type: null, |
|
|
|
|
|
elnType: this.product, |
|
|
|
|
|
syl: fzTotal > 0 ? fzTotal : null, |
|
|
|
|
|
syldw: fzTotal > 0 ? fzsj.dw : unit, |
|
|
|
|
|
yxzq: stepTableFormData[j].targetSolutionCycle, |
|
|
|
|
|
yxzqdw: stepTableFormData[j].targetSolutionCyclePrecision, |
|
|
|
|
|
}) |
|
|
|
|
|
//稀释液 |
|
|
|
|
|
tmpResource.push({ |
|
|
|
|
|
mc: null, |
|
|
|
|
|
bh: paralleConfigs.subSolution, |
|
|
|
|
|
ph: null, |
|
|
|
|
|
nd: null, |
|
|
|
|
|
nddw: null, |
|
|
|
|
|
ndz: null, |
|
|
|
|
|
ly: null, |
|
|
|
|
|
sxrq: null, |
|
|
|
|
|
kc: null, |
|
|
|
|
|
kcdw: null, |
|
|
|
|
|
type: 1, |
|
|
|
|
|
syl: stepTableFormData[j].actDiluentVolume, |
|
|
|
|
|
syldw: paralleConfigs.headerSelectFields.actDiluentVolumeUnit, |
|
|
|
|
|
yxzq: null, |
|
|
|
|
|
yxzqdw: null, |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
}) |
|
|
} |
|
|
} |
|
|
if (tmpResource.length > 0) { |
|
|
if (tmpResource.length > 0) { |
|
|
tmpResource = uniqeResourceOne(tmpResource) |
|
|
tmpResource = uniqeResourceOne(tmpResource) |
|
|
@ -596,24 +599,36 @@ export default { |
|
|
const stepResource = this.getStepResource() |
|
|
const stepResource = this.getStepResource() |
|
|
this.resourceTmp = uniqeResource(tmpResource, stepResource.sjResource || []) |
|
|
this.resourceTmp = uniqeResource(tmpResource, stepResource.sjResource || []) |
|
|
this.yqResourceTmp = stepResource.yqResource || [] |
|
|
this.yqResourceTmp = stepResource.yqResource || [] |
|
|
|
|
|
console.log(this.resourceTmp,"resourceTmp") |
|
|
return this.resourceTmp; |
|
|
return this.resourceTmp; |
|
|
}, |
|
|
}, |
|
|
getStepResource() { |
|
|
getStepResource() { |
|
|
const sjResource = [], yqResource = []; |
|
|
const sjResource = [], yqResource = []; |
|
|
if (this.formData.paralleConfigs && this.formData.paralleConfigs.length > 0) { |
|
|
|
|
|
for (let i = 0; i < this.formData.paralleConfigs.length; i++) { |
|
|
|
|
|
const paralleResource = this.$refs[`paralleRef_${i}`][0].getStepResource(); |
|
|
|
|
|
sjResource.push(...paralleResource.sjResource); |
|
|
|
|
|
yqResource.push(...paralleResource.yqResource); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
if (this.formData.ladderConfigs && this.formData.ladderConfigs.length > 0) { |
|
|
|
|
|
for (let i = 0; i < this.formData.ladderConfigs.length; i++) { |
|
|
|
|
|
const ladderResource = this.$refs[`ladderRef_${i}`][0].getStepResource(); |
|
|
|
|
|
sjResource.push(...ladderResource.sjResource); |
|
|
|
|
|
yqResource.push(...ladderResource.yqResource); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
configTyps.map((item) => { |
|
|
|
|
|
const { ref, configName } = item; |
|
|
|
|
|
const configs = this.formData[configName] || []; |
|
|
|
|
|
configs.map((config, i) => { |
|
|
|
|
|
if (this.$refs[`${ref}_${i}`]) { |
|
|
|
|
|
sjResource.push(...this.$refs[`${ref}_${i}`][0].getStepResource().sjResource); |
|
|
|
|
|
yqResource.push(...this.$refs[`${ref}_${i}`][0].getStepResource().yqResource); |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
|
// if (this.formData.paralleConfigs && this.formData.paralleConfigs.length > 0) { |
|
|
|
|
|
// for (let i = 0; i < this.formData.paralleConfigs.length; i++) { |
|
|
|
|
|
// const paralleResource = this.$refs[`paralleRef_${i}`][0].getStepResource(); |
|
|
|
|
|
// sjResource.push(...paralleResource.sjResource); |
|
|
|
|
|
// yqResource.push(...paralleResource.yqResource); |
|
|
|
|
|
// } |
|
|
|
|
|
// } |
|
|
|
|
|
// if (this.formData.ladderConfigs && this.formData.ladderConfigs.length > 0) { |
|
|
|
|
|
// for (let i = 0; i < this.formData.ladderConfigs.length; i++) { |
|
|
|
|
|
// const ladderResource = this.$refs[`ladderRef_${i}`][0].getStepResource(); |
|
|
|
|
|
// sjResource.push(...ladderResource.sjResource); |
|
|
|
|
|
// yqResource.push(...ladderResource.yqResource); |
|
|
|
|
|
// } |
|
|
|
|
|
// } |
|
|
//去重 |
|
|
//去重 |
|
|
const { sj, yq } = duplicateResource(sjResource, yqResource) |
|
|
const { sj, yq } = duplicateResource(sjResource, yqResource) |
|
|
return { sjResource: sj, yqResource: yq }; |
|
|
return { sjResource: sj, yqResource: yq }; |
|
|
|