diff --git a/src/components/Template/BaseInfoFormPackage.vue b/src/components/Template/BaseInfoFormPackage.vue index 2598ff2..3a50b0c 100644 --- a/src/components/Template/BaseInfoFormPackage.vue +++ b/src/components/Template/BaseInfoFormPackage.vue @@ -94,10 +94,12 @@ {{ $t(sItem.subText) }} + :value="formFields[sItem.subKey]" + @clickButton="(e,val,data) => handleClickButton(e, sItem,val,data)" />
@@ -345,13 +347,15 @@ export default { this.$emit('beforeReagentSubmit', { selectData: data, callback, key, formFields: this.formFields }) }, // 点击按钮 - handleClickButton(e, item) { - this.$emit("clickButton", e, item) + handleClickButton(e, item,val,data) { + this.formFields[item.subKey] = val; + this.$emit("clickButton", item,data) }, // 获取按钮项 getButtonItem(sItem) { return { ...sItem, + key: sItem.subKey, fillType: sItem.subFillType || sItem.fillType } }, diff --git a/src/components/Template/HandleFormItem.vue b/src/components/Template/HandleFormItem.vue index 4eab823..7e1c10d 100644 --- a/src/components/Template/HandleFormItem.vue +++ b/src/components/Template/HandleFormItem.vue @@ -53,7 +53,8 @@ - {{ item.buttonName }} + {{ $t(item.buttonName) }} +
{ EventBus.$emit('onModifyRecord', params,) + console.log(params,"onModifyRecord") if (this.regentType.includes(this.item.type)) { this.$emit("onRegentSubmit", this.selectRegentInfo, this.inputValue); } @@ -1011,7 +1021,7 @@ export default { isShowHandle() { const { fillType } = this.item; //只有当模板状态不是预填时,才显示操作按钮 - return this.templateFillType !== "preFill" && fillType === "actFill" + return this.templateFillType !== "preFill" && fillType === "actFill"&&this.type!=="button" }, //判断是否禁用 getDisabled() { diff --git a/src/components/Template/mixins/formPackageMixins.js b/src/components/Template/mixins/formPackageMixins.js index a1a8a0e..d342645 100644 --- a/src/components/Template/mixins/formPackageMixins.js +++ b/src/components/Template/mixins/formPackageMixins.js @@ -109,17 +109,23 @@ export default { }, //更新表单数据 - updateFormData(key, value) { + updateFormData(key, value,data) { + const {isUpdateRecord,signData} = data || {}; // 深拷贝当前表单数据,避免直接修改原数据 const cloneFormFields = JSON.parse(JSON.stringify(this.formFields)); this.oldFormFields[key] = cloneFormFields[key]; - // this.showEditSignDialog(); this.formFields[key] = value; // 清除该表单项的错误状态 if (this.errors[key]) { this.$set(this.errors, key, false); } + + if(isUpdateRecord){ + setTimeout(() => { + this.$refs[key][0].handleUpdateRecord(signData,{oldValue:this.oldFormFields[key],inputValue:value}); + }, 10); + } }, @@ -363,7 +369,6 @@ export default { const subComponentValidateResult = this.validateSubComponents(); // const subComponentValidateResult = {valid: true, error: ''}; - console.log(subComponentValidateResult,validateResult,"subComponentValidateResult") return new Promise((resolve, reject) => { if (validateResult.valid && subComponentValidateResult.valid) { resolve(this.formFields); diff --git a/src/views/business/comps/template/comps/yp/YP002.vue b/src/views/business/comps/template/comps/yp/YP002.vue index 0bb4ebf..07fdea3 100644 --- a/src/views/business/comps/template/comps/yp/YP002.vue +++ b/src/views/business/comps/template/comps/yp/YP002.vue @@ -141,6 +141,7 @@ export default { fillType: 'actFill', maxlength: 200, subType:"button", + subKey:"jssjButton", buttonName:"获取时间" }, } @@ -157,9 +158,8 @@ export default { }, methods: { // 点击按钮 - handleClickButton(e,item){ - this.$refs.ypjsInfoRef.updateFormData("jssj", moment().format("YYYY/MM/DD HH:mm")); - console.log(e,item,"点击按钮") + handleClickButton(item,signData){ + this.$refs.ypjsInfoRef.updateFormData("jssj", moment().format("YYYY/MM/DD HH:mm"),{isUpdateRecord:true,signData}); }, //获取已填写的表单数据 getFilledFormData() {