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.subDetail = this.form1.acTaxPiIncomeReportingDetail;
      this.form.equityIncentiveIncome = this.calculateIncome();
      console.log(this.form.equityIncentiveIncome, 'form111');

      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: '',
  applicableFormula: null,
  equityIncentiveIncome: null,
  accumulateTaxFreeIncome: null,
  accumulateEquityIncentiveIncome: null,
  accumulateOther: null,
  accumulateDeductionAllowedDonate: null,
  acTaxPiPersonVo: {
    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,
    personId: 0,
    totalRevenue: 0,
  },
},
form1: {
  acTaxPiPersonVo: {
    personId: null,
    name: '',
    identificationNum: '',
    identificationType: '',
    employeeId: '',
  },
  acTaxPiIncomeReportingDetail: {
    abroadPayment: 0,
    abroadWorkDays: 0,
    domesticPayment: 0,
    domesticWorkDays: 0,
    gregorianCalendarDays: 0,
    personId: 0,
    totalRevenue: 0,
  },
},
subDetail: null,

该代码使用switch语句根据不同的计算公式,计算出相应的收入值。该代码还包含了用于打开明细对话框的opendetail函数,以及用于提交明细数据的submitDetail函数。form和form1是用于存储表单数据的对象,subDetail用于存储提交的明细数据。

该代码可以帮助你计算股权激励收入,并提供用户友好的界面。


原文地址: https://www.cveoy.top/t/topic/peLA 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录