|
|
@ -287,14 +287,17 @@ export default { |
|
|
//试剂弹窗确认前
|
|
|
//试剂弹窗确认前
|
|
|
onBeforeReagentSubmit(data) { |
|
|
onBeforeReagentSubmit(data) { |
|
|
const { selectData, callback, key, formFields } = data; |
|
|
const { selectData, callback, key, formFields } = data; |
|
|
const { subTargetStartSolution } = formFields; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const { subTargetStartSolution,targetStartSolution } = formFields; |
|
|
|
|
|
const { nd } = selectData.row; |
|
|
|
|
|
const sjndArr = nd.split('/'); |
|
|
|
|
|
const ytndArr = targetStartSolution.split('/'); |
|
|
//判断选择的浓度单位和预制的浓度单位是否一致
|
|
|
//判断选择的浓度单位和预制的浓度单位是否一致
|
|
|
if (key === "subStartSolution" && !isCommonUnit(selectData.row.nddw, [subTargetStartSolution])) {//选择起始源溶液需要同步更新table的变更记录。
|
|
|
if (key === "subStartSolution" && !isCommonUnit(selectData.row.nddw, [subTargetStartSolution])) {//选择起始源溶液需要同步更新table的变更记录。
|
|
|
callback.prevent('浓度单位与预制不符,请重新选择或申请废止并重新预制。'); |
|
|
callback.prevent('浓度单位与预制不符,请重新选择或申请废止并重新预制。'); |
|
|
} |
|
|
|
|
|
if (selectData.row.nd === "NA") { |
|
|
|
|
|
|
|
|
}else if(nd === "NA") { |
|
|
callback.prevent('当前实际浓度为NA,请重新选择'); |
|
|
callback.prevent('当前实际浓度为NA,请重新选择'); |
|
|
|
|
|
}else if(ytndArr.length !== sjndArr.length) { |
|
|
|
|
|
callback.prevent('起始溶液浓度和目标溶液浓度格式不一致,请重新输入'); |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
getFormDataByTemplateData() { |
|
|
getFormDataByTemplateData() { |
|
|
@ -619,14 +622,6 @@ export default { |
|
|
if (isValueEmpty(actStartSolutionVolume) || isValueEmpty(actDiluentVolume) || isValueEmpty(initUnit)) { |
|
|
if (isValueEmpty(actStartSolutionVolume) || isValueEmpty(actDiluentVolume) || isValueEmpty(initUnit)) { |
|
|
return false |
|
|
return false |
|
|
} |
|
|
} |
|
|
const splitXsytj = actDiluentVolume.split("/"); |
|
|
|
|
|
const splitYrytj = actStartSolutionVolume.split("/"); |
|
|
|
|
|
const sjZtj = splitXsytj.map((item, index) => { |
|
|
|
|
|
const xsytj = volumeConverter.convert(item + actDiluentVolumeUnit, actSolutionVolumeUnit); |
|
|
|
|
|
const yrytj = volumeConverter.convert(splitYrytj[index] + actStartSolutionVolumeUnit, actSolutionVolumeUnit); |
|
|
|
|
|
return (Number(xsytj) + Number(yrytj)).toFixed(volPrecision); |
|
|
|
|
|
}) |
|
|
|
|
|
console.log(sjZtj, "sjZtj") |
|
|
|
|
|
const converActDiluentVolume = volumeConverter.convert(actDiluentVolume + actDiluentVolumeUnit, actSolutionVolumeUnit) |
|
|
const converActDiluentVolume = volumeConverter.convert(actDiluentVolume + actDiluentVolumeUnit, actSolutionVolumeUnit) |
|
|
const converActStartSolutionVolume = volumeConverter.convert(actStartSolutionVolume + actStartSolutionVolumeUnit, actSolutionVolumeUnit) |
|
|
const converActStartSolutionVolume = volumeConverter.convert(actStartSolutionVolume + actStartSolutionVolumeUnit, actSolutionVolumeUnit) |
|
|
//实际源溶液加入体积+实际稀释液加入体积
|
|
|
//实际源溶液加入体积+实际稀释液加入体积
|
|
|
@ -640,18 +635,22 @@ export default { |
|
|
converArr.map((item) => { |
|
|
converArr.map((item) => { |
|
|
return convertConcentration.convert(item + initUnit, actSolutionConcentrationUnit) |
|
|
return convertConcentration.convert(item + initUnit, actSolutionConcentrationUnit) |
|
|
}) |
|
|
}) |
|
|
console.log(converArr, "converArr") |
|
|
|
|
|
const converTargetAcSolution = convertConcentration.convert(targetAcSolution + initUnit, actSolutionConcentrationUnit) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// const converTargetAcSolution = convertConcentration.convert(targetAcSolution + initUnit, actSolutionConcentrationUnit)
|
|
|
// 实际目标溶液浓度 = 实际源溶液浓度÷(实际终体积÷源溶液加入体积);
|
|
|
// 实际目标溶液浓度 = 实际源溶液浓度÷(实际终体积÷源溶液加入体积);
|
|
|
const actNd = ( |
|
|
|
|
|
parseFloat(converTargetAcSolution) / ( |
|
|
|
|
|
parseFloat(converActVol) / parseFloat(converActDiluentVolume1) |
|
|
|
|
|
) |
|
|
|
|
|
).toFixed(precision) |
|
|
|
|
|
const nd = actNd === 'Infinity' ? 0 : Number(actNd) |
|
|
|
|
|
console.log(actNd, targetAcSolution, actStartSolutionVolume, actVol, "actNd") |
|
|
|
|
|
|
|
|
// const actNd = (
|
|
|
|
|
|
// parseFloat(converTargetAcSolution) / (
|
|
|
|
|
|
// parseFloat(converActVol) / parseFloat(converActDiluentVolume1)
|
|
|
|
|
|
// )
|
|
|
|
|
|
// ).toFixed(precision)
|
|
|
|
|
|
const actNdArr = converArr.map((item) => { |
|
|
|
|
|
return parseFloat((item / (converActVol / converActDiluentVolume1) |
|
|
|
|
|
).toFixed(precision)) |
|
|
|
|
|
}) |
|
|
|
|
|
// const nd = actNd === 'Infinity' ? 0 : Number(actNd)
|
|
|
|
|
|
console.log(actNdArr, targetAcSolution, actStartSolutionVolume, actVol, "actNd") |
|
|
// item.actSolutionConcentration = actNd === 'Infinity' ? 0 : actNd
|
|
|
// item.actSolutionConcentration = actNd === 'Infinity' ? 0 : actNd
|
|
|
return { actVol: Number(actVol), actNd: nd } |
|
|
|
|
|
|
|
|
return { actVol: Number(actVol), actNd: actNdArr.join("/") } |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
//计算并更新实际目标溶液浓度 先计算实际目标溶液体积再计算实际目标溶液浓度
|
|
|
//计算并更新实际目标溶液浓度 先计算实际目标溶液体积再计算实际目标溶液浓度
|
|
|
|