|
|
@ -63,10 +63,11 @@ import templateMixin from "../../mixins/templateMixin"; |
|
|
import CustomTable from '@/components/Template/CustomTable.vue'; |
|
|
import CustomTable from '@/components/Template/CustomTable.vue'; |
|
|
import { getLatestSnArr } from '@/api/template'; |
|
|
import { getLatestSnArr } from '@/api/template'; |
|
|
import { EventBus } from "@/utils/eventBus"; |
|
|
import { EventBus } from "@/utils/eventBus"; |
|
|
import { uniqeResource } from "@/utils/calUnitTools"; |
|
|
|
|
|
import SelectReagentDialog from '../../dialog/SelectReagentDialog.vue'; |
|
|
import SelectReagentDialog from '../../dialog/SelectReagentDialog.vue'; |
|
|
import { getLadderColumnsConfig } from "../../formConfig/PCRTableConfig.js"; |
|
|
import { getLadderColumnsConfig } from "../../formConfig/PCRTableConfig.js"; |
|
|
import TableOpertaion from "@/components/Template/operation/TableOpertaion.vue" |
|
|
import TableOpertaion from "@/components/Template/operation/TableOpertaion.vue" |
|
|
|
|
|
import { addTj,uniqeResource,uniqeResourceOne,addDecimals } from "@/utils/calUnitTools"; |
|
|
|
|
|
|
|
|
export default { |
|
|
export default { |
|
|
name: "PCR002", |
|
|
name: "PCR002", |
|
|
components: { BaseInfoFormPackage, LineLabel, TableList, Step, CustomTable, TableOpertaion, SelectReagentDialog }, |
|
|
components: { BaseInfoFormPackage, LineLabel, TableList, Step, CustomTable, TableOpertaion, SelectReagentDialog }, |
|
|
@ -373,37 +374,121 @@ export default { |
|
|
getFilledFormData() { |
|
|
getFilledFormData() { |
|
|
return this.getFilledFormDataByRefs(["baseInfoRef", "stepFormPackageRef","stepTableRef", "stepRef", "remarkRef"]) |
|
|
return this.getFilledFormDataByRefs(["baseInfoRef", "stepFormPackageRef","stepTableRef", "stepRef", "remarkRef"]) |
|
|
}, |
|
|
}, |
|
|
//获取填写完成的表单数据 |
|
|
|
|
|
async getFormData() { |
|
|
async getFormData() { |
|
|
let content = await this.validFormFields(["baseInfoRef", "stepFormPackageRef", "stepTableRef", "stepRef", "remarkRef"]); |
|
|
|
|
|
|
|
|
let content = await this.validFormFields(["baseInfoRef", "stepFormPackageRef", "stepTableRef","stepRef", "remarkRef"]); |
|
|
|
|
|
return content; |
|
|
|
|
|
}, |
|
|
|
|
|
getResource() { |
|
|
|
|
|
let content = this.getFilledFormData(); |
|
|
|
|
|
console.log(content) |
|
|
//生成resource |
|
|
//生成resource |
|
|
let tmpResource = [] |
|
|
let tmpResource = [] |
|
|
if (this.fillType === "actFill") { |
|
|
|
|
|
//配置的试剂 |
|
|
|
|
|
tmpResource.push({ |
|
|
|
|
|
mc: content.targetName, |
|
|
|
|
|
bh: content.targetCode + content.targetCodeSn, |
|
|
|
|
|
ph: '', |
|
|
|
|
|
ndz: content.targetActConcentration + content.targetActConcentrationUnit, |
|
|
|
|
|
nd: content.targetActConcentration, |
|
|
|
|
|
nddw: content.targetActConcentrationUnit, |
|
|
|
|
|
ly: 'ELN配制', |
|
|
|
|
|
sxrq: content.expireDate, |
|
|
|
|
|
kc: content.targetActVolume, |
|
|
|
|
|
kcdw: content.targetActVolumeUnit, |
|
|
|
|
|
syl: null, |
|
|
|
|
|
type: null, |
|
|
|
|
|
elnType: this.product, |
|
|
|
|
|
syldw: content.targetActVolumeUnit, |
|
|
|
|
|
yxzq: content.effectivePeriod, |
|
|
|
|
|
yxzqdw: content.effectivePeriodUnit, |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
if(this.fillType === "actFill"){ |
|
|
|
|
|
let tableList = content.stepTableFormData |
|
|
|
|
|
if(tableList && tableList.length>0){ |
|
|
|
|
|
for(let i=0;i<tableList.length;i++){ |
|
|
|
|
|
//配置的试剂 |
|
|
|
|
|
let item = tableList[i] |
|
|
|
|
|
console.log('表格item:'+JSON.stringify(item)) |
|
|
|
|
|
|
|
|
|
|
|
//使用的 |
|
|
|
|
|
|
|
|
|
|
|
// 起始溶液 |
|
|
|
|
|
tmpResource.push({ |
|
|
|
|
|
mc: null, |
|
|
|
|
|
bh: item.startSolutionCode, |
|
|
|
|
|
ph: null, |
|
|
|
|
|
ndz: null, |
|
|
|
|
|
nd: null, |
|
|
|
|
|
nddw: null, |
|
|
|
|
|
ly: 'ELN配制', |
|
|
|
|
|
sxrq: null, |
|
|
|
|
|
kc: null, |
|
|
|
|
|
kcdw: null, |
|
|
|
|
|
syl: item.actStartSolutionVolume, |
|
|
|
|
|
type: 1, |
|
|
|
|
|
elnType: this.product, |
|
|
|
|
|
syldw:content.headerSelectFields.actStartSolutionVolumeUnit, |
|
|
|
|
|
yxzq:null, |
|
|
|
|
|
yxzqdw:null, |
|
|
|
|
|
}) |
|
|
|
|
|
// 稀释液 |
|
|
|
|
|
tmpResource.push({ |
|
|
|
|
|
mc: null, |
|
|
|
|
|
bh: content.subSolution, |
|
|
|
|
|
ph: null, |
|
|
|
|
|
ndz: null, |
|
|
|
|
|
nd: null, |
|
|
|
|
|
nddw: null, |
|
|
|
|
|
ly: 'ELN配制', |
|
|
|
|
|
sxrq: null, |
|
|
|
|
|
kc: null, |
|
|
|
|
|
kcdw: null, |
|
|
|
|
|
syl: item.actDiluentVolume, |
|
|
|
|
|
type: 1, |
|
|
|
|
|
elnType: this.product, |
|
|
|
|
|
syldw:content.headerSelectFields.actDiluentVolumeUnit, |
|
|
|
|
|
yxzq:null, |
|
|
|
|
|
yxzqdw:null, |
|
|
|
|
|
}) |
|
|
|
|
|
//分装的 |
|
|
|
|
|
let fzTotal = 0//分装总量 |
|
|
|
|
|
if(item.fzsj && item.fzsj.fzList && item.fzsj.fzList.length>0){ |
|
|
|
|
|
for(let j=0;j<item.fzsj.fzList.length;j++){ |
|
|
|
|
|
let fzItem = item.fzsj.fzList[j] |
|
|
|
|
|
tmpResource.push({ |
|
|
|
|
|
mc: null, |
|
|
|
|
|
bh: item.fzsj.mybh+fzItem.preCode+ fzItem.subCode, |
|
|
|
|
|
ph: null, |
|
|
|
|
|
ndz: item.hhwznd + content.headerSelectFields.hhwzndUnit, |
|
|
|
|
|
nd: item.hhwznd, |
|
|
|
|
|
nddw: content.headerSelectFields.hhwzndUnit, |
|
|
|
|
|
ly: 'ELN配制', |
|
|
|
|
|
sxrq: null, |
|
|
|
|
|
kc: fzItem.num, |
|
|
|
|
|
kcdw: item.fzsj.dw, |
|
|
|
|
|
syl: null, |
|
|
|
|
|
type: null, |
|
|
|
|
|
elnType: this.product, |
|
|
|
|
|
syldw:item.fzsj.dw, |
|
|
|
|
|
yxzq:null, |
|
|
|
|
|
yxzqdw:null, |
|
|
|
|
|
}) |
|
|
|
|
|
fzTotal=addDecimals(fzTotal,fzItem.num) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
//生成的 |
|
|
|
|
|
// const { total, unit } = addTj([item.sjjzxql, item.sjryxql], [content.headerSelectFields.sjjzxqlUnit, content.headerSelectFields.sjryxqlUnit]) |
|
|
|
|
|
const { total, unit } = addTj([item.actStartSolutionVolume, item.actDiluentVolume], [content.headerSelectFields.actStartSolutionVolumeUnit, content.headerSelectFields.actDiluentVolumeUnit]) |
|
|
|
|
|
tmpResource.push({ |
|
|
|
|
|
mc: null, |
|
|
|
|
|
bh: item.targetSolutionCode+item.subTargetSolutionCode, |
|
|
|
|
|
ph: null, |
|
|
|
|
|
ndz: item.actSolutionConcentration + content.headerSelectFields.actSolutionConcentrationUnit, |
|
|
|
|
|
nd: item.actSolutionConcentration, |
|
|
|
|
|
nddw: content.headerSelectFields.actSolutionConcentrationUnit, |
|
|
|
|
|
ly: 'ELN配制', |
|
|
|
|
|
sxrq: null, |
|
|
|
|
|
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) |
|
|
} |
|
|
} |
|
|
//使用的试剂、仪器 |
|
|
//使用的试剂、仪器 |
|
|
const stepResource = this.$refs.stepRef.getStepResource() |
|
|
const stepResource = this.$refs.stepRef.getStepResource() |
|
|
this.resourceTmp = uniqeResource(tmpResource, stepResource.sjResource || []) |
|
|
|
|
|
this.yqResourceTmp = stepResource.yqResource || [] |
|
|
|
|
|
return content; |
|
|
|
|
|
|
|
|
this.resourceTmp =uniqeResource(tmpResource,stepResource.sjResource||[]) |
|
|
|
|
|
this.yqResourceTmp = stepResource.yqResource||[] |
|
|
|
|
|
return this.resourceTmp; |
|
|
}, |
|
|
}, |
|
|
//保存 |
|
|
//保存 |
|
|
async onSave() { |
|
|
async onSave() { |
|
|
|