From 0594056ffd42c82642c2f50812ef7f4583e279a8 Mon Sep 17 00:00:00 2001 From: luojie <125330818@qq.com> Date: Mon, 2 Feb 2026 22:38:05 +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 --- .../Template/StepComponents/ZLSubPackage.vue | 58 +++++++++++++++++++--- src/components/Template/StepFormPackage.vue | 6 ++- 2 files changed, 57 insertions(+), 7 deletions(-) diff --git a/src/components/Template/StepComponents/ZLSubPackage.vue b/src/components/Template/StepComponents/ZLSubPackage.vue index fd881f5..4318524 100644 --- a/src/components/Template/StepComponents/ZLSubPackage.vue +++ b/src/components/Template/StepComponents/ZLSubPackage.vue @@ -27,14 +27,14 @@
{{ formData.mybh }}-set{{ item.subCode }}
+ type="inputNumber" @blur="onBlurFzNum(index)" v-model="item.prenum" /> + type="inputNumber" @blur="onBlurFzNum(index)" v-model="item.actnum" /> + @clickButton="(e)=>onGetValue(item)" />
@@ -54,9 +54,14 @@ export default { components: { HandleFormItem, }, + props: { + subData: { + type: Object, + default: () => ({}) + }, + }, data() { return { - subData: {}, inputItem: { type: "input", fillType: "actFill", @@ -93,6 +98,35 @@ export default { uuid:"",//事件id } }, + watch: { + subData:{ + handler(newVal) { + console.log(newVal,"fff"); + if(newVal.formData){ + this.formData = newVal.formData; + } + if(newVal.fzList){ + this.fzList = newVal.fzList; + } + }, + deep: true, + immediate: true, + }, + // 监听formData的变化 + formData: { + handler(newVal) { + this.onDataChange(); + }, + deep: true + }, + // 监听fzList的变化 + fzList: { + handler(newVal) { + this.onDataChange(); + }, + deep: true + } + }, computed: { unitItem() { return { @@ -106,7 +140,7 @@ export default { // 获取按钮项 getButtonItem() { return { - fillType: "actFill", + fillType: "preFill", buttonName:"获取值", } }, @@ -237,7 +271,8 @@ export default { // 根据输入的数量生成新列表 for (let i = 0; i < e; i++) { this.fzList.push({ - num: "", + prenum: "", + actnum: "", subCode: codes[i], }); // 同步初始化错误状态数组 @@ -259,6 +294,9 @@ export default { this.formErrors.mfbzl = false; }, onGetValue(item) { + item.actnum = 123; + console.log(item,"获取值") + this.fzList = [...this.fzList] }, onCommonBlur(e, field) { if (this.formData[field]) { @@ -272,6 +310,14 @@ export default { } } }, + // 数据变化处理方法 + onDataChange() { + // 触发自定义事件,将数据变化传递给父组件 + this.$emit('update', { + formData: this.formData, + fzList: this.fzList + }); + }, } } diff --git a/src/components/Template/StepFormPackage.vue b/src/components/Template/StepFormPackage.vue index 457e609..4a4f0e9 100644 --- a/src/components/Template/StepFormPackage.vue +++ b/src/components/Template/StepFormPackage.vue @@ -48,7 +48,7 @@ {{ formFields[key] }}
@@ -120,6 +120,10 @@ export default { } }, methods: { + // 子组件数据更新处理方法 + onSubPackageUpdate(data,key){ + this.formFields[key] = data; + }, getSjResource(){ const {allFieldsConfig,formFields} = this; const sjResource = [],yqResource = [];