应纳税所得额计算 - 详细指南及代码示例
应纳税所得额计算 - 详细指南及代码示例
本文将深入解析应纳税所得额的计算方法,并提供完整的代码示例,帮助您理解如何使用Vue.js框架进行所得税计算。同时,还将解决常见的表单数据更新问题,确保您能够正确使用计算结果。
代码示例
// 应纳税所得额计算
acTaxableincome: function () {
const { disposableCompensationIncome, taxExemptIncome, subtotal, deductionAllowedDonate } = this.form;
const taxableAmount = disposableCompensationIncome - taxExemptIncome - subtotal - deductionAllowedDonate;
this.form.acTaxPiPersonCalculationSchedule.acTaxableIncome = taxableAmount >= 0 ? taxableAmount : 0.0; // 赋值给表单项属性
return this.form.acTaxPiPersonCalculationSchedule.acTaxableIncome;
},
// 年均应纳税所得额计算
acAnnualTaxableIncome() {
const acTaxableIncome = this.acTaxableincome;
const shareYearDegree = this.form.shareYearDegree;
const AnnualTaxableIncome = acTaxableIncome / shareYearDegree;
return AnnualTaxableIncome >= 0 ? AnnualTaxableIncome : 0.0;
},
<el-form-item
label='应纳税所得额:'
prop='acTaxPiPersonCalculationSchedule.acTaxableIncome'
style='width: 290px'
>
{{ acTaxableincome }}
</el-form-item>
<el-form-item
label='税率/预扣率:'
prop='acTaxPiPersonCalculationSchedule.taxRate'
style='width: 290px'
>
10%
</el-form-item>
<el-form-item
label='速算扣除数:'
prop='acTaxPiPersonCalculationSchedule.quickCalculationDeduction'
style='width: 290px'
>
0.00
</el-form-item>
</el-row>
<el-row style='display: flex'>
<el-form-item
label='年均应纳税所得额:'
prop='acTaxPiPersonCalculationSchedule.annualTaxableIncome'
style='width: 290px; white-space: nowrap'
>
{{ acAnnualTaxableIncome }}
</el-form-item>
</el-row>
// 查询参数
form: {
// 准予扣除的捐赠额
deductionAllowedDonate: 0,
// 一次性补偿收入
disposableCompensationIncome: 0,
// 年均减除费用
averageAnnualDeductionCost: 0,
// 分均年度数
shareYearDegree: null,
// 减除费用
deductCost: null,
companyId: null,
personId: null,
reportingPeriodDate: null,
other: null,
taxExemptIncome: 0,
// 备注
remark: null,
// 小计
subtotal: 0,
// 减免税额
reductionTaxAmount: null,
// companyId: null,
// incomeReportingCode: null,
// 所得期间起
incomePeriodDateStart: null,
// 所得期间至
incomePeriodDateEnd: null,
// 应纳税额
acTaxPiPersonVo: {
// 人员id
personId: null,
// 姓名
name: '',
// 证件号码
identificationNum: '',
// 证件类型
identificationType: '',
// 工号
employeeId: '',
// 其他
},
acTaxPiPersonCalculationSchedule: {
// 应纳税额
acTaxableAmount: 0,
// 减免税额
acTaxSavings: 0,
// 应纳税所得额
acTaxableIncome: 0,
// 已预缴税额
prepaidTaxAmount: 0,
// 税率/预扣率
taxRate: 0,
// 速算扣除数
quickCalculationDeduction: 0,
// 应补(退)税额
payableTaxAmount: 0,
// 累计应扣缴税额
acDeductiblePaymentAmount: 0,
// 年均应纳税所得额(提前退休一次性补贴表)
annualTaxableIncome: 0,
},
},
// ...
表单acTaxableincome
不更新问题的解决方法
如果表单acTaxableincome
没有反应,可能是由于以下几个原因:
- 模板中表单项属性绑定错误: 确保在模板中正确使用
acTaxPiPersonCalculationSchedule.acTaxableIncome
绑定表单项的值。 - 计算函数调用错误: 确保在组件中正确调用
acTaxableincome
函数,并将其结果赋值给acTaxPiPersonCalculationSchedule.acTaxableIncome
。 - 表单项属性初始化错误: 确保在初始化表单时,将
acTaxPiPersonCalculationSchedule.acTaxableIncome
设置为初始值。
如果问题仍然存在,请提供完整的代码以便更详细的分析和解决问题。
其他优化
- 使用
computed
属性: 将acTaxableincome
和acAnnualTaxableIncome
定义为computed
属性,可以提高代码可读性和性能。 - 使用
v-model
指令: 可以使用v-model
指令简化表单的双向数据绑定。 - 使用
watch
监听数据变化: 可以使用watch
监听相关数据变化,并在数据变化时重新计算应纳税所得额。
通过以上优化,您能够创建更加清晰、高效的税收计算组件,并有效解决表单数据更新问题。
原文地址: https://www.cveoy.top/t/topic/o99W 著作权归作者所有。请勿转载和采集!