How to Pass acTaxPiIncomeReportingDetail to API in JavaScript
To pass the value of 'acTaxPiIncomeReportingDetail' to the API, you can modify the 'submitForm()' function as follows:
submitForm() {
const acTaxPiIncomeReportingDetail = this.subDetail;
this.$refs["form"].validate((valid) => {
if (valid) {
// other form validation and assignment operations
// assign acTaxPiIncomeReportingDetail to this.form.acTaxPiIncomeReportingDetail
this.form.acTaxPiIncomeReportingDetail = acTaxPiIncomeReportingDetail;
// assign other values to this.form.acTaxPiPersonCalculationSchedule
this.form.acTaxPiPersonCalculationSchedule.acTaxableIncome = this.acTaxableincome;
this.form.acTaxPiPersonCalculationSchedule.acTaxableAmount = this.acTaxableamount;
this.form.acTaxPiPersonCalculationSchedule.acDeductiblePaymentAmount = this.acDeductibleAmount;
this.form.acTaxPiPersonCalculationSchedule.payableTaxAmount = this.payableTaxamount;
// assign value to this.form.reportingPeriodDate, this.form.companyId, etc.
if (this.form.personId != null) {
// update the record with the updated values
this.form.companyId = this.companyId;
updateReportingEquityIncentive(this.form).then((response) => {
// handle success response
});
} else {
// add a new record with the provided values
this.form.acTaxPiPersonCalculationSchedule.taxRate = this.defaultTax;
this.form.personId = this.form.acTaxPiPersonVo.personId;
this.form.companyId = this.companyId;
addReportingEquityIncentive(this.form).then((response) => {
// handle success response
});
}
} else {
console.log("error submit!!");
return false;
}
});
},
In this modified code, the 'acTaxPiIncomeReportingDetail' value is assigned to 'this.form.acTaxPiIncomeReportingDetail', and then the modified 'this.form' object is passed to the API.
原文地址: https://www.cveoy.top/t/topic/peMD 著作权归作者所有。请勿转载和采集!