如何在提交表单时获取计算属性的最新值并传递给后台处理逻辑
在提交表单时,可以通过以下方式获取计算属性的最新值并传递给后台处理逻辑:
- 在
submitForm方法中,获取计算属性的最新值:
this.form.acTaxPiPersonCalculationSchedule.acTaxableIncome = this.acTaxableincome();
this.form.acTaxPiPersonCalculationSchedule.payableTaxAmount = this.acTaxableamount();
this.form.acTaxPiPersonCalculationSchedule.acTaxableAmount = this.payableTaxamount();
this.form.acTaxPiPersonCalculationSchedule.acDeductiblePaymentAmount = this.acDeductibleAmount();
这里假设 acTaxableincome()、acTaxableamount()、payableTaxamount() 和 acDeductibleAmount() 是计算属性的方法,根据你的具体业务逻辑进行相应的计算。
- 将获取到的最新值传递给后台处理逻辑:
addReportingRoyaltiesIncome(this.form).then((response) => {
console.log(response, 'resssssssssss');
this.msgSuccess('新增成功');
this.open = false;
this.getList();
});
这里假设 addReportingRoyaltiesIncome 是向后台发送新增数据的方法,根据你的具体业务逻辑进行相应的调用。
通过以上步骤,你可以在提交表单时获取计算属性的最新值并传递给后台处理逻辑。
原文地址: https://www.cveoy.top/t/topic/b3vK 著作权归作者所有。请勿转载和采集!