|
|
|
@ -15,12 +15,13 @@ |
|
|
|
<LineLabel label="template.common.operationSteps" /> |
|
|
|
<div class="template-form-item"> |
|
|
|
<BaseInfoFormPackage fieldItemLabel="template.common.operationSteps" ref="stepFormPackageRef" |
|
|
|
@clickable="handleFormClickable" @resetRecord="resetRecord" :formConfig="stepFormConfig" |
|
|
|
@blur="onHandleBlur" :formData="formData" /> |
|
|
|
<el-button type="primary" @click="exportExcel(['a', 'b', 'c', 'd'])">{{ $t('template.common.downloadTemplate') }}</el-button> |
|
|
|
<el-button type="primary" @click="showImportExcelDialog">{{ $t('template.common.importTemplate') }}</el-button> |
|
|
|
<CustomTable @blur="onHandleTableBlur" :ref="`stepTableRef`" :columns="tableStepColumns" |
|
|
|
:formData="formData" :prefixKey="`table`" |
|
|
|
:formConfig="stepFormConfig" @blur="onHandleBlur" :formData="formData" /> |
|
|
|
<el-button type="primary" @click="downloadExcelTemplate">{{ |
|
|
|
$t('template.common.downloadTemplate') }}</el-button> |
|
|
|
<el-button type="primary" @click="showImportExcelDialog">{{ $t('template.common.importTemplate') |
|
|
|
}}</el-button> |
|
|
|
<CustomTable @blur="onHandleTableBlur" @headerSelectChange="onHandleTableBlur" |
|
|
|
:ref="`stepTableRef`" :columns="tableStepColumns" :formData="formData" :prefixKey="`table`" |
|
|
|
fieldItemLabel="template.common.operationSteps"> |
|
|
|
<template slot="operation" slot-scope="{ row, rowIndex, columns }"> |
|
|
|
<TableOpertaion :fillType="fillType" :row="row" :rowIndex="rowIndex" :columns="columns" |
|
|
|
@ -29,6 +30,10 @@ |
|
|
|
</CustomTable> |
|
|
|
</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> |
|
|
|
@ -37,6 +42,7 @@ |
|
|
|
<SelectReagentDialog @submit="onSelectReagentSubmit" ref="selectReagentDialogRef"> |
|
|
|
</SelectReagentDialog> |
|
|
|
<!-- <button @click="onSave">保存</button> --> |
|
|
|
<ImportExcelDialog ref="ImportExcelDialog" @onLoadData="onLoadData" /> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
|
@ -47,16 +53,19 @@ import TableList from "@/components/Template/Table"; |
|
|
|
import Step from "@/components/Template/Step"; |
|
|
|
import templateMixin from "../../mixins/templateMixin.js"; |
|
|
|
import CustomTable from '@/components/Template/CustomTable.vue'; |
|
|
|
import { isValueEmpty } from '@/utils/index'; |
|
|
|
import { getLatestSnArr } from '@/api/template'; |
|
|
|
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 TableOpertaion from "@/components/Template/operation/TableOpertaion.vue" |
|
|
|
import { addTj, uniqeResource, uniqeResourceOne, addDecimals } from "@/utils/calUnitTools"; |
|
|
|
|
|
|
|
import ImportExcelDialog from '../../dialog/ImportExcelDialog' |
|
|
|
export default { |
|
|
|
name: "PCR002", |
|
|
|
components: { BaseInfoFormPackage, LineLabel, TableList, Step, CustomTable, TableOpertaion, SelectReagentDialog }, |
|
|
|
name: "PCR005", |
|
|
|
components: { BaseInfoFormPackage, LineLabel, TableList, Step, CustomTable, TableOpertaion, SelectReagentDialog, ImportExcelDialog }, |
|
|
|
mixins: [templateMixin], |
|
|
|
props: { |
|
|
|
fillType: { |
|
|
|
@ -68,6 +77,21 @@ export default { |
|
|
|
tableStepColumns() { |
|
|
|
return getPCR005Config(this); |
|
|
|
}, |
|
|
|
// 附件表单配置 |
|
|
|
getFjFormConfig() { |
|
|
|
return [ |
|
|
|
{ |
|
|
|
type: "attachment", |
|
|
|
config: { |
|
|
|
attTitle: { |
|
|
|
label: 'template.pcr.pcr005.fj', |
|
|
|
type: "attachment", |
|
|
|
fillType: "actFill", |
|
|
|
}, |
|
|
|
} |
|
|
|
} |
|
|
|
] |
|
|
|
}, |
|
|
|
// 配置条件 |
|
|
|
storageFormConfig() { |
|
|
|
return [ |
|
|
|
@ -205,8 +229,68 @@ export default { |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
const formData = this.getFormDataByTemplateData(); |
|
|
|
this.onHandleTableBlur() |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
downloadExcelTemplate() { |
|
|
|
this.exportExcel(['样品名称', '样品初始浓度', '稀释倍数', '预设样品吸样体积']) |
|
|
|
}, |
|
|
|
//选择试剂提交事件 |
|
|
|
onSelectReagentSubmit(code, row) { |
|
|
|
|
|
|
|
}, |
|
|
|
showImportExcelDialog() { |
|
|
|
this.$refs.ImportExcelDialog.show() |
|
|
|
}, |
|
|
|
// 失去焦点,计算 |
|
|
|
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] |
|
|
|
console.log(item) |
|
|
|
|
|
|
|
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() { |
|
|
|
return this.getFilledFormDataByRefs(["baseInfoRef", "stepFormPackageRef", "stepTableRef", "stepRef", "remarkRef"]) |
|
|
|
@ -217,7 +301,7 @@ export default { |
|
|
|
}, |
|
|
|
getResource() { |
|
|
|
let content = this.getFilledFormData(); |
|
|
|
console.log(content) |
|
|
|
|
|
|
|
//生成resource |
|
|
|
let tmpResource = [] |
|
|
|
if (this.fillType === "actFill") { |
|
|
|
|