|
|
|
@ -110,7 +110,7 @@ import templateMixin from "../../mixins/templateMixin.js"; |
|
|
|
import CustomTable from '@/components/Template/CustomTable.vue'; |
|
|
|
import SelectReagentDialog from '../../dialog/SelectReagentDialog.vue'; |
|
|
|
import TableOpertaion from "@/components/Template/operation/TableOpertaion.vue"; |
|
|
|
import { getExpireDate } from "@/utils/index.js"; |
|
|
|
import { getExpireDate,duplicateResource } from "@/utils/index.js"; |
|
|
|
import moment from "moment"; |
|
|
|
import { addTj,uniqeResource } from "@/utils/calUnitTools"; |
|
|
|
import { getLadderColumnsConfig, getParallelColumnsConfig, getLadderFormConfig, getBaseInfoFormConfig, getRemarkFormConfig, getStorageConditionFormConfig, getParalleStepFormConfig } from "../../formConfig/paralleAndLadderConfig.js"; |
|
|
|
@ -401,20 +401,25 @@ export default { |
|
|
|
if (type === "ladder") { |
|
|
|
const targetAcSolution = this.$refs[`ladderStepFormPackageRef_${configIndex}`][0]?.getFormDataByKey("targetAcSolution") || 0;//获取实际起始溶液浓度 |
|
|
|
if (targetAcSolution) { |
|
|
|
const { actVol, actNd } = this.updateSjmbrynd(item, targetAcSolution); |
|
|
|
const volResult = this.updateSjmbrynd(item, targetAcSolution); |
|
|
|
if(!volResult){ |
|
|
|
return |
|
|
|
} |
|
|
|
this.$refs[`ladderStepTableRef_${configIndex}`][0]?.updateDataSourceByRowIndex(rowIndex, { |
|
|
|
actSolutionVolume: actVol, |
|
|
|
actSolutionConcentration: actNd, |
|
|
|
actSolutionVolume: volResult.actVol, |
|
|
|
actSolutionConcentration: volResult.actNd, |
|
|
|
},"blur"); |
|
|
|
} |
|
|
|
} else if (type === "paralle") { |
|
|
|
const targetAcSolution = item.targetAcSolution || 0;//获取实际起始溶液浓度 |
|
|
|
if (targetAcSolution) { |
|
|
|
this.updateSjmbrynd(item, targetAcSolution); |
|
|
|
const { actVol, actNd } = this.updateSjmbrynd(item, targetAcSolution); |
|
|
|
const volResult = this.updateSjmbrynd(item, targetAcSolution); |
|
|
|
if(!volResult){ |
|
|
|
return |
|
|
|
} |
|
|
|
this.$refs[`paralleStepTableRef_${configIndex}`][0]?.updateDataSourceByRowIndex(rowIndex, { |
|
|
|
actSolutionVolume: actVol, |
|
|
|
actSolutionConcentration: actNd, |
|
|
|
actSolutionVolume: volResult.actVol, |
|
|
|
actSolutionConcentration: volResult.actNd, |
|
|
|
},"blur"); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -462,12 +467,15 @@ export default { |
|
|
|
} else if (currentTableKey === "actStartSolutionCode") {//实际原始溶液编号点击事件 |
|
|
|
const tableRef = this.$refs[`paralleStepTableRef_${currentRowIndex}`][0]; |
|
|
|
if (tableRef) { |
|
|
|
const { actVol, actNd } = this.updateSjmbrynd(this.currentRowData, row.nd); |
|
|
|
const volResult = this.updateSjmbrynd(this.currentRowData, row.nd); |
|
|
|
if(!volResult){ |
|
|
|
return |
|
|
|
} |
|
|
|
tableRef.updateDataSourceByRowIndex(currentTableIndex, { |
|
|
|
actStartSolutionCode: code, |
|
|
|
targetAcSolution: row.nd, |
|
|
|
actSolutionVolume: actVol, |
|
|
|
actSolutionConcentration: actNd, |
|
|
|
actSolutionVolume: volResult.actVol, |
|
|
|
actSolutionConcentration: volResult.actNd, |
|
|
|
},"clickable") |
|
|
|
} |
|
|
|
} |
|
|
|
@ -488,14 +496,13 @@ export default { |
|
|
|
const newData = JSON.parse(JSON.stringify(stepTableFormData)); |
|
|
|
// 遍历数据,按要求更新起始溶液编号 |
|
|
|
newData.forEach((item, index) => { |
|
|
|
const { actVol, actNd } = this.updateSjmbrynd(item, row.nd); |
|
|
|
console.log(actNd, "actNd") |
|
|
|
item.actSolutionVolume = actVol; |
|
|
|
item.actSolutionConcentration = actNd; |
|
|
|
const o = { |
|
|
|
actSolutionVolume: actVol, |
|
|
|
actSolutionConcentration: actNd, |
|
|
|
const volResult = this.updateSjmbrynd(item, row.nd); |
|
|
|
if(!volResult){ |
|
|
|
return |
|
|
|
} |
|
|
|
console.log(volResult.actNd, "actNd") |
|
|
|
item.actSolutionVolume = volResult.actVol; |
|
|
|
item.actSolutionConcentration = volResult.actNd; |
|
|
|
// 更新stepTableRef组件的数据 |
|
|
|
}) |
|
|
|
this.$refs[`ladderStepTableRef_${this.currentRowIndex}`][0].updateDataSource(newData); |
|
|
|
@ -694,8 +701,28 @@ export default { |
|
|
|
this.resourceTmp=tmpResource |
|
|
|
return content; |
|
|
|
}, |
|
|
|
getStepResource(){ |
|
|
|
const sjResource=[],yqResource= []; |
|
|
|
if (this.formData.paralleConfigs && this.formData.paralleConfigs.length > 0) { |
|
|
|
for (let i = 0; i < this.formData.paralleConfigs.length; i++) { |
|
|
|
const paralleResource = this.$refs[`paralleStepRef_${i}`][0].getStepResource(); |
|
|
|
sjResource.push(...paralleResource.sjResource); |
|
|
|
yqResource.push(...paralleResource.yqResource); |
|
|
|
} |
|
|
|
} |
|
|
|
if (this.formData.ladderConfigs && this.formData.ladderConfigs.length > 0) { |
|
|
|
for (let i = 0; i < this.formData.ladderConfigs.length; i++) { |
|
|
|
const ladderResource = this.$refs[`ladderStepRef_${i}`][0].getStepResource(); |
|
|
|
sjResource.push(...ladderResource.sjResource); |
|
|
|
yqResource.push(...ladderResource.yqResource); |
|
|
|
} |
|
|
|
} |
|
|
|
//去重 |
|
|
|
const {sj,yq} = duplicateResource(sjResource,yqResource) |
|
|
|
return {sjResource:sj,yqResource:yq}; |
|
|
|
}, |
|
|
|
async onSave() { |
|
|
|
const formData = await this.getFormData(); |
|
|
|
const formData = this.getStepResource(); |
|
|
|
console.log(formData, "formData") |
|
|
|
} |
|
|
|
} |
|
|
|
|