From fc1b46418c36ee6469fba82508f2016819c2574f Mon Sep 17 00:00:00 2001 From: HanLong <404402223@qq.com> Date: Tue, 10 Mar 2026 14:52:20 +0800 Subject: [PATCH] =?UTF-8?q?feat:[=E6=A8=A1=E6=9D=BF=E7=AE=A1=E7=90=86][PCR?= =?UTF-8?q?008]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/lang/en/template/pcr.js | 2 +- src/lang/zh/template/pcr.js | 4 +- .../business/comps/template/comps/pcr/PCR008.vue | 140 +++++++++++++++------ .../comps/template/formConfig/PCRTableConfig.js | 9 +- 4 files changed, 107 insertions(+), 48 deletions(-) diff --git a/src/lang/en/template/pcr.js b/src/lang/en/template/pcr.js index 72e860b..6be5868 100644 --- a/src/lang/en/template/pcr.js +++ b/src/lang/en/template/pcr.js @@ -52,7 +52,7 @@ export default { ypmc: '样品名称', cyqypgsjyjtjtj: '采样前样品管试剂预计添加体积', cyqypgsjsjtjtj: '采样前样品管试剂实际添加体积', - cygzl: '采集管重量', + cjgzl: '采集管重量', czsj: '称重时间', clpbh: 'Analysis Batch Number', ypmc: '样品名称', diff --git a/src/lang/zh/template/pcr.js b/src/lang/zh/template/pcr.js index 4e51090..af4ca3c 100644 --- a/src/lang/zh/template/pcr.js +++ b/src/lang/zh/template/pcr.js @@ -51,7 +51,7 @@ export default { ypmc: '样品名称', cyqypgsjyjtjtj: '采样前样品管试剂预计添加体积', cyqypgsjsjtjtj: '采样前样品管试剂实际添加体积', - cygzl: '采集管重量', + cjgzl: '采集管重量', czsj: '称重时间', clpbh: 'Analysis Batch Number', ypmc: '样品名称', @@ -66,7 +66,7 @@ export default { }, pcr008: { czb: '称重表', - clsj: 'Work Time', + clsj: '处理时间', yjry: '匀浆溶液', bs: '倍数', yjyjry: '已加匀浆溶液', diff --git a/src/views/business/comps/template/comps/pcr/PCR008.vue b/src/views/business/comps/template/comps/pcr/PCR008.vue index df299c2..1983f58 100644 --- a/src/views/business/comps/template/comps/pcr/PCR008.vue +++ b/src/views/business/comps/template/comps/pcr/PCR008.vue @@ -15,7 +15,8 @@
+ :formConfig="stepFormConfig" @blur="onHandleBlur" :formData="formData" + @beforeReagentSubmit="onBeforeReagentSubmit" @onRegentSubmit="onRegentSubmit" />
{{ $t('form.delete') }} @@ -230,16 +231,66 @@ export default { this.onHandleTableBlur() }, methods: { - onRegentSubmit(data){ - console.log(data,"回调") + onBeforeReagentSubmit(data) { + const { selectData, callback } = data; + + let selectedRows = selectData.selectedRows + let cjgzlUnit; + let error = false; + if (selectedRows) { + selectedRows.forEach(item => { + let bdnr = JSON.parse(item.bdnr) + if (!cjgzlUnit) { + cjgzlUnit = bdnr.headerSelectFields.cjgzlUnit + } + if (cjgzlUnit != bdnr.headerSelectFields.cjgzlUnit) { + error = true + } + }) + } + if (error) { + callback.prevent("所选表单单位不一致,请重新选择") + } + + }, + onRegentSubmit(data) { + let addRows = [] + let selectedRows = data.selectInfo.selectedRows + let cjgzlUnit; + + if (selectedRows) { + selectedRows.forEach(item => { + let bdnr = JSON.parse(item.bdnr) + if (!cjgzlUnit) { + cjgzlUnit = bdnr.headerSelectFields.cjgzlUnit + } + if (bdnr.stepTableFormData) { + bdnr.stepTableFormData.forEach(row => { + addRows.push({ + ypmc: row.ypmc, + cjgz: row.cjgzl, + targetStartSolutionVolumePrecision: 3, + targetDiluentVolumePrecision: 3 + }) + }) + } + }) + if (addRows) { + this.$refs.stepTableRef.addRows(addRows) + let content = this.getFilledFormData(); + setTimeout(() => { + this.justUpdateFilledFormData(); + }, 100); + } + } }, onClickDelete() { this.$modal.confirm(this.$t('form.confirmDelete')).then(() => { - this.$refs.stepTableRef.deleteSelectedRows(this.deleteRows) - this.$refs.stepTableRef.justUpdateFilledFormData(); + setTimeout(() => { + this.justUpdateFilledFormData(); + }, 100); }).catch(() => { }); - }, handleSelectionChange(row) { this.deleteRows = [] @@ -259,17 +310,35 @@ export default { let content = this.getFilledFormData(); let bs = content.bs - content + let yjyjry = content.yjyjry + let yjyjryUnit = content.yjyjryUnit + if (this.fillType === "actFill") { let tableList = content.stepTableFormData if (tableList && tableList.length > 0) { for (let i = 0; i < tableList.length; i++) { let item = tableList[i] - let cqzl = item.cqzl * bs - // 组织重量 乘以 倍数 )减去 已加匀浆溶液 + console.log(item) + let lzzcz = item.lzzcz + let cjgz = item.cjgz + let tabZzzl; + // 组织重量 = 连组织称重 减去 采集管重 + if(lzzcz && cjgz) { + let temp = subTj([lzzcz, cjgz], [content.headerSelectFields.lzzczUnit, content.headerSelectFields.cjgzUnit]) + let zzzl = temp.total + let zzzlUnit = temp.unit + tabZzzl = volumeConverter.convert(zzzl + zzzlUnit, content.headerSelectFields.zzzlUnit) + tableList[i].zzzl = tabZzzl + } + // 预设匀浆溶液补加入量 = (组织重量 乘以 倍数 )减去 已加匀浆溶液 - let ysyjrybjrl = volumeConverter.convert(cqzl + content.headerSelectFields.cqzlUnit, content.headerSelectFields.ysyjrybjrlUnit) - tableList[i].ysyjrybjrl = ysyjrybjrl + if(tabZzzl && bs && yjyjry) { + let temp = subTj([tabZzzl * bs, yjyjry], [content.headerSelectFields.zzzlUnit, yjyjryUnit]) + let ysyjrybjrl = temp.total + let ysyjrybjrlUnit = temp.unit + ysyjrybjrl = volumeConverter.convert(ysyjrybjrl + ysyjrybjrlUnit, content.headerSelectFields.ysyjrybjrlUnit) + tableList[i].ysyjrybjrl = ysyjrybjrl + } } } this.$refs.stepTableRef.updateDataSource(tableList); @@ -289,36 +358,25 @@ export default { //生成resource let tmpResource = [] if (this.fillType === "actFill") { - 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: content.subSolution, - ph: null, - ndz: null, - nd: null, - nddw: null, - ly: 'ELN配制', - sxrq: null, - kc: null, - kcdw: null, - syl: item.ysxsyxytj, - type: 1, - elnType: this.product, - syldw: content.headerSelectFields.sjxsyxytjUnit, - yxzq: null, - yxzqdw: null, - }) - - } - } + //使用的 + tmpResource.push({ + mc: null, + bh: content.yjrybh, + ph: null, + ndz: null, + nd: null, + nddw: null, + ly: null, + sxrq: null, + kc: null, + kcdw: null, + syl: content.yjyjry, + type: 1, + elnType: this.product, + syldw: content.yjyjryUnit, + yxzq: null, + yxzqdw: null, + }) } if (tmpResource.length > 0) { tmpResource = uniqeResourceOne(tmpResource) diff --git a/src/views/business/comps/template/formConfig/PCRTableConfig.js b/src/views/business/comps/template/formConfig/PCRTableConfig.js index 51e3074..c7f49f7 100644 --- a/src/views/business/comps/template/formConfig/PCRTableConfig.js +++ b/src/views/business/comps/template/formConfig/PCRTableConfig.js @@ -735,12 +735,12 @@ export const getPCR007Config = ($this) => { bodyMaxlength: 10, }, { - label: 'template.pcr.pcr007.cygzl', - prop: 'cygzl', + label: 'template.pcr.pcr007.cjgzl', + prop: 'cjgzl', width: 280, showWidth: 180, fillType: 'preFill', - headerSelectKey: 'cygzlUnit', + headerSelectKey: 'cjgzlUnit', headerOptions: $this.getDictOptions('business_tjdw'), bodyType: 'inputNumber', bodyFillType: 'actFill', @@ -794,10 +794,11 @@ export const getPCR008Config = ($this) => { bodyType: 'inputNumber', bodyFillType: 'actFill', bodyMaxlength: 10, - bodySubType: 'inputNumber', bodyFillType: 'actFill', bodySubType: 'button', bodySubButtonName: 'form.hqz', + bodySubFillType: 'actFill', + showBodySub: $this.fillType === 'actFill', }, { label: 'template.pcr.pcr008.zzzl',