From 9fd926296218d878f80a0a97cd987580132cd5a5 Mon Sep 17 00:00:00 2001 From: luojie <125330818@qq.com> Date: Thu, 5 Feb 2026 16:51:55 +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/CustomTable.vue | 13 ++- src/components/Template/Step.vue | 2 +- .../Template/StepComponents/ZLSubPackage.vue | 108 ++++++++++++--------- src/components/Template/StepComponents/ry/zlfz.vue | 16 ++- src/components/Template/StepFormPackage.vue | 11 ++- .../Template/mixins/formPackageMixins.js | 12 ++- 6 files changed, 106 insertions(+), 56 deletions(-) diff --git a/src/components/Template/CustomTable.vue b/src/components/Template/CustomTable.vue index c8a2f30..595687b 100644 --- a/src/components/Template/CustomTable.vue +++ b/src/components/Template/CustomTable.vue @@ -263,10 +263,10 @@ export default { }, handleEditSignCallback(data) { if (data.uuid === this.uuid) { - this.updateRecords(); + this.updateRecords(data); } }, - getRecords() { + getRecords(data) { const records = []; const { nickName, name } = this.$store.getters; const { oldLocalDataSource, localDataSource, columns, prefixKey, fieldItemLabel } = this; @@ -299,6 +299,9 @@ export default { title: oldValue ? "修改" : "提交", time: moment().format("YYYY-MM-DD HH:mm:ss"), }; + if (data) { + record.reason = data.remark + } this.updateZdxgjl(record); records.push(record); @@ -324,6 +327,9 @@ export default { title: oldSubValue ? "修改" : "提交", time: moment().format("YYYY-MM-DD HH:mm:ss"), }; + if (data) { + record.reason = data.remark + } this.updateZdxgjl(record); records.push(record); } @@ -349,6 +355,9 @@ export default { title: oldOtherValue ? "修改" : "提交", time: moment().format("YYYY-MM-DD HH:mm:ss"), }; + if (data) { + record.reason = data.remark + } this.updateZdxgjl(record); records.push(record); } diff --git a/src/components/Template/Step.vue b/src/components/Template/Step.vue index d7a5ce8..b378158 100644 --- a/src/components/Template/Step.vue +++ b/src/components/Template/Step.vue @@ -114,7 +114,7 @@ const stepTypes = [ { label: '灭菌', value: 'mj' }, { label: '复苏', value: 'fs' }, { label: '封板', value: 'fb' }, - { label: '质量分装', value: 'zlfz' }, + // { label: '质量分装', value: 'zlfz' }, ]; diff --git a/src/components/Template/StepComponents/ZLSubPackage.vue b/src/components/Template/StepComponents/ZLSubPackage.vue index aeaeeac..6165d81 100644 --- a/src/components/Template/StepComponents/ZLSubPackage.vue +++ b/src/components/Template/StepComponents/ZLSubPackage.vue @@ -3,12 +3,15 @@
-
-
母编号
- +
+
{{ item.label }}
+
-
+
{{ formData.mybh }}-set{{ item.subCode }}
- - import HandleFormItem from '@/components/Template/HandleFormItem.vue'; -import { compareVolume } from '@/utils/volumeTools.js'; import { EventBus } from '@/utils/eventBus'; import { getLatestSn } from '@/api/template'; import { isValueEmpty } from '@/utils/index.js'; @@ -73,30 +76,30 @@ export default { }, integerInputNumberItem: { type: "inputNumber", - fillType: "preFill", + fillType: "actFill", precision: 0, maxlength: 3 }, inputNumberItem: { type: "inputNumber", fillType: "actFill", + label:"实际称量" }, preInputNumberItem: { type: "inputNumber", fillType: "preFill", + label:"预计称量" }, formData: { mybh: "",//母液编号 fzsl: "",//分装数量 dw: "",//单位 - mfbzl: "",//每份包装量 }, fzList: [],//分装列表 // 错误状态字段 formErrors: { fzsl: false, dw: false, - mfbzl: false, }, fzListErrors: [], // 分装列表错误状态 uuid:"",//事件id @@ -131,19 +134,42 @@ export default { } }, computed: { - unitItem() { - return { - type: "select", - fillType: "actFill", - options: this.dict.type.business_tjdw - } - } + subConfig(){ + return[ + { + fieldKey:"clfz_mybh", + key:"mybh", + label:"母编号", + type:"input", + disabled: true, + fillType: "actFill", + }, + { + fieldKey:"clfz_fzsl", + key:"fzsl", + label:"分装数量", + type:"inputNumber", + fillType: "preFill", + }, + { + fieldKey:"clfz_dw", + key:"dw", + label:"单位", + type:"select", + options: this.dict.type.business_tjdw, + fillType: "preFill", + }, + ] + }, }, methods: { + updateFormData(data){ + this.formData = {...this.formData,...data}; + }, // 获取按钮项 getButtonItem() { return { - fillType: "preFill", + fillType: "actFill", buttonName:"获取值", } }, @@ -157,30 +183,13 @@ export default { let isValid = true; // 定义需要验证的基础字段配置 - const baseFieldConfigs = [ - - { - field: 'fzsl', - errorField: 'fzsl', - itemConfig: this.integerInputNumberItem - }, - { - field: 'dw', - errorField: 'dw', - itemConfig: this.unitItem - }, - { - field: 'mfbzl', - errorField: 'mfbzl', - itemConfig: this.inputNumberItem - } - ]; + const baseFieldConfigs = this.subConfig; // 验证基础字段 baseFieldConfigs.forEach(config => { - if (config.itemConfig.fillType === this.templateFillType) { - if (!this.formData[config.field]) { - this.formErrors[config.errorField] = true; + if (config.fillType === this.templateFillType) { + if (isValueEmpty(this.formData[config.key]) && !config.disabled) { + this.formErrors[config.key] = true; isValid = false; } } @@ -214,7 +223,7 @@ export default { } } } - return {valid: isValid,error:""}; + return {valid: isValid,error:"质量分装数据没填完"}; }, resetErrors() { // 重置表单错误状态 @@ -229,7 +238,6 @@ export default { }, // 分装数量失去焦点时,根据数量生成分装列表 async onBlurFzsl(e) { - console.log(e,"失去焦点时的数量") // 清除当前字段的错误状态 if (e) { this.formErrors.fzsl = false; @@ -252,6 +260,13 @@ export default { subCode: codes[i], }); } + const params = { + type: "fieldChanged", + newRecord: null, + resourceList: null, + } + EventBus.$emit("onModifyRecord", params); + } }, @@ -260,10 +275,13 @@ export default { console.log(item,"获取值") this.fzList = [...this.fzList] }, - onCommonBlur(e, field) { + onCommonBlur(e,field) { if (this.formData[field]) { this.formErrors[field] = false; } + if(field === 'fzsl'){ + this.onBlurFzsl(e); + } }, onBlurFzNum(index, field) { if (this.fzList[index]) { diff --git a/src/components/Template/StepComponents/ry/zlfz.vue b/src/components/Template/StepComponents/ry/zlfz.vue index a070892..08c5538 100644 --- a/src/components/Template/StepComponents/ry/zlfz.vue +++ b/src/components/Template/StepComponents/ry/zlfz.vue @@ -1,6 +1,8 @@ @@ -38,7 +40,7 @@ export default { }, { config:{ - clfz:{ + zlfz:{ type: "zlfz", } } @@ -46,6 +48,16 @@ export default { ] } }, + methods: { + onDialogSubmit(data,key){ + console.log(data,key,"onDialogSubmit") + if(key === 'yq'){//供试品弹窗确定 + this.$refs.stepFormPackageRef.updateZlfzData("zlfz",{mybh:data.selectedId}); + // this.formData[key] = data; + + } + } + } } diff --git a/src/components/Template/StepFormPackage.vue b/src/components/Template/StepFormPackage.vue index 4f2bd9b..25e0e0e 100644 --- a/src/components/Template/StepFormPackage.vue +++ b/src/components/Template/StepFormPackage.vue @@ -48,6 +48,7 @@ {{ formFields[key] }} @@ -120,6 +121,12 @@ export default { } }, methods: { + updateZlfzData(key,data){ + const ref = this.$refs[`zlSubPackageRef_${key}`][0]; + if(ref){ + ref.updateFormData(data); + } + }, // 子组件数据更新处理方法 onSubPackageUpdate(data,key){ this.formFields[key] = data; @@ -132,7 +139,7 @@ export default { if (item.config) { for (const key in item.config) { const sItem = item.config[key]; - if (sItem.type === 'zlfz') { + if (sItem.type === 'zlfz') {//质量分装 // 根据key构建ref名称 const refName = `zlSubPackageRef_${key}`; const zlSubPackageRef = this.$refs[refName]; @@ -211,7 +218,7 @@ export default { this.allFieldsConfig[this.currentClickKey].sjSelectType = data.selectType; this.formFields[`selectInfo_${this.currentClickKey}`] = data.selectInfo; } - this.$emit("onDialogSubmit",data) + this.$emit("onDialogSubmit",data,this.currentClickKey) }, // 处理选择试剂提交 onReagentSubmit(data){ diff --git a/src/components/Template/mixins/formPackageMixins.js b/src/components/Template/mixins/formPackageMixins.js index e94afb6..51c0f6d 100644 --- a/src/components/Template/mixins/formPackageMixins.js +++ b/src/components/Template/mixins/formPackageMixins.js @@ -50,7 +50,7 @@ export default { }, methods: { - getRecords() { + getRecords(data) { const records = []; const { nickName, name } = this.$store.getters; const { oldFormFields, formFields, allFieldsConfig, prefixKey, fieldItemLabel } = this; @@ -72,6 +72,9 @@ export default { title: oldValue ? "修改" : "提交", time: moment().format("YYYY-MM-DD HH:mm:ss"), } + if (data) { + record.reason = data.remark + } this.updateZdxgjl(record); records.push(record); } @@ -86,7 +89,7 @@ export default { }, handleEditSignCallback(data) { if (data.uuid === this.uuid) { - this.updateRecord(); + this.updateRecord(data); } }, handleClickButton(key) { @@ -134,8 +137,8 @@ export default { this.$set(this.errors, key, false); } }, - updateRecord() { - const records = this.getRecords(); + updateRecord(data) { + const records = this.getRecords(data); const params = { type: "fieldChanged", newRecord: records, @@ -345,6 +348,7 @@ export default { const errors = []; // 清空之前的错误状态 this.errors = {}; + console.log(allFieldsConfig,"allFieldsConfig") for (const key in allFieldsConfig) { const o = allFieldsConfig[key]; if (o.otherCode) {//