Commit 88629861 by wangzhihui

工资推送月报

1 parent cfeca1dd
const url = '/rop-dj-staff/router'
export default {
/**每月工资条推送-详情 */
getSalaryDetail(data = {}) {
data.method = 'dj.staff.api.staff.month.salary.send.detai1'
return window.$HTTP({
url,
data,
returnAll: true
})
},
}
\ No newline at end of file
<!-- 工资条-->
<template>
<div class="salary-detail">
<div class="card">
<div class="row">
<span class="label">计薪月份</span>
<span class="value">{{ detail.salaryMonth }}</span>
</div>
<div class="row">
<span class="label">姓名</span>
<span class="value">{{ detail.staffName }}</span>
</div>
<div class="row">
<span class="label">手机号</span>
<span class="value">{{ detail.staffPhone }}</span>
</div>
<div class="row">
<span class="label">入职日期</span>
<span class="value">{{ detail.entryDate }}</span>
</div>
<div class="row">
<span class="label">计薪天数</span>
<span class="value">{{ detail.actualWorkDay?detail.actualWorkDay+'天' :'-'}}</span>
</div>
<div class="row">
<span class="label">基本底薪</span>
<span class="value">{{ formatMoney(detail.minimumSalary) }}</span>
</div>
<div class="row">
<span class="label">绩效工资</span>
<span class="value">{{ formatMoney(detail.performanceSalary) }}</span>
</div>
<div class="row">
<span class="label">绩效等级</span>
<span class="value">{{ detail.performanceLevel }}</span>
</div>
<div class="row">
<span class="label">业务提成</span>
<span class="value">{{ formatMoney(detail.commissionPrice) }}</span>
</div>
<div class="row">
<span class="label">平板扣款</span>
<span class="value">{{ formatDeduction(detail.padDeductMoney, true) }}</span>
</div>
<div class="row">
<span class="label">日报扣款</span>
<span class="value">{{ formatDeduction(detail.dailyDeductMoney, true) }}</span>
</div>
<div class="row">
<span class="label">递延金扣减</span>
<span class="value">{{ formatDeduction(detail.deferExpenses, true) }}</span>
</div>
<div class="row">
<span class="label">递延金发放</span>
<span class="value">{{ formatIncomeWithPlus(detail.deferIncome, true) }}</span>
</div>
<div class="row">
<span class="label">其他扣除</span>
<span class="value">{{ formatDeduction(detail.otherDeduction, true) }}</span>
</div>
<div class="row">
<span class="label">其他奖励</span>
<span class="value">{{ formatIncomeWithPlus(detail.otherRewards, true) }}</span>
</div>
<div class="row total">
<span class="label">工资合计</span>
<span class="value">{{ formatMoney(detail.salary) }}</span>
</div>
</div>
</div>
</template>
<script>
import salaryApi from '@/api/salary'
export default {
name: 'SalaryIndex',
data() {
return {
detail: {
}
}
},
mounted() {
this.getSalaryDetail()
},
methods: {
getSalaryDetail(){
salaryApi.getSalaryDetail({
salaryId: this.$route.query.uuid
}).then(res => {
this.detail = res.data
})
},
// 金额格式化:¥ + 千分位 + 两位小数
formatMoney(value, { showPlus = false, dashIfEmpty = true } = {}) {
console.log(value === null || value === undefined || value === '')
if (value === null || value === undefined || value === '') {
return dashIfEmpty ? '-' : '¥0.00'
}
const num = Number(value)
if (isNaN(num)) return dashIfEmpty ? '-' : '¥0.00'
const formatted = num.toFixed(2).replace(/\B(?=(\d{3})+(?!\d))/g, ',')
const signPrefix = showPlus ? '+' : ''
return `${signPrefix}¥${formatted}`
},
// 扣减类统一渲染为 -¥
formatDeduction(value, dashIfEmpty = false) {
if (value === null || value === undefined || value === '') {
return dashIfEmpty ? '-' : '-¥0.00'
}
const num = Math.abs(Number(value) || 0)
const formatted = num.toFixed(2).replace(/\B(?=(\d{3})+(?!\d))/g, ',')
return `-¥${formatted}`
},
// 奖励/发放类显示 +¥
formatIncomeWithPlus(value, dashIfEmpty = false) {
if (value === null || value === undefined || value === '') {
return dashIfEmpty ? '-' : '+¥0.00'
}
const num = Number(value) || 0
const formatted = num.toFixed(2).replace(/\B(?=(\d{3})+(?!\d))/g, ',')
return `¥${formatted}`
}
}
}
</script>
<style lang="scss" scoped>
.salary-detail {
min-height: 100vh;
background: #ffffff;
padding: 16px;
}
.row {
display: flex;
align-items: center;
font-size: 14px;
margin-bottom:16px;
}
.row:last-child {
border-bottom: none;
}
.label {
width: 56px;
color: #888888;
white-space: wrap;
margin-right:20px;
}
.value {
color: #222222;
}
.total{
border-top: 0.5px solid #c3c3c366;
padding-top:16px;
}
.total .value {
font-size: 16px;
font-weight: 600;
}
</style>
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!