diff --git a/src/components/Template/HandleFormItem.vue b/src/components/Template/HandleFormItem.vue index 83c8450..115c85a 100644 --- a/src/components/Template/HandleFormItem.vue +++ b/src/components/Template/HandleFormItem.vue @@ -1202,7 +1202,7 @@ console.log("fillll") if (!isOldValueEmpty && !(isSame) && (this.templateFillType === "actFill" || this.templateFillType === "blxjsh")&&this.type !== "attachment") { console.log("需要电子签名") // 通过EventBus触发电子签名弹窗 - EventBus.$emit('showEditSignDialog', { uuid: this.uuid }); + // EventBus.$emit('showEditSignDialog', { uuid: this.uuid }); } else {//如果是第一次填写,不需要密码验证 this.handleUpdateRecord() } diff --git a/src/views/business/comps/template/mixins/templateMixin.js b/src/views/business/comps/template/mixins/templateMixin.js index 0b5bb38..8e7aee4 100644 --- a/src/views/business/comps/template/mixins/templateMixin.js +++ b/src/views/business/comps/template/mixins/templateMixin.js @@ -287,14 +287,17 @@ export default { //试剂弹窗确认前 onBeforeReagentSubmit(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的变更记录。 callback.prevent('浓度单位与预制不符,请重新选择或申请废止并重新预制。'); - } - if (selectData.row.nd === "NA") { + }else if(nd === "NA") { callback.prevent('当前实际浓度为NA,请重新选择'); + }else if(ytndArr.length !== sjndArr.length) { + callback.prevent('起始溶液浓度和目标溶液浓度格式不一致,请重新输入'); } }, getFormDataByTemplateData() { @@ -619,14 +622,6 @@ export default { if (isValueEmpty(actStartSolutionVolume) || isValueEmpty(actDiluentVolume) || isValueEmpty(initUnit)) { 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 converActStartSolutionVolume = volumeConverter.convert(actStartSolutionVolume + actStartSolutionVolumeUnit, actSolutionVolumeUnit) //实际源溶液加入体积+实际稀释液加入体积 @@ -640,18 +635,22 @@ export default { converArr.map((item) => { 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 - return { actVol: Number(actVol), actNd: nd } + return { actVol: Number(actVol), actNd: actNdArr.join("/") } }, //计算并更新实际目标溶液浓度 先计算实际目标溶液体积再计算实际目标溶液浓度