| New file |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <!--工具栏--> |
| | | <div class="head-container"> |
| | | <div v-if="crud.props.searchToggle"> |
| | | <!-- 搜索 --> |
| | | <el-select v-model="query.userId" v-permission="permission.queryUserId" filterable clearable placeholder="所属员工" style="width: 185px;" class="filter-item" @keyup.enter.native="crud.toQuery"> |
| | | <el-option |
| | | v-for="item in users" |
| | | :key="item.id" |
| | | :label="item.nickName" |
| | | :value="item.id" |
| | | /> |
| | | </el-select> |
| | | <el-date-picker v-model="query.salaryYearMonth" type="month" clearable placeholder="工资年月" style="width: 185px;" class="filter-item" @keyup.enter.native="crud.toQuery" /> |
| | | <rrOperation :crud="crud" /> |
| | | </div> |
| | | <!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'--> |
| | | <crudOperation :permission="permission"> |
| | | <el-button |
| | | slot="right" |
| | | v-permission="permission.publicity" |
| | | class="filter-item" |
| | | size="mini" |
| | | type="primary" |
| | | icon="el-icon-s-check" |
| | | :disabled="crud.selections.length === 0" |
| | | style="margin-right: 6px;" |
| | | @click="multiplePublicity(crud.selections)" |
| | | >公示</el-button> |
| | | <el-button |
| | | slot="right" |
| | | v-permission="permission.approve" |
| | | class="filter-item" |
| | | size="mini" |
| | | type="primary" |
| | | icon="el-icon-finished" |
| | | :disabled="crud.selections.length === 0" |
| | | style="margin-right: 6px;" |
| | | @click="multipleApprove(crud.selections)" |
| | | >承认</el-button> |
| | | <el-button |
| | | slot="right" |
| | | v-permission="permission.generate" |
| | | class="filter-item" |
| | | size="mini" |
| | | type="primary" |
| | | icon="el-icon-plus" |
| | | style="margin-right: 6px;" |
| | | @click="openGenerate" |
| | | >生成</el-button> |
| | | </crudOperation> |
| | | <!--表单组件--> |
| | | <el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="690px"> |
| | | <el-form ref="form" v-loading="formLoading" :inline="true" :model="form" :rules="rules" size="small" label-width="110px"> |
| | | <el-form-item label="工资年月" prop="salaryYearMonth"> |
| | | <el-date-picker |
| | | v-model="form.salaryYearMonth" |
| | | type="month" |
| | | style="width: 523px;" |
| | | placeholder="请选择" |
| | | value-format="yyyy-MM-dd HH:mm:ss" |
| | | :disabled="disabledFlagByApprove" |
| | | @change="getUserLevel" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="所属员工" prop="userId"> |
| | | <el-select v-model="form.userId" filterable clearable placeholder="请选择" style="width: 523px;" :disabled="disabledFlagByApprove" @change="getUserLevel"> |
| | | <el-option |
| | | v-for="item in users" |
| | | :key="item.id" |
| | | :label="item.nickName" |
| | | :value="item.id" |
| | | :disabled="!item.enabled" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-divider>基本工资</el-divider> |
| | | <el-form-item label="全勤小时数" prop="fullDays"> |
| | | <el-input v-model="form.fullDays" style="width: 200px;" :disabled="disabledFlagByApprove" @blur="basicParameterBlur"> |
| | | <template slot="append">小时</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="缺勤小时数" prop="absenceDays"> |
| | | <el-input v-model="form.absenceDays" style="width: 200px;" :disabled="disabledFlagByApprove" @blur="basicParameterBlur"> |
| | | <template slot="append">小时</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="预计工资" prop="basicWage"> |
| | | <money-input :key="basicWageRandom" v-model="form.basicWage" :width="523" :disabled="disabledFlagByApprove" @blur="basicWageBlur" /> |
| | | </el-form-item> |
| | | <el-form-item label="实际工资" prop="actualBasicWage"> |
| | | <money-input :key="actualBasicWageRandom" v-model="form.actualBasicWage" :width="523" :disabled="disabledFlagByApprove" @blur="statisticalAmount" /> |
| | | </el-form-item> |
| | | <el-divider>绩效工资</el-divider> |
| | | <el-form-item label="应完成工时" prop="needCompletedAchievementsHours"> |
| | | <el-input v-model="form.needCompletedAchievementsHours" style="width: 200px;" :disabled="disabledFlagByApprove" @blur="achievementsParameterBlur"> |
| | | <template slot="append">小时</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="已完成工时" prop="alreadyCompletedAchievementsHours"> |
| | | <el-input v-model="form.alreadyCompletedAchievementsHours" style="width: 200px;" :disabled="disabledFlagByApprove" @blur="achievementsParameterBlur"> |
| | | <template slot="append">小时</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="预计工资" prop="achievementsWage"> |
| | | <money-input :key="achievementsWageRandom" v-model="form.achievementsWage" :width="523" :disabled="disabledFlagByApprove" @blur="achievementsWageBlur" /> |
| | | </el-form-item> |
| | | <el-form-item label="实际工资" prop="actualAchievementsWage"> |
| | | <money-input :key="actualAchievementsWageRandom" v-model="form.actualAchievementsWage" :width="523" :disabled="disabledFlagByApprove" @blur="statisticalAmount" /> |
| | | </el-form-item> |
| | | <el-divider>业绩工资</el-divider> |
| | | <el-form-item label="应完成工时" prop="needCompletedPerformanceHours"> |
| | | <el-input v-model="form.needCompletedPerformanceHours" style="width: 200px;" :disabled="disabledFlagByApprove" @blur="performanceParameterBlur"> |
| | | <template slot="append">小时</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="已完成工时" prop="alreadyCompletedPerformanceHours"> |
| | | <el-input v-model="form.alreadyCompletedPerformanceHours" style="width: 200px;" :disabled="disabledFlagByApprove" @blur="performanceParameterBlur"> |
| | | <template slot="append">小时</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="预计工资" prop="performanceWage"> |
| | | <money-input :key="performanceWageRandom" v-model="form.performanceWage" :width="523" :disabled="disabledFlagByApprove" @blur="performanceWageBlur" /> |
| | | </el-form-item> |
| | | <el-form-item label="实际工资" prop="actualPerformanceWage"> |
| | | <money-input :key="actualPerformanceWageRandom" v-model="form.actualPerformanceWage" :width="523" :disabled="disabledFlagByApprove" @blur="statisticalAmount" /> |
| | | </el-form-item> |
| | | <el-divider>团队工资</el-divider> |
| | | <el-form-item label="实达标工时" prop="actualComplianceTeamHours"> |
| | | <el-input v-model="form.actualComplianceTeamHours" style="width: 200px;" :disabled="disabledFlagByApprove" @blur="teamParameterBlur"> |
| | | <template slot="append">小时</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="已完成工时" prop="alreadyCompletedTeamHours"> |
| | | <el-input v-model="form.alreadyCompletedTeamHours" style="width: 200px;" :disabled="disabledFlagByApprove" @blur="teamParameterBlur"> |
| | | <template slot="append">小时</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="预计工资" prop="teamWage"> |
| | | <money-input :key="teamWageRandom" v-model="form.teamWage" :width="523" :disabled="disabledFlagByApprove" @blur="teamWageBlur" /> |
| | | </el-form-item> |
| | | <el-form-item label="实际工资" prop="actualTeamWage"> |
| | | <money-input :key="actualTeamWageRandom" v-model="form.actualTeamWage" :width="523" :disabled="disabledFlagByApprove" @blur="statisticalAmount" /> |
| | | </el-form-item> |
| | | <el-divider>其他工资</el-divider> |
| | | <el-form-item label="计件工资" prop="pieceRate"> |
| | | <money-input :key="pieceRateRandom" v-model="form.pieceRate" :width="523" :disabled="disabledFlagByApprove" @blur="statisticalAmount" /> |
| | | </el-form-item> |
| | | <el-form-item label="出差补助工资" prop="travelAllowance"> |
| | | <money-input :key="travelAllowanceRandom" v-model="form.travelAllowance" :width="523" :disabled="disabledFlagByApprove" @blur="statisticalAmount" /> |
| | | </el-form-item> |
| | | <el-divider>公积金</el-divider> |
| | | <el-form-item label="基数" prop="accumulationFund"> |
| | | <money-input :key="accumulationFundRandom" v-model="form.accumulationFund" :width="523" :disabled="disabledFlagByApprove" @blur="accumulationParameterBlur" /> |
| | | </el-form-item> |
| | | <el-form-item label="个人缴纳比例" prop="accumulationFundPersonal"> |
| | | <el-input v-model="form.accumulationFundPersonal" style="width: 200px;" :disabled="disabledFlagByApprove" @blur="accumulationParameterBlur"> |
| | | <template slot="append">%</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="个人缴纳金额" prop="accumulationFundPersonalAmount"> |
| | | <money-input :key="accumulationFundPersonalAmountRandom" v-model="form.accumulationFundPersonalAmount" :width="200" :disabled="disabledFlagByApprove" @blur="statisticalAmount" /> |
| | | </el-form-item> |
| | | <el-form-item label="公司缴纳比例" prop="accumulationFundCompany"> |
| | | <el-input v-model="form.accumulationFundCompany" style="width: 200px;" :disabled="disabledFlagByApprove" @blur="accumulationParameterBlur"> |
| | | <template slot="append">%</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="公司缴纳金额" prop="accumulationFundCompanyAmount"> |
| | | <money-input :key="accumulationFundCompanyAmountRandom" v-model="form.accumulationFundCompanyAmount" :width="200" :disabled="disabledFlagByApprove" @blur="statisticalAmount" /> |
| | | </el-form-item> |
| | | <el-divider>养老险</el-divider> |
| | | <el-form-item label="基数" prop="retirementInsurance"> |
| | | <money-input :key="retirementInsuranceRandom" v-model="form.retirementInsurance" :width="523" :disabled="disabledFlagByApprove" @blur="pensionParameterBlur" /> |
| | | </el-form-item> |
| | | <el-form-item label="个人缴纳比例" prop="retirementInsurancePersonal"> |
| | | <el-input v-model="form.retirementInsurancePersonal" style="width: 200px;" :disabled="disabledFlagByApprove" @blur="pensionParameterBlur"> |
| | | <template slot="append">%</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="个人缴纳金额" prop="retirementInsurancePersonalAmount"> |
| | | <money-input :key="retirementInsurancePersonalAmountRandom" v-model="form.retirementInsurancePersonalAmount" :width="200" :disabled="disabledFlagByApprove" @blur="statisticalAmount" /> |
| | | </el-form-item> |
| | | <el-form-item label="公司缴纳比例" prop="retirementInsuranceCompany"> |
| | | <el-input v-model="form.retirementInsuranceCompany" style="width: 200px;" :disabled="disabledFlagByApprove" @blur="pensionParameterBlur"> |
| | | <template slot="append">%</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="公司缴纳金额" prop="retirementInsuranceCompanyAmount"> |
| | | <money-input :key="retirementInsuranceCompanyAmountRandom" v-model="form.retirementInsuranceCompanyAmount" :width="200" :disabled="disabledFlagByApprove" @blur="statisticalAmount" /> |
| | | </el-form-item> |
| | | <el-divider>医疗险</el-divider> |
| | | <el-form-item label="基数" prop="medicalInsurance"> |
| | | <money-input :key="medicalInsuranceRandom" v-model="form.medicalInsurance" :width="523" :disabled="disabledFlagByApprove" @blur="medicalParameterBlur" /> |
| | | </el-form-item> |
| | | <el-form-item label="个人缴纳比例" prop="medicalInsurancePersonal"> |
| | | <el-input v-model="form.medicalInsurancePersonal" style="width: 200px;" :disabled="disabledFlagByApprove" @blur="medicalParameterBlur"> |
| | | <template slot="append">%</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="个人缴纳金额" prop="medicalInsurancePersonalAmount"> |
| | | <money-input :key="medicalInsurancePersonalAmountRandom" v-model="form.medicalInsurancePersonalAmount" :width="200" :disabled="disabledFlagByApprove" @blur="statisticalAmount" /> |
| | | </el-form-item> |
| | | <el-form-item label="公司缴纳比例" prop="medicalInsuranceCompany"> |
| | | <el-input v-model="form.medicalInsuranceCompany" style="width: 200px;" :disabled="disabledFlagByApprove" @blur="medicalParameterBlur"> |
| | | <template slot="append">%</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="公司缴纳金额" prop="medicalInsuranceCompanyAmount"> |
| | | <money-input :key="medicalInsuranceCompanyAmountRandom" v-model="form.medicalInsuranceCompanyAmount" :width="200" :disabled="disabledFlagByApprove" @blur="statisticalAmount" /> |
| | | </el-form-item> |
| | | <el-divider>失业险</el-divider> |
| | | <el-form-item label="基数" prop="unemploymentInsurance"> |
| | | <money-input :key="unemploymentInsuranceRandom" v-model="form.unemploymentInsurance" :width="523" :disabled="disabledFlagByApprove" @blur="unemploymentParameterBlur" /> |
| | | </el-form-item> |
| | | <el-form-item label="个人缴纳比例" prop="unemploymentInsurancePersonal"> |
| | | <el-input v-model="form.unemploymentInsurancePersonal" style="width: 200px;" :disabled="disabledFlagByApprove" @blur="unemploymentParameterBlur"> |
| | | <template slot="append">%</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="个人缴纳金额" prop="unemploymentInsurancePersonalAmount"> |
| | | <money-input :key="unemploymentInsurancePersonalAmountRandom" v-model="form.unemploymentInsurancePersonalAmount" :width="200" :disabled="disabledFlagByApprove" @blur="statisticalAmount" /> |
| | | </el-form-item> |
| | | <el-form-item label="公司缴纳比例" prop="unemploymentInsuranceCompany"> |
| | | <el-input v-model="form.unemploymentInsuranceCompany" style="width: 200px;" :disabled="disabledFlagByApprove" @blur="unemploymentParameterBlur"> |
| | | <template slot="append">%</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="公司缴纳金额" prop="unemploymentInsuranceCompanyAmount"> |
| | | <money-input :key="unemploymentInsuranceCompanyAmountRandom" v-model="form.unemploymentInsuranceCompanyAmount" :width="200" :disabled="disabledFlagByApprove" @blur="statisticalAmount" /> |
| | | </el-form-item> |
| | | <el-divider>生育险</el-divider> |
| | | <el-form-item label="基数" prop="birthInsurance"> |
| | | <money-input :key="birthInsuranceRandom" v-model="form.birthInsurance" :width="523" :disabled="disabledFlagByApprove" @blur="maternityParameterBlur" /> |
| | | </el-form-item> |
| | | <el-form-item label="个人缴纳比例" prop="birthInsurancePersonal"> |
| | | <el-input v-model="form.birthInsurancePersonal" style="width: 200px;" :disabled="disabledFlagByApprove" @blur="maternityParameterBlur"> |
| | | <template slot="append">%</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="个人缴纳金额" prop="birthInsurancePersonalAmount"> |
| | | <money-input :key="birthInsurancePersonalAmountRandom" v-model="form.birthInsurancePersonalAmount" :width="200" :disabled="disabledFlagByApprove" @blur="statisticalAmount" /> |
| | | </el-form-item> |
| | | <el-form-item label="公司缴纳比例" prop="birthInsuranceCompany"> |
| | | <el-input v-model="form.birthInsuranceCompany" style="width: 200px;" :disabled="disabledFlagByApprove" @blur="maternityParameterBlur"> |
| | | <template slot="append">%</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="公司缴纳金额" prop="birthInsuranceCompanyAmount"> |
| | | <money-input :key="birthInsuranceCompanyAmountRandom" v-model="form.birthInsuranceCompanyAmount" :width="200" :disabled="disabledFlagByApprove" @blur="statisticalAmount" /> |
| | | </el-form-item> |
| | | <el-divider>工伤险</el-divider> |
| | | <el-form-item label="基数" prop="employmentInsurance"> |
| | | <money-input :key="employmentInsuranceRandom" v-model="form.employmentInsurance" :width="523" :disabled="disabledFlagByApprove" @blur="industrialInjuryParameterBlur" /> |
| | | </el-form-item> |
| | | <el-form-item label="个人缴纳比例" prop="employmentInsurancePersonal"> |
| | | <el-input v-model="form.employmentInsurancePersonal" style="width: 200px;" :disabled="disabledFlagByApprove" @blur="industrialInjuryParameterBlur"> |
| | | <template slot="append">%</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="个人缴纳金额" prop="employmentInsurancePersonalAmount"> |
| | | <money-input :key="employmentInsurancePersonalAmountRandom" v-model="form.employmentInsurancePersonalAmount" :width="200" :disabled="disabledFlagByApprove" @blur="statisticalAmount" /> |
| | | </el-form-item> |
| | | <el-form-item label="公司缴纳比例" prop="employmentInsuranceCompany"> |
| | | <el-input v-model="form.employmentInsuranceCompany" style="width: 200px;" :disabled="disabledFlagByApprove" @blur="industrialInjuryParameterBlur"> |
| | | <template slot="append">%</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="公司缴纳金额" prop="employmentInsuranceCompanyAmount"> |
| | | <money-input :key="employmentInsuranceCompanyAmountRandom" v-model="form.employmentInsuranceCompanyAmount" :width="200" :disabled="disabledFlagByApprove" @blur="statisticalAmount" /> |
| | | </el-form-item> |
| | | <el-divider>统计</el-divider> |
| | | <el-form-item label="税前金额" prop="preTaxAmount"> |
| | | <money-input :key="preTaxAmountRandom" v-model="form.preTaxAmount" :width="200" :disabled="disabledFlagByApprove" @blur="preTaxAmountBlur" /> |
| | | </el-form-item> |
| | | <el-form-item label="个人所得税" prop="individualIncomeTax"> |
| | | <money-input :key="individualIncomeTaxRandom" v-model="form.individualIncomeTax" :width="200" :disabled="disabledFlagByApprove" @blur="individualIncomeTaxBlur" /> |
| | | </el-form-item> |
| | | <el-form-item label="税后金额" prop="afterTaxAmount"> |
| | | <money-input :key="afterTaxAmountRandom" v-model="form.afterTaxAmount" :width="523" :disabled="disabledFlagByApprove" /> |
| | | </el-form-item> |
| | | <el-form-item label="备注"> |
| | | <el-input v-model="form.remarks" :rows="3" type="textarea" style="width: 523px;" :disabled="disabledFlagByApprove" /> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button type="text" @click="crud.cancelCU">取消</el-button> |
| | | <el-button :loading="crud.status.cu === 2" type="primary" @click="crud.submitCU">确认</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | <!--表格渲染--> |
| | | <el-table ref="table" v-loading="crud.loading" :data="crud.data" size="small" style="width: 100%;" @selection-change="crud.selectionChangeHandler"> |
| | | <el-table-column type="selection" width="55" /> |
| | | <el-table-column :show-overflow-tooltip="true" prop="userNickName" label="所属员工" fixed="left" width="100"> |
| | | <template slot-scope="scope"> |
| | | <el-tag>{{ scope.row.userNickName }}</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column :show-overflow-tooltip="true" prop="salaryYearMonth" label="工资年月" fixed="left" width="100"> |
| | | <template slot-scope="scope"> |
| | | {{ crud.toMonth(scope.row.salaryYearMonth) }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column :show-overflow-tooltip="true" prop="actualBasicWage" label="基础工资" width="100"> |
| | | <template slot-scope="scope"> |
| | | {{ crud.toMoney(scope.row.actualBasicWage) }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column :show-overflow-tooltip="true" prop="actualAchievementsWage" label="绩效工资" width="100"> |
| | | <template slot-scope="scope"> |
| | | {{ crud.toMoney(scope.row.actualAchievementsWage) }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column :show-overflow-tooltip="true" prop="actualPerformanceWage" label="业绩工资" width="100"> |
| | | <template slot-scope="scope"> |
| | | {{ crud.toMoney(scope.row.actualPerformanceWage) }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column :show-overflow-tooltip="true" prop="actualTeamWage" label="团队工资" width="100"> |
| | | <template slot-scope="scope"> |
| | | {{ crud.toMoney(scope.row.actualTeamWage) }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column :show-overflow-tooltip="true" prop="accumulationFundPersonalAmount" label="公积金·个人缴纳金额" width="100"> |
| | | <template slot-scope="scope"> |
| | | {{ crud.toMoney(scope.row.accumulationFundPersonalAmount) }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column :show-overflow-tooltip="true" prop="retirementInsurancePersonalAmount" label="养老险·个人缴纳金额" width="100"> |
| | | <template slot-scope="scope"> |
| | | {{ crud.toMoney(scope.row.retirementInsurancePersonalAmount) }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column :show-overflow-tooltip="true" prop="medicalInsurancePersonalAmount" label="医疗险·个人缴纳金额" width="100"> |
| | | <template slot-scope="scope"> |
| | | {{ crud.toMoney(scope.row.medicalInsurancePersonalAmount) }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column :show-overflow-tooltip="true" prop="unemploymentInsurancePersonalAmount" label="失业险·个人缴纳金额" width="100"> |
| | | <template slot-scope="scope"> |
| | | {{ crud.toMoney(scope.row.unemploymentInsurancePersonalAmount) }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column :show-overflow-tooltip="true" prop="birthInsurancePersonalAmount" label="生育险·个人缴纳金额" width="100"> |
| | | <template slot-scope="scope"> |
| | | {{ crud.toMoney(scope.row.birthInsurancePersonalAmount) }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column :show-overflow-tooltip="true" prop="employmentInsurancePersonalAmount" label="工伤险·个人缴纳金额" width="100"> |
| | | <template slot-scope="scope"> |
| | | {{ crud.toMoney(scope.row.employmentInsurancePersonalAmount) }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column :show-overflow-tooltip="true" prop="preTaxAmount" label="税前金额" width="100"> |
| | | <template slot-scope="scope"> |
| | | {{ crud.toMoney(scope.row.preTaxAmount) }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column :show-overflow-tooltip="true" prop="individualIncomeTax" label="个人所得税" width="100"> |
| | | <template slot-scope="scope"> |
| | | {{ crud.toMoney(scope.row.individualIncomeTax) }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column :show-overflow-tooltip="true" prop="afterTaxAmount" label="税后金额" width="100"> |
| | | <template slot-scope="scope"> |
| | | {{ crud.toMoney(scope.row.afterTaxAmount) }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column :show-overflow-tooltip="true" prop="remarks" label="备注" width="140" /> |
| | | <el-table-column :show-overflow-tooltip="true" prop="createTime" label="创建时间" width="140" /> |
| | | <el-table-column :show-overflow-tooltip="true" prop="publicityStatus" label="公示状态" width="80" fixed="right"> |
| | | <template slot-scope="scope"> |
| | | <el-tag>{{ dict.label[publicityStatus][scope.row.publicityStatus] }}</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column :show-overflow-tooltip="true" prop="approveStatus" label="承认状态" width="80" fixed="right"> |
| | | <template slot-scope="scope"> |
| | | <el-tag>{{ dict.label[approveStatus][scope.row.approveStatus] }}</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column v-if="checkPer(['admin','salary:edit','salary:del','salary:publicity','salary:approve'])" label="操作" width="210px" align="center" fixed="right"> |
| | | <template slot-scope="scope"> |
| | | <udOperation |
| | | :data="scope.row" |
| | | :permission="permission" |
| | | > |
| | | <el-popover slot="left" :ref="`publicity_${scope.row.id}`" v-permission="permission.publicity" placement="top" width="180"> |
| | | <p>确定公示本条数据吗?</p> |
| | | <div style="text-align: right; margin: 0"> |
| | | <el-button size="mini" type="text" @click="publicityCancel(scope.row)">取消</el-button> |
| | | <el-button :loading="publicityLoading" type="primary" size="mini" @click="doPublicity(scope.row)">确定</el-button> |
| | | </div> |
| | | <el-button slot="reference" type="primary" icon="el-icon-s-check" size="mini" /> |
| | | </el-popover> |
| | | <el-popover slot="left" :ref="`approve_${scope.row.id}`" v-permission="permission.approve" placement="top" width="180"> |
| | | <p>确定承认本条数据吗?</p> |
| | | <div style="text-align: right; margin: 0"> |
| | | <el-button size="mini" type="text" @click="approveCancel(scope.row)">取消</el-button> |
| | | <el-button :loading="approveLoading" type="primary" size="mini" @click="doApprove(scope.row)">确定</el-button> |
| | | </div> |
| | | <el-button slot="reference" type="primary" icon="el-icon-finished" size="mini" style="margin-left: 3px;" /> |
| | | </el-popover> |
| | | </udOperation> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <!--分页组件--> |
| | | <pagination /> |
| | | <!--表单组件--> |
| | | <el-dialog :close-on-click-modal="false" :before-close="closeGenerate" :visible.sync="generateStatus" title="生成工资记录" width="500px"> |
| | | <el-form ref="generateForm" :model="generateForm" :rules="generateRules" size="small" label-width="80px"> |
| | | <el-form-item label="工资年月" prop="targetYearMonth"> |
| | | <el-date-picker |
| | | v-model="generateForm.targetYearMonth" |
| | | type="month" |
| | | style="width: 370px;" |
| | | placeholder="请选择" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="所属员工" prop="userId"> |
| | | <el-select v-model="generateForm.userId" filterable clearable placeholder="请选择" style="width: 370px;"> |
| | | <el-option |
| | | v-for="item in users" |
| | | :key="item.id" |
| | | :label="item.nickName" |
| | | :value="item.id" |
| | | :disabled="!item.enabled" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button type="text" @click="closeGenerate">取消</el-button> |
| | | <el-button :loading="generateLoading" type="primary" @click="submitGenerate">确认</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import crudNewSalary from '@/api/salary/newSalary' |
| | | import CRUD, { presenter, header, form, crud } from '@crud/crud' |
| | | import rrOperation from '@crud/RR.operation' |
| | | import crudOperation from '@crud/CRUD.operation' |
| | | import udOperation from '@crud/UD.operation' |
| | | import pagination from '@crud/Pagination' |
| | | import moneyInput from '../../assembly/moneyInput/index.vue' |
| | | import constant from '../../../utils/constant' |
| | | import crudUser from '@/api/system/user' |
| | | import crudUserLevelWage from '@/api/treatment/userLevelWage' |
| | | import crudUserLevelInsurance from '@/api/treatment/userInsurance' |
| | | import crudUserLevelOther from '@/api/system/userLevelOther' |
| | | import crudAttendance from '@/api/attendance/attendance' |
| | | import crudTaskDaliy from '@/api/task/taskDaliy' |
| | | import crudProjectPerformanceDetail from '@/api/project/projectPerformanceDetail' |
| | | import crudSysConfigIndividualIncomeTax from '@/api/system/configIndividualIncomeTax' |
| | | |
| | | const defaultForm = { id: null, userId: null, salaryYearMonth: null, basicWage: null, fullDays: null, absenceDays: null, actualBasicWage: null, achievementsWage: null, needCompletedAchievementsHours: null, alreadyCompletedAchievementsHours: null, actualAchievementsWage: null, performanceWage: null, personalPerformanceProportion: null, needCompletedPerformanceHours: null, alreadyCompletedPerformanceHours: null, actualPerformanceWage: null, teamWage: null, actualComplianceTeamHours: null, alreadyCompletedTeamHours: null, actualTeamWage: null, pieceRate: 0, travelAllowance: 0, accumulationFund: null, accumulationFundPersonal: null, accumulationFundPersonalAmount: null, accumulationFundCompany: null, accumulationFundCompanyAmount: null, retirementInsurance: null, retirementInsurancePersonal: null, retirementInsurancePersonalAmount: null, retirementInsuranceCompany: null, retirementInsuranceCompanyAmount: null, medicalInsurance: null, medicalInsurancePersonal: null, medicalInsurancePersonalAmount: null, medicalInsuranceCompany: null, medicalInsuranceCompanyAmount: null, unemploymentInsurance: null, unemploymentInsurancePersonal: null, unemploymentInsurancePersonalAmount: null, unemploymentInsuranceCompany: null, unemploymentInsuranceCompanyAmount: null, birthInsurance: null, birthInsurancePersonal: null, birthInsurancePersonalAmount: null, birthInsuranceCompany: null, birthInsuranceCompanyAmount: null, employmentInsurance: null, employmentInsurancePersonal: null, employmentInsurancePersonalAmount: null, employmentInsuranceCompany: null, employmentInsuranceCompanyAmount: null, preTaxAmount: null, individualIncomeTax: null, afterTaxAmount: null, remarks: null, publicityStatus: constant.PUBLICITY_STATUS_NOT, approveStatus: constant.APPROVE_STATUS_UNRECOGNIZED, createBy: null, createTime: null, updateBy: null, updateTime: null } |
| | | export default { |
| | | name: 'NewSalary', |
| | | components: { pagination, crudOperation, rrOperation, udOperation, moneyInput }, |
| | | mixins: [presenter(), header(), form(defaultForm), crud()], |
| | | dicts: [constant.PUBLICITY_STATUS, constant.APPROVE_STATUS], |
| | | cruds() { |
| | | return CRUD({ title: '工资记录', url: 'api/newSalary', idField: 'id', sort: 'salaryYearMonth,desc', crudMethod: { ...crudNewSalary }}) |
| | | }, |
| | | data() { |
| | | // 工资(千万内)验证 |
| | | var wageValidate = (rule, value, callback) => { |
| | | if (value != null && value !== '' && (isNaN(value) || Number(value) < 0 || Number(value) > 10000000)) { |
| | | callback(new Error('请输入 一千万 以内的正整数或两位小数')) |
| | | } else { |
| | | callback() |
| | | } |
| | | } |
| | | // 比例(百内)验证 |
| | | var proportionValidate = (rule, value, callback) => { |
| | | const reg = /^([0-9]|[1-9]\d)(\.\d{1,2})?$|100$/ |
| | | if (value != null && value !== '' && !reg.test(value)) { |
| | | callback(new Error('请输入 一百 以内的正整数或两位小数')) |
| | | } else { |
| | | callback() |
| | | } |
| | | } |
| | | // 时长(千内)验证 |
| | | var durationValidate = (rule, value, callback) => { |
| | | const reg = /^([0-9]|[1-9]\d{1,2})(\.\d{1,2})?$|1000$/ |
| | | if (value != null && value !== '' && !reg.test(value)) { |
| | | callback(new Error('请输入 一千 以内的正整数或两位小数')) |
| | | } else { |
| | | callback() |
| | | } |
| | | } |
| | | return { |
| | | permission: { |
| | | add: ['admin', 'newSalary:add'], |
| | | edit: ['admin', 'newSalary:edit'], |
| | | del: ['admin', 'newSalary:del'], |
| | | download: ['admin', 'newSalary:download'], |
| | | publicity: ['admin', 'newSalary:publicity'], |
| | | approve: ['admin', 'newSalary:approve'], |
| | | generate: ['admin', 'newSalary:generate'], |
| | | queryUserId: ['admin', 'newSalary:queryUserId'] |
| | | }, |
| | | rules: { |
| | | userId: [ |
| | | { required: true, message: '所属员工不能为空', trigger: 'change' } |
| | | ], |
| | | salaryYearMonth: [ |
| | | { required: true, message: '工资年月不能为空', trigger: 'change' } |
| | | ], |
| | | basicWage: [ |
| | | { required: true, message: '预计基本工资不能为空', trigger: 'blur' }, |
| | | { validator: wageValidate, trigger: 'blur' } |
| | | ], |
| | | fullDays: [ |
| | | { required: true, message: '全勤小时数不能为空', trigger: 'blur' }, |
| | | { validator: durationValidate, trigger: 'blur' } |
| | | ], |
| | | absenceDays: [ |
| | | { required: true, message: '缺勤小时数不能为空', trigger: 'blur' }, |
| | | { validator: durationValidate, trigger: 'blur' } |
| | | ], |
| | | actualBasicWage: [ |
| | | { required: true, message: '实际基础工资不能为空', trigger: 'blur' }, |
| | | { validator: wageValidate, trigger: 'blur' } |
| | | ], |
| | | achievementsWage: [ |
| | | { required: true, message: '预计绩效工资不能为空', trigger: 'blur' }, |
| | | { validator: wageValidate, trigger: 'blur' } |
| | | ], |
| | | needCompletedAchievementsHours: [ |
| | | { required: true, message: '应完成绩效工时不能为空', trigger: 'blur' }, |
| | | { validator: durationValidate, trigger: 'blur' } |
| | | ], |
| | | alreadyCompletedAchievementsHours: [ |
| | | { required: true, message: '已完成绩效工时不能为空', trigger: 'blur' }, |
| | | { validator: durationValidate, trigger: 'blur' } |
| | | ], |
| | | actualAchievementsWage: [ |
| | | { required: true, message: '实际绩效工资不能为空', trigger: 'blur' }, |
| | | { validator: wageValidate, trigger: 'blur' } |
| | | ], |
| | | performanceWage: [ |
| | | { required: true, message: '预计业绩工资不能为空', trigger: 'blur' }, |
| | | { validator: wageValidate, trigger: 'blur' } |
| | | ], |
| | | personalPerformanceProportion: [ |
| | | { required: true, message: '个人业绩比例不能为空', trigger: 'blur' }, |
| | | { validator: proportionValidate, trigger: 'blur' } |
| | | ], |
| | | needCompletedPerformanceHours: [ |
| | | { required: true, message: '应完成业绩工时不能为空', trigger: 'blur' }, |
| | | { validator: durationValidate, trigger: 'blur' } |
| | | ], |
| | | alreadyCompletedPerformanceHours: [ |
| | | { required: true, message: '已完成业绩工时不能为空', trigger: 'blur' }, |
| | | { validator: durationValidate, trigger: 'blur' } |
| | | ], |
| | | actualPerformanceWage: [ |
| | | { required: true, message: '实际业绩工资不能为空', trigger: 'blur' }, |
| | | { validator: wageValidate, trigger: 'blur' } |
| | | ], |
| | | teamWage: [ |
| | | { required: true, message: '预计团队工资不能为空', trigger: 'blur' }, |
| | | { validator: wageValidate, trigger: 'blur' } |
| | | ], |
| | | actualComplianceTeamHours: [ |
| | | { required: true, message: '实达标团队工时不能为空', trigger: 'blur' }, |
| | | { validator: durationValidate, trigger: 'blur' } |
| | | ], |
| | | alreadyCompletedTeamHours: [ |
| | | { required: true, message: '已完成团队工时不能为空', trigger: 'blur' }, |
| | | { validator: durationValidate, trigger: 'blur' } |
| | | ], |
| | | actualTeamWage: [ |
| | | { required: true, message: '实际团队工资不能为空', trigger: 'blur' }, |
| | | { validator: wageValidate, trigger: 'blur' } |
| | | ], |
| | | accumulationFund: [ |
| | | { required: true, message: '公积金基数不能为空', trigger: 'blur' }, |
| | | { validator: wageValidate, trigger: 'blur' } |
| | | ], |
| | | accumulationFundPersonal: [ |
| | | { required: true, message: '公积金个人缴纳比例不能为空', trigger: 'blur' }, |
| | | { validator: proportionValidate, trigger: 'blur' } |
| | | ], |
| | | accumulationFundPersonalAmount: [ |
| | | { required: true, message: '公积金个人缴纳金额不能为空', trigger: 'blur' }, |
| | | { validator: wageValidate, trigger: 'blur' } |
| | | ], |
| | | accumulationFundCompany: [ |
| | | { required: true, message: '公积金公司缴纳比例不能为空', trigger: 'blur' }, |
| | | { validator: proportionValidate, trigger: 'blur' } |
| | | ], |
| | | accumulationFundCompanyAmount: [ |
| | | { required: true, message: '公积金公司缴纳金额不能为空', trigger: 'blur' }, |
| | | { validator: wageValidate, trigger: 'blur' } |
| | | ], |
| | | retirementInsurance: [ |
| | | { required: true, message: '养老险基数不能为空', trigger: 'blur' }, |
| | | { validator: wageValidate, trigger: 'blur' } |
| | | ], |
| | | retirementInsurancePersonal: [ |
| | | { required: true, message: '养老险个人缴纳比例不能为空', trigger: 'blur' }, |
| | | { validator: proportionValidate, trigger: 'blur' } |
| | | ], |
| | | retirementInsurancePersonalAmount: [ |
| | | { required: true, message: '养老险个人缴纳金额不能为空', trigger: 'blur' }, |
| | | { validator: wageValidate, trigger: 'blur' } |
| | | ], |
| | | retirementInsuranceCompany: [ |
| | | { required: true, message: '养老险公司缴纳比例不能为空', trigger: 'blur' }, |
| | | { validator: proportionValidate, trigger: 'blur' } |
| | | ], |
| | | retirementInsuranceCompanyAmount: [ |
| | | { required: true, message: '养老险公司缴纳金额不能为空', trigger: 'blur' }, |
| | | { validator: wageValidate, trigger: 'blur' } |
| | | ], |
| | | medicalInsurance: [ |
| | | { required: true, message: '医疗险基数不能为空', trigger: 'blur' }, |
| | | { validator: wageValidate, trigger: 'blur' } |
| | | ], |
| | | medicalInsurancePersonal: [ |
| | | { required: true, message: '医疗险个人缴纳比例不能为空', trigger: 'blur' }, |
| | | { validator: proportionValidate, trigger: 'blur' } |
| | | ], |
| | | medicalInsurancePersonalAmount: [ |
| | | { required: true, message: '医疗险个人缴纳金额不能为空', trigger: 'blur' }, |
| | | { validator: wageValidate, trigger: 'blur' } |
| | | ], |
| | | medicalInsuranceCompany: [ |
| | | { required: true, message: '医疗险公司缴纳比例不能为空', trigger: 'blur' }, |
| | | { validator: proportionValidate, trigger: 'blur' } |
| | | ], |
| | | medicalInsuranceCompanyAmount: [ |
| | | { required: true, message: '医疗险公司缴纳金额不能为空', trigger: 'blur' }, |
| | | { validator: wageValidate, trigger: 'blur' } |
| | | ], |
| | | unemploymentInsurance: [ |
| | | { required: true, message: '失业险基数不能为空', trigger: 'blur' }, |
| | | { validator: wageValidate, trigger: 'blur' } |
| | | ], |
| | | unemploymentInsurancePersonal: [ |
| | | { required: true, message: '失业险个人缴纳比例不能为空', trigger: 'blur' }, |
| | | { validator: proportionValidate, trigger: 'blur' } |
| | | ], |
| | | unemploymentInsurancePersonalAmount: [ |
| | | { required: true, message: '失业险个人缴纳金额不能为空', trigger: 'blur' }, |
| | | { validator: wageValidate, trigger: 'blur' } |
| | | ], |
| | | unemploymentInsuranceCompany: [ |
| | | { required: true, message: '失业险公司缴纳比例不能为空', trigger: 'blur' }, |
| | | { validator: proportionValidate, trigger: 'blur' } |
| | | ], |
| | | unemploymentInsuranceCompanyAmount: [ |
| | | { required: true, message: '失业险公司缴纳金额不能为空', trigger: 'blur' }, |
| | | { validator: wageValidate, trigger: 'blur' } |
| | | ], |
| | | birthInsurance: [ |
| | | { required: true, message: '生育险基数不能为空', trigger: 'blur' }, |
| | | { validator: wageValidate, trigger: 'blur' } |
| | | ], |
| | | birthInsurancePersonal: [ |
| | | { required: true, message: '生育险个人缴纳比例不能为空', trigger: 'blur' }, |
| | | { validator: proportionValidate, trigger: 'blur' } |
| | | ], |
| | | birthInsurancePersonalAmount: [ |
| | | { required: true, message: '生育险个人缴纳金额不能为空', trigger: 'blur' }, |
| | | { validator: wageValidate, trigger: 'blur' } |
| | | ], |
| | | birthInsuranceCompany: [ |
| | | { required: true, message: '生育险公司缴纳比例不能为空', trigger: 'blur' }, |
| | | { validator: proportionValidate, trigger: 'blur' } |
| | | ], |
| | | birthInsuranceCompanyAmount: [ |
| | | { required: true, message: '生育险公司缴纳金额不能为空', trigger: 'blur' }, |
| | | { validator: wageValidate, trigger: 'blur' } |
| | | ], |
| | | employmentInsurance: [ |
| | | { required: true, message: '工伤险基数不能为空', trigger: 'blur' }, |
| | | { validator: wageValidate, trigger: 'blur' } |
| | | ], |
| | | employmentInsurancePersonal: [ |
| | | { required: true, message: '工伤险个人缴纳比例不能为空', trigger: 'blur' }, |
| | | { validator: proportionValidate, trigger: 'blur' } |
| | | ], |
| | | employmentInsurancePersonalAmount: [ |
| | | { required: true, message: '工伤险个人缴纳金额不能为空', trigger: 'blur' }, |
| | | { validator: wageValidate, trigger: 'blur' } |
| | | ], |
| | | employmentInsuranceCompany: [ |
| | | { required: true, message: '工伤险公司缴纳比例不能为空', trigger: 'blur' }, |
| | | { validator: proportionValidate, trigger: 'blur' } |
| | | ], |
| | | employmentInsuranceCompanyAmount: [ |
| | | { required: true, message: '工伤险公司缴纳金额不能为空', trigger: 'blur' }, |
| | | { validator: wageValidate, trigger: 'blur' } |
| | | ], |
| | | preTaxAmount: [ |
| | | { required: true, message: '税前金额不能为空', trigger: 'blur' }, |
| | | { validator: wageValidate, trigger: 'blur' } |
| | | ], |
| | | individualIncomeTax: [ |
| | | { required: true, message: '个人所得税不能为空', trigger: 'blur' }, |
| | | { validator: wageValidate, trigger: 'blur' } |
| | | ], |
| | | afterTaxAmount: [ |
| | | { required: true, message: '税后金额不能为空', trigger: 'blur' }, |
| | | { validator: wageValidate, trigger: 'blur' } |
| | | ] |
| | | }, |
| | | queryTypeOptions: [ |
| | | { key: 'userId', display_name: '所属员工' }, |
| | | { key: 'salaryYearMonth', display_name: '工资年月' } |
| | | ], |
| | | // 字典:公示状态 |
| | | publicityStatus: constant.PUBLICITY_STATUS, |
| | | // 字典:承认状态 |
| | | approveStatus: constant.APPROVE_STATUS, |
| | | // 用户列表 |
| | | users: [], |
| | | // 表单加载 |
| | | formLoading: false, |
| | | // 公示弹窗加载 |
| | | publicityLoading: false, |
| | | // 承认弹窗加载 |
| | | approveLoading: false, |
| | | // 表单禁用标记(承认状态) |
| | | disabledFlagByApprove: false, |
| | | // 生成表单状态 |
| | | generateStatus: false, |
| | | // 生成表单加载 |
| | | generateLoading: false, |
| | | // 生成表单数据 |
| | | generateForm: { targetYearMonth: null, userId: null }, |
| | | // 生成表单验证 |
| | | generateRules: { |
| | | targetYearMonth: [ |
| | | { required: true, message: '工资年月不能为空', trigger: 'change' } |
| | | ] |
| | | }, |
| | | // 预计基本工资随机数 |
| | | basicWageRandom: 0, |
| | | // 实际基本工资随机数 |
| | | actualBasicWageRandom: 0, |
| | | // 预计绩效工资随机数 |
| | | achievementsWageRandom: 0, |
| | | // 实际绩效工资随机数 |
| | | actualAchievementsWageRandom: 0, |
| | | // 预计业绩工资随机数 |
| | | performanceWageRandom: 0, |
| | | // 实际业绩工资随机数 |
| | | actualPerformanceWageRandom: 0, |
| | | // 预计团队工资随机数 |
| | | teamWageRandom: 0, |
| | | // 实际团队工资随机数 |
| | | actualTeamWageRandom: 0, |
| | | // 计件工资随机数 |
| | | pieceRateRandom: 0, |
| | | // 出差补助工资随机数 |
| | | travelAllowanceRandom: 0, |
| | | // 公积金基数随机数 |
| | | accumulationFundRandom: 0, |
| | | // 公积金个人缴纳金额随机数 |
| | | accumulationFundPersonalAmountRandom: 0, |
| | | // 公积金公司缴纳金额随机数 |
| | | accumulationFundCompanyAmountRandom: 0, |
| | | // 养老险基数随机数 |
| | | retirementInsuranceRandom: 0, |
| | | // 养老险个人缴纳金额随机数 |
| | | retirementInsurancePersonalAmountRandom: 0, |
| | | // 养老险公司缴纳金额随机数 |
| | | retirementInsuranceCompanyAmountRandom: 0, |
| | | // 医疗险基数随机数 |
| | | medicalInsuranceRandom: 0, |
| | | // 医疗险个人缴纳金额随机数 |
| | | medicalInsurancePersonalAmountRandom: 0, |
| | | // 医疗险公司缴纳金额随机数 |
| | | medicalInsuranceCompanyAmountRandom: 0, |
| | | // 失业险基数随机数 |
| | | unemploymentInsuranceRandom: 0, |
| | | // 失业险个人缴纳金额随机数 |
| | | unemploymentInsurancePersonalAmountRandom: 0, |
| | | // 失业险公司缴纳金额随机数 |
| | | unemploymentInsuranceCompanyAmountRandom: 0, |
| | | // 生育险基数随机数 |
| | | birthInsuranceRandom: 0, |
| | | // 生育险个人缴纳金额随机数 |
| | | birthInsurancePersonalAmountRandom: 0, |
| | | // 生育险公司缴纳金额随机数 |
| | | birthInsuranceCompanyAmountRandom: 0, |
| | | // 工伤险基数随机数 |
| | | employmentInsuranceRandom: 0, |
| | | // 工伤险个人缴纳金额随机数 |
| | | employmentInsurancePersonalAmountRandom: 0, |
| | | // 工伤险公司缴纳金额随机数 |
| | | employmentInsuranceCompanyAmountRandom: 0, |
| | | // 税前金额随机数 |
| | | preTaxAmountRandom: 0, |
| | | // 个人所得税随机数 |
| | | individualIncomeTaxRandom: 0, |
| | | // 税后金额随机数 |
| | | afterTaxAmountRandom: 0 |
| | | } |
| | | }, |
| | | methods: { |
| | | // 钩子:在获取表格数据之前执行,false 则代表不获取数据 |
| | | [CRUD.HOOK.beforeRefresh]() { |
| | | // 获取用户 |
| | | this.getUser() |
| | | return true |
| | | }, |
| | | // 获取用户 |
| | | getUser() { |
| | | // 获取用户 |
| | | crudUser.getAll().then(res => { |
| | | // 用户列表 |
| | | this.users = res |
| | | }) |
| | | }, |
| | | // 钩子: 开始 "新建/编辑" - 之前 |
| | | [CRUD.HOOK.beforeToCU]() { |
| | | // 判断表单承认状态 |
| | | if (this.form.approveStatus === constant.APPROVE_STATUS_ACKNOWLEDGED) { |
| | | // 表单禁用标记(承认状态) |
| | | this.disabledFlagByApprove = true |
| | | } else { |
| | | // 表单禁用标记(承认状态) |
| | | this.disabledFlagByApprove = false |
| | | } |
| | | // 预计基本工资随机数 |
| | | this.basicWageRandom = Math.random() |
| | | // 实际基本工资随机数 |
| | | this.actualBasicWageRandom = Math.random() |
| | | // 预计绩效工资随机数 |
| | | this.achievementsWageRandom = Math.random() |
| | | // 实际绩效工资随机数 |
| | | this.actualAchievementsWageRandom = Math.random() |
| | | // 预计业绩工资随机数 |
| | | this.performanceWageRandom = Math.random() |
| | | // 实际业绩工资随机数 |
| | | this.actualPerformanceWageRandom = Math.random() |
| | | // 预计团队工资随机数 |
| | | this.teamWageRandom = Math.random() |
| | | // 实际团队工资随机数 |
| | | this.actualTeamWageRandom = Math.random() |
| | | // 公积金基数随机数 |
| | | this.accumulationFundRandom = Math.random() |
| | | // 公积金个人缴纳金额随机数 |
| | | this.accumulationFundPersonalAmountRandom = Math.random() |
| | | // 公积金公司缴纳金额随机数 |
| | | this.accumulationFundCompanyAmountRandom = Math.random() |
| | | // 养老险基数随机数 |
| | | this.retirementInsuranceRandom = Math.random() |
| | | // 养老险个人缴纳金额随机数 |
| | | this.retirementInsurancePersonalAmountRandom = Math.random() |
| | | // 养老险公司缴纳金额随机数 |
| | | this.retirementInsuranceCompanyAmountRandom = Math.random() |
| | | // 医疗险基数随机数 |
| | | this.medicalInsuranceRandom = Math.random() |
| | | // 医疗险个人缴纳金额随机数 |
| | | this.medicalInsurancePersonalAmountRandom = Math.random() |
| | | // 医疗险公司缴纳金额随机数 |
| | | this.medicalInsuranceCompanyAmountRandom = Math.random() |
| | | // 失业险基数随机数 |
| | | this.unemploymentInsuranceRandom = Math.random() |
| | | // 失业险个人缴纳金额随机数 |
| | | this.unemploymentInsurancePersonalAmountRandom = Math.random() |
| | | // 失业险公司缴纳金额随机数 |
| | | this.unemploymentInsuranceCompanyAmountRandom = Math.random() |
| | | // 生育险基数随机数 |
| | | this.birthInsuranceRandom = Math.random() |
| | | // 生育险个人缴纳金额随机数 |
| | | this.birthInsurancePersonalAmountRandom = Math.random() |
| | | // 生育险公司缴纳金额随机数 |
| | | this.birthInsuranceCompanyAmountRandom = Math.random() |
| | | // 工伤险基数随机数 |
| | | this.employmentInsuranceRandom = Math.random() |
| | | // 工伤险个人缴纳金额随机数 |
| | | this.employmentInsurancePersonalAmountRandom = Math.random() |
| | | // 工伤险公司缴纳金额随机数 |
| | | this.employmentInsuranceCompanyAmountRandom = Math.random() |
| | | // 税前金额随机数 |
| | | this.preTaxAmountRandom = Math.random() |
| | | // 个人所得税随机数 |
| | | this.individualIncomeTaxRandom = Math.random() |
| | | // 税后金额随机数 |
| | | this.afterTaxAmountRandom = Math.random() |
| | | }, |
| | | // 钩子: 编辑 - 之前 |
| | | // [CRUD.HOOK.beforeToEdit]() { |
| | | // // 表单加载 |
| | | // this.formLoading = true |
| | | // }, |
| | | // 获取用户级别数据 |
| | | getUserLevel() { |
| | | // 判断所属员工、工资年月是否为空 |
| | | if (this.form.userId != null && this.form.userId !== '' && this.form.salaryYearMonth != null && this.form.salaryYearMonth !== '') { |
| | | // 表单加载 |
| | | this.formLoading = true |
| | | // 执行完以下内容才往下走:获取用户级别工资、获取用户级别保险、获取用户级别其他、获取工作天数、获取出勤小时数、获取达标工时、获取已完成工时 |
| | | Promise.all([ |
| | | this.getUserLevelWage(), this.getUserLevelInsurance(), this.getUserLevelOther(), this.getWorkDays(), this.getAttendanceHours(), |
| | | this.getComplianceWork(), this.getCompletedWork() |
| | | ]).then(res => { |
| | | // 表单加载 |
| | | this.formLoading = false |
| | | }).catch(() => { |
| | | // 表单加载 |
| | | this.formLoading = false |
| | | }) |
| | | } |
| | | }, |
| | | // 获取用户级别工资 |
| | | getUserLevelWage() { |
| | | return new Promise((resolve, reject) => { |
| | | // 获取用户级别工资 |
| | | crudUserLevelWage.getTargetYearMonth({ userId: this.form.userId, targetYearMonth: this.form.salaryYearMonth }).then(res => { |
| | | console.log(res) |
| | | // 级别基本工资 |
| | | const basicWage = Number(res.basicWage.toFixed(2)) |
| | | // 级别等级工资 |
| | | const rankWage = Number(res.rankWage.toFixed(2)) |
| | | // 预计基本工资 |
| | | this.form.basicWage = Number((basicWage + rankWage).toFixed(2)) |
| | | // 预计基本工资随机数 |
| | | this.basicWageRandom = Math.random() |
| | | // 预计绩效工资 |
| | | this.form.achievementsWage = Number(res.performanceWage.toFixed(2)) |
| | | // 预计绩效工资随机数 |
| | | this.achievementsWageRandom = Math.random() |
| | | // 预计业绩工资 |
| | | this.form.performanceWage = 0 |
| | | // 预计业绩工资随机数 |
| | | this.performanceWageRandom = Math.random() |
| | | // 预计团队工资 |
| | | this.form.teamWage = 0 |
| | | // 预计团队工资随机数 |
| | | this.teamWageRandom = Math.random() |
| | | // 成功 |
| | | resolve() |
| | | }).catch(() => { |
| | | // 预计基本工资 |
| | | this.form.basicWage = 0 |
| | | // 预计基本工资随机数 |
| | | this.basicWageRandom = Math.random() |
| | | // 预计绩效工资 |
| | | this.form.achievementsWage = 0 |
| | | // 预计绩效工资随机数 |
| | | this.achievementsWageRandom = Math.random() |
| | | // 预计业绩工资 |
| | | this.form.performanceWage = 0 |
| | | // 预计业绩工资随机数 |
| | | this.performanceWageRandom = Math.random() |
| | | // 预计团队工资 |
| | | this.form.teamWage = 0 |
| | | // 预计团队工资随机数 |
| | | this.teamWageRandom = Math.random() |
| | | // 失败 |
| | | reject() |
| | | }) |
| | | }) |
| | | }, |
| | | // 获取用户级别保险 |
| | | getUserLevelInsurance() { |
| | | return new Promise((resolve, reject) => { |
| | | // 获取用户级别保险 |
| | | crudUserLevelInsurance.getTargetYearMonth({ userId: this.form.userId, targetYearMonth: this.form.salaryYearMonth }).then(res => { |
| | | // 公积金基数 |
| | | this.form.accumulationFund = Number(res.accumulationFund.toFixed(2)) |
| | | // 公积金基数随机数 |
| | | this.accumulationFundRandom = Math.random() |
| | | // 公积金个人缴纳比例 |
| | | this.form.accumulationFundPersonal = Number(res.accumulationFundPersonal.toFixed(2)) |
| | | // 公积金个人缴纳金额 |
| | | this.form.accumulationFundPersonalAmount = Number((res.accumulationFund * (res.accumulationFundPersonal / 100)).toFixed(2)) |
| | | // 公积金个人缴纳金额随机数 |
| | | this.accumulationFundPersonalAmountRandom = Math.random() |
| | | // 公积金公司缴纳比例 |
| | | this.form.accumulationFundCompany = Number(res.accumulationFundCompany.toFixed(2)) |
| | | // 公积金公司缴纳金额 |
| | | this.form.accumulationFundCompanyAmount = Number((res.accumulationFund * (res.accumulationFundCompany / 100)).toFixed(2)) |
| | | // 公积金公司缴纳金额随机数 |
| | | this.accumulationFundCompanyAmountRandom = Math.random() |
| | | // 养老险基数 |
| | | this.form.retirementInsurance = Number(res.retirementInsurance.toFixed(2)) |
| | | // 养老险基数随机数 |
| | | this.retirementInsuranceRandom = Math.random() |
| | | // 养老险个人缴纳比例 |
| | | this.form.retirementInsurancePersonal = Number(res.retirementInsurancePersonal.toFixed(2)) |
| | | // 养老险个人缴纳金额 |
| | | this.form.retirementInsurancePersonalAmount = Number((res.retirementInsurance * (res.retirementInsurancePersonal / 100)).toFixed(2)) |
| | | // 养老险个人缴纳金额随机数 |
| | | this.retirementInsurancePersonalAmountRandom = Math.random() |
| | | // 养老险公司缴纳比例 |
| | | this.form.retirementInsuranceCompany = Number(res.retirementInsuranceCompany.toFixed(2)) |
| | | // 养老险公司缴纳金额 |
| | | this.form.retirementInsuranceCompanyAmount = Number((res.retirementInsurance * (res.retirementInsuranceCompany / 100)).toFixed(2)) |
| | | // 养老险公司缴纳金额随机数 |
| | | this.retirementInsuranceCompanyAmountRandom = Math.random() |
| | | // 医疗险基数 |
| | | this.form.medicalInsurance = Number(res.medicalInsurance.toFixed(2)) |
| | | // 医疗险基数随机数 |
| | | this.medicalInsuranceRandom = Math.random() |
| | | // 医疗险个人缴纳比例 |
| | | this.form.medicalInsurancePersonal = Number(res.medicalInsurancePersonal.toFixed(2)) |
| | | // 医疗险个人缴纳金额 |
| | | this.form.medicalInsurancePersonalAmount = Number((res.medicalInsurance * (res.medicalInsurancePersonal / 100)).toFixed(2)) |
| | | // 医疗险个人缴纳金额随机数 |
| | | this.medicalInsurancePersonalAmountRandom = Math.random() |
| | | // 医疗险公司缴纳比例 |
| | | this.form.medicalInsuranceCompany = Number(res.medicalInsuranceCompany.toFixed(2)) |
| | | // 医疗险公司缴纳金额 |
| | | this.form.medicalInsuranceCompanyAmount = Number((res.medicalInsurance * (res.medicalInsuranceCompany / 100)).toFixed(2)) |
| | | // 医疗险公司缴纳金额随机数 |
| | | this.medicalInsuranceCompanyAmountRandom = Math.random() |
| | | // 失业险基数 |
| | | this.form.unemploymentInsurance = Number(res.unemploymentInsurance.toFixed(2)) |
| | | // 失业险基数随机数 |
| | | this.unemploymentInsuranceRandom = Math.random() |
| | | // 失业险个人缴纳比例 |
| | | this.form.unemploymentInsurancePersonal = Number(res.unemploymentInsurancePersonal.toFixed(2)) |
| | | // 失业险个人缴纳金额 |
| | | this.form.unemploymentInsurancePersonalAmount = Number((res.unemploymentInsurance * (res.unemploymentInsurancePersonal / 100)).toFixed(2)) |
| | | // 失业险个人缴纳金额随机数 |
| | | this.unemploymentInsurancePersonalAmountRandom = Math.random() |
| | | // 失业险公司缴纳比例 |
| | | this.form.unemploymentInsuranceCompany = Number(res.unemploymentInsuranceCompany.toFixed(2)) |
| | | // 失业险公司缴纳金额 |
| | | this.form.unemploymentInsuranceCompanyAmount = Number((res.unemploymentInsurance * (res.unemploymentInsuranceCompany / 100)).toFixed(2)) |
| | | // 失业险公司缴纳金额随机数 |
| | | this.unemploymentInsuranceCompanyAmountRandom = Math.random() |
| | | // 生育险基数 |
| | | this.form.birthInsurance = Number(res.birthInsurance.toFixed(2)) |
| | | // 生育险基数随机数 |
| | | this.birthInsuranceRandom = Math.random() |
| | | // 生育险个人缴纳比例 |
| | | this.form.birthInsurancePersonal = Number(res.birthInsurancePersonal.toFixed(2)) |
| | | // 生育险个人缴纳金额 |
| | | this.form.birthInsurancePersonalAmount = Number((res.birthInsurance * (res.birthInsurancePersonal / 100)).toFixed(2)) |
| | | // 生育险个人缴纳金额随机数 |
| | | this.birthInsurancePersonalAmountRandom = Math.random() |
| | | // 生育险公司缴纳比例 |
| | | this.form.birthInsuranceCompany = Number(res.birthInsuranceCompany.toFixed(2)) |
| | | // 生育险公司缴纳金额 |
| | | this.form.birthInsuranceCompanyAmount = Number((res.birthInsurance * (res.birthInsuranceCompany / 100)).toFixed(2)) |
| | | // 生育险公司缴纳金额随机数 |
| | | this.birthInsuranceCompanyAmountRandom = Math.random() |
| | | // 工伤险基数 |
| | | this.form.employmentInsurance = Number(res.employmentInsurance.toFixed(2)) |
| | | // 工伤险基数随机数 |
| | | this.employmentInsuranceRandom = Math.random() |
| | | // 工伤险个人缴纳比例 |
| | | this.form.employmentInsurancePersonal = Number(res.employmentInsurancePersonal.toFixed(2)) |
| | | // 工伤险个人缴纳金额 |
| | | this.form.employmentInsurancePersonalAmount = Number((res.employmentInsurance * (res.employmentInsurancePersonal / 100)).toFixed(2)) |
| | | // 工伤险个人缴纳金额随机数 |
| | | this.employmentInsurancePersonalAmountRandom = Math.random() |
| | | // 工伤险公司缴纳比例 |
| | | this.form.employmentInsuranceCompany = Number(res.employmentInsuranceCompany.toFixed(2)) |
| | | // 工伤险公司缴纳金额 |
| | | this.form.employmentInsuranceCompanyAmount = Number((res.employmentInsurance * (res.employmentInsuranceCompany / 100)).toFixed(2)) |
| | | // 工伤险公司缴纳金额随机数 |
| | | this.employmentInsuranceCompanyAmountRandom = Math.random() |
| | | // 成功 |
| | | resolve() |
| | | }).catch(() => { |
| | | // 公积金基数 |
| | | this.form.accumulationFund = 0 |
| | | // 公积金基数随机数 |
| | | this.accumulationFundRandom = Math.random() |
| | | // 公积金个人缴纳比例 |
| | | this.form.accumulationFundPersonal = 0 |
| | | // 公积金个人缴纳金额 |
| | | this.form.accumulationFundPersonalAmount = 0 |
| | | // 公积金个人缴纳金额随机数 |
| | | this.accumulationFundPersonalAmountRandom = Math.random() |
| | | // 公积金公司缴纳比例 |
| | | this.form.accumulationFundCompany = 0 |
| | | // 公积金公司缴纳金额 |
| | | this.form.accumulationFundCompanyAmount = 0 |
| | | // 公积金公司缴纳金额随机数 |
| | | this.accumulationFundCompanyAmountRandom = Math.random() |
| | | // 养老险基数 |
| | | this.form.retirementInsurance = 0 |
| | | // 养老险基数随机数 |
| | | this.retirementInsuranceRandom = Math.random() |
| | | // 养老险个人缴纳比例 |
| | | this.form.retirementInsurancePersonal = 0 |
| | | // 养老险个人缴纳金额 |
| | | this.form.retirementInsurancePersonalAmount = 0 |
| | | // 养老险个人缴纳金额随机数 |
| | | this.retirementInsurancePersonalAmountRandom = Math.random() |
| | | // 养老险公司缴纳比例 |
| | | this.form.retirementInsuranceCompany = 0 |
| | | // 养老险公司缴纳金额 |
| | | this.form.retirementInsuranceCompanyAmount = 0 |
| | | // 养老险公司缴纳金额随机数 |
| | | this.retirementInsuranceCompanyAmountRandom = Math.random() |
| | | // 医疗险基数 |
| | | this.form.medicalInsurance = 0 |
| | | // 医疗险基数随机数 |
| | | this.medicalInsuranceRandom = Math.random() |
| | | // 医疗险个人缴纳比例 |
| | | this.form.medicalInsurancePersonal = 0 |
| | | // 医疗险个人缴纳金额 |
| | | this.form.medicalInsurancePersonalAmount = 0 |
| | | // 医疗险个人缴纳金额随机数 |
| | | this.medicalInsurancePersonalAmountRandom = Math.random() |
| | | // 医疗险公司缴纳比例 |
| | | this.form.medicalInsuranceCompany = 0 |
| | | // 医疗险公司缴纳金额 |
| | | this.form.medicalInsuranceCompanyAmount = 0 |
| | | // 医疗险公司缴纳金额随机数 |
| | | this.medicalInsuranceCompanyAmountRandom = Math.random() |
| | | // 失业险基数 |
| | | this.form.unemploymentInsurance = 0 |
| | | // 失业险基数随机数 |
| | | this.unemploymentInsuranceRandom = Math.random() |
| | | // 失业险个人缴纳比例 |
| | | this.form.unemploymentInsurancePersonal = 0 |
| | | // 失业险个人缴纳金额 |
| | | this.form.unemploymentInsurancePersonalAmount = 0 |
| | | // 失业险个人缴纳金额随机数 |
| | | this.unemploymentInsurancePersonalAmountRandom = Math.random() |
| | | // 失业险公司缴纳比例 |
| | | this.form.unemploymentInsuranceCompany = 0 |
| | | // 失业险公司缴纳金额 |
| | | this.form.unemploymentInsuranceCompanyAmount = 0 |
| | | // 失业险公司缴纳金额随机数 |
| | | this.unemploymentInsuranceCompanyAmountRandom = Math.random() |
| | | // 生育险基数 |
| | | this.form.birthInsurance = 0 |
| | | // 生育险基数随机数 |
| | | this.birthInsuranceRandom = Math.random() |
| | | // 生育险个人缴纳比例 |
| | | this.form.birthInsurancePersonal = 0 |
| | | // 生育险个人缴纳金额 |
| | | this.form.birthInsurancePersonalAmount = 0 |
| | | // 生育险个人缴纳金额随机数 |
| | | this.birthInsurancePersonalAmountRandom = Math.random() |
| | | // 生育险公司缴纳比例 |
| | | this.form.birthInsuranceCompany = 0 |
| | | // 生育险公司缴纳金额 |
| | | this.form.birthInsuranceCompanyAmount = 0 |
| | | // 生育险公司缴纳金额随机数 |
| | | this.birthInsuranceCompanyAmountRandom = Math.random() |
| | | // 工伤险基数 |
| | | this.form.employmentInsurance = 0 |
| | | // 工伤险基数随机数 |
| | | this.employmentInsuranceRandom = Math.random() |
| | | // 工伤险个人缴纳比例 |
| | | this.form.employmentInsurancePersonal = 0 |
| | | // 工伤险个人缴纳金额 |
| | | this.form.employmentInsurancePersonalAmount = 0 |
| | | // 工伤险个人缴纳金额随机数 |
| | | this.employmentInsurancePersonalAmountRandom = Math.random() |
| | | // 工伤险公司缴纳比例 |
| | | this.form.employmentInsuranceCompany = 0 |
| | | // 工伤险公司缴纳金额 |
| | | this.form.employmentInsuranceCompanyAmount = 0 |
| | | // 工伤险公司缴纳金额随机数 |
| | | this.employmentInsuranceCompanyAmountRandom = Math.random() |
| | | // 失败 |
| | | reject() |
| | | }) |
| | | }) |
| | | }, |
| | | // 获取用户级别其他 |
| | | getUserLevelOther() { |
| | | return new Promise((resolve, reject) => { |
| | | // 获取用户级别其他 |
| | | crudUserLevelOther.getTargetYearMonth({ userId: this.form.userId, targetYearMonth: this.form.salaryYearMonth }).then(res => { |
| | | // 个人业绩比例 |
| | | this.form.personalPerformanceProportion = Number(res.personalPerformanceProportion.toFixed(2)) |
| | | // 成功 |
| | | resolve() |
| | | }).catch(() => { |
| | | // 个人业绩比例 |
| | | this.form.personalPerformanceProportion = 0 |
| | | // 失败 |
| | | reject() |
| | | }) |
| | | }) |
| | | }, |
| | | // 获取工作天数 |
| | | getWorkDays() { |
| | | return new Promise((resolve, reject) => { |
| | | // 获取工作天数 |
| | | crudNewSalary.workDays({ targetYearMonth: this.form.salaryYearMonth }).then(res => { |
| | | // 全勤小时数 |
| | | this.form.fullDays = Number((res * 8).toFixed(2)) |
| | | // 应完成绩效工时 |
| | | this.form.needCompletedAchievementsHours = Number((res * 8).toFixed(2)) |
| | | // 定时器 |
| | | const interval = setInterval(() => { |
| | | // 判断个人业绩比例是否为空 |
| | | if (this.form.personalPerformanceProportion != null && this.form.personalPerformanceProportion !== '') { |
| | | // 应完成业绩工时 |
| | | this.form.needCompletedPerformanceHours = Number((res * 8 * (1 + this.form.personalPerformanceProportion / 100)).toFixed(2)) |
| | | // 清空定时器 |
| | | clearInterval(interval) |
| | | // 成功 |
| | | resolve() |
| | | } |
| | | }, 500) |
| | | }).catch(() => { |
| | | // 全勤小时数 |
| | | this.form.fullDays = 0 |
| | | // 应完成绩效工时 |
| | | this.form.needCompletedAchievementsHours = 0 |
| | | // 应完成业绩工时 |
| | | this.form.needCompletedPerformanceHours = 0 |
| | | // 失败 |
| | | reject() |
| | | }) |
| | | }) |
| | | }, |
| | | // 获取出勤小时数 |
| | | getAttendanceHours() { |
| | | return new Promise((resolve, reject) => { |
| | | // 获取出勤小时数 |
| | | crudAttendance.attendanceHours({ userId: this.form.userId, targetYearMonth: this.form.salaryYearMonth }).then(res => { |
| | | // 定时器 |
| | | const interval = setInterval(() => { |
| | | // 判断预计基础工资、全勤小时数是否为空 |
| | | if (this.form.basicWage != null && this.form.basicWage !== '' && this.form.fullDays != null && this.form.fullDays !== '') { |
| | | // 缺勤小时数 |
| | | this.form.absenceDays = Number((this.form.fullDays - res).toFixed(2)) |
| | | // 实际基础工资 |
| | | this.form.actualBasicWage = Number((this.form.basicWage - (this.form.basicWage / this.form.fullDays) * (this.form.fullDays - res)).toFixed(2)) |
| | | // 实际基本工资随机数 |
| | | this.actualBasicWageRandom = Math.random() |
| | | // 清空定时器 |
| | | clearInterval(interval) |
| | | // 成功 |
| | | resolve() |
| | | } |
| | | }, 500) |
| | | }).catch(() => { |
| | | // 缺勤小时数 |
| | | this.form.absenceDays = 0 |
| | | // 实际基础工资 |
| | | this.form.actualBasicWage = 0 |
| | | // 实际基本工资随机数 |
| | | this.actualBasicWageRandom = Math.random() |
| | | // 失败 |
| | | reject() |
| | | }) |
| | | }) |
| | | }, |
| | | // 获取达标工时 |
| | | getComplianceWork() { |
| | | return new Promise((resolve, reject) => { |
| | | // 获取达标工时 |
| | | crudProjectPerformanceDetail.complianceWork({ userId: this.form.userId, yearMonth: this.form.salaryYearMonth }).then(res => { |
| | | // 实达标团队工时 |
| | | this.form.actualComplianceTeamHours = Number(res.toFixed(2)) |
| | | // 成功 |
| | | resolve() |
| | | }).catch(() => { |
| | | // 实达标团队工时 |
| | | this.form.actualComplianceTeamHours = 0 |
| | | // 失败 |
| | | reject() |
| | | }) |
| | | }) |
| | | }, |
| | | // 获取已完成工时 |
| | | getCompletedWork() { |
| | | return new Promise((resolve, reject) => { |
| | | // 获取已完成工时 |
| | | crudTaskDaliy.completedWork({ userId: this.form.userId, targetYearMonth: this.form.salaryYearMonth }).then(res => { |
| | | // 已完成绩效工时 |
| | | this.form.alreadyCompletedAchievementsHours = Number(res.toFixed(2)) |
| | | // 已完成业绩工时 |
| | | this.form.alreadyCompletedPerformanceHours = Number(res.toFixed(2)) |
| | | // 已完成团队工时 |
| | | this.form.alreadyCompletedTeamHours = Number(res.toFixed(2)) |
| | | // 绩效定时器 |
| | | const achievementsInterval = setInterval(() => { |
| | | // 判断预计绩效工资、应完成绩效工时是否为空 |
| | | if (this.form.achievementsWage != null && this.form.achievementsWage !== '' && this.form.needCompletedAchievementsHours != null && this.form.needCompletedAchievementsHours !== '') { |
| | | // 实际绩效工资 |
| | | this.form.actualAchievementsWage = Number((this.form.achievementsWage * (res / this.form.needCompletedAchievementsHours)).toFixed(2)) |
| | | // 实际绩效工资随机数 |
| | | this.actualAchievementsWageRandom = Math.random() |
| | | // 清空绩效定时器 |
| | | clearInterval(achievementsInterval) |
| | | } |
| | | }, 500) |
| | | // 业绩定时器 |
| | | const performanceInterval = setInterval(() => { |
| | | // 判断预计业绩工资、应完成业绩工时是否为空 |
| | | if (this.form.performanceWage != null && this.form.performanceWage !== '' && this.form.needCompletedPerformanceHours != null && this.form.needCompletedPerformanceHours !== '') { |
| | | // 实际业绩工资 |
| | | this.form.actualPerformanceWage = Number((res >= this.form.needCompletedPerformanceHours ? this.form.performanceWage : 0).toFixed(2)) |
| | | // 实际业绩工资随机数 |
| | | this.actualPerformanceWageRandom = Math.random() |
| | | // 清空业绩定时器 |
| | | clearInterval(performanceInterval) |
| | | } |
| | | }, 500) |
| | | // 团队定时器 |
| | | const teamInterval = setInterval(() => { |
| | | // 判断预计团队工资、实达标团队工时是否为空 |
| | | if (this.form.teamWage != null && this.form.teamWage !== '' && this.form.actualComplianceTeamHours != null && this.form.actualComplianceTeamHours !== '') { |
| | | // 实际团队工资 |
| | | this.form.actualTeamWage = Number(this.form.actualComplianceTeamHours !== 0 ? (this.form.teamWage * (this.form.actualComplianceTeamHours / this.form.needCompletedAchievementsHours)).toFixed(2) : 0) |
| | | // 实际团队工资随机数 |
| | | this.actualTeamWageRandom = Math.random() |
| | | // 清空团队定时器 |
| | | clearInterval(teamInterval) |
| | | } |
| | | }, 500) |
| | | // 统计定时器 |
| | | const statisticsInterval = setInterval(() => { |
| | | // 判断 实际基础工资、实际绩效工资、实际业绩工资、实际团队工资、公积金个人缴纳金额、 |
| | | // 养老险个人缴纳金额、医疗险个人缴纳金额、失业险个人缴纳金额、生育险个人缴纳金额、工伤险个人缴纳金额 是否为空 |
| | | if ( |
| | | this.form.actualBasicWage != null && this.form.actualBasicWage !== '' && |
| | | this.form.actualAchievementsWage != null && this.form.actualAchievementsWage !== '' && |
| | | this.form.actualPerformanceWage != null && this.form.actualPerformanceWage !== '' && |
| | | this.form.actualTeamWage != null && this.form.actualTeamWage !== '' && |
| | | this.form.accumulationFundPersonalAmount != null && this.form.accumulationFundPersonalAmount !== '' && |
| | | this.form.retirementInsurancePersonalAmount != null && this.form.retirementInsurancePersonalAmount !== '' && |
| | | this.form.medicalInsurancePersonalAmount != null && this.form.medicalInsurancePersonalAmount !== '' && |
| | | this.form.unemploymentInsurancePersonalAmount != null && this.form.unemploymentInsurancePersonalAmount !== '' && |
| | | this.form.birthInsurancePersonalAmount != null && this.form.birthInsurancePersonalAmount !== '' && |
| | | this.form.employmentInsurancePersonalAmount != null && this.form.employmentInsurancePersonalAmount !== '' |
| | | ) { |
| | | // 统计金额 |
| | | this.statisticalAmount() |
| | | // 清空统计定时器 |
| | | clearInterval(statisticsInterval) |
| | | // 成功 |
| | | resolve() |
| | | } |
| | | }, 500) |
| | | }).catch(() => { |
| | | // 已完成绩效工时 |
| | | this.form.alreadyCompletedAchievementsHours = 0 |
| | | // 已完成业绩工时 |
| | | this.form.alreadyCompletedPerformanceHours = 0 |
| | | // 已完成团队工时 |
| | | this.form.alreadyCompletedTeamHours = 0 |
| | | // 实际绩效工资 |
| | | this.form.actualAchievementsWage = 0 |
| | | // 实际绩效工资随机数 |
| | | this.actualAchievementsWageRandom = Math.random() |
| | | // 实际业绩工资 |
| | | this.form.actualPerformanceWage = 0 |
| | | // 实际业绩工资随机数 |
| | | this.actualPerformanceWageRandom = Math.random() |
| | | // 实际团队工资 |
| | | this.form.actualTeamWage = 0 |
| | | // 实际团队工资随机数 |
| | | this.actualTeamWageRandom = Math.random() |
| | | // 税前金额 |
| | | this.form.preTaxAmount = 0 |
| | | // 税前金额随机数 |
| | | this.preTaxAmountRandom = Math.random() |
| | | // 个人所得税 |
| | | this.form.individualIncomeTax = 0 |
| | | // 个人所得税随机数 |
| | | this.individualIncomeTaxRandom = Math.random() |
| | | // 税后金额 |
| | | this.form.afterTaxAmount = 0 |
| | | // 税后金额随机数 |
| | | this.afterTaxAmountRandom = Math.random() |
| | | // 失败 |
| | | reject() |
| | | }) |
| | | }) |
| | | }, |
| | | // 公示弹窗关闭 |
| | | publicityCancel(data) { |
| | | // 公示弹窗隐藏 |
| | | this.$refs[`publicity_${data.id}`].showPopper = false |
| | | }, |
| | | // 公示弹窗确认 |
| | | doPublicity(data) { |
| | | // 公示弹窗加载 |
| | | this.publicityLoading = true |
| | | // 公示工资 |
| | | crudNewSalary.publicity([data.id]).then(res => { |
| | | // 搜索:刷新表格 |
| | | this.crud.toQuery() |
| | | // 消息提示 |
| | | this.crud.notify('公示成功', CRUD.NOTIFICATION_TYPE.SUCCESS) |
| | | // 公示弹窗加载 |
| | | this.publicityLoading = false |
| | | // 公示弹窗隐藏 |
| | | this.$refs[`publicity_${data.id}`].showPopper = false |
| | | }).catch(() => { |
| | | // 公示弹窗加载 |
| | | this.publicityLoading = false |
| | | }) |
| | | }, |
| | | // 多工资公示 |
| | | multiplePublicity(data) { |
| | | // 确认框 |
| | | this.$confirm('此操作将公示 ' + data.length + ' 条工资, 是否继续?', '提示', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'success' |
| | | }).then(() => { |
| | | // ID列表 |
| | | const ids = [] |
| | | // 循环数据 |
| | | for (let i = 0; i < data.length; i++) { |
| | | // ID列表 |
| | | ids.push(data[i].id) |
| | | // 判断循环是否结束 |
| | | if (i === data.length - 1) { |
| | | // 公示工资 |
| | | crudNewSalary.publicity(ids).then(res => { |
| | | // 搜索:刷新表格 |
| | | this.crud.toQuery() |
| | | // 消息提示 |
| | | this.crud.notify('公示成功', CRUD.NOTIFICATION_TYPE.SUCCESS) |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | // 承认弹窗关闭 |
| | | approveCancel(data) { |
| | | // 承认弹窗隐藏 |
| | | this.$refs[`approve_${data.id}`].showPopper = false |
| | | }, |
| | | // 承认弹窗确认 |
| | | doApprove(data) { |
| | | // 承认弹窗加载 |
| | | this.approveLoading = true |
| | | // 承认工资 |
| | | crudNewSalary.approve([data.id]).then(res => { |
| | | // 搜索:刷新表格 |
| | | this.crud.toQuery() |
| | | // 消息提示 |
| | | this.crud.notify('承认成功', CRUD.NOTIFICATION_TYPE.SUCCESS) |
| | | // 承认弹窗加载 |
| | | this.approveLoading = false |
| | | // 承认弹窗隐藏 |
| | | this.$refs[`approve_${data.id}`].showPopper = false |
| | | }).catch(() => { |
| | | // 承认弹窗加载 |
| | | this.approveLoading = false |
| | | }) |
| | | }, |
| | | // 多工资承认 |
| | | multipleApprove(data) { |
| | | // 确认框 |
| | | this.$confirm('此操作将承认 ' + data.length + ' 条工资, 是否继续?', '提示', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'success' |
| | | }).then(() => { |
| | | // ID列表 |
| | | const ids = [] |
| | | // 循环数据 |
| | | for (let i = 0; i < data.length; i++) { |
| | | // ID列表 |
| | | ids.push(data[i].id) |
| | | // 判断循环是否结束 |
| | | if (i === data.length - 1) { |
| | | // 承认工资 |
| | | crudNewSalary.approve(ids).then(res => { |
| | | // 搜索:刷新表格 |
| | | this.crud.toQuery() |
| | | // 消息提示 |
| | | this.crud.notify('承认成功', CRUD.NOTIFICATION_TYPE.SUCCESS) |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | // 生成表单打开 |
| | | openGenerate() { |
| | | // 生成表单状态 |
| | | this.generateStatus = true |
| | | }, |
| | | // 生成表单关闭 |
| | | closeGenerate() { |
| | | // 生成表单状态 |
| | | this.generateStatus = false |
| | | // 生成表单数据 |
| | | this.generateForm = { targetYearMonth: null, userId: null } |
| | | // 清空表单 |
| | | this.$refs['generateForm'].clearValidate() |
| | | }, |
| | | // 生成表单提交 |
| | | submitGenerate() { |
| | | // 生成表单加载 |
| | | this.generateLoading = true |
| | | // 表单验证 |
| | | this.$refs['generateForm'].validate((valid) => { |
| | | if (valid) { |
| | | // 生成工资 |
| | | crudNewSalary.generate(this.generateForm).then(res => { |
| | | // 生成表单加载 |
| | | this.generateLoading = false |
| | | // 生成表单关闭 |
| | | this.closeGenerate() |
| | | // 搜索:刷新表格 |
| | | this.crud.toQuery() |
| | | // 消息提示 |
| | | this.crud.notify('生成成功', CRUD.NOTIFICATION_TYPE.SUCCESS) |
| | | }).catch(() => { |
| | | // 生成表单加载 |
| | | this.generateLoading = false |
| | | }) |
| | | } else { |
| | | // 生成表单加载 |
| | | this.generateLoading = false |
| | | } |
| | | }) |
| | | }, |
| | | // 基本参数变更 |
| | | basicParameterBlur() { |
| | | // 实际基础工资 = 预计基本工资 - (预计基本工资 / 全勤小时数) * 缺勤小时数 |
| | | this.form.actualBasicWage = Number((this.form.basicWage - (this.form.basicWage / this.form.fullDays) * this.form.absenceDays).toFixed(2)) |
| | | // 实际基本工资随机数 |
| | | this.actualBasicWageRandom = Math.random() |
| | | // 统计金额 |
| | | this.statisticalAmount() |
| | | }, |
| | | // 预计基本工资变更 |
| | | basicWageBlur() { |
| | | // 实际基础工资 = 预计基本工资 - (预计基本工资 / 全勤小时数) * 缺勤小时数 |
| | | this.form.actualBasicWage = Number((this.form.basicWage - (this.form.basicWage / this.form.fullDays) * this.form.absenceDays).toFixed(2)) |
| | | // 实际基本工资随机数 |
| | | this.actualBasicWageRandom = Math.random() |
| | | // 统计金额 |
| | | this.statisticalAmount() |
| | | }, |
| | | // 绩效参数变更 |
| | | achievementsParameterBlur() { |
| | | // 实际绩效工资 = 预计绩效工资 * (已完成绩效工时 / 应完成绩效工时) |
| | | this.form.actualAchievementsWage = Number((this.form.achievementsWage * (this.form.alreadyCompletedAchievementsHours / this.form.needCompletedAchievementsHours)).toFixed(2)) |
| | | // 实际绩效工资随机数 |
| | | this.actualAchievementsWageRandom = Math.random() |
| | | // 统计金额 |
| | | this.statisticalAmount() |
| | | }, |
| | | // 预计绩效工资变更 |
| | | achievementsWageBlur() { |
| | | // 实际绩效工资 = 预计绩效工资 * (已完成绩效工时 / 应完成绩效工时) |
| | | this.form.actualAchievementsWage = Number((this.form.achievementsWage * (this.form.alreadyCompletedAchievementsHours / this.form.needCompletedAchievementsHours)).toFixed(2)) |
| | | // 实际绩效工资随机数 |
| | | this.actualAchievementsWageRandom = Math.random() |
| | | // 统计金额 |
| | | this.statisticalAmount() |
| | | }, |
| | | // 业绩参数变更 |
| | | performanceParameterBlur() { |
| | | // 实际业绩工资 = 已完成业绩工时 >= 应完成业绩工时 ? 预计业绩工资 : 0 |
| | | this.form.actualPerformanceWage = Number((this.form.alreadyCompletedPerformanceHours >= this.form.needCompletedPerformanceHours ? this.form.performanceWage : 0).toFixed(2)) |
| | | // 实际业绩工资随机数 |
| | | this.actualPerformanceWageRandom = Math.random() |
| | | // 统计金额 |
| | | this.statisticalAmount() |
| | | }, |
| | | // 预计业绩工资变更 |
| | | performanceWageBlur() { |
| | | // 实际业绩工资 = 已完成业绩工时 >= 应完成业绩工时 ? 预计业绩工资 : 0 |
| | | this.form.actualPerformanceWage = Number((this.form.alreadyCompletedPerformanceHours >= this.form.needCompletedPerformanceHours ? this.form.performanceWage : 0).toFixed(2)) |
| | | // 实际业绩工资随机数 |
| | | this.actualPerformanceWageRandom = Math.random() |
| | | // 统计金额 |
| | | this.statisticalAmount() |
| | | }, |
| | | // 团队参数变更 |
| | | teamParameterBlur() { |
| | | // 实际团队工资 = 预计团队工资 * (实达标团队工时 / 已完成团队工时) |
| | | this.form.actualTeamWage = Number(this.form.actualComplianceTeamHours !== 0 ? (this.form.teamWage * (this.form.actualComplianceTeamHours / this.form.alreadyCompletedTeamHours)).toFixed(2) : 0) |
| | | // 实际团队工资随机数 |
| | | this.actualTeamWageRandom = Math.random() |
| | | // 统计金额 |
| | | this.statisticalAmount() |
| | | }, |
| | | // 预计团队工资变更 |
| | | teamWageBlur() { |
| | | // 实际团队工资 = 预计团队工资 * (实达标团队工时 / 已完成团队工时) |
| | | this.form.actualTeamWage = Number(this.form.actualComplianceTeamHours !== 0 ? (this.form.teamWage * (this.form.actualComplianceTeamHours / this.form.alreadyCompletedTeamHours)).toFixed(2) : 0) |
| | | // 实际团队工资随机数 |
| | | this.actualTeamWageRandom = Math.random() |
| | | // 统计金额 |
| | | this.statisticalAmount() |
| | | }, |
| | | // 公积金参数变更 |
| | | accumulationParameterBlur() { |
| | | // 公积金个人缴纳金额 = 公积金基数 * (公积金个人缴纳比例 / 100) |
| | | this.form.accumulationFundPersonalAmount = Number((this.form.accumulationFund * (this.form.accumulationFundPersonal / 100)).toFixed(2)) |
| | | // 公积金个人缴纳金额随机数 |
| | | this.accumulationFundPersonalAmountRandom = Math.random() |
| | | // 公积金公司缴纳金额 = 公积金基数 * (公积金公司缴纳比例 / 100) |
| | | this.form.accumulationFundCompanyAmount = Number((this.form.accumulationFund * (this.form.accumulationFundCompany / 100)).toFixed(2)) |
| | | // 公积金公司缴纳金额随机数 |
| | | this.accumulationFundCompanyAmountRandom = Math.random() |
| | | // 统计金额 |
| | | this.statisticalAmount() |
| | | }, |
| | | // 养老险参数变更 |
| | | pensionParameterBlur() { |
| | | // 养老险个人缴纳金额 = 养老险基数 * (养老险个人缴纳比例 / 100) |
| | | this.form.retirementInsurancePersonalAmount = Number((this.form.retirementInsurance * (this.form.retirementInsurancePersonal / 100)).toFixed(2)) |
| | | // 养老险个人缴纳金额随机数 |
| | | this.retirementInsurancePersonalAmountRandom = Math.random() |
| | | // 养老险公司缴纳金额 = 养老险基数 * (养老险公司缴纳比例 / 100) |
| | | this.form.retirementInsuranceCompanyAmount = Number((this.form.retirementInsurance * (this.form.retirementInsuranceCompany / 100)).toFixed(2)) |
| | | // 养老险公司缴纳金额随机数 |
| | | this.retirementInsuranceCompanyAmountRandom = Math.random() |
| | | // 统计金额 |
| | | this.statisticalAmount() |
| | | }, |
| | | // 医疗险参数变更 |
| | | medicalParameterBlur() { |
| | | // 医疗险个人缴纳金额 = 医疗险基数 * (医疗险个人缴纳比例 / 100) |
| | | this.form.medicalInsurancePersonalAmount = Number((this.form.medicalInsurance * (this.form.medicalInsurancePersonal / 100)).toFixed(2)) |
| | | // 医疗险个人缴纳金额随机数 |
| | | this.medicalInsurancePersonalAmountRandom = Math.random() |
| | | // 医疗险公司缴纳金额 = 医疗险基数 * (医疗险公司缴纳比例 / 100) |
| | | this.form.medicalInsuranceCompanyAmount = Number((this.form.medicalInsurance * (this.form.medicalInsuranceCompany / 100)).toFixed(2)) |
| | | // 医疗险公司缴纳金额随机数 |
| | | this.medicalInsuranceCompanyAmountRandom = Math.random() |
| | | // 统计金额 |
| | | this.statisticalAmount() |
| | | }, |
| | | // 失业险参数变更 |
| | | unemploymentParameterBlur() { |
| | | // 失业险个人缴纳金额 = 失业险基数 * (失业险个人缴纳比例 / 100) |
| | | this.form.unemploymentInsurancePersonalAmount = Number((this.form.unemploymentInsurance * (this.form.unemploymentInsurancePersonal / 100)).toFixed(2)) |
| | | // 失业险个人缴纳金额随机数 |
| | | this.unemploymentInsurancePersonalAmountRandom = Math.random() |
| | | // 失业险公司缴纳金额 = 失业险基数 * (失业险公司缴纳比例 / 100) |
| | | this.form.unemploymentInsuranceCompanyAmount = Number((this.form.unemploymentInsurance * (this.form.unemploymentInsuranceCompany / 100)).toFixed(2)) |
| | | // 失业险公司缴纳金额随机数 |
| | | this.unemploymentInsuranceCompanyAmountRandom = Math.random() |
| | | // 统计金额 |
| | | this.statisticalAmount() |
| | | }, |
| | | // 生育险参数变更 |
| | | maternityParameterBlur() { |
| | | // 生育险个人缴纳金额 = 生育险基数 * (生育险个人缴纳比例 / 100) |
| | | this.form.birthInsurancePersonalAmount = Number((this.form.birthInsurance * (this.form.birthInsurancePersonal / 100)).toFixed(2)) |
| | | // 生育险个人缴纳金额随机数 |
| | | this.birthInsurancePersonalAmountRandom = Math.random() |
| | | // 生育险公司缴纳金额 = 生育险基数 * (生育险公司缴纳比例 / 100) |
| | | this.form.birthInsuranceCompanyAmount = Number((this.form.birthInsurance * (this.form.birthInsuranceCompany / 100)).toFixed(2)) |
| | | // 生育险公司缴纳金额随机数 |
| | | this.birthInsuranceCompanyAmountRandom = Math.random() |
| | | // 统计金额 |
| | | this.statisticalAmount() |
| | | }, |
| | | // 工伤险参数变更 |
| | | industrialInjuryParameterBlur() { |
| | | // 工伤险个人缴纳金额 = 工伤险基数 * (工伤险个人缴纳比例 / 100) |
| | | this.form.employmentInsurancePersonalAmount = Number((this.form.employmentInsurance * (this.form.employmentInsurancePersonal / 100)).toFixed(2)) |
| | | // 工伤险个人缴纳金额随机数 |
| | | this.employmentInsurancePersonalAmountRandom = Math.random() |
| | | // 工伤险公司缴纳金额 = 工伤险基数 * (工伤险公司缴纳比例 / 100) |
| | | this.form.employmentInsuranceCompanyAmount = Number((this.form.employmentInsurance * (this.form.employmentInsuranceCompany / 100)).toFixed(2)) |
| | | // 工伤险公司缴纳金额随机数 |
| | | this.employmentInsuranceCompanyAmountRandom = Math.random() |
| | | // 统计金额 |
| | | this.statisticalAmount() |
| | | }, |
| | | // 统计金额 |
| | | statisticalAmount() { |
| | | console.log('统计金额') |
| | | // 税前金额 |
| | | this.form.preTaxAmount = this.form.actualBasicWage + this.form.actualAchievementsWage + this.form.actualPerformanceWage + this.form.actualTeamWage + this.form.pieceRate + this.form.travelAllowance |
| | | // 税前金额随机数 |
| | | this.preTaxAmountRandom = Math.random() |
| | | // 税前金额变更 |
| | | this.preTaxAmountBlur() |
| | | }, |
| | | // 税前金额变更 |
| | | preTaxAmountBlur() { |
| | | // 查询个人所得税列表 |
| | | crudSysConfigIndividualIncomeTax.getAll().then(res => { |
| | | // 税额 |
| | | let taxAmount = 0 |
| | | // 计税金额 = 税前金额 - 五险一金个人缴纳金额 |
| | | const taxableAmount = this.form.preTaxAmount - this.form.accumulationFundPersonalAmount - this.form.retirementInsurancePersonalAmount - this.form.medicalInsurancePersonalAmount - this.form.unemploymentInsurancePersonalAmount - this.form.birthInsurancePersonalAmount - this.form.employmentInsurancePersonalAmount |
| | | // 循环个人所得税列表 |
| | | for (let i = 0; i < res.length; i++) { |
| | | // 判断计税金额所在个人所得税范围 |
| | | if (res[i].gearAmountEnd != null && res[i].gearAmountEnd !== '' && taxableAmount > res[i].gearAmountEnd) { |
| | | // 税额 |
| | | taxAmount += (res[i].gearAmountEnd - res[i].gearAmountStart) * (res[i].taxRate / 100) |
| | | } else if (taxableAmount >= res[i].gearAmountStart && (res[i].gearAmountEnd == null || res[i].gearAmountEnd === '' || taxableAmount <= res[i].gearAmountEnd)) { |
| | | // 税额 |
| | | taxAmount += (taxableAmount - res[i].gearAmountStart) * (res[i].taxRate / 100) |
| | | } |
| | | // 判断循环是否结束 |
| | | if (i === res.length - 1) { |
| | | // 个人所得税 = 税额 |
| | | this.form.individualIncomeTax = taxAmount |
| | | // 个人所得税随机数 |
| | | this.individualIncomeTaxRandom = Math.random() |
| | | // 税后金额 = 计税金额 - 税额 |
| | | this.form.afterTaxAmount = (taxableAmount - taxAmount) < 0 ? 0 : taxableAmount - taxAmount |
| | | // 税后金额随机数 |
| | | this.afterTaxAmountRandom = Math.random() |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | // 个人所得税变更 |
| | | individualIncomeTaxBlur() { |
| | | // 计税金额 = 税前金额 - 五险一金个人缴纳金额 |
| | | const taxableAmount = this.form.preTaxAmount - this.form.accumulationFundPersonalAmount - this.form.retirementInsurancePersonalAmount - this.form.medicalInsurancePersonalAmount - this.form.unemploymentInsurancePersonalAmount - this.form.birthInsurancePersonalAmount - this.form.employmentInsurancePersonalAmount |
| | | // 税后金额 = 计税金额 - 个人所得税 |
| | | this.form.afterTaxAmount = (taxableAmount - this.form.individualIncomeTax) < 0 ? 0 : taxableAmount - this.form.individualIncomeTax |
| | | // 税后金额随机数 |
| | | this.afterTaxAmountRandom = Math.random() |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | |
| | | </style> |