From 58d008d5263bf74bcce2a754f1c4f9204319dd9e Mon Sep 17 00:00:00 2001 From: "15881625488@163.com" <15881625488@163.com> Date: Mon, 19 Jan 2026 16:23:57 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A[=E6=A8=A1=E6=9D=BF=E7=AE=A1?= =?UTF-8?q?=E7=90=86]=E8=89=B2=E8=B0=B1=E7=AC=AC=E4=BA=8C=E4=B8=AA?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../comps/template/comps/sp/SWYPFXCBYPZB.vue | 185 ++++++++++++++------- .../comps/template/comps/sp/SWYPFXRYPZB.vue | 1 - src/views/business/study/comp/tbbd/Fh.vue | 1 + src/views/business/study/comp/tbbd/Xq.vue | 10 +- 4 files changed, 130 insertions(+), 67 deletions(-) diff --git a/src/views/business/comps/template/comps/sp/SWYPFXCBYPZB.vue b/src/views/business/comps/template/comps/sp/SWYPFXCBYPZB.vue index ccd0d99..654920b 100644 --- a/src/views/business/comps/template/comps/sp/SWYPFXCBYPZB.vue +++ b/src/views/business/comps/template/comps/sp/SWYPFXCBYPZB.vue @@ -1,29 +1,32 @@ - + @@ -33,11 +36,12 @@ import LineLabel from "@/components/Template/LineLabel"; import TableList from "@/components/Template/Table"; import Step from "@/components/Template/Step"; import templateMixin from "../../mixins/templateMixin"; - +import CustomTable from '@/components/Template/CustomTable.vue'; +import { getLatestSn } from '@/api/template'; export default { - name: "SWYPFXRYPZB", - components: { BaseInfoFormPcakge, LineLabel, TableList, Step }, + name: "SWYPFXCBYPZB", + components: { BaseInfoFormPcakge, LineLabel, TableList, Step, CustomTable }, mixins: [templateMixin], props: { fillType: { @@ -52,10 +56,10 @@ export default { type: "conditionItem", config: { storageCondition: { - label: "存储条件", + label: 'template.common.storageConditionLabel', type: "select", fillType: "preFill", - options: this.getDictOptions('business_cctj'), + options: this.getDictOptions("business_cctj"), otherCode: "storageConditionOther", }, @@ -73,7 +77,7 @@ export default { type: "textarea", fillType: "actFill", span: 1, - placeholder: "请输入备注", + placeholder: 'template.common.remarkPlaceholder', maxlength: 1000, rows: 5 } @@ -81,40 +85,43 @@ export default { } ] }, + baseInfoFormConfig() { return [ { type: "cardItem", config: { studyMc: { - label: "试验名称", + label: 'template.common.testName', type: "input", disabled: true, }, studySn: { - label: "试验编号", + label: 'template.common.testNumber', type: "input", disabled: true, }, methodCode: { - label: "方法编号", + label: 'template.common.methodCode', type: "input", fillType: "preFill", + maxlength: 50 }, versionNum: { - label: "版本号", + label: 'template.common.versionNumber', type: "input", - fillType: "actFill" + fillType: "actFill", + maxlength: 50 }, } }, { type: "conditionItem", - label: "试验配制条件", + label: 'template.common.testConfigurationConditions', config: { pre: { - label: "预填", + label: 'template.common.preFill', type: "select", multiple: true, fillType: "preFill", @@ -122,25 +129,25 @@ export default { otherCode: "preOther", }, act: { - label: "实际", + label: 'template.common.actualFill', type: "select", fillType: "actFill", otherCode: "actOther", multiple: true, - options: this.getDictOptions('business_pztj'), + options: this.getDictOptions('business_pztj') } } }, { type: "cellItem", - label: "配置时间", + label: 'template.common.configurationTime', config: { startDate: { - label: "开始时间", + label: 'template.common.startTime', type: "input", }, endDate: { - label: "结束时间", + label: 'template.common.endTime', type: "input", }, } @@ -153,63 +160,72 @@ export default { type: "step", config: { targetName: { - label: "目标溶液名称", + label: 'template.common.targetSolutionName', type: "input", fillType: "preFill", + maxlength: 50 }, targetCode: { - label: "目标溶液编号", + label: 'template.common.targetSolutionCode', type: "input", subType: "span", fillType: "preFill", - subKey: "targetCode1", + subKey: "targetCodeSn", + maxlength: 20 }, targetPreConcentration: { - label: "目标溶液预计浓度", - type: "input", + label: 'template.common.targetPreConcentration', + type: "inputNumber", subType: "select", subKey: "targetPreConcentrationUnit", fillType: "preFill", subOptions: this.getDictOptions('business_nddw'), + maxlength: 10 }, targetActConcentration: { - label: "目标溶液实际浓度", - type: "input", + label: 'template.common.targetActConcentration', + type: "inputNumber", subType: "select", subKey: "targetActConcentrationUnit", + compareTo: "targetPreConcentration",//与哪个字段比较 fillType: "actFill", subFillType: "preFill", subOptions: this.getDictOptions('business_nddw'), copyFrom: "targetPreConcentration",//复制哪个字段 + maxlength: 10 }, targetPreVolume: { - label: "目标溶液预计体积", - type: "input", + label: 'template.common.targetPreVolume', + type: "inputNumber", subType: "select", subKey: "targetPreVolumeUnit", subOptions: this.getDictOptions('business_tjdw'), fillType: "preFill", + maxlength: 10 }, targetActVolume: { - label: "目标溶液实际体积", - type: "input", + label: 'template.common.targetActVolume', + type: "inputNumber", subType: "select", subKey: "targetActVolumeUnit", fillType: "actFill", subFillType: "preFill", subOptions: this.getDictOptions('business_tjdw'), + compareTo: "targetPreVolume",//与哪个字段比较 copyFrom: "targetPreVolume",//复制哪个字段 + maxlength: 10 }, effectivePeriod: { - label: "有效周期", - type: "input", + label: 'template.common.effectivePeriod', + type: "inputNumber", subType: "select", subKey: "effectivePeriodUnit", fillType: "preFill", subOptions: this.getDictOptions('business_yxqdw'), + maxlength: 10 }, expireDate: { - label: "失效日", + label: 'template.common.expireDate', type: "input", }, } @@ -219,37 +235,84 @@ export default { }, data() { return { - dataSource: [], + resource: [], + resourceData1: [], sysjColumns: [ - { label: "试剂名称", prop: "reagentName" }, - { label: "编号", prop: "reagentCode" }, - { label: "批号", prop: "reagentNo" }, - { label: "浓度/含量/纯度", prop: "concentration" }, - { label: "来源", prop: "source" }, - { label: "失效日", prop: "expireDate" }, + { label: 'template.common.reagentName', prop: "mc" },//名称 + { label: 'template.common.reagentCode', prop: "bh" },//编号 + { label: 'template.common.reagentNo', prop: "ph" },//批号 试剂,供试品才有 + { label: 'template.common.concentration', prop: "nd" },//浓度 + { label: 'template.common.source', prop: "source" },//来源 + { label: 'template.common.reagentExpireDate', prop: "sxrq" },//失效日期 ], yqsColumns: [ - { label: "仪器名称", prop: "instrumentName" }, - { label: "仪器型号", prop: "instrumentModel" }, - { label: "仪器编号", prop: "instrumentCode" }, - { label: "下次测试/校准/检定日期", prop: "nextTestDate" }, + { label: 'template.common.instrumentName', prop: "instrumentName" }, + { label: 'template.common.instrumentModel', prop: "instrumentModel" }, + { label: 'template.common.instrumentCode', prop: "instrumentCode" }, + { label: 'template.common.nextTestDate', prop: "nextTestDate" }, ], - - formData: {} }; }, mounted() { }, + watch: { + formData: { + immediate: true, + handler(v) { + if(!v.targetCodeSn && this.fillType === "actFill"){ + this.getCode(); + } + } + } + }, methods: { + //获取目标溶液编号 + async getCode(){ + const result = await getLatestSn({ + count: 1, + }) + if(result.code == 200){ + this.$refs.stepFormPackageRef.updateFormData("targetCodeSn",result.data) + } + }, + //获取已填写的表单数据 + getFilledFormData(){ + return this.getFilledFormDataByRefs(["baseInfoRef", "storageConditionRef", "stepFormPackageRef", "stepRef", "remarkRef"]) + }, async getFormData() { - return await this.validFormFields(["baseInfoRef", "storageConditionRef","stepFormPackageRef","stepRef","remarkRef"]); + let content = await this.validFormFields(["baseInfoRef", "storageConditionRef", "stepFormPackageRef", "stepRef", "remarkRef"]); + //生成resource + let tmpResource = [] + //配置的试剂 + tmpResource.push({ + mc: content.targetName, + bh: content.targetCode+content.targetCodeSn, + ph: '', + nd: content.targetActConcentration + content.targetActConcentrationUnit, + source: 'ELN配制', + sxrq: content.expireDate, + ndz: content.targetActConcentration, + nddw: content.targetActConcentrationUnit, + kc: content.targetActVolume, + kcdw: content.targetActVolumeUnit, + syl: null, + syldw:content.targetActVolumeUnit, + yxzq:content.effectivePeriod, + yxzqdw:content.effectivePeriodUnit, + }) + //使用的试剂 + this.resource=tmpResource + + return content; }, async onSave() { - const formData = await this.getFormData(); + const formData = await this.getFilledFormData(); + console.log(formData, "formData") - } + }, + } }; diff --git a/src/views/business/comps/template/comps/sp/SWYPFXRYPZB.vue b/src/views/business/comps/template/comps/sp/SWYPFXRYPZB.vue index 2e6582b..e9bc898 100644 --- a/src/views/business/comps/template/comps/sp/SWYPFXRYPZB.vue +++ b/src/views/business/comps/template/comps/sp/SWYPFXRYPZB.vue @@ -285,7 +285,6 @@ export default { let content = await this.validFormFields(["baseInfoRef", "storageConditionRef", "stepFormPackageRef", "stepRef", "remarkRef"]); //生成resource let tmpResource = [] - debugger //配置的试剂 tmpResource.push({ mc: content.targetName, diff --git a/src/views/business/study/comp/tbbd/Fh.vue b/src/views/business/study/comp/tbbd/Fh.vue index 5e838e4..a2ea62e 100644 --- a/src/views/business/study/comp/tbbd/Fh.vue +++ b/src/views/business/study/comp/tbbd/Fh.vue @@ -167,6 +167,7 @@ export default { console.log("formdata:" + JSON.stringify(this.$refs.templateTable.getFilledFormData())) if (data.type == 'checkbox') { // {"type":"checkbox","fieldCheckObj":"{\"_methodCode\":{\"checked\":false}}"} + debugger studyFormFill_updateZdgxjl( { id: this.form.id, diff --git a/src/views/business/study/comp/tbbd/Xq.vue b/src/views/business/study/comp/tbbd/Xq.vue index 5745821..d7f9b7e 100644 --- a/src/views/business/study/comp/tbbd/Xq.vue +++ b/src/views/business/study/comp/tbbd/Xq.vue @@ -25,7 +25,7 @@ {{ $t('page.business.study.studyFormFill.dcbhsjgj') }} - +
- +
@@ -73,7 +73,7 @@ @pagination="getJjcgjList" /> -->
- +