diff --git a/src/lang/en/template/pcr.js b/src/lang/en/template/pcr.js
index e5ae109..ff5c6ca 100644
--- a/src/lang/en/template/pcr.js
+++ b/src/lang/en/template/pcr.js
@@ -49,6 +49,11 @@ export default {
},
pcr007: {
dztpbh: '电子天平编号',
+ ypmc: '样品名称',
+ cyqypgsjyjtjtj: '采样前样品管试剂预计添加体积',
+ cyqypgsjsjtjtj: '采样前样品管试剂实际添加体积',
+ cygzl: '采集管重量',
+ czsj: '称重时间',
clpbh: 'Analysis Batch Number',
ypmc: '样品名称',
ypcsnd: '样品初始浓度',
diff --git a/src/lang/zh/template/pcr.js b/src/lang/zh/template/pcr.js
index 80f8fe1..919028d 100644
--- a/src/lang/zh/template/pcr.js
+++ b/src/lang/zh/template/pcr.js
@@ -48,6 +48,11 @@ export default {
},
pcr007: {
dztpbh: '电子天平编号',
+ ypmc: '样品名称',
+ cyqypgsjyjtjtj: '采样前样品管试剂预计添加体积',
+ cyqypgsjsjtjtj: '采样前样品管试剂实际添加体积',
+ cygzl: '采集管重量',
+ czsj: '称重时间',
clpbh: 'Analysis Batch Number',
ypmc: '样品名称',
ypcsnd: '样品初始浓度',
diff --git a/src/utils/index.js b/src/utils/index.js
index 0212fd7..b80851c 100644
--- a/src/utils/index.js
+++ b/src/utils/index.js
@@ -441,7 +441,7 @@ export function isValueEmpty(value) {
if (Array.isArray(value) && value.length === 0) {
return true
}
- if (Object.keys(value).length === 0) {
+ if (Object.keys(value).length === 0 && typeof value=='object') {
return true;
}
return false
diff --git a/src/views/business/comps/template/comps/pcr/PCR005.vue b/src/views/business/comps/template/comps/pcr/PCR005.vue
index 6a23326..dc9e66c 100644
--- a/src/views/business/comps/template/comps/pcr/PCR005.vue
+++ b/src/views/business/comps/template/comps/pcr/PCR005.vue
@@ -26,10 +26,11 @@
deleteRow(rowIndex)">
+ @deleteRow="(rowIndex) => deleteRow(rowIndex)" >
@@ -43,8 +44,6 @@
-
-
@@ -177,11 +176,11 @@ export default {
type: "cellItem",
label: 'template.pcr.pcr005.clpbh',
config: {
- act: {
+ clpbh: {
label: '',
type: "input",
fillType: "actFill",
- otherCode: "preOther",
+ otherCode: "clpbh",
}
}
},
@@ -237,7 +236,7 @@ export default {
},
methods: {
downloadExcelTemplate() {
- this.exportExcel(['样品名称', '样品初始浓度', '稀释倍数', '预设样品吸样体积'])
+ this.exportExcel(['样品名称', '样品初始浓度', '稀释倍数', '预设样品吸样体积'], 'PCR分析样品处理表导入模板')
},
//选择试剂提交事件
onSelectReagentSubmit(code, row) {
@@ -310,15 +309,15 @@ export default {
},
//获取已填写的表单数据
getFilledFormData() {
- return this.getFilledFormDataByRefs(["baseInfoRef", "stepFormPackageRef", "stepTableRef", "stepRef", "remarkRef"])
+ return this.getFilledFormDataByRefs(["baseInfoRef", "stepFormPackageRef", "stepTableRef", "stepRef", "fjRef", "remarkRef"])
},
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;
},
getResource() {
let content = this.getFilledFormData();
-
+ console.log(content)
//生成resource
let tmpResource = []
if (this.fillType === "actFill") {
@@ -333,7 +332,7 @@ export default {
tmpResource.push({
mc: null,
- bh: item.startSolutionCode,
+ bh: content.subSolution,
ph: null,
ndz: null,
nd: null,
@@ -342,10 +341,10 @@ export default {
sxrq: null,
kc: null,
kcdw: null,
- syl: item.actStartSolutionVolume,
+ syl: item.ysxsyxytj,
type: 1,
elnType: this.product,
- syldw: content.headerSelectFields.actStartSolutionVolumeUnit,
+ syldw: content.headerSelectFields.sjxsyxytjUnit,
yxzq: null,
yxzqdw: null,
})
diff --git a/src/views/business/comps/template/comps/pcr/PCR007.vue b/src/views/business/comps/template/comps/pcr/PCR007.vue
index 8d8a7f5..dcfbadb 100644
--- a/src/views/business/comps/template/comps/pcr/PCR007.vue
+++ b/src/views/business/comps/template/comps/pcr/PCR007.vue
@@ -26,6 +26,7 @@
-
-
-
-
@@ -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);
},
// 删除表格行
diff --git a/src/views/business/comps/template/formConfig/PCRTableConfig.js b/src/views/business/comps/template/formConfig/PCRTableConfig.js
index 4f7168b..cbaacc9 100644
--- a/src/views/business/comps/template/formConfig/PCRTableConfig.js
+++ b/src/views/business/comps/template/formConfig/PCRTableConfig.js
@@ -632,6 +632,7 @@ export const getPCR005Config = ($this) => {
fillType: 'preFill',
headerSelectKey: 'sjypxytjUnit',
headerOptions: $this.getDictOptions('business_tjdw'),
+ copyFrom: 'ysypxytj', //复制哪个字段
bodyType: 'inputNumber',
bodyFillType: 'actFill',
bodyMaxlength: 10,
@@ -666,6 +667,7 @@ export const getPCR005Config = ($this) => {
fillType: 'preFill',
headerSelectKey: 'sjxsyxytjUnit',
headerOptions: $this.getDictOptions('business_tjdw'),
+ copyFrom: 'ysxsyxytj', //复制哪个字段
bodyType: 'inputNumber',
bodyFillType: 'actFill',
bodyMaxlength: 10,
@@ -699,7 +701,7 @@ export const getPCR005Config = ($this) => {
export const getPCR007Config = ($this) => {
return [
{
- label: 'template.pcr.pcr005.ypmc',
+ label: 'template.pcr.pcr007.ypmc',
prop: 'ypmc',
width: 280,
bodyType: 'input',
@@ -708,105 +710,50 @@ export const getPCR007Config = ($this) => {
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,
showWidth: 180,
fillType: 'preFill',
- headerSelectKey: 'ysypxytjUnit',
+ headerSelectKey: 'cyqypgsjyjtjtjUnit',
headerOptions: $this.getDictOptions('business_tjdw'),
bodyType: 'inputNumber',
bodyFillType: 'preFill',
bodyMaxlength: 10,
},
{
- label: 'template.pcr.pcr005.sjypxytj',
- prop: 'sjypxytj',
+ label: 'template.pcr.pcr007.cyqypgsjsjtjtj',
+ prop: 'cyqypgsjsjtjtj',
width: 280,
showWidth: 180,
fillType: 'preFill',
- headerSelectKey: 'sjypxytjUnit',
+ headerSelectKey: 'cyqypgsjsjtjtjUnit',
headerOptions: $this.getDictOptions('business_tjdw'),
bodyType: 'inputNumber',
bodyFillType: 'actFill',
+ copyFrom: 'cyqypgsjyjtjtj', //复制哪个字段
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,
showWidth: 180,
fillType: 'preFill',
- headerSelectKey: 'sjxsyxytjUnit',
+ headerSelectKey: 'cygzlUnit',
headerOptions: $this.getDictOptions('business_tjdw'),
bodyType: 'inputNumber',
bodyFillType: 'actFill',
+ bodySubType: 'button',
+ bodySubButtonName: 'form.hqz',
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',
bodyPrecisionKey: 'targetDiluentVolumePrecision',
- bodySubFillType: 'preFill',
+ bodySubFillType: 'actFill',
subPrecision: 0,
- showBodySub: $this.fillType === 'preFill',
+ showBodySub: $this.fillType === 'actFill',
bodyMaxlength: 10,
bodySubPlaceholder: 'template.common.xswsPlaceholder',
- },
+ }
]
}
\ No newline at end of file