|
|
|
@ -26,6 +26,7 @@ |
|
|
|
|
|
|
|
<CustomTable @blur="onHandleTableBlur" @headerSelectChange="onHandleTableBlur" |
|
|
|
:ref="`stepTableRef`" :columns="tableStepColumns" :formData="formData" :prefixKey="`table`" |
|
|
|
:showOperation="fillType === 'preFill'" |
|
|
|
fieldItemLabel="template.common.operationSteps"> |
|
|
|
<template slot="operation" slot-scope="{ row, rowIndex, columns }"> |
|
|
|
<TableOpertaion :fillType="fillType" :row="row" :rowIndex="rowIndex" :columns="columns" |
|
|
|
@ -35,16 +36,11 @@ |
|
|
|
</div> |
|
|
|
<Step ref="stepRef" :formData="formData.stepData"></Step> |
|
|
|
|
|
|
|
<BaseInfoFormPackage fieldItemLabel="template.pcr.pcr005.fj" label="template.pcr.pcr005.fj" |
|
|
|
ref="fjRef" :formConfig="getFjFormConfig" :formData="formData" /> |
|
|
|
|
|
|
|
<BaseInfoFormPackage fieldItemLabel="template.common.remark" label="template.common.remark" |
|
|
|
ref="remarkRef" :formConfig="remarkConig" :formData="formData" /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<SelectReagentDialog @submit="onSelectReagentSubmit" ref="selectReagentDialogRef"> |
|
|
|
</SelectReagentDialog> |
|
|
|
<!-- <button @click="onSave">保存</button> --> |
|
|
|
<ImportExcelDialog ref="ImportExcelDialog" @onLoadData="onLoadExcelData" /> |
|
|
|
</div> |
|
|
|
@ -63,7 +59,7 @@ import { EventBus } from "@/utils/eventBus"; |
|
|
|
import { volumeConverter } from "@/utils/volConverter";//体积单位转换 |
|
|
|
import { convertConcentration } from "@/utils/conConverter";//浓度单位转换 |
|
|
|
import SelectReagentDialog from '../../dialog/SelectReagentDialog.vue'; |
|
|
|
import { getPCR005Config } from "../../formConfig/PCRTableConfig.js"; |
|
|
|
import { getPCR007Config } from "../../formConfig/PCRTableConfig.js"; |
|
|
|
import TableOpertaion from "@/components/Template/operation/TableOpertaion.vue" |
|
|
|
import { addTj, uniqeResource, uniqeResourceOne, addDecimals } from "@/utils/calUnitTools"; |
|
|
|
import ImportExcelDialog from '../../dialog/ImportExcelDialog' |
|
|
|
@ -79,7 +75,7 @@ export default { |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
tableStepColumns() { |
|
|
|
return getPCR005Config(this); |
|
|
|
return getPCR007Config(this); |
|
|
|
}, |
|
|
|
// 附件表单配置 |
|
|
|
getFjFormConfig() { |
|
|
|
@ -151,43 +147,8 @@ export default { |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
type: "conditionItem", |
|
|
|
label: 'template.common.processCondition', |
|
|
|
config: { |
|
|
|
pre: { |
|
|
|
label: 'template.common.preFill', |
|
|
|
type: "select", |
|
|
|
multiple: true, |
|
|
|
fillType: "preFill", |
|
|
|
options: this.getDictOptions('business_pztj'), |
|
|
|
otherCode: "preOther", |
|
|
|
}, |
|
|
|
act: { |
|
|
|
label: 'template.common.actualFill', |
|
|
|
type: "select", |
|
|
|
fillType: "actFill", |
|
|
|
otherCode: "actOther", |
|
|
|
multiple: true, |
|
|
|
compareTo: "pre", |
|
|
|
options: this.getDictOptions('business_pztj') |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
type: "cellItem", |
|
|
|
label: 'template.pcr.pcr005.clpbh', |
|
|
|
config: { |
|
|
|
act: { |
|
|
|
label: '', |
|
|
|
type: "input", |
|
|
|
fillType: "actFill", |
|
|
|
otherCode: "preOther", |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
type: "cellItem", |
|
|
|
label: 'template.common.configurationTime', |
|
|
|
label: 'template.pcr.pcr007.czsj', |
|
|
|
config: { |
|
|
|
startDate: { |
|
|
|
label: 'template.common.startTime', |
|
|
|
@ -208,14 +169,10 @@ export default { |
|
|
|
type: 'step', |
|
|
|
config: { |
|
|
|
solution: { |
|
|
|
labelWidth: 80, |
|
|
|
labelWidth: 100, |
|
|
|
label: 'template.pcr.pcr007.dztpbh', |
|
|
|
type: 'input', |
|
|
|
fillType: 'preFill', |
|
|
|
subType: 'sj', |
|
|
|
subKey: 'subSolution', |
|
|
|
subFillType: 'actFill', |
|
|
|
maxlength: 20 |
|
|
|
type: 'yq', |
|
|
|
fillType: 'actFill', |
|
|
|
}, |
|
|
|
} |
|
|
|
} |
|
|
|
@ -237,7 +194,7 @@ export default { |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
downloadExcelTemplate() { |
|
|
|
this.exportExcel(['样品名称', '样品初始浓度', '稀释倍数', '预设样品吸样体积']) |
|
|
|
this.exportExcel(['样品名称', '样品初始浓采样前样品管试剂预计添加体积度'], 'PCR分析采集管称重记录表导入模板') |
|
|
|
}, |
|
|
|
//选择试剂提交事件 |
|
|
|
onSelectReagentSubmit(code, row) { |
|
|
|
@ -253,10 +210,6 @@ export default { |
|
|
|
list.push({ |
|
|
|
ypmc: item[0], |
|
|
|
ypcsnd: item[1], |
|
|
|
sxbs: item[2], |
|
|
|
ysypxytj: item[3], |
|
|
|
targetDiluentVolumePrecision: 3, |
|
|
|
actSolutionVolumePrecision: 3 |
|
|
|
}) |
|
|
|
}) |
|
|
|
this.$refs.stepTableRef.addRows(list) |
|
|
|
@ -265,48 +218,8 @@ export default { |
|
|
|
}, |
|
|
|
// 失去焦点,计算 |
|
|
|
onHandleTableBlur() { |
|
|
|
let content = this.getFilledFormData(); |
|
|
|
// 预填 |
|
|
|
let ysypxytjUnit = content.headerSelectFields.ysypxytjUnit |
|
|
|
let ysxsyxytjUnit = content.headerSelectFields.ysxsyxytjUnit |
|
|
|
|
|
|
|
let ypzndUnit = content.headerSelectFields.ypzndUnit |
|
|
|
let ypcsndUnit = content.headerSelectFields.ypcsndUnit |
|
|
|
if (this.fillType === "preFill") { |
|
|
|
let tableList = content.stepTableFormData |
|
|
|
if (tableList && tableList.length > 0) { |
|
|
|
for (let i = 0; i < tableList.length; i++) { |
|
|
|
let item = tableList[i] |
|
|
|
if ( |
|
|
|
isValueEmpty(ysypxytjUnit) || |
|
|
|
isValueEmpty(ysxsyxytjUnit) || |
|
|
|
isValueEmpty(item.sxbs) || |
|
|
|
isValueEmpty(item.ysypxytj) || |
|
|
|
isValueEmpty(item.actSolutionVolumePrecision) || |
|
|
|
isValueEmpty(item.ypcsnd) |
|
|
|
) { |
|
|
|
continue; |
|
|
|
} |
|
|
|
|
|
|
|
// 计算预设稀释液吸样体积 公式:(稀释倍数-1)*样品理论体积 |
|
|
|
let ysxsyxytj = (item.sxbs - 1) * item.ysypxytj |
|
|
|
ysxsyxytj = volumeConverter.convert(ysxsyxytj + ysypxytjUnit, ysxsyxytjUnit).toFixed( |
|
|
|
item.actSolutionVolumePrecision |
|
|
|
) |
|
|
|
tableList[i].ysxsyxytj = ysxsyxytj |
|
|
|
|
|
|
|
|
|
|
|
// 计算样品终浓度: 样品初始浓度/稀释倍数 |
|
|
|
let ypznd = (item.ypcsnd) / item.sxbs |
|
|
|
ypznd = convertConcentration.convert(ypznd + ypcsndUnit, ypzndUnit).toFixed( |
|
|
|
item.targetDiluentVolumePrecision |
|
|
|
) |
|
|
|
tableList[i].ypznd = ypznd |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
this.$refs.stepTableRef.updateDataSource(tableList); |
|
|
|
} |
|
|
|
}, |
|
|
|
//获取已填写的表单数据 |
|
|
|
getFilledFormData() { |
|
|
|
@ -325,31 +238,6 @@ export default { |
|
|
|
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, |
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
@ -365,7 +253,6 @@ export default { |
|
|
|
//保存 |
|
|
|
async onSave() { |
|
|
|
let content = this.$refs.stepRef.getStepResource(); |
|
|
|
console.log(content); |
|
|
|
|
|
|
|
}, |
|
|
|
// 删除表格行 |
|
|
|
|