Browse Source

feat:[模板管理][PCR005]

lkf
HanLong 1 month ago
parent
commit
18755eb6dd
4 changed files with 100 additions and 12 deletions
  1. +1
    -0
      src/lang/en/template/pcr.js
  2. +1
    -0
      src/lang/zh/template/pcr.js
  3. +94
    -10
      src/views/business/comps/template/comps/pcr/PCR005.vue
  4. +4
    -2
      src/views/business/comps/template/formConfig/PCRTableConfig.js

+ 1
- 0
src/lang/en/template/pcr.js View File

@ -45,6 +45,7 @@ export default {
ysxsyxytj: '预设稀释液吸样体积',
sjxsyxytj: '实际稀释液吸样体积',
ypznd: '样品终浓度',
fj: 'Attachment',
},
// 生物样品分析方法学样品制备表-准确度与精密度
sp008: {

+ 1
- 0
src/lang/zh/template/pcr.js View File

@ -44,6 +44,7 @@ export default {
ysxsyxytj: '预设稀释液吸样体积',
sjxsyxytj: '实际稀释液吸样体积',
ypznd: '样品终浓度',
fj: '附件',
},
// 生物样品分析方法学样品制备表-Recovery
sp009: {

+ 94
- 10
src/views/business/comps/template/comps/pcr/PCR005.vue View File

@ -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") {

+ 4
- 2
src/views/business/comps/template/formConfig/PCRTableConfig.js View File

@ -115,7 +115,6 @@ export const getLadderColumnsConfig = ($this, selectKey) => {
bodyFillType: 'actFill',
bodySubFillType: 'preFill',
showBodySub: $this.fillType === 'preFill',
bodyPrecisionKey: 'actSolutionConcentrationPrecision',
bodyMaxlength: 10,
bodySubPlaceholder: 'template.common.xswsPlaceholder',
@ -146,7 +145,6 @@ export const getLadderColumnsConfig = ($this, selectKey) => {
bodyFillType: 'actFill',
bodySubFillType: 'preFill',
showBodySub: $this.fillType === 'preFill',
bodyPrecisionKey: 'actSolutionVolumePrecision',
bodyMaxlength: 10,
// copyFrom: 'targetSolutionVolume', //复制哪个字段
@ -646,11 +644,13 @@ export const getPCR005Config = ($this) => {
fillType: 'preFill',
headerSelectKey: 'ysxsyxytjUnit',
headerOptions: $this.getDictOptions('business_tjdw'),
bodyDisabled: true,
bodyType: 'inputNumber',
bodyFillType: 'preFill',
bodyMaxlength: 10,
bodySubType: 'inputNumber',
bodySubKey: 'actSolutionVolumePrecision',
subPrecision: 0,
bodyFillType: 'preFill',
bodySubFillType: 'preFill',
showBodySub: $this.fillType === 'preFill',
@ -678,6 +678,7 @@ export const getPCR005Config = ($this) => {
fillType: 'preFill',
headerSelectKey: 'ypzndUnit',
headerOptions: $this.getDictOptions('business_nddw'),
bodyDisabled: true,
bodyType: 'inputNumber',
bodyFillType: 'preFill',
bodyMaxlength: 10,
@ -685,6 +686,7 @@ export const getPCR005Config = ($this) => {
bodySubKey: 'targetDiluentVolumePrecision',
bodyPrecisionKey: 'targetDiluentVolumePrecision',
bodySubFillType: 'preFill',
subPrecision: 0,
showBodySub: $this.fillType === 'preFill',
bodyMaxlength: 10,
bodySubPlaceholder: 'template.common.xswsPlaceholder',

Loading…
Cancel
Save