diff --git a/src/views/business/comps/template/comps/sp/SP003.vue b/src/views/business/comps/template/comps/sp/SP003.vue index 89690bd..4354851 100644 --- a/src/views/business/comps/template/comps/sp/SP003.vue +++ b/src/views/business/comps/template/comps/sp/SP003.vue @@ -54,7 +54,7 @@ import CustomTable from '@/components/Template/CustomTable.vue'; import SelectReagentDialog from '../../dialog/SelectReagentDialog.vue'; import TableOpertaion from "@/components/Template/operation/TableOpertaion.vue"; import { EventBus } from "@/utils/eventBus"; -import { addTj ,uniqeResource,uniqeResourceOne} from "@/utils/calUnitTools"; +import { addTj ,uniqeResource,uniqeResourceOne,addDecimals} from "@/utils/calUnitTools"; export default { name: "SP003", components: { BaseInfoFormPackage, LineLabel, TableList, Step, CustomTable, SelectReagentDialog, TableOpertaion }, @@ -575,38 +575,20 @@ export default { if (tableList && tableList.length > 0) { for (let i = 0; i < tableList.length; i++) { let item = tableList[i] - //计算实际目标溶液体积(实际起始溶液体积+实际稀释液体积) - const { total, unit } = addTj([item.actStartSolutionVolume, item.actDiluentVolumeUnit], [content.headerSelectFields.actStartSolutionVolumeUnit, content.headerSelectFields.actDiluentVolumeUnit]) - tmpResource.push({ - mc: null, - bh: item.targetSolutionCode + item.subTargetSolutionCode, - ph: null, - nd: item.actSolutionConcentration, - nddw: content.headerSelectFields.actSolutionConcentrationUnit, - ndz: item.actSolutionConcentration + content.headerSelectFields.actSolutionConcentrationUnit, - ly: 'ELN配制', - sxrq: content.expireDate, - kc: total, - kcdw: unit, - type: null, - elnType: this.product, - syl: null, - syldw: unit, - yxzq: content.effectivePeriod, - yxzqdw: content.effectivePeriodUnit, - }) + let fzTotal = 0//分装总量 if (item.fzsj && item.fzsj.fzList && item.fzsj.fzList) { for (let j = 0; j < item.fzsj.fzList.length; j++) { + let fzItem = item.fzsj.fzList[j] tmpResource.push({ mc: null, - bh: item.fzsj.mybh + '-' + item.fzsj.fzList[j].subCode, + bh: item.fzsj.mybh + fzItem.preCode + fzItem.subCode, ph: null, nd: item.actSolutionConcentration, nddw: content.headerSelectFields.actSolutionConcentrationUnit, ndz: item.actSolutionConcentration + content.headerSelectFields.actSolutionConcentrationUnit, ly: 'ELN配制', sxrq: content.expireDate, - kc: item.fzsj.fzList[j].num, + kc: fzItem.num, kcdw: item.fzsj.dw, type: null, elnType: this.product, @@ -615,12 +597,32 @@ export default { yxzq: content.effectivePeriod, yxzqdw: content.effectivePeriodUnit, }) + fzTotal=addDecimals(fzTotal,fzItem.num) } } + + //计算实际目标溶液体积(实际起始溶液体积+实际稀释液体积) + const { total, unit } = addTj([item.actStartSolutionVolume, item.actDiluentVolumeUnit], [content.headerSelectFields.actStartSolutionVolumeUnit, content.headerSelectFields.actDiluentVolumeUnit]) + tmpResource.push({ + mc: null, + bh: item.targetSolutionCode + item.subTargetSolutionCode, + ph: null, + nd: item.actSolutionConcentration, + nddw: content.headerSelectFields.actSolutionConcentrationUnit, + ndz: item.actSolutionConcentration + content.headerSelectFields.actSolutionConcentrationUnit, + ly: 'ELN配制', + sxrq: content.expireDate, + kc: total, + kcdw: unit, + type: null, + elnType: this.product, + syl: fzTotal>0?fzTotal:null, + syldw: fzTotal>0?item.fzsj.dw:unit, + yxzq: content.effectivePeriod, + yxzqdw: content.effectivePeriodUnit, + }) } } - //使用 - } if(tmpResource.length>0){ tmpResource = uniqeResourceOne(tmpResource) diff --git a/src/views/business/comps/template/comps/sp/SP00456.vue b/src/views/business/comps/template/comps/sp/SP00456.vue index 7619db8..2f73ec9 100644 --- a/src/views/business/comps/template/comps/sp/SP00456.vue +++ b/src/views/business/comps/template/comps/sp/SP00456.vue @@ -110,7 +110,7 @@ import SelectReagentDialog from '../../dialog/SelectReagentDialog.vue'; import TableOpertaion from "@/components/Template/operation/TableOpertaion.vue"; import { getExpireDate, duplicateResource } from "@/utils/index.js"; import moment from "moment"; -import { addTj, uniqeResource,uniqeResourceOne } from "@/utils/calUnitTools"; +import { addTj, uniqeResource,uniqeResourceOne,addDecimals } from "@/utils/calUnitTools"; import { getLadderColumnsConfig, getParallelColumnsConfig, getLadderFormConfig, getBaseInfoFormConfig, getRemarkFormConfig, getStorageConditionFormConfig, getParalleStepFormConfig } from "../../formConfig/paralleAndLadderConfig.js"; export default { name: "SP00456", @@ -598,39 +598,22 @@ export default { let ladderConfigs = content.ladderConfigs[i] let stepTableFormData = ladderConfigs.stepTableFormData for (let j = 0; j < stepTableFormData.length; j++) { - //计算实际目标溶液体积(实际起始溶液体积+实际稀释液体积) - const { total, unit } = addTj([stepTableFormData[j].actStartSolutionVolume, stepTableFormData[j].actDiluentVolume], [ladderConfigs.headerSelectFields.actStartSolutionVolumeUnit, ladderConfigs.headerSelectFields.actDiluentVolumeUnit]) - tmpResource.push({ - mc: null, - bh: stepTableFormData[j].targetSolutionCode + stepTableFormData[j].subTargetSolutionCode, - ph: null, - ndz: stepTableFormData[j].actSolutionConcentration + ladderConfigs.headerSelectFields.actSolutionConcentrationUnit, - nd: stepTableFormData[j].actSolutionConcentration, - nddw: ladderConfigs.headerSelectFields.actSolutionConcentrationUnit, - ly: 'ELN配制', - sxrq: ladderConfigs.expireDate, - kc: total, - kcdw: unit, - type: null, - elnType: this.product, - syl: null, - syldw: unit, - yxzq: ladderConfigs.effectivePeriod, - yxzqdw: ladderConfigs.effectivePeriodUnit, - }) + + let fzTotal = 0//分装总量 let fzsj = stepTableFormData[j].fzsj if (fzsj && fzsj.fzList) { for (let k = 0; k < fzsj.fzList.length; k++) { + let fzItem = fzsj.fzList[k] tmpResource.push({ mc: null, - bh: fzsj.mybh + '-' + fzsj.fzList[k].subCode, + bh: fzsj.mybh + fzItem.preCode + fzItem.subCode, ph: null, nd: stepTableFormData[j].actSolutionConcentration, nddw: ladderConfigs.headerSelectFields.actSolutionConcentrationUnit, ndz: stepTableFormData[j].actSolutionConcentration + ladderConfigs.headerSelectFields.actSolutionConcentrationUnit, ly: 'ELN配制', sxrq: ladderConfigs.expireDate, - kc: fzsj.fzList[k].num, + kc: fzItem.num, kcdw: fzsj.dw, type: null, elnType: this.product, @@ -639,49 +622,55 @@ export default { yxzq: ladderConfigs.effectivePeriod, yxzqdw: ladderConfigs.effectivePeriodUnit, }) + fzTotal=addDecimals(fzTotal,fzItem.num) } } - } - } - } - //阶梯配置 - if (content.paralleConfigs && content.paralleConfigs.length > 0) { - for (let i = 0; i < content.paralleConfigs.length; i++) { - let paralleConfigs = content.paralleConfigs[i] - let stepTableFormData = paralleConfigs.stepTableFormData - for (let j = 0; j < stepTableFormData.length; j++) { - const { total, unit } = addTj([stepTableFormData[j].actSolutionVolume, stepTableFormData[j].actDiluentVolume], [paralleConfigs.headerSelectFields.actSolutionVolumeUnit, paralleConfigs.headerSelectFields.actDiluentVolumeUnit]) + + //计算实际目标溶液体积(实际起始溶液体积+实际稀释液体积) + const { total, unit } = addTj([stepTableFormData[j].actStartSolutionVolume, stepTableFormData[j].actDiluentVolume], [ladderConfigs.headerSelectFields.actStartSolutionVolumeUnit, ladderConfigs.headerSelectFields.actDiluentVolumeUnit]) tmpResource.push({ mc: null, bh: stepTableFormData[j].targetSolutionCode + stepTableFormData[j].subTargetSolutionCode, ph: null, + ndz: stepTableFormData[j].actSolutionConcentration + ladderConfigs.headerSelectFields.actSolutionConcentrationUnit, nd: stepTableFormData[j].actSolutionConcentration, - ndz: stepTableFormData[j].actSolutionConcentration + paralleConfigs.headerSelectFields.actSolutionConcentrationUnit, - nddw: paralleConfigs.headerSelectFields.actSolutionConcentrationUnit, + nddw: ladderConfigs.headerSelectFields.actSolutionConcentrationUnit, ly: 'ELN配制', - sxrq: stepTableFormData[j].targetSolutionExpirationDate, + sxrq: ladderConfigs.expireDate, kc: total, kcdw: unit, type: null, elnType: this.product, - syl: null, - syldw: unit, - yxzq: stepTableFormData[j].targetSolutionCycle, - yxzqdw: stepTableFormData[j].targetSolutionCyclePrecision, + syl: fzTotal>0?fzTotal:null, + syldw: fzTotal>0?fzsj.dw:unit, + yxzq: ladderConfigs.effectivePeriod, + yxzqdw: ladderConfigs.effectivePeriodUnit, }) + + } + } + } + //阶梯配置 + if (content.paralleConfigs && content.paralleConfigs.length > 0) { + for (let i = 0; i < content.paralleConfigs.length; i++) { + let paralleConfigs = content.paralleConfigs[i] + let stepTableFormData = paralleConfigs.stepTableFormData + for (let j = 0; j < stepTableFormData.length; j++) { + let fzTotal = 0//分装总量 let fzsj = stepTableFormData[j].fzsj if (fzsj && fzsj.fzList) { for (let k = 0; k < fzsj.fzList.length; k++) { + let fzItem = fzsj.fzList[k] tmpResource.push({ mc: null, - bh: fzsj.mybh + '-' + fzsj.fzList[k].subCode, + bh: fzsj.mybh + fzItem.preCode + fzItem.subCode, ph: null, ndz: stepTableFormData[j].actSolutionConcentration + paralleConfigs.headerSelectFields.actSolutionConcentrationUnit, nd: stepTableFormData[j].actSolutionConcentration, nddw: paralleConfigs.headerSelectFields.actSolutionConcentrationUnit, ly: 'ELN配制', sxrq: paralleConfigs.expireDate, - kc: fzsj.fzList[k].num, + kc: fzItem.num, kcdw: fzsj.dw, type: null, elnType: this.product, @@ -690,8 +679,30 @@ export default { yxzq: paralleConfigs.effectivePeriod, yxzqdw: paralleConfigs.effectivePeriodUnit, }) + fzTotal=addDecimals(fzTotal,fzItem.num) } } + + const { total, unit } = addTj([stepTableFormData[j].actSolutionVolume, stepTableFormData[j].actDiluentVolume], [paralleConfigs.headerSelectFields.actSolutionVolumeUnit, paralleConfigs.headerSelectFields.actDiluentVolumeUnit]) + tmpResource.push({ + mc: null, + bh: stepTableFormData[j].targetSolutionCode + stepTableFormData[j].subTargetSolutionCode, + ph: null, + nd: stepTableFormData[j].actSolutionConcentration, + ndz: stepTableFormData[j].actSolutionConcentration + paralleConfigs.headerSelectFields.actSolutionConcentrationUnit, + nddw: paralleConfigs.headerSelectFields.actSolutionConcentrationUnit, + ly: 'ELN配制', + sxrq: stepTableFormData[j].targetSolutionExpirationDate, + kc: total, + kcdw: unit, + type: null, + elnType: this.product, + syl: fzTotal>0?fzTotal:null, + syldw: fzTotal>0?fzsj.dw:unit, + yxzq: stepTableFormData[j].targetSolutionCycle, + yxzqdw: stepTableFormData[j].targetSolutionCyclePrecision, + }) + } } }