|
|
|
@ -42,6 +42,7 @@ |
|
|
|
<CustomTable @blur="(e) => onHandleTableBlur('ladder', ladderIndex, e)" |
|
|
|
:ref="`ladderStepTableRef_${ladderIndex}`" :showOperation="fillType === 'actFill' || fillType === 'preFill'" |
|
|
|
:columns="ladderStepColumns" :formData="ladderConfig" |
|
|
|
@beforeSaveRecord = "(data) => onBeforeSaveRecord(data,'ladder',ladderIndex)" |
|
|
|
@headerSelectChange="(data)=>onHeaderSelectChange(data,'ladder',ladderIndex)" |
|
|
|
:prefixKey="'ladder_' + ladderIndex" :fieldItemLabel="$t('template.common.jtpz')"> |
|
|
|
<template slot="operation" slot-scope="{ row, rowIndex, columns }"> |
|
|
|
@ -199,6 +200,12 @@ export default { |
|
|
|
} |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
onBeforeSaveRecord(data,type,configIndex){ |
|
|
|
if(type === "ladder"){ |
|
|
|
const formFields = this.$refs[`ladderStepFormPackageRef_${configIndex}`][0]?.getFilledFormData(); |
|
|
|
this.onCommonVerifyNdException(formFields,data); |
|
|
|
} |
|
|
|
}, |
|
|
|
bodySelectChange(data){ |
|
|
|
this.paralleUpdateTargetStartSolutionVolume(data.item,data.headerSelectFields); |
|
|
|
}, |
|
|
|
@ -346,7 +353,7 @@ export default { |
|
|
|
row.subTargetSolutionCode && row.subTargetSolutionCode.trim() !== ''); |
|
|
|
// 如果没有任何一行有值,则为所有行分配编号 |
|
|
|
if (!hasAnyWithValue) { |
|
|
|
const codes = stepTableFormData.map((item) => ({ prex: item.targetSolutionCode, type: 1 })); |
|
|
|
const codes = stepTableFormData.map((item) => ({ pre: item.targetSolutionCode, type: 1 })); |
|
|
|
const snList = await this.getLatestSnArr(codes); |
|
|
|
tableDataArray.forEach((row, idx) => { |
|
|
|
let expDate = {}; |
|
|
|
@ -441,6 +448,22 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
getLadderNdParamsByIndex(configIndex){ |
|
|
|
const { headerSelectFields = [] } = this.$refs[`ladderStepTableRef_${configIndex}`][0].getFilledFormData(); |
|
|
|
const subTargetAcSolutionUnit = this.$refs[`ladderStepFormPackageRef_${configIndex}`][0]?.getFormDataByKey("subTargetAcSolutionUnit");//获取实际起始溶液浓度 |
|
|
|
return { |
|
|
|
targetStartSolutionUnit:subTargetAcSolutionUnit, |
|
|
|
headerSelectFields |
|
|
|
} |
|
|
|
}, |
|
|
|
getParalleNdParamsByIndex(item,configIndex){ |
|
|
|
const { headerSelectFields = [] } = this.$refs[`paralleStepTableRef_${configIndex}`][0].getFilledFormData(); |
|
|
|
const subTargetAcSolutionUnit = item.subTargetAcSolutionUnit || "";//获取实际起始溶液浓度单位 |
|
|
|
return { |
|
|
|
targetStartSolutionUnit:subTargetAcSolutionUnit, |
|
|
|
headerSelectFields |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
// 表格失去焦点事件 |
|
|
|
onHandleTableBlur(type, configIndex, e) { |
|
|
|
@ -460,10 +483,10 @@ export default { |
|
|
|
} |
|
|
|
} else if (colKey === "actStartSolutionVolume" || colKey === "actDiluentVolume") {//实际起始溶液体积和实际目标溶液体积 |
|
|
|
if (type === "ladder") { |
|
|
|
const targetAcSolution = this.$refs[`ladderStepFormPackageRef_${configIndex}`][0]?.getFormDataByKey("targetAcSolution") || 0;//获取实际起始溶液浓度 |
|
|
|
const dataSource = this.$refs[`ladderStepTableRef_${configIndex}`][0]?.getDataSource() || []; |
|
|
|
const targetAcSolution = this.$refs[`ladderStepFormPackageRef_${configIndex}`][0]?.getFormDataByKey("targetAcSolution");//获取实际起始溶液浓度 |
|
|
|
const params = this.getLadderNdParamsByIndex(configIndex); |
|
|
|
if (targetAcSolution) { |
|
|
|
const volResult = this.updateSjmbrynd(item, targetAcSolution,rowIndex,dataSource,"ladder"); |
|
|
|
const volResult = this.updateSjmbrynd(item, targetAcSolution,params); |
|
|
|
if (!volResult) { |
|
|
|
return |
|
|
|
} |
|
|
|
@ -474,8 +497,9 @@ export default { |
|
|
|
} |
|
|
|
} else if (type === "paralle") { |
|
|
|
const targetAcSolution = item.targetAcSolution || 0;//获取实际起始溶液浓度 |
|
|
|
const params = this.getParalleNdParamsByIndex(item,configIndex); |
|
|
|
if (targetAcSolution) { |
|
|
|
const volResult = this.updateSjmbrynd(item, targetAcSolution); |
|
|
|
const volResult = this.updateSjmbrynd(item, targetAcSolution,params); |
|
|
|
if (!volResult) { |
|
|
|
return |
|
|
|
} |
|
|
|
@ -501,12 +525,14 @@ export default { |
|
|
|
const { row, selectedId } = selectInfo; |
|
|
|
if (key === "actStartSolutionCode") {//实际原始溶液编号点击事件 |
|
|
|
const tableRef = this.$refs[`paralleStepTableRef_${configIndex}`][0]; |
|
|
|
const params = this.getParalleNdParamsByIndex(rowData,configIndex); |
|
|
|
if (tableRef) { |
|
|
|
const volResult = this.updateSjmbrynd(rowData, row.nd); |
|
|
|
const volResult = this.updateSjmbrynd(rowData, row.nd,params); |
|
|
|
//第一次选择溶液的时候,可能其他值没填入,就需要先把浓度和code一起更新 |
|
|
|
tableRef.updateDataSourceByRowIndex(rowIndex, { |
|
|
|
actStartSolutionCode: selectedId, |
|
|
|
targetAcSolution: row.nd, |
|
|
|
subTargetAcSolutionUnit: row.nddw, |
|
|
|
}) |
|
|
|
if (!volResult) { |
|
|
|
return |
|
|
|
@ -528,7 +554,9 @@ export default { |
|
|
|
const packageRef = this.$refs[`${ref}${rowIndex}`][0]; |
|
|
|
if (key === "subStartSolution") { |
|
|
|
packageRef.updateFormData("targetAcSolution", row.nd); |
|
|
|
packageRef.updateFormData("subTargetAcSolutionUnit", row.nddw); |
|
|
|
packageRef.onValueChangeCompareTo("targetAcSolution", row.nd, "targetStartSolution"); |
|
|
|
packageRef.onValueChangeCompareTo("subTargetAcSolutionUnit", row.nddw, "subTargetStartSolution"); |
|
|
|
this.updateTableNd(row, rowIndex); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -544,8 +572,9 @@ export default { |
|
|
|
}, |
|
|
|
//选择实际的时候更新table的浓度 |
|
|
|
updateTableNd(row, rowIndex) { |
|
|
|
const { stepTableFormData = [] } = this.$refs[`ladderStepTableRef_${rowIndex}`][0].getFilledFormData(); |
|
|
|
const { stepTableFormData = [], headerSelectFields = [] } = this.$refs[`ladderStepTableRef_${rowIndex}`][0].getFilledFormData(); |
|
|
|
const newData = JSON.parse(JSON.stringify(stepTableFormData)); |
|
|
|
const params = this.getLadderNdParamsByIndex(rowIndex); |
|
|
|
// 遍历数据,按要求更新起始溶液编号 |
|
|
|
newData.forEach((item, index) => { |
|
|
|
let initNd = row.nd;//起始浓度是上一条记录的实际目标溶液浓度 |
|
|
|
@ -555,7 +584,7 @@ export default { |
|
|
|
item.startSolutionCode = newData[index - 1].targetSolutionCode + newData[index - 1].subTargetSolutionCode; |
|
|
|
initNd = newData[index - 1].actSolutionConcentration; |
|
|
|
} |
|
|
|
const volResult = this.updateSjmbrynd(item, initNd); |
|
|
|
const volResult = this.updateSjmbrynd(item, initNd,params); |
|
|
|
if (!volResult) { |
|
|
|
return |
|
|
|
} |
|
|
|
|