From 64c16e0cec3a54efee29ed26558a0600d8cb1d39 Mon Sep 17 00:00:00 2001 From: memorylkf <312904636@qq.com> Date: Tue, 20 Jan 2026 10:39:35 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feat:=20[=E6=A8=A1=E6=9D=BF=E7=AE=A1?= =?UTF-8?q?=E7=90=86]=20=E5=9F=BA=E7=A1=80=E5=8F=8C=E8=AF=AD=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=20feat:=20[=E6=A8=A1=E6=9D=BF=E7=AE=A1=E7=90=86]=20?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=94=9F=E7=89=A9=E6=A0=B7=E5=93=81=E5=88=86?= =?UTF-8?q?=E6=9E=90=E6=96=B9=E6=B3=95=E5=AD=A6=E6=A0=B7=E5=93=81=E5=88=B6?= =?UTF-8?q?=E5=A4=87=E8=A1=A8=EF=BC=88=E5=85=A8=E8=A1=80=E7=A8=B3=E5=AE=9A?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/lang/en/template/commonTemplate.js | 44 +-- src/lang/en/template/sp.js | 5 + src/lang/zh/template/sp.js | 4 + .../business/comps/template/TemplateTable.vue | 5 +- .../template/comps/sp/SWYPFXFFXYPZBB/QXWDX.vue | 373 +++++++++++++++++++++ .../template/comps/sp/SWYPFXFFXYPZBB/ZQDYJMD.vue | 2 +- 6 files changed, 409 insertions(+), 24 deletions(-) create mode 100644 src/views/business/comps/template/comps/sp/SWYPFXFFXYPZBB/QXWDX.vue diff --git a/src/lang/en/template/commonTemplate.js b/src/lang/en/template/commonTemplate.js index 1543197..d4c00fb 100644 --- a/src/lang/en/template/commonTemplate.js +++ b/src/lang/en/template/commonTemplate.js @@ -3,33 +3,33 @@ export default { pageTitle: 'Biological Sample Analysis Solution Preparation Table', // 标签 - baseInfo: 'Test Basic Information', + baseInfo: 'Study Basic Information', reagentInfo: 'Test Reagent Information', - instrumentInfo: 'Instrument Usage Information', + instrumentInfo: 'Instrument Usage', storageCondition: 'Storage Conditions', - operationSteps: 'Operation Steps', - remark: 'Remarks', + operationSteps: 'Operation Workflow', + remark: 'Comments', // 字段标签 - storageConditionLabel: 'Storage Conditions', - testName: 'Test Name', - testNumber: 'Test Number', - methodCode: 'Method Code', - versionNumber: 'Version Number', - testConfigurationConditions: 'Test Configuration Conditions', - preFill: 'Pre-Fill', + storageConditionLabel: 'Storage Condition', + testName: 'Study Name', + testNumber: 'Study Number', + methodCode: 'Method Number', + versionNumber: 'Version', + testConfigurationConditions: 'Work Condition', + preFill: 'Preset', actualFill: 'Actual', - configurationTime: 'Configuration Time', + configurationTime: 'Work Time', startTime: 'Start Time', endTime: 'End Time', targetSolutionName: 'Target Solution Name', - targetSolutionCode: 'Target Solution Code', - targetPreConcentration: 'Target Solution Expected Concentration', - targetActConcentration: 'Target Solution Actual Concentration', - targetPreVolume: 'Target Solution Expected Volume', - targetActVolume: 'Target Solution Actual Volume', - effectivePeriod: 'Effective Period', - expireDate: 'Expiry Date', + targetSolutionCode: 'Target Solution ID', + targetPreConcentration: 'Expected Concentration of Target Solution', + targetActConcentration: 'Actual Concentration of Target Solution', + targetPreVolume: 'Expected Volume of Target Solution', + targetActVolume: 'Actual Volume of Target Solution', + effectivePeriod: 'Validity Period', + expireDate: 'Expiration Date', // 占位符 remarkPlaceholder: 'Please enter remarks', @@ -42,16 +42,16 @@ export default { // 试剂信息列 reagentName: 'Reagent Name', - reagentCode: 'Code', + reagentCode: 'Item Number', reagentNo: 'Batch Number', concentration: 'Concentration/Content/Purity', source: 'Source', - reagentExpireDate: 'Expiry Date', + reagentExpireDate: 'Expiration Date', // 仪器使用信息列 instrumentName: 'Instrument Name', instrumentModel: 'Instrument Model', - instrumentCode: 'Instrument Number', + instrumentCode: 'Instrument ID', nextTestDate: 'Next Test/Calibration/Verification Date', // 试验物质配制计划列 diff --git a/src/lang/en/template/sp.js b/src/lang/en/template/sp.js index 0df478b..1f9c151 100644 --- a/src/lang/en/template/sp.js +++ b/src/lang/en/template/sp.js @@ -16,5 +16,10 @@ export default { yjjzxql: 'Expected Blank Substrate Extraction Volume', sjjzxql: 'Actual Blank Substrate Extraction Volume', hhwznd: 'Target Solution Concentration' + }, + //生物样品分析方法学样品制备表(全血稳定) + sp010: { + title: + 'Bioanalytical Methods Sample Preparation Record (Whole Blood Stability)' } } diff --git a/src/lang/zh/template/sp.js b/src/lang/zh/template/sp.js index 0c12260..e9b4750 100644 --- a/src/lang/zh/template/sp.js +++ b/src/lang/zh/template/sp.js @@ -15,5 +15,9 @@ export default { yjjzxql: '预计基质吸取量', sjjzxql: '实际基质吸取量', hhwznd: '化合物终浓度' + }, + //生物样品分析方法学样品制备表(全血稳定) + sp010: { + title: '生物样品分析方法学样品制备表(全血稳定)' } } diff --git a/src/views/business/comps/template/TemplateTable.vue b/src/views/business/comps/template/TemplateTable.vue index 8cdfd90..b7e949c 100644 --- a/src/views/business/comps/template/TemplateTable.vue +++ b/src/views/business/comps/template/TemplateTable.vue @@ -15,7 +15,9 @@ import SWYPFXRYPZB from "./comps/sp/SWYPFXRYPZB.vue"; import SWYPFXCBYPZB from "./comps/sp/SWYPFXCBYPZB.vue"; import SWYPBQGZYZBB from "./comps/sp/SWYPBQGZYZBB.vue"; import SWYPNBGZYZBB from "./comps/sp/SWYPNBGZYZBB.vue"; +//色谱生物样品分析方法学样品制备表-10个类似 import ZQDYJMD from "./comps/sp/SWYPFXFFXYPZBB/ZQDYJMD.vue"; +import QXWDX from "./comps/sp/SWYPFXFFXYPZBB/QXWDX.vue"; import Demo from "./comps/sp/Demo.vue"; //公用 import SYWZPZJHB from "./comps/gy/SYWZPZJHB.vue"; @@ -25,7 +27,7 @@ export default { name: "TemplateTable", components: { MJYLQSQD, SYWZPZJHB, - SP001, SWYPFXRYPZB, Demo, SWYPFXCBYPZB, SWYPBQGZYZBB, SWYPNBGZYZBB,ZQDYJMD + SP001, SWYPFXRYPZB, Demo, SWYPFXCBYPZB, SWYPBQGZYZBB, SWYPNBGZYZBB,ZQDYJMD,QXWDX }, props: { sn: { @@ -55,6 +57,7 @@ export default { 'SP003': 'SWYPBQGZYZBB', 'SP004': 'SWYPNBGZYZBB', 'SP008': 'ZQDYJMD', + 'SP010': 'QXWDX', 'SYWZPZJHB': 'SYWZPZJHB', 'MJYLQSQD': 'MJYLQSQD', } diff --git a/src/views/business/comps/template/comps/sp/SWYPFXFFXYPZBB/QXWDX.vue b/src/views/business/comps/template/comps/sp/SWYPFXFFXYPZBB/QXWDX.vue new file mode 100644 index 0000000..db906bc --- /dev/null +++ b/src/views/business/comps/template/comps/sp/SWYPFXFFXYPZBB/QXWDX.vue @@ -0,0 +1,373 @@ + + + + + \ No newline at end of file diff --git a/src/views/business/comps/template/comps/sp/SWYPFXFFXYPZBB/ZQDYJMD.vue b/src/views/business/comps/template/comps/sp/SWYPFXFFXYPZBB/ZQDYJMD.vue index 6206e8f..758a078 100644 --- a/src/views/business/comps/template/comps/sp/SWYPFXFFXYPZBB/ZQDYJMD.vue +++ b/src/views/business/comps/template/comps/sp/SWYPFXFFXYPZBB/ZQDYJMD.vue @@ -16,7 +16,7 @@ :formConfig="storageFormConfig" :formData="formData" />
- Date: Tue, 20 Jan 2026 10:56:49 +0800 Subject: [PATCH 2/2] =?UTF-8?q?feat:=20[=E6=A8=A1=E6=9D=BF]=20=E9=80=89?= =?UTF-8?q?=E6=8B=A9=E7=BC=96=E5=8F=B7=E4=BF=AE=E6=94=B9=EF=BC=8C=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E6=A0=BC=E5=BC=8F=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../formConfig/SWYPFXFFXYPZBBTableConfig.js | 2 +- .../template/formConfig/paralleAndLadderConfig.js | 1024 ++++++++++---------- .../comps/template/mixins/templateMixin.js | 248 +++-- 3 files changed, 668 insertions(+), 606 deletions(-) diff --git a/src/views/business/comps/template/formConfig/SWYPFXFFXYPZBBTableConfig.js b/src/views/business/comps/template/formConfig/SWYPFXFFXYPZBBTableConfig.js index 6a05d6b..96fd06d 100644 --- a/src/views/business/comps/template/formConfig/SWYPFXFFXYPZBBTableConfig.js +++ b/src/views/business/comps/template/formConfig/SWYPFXFFXYPZBBTableConfig.js @@ -5,7 +5,7 @@ export const getSWYPFXFFXYPZBBTableConfig = ($this) => { label: 'template.sp.sp008.bh', prop: 'bh', bodyType: 'select', - bodyOptions: $this.getDictOptions('business_jmdyzqdyp'), + bodyOptions: $this.getDictOptions('business_sp_jmdyzqdyp'), bodySubType: 'span', bodySubKey: 'bhCode', bodyFillType: 'preFill', diff --git a/src/views/business/comps/template/formConfig/paralleAndLadderConfig.js b/src/views/business/comps/template/formConfig/paralleAndLadderConfig.js index f01eab1..ac19ada 100644 --- a/src/views/business/comps/template/formConfig/paralleAndLadderConfig.js +++ b/src/views/business/comps/template/formConfig/paralleAndLadderConfig.js @@ -1,554 +1,552 @@ // 阶梯配置表格列配置 export const getLadderColumnsConfig = ($this) => { - return [ - { - label: "目标溶液编号", - prop: "targetSolutionCode", - bodyType: "input", - bodySubType: "span", - bodySubKey: "subTargetSolutionCode", - bodyFillType: "preFill", - width: 280 - }, - { - label: "起始溶液编号", - prop: "startSolutionCode", - width: 280, - bodyType: "input", - bodyFillType: "actFill", - bodyMaxlength: 10, - }, - { - label: "预设起始溶液体积", - prop: "targetStartSolutionVolume", - width: 280, - headerSelectKey: "targetStartSolutionVolumeUnit", - fillType: "preFill", - headerOptions: $this.getDictOptions('business_tjdw'), - bodyType: "inputNumber", - bodySubType: "inputNumber", - bodySubKey: "targetStartSolutionVolumePrecision", - bodyFillType: "preFill", - bodySubFillType: "preFill", - showBodySub: $this.fillType === "preFill", - bodyPrecisionKey: "targetStartSolutionVolumePrecision", - bodyMaxlength: 10, - bodyDisabled: true, - bodySubPlaceholder: "请输入保留小数位数", - }, - { - label: "实际起始溶液体积", - prop: "actStartSolutionVolume", - width: 280, - headerSelectKey: "actStartSolutionVolumeUnit", - fillType: "preFill", - headerOptions: $this.getDictOptions('business_tjdw'), - bodyType: "inputNumber", - bodyFillType: "actFill", - bodyMaxlength: 10, - copyFrom: "targetStartSolutionVolume",//复制哪个字段 - }, - { - label: "预设稀释液体积", - prop: "targetDiluentVolume", - width: 280, - headerSelectKey: "targetDiluentVolumeUnit", - fillType: "preFill", - headerOptions: $this.getDictOptions('business_tjdw'), - bodyDisabled: true, - bodyType: "inputNumber", - bodySubType: "inputNumber", - bodySubKey: "targetDiluentVolumePrecision", - bodyFillType: "preFill", - bodySubFillType: "preFill", - showBodySub: $this.fillType === "preFill", + return [ + { + label: '目标溶液编号', + prop: 'targetSolutionCode', + bodyType: 'input', + bodySubType: 'span', + bodySubKey: 'subTargetSolutionCode', + bodyFillType: 'preFill', + width: 280 + }, + { + label: '起始溶液编号', + prop: 'startSolutionCode', + width: 280, + bodyType: 'input', + bodyFillType: 'actFill', + bodyMaxlength: 10 + }, + { + label: '预设起始溶液体积', + prop: 'targetStartSolutionVolume', + width: 280, + headerSelectKey: 'targetStartSolutionVolumeUnit', + fillType: 'preFill', + headerOptions: $this.getDictOptions('business_tjdw'), + bodyType: 'inputNumber', + bodySubType: 'inputNumber', + bodySubKey: 'targetStartSolutionVolumePrecision', + bodyFillType: 'preFill', + bodySubFillType: 'preFill', + showBodySub: $this.fillType === 'preFill', + bodyPrecisionKey: 'targetStartSolutionVolumePrecision', + bodyMaxlength: 10, + bodyDisabled: true, + bodySubPlaceholder: '请输入保留小数位数' + }, + { + label: '实际起始溶液体积', + prop: 'actStartSolutionVolume', + width: 280, + headerSelectKey: 'actStartSolutionVolumeUnit', + fillType: 'preFill', + headerOptions: $this.getDictOptions('business_tjdw'), + bodyType: 'inputNumber', + bodyFillType: 'actFill', + bodyMaxlength: 10, + copyFrom: 'targetStartSolutionVolume' //复制哪个字段 + }, + { + label: '预设稀释液体积', + prop: 'targetDiluentVolume', + width: 280, + headerSelectKey: 'targetDiluentVolumeUnit', + fillType: 'preFill', + headerOptions: $this.getDictOptions('business_tjdw'), + bodyDisabled: true, + bodyType: 'inputNumber', + bodySubType: 'inputNumber', + bodySubKey: 'targetDiluentVolumePrecision', + bodyFillType: 'preFill', + bodySubFillType: 'preFill', + showBodySub: $this.fillType === 'preFill', - bodyPrecisionKey: "targetDiluentVolumePrecision", - bodyMaxlength: 10, - bodySubPlaceholder: "请输入保留小数位数", - }, - { - label: "实际稀释液体积", - prop: "actDiluentVolume", - width: 280, - headerSelectKey: "actDiluentVolumeUnit", - fillType: "preFill", - headerOptions: $this.getDictOptions('business_tjdw'), - bodyType: "inputNumber", - bodyFillType: "actFill", - bodyMaxlength: 10, - copyFrom: "targetDiluentVolume",//复制哪个字段 - }, - { - label: "预设目标溶液浓度", - prop: "targetSolutionConcentration", - width: 280, - headerSelectKey: "targetSolutionConcentrationUnit", - fillType: "preFill", - headerOptions: $this.getDictOptions('business_nddw'), - bodyType: "inputNumber", - bodyFillType: "preFill", - bodyMaxlength: 10, - }, - { - label: "实际目标溶液浓度", - prop: "actSolutionConcentration", - width: 280, - headerSelectKey: "actSolutionConcentrationUnit", - fillType: "preFill", - headerOptions: $this.getDictOptions('business_nddw'), - bodyDisabled: true, - bodyType: "inputNumber", - bodySubType: "inputNumber", - bodySubKey: "actSolutionConcentrationPrecision", - bodyFillType: "actFill", - bodySubFillType: "preFill", - showBodySub: $this.fillType === "preFill", + bodyPrecisionKey: 'targetDiluentVolumePrecision', + bodyMaxlength: 10, + bodySubPlaceholder: '请输入保留小数位数' + }, + { + label: '实际稀释液体积', + prop: 'actDiluentVolume', + width: 280, + headerSelectKey: 'actDiluentVolumeUnit', + fillType: 'preFill', + headerOptions: $this.getDictOptions('business_tjdw'), + bodyType: 'inputNumber', + bodyFillType: 'actFill', + bodyMaxlength: 10, + copyFrom: 'targetDiluentVolume' //复制哪个字段 + }, + { + label: '预设目标溶液浓度', + prop: 'targetSolutionConcentration', + width: 280, + headerSelectKey: 'targetSolutionConcentrationUnit', + fillType: 'preFill', + headerOptions: $this.getDictOptions('business_nddw'), + bodyType: 'inputNumber', + bodyFillType: 'preFill', + bodyMaxlength: 10 + }, + { + label: '实际目标溶液浓度', + prop: 'actSolutionConcentration', + width: 280, + headerSelectKey: 'actSolutionConcentrationUnit', + fillType: 'preFill', + headerOptions: $this.getDictOptions('business_nddw'), + bodyDisabled: true, + bodyType: 'inputNumber', + bodySubType: 'inputNumber', + bodySubKey: 'actSolutionConcentrationPrecision', + bodyFillType: 'actFill', + bodySubFillType: 'preFill', + showBodySub: $this.fillType === 'preFill', - bodyPrecisionKey: "actSolutionConcentrationPrecision", - bodyMaxlength: 10, - copyFrom: "targetSolutionConcentration",//复制哪个字段 - bodySubPlaceholder: "请输入保留小数位数", - }, - { - label: "预设目标溶液体积", - prop: "targetSolutionVolume", - width: 280, - headerSelectKey: "targetSolutionVolumeUnit", - fillType: "preFill", - headerOptions: $this.getDictOptions('business_tjdw'), - bodyType: "inputNumber", - bodyFillType: "preFill", - bodyMaxlength: 10, - }, - { - label: "实际目标溶液体积", - prop: "actSolutionVolume", - width: 280, - headerSelectKey: "actSolutionVolumeUnit", - fillType: "preFill", - headerOptions: $this.getDictOptions('business_tjdw'), - bodyDisabled: true, - bodyType: "inputNumber", - bodySubType: "inputNumber", - bodySubKey: "actSolutionVolumePrecision", - bodyFillType: "actFill", - bodySubFillType: "preFill", - showBodySub: $this.fillType === "preFill", + bodyPrecisionKey: 'actSolutionConcentrationPrecision', + bodyMaxlength: 10, + copyFrom: 'targetSolutionConcentration', //复制哪个字段 + bodySubPlaceholder: '请输入保留小数位数' + }, + { + label: '预设目标溶液体积', + prop: 'targetSolutionVolume', + width: 280, + headerSelectKey: 'targetSolutionVolumeUnit', + fillType: 'preFill', + headerOptions: $this.getDictOptions('business_tjdw'), + bodyType: 'inputNumber', + bodyFillType: 'preFill', + bodyMaxlength: 10 + }, + { + label: '实际目标溶液体积', + prop: 'actSolutionVolume', + width: 280, + headerSelectKey: 'actSolutionVolumeUnit', + fillType: 'preFill', + headerOptions: $this.getDictOptions('business_tjdw'), + bodyDisabled: true, + bodyType: 'inputNumber', + bodySubType: 'inputNumber', + bodySubKey: 'actSolutionVolumePrecision', + bodyFillType: 'actFill', + bodySubFillType: 'preFill', + showBodySub: $this.fillType === 'preFill', - bodyPrecisionKey: "actSolutionVolumePrecision", - bodyMaxlength: 10, - copyFrom: "targetSolutionVolume",//复制哪个字段 - bodySubPlaceholder: "请输入保留小数位数", - }, - ] + bodyPrecisionKey: 'actSolutionVolumePrecision', + bodyMaxlength: 10, + copyFrom: 'targetSolutionVolume', //复制哪个字段 + bodySubPlaceholder: '请输入保留小数位数' + } + ] } // 平行配置表格列配置 export const getParallelColumnsConfig = ($this) => { - return [ - { - label: "目标溶液编号", - prop: "targetSolutionCode", - bodyType: "select", - bodyOptions: $this.getDictOptions('business_jmdyzqdyp'), - subType: "span", - subKey: "subTargetSolutionCode", - bodyFillType: "preFill", - width: 280 - }, - { - label: "预设目标溶液浓度", - prop: "targetSolutionConcentration", - width: 280, - headerSelectKey: "targetSolutionConcentrationUnit", - fillType: "preFill", - headerOptions: $this.getDictOptions('business_nddw'), - bodyType: "inputNumber", - bodyFillType: "preFill", - bodyMaxlength: 10, - }, - { - label: "实际目标溶液浓度", - prop: "actSolutionConcentration", - width: 280, - headerSelectKey: "actSolutionConcentrationUnit", - fillType: "preFill", - headerOptions: $this.getDictOptions('business_nddw'), - bodyDisabled: true, - bodyType: "inputNumber", - bodySubType: "inputNumber", - bodySubKey: "actSolutionConcentrationPrecision", - bodyFillType: "actFill", - bodySubFillType: "preFill", - showBodySub: $this.fillType === "preFill", - bodyPrecisionKey: "actSolutionConcentrationPrecision", - bodyMaxlength: 10, - copyFrom: "targetSolutionConcentration",//复制哪个字段 - bodySubPlaceholder: "请输入保留小数位数", - }, - { - label: "预设目标溶液体积", - prop: "targetSolutionVolume", - width: 280, - headerSelectKey: "targetSolutionVolumeUnit", - fillType: "preFill", - headerOptions: $this.getDictOptions('business_tjdw'), - bodyType: "inputNumber", - bodyFillType: "preFill", - bodyMaxlength: 10, - }, - { - label: "实际目标溶液体积", - prop: "actSolutionVolume", - width: 280, - headerSelectKey: "actSolutionVolumeUnit", - fillType: "preFill", - headerOptions: $this.getDictOptions('business_tjdw'), - bodyDisabled: true, - bodyType: "inputNumber", - bodySubType: "inputNumber", - bodySubKey: "actSolutionVolumePrecision", - bodyFillType: "actFill", - bodySubFillType: "preFill", - showBodySub: $this.fillType === "preFill", + return [ + { + label: '目标溶液编号', + prop: 'targetSolutionCode', + bodyType: 'select', + bodyOptions: $this.getDictOptions('business_sp_jmdyzqdyp'), + subType: 'span', + subKey: 'subTargetSolutionCode', + bodyFillType: 'preFill', + width: 280 + }, + { + label: '预设目标溶液浓度', + prop: 'targetSolutionConcentration', + width: 280, + headerSelectKey: 'targetSolutionConcentrationUnit', + fillType: 'preFill', + headerOptions: $this.getDictOptions('business_nddw'), + bodyType: 'inputNumber', + bodyFillType: 'preFill', + bodyMaxlength: 10 + }, + { + label: '实际目标溶液浓度', + prop: 'actSolutionConcentration', + width: 280, + headerSelectKey: 'actSolutionConcentrationUnit', + fillType: 'preFill', + headerOptions: $this.getDictOptions('business_nddw'), + bodyDisabled: true, + bodyType: 'inputNumber', + bodySubType: 'inputNumber', + bodySubKey: 'actSolutionConcentrationPrecision', + bodyFillType: 'actFill', + bodySubFillType: 'preFill', + showBodySub: $this.fillType === 'preFill', + bodyPrecisionKey: 'actSolutionConcentrationPrecision', + bodyMaxlength: 10, + copyFrom: 'targetSolutionConcentration', //复制哪个字段 + bodySubPlaceholder: '请输入保留小数位数' + }, + { + label: '预设目标溶液体积', + prop: 'targetSolutionVolume', + width: 280, + headerSelectKey: 'targetSolutionVolumeUnit', + fillType: 'preFill', + headerOptions: $this.getDictOptions('business_tjdw'), + bodyType: 'inputNumber', + bodyFillType: 'preFill', + bodyMaxlength: 10 + }, + { + label: '实际目标溶液体积', + prop: 'actSolutionVolume', + width: 280, + headerSelectKey: 'actSolutionVolumeUnit', + fillType: 'preFill', + headerOptions: $this.getDictOptions('business_tjdw'), + bodyDisabled: true, + bodyType: 'inputNumber', + bodySubType: 'inputNumber', + bodySubKey: 'actSolutionVolumePrecision', + bodyFillType: 'actFill', + bodySubFillType: 'preFill', + showBodySub: $this.fillType === 'preFill', - bodyPrecisionKey: "actSolutionVolumePrecision", - bodyMaxlength: 10, - copyFrom: "targetSolutionVolume",//复制哪个字段 - bodySubPlaceholder: "请输入保留小数位数", - }, - { - label: "目标溶液有效周期", - prop: "targetSolutionCycle", - width: 280, - fillType: "preFill", - bodyType: "inputNumber", - bodySubType: "select", - showBodySub:true, - bodySubKey: "targetSolutionCyclePrecision", - bodySubOptions: $this.getDictOptions('business_yxqdw'), - bodyFillType: "preFill", - bodySubFillType: "preFill", - bodyMaxlength: 10, - }, - { - label: "目标溶液失效日", - prop: "targetSolutionExpirationDate", - width: 280, - bodyType: "span", - }, - { - label: "预设原始溶液编号", - prop: "startSolutionCode", - width: 280, - bodyType: "input", - bodyFillType: "preFill", - }, - { - label: "实际原始溶液编号", - prop: "actStartSolutionCode", - width: 280, - bodyType: "clickable", - bodyFillType: "actFill", - }, - { - label: "预设原始溶液浓度", - prop: "targetStartSolutionConcentration", - width: 280, - bodyType: "inputNumber", - bodyFillType: "preFill", - bodySubType: "select", - bodySubKey: "targetStartSolutionConcentrationPrecision", - bodySubOptions: $this.getDictOptions('business_nddw'), - bodySubFillType: "preFill", - bodyMaxlength: 10, - showBodySub:true, - }, - { - label: "实际原始溶液浓度", - prop: "targetAcSolution", - width: 280, - bodyType: "inputNumber", - bodyFillType: "actFill", - bodyDisabled: true, - }, - { - label: "预设原始溶液体积", - prop: "targetStartSolutionVolume", - headerSelectKey: "targetStartSolutionVolumeUnit", - fillType: "preFill", - headerOptions: $this.getDictOptions('business_tjdw'), - width: 280, - bodyType: "inputNumber", - bodyFillType: "preFill", - bodySubType: "inputNumber", - bodySubKey: "targetStartSolutionVolumePrecision", - bodySubFillType: "preFill", - bodyMaxlength: 10, - bodyPrecisionKey: "targetStartSolutionVolumePrecision", - bodyMaxlength: 10, - bodySubPlaceholder: "请输入保留小数位数", - bodyDisabled: true, - showBodySub:true, - showBodySub: $this.fillType === "preFill", - }, + bodyPrecisionKey: 'actSolutionVolumePrecision', + bodyMaxlength: 10, + copyFrom: 'targetSolutionVolume', //复制哪个字段 + bodySubPlaceholder: '请输入保留小数位数' + }, + { + label: '目标溶液有效周期', + prop: 'targetSolutionCycle', + width: 280, + fillType: 'preFill', + bodyType: 'inputNumber', + bodySubType: 'select', + showBodySub: true, + bodySubKey: 'targetSolutionCyclePrecision', + bodySubOptions: $this.getDictOptions('business_yxqdw'), + bodyFillType: 'preFill', + bodySubFillType: 'preFill', + bodyMaxlength: 10 + }, + { + label: '目标溶液失效日', + prop: 'targetSolutionExpirationDate', + width: 280, + bodyType: 'span' + }, + { + label: '预设原始溶液编号', + prop: 'startSolutionCode', + width: 280, + bodyType: 'input', + bodyFillType: 'preFill' + }, + { + label: '实际原始溶液编号', + prop: 'actStartSolutionCode', + width: 280, + bodyType: 'clickable', + bodyFillType: 'actFill' + }, + { + label: '预设原始溶液浓度', + prop: 'targetStartSolutionConcentration', + width: 280, + bodyType: 'inputNumber', + bodyFillType: 'preFill', + bodySubType: 'select', + bodySubKey: 'targetStartSolutionConcentrationPrecision', + bodySubOptions: $this.getDictOptions('business_nddw'), + bodySubFillType: 'preFill', + bodyMaxlength: 10, + showBodySub: true + }, + { + label: '实际原始溶液浓度', + prop: 'targetAcSolution', + width: 280, + bodyType: 'inputNumber', + bodyFillType: 'actFill', + bodyDisabled: true + }, + { + label: '预设原始溶液体积', + prop: 'targetStartSolutionVolume', + headerSelectKey: 'targetStartSolutionVolumeUnit', + fillType: 'preFill', + headerOptions: $this.getDictOptions('business_tjdw'), + width: 280, + bodyType: 'inputNumber', + bodyFillType: 'preFill', + bodySubType: 'inputNumber', + bodySubKey: 'targetStartSolutionVolumePrecision', + bodySubFillType: 'preFill', + bodyMaxlength: 10, + bodyPrecisionKey: 'targetStartSolutionVolumePrecision', + bodyMaxlength: 10, + bodySubPlaceholder: '请输入保留小数位数', + bodyDisabled: true, + showBodySub: true, + showBodySub: $this.fillType === 'preFill' + }, - { - label: "实际原始溶液体积", - prop: "actStartSolutionVolume", - headerSelectKey: "actStartSolutionVolumeUnit", - fillType: "preFill", - headerOptions: $this.getDictOptions('business_tjdw'), - width: 280, - bodyType: "inputNumber", - bodyFillType: "actFill", - bodyMaxlength: 10, - }, + { + label: '实际原始溶液体积', + prop: 'actStartSolutionVolume', + headerSelectKey: 'actStartSolutionVolumeUnit', + fillType: 'preFill', + headerOptions: $this.getDictOptions('business_tjdw'), + width: 280, + bodyType: 'inputNumber', + bodyFillType: 'actFill', + bodyMaxlength: 10 + }, - { - label: "预计稀释液体积", - prop: "targetDiluentVolume", - headerSelectKey: "preDiluentVolumeUnit", - fillType: "preFill", - headerOptions: $this.getDictOptions('business_tjdw'), - width: 280, - bodyType: "inputNumber", - bodyFillType: "preFill", - bodySubType: "inputNumber", - bodySubKey: "targetDiluentVolumePrecision", - bodySubFillType: "preFill", - bodyMaxlength: 10, - bodyPrecisionKey: "targetDiluentVolumePrecision", - bodySubPlaceholder: "请输入保留小数位数", - bodyDisabled: true, - showBodySub: $this.fillType === "preFill", - }, - { - label: "实际稀释液体积", - prop: "actDiluentVolume", - headerSelectKey: "actDiluentVolumeUnit", - fillType: "preFill", - headerOptions: $this.getDictOptions('business_tjdw'), - width: 280, - bodyType: "inputNumber", - bodyFillType: "actFill", - bodyMaxlength: 10, - }, - ] + { + label: '预计稀释液体积', + prop: 'targetDiluentVolume', + headerSelectKey: 'preDiluentVolumeUnit', + fillType: 'preFill', + headerOptions: $this.getDictOptions('business_tjdw'), + width: 280, + bodyType: 'inputNumber', + bodyFillType: 'preFill', + bodySubType: 'inputNumber', + bodySubKey: 'targetDiluentVolumePrecision', + bodySubFillType: 'preFill', + bodyMaxlength: 10, + bodyPrecisionKey: 'targetDiluentVolumePrecision', + bodySubPlaceholder: '请输入保留小数位数', + bodyDisabled: true, + showBodySub: $this.fillType === 'preFill' + }, + { + label: '实际稀释液体积', + prop: 'actDiluentVolume', + headerSelectKey: 'actDiluentVolumeUnit', + fillType: 'preFill', + headerOptions: $this.getDictOptions('business_tjdw'), + width: 280, + bodyType: 'inputNumber', + bodyFillType: 'actFill', + bodyMaxlength: 10 + } + ] } //阶梯配置 export const getLadderFormConfig = ($this) => { - return [ - { - type: "step", - config: { - startSolution: { - label: "起始源溶液", - type: "input", - fillType: "preFill", - subType: "clickable", - subKey: "subStartSolution", - subFillType: "actFill", - maxlength: 20, - }, - targetStartSolution: { - label: "预设起始源溶液浓度", - type: "inputNumber", - subType: "select", - fillType: "preFill", - subOptions: $this.getDictOptions('business_nddw'), - subKey: "subTargetStartSolution", - maxlength: 10, - }, - targetAcSolution: { - label: "实际起始源溶液浓度", - type: "input", - fillType: "actFill", - disabled: true, - maxlength: 10, - }, - solution: { - label: "稀释液", - type: "input", - fillType: "preFill", - subType: "clickable", - subKey: "subSolution", - subFillType: "actFill", - maxlength: 20, - }, - stepStorageCondition: { - label: "存储条件", - type: "select", - fillType: "preFill", - options: $this.getDictOptions('business_cctj'), - otherCode: "stepStorageConditionOther", - }, + return [ + { + type: 'step', + config: { + startSolution: { + label: '起始源溶液', + type: 'input', + fillType: 'preFill', + subType: 'clickable', + subKey: 'subStartSolution', + subFillType: 'actFill', + maxlength: 20 + }, + targetStartSolution: { + label: '预设起始源溶液浓度', + type: 'inputNumber', + subType: 'select', + fillType: 'preFill', + subOptions: $this.getDictOptions('business_nddw'), + subKey: 'subTargetStartSolution', + maxlength: 10 + }, + targetAcSolution: { + label: '实际起始源溶液浓度', + type: 'input', + fillType: 'actFill', + disabled: true, + maxlength: 10 + }, + solution: { + label: '稀释液', + type: 'input', + fillType: 'preFill', + subType: 'clickable', + subKey: 'subSolution', + subFillType: 'actFill', + maxlength: 20 + }, + stepStorageCondition: { + label: '存储条件', + type: 'select', + fillType: 'preFill', + options: $this.getDictOptions('business_cctj'), + otherCode: 'stepStorageConditionOther' + }, - effectivePeriod: { - label: "目标溶液有效周期", - type: "input", - subType: "select", - subKey: "effectivePeriodUnit", - fillType: "preFill", - subOptions: $this.getDictOptions('business_yxqdw'), - }, - expireDate: { - label: "目标溶液失效日", - type: "input", - }, - } + effectivePeriod: { + label: '目标溶液有效周期', + type: 'input', + subType: 'select', + subKey: 'effectivePeriodUnit', + fillType: 'preFill', + subOptions: $this.getDictOptions('business_yxqdw') + }, + expireDate: { + label: '目标溶液失效日', + type: 'input' } - ] + } + } + ] } //试验基本信息 export const getBaseInfoFormConfig = ($this) => { - return [ - { - type: "cardItem", - config: { - studyMc: { - label: "试验名称", - type: "input", - disabled: true, - }, - studySn: { - label: "试验编号", - type: "input", - disabled: true, - }, - methodCode: { - label: "方法编号", - type: "input", - fillType: "preFill", - maxlength: 50, - }, - versionNum: { - label: "版本号", - type: "inputNumber", - fillType: "actFill", - prepend: "V", - maxlength: 50, - }, - - } + return [ + { + type: 'cardItem', + config: { + studyMc: { + label: '试验名称', + type: 'input', + disabled: true }, - { - type: "conditionItem", - label: "试验配制条件", - config: { - pre: { - label: "预填", - type: "select", - multiple: true, - fillType: "preFill", - options: $this.getDictOptions('business_pztj'), - otherCode: "preOther", - }, - act: { - label: "实际", - type: "select", - fillType: "actFill", - otherCode: "actOther", - multiple: true, - options: $this.getDictOptions('business_pztj') - } - } + studySn: { + label: '试验编号', + type: 'input', + disabled: true }, - { - type: "conditionItem", - label: "容器材质", - config: { - containerMaterial: { - label: "容器材质", - type: "select", - options: $this.getDictOptions('business_rqcz'), - fillType: "actFill", - multiple: true, - otherCode: "containerMaterialOther", - } - } + methodCode: { + label: '方法编号', + type: 'input', + fillType: 'preFill', + maxlength: 50 }, - { - type: "cellItem", - label: "处理时间", - config: { - startDate: { - label: "开始时间", - type: "input", - }, - endDate: { - label: "结束时间", - type: "input", - }, - } + versionNum: { + label: '版本号', + type: 'inputNumber', + fillType: 'actFill', + prepend: 'V', + maxlength: 50 + } + } + }, + { + type: 'conditionItem', + label: '试验配制条件', + config: { + pre: { + label: '预填', + type: 'select', + multiple: true, + fillType: 'preFill', + options: $this.getDictOptions('business_pztj'), + otherCode: 'preOther' + }, + act: { + label: '实际', + type: 'select', + fillType: 'actFill', + otherCode: 'actOther', + multiple: true, + options: $this.getDictOptions('business_pztj') + } + } + }, + { + type: 'conditionItem', + label: '容器材质', + config: { + containerMaterial: { + label: '容器材质', + type: 'select', + options: $this.getDictOptions('business_rqcz'), + fillType: 'actFill', + multiple: true, + otherCode: 'containerMaterialOther' } - ] + } + }, + { + type: 'cellItem', + label: '处理时间', + config: { + startDate: { + label: '开始时间', + type: 'input' + }, + endDate: { + label: '结束时间', + type: 'input' + } + } + } + ] } //备注config export const getRemarkFormConfig = () => { - return [ - { - type: "cellItem", - config: { - remark: { - label: "", - type: "textarea", - fillType: "actFill", - span: 1, - placeholder: "请输入备注", - maxlength: 1000, - rows: 5 - } - } + return [ + { + type: 'cellItem', + config: { + remark: { + label: '', + type: 'textarea', + fillType: 'actFill', + span: 1, + placeholder: '请输入备注', + maxlength: 1000, + rows: 5 } - ] + } + } + ] } //存储条件 export const getStorageConditionFormConfig = ($this) => { - return [ - { - type: "conditionItem", - config: { - storageCondition: { - label: "存储条件", - type: "select", - fillType: "preFill", - options: $this.getDictOptions('business_cctj'), - otherCode: "othersSorageCondition", - }, - - } + return [ + { + type: 'conditionItem', + config: { + storageCondition: { + label: '存储条件', + type: 'select', + fillType: 'preFill', + options: $this.getDictOptions('business_cctj'), + otherCode: 'othersSorageCondition' } - ]; + } + } + ] } //并行步骤配置 export const getParalleStepFormConfig = ($this) => { - return [ - { - type: "step", - config: { - solution: { - label: "稀释液", - type: "input", - fillType: "preFill", - subType: "clickable", - subKey: "subSolution", - subFillType: "actFill", - maxlength: 20, - }, - paralleStepStorageCondition: { - label: "存储条件", - type: "select", - fillType: "preFill", - options: $this.getDictOptions('business_cctj'), - otherCode: "paralleStepStorageConditionOther", - }, - } + return [ + { + type: 'step', + config: { + solution: { + label: '稀释液', + type: 'input', + fillType: 'preFill', + subType: 'clickable', + subKey: 'subSolution', + subFillType: 'actFill', + maxlength: 20 + }, + paralleStepStorageCondition: { + label: '存储条件', + type: 'select', + fillType: 'preFill', + options: $this.getDictOptions('business_cctj'), + otherCode: 'paralleStepStorageConditionOther' } - ] + } + } + ] } diff --git a/src/views/business/comps/template/mixins/templateMixin.js b/src/views/business/comps/template/mixins/templateMixin.js index d786f41..e869d92 100644 --- a/src/views/business/comps/template/mixins/templateMixin.js +++ b/src/views/business/comps/template/mixins/templateMixin.js @@ -1,11 +1,19 @@ -import moment from "moment"; +import moment from 'moment' export default { - dicts: ['business_pztj', 'business_cctj', 'business_nddw', 'business_tjdw', 'business_yxqdw', 'business_rqcz', 'business_jmdyzqdyp'], + dicts: [ + 'business_pztj', + 'business_cctj', + 'business_nddw', + 'business_tjdw', + 'business_yxqdw', + 'business_rqcz', + 'business_sp_jmdyzqdyp' + ], props: { templateData: { type: Object, - default: () => { }, - }, + default: () => {} + } }, watch: { templateData: { @@ -14,23 +22,48 @@ export default { handler(v) { if (v) { const { - studyMc,studySn,templateMc,templateMcEn,templateSn,startDate,endDate, - } = v; - if (v.resource) {//试验试剂信息 - this.resource = JSON.parse(v.resource); + studyMc, + studySn, + templateMc, + templateMcEn, + templateSn, + startDate, + endDate + } = v + if (v.resource) { + //试验试剂信息 + this.resource = JSON.parse(v.resource) } if (v.bdnr) { - this.formData = { ...JSON.parse(v.bdnr), studyMc,studySn,templateMc,templateMcEn,templateSn,startDate,endDate, }; + this.formData = { + ...JSON.parse(v.bdnr), + studyMc, + studySn, + templateMc, + templateMcEn, + templateSn, + startDate, + endDate + } } - const { effectivePeriod, effectivePeriodUnit, expireDate } = this.formData; + const { effectivePeriod, effectivePeriodUnit, expireDate } = + this.formData //实际填报的时候,如果有了开始时间,并且有有效周期,但是没有失效日,就计算失效日为开始时间+有效周期 - if (startDate && this.fillType === "actFill" && effectivePeriod && effectivePeriodUnit && !expireDate) { - const start = moment(startDate); - const end = start.add(Number(effectivePeriod), effectivePeriodUnit).format("YYYY-MM-DD HH:mm:ss"); - this.formData = { ...this.formData, expireDate: end }; + if ( + startDate && + this.fillType === 'actFill' && + effectivePeriod && + effectivePeriodUnit && + !expireDate + ) { + const start = moment(startDate) + const end = start + .add(Number(effectivePeriod), effectivePeriodUnit) + .format('YYYY-MM-DD HH:mm:ss') + this.formData = { ...this.formData, expireDate: end } } - console.log(this.formData, "formData from templateData") - this.setTemplateData(v); + console.log(this.formData, 'formData from templateData') + this.setTemplateData(v) } } } @@ -39,72 +72,71 @@ export default { return { formData: {}, templateDetail: {}, - resource: [],//试验试剂信息 + resource: [], //试验试剂信息 sysjColumns: [ - { label: "试剂名称", prop: "reagentName" }, - { label: "编号", prop: "reagentCode" }, - { label: "批号", prop: "reagentNo" }, - { label: "浓度/含量/纯度", prop: "concentration" }, - { label: "来源", prop: "source" }, - { label: "失效日", prop: "expireDate" }, + { label: '试剂名称', prop: 'reagentName' }, + { label: '编号', prop: 'reagentCode' }, + { label: '批号', prop: 'reagentNo' }, + { label: '浓度/含量/纯度', prop: 'concentration' }, + { label: '来源', prop: 'source' }, + { label: '失效日', prop: 'expireDate' } ], yqsColumns: [ - { label: "仪器名称", prop: "instrumentName" }, - { label: "仪器型号", prop: "instrumentModel" }, - { label: "仪器编号", prop: "instrumentCode" }, - { label: "下次测试/校准/检定日期", prop: "nextTestDate" }, + { label: '仪器名称', prop: 'instrumentName' }, + { label: '仪器型号', prop: 'instrumentModel' }, + { label: '仪器编号', prop: 'instrumentCode' }, + { label: '下次测试/校准/检定日期', prop: 'nextTestDate' } ] } }, - mounted() { - }, + mounted() {}, unmounted() { - this.setTemplateData({}); + this.setTemplateData({}) }, methods: { getResource() { - return this.resource; + return this.resource }, //根据ref数组获取直接formData getFilledFormDataByRefs(refArr = []) { - let result = {}; - refArr.map(ref => { - const refData = this.$refs[ref]?.getFilledFormData() || {}; - result = { ...result, ...refData }; - }); - return result; + let result = {} + refArr.map((ref) => { + const refData = this.$refs[ref]?.getFilledFormData() || {} + result = { ...result, ...refData } + }) + return result }, //统一校验form表单是否填写 async validFormFields(refArr = []) { - let result = {}; - const refs = refArr.map(ref => { - let refData = {}; + let result = {} + const refs = refArr.map((ref) => { + let refData = {} if (this.$refs[ref][0]) { - refData = this.$refs[ref][0]?.getFormData() || {}; + refData = this.$refs[ref][0]?.getFormData() || {} } else { - refData = this.$refs[ref]?.getFormData() || {}; + refData = this.$refs[ref]?.getFormData() || {} } - return refData; - }); - const validFormData = await Promise.all(refs).catch(err => { + return refData + }) + const validFormData = await Promise.all(refs).catch((err) => { // this.$message.error(err); - if (err.errorType && err.errorType === "step") { - this.$message.error("请添加步骤"); + if (err.errorType && err.errorType === 'step') { + this.$message.error('请添加步骤') return } - this.$message.error("表单内容未填完,请填写后再提交"); - }); + this.$message.error('表单内容未填完,请填写后再提交') + }) if (validFormData) { - validFormData.forEach(item => { + validFormData.forEach((item) => { result = { ...result, ...item } }) - return result; + return result } - return false; + return false }, //试验配制条件options getDictOptions(dictType) { - return this.dict.type[dictType] || []; + return this.dict.type[dictType] || [] }, setTemplateData(data) { @@ -112,41 +144,67 @@ export default { }, //统一处理删除行 deleteRow(index) { - this.$refs.stepTableRef.deleteRow(index); + this.$refs.stepTableRef.deleteRow(index) }, //统一处理blur事件,因为有效周期和过期日期是相关的,所以需要在有效周期失焦时更新过期日期 onHandleBlur(fields) { - const { key, effectivePeriodUnit, effectivePeriod, codeSTD, targetStartSolution } = fields; - const { startDate } = this.formData; - if (key === "codeSTD") {//起始编号STD失焦时,更新stepDataSource + const { + key, + effectivePeriodUnit, + effectivePeriod, + codeSTD, + targetStartSolution + } = fields + const { startDate } = this.formData + if (key === 'codeSTD') { + //起始编号STD失焦时,更新stepDataSource const arr = Array.from({ length: codeSTD }, (item, index) => ({ - actSolutionVolumePrecision: 3,//小数点精度默认为3 - actSolutionConcentrationPrecision: 3,//小数点精度默认为3 - targetDiluentVolumePrecision: 3,//小数点精度默认为3 - targetStartSolutionVolumePrecision: 3,//小数点精度默认为3 + actSolutionVolumePrecision: 3, //小数点精度默认为3 + actSolutionConcentrationPrecision: 3, //小数点精度默认为3 + targetDiluentVolumePrecision: 3, //小数点精度默认为3 + targetStartSolutionVolumePrecision: 3, //小数点精度默认为3 targetSolutionCode: `STD${Number(codeSTD) - index}` - })); - this.$refs.stepTableRef.updateDataSource(arr); - } else if (key === "targetStartSolution") {//起始溶液体积失焦时,更新目标溶液预计浓度 - const arr = this.$refs.stepTableRef?.getDataSource(); + })) + this.$refs.stepTableRef.updateDataSource(arr) + } else if (key === 'targetStartSolution') { + //起始溶液体积失焦时,更新目标溶液预计浓度 + const arr = this.$refs.stepTableRef?.getDataSource() arr.forEach((item, rowIndex) => { - this.updateTargetStartSolutionVolume(rowIndex, item, targetStartSolution); + this.updateTargetStartSolutionVolume( + rowIndex, + item, + targetStartSolution + ) }) } }, //统一处理table失焦事件 onHandleTableBlur(params) { - const { rowIndex, colKey, value, item } = params; - if (colKey === "targetSolutionVolume" || colKey === "targetSolutionConcentration" || colKey === "targetStartSolutionVolumePrecision" || colKey === "targetDiluentVolumePrecision") { - const volume = this.$refs.stepFormPackageRef?.getFormDataByKey("targetStartSolution") || 0; + const { rowIndex, colKey, value, item } = params + if ( + colKey === 'targetSolutionVolume' || + colKey === 'targetSolutionConcentration' || + colKey === 'targetStartSolutionVolumePrecision' || + colKey === 'targetDiluentVolumePrecision' + ) { + const volume = + this.$refs.stepFormPackageRef?.getFormDataByKey( + 'targetStartSolution' + ) || 0 if (volume) { - this.updateTargetStartSolutionVolume(item, volume); + this.updateTargetStartSolutionVolume(item, volume) } - } else if (colKey === "actStartSolutionVolume" || colKey === "actDiluentVolume") {//实际起始溶液体积和实际目标溶液体积 - const targetAcSolution = this.$refs.stepFormPackageRef?.getFormDataByKey("targetAcSolution") || 0;//获取实际起始溶液浓度 + } else if ( + colKey === 'actStartSolutionVolume' || + colKey === 'actDiluentVolume' + ) { + //实际起始溶液体积和实际目标溶液体积 + const targetAcSolution = + this.$refs.stepFormPackageRef?.getFormDataByKey('targetAcSolution') || + 0 //获取实际起始溶液浓度 if (targetAcSolution) { - this.updateSjmbrynd(item, targetAcSolution); + this.updateSjmbrynd(item, targetAcSolution) } } }, @@ -154,37 +212,43 @@ export default { //计算并更新实际目标溶液浓度 先计算实际目标溶液体积再计算实际目标溶液浓度 updateSjmbrynd(item, targetAcSolution) { //实际源溶液浓度÷(实际终体积÷源溶液加入体积); - const precision = item.actSolutionConcentrationPrecision || 0; - const volPrecision = item.actSolutionVolumePrecision || 0; + const precision = item.actSolutionConcentrationPrecision || 0 + const volPrecision = item.actSolutionVolumePrecision || 0 //实际稀释液体积 - const actDiluentVolume = item.actDiluentVolume || 0; - const actStartSolutionVolume = item.actStartSolutionVolume || 0; + const actDiluentVolume = item.actDiluentVolume || 0 + const actStartSolutionVolume = item.actStartSolutionVolume || 0 //实际高源溶液加入体积+实际稀释液加入体积 - const actVol = (Number(actStartSolutionVolume) + Number(actDiluentVolume)).toFixed(volPrecision); + const actVol = ( + Number(actStartSolutionVolume) + Number(actDiluentVolume) + ).toFixed(volPrecision) //实际目标溶液体积 - item.actSolutionVolume = actVol; + item.actSolutionVolume = actVol //实际目标溶液浓度 - const actNd = (targetAcSolution / actStartSolutionVolume / actVol).toFixed(precision); - item.actSolutionConcentration = actNd; + const actNd = ( + targetAcSolution / + actStartSolutionVolume / + actVol + ).toFixed(precision) + item.actSolutionConcentration = actNd }, //更新起始溶液体积时,计算目标溶液预计浓度 updateTargetStartSolutionVolume(item, volume) { - const precision = item.targetStartSolutionVolumePrecision || 0; - const concentration = item.targetSolutionConcentration || 0; - const targetVolume = item.targetSolutionVolume || 0; + const precision = item.targetStartSolutionVolumePrecision || 0 + const concentration = item.targetSolutionConcentration || 0 + const targetVolume = item.targetSolutionVolume || 0 //目标溶液预计浓度:(目标溶液预计体积 乘以 起始溶液浓度)除以 起始溶液体积 - const result = ((concentration * targetVolume) / volume).toFixed(precision); - item.targetStartSolutionVolume = result; + const result = ((concentration * targetVolume) / volume).toFixed( + precision + ) + item.targetStartSolutionVolume = result // this.$refs.stepTableRef.updateDataSourceByRowIndex(rowIndex, { targetStartSolutionVolume: result }); if (targetVolume) { //预设稀释液体积:目标溶液预计体积 减去 源溶液预计体积; - const precision1 = item.targetDiluentVolumePrecision || 0; - const result1 = (targetVolume - result).toFixed(precision1); - item.targetDiluentVolume = result1; + const precision1 = item.targetDiluentVolumePrecision || 0 + const result1 = (targetVolume - result).toFixed(precision1) + item.targetDiluentVolume = result1 // this.$refs.stepTableRef.updateDataSourceByRowIndex(rowIndex, { targetDiluentVolume: result1 }); } } - - }, - + } }