股权激励收入计算公式及实现代码
股权激励收入计算公式及实现代码
本文将介绍股权激励收入的计算公式以及实现代码,并提供表单验证和数据提交的示例。
计算公式
股权激励收入的计算公式取决于不同的情况,以下列举了常见的几种情况:
- 公式 0 & 4:
(detail.domesticPayment * detail.domesticWorkDays) / detail.gregorianCalendarDays - 公式 2 & 6:
(detail.totalRevenue * detail.domesticWorkDays) / detail.gregorianCalendarDays - 公式 3 & 5:
detail.totalRevenue * (1 - (detail.abroadPayment / detail.totalRevenue) * (detail.abroadWorkDays / detail.gregorianCalendarDays)) - 公式 1:
detail.domesticPayment - 公式 7 & 8:
detail.totalRevenue
代码实现
calculateIncome() {
const formula = this.form.applicableFormula;
const detail = this.form1.acTaxPiIncomeReportingDetail;
let income = 0;
switch (formula) {
case '0':
case '4':
income = (detail.domesticPayment * detail.domesticWorkDays) / detail.gregorianCalendarDays;
break;
case '2':
case '6':
income = (detail.totalRevenue * detail.domesticWorkDays) / detail.gregorianCalendarDays;
break;
case '3':
case '5':
income = detail.totalRevenue * (1 - (detail.abroadPayment / detail.totalRevenue) * (detail.abroadWorkDays / detail.gregorianCalendarDays));
break;
case '1':
income = detail.domesticPayment;
break;
case '7':
case '8':
income = detail.totalRevenue;
break;
default:
break;
}
// 返回计算后的本期收入
return income;
},
opendetail() {
this.dialogVisible = true;
this.isViewMode = false;
},
// 明细对话框
submitDetail() {
if (this.subDetail === null) {
this.subDetail = {};
}
console.log(this.form1.acTaxPiIncomeReportingDetail, 'acTaxPiIncomeReportingDetail');
this.isViewMode = false;
this.$refs['form1'].validate((valid) => {
if (valid) {
// 其他表单验证和赋值操作
// this.$refs.form1.validateField();
this.subDetail = this.form1.acTaxPiIncomeReportingDetail;
this.form.equityIncentiveIncome = this.calculateIncome();
console.log(this.form.equityIncentiveIncome, 'form111');
// acTaxPiIncomeReportingDetail = this.subDetail;
this.dialogVisible = false;
} else {
console.log('表单验证失败:', valid);
console.log('error submit!!');
return false;
}
});
},
// 查询参数
form: {
companyId: null,
personId: null,
reportingPeriodDate: null,
other: '',
// 应纳税额
cost: '',
// 应纳税额
taxExemptIncome: '',
// 备注
remark: '',
// 小计
subtotal: '',
// 减免税额
reductionTaxAmount: '',
// companyId: null
// incomeReportingCode: null
// 所得期间起
incomePeriodDateStart: null,
// 所得期间至
incomePeriodDateEnd: null,
// 应纳税额
// 扣除及减除项目合计
deductProjectTotal: null,
// applicableFormula
applicableFormula: null,
// 本月股权激励收入
equityIncentiveIncome: null,
// 本年累计免税收入
accumulateTaxFreeIncome: null,
// 本年累计股权激励收入
accumulateEquityIncentiveIncome: null,
// 本年累计其他
accumulateOther: null,
// 本年累计准予扣除的捐赠额
accumulateDeductionAllowedDonate: null,
acTaxPiPersonVo: {
// 人员id
personId: null,
// 姓名
name: '',
// 证件号码
identificationNum: '',
// 证件类型
identificationType: '',
// 工号
employeeId: '',
// 其他
},
acTaxPiPersonCalculationSchedule: {
// 应纳税额
acTaxableAmount: '',
// 减免税额
acTaxSavings: '',
// 应纳税所得额
acTaxableIncome: '',
// 已预缴税额
prepaidTaxAmount: '',
// 税率/预扣率
taxRate: '',
// 速算扣除数
quickCalculationDeduction: 0,
// 应补(退)税额
payableTaxAmount: '',
// 累计应扣缴税额
acDeductiblePaymentAmount: '',
},
acTaxPiIncomeReportingDetail: {
abroadPayment: 0,
abroadWorkDays: 0,
domesticPayment: 0,
domesticWorkDays: 0,
gregorianCalendarDays: 0,
// incomeReportingCode: '',
personId: 0,
// reportingPeriodDate: '',
totalRevenue: 0,
},
},
form1: {
acTaxPiPersonVo: {
// 人员id
personId: null,
// 姓名
name: '',
// 证件号码
identificationNum: '',
// 证件类型
identificationType: '',
// 工号
employeeId: '',
// 其他
},
acTaxPiIncomeReportingDetail: {
abroadPayment: 0,
abroadWorkDays: 0,
domesticPayment: 0,
domesticWorkDays: 0,
gregorianCalendarDays: 0,
// incomeReportingCode: '',
personId: 0,
// reportingPeriodDate: '',
totalRevenue: 0,
},
},
// 存储天数
subDetail: null
// subDetail怎么把form1里面的 acTaxPiIncomeReportingDetail: { abroadPayment: 0, abroadWorkDays: 0, domesticPayment: 0, domesticWorkDays: 0, gregorianCalendarDays: 0, // incomeReportingCode: '', personId: 0, // reportingPeriodDate: '', totalRevenue: 0, },传给submitForm里面的acTaxPiIncomeReportingDetail 解决方法内容:To pass the `acTaxPiIncomeReportingDetail` object from `form1` to `submitForm`, you can update the `submitForm` method to accept the `acTaxPiIncomeReportingDetail` object as a parameter. Here's an example:javascriptsubmitForm(acTaxPiIncomeReportingDetail) { // ... other code
this.subDetail = acTaxPiIncomeReportingDetail; this.form.equityIncentiveIncome = this.calculateIncome(); // ... other code}
Then, in the `submitDetail` method, pass the `acTaxPiIncomeReportingDetail` object from `form1` to the `submitForm` method:javascriptsubmitDetail() { // ... other code
this.$refs['form1'].validate((valid) => { if (valid) { this.submitForm(this.form1.acTaxPiIncomeReportingDetail); // ... other code } else { // ... other code } });}
With these changes, the `acTaxPiIncomeReportingDetail` object from `form1` will be passed to the `submitForm` method and assigned to `subDetail`
原文地址: https://www.cveoy.top/t/topic/peLD 著作权归作者所有。请勿转载和采集!