|
|
|
|
@ -420,6 +420,41 @@
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
submit() {
|
|
|
|
|
// 保存事后支付表格的数据
|
|
|
|
|
if (this.contract.contract_template) {
|
|
|
|
|
const dom = this.$refs.zoomedForms || this.$refs.zoomedTemplate;
|
|
|
|
|
if (dom) {
|
|
|
|
|
// 获取所有输入控件
|
|
|
|
|
const inputs = dom.querySelectorAll('input, select, textarea');
|
|
|
|
|
|
|
|
|
|
// 遍历所有输入控件,更新值到 HTML
|
|
|
|
|
inputs.forEach(input => {
|
|
|
|
|
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 || []
|
|
|
|
|
}
|
|
|
|
|
|