Browse Source

feat:[模板管理][update]

lkf
luojie 2 months ago
parent
commit
444a58f537
6 changed files with 101 additions and 51 deletions
  1. +3
    -1
      src/components/Template/CustomTable.vue
  2. +1
    -1
      src/utils/conTools.js
  3. +2
    -3
      src/views/business/comps/template/comps/sp/SP003.vue
  4. +33
    -6
      src/views/business/comps/template/comps/sp/SP00456.vue
  5. +8
    -8
      src/views/business/comps/template/formConfig/paralleAndLadderConfig.js
  6. +54
    -32
      src/views/business/comps/template/mixins/templateMixin.js

+ 3
- 1
src/components/Template/CustomTable.vue View File

@ -481,10 +481,12 @@ export default {
}, },
// //
onHeaderSelectChange(col, value) { onHeaderSelectChange(col, value) {
console.log(col,"ccc")
if (col.headerSelectTo) { if (col.headerSelectTo) {
this.headerSelectFields[col.headerSelectTo] = value; this.headerSelectFields[col.headerSelectTo] = value;
} }
this.headerSelectFields[col.headerSelectKey] = value; this.headerSelectFields[col.headerSelectKey] = value;
console.log(this.headerSelectFields, "this.headerSelectFields")
// //
this.formErrors = this.formErrors.filter(error => this.formErrors = this.formErrors.filter(error =>
!(error.rowIndex === -1 && !(error.rowIndex === -1 &&
@ -724,7 +726,7 @@ export default {
} }
} }
this.$emit("blur", { rowIndex, colKey, value, item: this.localDataSource[rowIndex] });
this.$emit("blur", { rowIndex, colKey, value,dataSource:this.localDataSource, item: this.localDataSource[rowIndex] });
}, },
onSubBlur(rowIndex, colKey, value) { onSubBlur(rowIndex, colKey, value) {
// //

+ 1
- 1
src/utils/conTools.js View File

@ -5,7 +5,7 @@
* @returns {boolean} 是否属于同一系列 * @returns {boolean} 是否属于同一系列
*/ */
export const isConUnitDiff = (startUnit, units) => {
export const isCommonUnit = (startUnit, units) => {
if (!startUnit || !Array.isArray(units) || units.length === 0) { if (!startUnit || !Array.isArray(units) || units.length === 0) {
return false; return false;
} }

+ 2
- 3
src/views/business/comps/template/comps/sp/SP003.vue View File

@ -50,7 +50,7 @@ import SelectReagentDialog from '../../dialog/SelectReagentDialog.vue';
import TableOpertaion from "@/components/Template/operation/TableOpertaion.vue"; import TableOpertaion from "@/components/Template/operation/TableOpertaion.vue";
import { EventBus } from "@/utils/eventBus"; import { EventBus } from "@/utils/eventBus";
import { addTj, uniqeResource, uniqeResourceOne, addDecimals } from "@/utils/calUnitTools"; import { addTj, uniqeResource, uniqeResourceOne, addDecimals } from "@/utils/calUnitTools";
import { isConUnitDiff } from "@/utils/conTools";
import { isCommonUnit } from "@/utils/conTools";
export default { export default {
name: "SP003", name: "SP003",
components: { BaseInfoFormPackage, LineLabel, TableList, Step, CustomTable, SelectReagentDialog, TableOpertaion }, components: { BaseInfoFormPackage, LineLabel, TableList, Step, CustomTable, SelectReagentDialog, TableOpertaion },
@ -563,11 +563,10 @@ export default {
}, },
async getFormData() { async getFormData() {
let content = await this.validFormFields(["baseInfoRef", "stepFormPackageRef", "stepTableRef", "stepRef", "remarkRef"]); let content = await this.validFormFields(["baseInfoRef", "stepFormPackageRef", "stepTableRef", "stepRef", "remarkRef"]);
console.log(content,"content")
if(content){ if(content){
const {headerSelectFields = {},subTargetStartSolution} = content; const {headerSelectFields = {},subTargetStartSolution} = content;
const {targetSolutionConcentrationUnit,actSolutionConcentrationUnit} = headerSelectFields; const {targetSolutionConcentrationUnit,actSolutionConcentrationUnit} = headerSelectFields;
if(!isConUnitDiff(subTargetStartSolution,[targetSolutionConcentrationUnit,actSolutionConcentrationUnit])){
if(!isCommonUnit(subTargetStartSolution,[targetSolutionConcentrationUnit,actSolutionConcentrationUnit])){
this.$message.error("起始浓度单位与目标浓度单位不符,请重新选择!"); this.$message.error("起始浓度单位与目标浓度单位不符,请重新选择!");
return false; return false;
} }

+ 33
- 6
src/views/business/comps/template/comps/sp/SP00456.vue View File

@ -37,7 +37,7 @@
:formData="ladderConfig" :fieldItemLabel="$t('template.common.jtpz')" :formData="ladderConfig" :fieldItemLabel="$t('template.common.jtpz')"
:prefixKey="'ladder_' + ladderIndex" /> :prefixKey="'ladder_' + ladderIndex" />
<CustomTable @blur="(e) => onHandleTableBlur('ladder', ladderIndex, e)" <CustomTable @blur="(e) => onHandleTableBlur('ladder', ladderIndex, e)"
:ref="`ladderStepTableRef_${ladderIndex}`" :showOperation="fillType === 'actFill'"
:ref="`ladderStepTableRef_${ladderIndex}`" :showOperation="fillType === 'actFill' || fillType === 'preFill'"
:columns="ladderStepColumns" :formData="ladderConfig" :columns="ladderStepColumns" :formData="ladderConfig"
:prefixKey="'ladder_' + ladderIndex" :fieldItemLabel="$t('template.common.jtpz')"> :prefixKey="'ladder_' + ladderIndex" :fieldItemLabel="$t('template.common.jtpz')">
<template slot="operation" slot-scope="{ row, rowIndex, columns }"> <template slot="operation" slot-scope="{ row, rowIndex, columns }">
@ -74,7 +74,7 @@
:formData="paralleConfig" :prefixKey="'paralle' + paralleIndex" :formData="paralleConfig" :prefixKey="'paralle' + paralleIndex"
:fieldItemLabel="$t('template.common.pxpz')" /> :fieldItemLabel="$t('template.common.pxpz')" />
<CustomTable @blur="(e) => onHandleTableBlur('paralle', paralleIndex, e)" <CustomTable @blur="(e) => onHandleTableBlur('paralle', paralleIndex, e)"
:ref="`paralleStepTableRef_${paralleIndex}`" :showOperation="fillType === 'actFill'"
:ref="`paralleStepTableRef_${paralleIndex}`" :showOperation="fillType === 'actFill' || fillType === 'preFill'"
:columns="paralleStepColumns" :columns="paralleStepColumns"
@onRegentSubmit="(data) => onTableRegentSubmit('paralle', paralleIndex, data)" @onRegentSubmit="(data) => onTableRegentSubmit('paralle', paralleIndex, data)"
:formData="paralleConfig" :prefixKey="'paralle' + paralleIndex" :formData="paralleConfig" :prefixKey="'paralle' + paralleIndex"
@ -116,6 +116,7 @@ import CustomTable from '@/components/Template/CustomTable.vue';
import SelectReagentDialog from '../../dialog/SelectReagentDialog.vue'; import SelectReagentDialog from '../../dialog/SelectReagentDialog.vue';
import TableOpertaion from "@/components/Template/operation/TableOpertaion.vue"; import TableOpertaion from "@/components/Template/operation/TableOpertaion.vue";
import { getExpireDate, duplicateResource } from "@/utils/index.js"; import { getExpireDate, duplicateResource } from "@/utils/index.js";
import { isCommonUnit } from "@/utils/conTools";
import moment from "moment"; import moment from "moment";
import { addTj, uniqeResource, uniqeResourceOne, addDecimals } from "@/utils/calUnitTools"; import { addTj, uniqeResource, uniqeResourceOne, addDecimals } from "@/utils/calUnitTools";
import { getLadderColumnsConfig, getParallelColumnsConfig, getLadderFormConfig, getBaseInfoFormConfig, getRemarkFormConfig, getStorageConditionFormConfig, getParalleStepFormConfig } from "../../formConfig/paralleAndLadderConfig.js"; import { getLadderColumnsConfig, getParallelColumnsConfig, getLadderFormConfig, getBaseInfoFormConfig, getRemarkFormConfig, getStorageConditionFormConfig, getParalleStepFormConfig } from "../../formConfig/paralleAndLadderConfig.js";
@ -403,15 +404,16 @@ export default {
} else if (colKey === "actStartSolutionVolume" || colKey === "actDiluentVolume") {// } else if (colKey === "actStartSolutionVolume" || colKey === "actDiluentVolume") {//
if (type === "ladder") { if (type === "ladder") {
const targetAcSolution = this.$refs[`ladderStepFormPackageRef_${configIndex}`][0]?.getFormDataByKey("targetAcSolution") || 0;// const targetAcSolution = this.$refs[`ladderStepFormPackageRef_${configIndex}`][0]?.getFormDataByKey("targetAcSolution") || 0;//
const dataSource = this.$refs[`ladderStepTableRef_${configIndex}`][0]?.getDataSource() || [];
if (targetAcSolution) { if (targetAcSolution) {
const volResult = this.updateSjmbrynd(item, targetAcSolution);
const volResult = this.updateSjmbrynd(item, targetAcSolution,rowIndex,dataSource,"ladder");
if (!volResult) { if (!volResult) {
return return
} }
this.$refs[`ladderStepTableRef_${configIndex}`][0]?.updateDataSourceByRowIndex(rowIndex, { this.$refs[`ladderStepTableRef_${configIndex}`][0]?.updateDataSourceByRowIndex(rowIndex, {
actSolutionVolume: volResult.actVol, actSolutionVolume: volResult.actVol,
actSolutionConcentration: volResult.actNd, actSolutionConcentration: volResult.actNd,
}, "blur");
});
} }
} else if (type === "paralle") { } else if (type === "paralle") {
const targetAcSolution = item.targetAcSolution || 0;// const targetAcSolution = item.targetAcSolution || 0;//
@ -438,12 +440,15 @@ export default {
const tableRef = this.$refs[`paralleStepTableRef_${configIndex}`][0]; const tableRef = this.$refs[`paralleStepTableRef_${configIndex}`][0];
if (tableRef) { if (tableRef) {
const volResult = this.updateSjmbrynd(rowData, row.nd); const volResult = this.updateSjmbrynd(rowData, row.nd);
//code
tableRef.updateDataSourceByRowIndex(rowIndex, {
actStartSolutionCode: selectedId,
targetAcSolution: row.nd,
})
if (!volResult) { if (!volResult) {
return return
} }
tableRef.updateDataSourceByRowIndex(rowIndex, { tableRef.updateDataSourceByRowIndex(rowIndex, {
actStartSolutionCode: selectedId,
targetAcSolution: row.nd,
actSolutionVolume: volResult.actVol, actSolutionVolume: volResult.actVol,
actSolutionConcentration: volResult.actNd, actSolutionConcentration: volResult.actNd,
}) })
@ -577,6 +582,28 @@ export default {
return false; return false;
} }
let content = this.getFilledFormData(); 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]));
if(!ladderConUnitDiff){
this.$message.error("起始浓度单位与目标浓度单位不符,请重新选择!");
return false;
}
}
if(paralleConfigs.length > 0){
const paralleConUnitDiff = paralleConfigs.every(item => {
const {stepTableFormData = [],headerSelectFields = {}} =item;
const conUnits = stepTableFormData.map(item => item.targetStartSolutionConcentrationPrecision);
const {actSolutionConcentrationUnit,targetSolutionConcentrationUnit} = headerSelectFields;
return isCommonUnit(actSolutionConcentrationUnit,[...conUnits,targetSolutionConcentrationUnit]);
});
if(!paralleConUnitDiff){
this.$message.error("起始浓度单位与目标浓度单位不符,请重新选择!");
return false;
}
}
}
return content; return content;
}, },
getResource() { getResource() {

+ 8
- 8
src/views/business/comps/template/formConfig/paralleAndLadderConfig.js View File

@ -41,7 +41,7 @@ export const getLadderColumnsConfig = ($this) => {
bodyMaxlength: 10, bodyMaxlength: 10,
bodyDisabled: true, bodyDisabled: true,
bodySubPlaceholder: 'template.common.xswsPlaceholder', bodySubPlaceholder: 'template.common.xswsPlaceholder',
selectTo:"actStartSolutionVolumeUnit",
headerSelectTo:"actStartSolutionVolumeUnit",
}, },
{ {
label: 'template.sp.sp00456.sjqsrytj', label: 'template.sp.sp00456.sjqsrytj',
@ -76,7 +76,7 @@ export const getLadderColumnsConfig = ($this) => {
bodyPrecisionKey: 'targetDiluentVolumePrecision', bodyPrecisionKey: 'targetDiluentVolumePrecision',
bodyMaxlength: 10, bodyMaxlength: 10,
bodySubPlaceholder: 'template.common.xswsPlaceholder', bodySubPlaceholder: 'template.common.xswsPlaceholder',
selectTo:"actDiluentVolumeUnit",
headerSelectTo:"actDiluentVolumeUnit",
}, },
{ {
label: 'template.sp.sp00456.sjxsytj', label: 'template.sp.sp00456.sjxsytj',
@ -103,7 +103,7 @@ export const getLadderColumnsConfig = ($this) => {
bodyType: 'inputNumber', bodyType: 'inputNumber',
bodyFillType: 'preFill', bodyFillType: 'preFill',
bodyMaxlength: 10, bodyMaxlength: 10,
selectTo:"actSolutionConcentrationUnit",
headerSelectTo:"actSolutionConcentrationUnit",
}, },
{ {
label: 'template.sp.sp00456.sjmbrynd', label: 'template.sp.sp00456.sjmbrynd',
@ -137,7 +137,7 @@ export const getLadderColumnsConfig = ($this) => {
bodyType: 'inputNumber', bodyType: 'inputNumber',
bodyFillType: 'preFill', bodyFillType: 'preFill',
bodyMaxlength: 10, bodyMaxlength: 10,
selectTo:"actSolutionVolumeUnit",
headerSelectTo:"actSolutionVolumeUnit",
}, },
{ {
label: 'template.sp.sp00456.sjmbrytj', label: 'template.sp.sp00456.sjmbrytj',
@ -197,7 +197,7 @@ export const getParallelColumnsConfig = ($this) => {
bodyType: 'inputNumber', bodyType: 'inputNumber',
bodyFillType: 'preFill', bodyFillType: 'preFill',
bodyMaxlength: 10, bodyMaxlength: 10,
selectTo:"actSolutionConcentrationUnit",
headerSelectTo:"actSolutionConcentrationUnit",
}, },
{ {
label: 'template.sp.sp00456.sjmbrynd', label: 'template.sp.sp00456.sjmbrynd',
@ -230,7 +230,7 @@ export const getParallelColumnsConfig = ($this) => {
bodyType: 'inputNumber', bodyType: 'inputNumber',
bodyFillType: 'preFill', bodyFillType: 'preFill',
bodyMaxlength: 10, bodyMaxlength: 10,
selectTo:"actSolutionVolumeUnit",
headerSelectTo:"actSolutionVolumeUnit",
}, },
{ {
label: 'template.sp.sp00456.sjmbrytj', label: 'template.sp.sp00456.sjmbrytj',
@ -335,7 +335,7 @@ export const getParallelColumnsConfig = ($this) => {
bodyDisabled: true, bodyDisabled: true,
showBodySub: true, showBodySub: true,
showBodySub: $this.fillType === 'preFill', showBodySub: $this.fillType === 'preFill',
selectTo:"actStartSolutionVolumeUnit",
headerSelectTo:"actStartSolutionVolumeUnit",
}, },
{ {
@ -371,7 +371,7 @@ export const getParallelColumnsConfig = ($this) => {
bodySubPlaceholder: 'template.common.xswsPlaceholder', bodySubPlaceholder: 'template.common.xswsPlaceholder',
bodyDisabled: true, bodyDisabled: true,
showBodySub: $this.fillType === 'preFill', showBodySub: $this.fillType === 'preFill',
selectTo:"actDiluentVolumeUnit",
headerSelectTo:"actDiluentVolumeUnit",
}, },
{ {
label: 'template.sp.sp00456.sjxsytj', label: 'template.sp.sp00456.sjxsytj',

+ 54
- 32
src/views/business/comps/template/mixins/templateMixin.js View File

@ -1,5 +1,5 @@
import moment from 'moment' import moment from 'moment'
import { getLatestSn,getLatestSnArr } from '@/api/template';
import { getLatestSn, getLatestSnArr } from '@/api/template';
import { isValueEmpty } from '@/utils/index'; import { isValueEmpty } from '@/utils/index';
import { sj_subpackage, sj_startConfiguration, sj_configurationCompleted } from '@/api/business/sj/sj'; import { sj_subpackage, sj_startConfiguration, sj_configurationCompleted } from '@/api/business/sj/sj';
export default { export default {
@ -53,21 +53,21 @@ export default {
id id
} = v } = v
if (v.resource) { if (v.resource) {
//type 类型:1:试剂;3:给药制剂;5:麻精药;7:供试品
//type 类型:1:试剂;3:给药制剂;5:麻精药;7:供试品
//试验试剂信息 试剂 //试验试剂信息 试剂
this.resource = _.filter(JSON.parse(v.resource),function(o){
return o.type==1||o.elnType==1
this.resource = _.filter(JSON.parse(v.resource), function (o) {
return o.type == 1 || o.elnType == 1
}) })
//试验物资信息 供试品、给药制剂 //试验物资信息 供试品、给药制剂
this.resourceWz =_.filter(JSON.parse(v.resource),function(o){
return o.type==3||o.type==7||o.elnType==3||o.elnType==7
this.resourceWz = _.filter(JSON.parse(v.resource), function (o) {
return o.type == 3 || o.type == 7 || o.elnType == 3 || o.elnType == 7
}) })
} }
if (v.yqResource) { if (v.yqResource) {
//仪器信息 //仪器信息
this.yqResource = JSON.parse(v.yqResource) this.yqResource = JSON.parse(v.yqResource)
} }
this.product=v.product||null
this.product = v.product || null
if (v.bdnr) { if (v.bdnr) {
this.formData = { this.formData = {
...JSON.parse(v.bdnr), ...JSON.parse(v.bdnr),
@ -125,13 +125,13 @@ export default {
return { return {
formData: {}, formData: {},
templateDetail: {}, templateDetail: {},
product:null,//产物:1:试剂;3:给药制剂;5:麻精药
product: null,//产物:1:试剂;3:给药制剂;5:麻精药
resource: [], //试验试剂信息 resource: [], //试验试剂信息
resourceWz: [], //物资信息 resourceWz: [], //物资信息
yqResource: [], //仪器信息 yqResource: [], //仪器信息
jcbList: [], //检测板信息 jcbList: [], //检测板信息
resourceTmp:[],//试验试剂信息提交用
resourceTmp: [],//试验试剂信息提交用
yqResourceTmp: [], //仪器信息提交用 yqResourceTmp: [], //仪器信息提交用
jcbListTmp: [], //检测板信息提交用 jcbListTmp: [], //检测板信息提交用
sysjColumns: [ sysjColumns: [
@ -162,10 +162,10 @@ export default {
this.setTemplateData({}) this.setTemplateData({})
}, },
methods: { methods: {
getFormDataByTemplateData(){
getFormDataByTemplateData() {
let o = {}; let o = {};
const { bdnr } = this.templateData const { bdnr } = this.templateData
if(bdnr){
if (bdnr) {
o = JSON.parse(bdnr) o = JSON.parse(bdnr)
} }
return o; return o;
@ -352,8 +352,8 @@ export default {
}, },
//统一处理table失焦事件 //统一处理table失焦事件
onHandleTableBlur(params) { onHandleTableBlur(params) {
const { rowIndex, colKey, value, item } = params
console.log(params,"params");
const { rowIndex, colKey, value, item, dataSource } = params
console.log(params, "params");
if ( if (
colKey === 'targetSolutionVolume' || colKey === 'targetSolutionVolume' ||
colKey === 'targetSolutionConcentration' || colKey === 'targetSolutionConcentration' ||
@ -364,9 +364,9 @@ export default {
this.$refs.stepFormPackageRef?.getFormDataByKey( this.$refs.stepFormPackageRef?.getFormDataByKey(
'targetStartSolution' 'targetStartSolution'
) )
if(isValueEmpty(volume)){
if (isValueEmpty(volume)) {
this.$message.error('请先选择预设起始源溶液浓度') this.$message.error('请先选择预设起始源溶液浓度')
}else{
} else {
this.updateTargetStartSolutionVolume(item, volume) this.updateTargetStartSolutionVolume(item, volume)
} }
} else if ( } else if (
@ -376,25 +376,24 @@ export default {
//实际起始溶液体积和实际目标溶液体积 //实际起始溶液体积和实际目标溶液体积
const targetAcSolution = const targetAcSolution =
this.$refs.stepFormPackageRef?.getFormDataByKey('targetAcSolution') //获取实际起始溶液浓度 this.$refs.stepFormPackageRef?.getFormDataByKey('targetAcSolution') //获取实际起始溶液浓度
console.log(targetAcSolution,"targetAcSolution")
if(isValueEmpty(targetAcSolution)){
this.$message.error('请先选择起始源溶液')
return
}else {
const volResult = this.updateSjmbrynd(item, targetAcSolution);
if(!volResult){
if (isValueEmpty(targetAcSolution)) {
this.$message.error('请先选择起始源溶液')
return
} else {
const volResult = this.updateSjmbrynd(item, targetAcSolution, rowIndex, dataSource, "ladder")
if (!volResult) {
return return
} }
this.$refs.stepTableRef?.updateDataSourceByRowIndex(rowIndex, { actSolutionVolume: volResult.actVol,actSolutionConcentration: volResult.actNd},"blur")
this.$refs.stepTableRef?.updateDataSourceByRowIndex(rowIndex, { actSolutionVolume: volResult.actVol, actSolutionConcentration: volResult.actNd }, "blur")
} }
} }
}, },
//计算并更新实际目标溶液浓度 先计算实际目标溶液体积再计算实际目标溶液浓度
updateSjmbrynd(item, targetAcSolution) {
console.log(item, targetAcSolution, 'updateSjmbrynd')
//计算目标溶液浓度
calcNd(item, targetAcSolution) {
//实际源溶液浓度÷(实际终体积÷源溶液加入体积); //实际源溶液浓度÷(实际终体积÷源溶液加入体积);
const precision = item.actSolutionConcentrationPrecision
const precision = item.actSolutionConcentrationPrecision
const volPrecision = item.actSolutionVolumePrecision || 0 const volPrecision = item.actSolutionVolumePrecision || 0
//实际稀释液体积 //实际稀释液体积
const actDiluentVolume = item.actDiluentVolume const actDiluentVolume = item.actDiluentVolume
@ -406,20 +405,43 @@ export default {
//实际目标溶液体积 //实际目标溶液体积
// item.actSolutionVolume = actVol // item.actSolutionVolume = actVol
//实际目标溶液浓度 //实际目标溶液浓度
if(isValueEmpty(actDiluentVolume) && isValueEmpty(actStartSolutionVolume)){
if (isValueEmpty(actDiluentVolume) && isValueEmpty(actStartSolutionVolume)) {
return false return false
} }
// 实际目标溶液浓度 = 实际源溶液浓度÷(实际终体积÷源溶液加入体积); // 实际目标溶液浓度 = 实际源溶液浓度÷(实际终体积÷源溶液加入体积);
const actNd = ( const actNd = (
parseFloat(targetAcSolution) /(
parseFloat(actStartSolutionVolume) /
parseFloat(actVol)
parseFloat(targetAcSolution) / (
parseFloat(actVol)/parseFloat(actStartSolutionVolume)
) )
).toFixed(precision) ).toFixed(precision)
const nd = actNd === 'Infinity' ? 0 : Number(actNd) const nd = actNd === 'Infinity' ? 0 : Number(actNd)
console.log(actNd, targetAcSolution, actStartSolutionVolume, actVol, "actNd") console.log(actNd, 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: nd }
},
//计算并更新实际目标溶液浓度 先计算实际目标溶液体积再计算实际目标溶液浓度
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);
}
}
return this.calcNd(item, targetAcSolution)
}, },
//更新起始溶液体积时,计算目标溶液预计浓度 //更新起始溶液体积时,计算目标溶液预计浓度
updateTargetStartSolutionVolume(item, volume) { updateTargetStartSolutionVolume(item, volume) {

Loading…
Cancel
Save