Browse Source

feat:[模板管理][PCR007]

ouqian
HanLong 1 month ago
parent
commit
f41280fa09
6 changed files with 48 additions and 205 deletions
  1. +5
    -0
      src/lang/en/template/pcr.js
  2. +5
    -0
      src/lang/zh/template/pcr.js
  3. +1
    -1
      src/utils/index.js
  4. +11
    -12
      src/views/business/comps/template/comps/pcr/PCR005.vue
  5. +8
    -121
      src/views/business/comps/template/comps/pcr/PCR007.vue
  6. +18
    -71
      src/views/business/comps/template/formConfig/PCRTableConfig.js

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

@ -49,6 +49,11 @@ export default {
}, },
pcr007: { pcr007: {
dztpbh: '电子天平编号', dztpbh: '电子天平编号',
ypmc: '样品名称',
cyqypgsjyjtjtj: '采样前样品管试剂预计添加体积',
cyqypgsjsjtjtj: '采样前样品管试剂实际添加体积',
cygzl: '采集管重量',
czsj: '称重时间',
clpbh: 'Analysis Batch Number', clpbh: 'Analysis Batch Number',
ypmc: '样品名称', ypmc: '样品名称',
ypcsnd: '样品初始浓度', ypcsnd: '样品初始浓度',

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

@ -48,6 +48,11 @@ export default {
}, },
pcr007: { pcr007: {
dztpbh: '电子天平编号', dztpbh: '电子天平编号',
ypmc: '样品名称',
cyqypgsjyjtjtj: '采样前样品管试剂预计添加体积',
cyqypgsjsjtjtj: '采样前样品管试剂实际添加体积',
cygzl: '采集管重量',
czsj: '称重时间',
clpbh: 'Analysis Batch Number', clpbh: 'Analysis Batch Number',
ypmc: '样品名称', ypmc: '样品名称',
ypcsnd: '样品初始浓度', ypcsnd: '样品初始浓度',

+ 1
- 1
src/utils/index.js View File

@ -441,7 +441,7 @@ export function isValueEmpty(value) {
if (Array.isArray(value) && value.length === 0) { if (Array.isArray(value) && value.length === 0) {
return true return true
} }
if (Object.keys(value).length === 0) {
if (Object.keys(value).length === 0 && typeof value=='object') {
return true; return true;
} }
return false return false

+ 11
- 12
src/views/business/comps/template/comps/pcr/PCR005.vue View File

@ -26,10 +26,11 @@
<CustomTable @blur="onHandleTableBlur" @headerSelectChange="onHandleTableBlur" <CustomTable @blur="onHandleTableBlur" @headerSelectChange="onHandleTableBlur"
:ref="`stepTableRef`" :columns="tableStepColumns" :formData="formData" :prefixKey="`table`" :ref="`stepTableRef`" :columns="tableStepColumns" :formData="formData" :prefixKey="`table`"
:showOperation="fillType === 'preFill'"
fieldItemLabel="template.common.operationSteps"> fieldItemLabel="template.common.operationSteps">
<template slot="operation" slot-scope="{ row, rowIndex, columns }"> <template slot="operation" slot-scope="{ row, rowIndex, columns }">
<TableOpertaion :fillType="fillType" :row="row" :rowIndex="rowIndex" :columns="columns" <TableOpertaion :fillType="fillType" :row="row" :rowIndex="rowIndex" :columns="columns"
@deleteRow="(rowIndex) => deleteRow(rowIndex)"></TableOpertaion>
@deleteRow="(rowIndex) => deleteRow(rowIndex)" ></TableOpertaion>
</template> </template>
</CustomTable> </CustomTable>
</div> </div>
@ -43,8 +44,6 @@
</div> </div>
</div> </div>
</div> </div>
<SelectReagentDialog @submit="onSelectReagentSubmit" ref="selectReagentDialogRef">
</SelectReagentDialog>
<!-- <button @click="onSave">保存</button> --> <!-- <button @click="onSave">保存</button> -->
<ImportExcelDialog ref="ImportExcelDialog" @onLoadData="onLoadExcelData" /> <ImportExcelDialog ref="ImportExcelDialog" @onLoadData="onLoadExcelData" />
</div> </div>
@ -177,11 +176,11 @@ export default {
type: "cellItem", type: "cellItem",
label: 'template.pcr.pcr005.clpbh', label: 'template.pcr.pcr005.clpbh',
config: { config: {
act: {
clpbh: {
label: '', label: '',
type: "input", type: "input",
fillType: "actFill", fillType: "actFill",
otherCode: "preOther",
otherCode: "clpbh",
} }
} }
}, },
@ -237,7 +236,7 @@ export default {
}, },
methods: { methods: {
downloadExcelTemplate() { downloadExcelTemplate() {
this.exportExcel(['样品名称', '样品初始浓度', '稀释倍数', '预设样品吸样体积'])
this.exportExcel(['样品名称', '样品初始浓度', '稀释倍数', '预设样品吸样体积'], 'PCR分析样品处理表导入模板')
}, },
// //
onSelectReagentSubmit(code, row) { onSelectReagentSubmit(code, row) {
@ -310,15 +309,15 @@ export default {
}, },
// //
getFilledFormData() { getFilledFormData() {
return this.getFilledFormDataByRefs(["baseInfoRef", "stepFormPackageRef", "stepTableRef", "stepRef", "remarkRef"])
return this.getFilledFormDataByRefs(["baseInfoRef", "stepFormPackageRef", "stepTableRef", "stepRef", "fjRef", "remarkRef"])
}, },
async getFormData() { async getFormData() {
let content = await this.validFormFields(["baseInfoRef", "stepFormPackageRef", "stepTableRef", "stepRef", "remarkRef"]);
let content = await this.validFormFields(["baseInfoRef", "stepFormPackageRef", "stepTableRef", "stepRef", "fjRef", "remarkRef"]);
return content; return content;
}, },
getResource() { getResource() {
let content = this.getFilledFormData(); let content = this.getFilledFormData();
console.log(content)
//resource //resource
let tmpResource = [] let tmpResource = []
if (this.fillType === "actFill") { if (this.fillType === "actFill") {
@ -333,7 +332,7 @@ export default {
tmpResource.push({ tmpResource.push({
mc: null, mc: null,
bh: item.startSolutionCode,
bh: content.subSolution,
ph: null, ph: null,
ndz: null, ndz: null,
nd: null, nd: null,
@ -342,10 +341,10 @@ export default {
sxrq: null, sxrq: null,
kc: null, kc: null,
kcdw: null, kcdw: null,
syl: item.actStartSolutionVolume,
syl: item.ysxsyxytj,
type: 1, type: 1,
elnType: this.product, elnType: this.product,
syldw: content.headerSelectFields.actStartSolutionVolumeUnit,
syldw: content.headerSelectFields.sjxsyxytjUnit,
yxzq: null, yxzq: null,
yxzqdw: null, yxzqdw: null,
}) })

+ 8
- 121
src/views/business/comps/template/comps/pcr/PCR007.vue View File

@ -26,6 +26,7 @@
<CustomTable @blur="onHandleTableBlur" @headerSelectChange="onHandleTableBlur" <CustomTable @blur="onHandleTableBlur" @headerSelectChange="onHandleTableBlur"
:ref="`stepTableRef`" :columns="tableStepColumns" :formData="formData" :prefixKey="`table`" :ref="`stepTableRef`" :columns="tableStepColumns" :formData="formData" :prefixKey="`table`"
:showOperation="fillType === 'preFill'"
fieldItemLabel="template.common.operationSteps"> fieldItemLabel="template.common.operationSteps">
<template slot="operation" slot-scope="{ row, rowIndex, columns }"> <template slot="operation" slot-scope="{ row, rowIndex, columns }">
<TableOpertaion :fillType="fillType" :row="row" :rowIndex="rowIndex" :columns="columns" <TableOpertaion :fillType="fillType" :row="row" :rowIndex="rowIndex" :columns="columns"
@ -35,16 +36,11 @@
</div> </div>
<Step ref="stepRef" :formData="formData.stepData"></Step> <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" <BaseInfoFormPackage fieldItemLabel="template.common.remark" label="template.common.remark"
ref="remarkRef" :formConfig="remarkConig" :formData="formData" /> ref="remarkRef" :formConfig="remarkConig" :formData="formData" />
</div> </div>
</div> </div>
</div> </div>
<SelectReagentDialog @submit="onSelectReagentSubmit" ref="selectReagentDialogRef">
</SelectReagentDialog>
<!-- <button @click="onSave">保存</button> --> <!-- <button @click="onSave">保存</button> -->
<ImportExcelDialog ref="ImportExcelDialog" @onLoadData="onLoadExcelData" /> <ImportExcelDialog ref="ImportExcelDialog" @onLoadData="onLoadExcelData" />
</div> </div>
@ -63,7 +59,7 @@ import { EventBus } from "@/utils/eventBus";
import { volumeConverter } from "@/utils/volConverter";// import { volumeConverter } from "@/utils/volConverter";//
import { convertConcentration } from "@/utils/conConverter";// import { convertConcentration } from "@/utils/conConverter";//
import SelectReagentDialog from '../../dialog/SelectReagentDialog.vue'; 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 TableOpertaion from "@/components/Template/operation/TableOpertaion.vue"
import { addTj, uniqeResource, uniqeResourceOne, addDecimals } from "@/utils/calUnitTools"; import { addTj, uniqeResource, uniqeResourceOne, addDecimals } from "@/utils/calUnitTools";
import ImportExcelDialog from '../../dialog/ImportExcelDialog' import ImportExcelDialog from '../../dialog/ImportExcelDialog'
@ -79,7 +75,7 @@ export default {
}, },
computed: { computed: {
tableStepColumns() { tableStepColumns() {
return getPCR005Config(this);
return getPCR007Config(this);
}, },
// //
getFjFormConfig() { 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", type: "cellItem",
label: 'template.common.configurationTime',
label: 'template.pcr.pcr007.czsj',
config: { config: {
startDate: { startDate: {
label: 'template.common.startTime', label: 'template.common.startTime',
@ -208,14 +169,10 @@ export default {
type: 'step', type: 'step',
config: { config: {
solution: { solution: {
labelWidth: 80,
labelWidth: 100,
label: 'template.pcr.pcr007.dztpbh', 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: { methods: {
downloadExcelTemplate() { downloadExcelTemplate() {
this.exportExcel(['样品名称', '样品初始浓度', '稀释倍数', '预设样品吸样体积'])
this.exportExcel(['样品名称', '样品初始浓采样前样品管试剂预计添加体积度'], 'PCR分析采集管称重记录表导入模板')
}, },
// //
onSelectReagentSubmit(code, row) { onSelectReagentSubmit(code, row) {
@ -253,10 +210,6 @@ export default {
list.push({ list.push({
ypmc: item[0], ypmc: item[0],
ypcsnd: item[1], ypcsnd: item[1],
sxbs: item[2],
ysypxytj: item[3],
targetDiluentVolumePrecision: 3,
actSolutionVolumePrecision: 3
}) })
}) })
this.$refs.stepTableRef.addRows(list) this.$refs.stepTableRef.addRows(list)
@ -265,48 +218,8 @@ export default {
}, },
// //
onHandleTableBlur() { 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() { getFilledFormData() {
@ -325,31 +238,6 @@ export default {
let tableList = content.stepTableFormData let tableList = content.stepTableFormData
if (tableList && tableList.length > 0) { if (tableList && tableList.length > 0) {
for (let i = 0; i < tableList.length; i++) { 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() { async onSave() {
let content = this.$refs.stepRef.getStepResource(); let content = this.$refs.stepRef.getStepResource();
console.log(content);
}, },
// //

+ 18
- 71
src/views/business/comps/template/formConfig/PCRTableConfig.js View File

@ -632,6 +632,7 @@ export const getPCR005Config = ($this) => {
fillType: 'preFill', fillType: 'preFill',
headerSelectKey: 'sjypxytjUnit', headerSelectKey: 'sjypxytjUnit',
headerOptions: $this.getDictOptions('business_tjdw'), headerOptions: $this.getDictOptions('business_tjdw'),
copyFrom: 'ysypxytj', //复制哪个字段
bodyType: 'inputNumber', bodyType: 'inputNumber',
bodyFillType: 'actFill', bodyFillType: 'actFill',
bodyMaxlength: 10, bodyMaxlength: 10,
@ -666,6 +667,7 @@ export const getPCR005Config = ($this) => {
fillType: 'preFill', fillType: 'preFill',
headerSelectKey: 'sjxsyxytjUnit', headerSelectKey: 'sjxsyxytjUnit',
headerOptions: $this.getDictOptions('business_tjdw'), headerOptions: $this.getDictOptions('business_tjdw'),
copyFrom: 'ysxsyxytj', //复制哪个字段
bodyType: 'inputNumber', bodyType: 'inputNumber',
bodyFillType: 'actFill', bodyFillType: 'actFill',
bodyMaxlength: 10, bodyMaxlength: 10,
@ -699,7 +701,7 @@ export const getPCR005Config = ($this) => {
export const getPCR007Config = ($this) => { export const getPCR007Config = ($this) => {
return [ return [
{ {
label: 'template.pcr.pcr005.ypmc',
label: 'template.pcr.pcr007.ypmc',
prop: 'ypmc', prop: 'ypmc',
width: 280, width: 280,
bodyType: 'input', bodyType: 'input',
@ -708,105 +710,50 @@ export const getPCR007Config = ($this) => {
bodyFillType: 'preFill', bodyFillType: 'preFill',
}, },
{ {
label: 'template.pcr.pcr005.ypcsnd',
prop: 'ypcsnd',
width: 280,
showWidth: 180,
fillType: 'preFill',
headerSelectKey: 'ypcsndUnit',
headerOptions: $this.getDictOptions('business_nddw'),
bodyType: 'inputNumber',
bodyFillType: 'preFill',
bodyMaxlength: 10,
},
{
label: 'template.pcr.pcr005.sxbs',
prop: 'sxbs',
width: 280,
showWidth: 180,
fillType: 'preFill',
bodyType: 'inputNumber',
bodyFillType: 'preFill',
bodyMaxlength: 10,
},
{
label: 'template.pcr.pcr005.ysypxytj',
prop: 'ysypxytj',
label: 'template.pcr.pcr007.cyqypgsjyjtjtj',
prop: 'cyqypgsjyjtjtj',
width: 280, width: 280,
showWidth: 180, showWidth: 180,
fillType: 'preFill', fillType: 'preFill',
headerSelectKey: 'ysypxytjUnit',
headerSelectKey: 'cyqypgsjyjtjtjUnit',
headerOptions: $this.getDictOptions('business_tjdw'), headerOptions: $this.getDictOptions('business_tjdw'),
bodyType: 'inputNumber', bodyType: 'inputNumber',
bodyFillType: 'preFill', bodyFillType: 'preFill',
bodyMaxlength: 10, bodyMaxlength: 10,
}, },
{ {
label: 'template.pcr.pcr005.sjypxytj',
prop: 'sjypxytj',
label: 'template.pcr.pcr007.cyqypgsjsjtjtj',
prop: 'cyqypgsjsjtjtj',
width: 280, width: 280,
showWidth: 180, showWidth: 180,
fillType: 'preFill', fillType: 'preFill',
headerSelectKey: 'sjypxytjUnit',
headerSelectKey: 'cyqypgsjsjtjtjUnit',
headerOptions: $this.getDictOptions('business_tjdw'), headerOptions: $this.getDictOptions('business_tjdw'),
bodyType: 'inputNumber', bodyType: 'inputNumber',
bodyFillType: 'actFill', bodyFillType: 'actFill',
copyFrom: 'cyqypgsjyjtjtj', //复制哪个字段
bodyMaxlength: 10, bodyMaxlength: 10,
}, },
{ {
label: 'template.pcr.pcr005.ysxsyxytj',
prop: 'ysxsyxytj',
width: 280,
showWidth: 180,
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',
bodyPrecisionKey: 0,
bodyMaxlength: 10,
bodySubPlaceholder: 'template.common.xswsPlaceholder',
},
{
label: 'template.pcr.pcr005.sjxsyxytj',
prop: 'sjxsyxytj',
label: 'template.pcr.pcr007.cygzl',
prop: 'cygzl',
width: 280, width: 280,
showWidth: 180, showWidth: 180,
fillType: 'preFill', fillType: 'preFill',
headerSelectKey: 'sjxsyxytjUnit',
headerSelectKey: 'cygzlUnit',
headerOptions: $this.getDictOptions('business_tjdw'), headerOptions: $this.getDictOptions('business_tjdw'),
bodyType: 'inputNumber', bodyType: 'inputNumber',
bodyFillType: 'actFill', bodyFillType: 'actFill',
bodySubType: 'button',
bodySubButtonName: 'form.hqz',
bodyMaxlength: 10, bodyMaxlength: 10,
},
{
label: 'template.pcr.pcr005.ypznd',
prop: 'ypznd',
width: 280,
showWidth: 180,
fillType: 'preFill',
headerSelectKey: 'ypzndUnit',
headerOptions: $this.getDictOptions('business_nddw'),
bodyDisabled: true,
bodyType: 'inputNumber',
bodyFillType: 'preFill',
bodyMaxlength: 10,
bodySubType: 'inputNumber',
bodySubKey: 'targetDiluentVolumePrecision', bodySubKey: 'targetDiluentVolumePrecision',
bodyPrecisionKey: 'targetDiluentVolumePrecision', bodyPrecisionKey: 'targetDiluentVolumePrecision',
bodySubFillType: 'preFill',
bodySubFillType: 'actFill',
subPrecision: 0, subPrecision: 0,
showBodySub: $this.fillType === 'preFill',
showBodySub: $this.fillType === 'actFill',
bodyMaxlength: 10, bodyMaxlength: 10,
bodySubPlaceholder: 'template.common.xswsPlaceholder', bodySubPlaceholder: 'template.common.xswsPlaceholder',
},
}
] ]
} }

Loading…
Cancel
Save