From b5855ae4961e17d00eb96e85eb7f70aaad696113 Mon Sep 17 00:00:00 2001 From: luojie <125330818@qq.com> Date: Wed, 25 Feb 2026 21:45:47 +0800 Subject: [PATCH] =?UTF-8?q?feat:[=E6=A8=A1=E6=9D=BF=E7=AE=A1=E7=90=86][upd?= =?UTF-8?q?ate]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Template/BaseInfoFormPackage.vue | 8 ++++---- src/components/Template/CustomTable.vue | 9 +++++---- src/components/Template/HandleFormItem.vue | 7 ++++++- src/components/Template/README.md | 4 ++-- src/components/Template/mixins/formPackageMixins.js | 7 ++++--- src/views/business/comps/template/comps/sp/SP0019.vue | 10 +++++++--- .../business/comps/template/formConfig/sp/SP0019.js | 19 +++++++++++-------- 7 files changed, 39 insertions(+), 25 deletions(-) diff --git a/src/components/Template/BaseInfoFormPackage.vue b/src/components/Template/BaseInfoFormPackage.vue index c2a4a12..8f36a41 100644 --- a/src/components/Template/BaseInfoFormPackage.vue +++ b/src/components/Template/BaseInfoFormPackage.vue @@ -115,7 +115,7 @@ :field-item-label="fieldItemLabel" :field-key="prefixKey+'_'+key" :type="sItem.type" sourceFrom = "baseInfoFormPackage" :error="errors[key]" @update:error="errors[key] = false" - @onRegentSubmit="(data)=>onRegentSubmit(data,key,sItem)" + @onRegentSubmit="(data,inputValue)=>onRegentSubmit(data,inputValue,key,sItem)" :item="sItem" :value="formFields[key]" /> @@ -176,7 +176,7 @@ :item="getRegentItem(sItem,'subType')" sourceFrom = "baseInfoFormPackage" @beforeReagentSubmit="(data, callback)=>onBeforeReagentSubmit(data, callback,sItem.subKey)" - @onRegentSubmit="(data)=>onRegentSubmit(data,sItem.subKey,sItem)" + @onRegentSubmit="(data,inputValue)=>onRegentSubmit(data,inputValue,sItem.subKey,sItem)" :error="errors[sItem.subKey]" @update:error="errors[sItem.subKey] = false" :value="formFields[sItem.subKey]" />
@@ -213,7 +213,7 @@ sourceFrom = "baseInfoFormPackage" :error="errors[sItem.subKey]" :type="sItem.subType" @beforeReagentSubmit="(data, callback)=>onBeforeReagentSubmit(data, callback,sItem.subKey)" - @onRegentSubmit="(data)=>onRegentSubmit(data,sItem.subKey,sItem)" + @onRegentSubmit="(data,inputValue)=>onRegentSubmit(data,inputValue,sItem.subKey,sItem)" :item="getRegentItem(sItem,'subType')" :value="formFields[sItem.subKey]" />
@@ -234,7 +234,7 @@ diff --git a/src/components/Template/CustomTable.vue b/src/components/Template/CustomTable.vue index e0bd489..d4459ea 100644 --- a/src/components/Template/CustomTable.vue +++ b/src/components/Template/CustomTable.vue @@ -99,8 +99,8 @@ sourceFrom = "customTable" :item="getBodyItem(col, rowIndex)" :value="row[col.prop]" :error="hasError(rowIndex, colIndex, col.prop)" - @onRegentSubmit="(data)=>onRegentSubmit(data,col, rowIndex, colIndex, row)" - @beforeReagentSubmit="(data, callback)=>onBeforeReagentSubmit(data, callback,col,row)" + @onRegentSubmit="(data,inputValue)=>onRegentSubmit(data,inputValue,col, rowIndex, colIndex, row)" + @beforeReagentSubmit="(data, callback)=>onBeforeReagentSubmit(data, callback,col,row)" @update:error="onErrorUpdate(rowIndex, colIndex, col.prop, $event)" :orange-bg="hasOrangeBg(rowIndex, colIndex, col.prop)" />
@@ -354,11 +354,11 @@ export default { } this.$emit("beforeReagentSubmit", {selectData:data, callback, key:col.prop, rowData:row}) }, - onRegentSubmit(data, col, rowIndex, colIndex, row){ + onRegentSubmit(data, inputValue, col, rowIndex, colIndex, row){ if (this.templateFillType !== 'actFill') { return } - this.updateDataSourceByRowIndex(rowIndex,{[col.prop]:data.selectedId}) + this.updateDataSourceByRowIndex(rowIndex,{[col.prop]:inputValue}) this.$emit("onRegentSubmit", {selectInfo:data,key:col.prop, col, rowIndex, colIndex, rowData:row}) }, isShowAddRos() { @@ -651,6 +651,7 @@ export default { copyFrom: col.copyFrom || "", compareTo: col.compareTo, // 添加 compareTo 字段 type: col.bodyType || "input", + filledCodes:col.filledCodes, }; if (col.bodyDisabled) { item.disabled = col.bodyDisabled; diff --git a/src/components/Template/HandleFormItem.vue b/src/components/Template/HandleFormItem.vue index d852790..4eab823 100644 --- a/src/components/Template/HandleFormItem.vue +++ b/src/components/Template/HandleFormItem.vue @@ -478,6 +478,11 @@ export default { // 执行试剂提交的共同逻辑 executeReagentSubmit(data) { this.inputValue = data.selectedId; + const {filledCodes=[]} = this.item; + const {selectInfo} = data; + if(filledCodes.length>0){ + this.inputValue = selectInfo[filledCodes[0]]+"("+selectInfo[filledCodes[1]]+")"; + } this.selectRegentInfo = data; EventBus.$emit("hideSelectMixReagentDialog"); this.onCommonHandleSaveRecord(this.inputValue); @@ -919,7 +924,7 @@ export default { this.$nextTick(() => { EventBus.$emit('onModifyRecord', params,) if (this.regentType.includes(this.item.type)) { - this.$emit("onRegentSubmit", this.selectRegentInfo); + this.$emit("onRegentSubmit", this.selectRegentInfo, this.inputValue); } }) }, diff --git a/src/components/Template/README.md b/src/components/Template/README.md index b03face..a0cb698 100644 --- a/src/components/Template/README.md +++ b/src/components/Template/README.md @@ -7,7 +7,7 @@ config: { storageCondition: {//当前表单的key值; label: "存储条件",//当前表单的label值,有的表单可能没有; - type: "input"|"select"|"inputerNumber"|"textarea"|"dateTime"|"span"|"clickable",//当前表单的type值 + type: "input"|"select"|"inputNumber"|"textarea"|"dateTime"|"span"|"clickable",|"attachment" |'sj', 'gsp', 'mix', 'xj', 'xb', 'gyzj', 'mjy', 'yq', 'jcb', 'qxbd'//当前表单的type值 fillType: "preFill" |"actFill",//主要是边框的区分,preFill为预填(蓝色),actFill为实际填报(橙色); options: this.getDictOptions("business_cctj"),//当前表单的type为select时,options为必填项,如:[{label:"",value:""}] otherCode: "storageConditionOther",//当前表单可能会触发其他输入项,otherCode为其他输入项的key值; @@ -23,7 +23,7 @@ subFillType: "preFill" |"actFill",//第二个字段的边框区分,preFill为预填(蓝色),actFill为实际填报(橙色); subPlaceholder: "请输入存储条件",//第二个表单的placeholder值,不填写时默认拼接请输入/请选择+label; compareTo: "storageCondition",//需要比较的字段,字段不一样时背景标红; - copyFrom:"storageCondition",//需要复制的字段,复制后会自动填充到当前表单; + copyFrom:"storageCondition",//需要复制的字段,复制后会自动填充到当前表单; }, } diff --git a/src/components/Template/mixins/formPackageMixins.js b/src/components/Template/mixins/formPackageMixins.js index 4b90ecc..a1a8a0e 100644 --- a/src/components/Template/mixins/formPackageMixins.js +++ b/src/components/Template/mixins/formPackageMixins.js @@ -62,9 +62,9 @@ export default { }, //试剂/仪器等弹窗提交 - onRegentSubmit(data,key,item){ - this.updateFormData(key,data.selectedId); - this.$emit("onRegentSubmit", {selectInfo:data,key,config:item}); + onRegentSubmit(data,inputValue,key,item){ + this.updateFormData(key,inputValue); + this.$emit("onRegentSubmit", {selectInfo:data,inputValue,key,config:item}); }, getRegentItem(item,fieldCode="type"){ const type = item[fieldCode] ; @@ -73,6 +73,7 @@ export default { type, fillType: item.subFillType || item.fillType, parentLabel: item.label, + filledCodes:item.filledCodes, } }, diff --git a/src/views/business/comps/template/comps/sp/SP0019.vue b/src/views/business/comps/template/comps/sp/SP0019.vue index 8997336..16edfbf 100644 --- a/src/views/business/comps/template/comps/sp/SP0019.vue +++ b/src/views/business/comps/template/comps/sp/SP0019.vue @@ -13,6 +13,7 @@ :columns="yqInfoColumns" :formData = "formData" ref = "yqInfoTableRef" + @onRegentSubmit="(data, col, rowIndex, colIndex, row)=>onYqSubmit(data, col, rowIndex, colIndex, row)" :showAddRow = "fillType === 'actFill'" :showOperation = "fillType === 'actFill'" :prefixKey="`yqTable`" @@ -21,7 +22,7 @@ - { return [ { + label: 'template.common.instrumentCode', + prop: "bh", + bodyType: "yq", + bodyFillType: 'actFill', + },//仪器编号 + { label: 'template.common.instrumentName', prop: "mc", - bodyType: "yq", + bodyType: "input", + bodyType: "input", + bodyDisabled: true, bodyFillType: 'actFill', },//仪器名称 { @@ -72,13 +81,7 @@ export const getYqColumns = ($this) => { bodyDisabled: true, bodyFillType: 'actFill', },//仪器型号 - { - label: 'template.common.instrumentCode', - prop: "bh", - bodyType: "input", - bodyDisabled: true, - bodyFillType: 'actFill', - },//仪器编号 + { label: 'template.common.nextTestDate', prop: "jzrq",