Vue.js Element UI 表单计算速算扣除数方法
<template>
<el-form ref="form" :model="form" label-width="120px">
<el-form-item
label="应纳税所得额:"
prop="acTaxPiPersonCalculationSchedule.acTaxableIncome"
style="width: 290px"
>
{{ acTaxableincome }}
</el-form-item>
<el-form-item
label="税率/预扣率:"
prop="acTaxPiPersonCalculationSchedule.taxRate"
style="width: 290px"
>
20%
</el-form-item>
<el-form-item
label="速算扣除数:"
prop="acTaxPiPersonCalculationSchedule.quickCalculationDeduction"
style="width: 290px"
>
{{ form.acTaxPiPersonCalculationSchedule.quickCalculationDeduction }}
</el-form-item>
</el-form>
</template>
<script>
export default {
data() {
return {
form: {
// 其他表单项省略...
acTaxPiPersonCalculationSchedule: {
acTaxableIncome: 0,
quickCalculationDeduction: 0,
},
},
};
},
computed: {
acTaxableincome() {
const { income, cost, subtotal, taxExemptIncome } = this.form;
const taxableAmount = income - cost - subtotal - taxExemptIncome;
return taxableAmount >= 0 ? taxableAmount : 0.0;
},
},
watch: {
'form.acTaxPiPersonCalculationSchedule.acTaxableIncome': function(newVal) {
this.calquickCalculationDeduction(newVal);
},
},
methods: {
calquickCalculationDeduction(acTaxableIncome) {
if (acTaxableIncome <= 36000) {
this.form.acTaxPiPersonCalculationSchedule.quickCalculationDeduction = 3690;
} else if (acTaxableIncome <= 144000) {
this.form.acTaxPiPersonCalculationSchedule.quickCalculationDeduction = 14190;
} else if (acTaxableIncome <= 300000) {
this.form.acTaxPiPersonCalculationSchedule.quickCalculationDeduction = 24190;
} else if (acTaxableIncome <= 420000) {
this.form.acTaxPiPersonCalculationSchedule.quickCalculationDeduction = 44190;
} else if (acTaxableIncome <= 660000) {
this.form.acTaxPiPersonCalculationSchedule.quickCalculationDeduction = 64190;
} else {
this.form.acTaxPiPersonCalculationSchedule.quickCalculationDeduction = 109190;
}
},
},
mounted() {
this.calquickCalculationDeduction(this.form.acTaxPiPersonCalculationSchedule.acTaxableIncome);
},
};
</script>
原文地址: https://www.cveoy.top/t/topic/o9PC 著作权归作者所有。请勿转载和采集!