|
|
|
@ -503,18 +503,19 @@ export default { |
|
|
|
targetDiluentVolumePrecision: 3, //小数点精度默认为3
|
|
|
|
targetStartSolutionVolumePrecision: 3, //小数点精度默认为3
|
|
|
|
targetSolutionCode: `CA-WS-STD${Number(codeSTD) - index}`, |
|
|
|
id:getuuid() |
|
|
|
id:getuuid(), |
|
|
|
rowIndex:index, |
|
|
|
})) |
|
|
|
this.$refs.stepTableRef.updateDataSource(arr) |
|
|
|
} else if (key === 'targetStartSolution' || key === 'subTargetStartSolution') { |
|
|
|
//起始溶液体积失焦时,更新目标溶液预计浓度
|
|
|
|
const arr = this.$refs.stepTableRef?.getDataSource(); |
|
|
|
const { headerSelectFields } = this.$refs.stepTableRef?.getFilledFormData(); |
|
|
|
const { headerSelectFields,stepTableFormData=[] } = this.$refs.stepTableRef?.getFilledFormData(); |
|
|
|
const params = { |
|
|
|
subTargetStartSolution, |
|
|
|
headerSelectFields |
|
|
|
} |
|
|
|
|
|
|
|
headerSelectFields, |
|
|
|
dataSource:stepTableFormData, |
|
|
|
} |
|
|
|
arr.forEach((item, rowIndex) => { |
|
|
|
this.updateTargetStartSolutionVolume( |
|
|
|
item, |
|
|
|
@ -526,6 +527,7 @@ export default { |
|
|
|
}, |
|
|
|
//批量更新目标起始源溶液体积
|
|
|
|
batchUpdateTargetStartSolutionVolume(arr, startConcentration, params) { |
|
|
|
params.dataSource = arr; |
|
|
|
arr.forEach((item, rowIndex) => { |
|
|
|
this.updateTargetStartSolutionVolume( |
|
|
|
item, |
|
|
|
@ -553,7 +555,8 @@ export default { |
|
|
|
) |
|
|
|
const params = { |
|
|
|
subTargetStartSolution: subTargetStartSolution, |
|
|
|
headerSelectFields |
|
|
|
headerSelectFields, |
|
|
|
dataSource |
|
|
|
} |
|
|
|
if (isValueEmpty(volume)) { |
|
|
|
this.$message.error('请先选择预设起始源溶液浓度') |
|
|
|
@ -593,13 +596,17 @@ export default { |
|
|
|
|
|
|
|
//计算目标溶液浓度
|
|
|
|
calcNd(item, targetAcSolution, params) { |
|
|
|
console.log(params, "ppp") |
|
|
|
console.log(item,params, "ppp") |
|
|
|
// debugger
|
|
|
|
//targetStartSolutionUnit(实际起始源溶液浓度单位)
|
|
|
|
const { targetStartSolutionUnit, headerSelectFields } = params; |
|
|
|
const { actStartSolutionVolumeUnit, actSolutionVolumeUnit, actDiluentVolumeUnit, actSolutionConcentrationUnit } = headerSelectFields; |
|
|
|
let initUnit = targetStartSolutionUnit; |
|
|
|
if (item.rowIndex > 0) { |
|
|
|
initUnit = actSolutionConcentrationUnit; |
|
|
|
} |
|
|
|
//actStartSolutionVolumeUnit(实际起始源溶液体积单位)actSolutionVolumeUnit(实际目标溶液体积单位)
|
|
|
|
//actDiluentVolumeUnit(实际稀释液体积单位)actSolutionConcentrationUnit(实际目标溶液浓度单位)
|
|
|
|
const { actStartSolutionVolumeUnit, actSolutionVolumeUnit, actDiluentVolumeUnit, actSolutionConcentrationUnit } = headerSelectFields; |
|
|
|
//实际源溶液浓度÷(实际终体积÷源溶液加入体积);
|
|
|
|
const precision = item.actSolutionConcentrationPrecision |
|
|
|
const volPrecision = item.actSolutionVolumePrecision; |
|
|
|
@ -607,10 +614,9 @@ export default { |
|
|
|
const actDiluentVolume = item.actDiluentVolume |
|
|
|
//实际起始源溶液体积
|
|
|
|
const actStartSolutionVolume = item.actStartSolutionVolume |
|
|
|
if (isValueEmpty(actStartSolutionVolume) || isValueEmpty(actDiluentVolume) || isValueEmpty(targetStartSolutionUnit)) { |
|
|
|
if (isValueEmpty(actStartSolutionVolume) || isValueEmpty(actDiluentVolume) || isValueEmpty(initUnit)) { |
|
|
|
return false |
|
|
|
} |
|
|
|
|
|
|
|
const converActDiluentVolume = volumeConverter.convert(actDiluentVolume + actDiluentVolumeUnit, actSolutionVolumeUnit) |
|
|
|
const converActStartSolutionVolume = volumeConverter.convert(actStartSolutionVolume + actStartSolutionVolumeUnit, actSolutionVolumeUnit) |
|
|
|
//实际源溶液加入体积+实际稀释液加入体积
|
|
|
|
@ -620,12 +626,12 @@ export default { |
|
|
|
const targetStartVolUnit = actSolutionConcentrationUnit.split("/")[1];//先按照预设目标溶液浓度的单位标准
|
|
|
|
const converActVol = volumeConverter.convert(actVol + actSolutionVolumeUnit, targetStartVolUnit) |
|
|
|
const converActDiluentVolume1 = volumeConverter.convert(actStartSolutionVolume + actStartSolutionVolumeUnit, targetStartVolUnit) |
|
|
|
const converArr = targetAcSolution.split("/"); |
|
|
|
const converArr = (targetAcSolution+'').split("/"); |
|
|
|
converArr.map((item)=>{ |
|
|
|
return convertConcentration.convert(item + targetStartSolutionUnit, actSolutionConcentrationUnit) |
|
|
|
return convertConcentration.convert(item + initUnit, actSolutionConcentrationUnit) |
|
|
|
}) |
|
|
|
console.log(converArr,"converArr") |
|
|
|
const converTargetAcSolution = convertConcentration.convert(targetAcSolution + targetStartSolutionUnit, actSolutionConcentrationUnit) |
|
|
|
const converTargetAcSolution = convertConcentration.convert(targetAcSolution + initUnit, actSolutionConcentrationUnit) |
|
|
|
// 实际目标溶液浓度 = 实际源溶液浓度÷(实际终体积÷源溶液加入体积);
|
|
|
|
const actNd = ( |
|
|
|
parseFloat(converTargetAcSolution) / ( |
|
|
|
@ -644,15 +650,22 @@ export default { |
|
|
|
}, |
|
|
|
//更新起始溶液体积时,计算预设起始溶液体积和预设稀释液体积
|
|
|
|
updateTargetStartSolutionVolume(item, volume, unitParams) { |
|
|
|
const { rowIndex } = item |
|
|
|
const { subTargetStartSolution, headerSelectFields, dataSource=[] } = unitParams |
|
|
|
const { targetSolutionConcentrationUnit, targetSolutionVolumeUnit, targetStartSolutionVolumeUnit, targetDiluentVolumeUnit } = headerSelectFields |
|
|
|
|
|
|
|
let initNd = volume,unit = subTargetStartSolution; |
|
|
|
if (rowIndex > 0) { |
|
|
|
initNd = dataSource[rowIndex - 1].targetSolutionConcentration; |
|
|
|
unit = targetSolutionConcentrationUnit; |
|
|
|
} |
|
|
|
const precision = item.targetStartSolutionVolumePrecision || 0 |
|
|
|
const concentration = item.targetSolutionConcentration |
|
|
|
const targetVolume = item.targetSolutionVolume |
|
|
|
const { subTargetStartSolution, headerSelectFields } = unitParams |
|
|
|
const { targetSolutionConcentrationUnit, targetSolutionVolumeUnit, targetStartSolutionVolumeUnit, targetDiluentVolumeUnit } = headerSelectFields |
|
|
|
if ( |
|
|
|
isValueEmpty(concentration) || |
|
|
|
isValueEmpty(targetVolume) || |
|
|
|
isValueEmpty(subTargetStartSolution) || |
|
|
|
isValueEmpty(unit) || |
|
|
|
isValueEmpty(targetSolutionConcentrationUnit) || |
|
|
|
isValueEmpty(targetSolutionVolumeUnit) || |
|
|
|
isValueEmpty(targetStartSolutionVolumeUnit) || |
|
|
|
@ -660,14 +673,15 @@ export default { |
|
|
|
) { |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
const targetStartVolUnit = targetSolutionConcentrationUnit.split("/")[1];//先按照预设目标溶液浓度的单位标准
|
|
|
|
const volumeArr = volume.split("/"); |
|
|
|
const volumeArr = (initNd+'').split("/"); |
|
|
|
const converArr = volumeArr.map((item)=>{ |
|
|
|
return convertConcentration.convert(item + subTargetStartSolution, targetSolutionConcentrationUnit) |
|
|
|
return convertConcentration.convert(item + unit, targetSolutionConcentrationUnit) |
|
|
|
}) |
|
|
|
console.log(converArr,"converArr") |
|
|
|
//将起始溶液浓度转换为和预设目标溶液浓度一样的单位再计算;
|
|
|
|
const converStartCon = convertConcentration.convert(volume + subTargetStartSolution, targetSolutionConcentrationUnit) |
|
|
|
const converStartCon = convertConcentration.convert(initNd + unit, targetSolutionConcentrationUnit) |
|
|
|
//将预设目标溶液体积转换为和预设目标溶液浓度单位的分母一样的单位再计算;如:预设目标溶液浓度单位为mg/mL,预设目标溶液体积单位为uL,则将预设目标溶液体积转换为mL
|
|
|
|
const convertTargetVol = volumeConverter.convert(targetVolume + targetSolutionVolumeUnit, targetStartVolUnit) |
|
|
|
|
|
|
|
|