diff --git a/src/components/Template/BaseInfoFormPackage.vue b/src/components/Template/BaseInfoFormPackage.vue
index 4bcd338..a5e46de 100644
--- a/src/components/Template/BaseInfoFormPackage.vue
+++ b/src/components/Template/BaseInfoFormPackage.vue
@@ -153,6 +153,19 @@
+
+
+
+ onSelectChange(key, e, type)"
+ :error="errors[key]" @update:error="errors[key] = false"
+ :orange-bg="orangeBgFields[key]" />
+
+
{{ $t(sItem.label) }}
+
+
+
+ @update="onFormUpdate(index, $event)" :stepIndex = "prefixKey + index" :ref="'stepCompRef_' + index">
- {{ $t('template.common.xzpxpz')
+ {{
+ $t('template.common.xzpxpz')
}}
- {{ $t('template.common.xzjtpz')
+ {{
+ $t('template.common.xzjtpz')
}}
@@ -37,30 +39,29 @@
+ :configType="'ladder'" :ref="`ladderRef_${ladderIndex}`"
+ :fieldItemLabel="'template.common.jtpz'"
+ @deleteConfig="deleteConfig('ladderConfigs', ladderConfig)" :fillType="fillType" />
-
+ :configType="'paralle'" :ref="`paralleRef_${paralleIndex}`"
+ :fieldItemLabel="'template.common.pxpz'"
+ @deleteConfig="deleteConfig('paralleConfigs', paralleConfig)" :fillType="fillType" />
- {{ $t('template.common.xzpxpz')
+ {{
+ $t('template.common.xzpxpz')
}}
- {{ $t('template.common.xzjtpz')
+ {{
+ $t('template.common.xzjtpz')
}}
@@ -69,23 +70,20 @@
+ :configType="'ladder'" :ref="`ladderRef_1_${ladderIndex}`"
+ :fieldItemLabel="'template.common.jtpz'"
+ @deleteConfig="deleteConfig('ladderConfigs_1', ladderConfig)" :fillType="fillType" />
-
+ :configType="'paralle'" :ref="`paralleRef_1_${paralleIndex}`"
+ :fieldItemLabel="'template.common.pxpz'"
+ @deleteConfig="deleteConfig('paralleConfigs_1', paralleConfig)" :fillType="fillType" />
{
- const configs = this.formData[config]
+ const configs = this.formData[configName]
const { startDate } = this.formData;
// 检查paralleConfigs中的paralleTableFormData数组
if (configs && configs.length > 0) {
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];
- if (!expireDate && config === "ladderConfigs") {
+ if (!expireDate && configType === "ladder") {
const date = getExpireDate(startDate, effectivePeriod, effectivePeriodUnit);
configs[i].expireDate = date;
}
@@ -257,13 +255,13 @@ export default {
const snList = await this.getLatestSnArr(codes);
tableDataArray.forEach((row, idx) => {
let expDate = {};
- if (config === "paralleConfigs" && !row.targetSolutionExpirationDate) {
+ if (configType === "paralle" && !row.targetSolutionExpirationDate) {
let date = getExpireDate(startDate, row.targetSolutionCycle, row.targetSolutionCyclePrecision);
expDate = {
targetSolutionExpirationDate: date
}
}
- this.$refs[ref][0]?.updateDataSourceByRowIndex(idx, { subTargetSolutionCode: snList[idx], ...expDate });
+ this.$refs[currentRef][0]?.updateDataSourceByRowIndex(idx, { subTargetSolutionCode: snList[idx], ...expDate });
});
resolve()
} else {
@@ -272,37 +270,36 @@ export default {
}
}
+ } else {
+ resolve()
}
})
},
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) {
// 初始化平行配制配置列表
if (!this.formData[configType]) {
+ // 新增配置的时候,把最新的formdata重新赋值一份,避免选板数据丢失的bug。
+ this.formData = { ...this.formData, ...this.getFilledFormData() };
this.$set(this.formData, configType, []);
+ // this.formData[configType] = [];
}
// 添加新的平行配制配置
this.formData[configType].push({
id: getuuid(),
stepData: [],
- paralleTableFormData: [],
showParalleConfig: true
});
- this.justUpdateFilledFormData();
+ justUpdateFilledFormData();
},
// 删除阶梯配制配置
deleteConfig(type, con) {
@@ -314,12 +311,7 @@ export default {
this.$set(this.formData, type, newConfigs);
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 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);
},
getFilledFormData() {
const baseData = this.$refs.baseInfoRef.getFilledFormData();
- let conditionData = {},jcbData = [];
+ let conditionData = {}, jcbData = [];
if (!this.isLba) {
conditionData = this.$refs.storageConditionRef.getFilledFormData();
- }else{
+ } else {
jcbData = this.$refs.jcbRef.getFilledFormData();
}
const remarkData = this.$refs.remarkRef.getFilledFormData();
@@ -360,12 +361,12 @@ export default {
...jcbData,
...remarkData
}
- configTyps.map((item)=>{
+ configTyps.map((item) => {
const { ref, configName } = item;
const configs = this.formData[configName] || [];
- const configData= [];
- configs.map((sItem,index)=>{
- const {id} = sItem;
+ const configData = [];
+ configs.map((sItem, index) => {
+ const { id } = sItem;
const {
baseFormData,
tableData,
@@ -391,16 +392,18 @@ export default {
}
let content = this.getFilledFormData();
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) {
this.$message.error("起始浓度单位与目标浓度单位不符,请重新选择!");
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 conUnits = stepTableFormData.map(item => item.targetStartSolutionConcentrationPrecision);
const { actSolutionConcentrationUnit, targetSolutionConcentrationUnit } = headerSelectFields;
@@ -419,175 +422,175 @@ export default {
//生成resource
let tmpResource = []
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) {
tmpResource = uniqeResourceOne(tmpResource)
@@ -596,24 +599,36 @@ export default {
const stepResource = this.getStepResource()
this.resourceTmp = uniqeResource(tmpResource, stepResource.sjResource || [])
this.yqResourceTmp = stepResource.yqResource || []
+ console.log(this.resourceTmp,"resourceTmp")
return this.resourceTmp;
},
getStepResource() {
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)
return { sjResource: sj, yqResource: yq };
diff --git a/src/views/business/comps/template/comps/sp/comps/LadderConfig.vue b/src/views/business/comps/template/comps/sp/comps/LadderConfig.vue
index 5477bbc..c499b5d 100644
--- a/src/views/business/comps/template/comps/sp/comps/LadderConfig.vue
+++ b/src/views/business/comps/template/comps/sp/comps/LadderConfig.vue
@@ -108,15 +108,10 @@ export default {
},
// 实现getFormData方法,用于表单验证
async getFormData() {
- const baseFormData = await this.$refs.formPackageRef?.getFormData();
- const tableData = await this.$refs.tableRef?.getFormData();
- const stepData =await this.$refs.stepRef?.getFormData();
- // 检查所有组件是否都返回了有效的数据
- if (!baseFormData || !tableData || !stepData) {
- return false;
- }
-
- return true;
+ const refs = ['formPackageRef', 'tableRef', 'stepRef']
+ const pros = refs.map((ref)=>this.$refs[ref]?.getFormData())
+ const result = await Promise.all(pros);
+ return result;
},
//选择试剂提交事件
onRegentSubmit(data) {
diff --git a/src/views/business/comps/template/formConfig/paralleAndLadderConfig.js b/src/views/business/comps/template/formConfig/paralleAndLadderConfig.js
index 748fcc1..eca1ca3 100644
--- a/src/views/business/comps/template/formConfig/paralleAndLadderConfig.js
+++ b/src/views/business/comps/template/formConfig/paralleAndLadderConfig.js
@@ -1,3 +1,40 @@
+const explainConfig = {
+ type: 'explainItem',
+ config: {
+ text1: {
+ label: '配制说明:配制',
+ type: 'span',
+ },
+ yb: {
+ type: "input",
+ fillType: 'preFill',
+ maxlength: 100,
+ formWidth: 280
+ },
+ text2:{
+ label:"样本,分别配制",
+ type: 'span',
+ },
+ ybs: {
+ type: "inputNumber",
+ fillType: 'preFill',
+ precision: 0,
+
+ },
+ text3:{
+ label:"套, 序列号为:",
+ type: 'span',
+ },
+ ybh: {
+ type: "input",
+ fillType: 'preFill',
+ },
+ text4:{
+ label:",单套配制过程如下:",
+ type: 'span',
+ },
+ }
+ }
// 阶梯配置表格列配置
export const getLadderColumnsConfig = ($this) => {
return [
@@ -38,11 +75,11 @@ export const getLadderColumnsConfig = ($this) => {
bodySubFillType: 'preFill',
showBodySub: $this.fillType === 'preFill',
bodyPrecisionKey: 'targetStartSolutionVolumePrecision',
- subPrecision:0,
+ subPrecision: 0,
bodyMaxlength: 10,
bodyDisabled: true,
bodySubPlaceholder: 'template.common.xswsPlaceholder',
- headerSelectTo:"actStartSolutionVolumeUnit",
+ headerSelectTo: "actStartSolutionVolumeUnit",
},
{
label: 'template.sp.sp00456.sjqsrytj',
@@ -75,10 +112,10 @@ export const getLadderColumnsConfig = ($this) => {
showBodySub: $this.fillType === 'preFill',
bodyPrecisionKey: 'targetDiluentVolumePrecision',
- subPrecision:0,
+ subPrecision: 0,
bodyMaxlength: 10,
bodySubPlaceholder: 'template.common.xswsPlaceholder',
- headerSelectTo:"actDiluentVolumeUnit",
+ headerSelectTo: "actDiluentVolumeUnit",
},
{
label: 'template.sp.sp00456.sjxsytj',
@@ -105,7 +142,7 @@ export const getLadderColumnsConfig = ($this) => {
bodyType: 'inputNumber',
bodyFillType: 'preFill',
bodyMaxlength: 10,
- headerSelectTo:"actSolutionConcentrationUnit",
+ headerSelectTo: "actSolutionConcentrationUnit",
},
{
label: 'template.sp.sp00456.sjmbrynd',
@@ -124,7 +161,7 @@ export const getLadderColumnsConfig = ($this) => {
showBodySub: $this.fillType === 'preFill',
bodyPrecisionKey: 'actSolutionConcentrationPrecision',
- subPrecision:0,
+ subPrecision: 0,
bodyMaxlength: 10,
bodySubPlaceholder: 'template.common.xswsPlaceholder',
compareTo: 'targetSolutionConcentration', //比较哪个字段
@@ -140,7 +177,7 @@ export const getLadderColumnsConfig = ($this) => {
bodyType: 'inputNumber',
bodyFillType: 'preFill',
bodyMaxlength: 10,
- headerSelectTo:"actSolutionVolumeUnit",
+ headerSelectTo: "actSolutionVolumeUnit",
},
{
label: 'template.sp.sp00456.sjmbrytj',
@@ -159,7 +196,7 @@ export const getLadderColumnsConfig = ($this) => {
showBodySub: $this.fillType === 'preFill',
bodyPrecisionKey: 'actSolutionVolumePrecision',
- subPrecision:0,
+ subPrecision: 0,
bodyMaxlength: 10,
// copyFrom: 'targetSolutionVolume', //复制哪个字段
bodySubPlaceholder: 'template.common.xswsPlaceholder',
@@ -171,16 +208,17 @@ export const getLadderColumnsConfig = ($this) => {
export const getParallelColumnsConfig = ($this) => {
const sn = $this.sn;
let o = {
- "SP004":"business_sp_nbgzy",
- "SP005":"business_sp_zkgzy",
- "SP006":"business_sp_bzqxzkypzbb",
+ "SP004": "business_sp_nbgzy",
+ "SP005": "business_sp_zkgzy",
+ "SP006": "business_sp_bzqxzkypzbb",
}
+ const dic = o[sn] || 'business_sp_nbgzy';
return [
{
label: 'template.sp.sp00456.mbrybh',
prop: 'targetSolutionCode',
bodyType: 'select',
- bodyOptions: $this.getDictOptions(o[sn]),
+ bodyOptions: $this.getDictOptions(dic),
bodySubType: 'span',
bodySubKey: 'subTargetSolutionCode',
bodyFillType: 'preFill',
@@ -201,7 +239,7 @@ export const getParallelColumnsConfig = ($this) => {
bodyType: 'inputNumber',
bodyFillType: 'preFill',
bodyMaxlength: 10,
- headerSelectTo:"actSolutionConcentrationUnit",
+ headerSelectTo: "actSolutionConcentrationUnit",
},
{
label: 'template.sp.sp00456.sjmbrynd',
@@ -219,7 +257,7 @@ export const getParallelColumnsConfig = ($this) => {
bodySubFillType: 'preFill',
showBodySub: $this.fillType === 'preFill',
bodyPrecisionKey: 'actSolutionConcentrationPrecision',
- subPrecision:0,
+ subPrecision: 0,
bodyMaxlength: 10,
bodySubPlaceholder: 'template.common.xswsPlaceholder',
compareTo: 'targetSolutionConcentration', //比较哪个字段
@@ -235,7 +273,7 @@ export const getParallelColumnsConfig = ($this) => {
bodyType: 'inputNumber',
bodyFillType: 'preFill',
bodyMaxlength: 10,
- headerSelectTo:"actSolutionVolumeUnit",
+ headerSelectTo: "actSolutionVolumeUnit",
},
{
label: 'template.sp.sp00456.sjmbrytj',
@@ -253,7 +291,7 @@ export const getParallelColumnsConfig = ($this) => {
bodySubFillType: 'preFill',
showBodySub: $this.fillType === 'preFill',
bodyPrecisionKey: 'actSolutionVolumePrecision',
- subPrecision:0,
+ subPrecision: 0,
bodyMaxlength: 10,
bodySubPlaceholder: 'template.common.xswsPlaceholder',
compareTo: 'targetSolutionVolume', //比较哪个字段
@@ -321,9 +359,9 @@ export const getParallelColumnsConfig = ($this) => {
bodyDisabled: true,
compareTo: 'targetStartSolutionConcentration', //比较哪个字段
bodySubKey: 'subTargetAcSolutionUnit',
- bodySubType:"input",
- bodySubCompareTo:"targetStartSolutionConcentrationPrecision",
- bodySubFillType:"actFill",
+ bodySubType: "input",
+ bodySubCompareTo: "targetStartSolutionConcentrationPrecision",
+ bodySubFillType: "actFill",
bodySubDisabled: true,
},
{
@@ -341,13 +379,13 @@ export const getParallelColumnsConfig = ($this) => {
bodySubFillType: 'preFill',
bodyMaxlength: 10,
bodyPrecisionKey: 'targetStartSolutionVolumePrecision',
- subPrecision:0,
+ subPrecision: 0,
bodyMaxlength: 10,
bodySubPlaceholder: 'template.common.xswsPlaceholder',
bodyDisabled: true,
showBodySub: true,
showBodySub: $this.fillType === 'preFill',
- headerSelectTo:"actStartSolutionVolumeUnit",
+ headerSelectTo: "actStartSolutionVolumeUnit",
},
{
@@ -380,11 +418,11 @@ export const getParallelColumnsConfig = ($this) => {
bodySubFillType: 'preFill',
bodyMaxlength: 10,
bodyPrecisionKey: 'targetDiluentVolumePrecision',
- subPrecision:0,
+ subPrecision: 0,
bodySubPlaceholder: 'template.common.xswsPlaceholder',
bodyDisabled: true,
showBodySub: $this.fillType === 'preFill',
- headerSelectTo:"actDiluentVolumeUnit",
+ headerSelectTo: "actDiluentVolumeUnit",
},
{
label: 'template.sp.sp00456.sjxsytj',
@@ -397,7 +435,7 @@ export const getParallelColumnsConfig = ($this) => {
bodyType: 'inputNumber',
bodyFillType: 'actFill',
bodyMaxlength: 10,
- copyFrom:"targetDiluentVolume",
+ copyFrom: "targetDiluentVolume",
compareTo: 'targetDiluentVolume' //比较哪个字段
}
]
@@ -405,7 +443,8 @@ export const getParallelColumnsConfig = ($this) => {
//阶梯配置
export const getLadderFormConfig = ($this) => {
- return [
+ const sn = $this.sn;
+ const defaultConfig = [
{
type: 'step',
config: {
@@ -435,9 +474,9 @@ export const getLadderFormConfig = ($this) => {
maxlength: 10,
compareTo: 'targetStartSolution', //比较哪个字段
subKey: "subTargetAcSolutionUnit",
- subType:"input",
- subDisabled:true,
- subCompareTo:"subTargetStartSolution",
+ subType: "input",
+ subDisabled: true,
+ subCompareTo: "subTargetStartSolution",
},
solution: {
label: 'template.sp.sp00456.xsy',
@@ -471,12 +510,16 @@ export const getLadderFormConfig = ($this) => {
}
}
]
+ if (sn === "LBA007") {
+ defaultConfig.unshift(explainConfig)
+ }
+ return defaultConfig
}
//试验基本信息
export const getBaseInfoFormConfig = ($this) => {
const sn = $this.sn;
- const labArr = ["LBA005","LBA007"]
+ const labArr = ["LBA005", "LBA007"]
const isLba = labArr.includes(sn);
return [
{
@@ -509,7 +552,7 @@ export const getBaseInfoFormConfig = ($this) => {
},
{
type: 'conditionItem',
- label:isLba? 'template.lba.lba002.cztj':'template.common.testConfigurationConditions',
+ label: isLba ? 'template.lba.lba002.cztj' : 'template.common.testConfigurationConditions',
config: {
pre: {
label: 'template.common.preFill',
@@ -530,7 +573,7 @@ export const getBaseInfoFormConfig = ($this) => {
}
}
},
- isLba?{}:{
+ isLba ? {} : {
type: 'conditionItem',
label: 'template.sp.sp00456.rqcz',
config: {
@@ -546,7 +589,7 @@ export const getBaseInfoFormConfig = ($this) => {
},
{
type: 'cellItem',
- label: isLba?'template.lba.lba002.czsj':'template.common.configurationTime',
+ label: isLba ? 'template.lba.lba002.czsj' : 'template.common.configurationTime',
config: {
startDate: {
label: 'template.common.startTime',
@@ -601,12 +644,13 @@ export const getStorageConditionFormConfig = ($this) => {
//平行步骤配置
export const getParalleStepFormConfig = ($this) => {
- return [
+ const defaultConfig = [
{
type: 'step',
config: {
solution: {
label: 'template.sp.sp00456.xsy',
+ labelWidth:80,
type: 'input',
fillType: 'preFill',
subType: 'sj',
@@ -616,6 +660,7 @@ export const getParalleStepFormConfig = ($this) => {
},
paralleStepStorageCondition: {
label: 'template.sp.sp00456.cctj',
+ labelWidth:80,
type: 'select',
fillType: 'preFill',
options: $this.getDictOptions('business_cctj'),
@@ -624,22 +669,27 @@ export const getParalleStepFormConfig = ($this) => {
}
}
]
+ const sn = $this.sn;
+ if(sn === "LBA007"){
+ defaultConfig.unshift(explainConfig)
+ }
+ return defaultConfig
}
//选板信息;
export const getJcbColumnsConfig = ($this) => {
return [{
- label: 'template.lba.lba002.jcbmc',
- prop: 'jcb',
- bodyType: 'input',
- bodyFillType: 'preFill',
- width: 280,
- bodyMaxlength:20
- },{
- label: '',
- prop: 'jcbBh',
- bodyType: 'jcb',
- bodyFillType: 'actFill',
- width: 280
- }]
+ label: 'template.lba.lba002.jcbmc',
+ prop: 'jcb',
+ bodyType: 'input',
+ bodyFillType: 'preFill',
+ width: 280,
+ bodyMaxlength: 20
+ }, {
+ label: '',
+ prop: 'jcbBh',
+ bodyType: 'jcb',
+ bodyFillType: 'actFill',
+ width: 280
+ }]
}
\ No newline at end of file
diff --git a/src/views/business/comps/template/formConfig/sp/SP0019.js b/src/views/business/comps/template/formConfig/sp/SP0019.js
index 1325f6c..f1b40ab 100644
--- a/src/views/business/comps/template/formConfig/sp/SP0019.js
+++ b/src/views/business/comps/template/formConfig/sp/SP0019.js
@@ -22,7 +22,7 @@ export const getBaseInfoFormConfig = (formType) => {
versionNum: {
label: 'template.common.versionNumber',
type: 'inputNumber',
- fillType: 'preFill',
+ fillType: 'actFill',
prepend: 'V',
maxlength: 50
},
diff --git a/src/views/business/comps/template/formConfig/sp/SP0020.js b/src/views/business/comps/template/formConfig/sp/SP0020.js
index cc4f90e..4bd1480 100644
--- a/src/views/business/comps/template/formConfig/sp/SP0020.js
+++ b/src/views/business/comps/template/formConfig/sp/SP0020.js
@@ -1,9 +1,6 @@
// checkboxTree 类型的配置
-const checkboxTreeOptions = [
- {
- label: '方法学验证',
- value: '方法学验证',
- children: [
+const getOptions = (sn) => {
+ let children = [
{ label: '储备液比对', value: '储备液比对' },
{ label: '标准曲线线性范围', value: '标准曲线线性范围' },
{ label: '准确度与精密度&灵敏度', value: '准确度与精密度&灵敏度' },
@@ -24,34 +21,64 @@ const checkboxTreeOptions = [
{ label: '储备液长期稳定性', value: '储备液长期稳定性' },
{ label: '工作液短期稳定性', value: '工作液短期稳定性' },
{ label: '工作液长期稳定性', value: '工作液长期稳定性' }
- ]
- },
- {
- label: '样品分析',
- value: '样品分析',
- children: [
- { label: '样品信息', value: '样品信息' }
- ]
- },
- {
- label: '其他',
- value: '其他',
- children: []
+ ];
+ if (sn === 'PCR006') {
+ children = [
+ { label: '基质效应', value: '基质效应' },
+ { label: '选择性', value: '选择性' },
+ { label: '特异性', value: '特异性' },
+ { label: '方法耐用性', value: '方法耐用性' },
+ { label: '精密度与准确性', value: '精密度与准确性' },
+ { label: '检测限', value: '检测限' },
+ { label: '提取精密度', value: '提取精密度' },
+ { label: '提取前样品稳定性', value: '提取前样品稳定性' },
+ { label: '提取后样品稳定性', value: '提取后样品稳定性' },
+ { label: 'cDNA样品稳定性', value: 'cDNA样品稳定性' },
+ { label: '方法适用性', value: '方法适用性' },
+ { label: '基因组DNA残留测定', value: '基因组DNA残留测定' },
+ { label: '稀释线性', value: '稀释线性' },
+ { label: '反复动态稳定性', value: '反复动态稳定性' },
+ { label: '标准工作液稳定性', value: '标准工作液稳定性' }
+ ]
}
- ]
+
+ return [
+ {
+ label: '方法学验证',
+ value: '方法学验证',
+ children
+ },
+ {
+ label: '样品分析',
+ value: '样品分析',
+ children: [
+ { label: '样品信息', value: '样品信息' }
+ ]
+ },
+ {
+ label: '其他',
+ value: '其他',
+ children: []
+ }
+ ]
+}
+
+
+
+
//试验内容
-export const getSynrFormConfig = ()=>{
+export const getSynrFormConfig = ($this) => {
return [
{
type: 'checkboxList',
config: {
ffxyz: {
- type: 'checkboxTree',
+ type: 'checkboxTree',
label: '方法学验证',
- options:checkboxTreeOptions,
- span:1,
- fillType:"actFill"
+ options: getOptions($this.sn),
+ span: 1,
+ fillType: "actFill"
},
}
},
@@ -59,36 +86,36 @@ export const getSynrFormConfig = ()=>{
}
//仪器结果
-export const getYqjgFormConfig = ()=>{
+export const getYqjgFormConfig = () => {
return [
{
type: 'checkboxList',
config: {
jg: {
- type: 'checkboxTree',
+ type: 'checkboxTree',
label: '结果',
- options:[
+ options: [
{ label: '分析批接受', value: '分析批接受' },
{ label: '分析批拒绝', value: '分析批拒绝' },
{ label: '部分接受', value: '部分接受' },
],
- span:1,
- fillType:"actFill"
+ span: 1,
+ fillType: "actFill"
},
yzkcjg: {
type: 'textarea',
label: '验证考察结果',
- span:1,
- fillType:"actFill",
+ span: 1,
+ fillType: "actFill",
maxlength: 1000,
- rows: 5
+ rows: 5
},
}
},
]
}
//分析批数据文件
-export const getFxpsjwjFormConfig = ()=>{
+export const getFxpsjwjFormConfig = () => {
return [
{
type: 'checkboxList',
@@ -96,15 +123,15 @@ export const getFxpsjwjFormConfig = ()=>{
fxpsjwjm: {
type: 'input',
label: '分析批数据文件名',
- span:1,
- fillType:"actFill",
+ span: 1,
+ fillType: "actFill",
maxlength: 100,
},
fxpsjlj: {
type: 'input',
label: '分析批数据路径',
- span:1,
- fillType:"actFill",
+ span: 1,
+ fillType: "actFill",
maxlength: 150,
},
}
@@ -113,7 +140,7 @@ export const getFxpsjwjFormConfig = ()=>{
}
//采集日期
-export const getCjrqFormConfig = ()=>{
+export const getCjrqFormConfig = () => {
return [
{
type: 'cellItem',
@@ -121,12 +148,12 @@ export const getCjrqFormConfig = ()=>{
cjksrq: {
type: 'datePicker',
label: '采集开始日期',
- fillType:"actFill"
+ fillType: "actFill"
},
cjjsrq: {
type: 'datePicker',
label: '采集结束日期',
- fillType:"actFill"
+ fillType: "actFill"
},
}
},
diff --git a/src/views/business/comps/template/mixins/templateMixin.js b/src/views/business/comps/template/mixins/templateMixin.js
index 89ed1f3..3d17358 100644
--- a/src/views/business/comps/template/mixins/templateMixin.js
+++ b/src/views/business/comps/template/mixins/templateMixin.js
@@ -3,8 +3,8 @@ import { getLatestSn, getLatestSnArr } from '@/api/template';
import { isValueEmpty, getStringWidth } from '@/utils/index';
import { isCommonUnit } from "@/utils/conTools";
import { sj_subpackage, sj_startConfiguration, sj_configurationCompleted } from '@/api/business/sj/sj';
-import {convertConcentration} from "@/utils/conConverter";//浓度单位转换
-import {volumeConverter} from "@/utils/volConverter";//体积单位转换
+import { convertConcentration } from "@/utils/conConverter";//浓度单位转换
+import { volumeConverter } from "@/utils/volConverter";//体积单位转换
import * as XLSX from 'xlsx'
import { EventBus } from "@/utils/eventBus";
@@ -95,7 +95,7 @@ export default {
// this.resourceWz = _.filter(JSON.parse(v.resource), function (o) {
// return o.type == 3 || o.type == 5 || o.type == 7 || o.elnType == 3|| o.elnType == 5 || o.elnType == 7
// })
- //试验试剂信息
+ //试验试剂信息
this.resourceSj = _.filter(JSON.parse(v.resource), function (o) {
return o.type == 1 || o.elnType == 1
})
@@ -126,8 +126,8 @@ export default {
studySn,
templateMc,
templateMcEn,
- templateId,
- templateSn,
+ templateId,
+ templateSn,
startDate,
bdmc,
endDate,
@@ -141,7 +141,7 @@ export default {
studySn,
templateMc,
templateMcEn,
- templateId,
+ templateId,
templateSn,
startDate,
bdmc,
@@ -188,13 +188,13 @@ export default {
yqResource: [], //仪器信息
jcbList: [], //检测板信息
xbxj: [], //细胞细菌信息
-
+
resourceTmp: [],//试验试剂信息提交用
yqResourceTmp: [], //仪器信息提交用
jcbListTmp: [], //检测板信息提交用
- xbxjTmp:[],//细胞细菌信息提交用
- sjColumns: [
+ xbxjTmp: [],//细胞细菌信息提交用
+ sjColumns: [
{ label: 'template.common.reagentName', prop: "mc" },//名称
{ label: 'template.common.reagentCode', prop: "bh" },//编号
{ label: 'template.common.reagentNo', prop: "ph" },//批号 试剂,供试品才有
@@ -202,7 +202,7 @@ export default {
{ label: 'template.common.source', prop: "ly" },//来源
{ label: 'template.common.reagentExpireDate', prop: "sxrq" },//失效日期
],
- gspColumns: [
+ gspColumns: [
{ label: 'template.common.wzName', prop: "mc" },//名称
{ label: 'template.common.wzCode', prop: "bh" },//编号
{ label: 'template.common.reagentNo', prop: "ph" },//批号 试剂,供试品才有
@@ -255,7 +255,7 @@ export default {
},
methods: {
// 只是更新已填写的表单数据,不触发校验
- justUpdateFilledFormData(){
+ justUpdateFilledFormData() {
const params = {
type: "fieldChanged",
newRecord: null,
@@ -264,11 +264,11 @@ export default {
EventBus.$emit('onModifyRecord', params,)
},
//试剂弹窗确认前
- onBeforeReagentSubmit(data){
- const {selectData, callback, key, formFields} = data;
- const {subTargetStartSolution} = formFields;
+ onBeforeReagentSubmit(data) {
+ const { selectData, callback, key, formFields } = data;
+ const { subTargetStartSolution } = formFields;
//判断选择的浓度单位和预制的浓度单位是否一致
- if(key === "subStartSolution" && !isCommonUnit(selectData.row.nddw,[subTargetStartSolution])){//选择起始源溶液需要同步更新table的变更记录。
+ if (key === "subStartSolution" && !isCommonUnit(selectData.row.nddw, [subTargetStartSolution])) {//选择起始源溶液需要同步更新table的变更记录。
callback.prevent('浓度单位与预制不符,请重新选择或申请废止并重新预制。');
}
},
@@ -381,10 +381,12 @@ export default {
let result = {}
const refs = refArr.map((ref) => {
let refData = {}
- if (this.$refs[ref][0]) {
- refData = this.$refs[ref][0]?.getFormData() || {}
- } else {
- refData = this.$refs[ref]?.getFormData() || {}
+ if (this.$refs[ref]) {
+ if (this.$refs[ref][0]) {
+ refData = this.$refs[ref][0]?.getFormData() || {}
+ } else {
+ refData = this.$refs[ref]?.getFormData() || {}
+ }
}
return refData
})
@@ -427,8 +429,8 @@ export default {
this.$store.commit('template/SET_TEMPLATE_DATA', data)
},
//统一处理删除行
- deleteRow(index,ref) {
- if(ref){
+ deleteRow(index, ref) {
+ if (ref) {
this.$refs[ref].deleteRow(index);
return;
}
@@ -436,14 +438,14 @@ export default {
},
//统一处理浓度校验异常
- onCommonVerifyNdException(formFields,data){
- const {callback,rowIndex, key,dataSource} = data;
+ onCommonVerifyNdException(formFields, data) {
+ const { callback, rowIndex, key, dataSource } = data;
const keys = [
'actStartSolutionVolume',
'actDiluentVolume',
]
- if(keys.includes(key)){
- const {targetAcSolution} = formFields;
+ if (keys.includes(key)) {
+ const { targetAcSolution } = formFields;
if (rowIndex === 0) {//第一行的浓度取选择的溶液,
if (isValueEmpty(targetAcSolution)) {
callback.prevent("请先选择起始源溶液")
@@ -481,7 +483,7 @@ export default {
} else if (key === 'targetStartSolution' || key === 'subTargetStartSolution') {
//起始溶液体积失焦时,更新目标溶液预计浓度
const arr = this.$refs.stepTableRef?.getDataSource();
- const {headerSelectFields} = this.$refs.stepTableRef?.getFilledFormData();
+ const { headerSelectFields } = this.$refs.stepTableRef?.getFilledFormData();
const params = {
subTargetStartSolution,
headerSelectFields
@@ -508,7 +510,7 @@ export default {
},
//统一处理table失焦事件
onHandleTableBlur(params) {
- const { rowIndex, colKey, value, item, dataSource,headerSelectFields } = params
+ const { rowIndex, colKey, value, item, dataSource, headerSelectFields } = params
if (
colKey === 'targetSolutionVolume' ||
colKey === 'targetSolutionConcentration' ||
@@ -524,37 +526,37 @@ export default {
'subTargetStartSolution'
)
const params = {
- subTargetStartSolution:subTargetStartSolution,
+ subTargetStartSolution: subTargetStartSolution,
headerSelectFields
}
if (isValueEmpty(volume)) {
this.$message.error('请先选择预设起始源溶液浓度')
} else {
- this.updateTargetStartSolutionVolume(item, volume,params)
+ this.updateTargetStartSolutionVolume(item, volume, params)
}
} else if (
colKey === 'actStartSolutionVolume' ||
colKey === 'actDiluentVolume'
) {
//实际起始溶液体积和实际目标溶液体积
- const {targetAcSolution,subTargetAcSolutionUnit} =
- this.$refs.stepFormPackageRef?.getFilledFormData() //获取实际起始溶液浓度
- const {headerSelectFields} = this.$refs.stepTableRef?.getFilledFormData();
+ const { targetAcSolution, subTargetAcSolutionUnit } =
+ this.$refs.stepFormPackageRef?.getFilledFormData() //获取实际起始溶液浓度
+ const { headerSelectFields } = this.$refs.stepTableRef?.getFilledFormData();
const p = {
- targetStartSolutionUnit:subTargetAcSolutionUnit,
+ targetStartSolutionUnit: subTargetAcSolutionUnit,
headerSelectFields
}
let initNd = 0;
- if(rowIndex === 0){
+ if (rowIndex === 0) {
initNd = targetAcSolution;
- }else{
+ } else {
initNd = dataSource[rowIndex - 1].actSolutionConcentration;
}
if (isValueEmpty(initNd)) {
this.$message.error('请先选择起始源溶液')
return
} else {
- const volResult = this.updateSjmbrynd(item, initNd,p)
+ const volResult = this.updateSjmbrynd(item, initNd, p)
if (!volResult) {
return
}
@@ -564,14 +566,14 @@ export default {
},
//计算目标溶液浓度
- calcNd(item, targetAcSolution,params) {
- console.log(params,"ppp")
+ calcNd(item, targetAcSolution, params) {
+ console.log(params, "ppp")
// debugger
//targetStartSolutionUnit(实际起始源溶液浓度单位)
- const {targetStartSolutionUnit,headerSelectFields} = params;
+ const { targetStartSolutionUnit, headerSelectFields } = params;
//actStartSolutionVolumeUnit(实际起始源溶液体积单位)actSolutionVolumeUnit(实际目标溶液体积单位)
//actDiluentVolumeUnit(实际稀释液体积单位)actSolutionConcentrationUnit(实际目标溶液浓度单位)
- const {actStartSolutionVolumeUnit,actSolutionVolumeUnit,actDiluentVolumeUnit,actSolutionConcentrationUnit} = headerSelectFields;
+ const { actStartSolutionVolumeUnit, actSolutionVolumeUnit, actDiluentVolumeUnit, actSolutionConcentrationUnit } = headerSelectFields;
//实际源溶液浓度÷(实际终体积÷源溶液加入体积);
const precision = item.actSolutionConcentrationPrecision
const volPrecision = item.actSolutionVolumePrecision;
@@ -579,24 +581,24 @@ export default {
const actDiluentVolume = item.actDiluentVolume
//实际起始源溶液体积
const actStartSolutionVolume = item.actStartSolutionVolume
- if(isValueEmpty(actStartSolutionVolume) || isValueEmpty(actDiluentVolume) || isValueEmpty(targetStartSolutionUnit)){
+ if (isValueEmpty(actStartSolutionVolume) || isValueEmpty(actDiluentVolume) || isValueEmpty(targetStartSolutionUnit)) {
return false
}
-
- const converActDiluentVolume = volumeConverter.convert(actDiluentVolume+actDiluentVolumeUnit,actSolutionVolumeUnit)
- const converActStartSolutionVolume = volumeConverter.convert(actStartSolutionVolume+actStartSolutionVolumeUnit,actSolutionVolumeUnit)
+
+ const converActDiluentVolume = volumeConverter.convert(actDiluentVolume + actDiluentVolumeUnit, actSolutionVolumeUnit)
+ const converActStartSolutionVolume = volumeConverter.convert(actStartSolutionVolume + actStartSolutionVolumeUnit, actSolutionVolumeUnit)
//实际源溶液加入体积+实际稀释液加入体积
const actVol = (
Number(converActDiluentVolume) + Number(converActStartSolutionVolume)
).toFixed(volPrecision)
const targetStartVolUnit = actSolutionConcentrationUnit.split("/")[1];//先按照预设目标溶液浓度的单位标准
- const converActVol = volumeConverter.convert(actVol+actSolutionVolumeUnit,targetStartVolUnit)
- const converActDiluentVolume1 = volumeConverter.convert(actStartSolutionVolume+actStartSolutionVolumeUnit,targetStartVolUnit)
- const converTargetAcSolution = convertConcentration.convert(targetAcSolution+targetStartSolutionUnit,actSolutionConcentrationUnit)
+ const converActVol = volumeConverter.convert(actVol + actSolutionVolumeUnit, targetStartVolUnit)
+ const converActDiluentVolume1 = volumeConverter.convert(actStartSolutionVolume + actStartSolutionVolumeUnit, targetStartVolUnit)
+ const converTargetAcSolution = convertConcentration.convert(targetAcSolution + targetStartSolutionUnit, actSolutionConcentrationUnit)
// 实际目标溶液浓度 = 实际源溶液浓度÷(实际终体积÷源溶液加入体积);
const actNd = (
parseFloat(converTargetAcSolution) / (
- parseFloat(converActVol)/parseFloat(converActDiluentVolume1)
+ parseFloat(converActVol) / parseFloat(converActDiluentVolume1)
)
).toFixed(precision)
const nd = actNd === 'Infinity' ? 0 : Number(actNd)
@@ -606,38 +608,38 @@ export default {
},
//计算并更新实际目标溶液浓度 先计算实际目标溶液体积再计算实际目标溶液浓度
- updateSjmbrynd(item, targetAcSolution,params) {
- return this.calcNd(item, targetAcSolution,params)
+ updateSjmbrynd(item, targetAcSolution, params) {
+ return this.calcNd(item, targetAcSolution, params)
},
//更新起始溶液体积时,计算预设起始溶液体积和预设稀释液体积
- updateTargetStartSolutionVolume(item, volume,unitParams) {
+ updateTargetStartSolutionVolume(item, volume, unitParams) {
const precision = item.targetStartSolutionVolumePrecision || 0
const concentration = item.targetSolutionConcentration
const targetVolume = item.targetSolutionVolume
- const {subTargetStartSolution,headerSelectFields} = unitParams
- const {targetSolutionConcentrationUnit,targetSolutionVolumeUnit,targetStartSolutionVolumeUnit,targetDiluentVolumeUnit} = headerSelectFields
- if(
+ const { subTargetStartSolution, headerSelectFields } = unitParams
+ const { targetSolutionConcentrationUnit, targetSolutionVolumeUnit, targetStartSolutionVolumeUnit, targetDiluentVolumeUnit } = headerSelectFields
+ if (
isValueEmpty(concentration) ||
- isValueEmpty(targetVolume)||
- isValueEmpty(subTargetStartSolution)||
- isValueEmpty(targetSolutionConcentrationUnit)||
- isValueEmpty(targetSolutionVolumeUnit)||
- isValueEmpty(targetStartSolutionVolumeUnit)||
+ isValueEmpty(targetVolume) ||
+ isValueEmpty(subTargetStartSolution) ||
+ isValueEmpty(targetSolutionConcentrationUnit) ||
+ isValueEmpty(targetSolutionVolumeUnit) ||
+ isValueEmpty(targetStartSolutionVolumeUnit) ||
isValueEmpty(targetDiluentVolumeUnit)
- ){
+ ) {
return;
}
const targetStartVolUnit = targetSolutionConcentrationUnit.split("/")[1];//先按照预设目标溶液浓度的单位标准
//将起始溶液浓度转换为和预设目标溶液浓度一样的单位再计算;
- const converStartCon = convertConcentration.convert(volume+subTargetStartSolution,targetSolutionConcentrationUnit)
+ const converStartCon = convertConcentration.convert(volume + subTargetStartSolution, targetSolutionConcentrationUnit)
//将预设目标溶液体积转换为和预设目标溶液浓度单位的分母一样的单位再计算;如:预设目标溶液浓度单位为mg/mL,预设目标溶液体积单位为uL,则将预设目标溶液体积转换为mL
- const convertTargetVol = volumeConverter.convert(targetVolume+targetSolutionVolumeUnit,targetStartVolUnit)
+ const convertTargetVol = volumeConverter.convert(targetVolume + targetSolutionVolumeUnit, targetStartVolUnit)
//预设起始溶液体积:(目标溶液预计浓度 乘以 目标溶液预计体积)除以 起始溶液浓度
const result = Number((concentration * convertTargetVol) / converStartCon)
//根据预设起始溶液体积单位转换计算后的数据
- const convertYsVol = volumeConverter.convert(result+targetStartVolUnit,targetStartSolutionVolumeUnit)
+ const convertYsVol = volumeConverter.convert(result + targetStartVolUnit, targetStartSolutionVolumeUnit)
item.targetStartSolutionVolume = Number(convertYsVol.toFixed(
precision
))
@@ -646,9 +648,9 @@ export default {
//预设稀释液体积:目标溶液预计体积 减去 源溶液预计体积;
const precision1 = item.targetDiluentVolumePrecision || 0;
//将预设目标溶液体积转换为和预设起始溶液体积单位一样的单位再计算;
- const convertTargetVol1 = volumeConverter.convert(targetVolume+targetSolutionVolumeUnit,targetStartSolutionVolumeUnit)
+ const convertTargetVol1 = volumeConverter.convert(targetVolume + targetSolutionVolumeUnit, targetStartSolutionVolumeUnit)
const result1 = (convertTargetVol1 - convertYsVol)
- item.targetDiluentVolume = Number(volumeConverter.convert(result1+targetStartSolutionVolumeUnit,targetDiluentVolumeUnit).toFixed(precision1))
+ item.targetDiluentVolume = Number(volumeConverter.convert(result1 + targetStartSolutionVolumeUnit, targetDiluentVolumeUnit).toFixed(precision1))
// this.$refs.stepTableRef.updateDataSourceByRowIndex(rowIndex, { targetDiluentVolume: result1 });
}
},