|
|
|
@ -332,6 +332,30 @@ export default { |
|
|
|
this.$refs.stepTableRef.deleteRow(index) |
|
|
|
}, |
|
|
|
|
|
|
|
//统一处理浓度校验异常
|
|
|
|
onCommonVerifyNdException(formFields,data){ |
|
|
|
const {callback,rowIndex, key,dataSource} = data; |
|
|
|
const keys = [ |
|
|
|
'actStartSolutionVolume', |
|
|
|
'actDiluentVolume', |
|
|
|
] |
|
|
|
if(keys.includes(key)){ |
|
|
|
const {targetAcSolution} = formFields; |
|
|
|
if (rowIndex === 0) {//第一行的浓度取选择的溶液,
|
|
|
|
if (isValueEmpty(targetAcSolution)) { |
|
|
|
callback.prevent("请先选择起始源溶液") |
|
|
|
} |
|
|
|
} else { |
|
|
|
//非第一行的浓度取上一行的浓度
|
|
|
|
const prevItem = dataSource[rowIndex - 1] |
|
|
|
const prevConcentration = prevItem.actSolutionConcentration; |
|
|
|
if (!prevConcentration) { |
|
|
|
callback.prevent("请先计算上一行的实际目标溶液浓度") |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
//统一处理blur事件,因为有效周期和过期日期是相关的,所以需要在有效周期失焦时更新过期日期
|
|
|
|
onHandleBlur(fields) { |
|
|
|
const { |
|
|
|
@ -410,13 +434,13 @@ export default { |
|
|
|
colKey === 'actDiluentVolume' |
|
|
|
) { |
|
|
|
//实际起始溶液体积和实际目标溶液体积
|
|
|
|
const targetAcSolution = |
|
|
|
this.$refs.stepFormPackageRef?.getFormDataByKey('targetAcSolution') //获取实际起始溶液浓度
|
|
|
|
const {targetAcSolution} = |
|
|
|
this.$refs.stepFormPackageRef?.getFilledFormData() //获取实际起始溶液浓度
|
|
|
|
if (isValueEmpty(targetAcSolution)) { |
|
|
|
this.$message.error('请先选择起始源溶液') |
|
|
|
return |
|
|
|
} else { |
|
|
|
const volResult = this.updateSjmbrynd(item, targetAcSolution, rowIndex, dataSource, "ladder") |
|
|
|
const volResult = this.updateSjmbrynd(item, targetAcSolution) |
|
|
|
if (!volResult) { |
|
|
|
return |
|
|
|
} |
|
|
|
@ -457,26 +481,7 @@ export default { |
|
|
|
}, |
|
|
|
|
|
|
|
//计算并更新实际目标溶液浓度 先计算实际目标溶液体积再计算实际目标溶液浓度
|
|
|
|
updateSjmbrynd(item, targetAcSolution, rowIndex, dataSource, type) { |
|
|
|
//如果是阶梯配置的就需要传rowIndex,dataSource,type字段
|
|
|
|
if (type === "ladder") { |
|
|
|
if (rowIndex === 0) {//第一行的浓度取选择的溶液,
|
|
|
|
if (isValueEmpty(targetAcSolution)) { |
|
|
|
this.$message.error('请先选择起始源溶液') |
|
|
|
return |
|
|
|
} |
|
|
|
return this.calcNd(item, targetAcSolution) |
|
|
|
} else { |
|
|
|
//非第一行的浓度取上一行的浓度
|
|
|
|
const prevItem = dataSource[rowIndex - 1] |
|
|
|
const prevConcentration = prevItem.actSolutionConcentration; |
|
|
|
if (!prevConcentration) { |
|
|
|
this.$message.error('请先计算上一行的实际目标溶液浓度') |
|
|
|
return false |
|
|
|
} |
|
|
|
return this.updateSjmbrynd(item, prevConcentration); |
|
|
|
} |
|
|
|
} |
|
|
|
updateSjmbrynd(item, targetAcSolution) { |
|
|
|
return this.calcNd(item, targetAcSolution) |
|
|
|
}, |
|
|
|
//更新起始溶液体积时,计算预设起始溶液体积和预设稀释液体积
|
|
|
|
|