From de00a1c07a53a4871f8fc00dca93207a8fc9e724 Mon Sep 17 00:00:00 2001 From: lynn Date: Thu, 22 May 2025 19:00:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/businessConfig/contractConfig.vue | 6 +-- .../components/paymentRegistration.vue | 37 ++++++++++++++++++- .../contract/components/printPaymentForm.vue | 2 +- src/views/contract/contractList.vue | 2 - 4 files changed, 40 insertions(+), 7 deletions(-) diff --git a/src/views/businessConfig/contractConfig.vue b/src/views/businessConfig/contractConfig.vue index 97ffb20..86387e8 100644 --- a/src/views/businessConfig/contractConfig.vue +++ b/src/views/businessConfig/contractConfig.vue @@ -124,7 +124,7 @@ - + @@ -302,8 +302,8 @@ - - + + { + const fieldName = input.getAttribute('data-field'); + if (fieldName) { + const field = this.contract.contract_template.contract_template_fields.find(f => f.field === fieldName); + if (field) { + if (input.type === 'checkbox' || input.type === 'radio') { + // 对于复选框和单选框,需要找到选中的值 + const checkedInput = dom.querySelector(`[data-field="${fieldName}"]:checked`); + field.value = checkedInput ? checkedInput.value : ''; + // 更新 HTML 中的 checked 状态 + if (checkedInput) { + checkedInput.setAttribute('checked', 'checked'); + } + } else { + field.value = input.value; + // 更新 HTML 中的 value + input.setAttribute('value', input.value); + } + } + } + }); + + // 获取更新后的 HTML + this.forms = dom.innerHTML; + } + } + let data = { contract_id: this.contract.id, apply_money: this.paymentRegistrationForm.applyMoney, @@ -428,7 +463,7 @@ is_end: this.paymentRegistrationForm.isLast ? 1 : 0, remark: this.paymentRegistrationForm.remark, audit_money: this.paymentRegistrationForm.audit_money, - // 添加事后支付表格数据 + // 提交更新后的HTML和字段数据 forms: this.forms, other_data: this.contract.contract_template?.contract_template_fields || [] } diff --git a/src/views/contract/components/printPaymentForm.vue b/src/views/contract/components/printPaymentForm.vue index 71b8f2a..f2fd410 100644 --- a/src/views/contract/components/printPaymentForm.vue +++ b/src/views/contract/components/printPaymentForm.vue @@ -4,7 +4,7 @@ - -