Commit aa7df2fa by 杨明

工资测算

1 parent 5950ceff
......@@ -189,5 +189,21 @@ module.exports = {
projectName: 'boutique',
...data
})
},
/** 提交打卡申诉 */
appealCommit(data) {
return http.post({
method: 'dj.api.car.boutique.clock.in.staff.appeal.commit',
projectName: 'boutique',
...data
})
},
/** 考勤出勤明细 */
attendanceDetail(data) {
return http.post({
method: 'dj.api.car.boutique.clock.in.staff.attendance.detail',
projectName: 'boutique',
...data
})
}
}

2.32 MB | W: | H:

2.32 MB | W: | H:

assets/images/sprite.png
assets/images/sprite.png
assets/images/sprite.png
assets/images/sprite.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -2,7 +2,7 @@
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2025-01-07 13:49:15
* @LastEditors: yangming@didihu.com.cn yangming@didihu.com.cn
* @LastEditTime: 2025-04-17 17:06:46
* @LastEditTime: 2025-04-23 14:05:42
* @FilePath: \gl-tape\components\HomeFrame\components\Income\History.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
......@@ -35,8 +35,8 @@
<view class="footer-up flex">
<view class="sprite-icon icon-income-card"></view>
<view class="footer-label">当月收入</view>
<view class="income-mark">系统测算</view>
<!-- <view class="income-mark primary">应发工资</view> -->
<view class="income-mark" v-if="salaryDetail.confirmSalary">系统测算</view>
<view class="income-mark primary" v-else>应发工资</view>
</view>
<view class="footer-price">
<text>¥</text>
......@@ -49,14 +49,14 @@
<view class="item-label" @click="handleShow(item)">{{ item.label }}</view>
<uni-icons type="help" size="18" color="#A2A2A8" @click="clickTips(item)"></uni-icons>
<view class="item-price">{{ item.showUnit }}{{ formatNumber(salaryDetail[item.value] || '0') }}</view>
<view class="item-expand" @click="showDetail(item)" v-if="salaryDetail[item.value] && item.tabelTh"></view>
<view class="item-expand" @click="showDetail(item)"></view>
</view>
</template>
</view>
<view class="footer-bottom">
<view class="income-time flex">
<view class="sprite-icon icon-time-icon"></view>
生成时间
生成时间:{{ salaryDetail.createdDate }}
</view>
<!-- <view class="income-tips">
<view class="sprite-icon icon-tips-b"></view>
......@@ -66,11 +66,11 @@
<view class="sprite-icon icon-warning-icon"></view>
<text>以上测算未包括 个人所得税、社保等事项</text>
</view>
<view class="finish-box flex-center">
<!-- <view class="finish-box flex-center">
<view class="sprite-icon icon-finish-icon"></view>
已提交申诉
</view>
<!-- <view class="verify-btn" @click="handleVerify">我要校核</view> -->
</view> -->
<view class="verify-btn" @click="handleVerify">我要校核</view>
</view>
</template>
<view class="empty-body" v-else>
......@@ -84,17 +84,26 @@
<Detail @close="show = false" :show="show" :detail="detail" :tabelTh="detail.tabelTh" :tabelTr="detail.tabelTr"></Detail>
<Question @close="tipsShow = false" :show="tipsShow" :detail="tipsDetail"></Question>
<base-dialog @close="baseShow = false" @showBaseDetail="showBaseDetail" :baseSalaryDetail="baseSalaryDetail" :show="baseShow"></base-dialog>
<base-detail
@close="
baseDetailShow = false
baseShow = true
"
:show="baseDetailShow"
:detail="detail"
></base-detail>
<Dailog @close="showVerify = false" v-if="showVerify" width="1640rpx" title="工资测算校核" icon="income-count">
<template slot="content">
<view class="dailog-body">
<view class="form-item">
<view class="form-label">校核月份:</view>
<view class="form-label">校核月份:{{ salaryMonth }}</view>
</view>
<view class="form-item">
<view class="form-label">校核说明:</view>
<textarea class="textarea-box" placeholder="请填写校核说明" />
<textarea class="textarea-box" placeholder="请填写校核说明" v-model="appealDesc" />
</view>
<view class="form-btn">提交校核</view>
<view class="form-btn" @click="appealCommit">提交校核</view>
</view>
</template>
</Dailog>
......@@ -107,21 +116,30 @@ import point from '@/mixin/point'
import Dailog from './Dailog.vue'
import Question from './Question.vue'
import firstTime from '@/mixin/firstTime'
import baseDialog from './baseDialog'
import baseDetail from './baseDetail'
export default {
mixins: [point, firstTime],
components: {
Detail,
Dailog,
Question
Question,
baseDialog,
baseDetail
},
data() {
return {
title: '学习数据',
show: false,
tipsShow: false,
baseShow: false,
baseDetailShow: false,
showVerify: false,
salaryMonth: '',
appealDesc: '',
tipsDetail: {},
salaryDetail: {},
baseSalaryDetail: {},
detail: {},
canvasList: [
{ date: '1月', num: 0 },
......@@ -171,6 +189,24 @@ export default {
handleVerify() {
this.showVerify = true
},
appealCommit() {
if (!this.appealDesc) {
uni.showToast({
title: '请填写校核说明',
icon: 'none'
})
}
const { phone: staffPhone } = uni.$storage.get('userInfo')
const params = {
staffPhone,
appealType: 2, // 工资
appealDate: this.salaryMonth,
appealDesc: this.appealDesc
}
uni.$api.pointApi.appealCommit(params).then(res => {
this.showVerify = false
})
},
getDetail(date) {
uni.$api.pointApi.pageStat({ salaryMonthBegin: `${this.year}-01`, salaryMonthEnd: `${this.year}-12` }).then(res => {
const list = res.list || []
......@@ -193,16 +229,36 @@ export default {
})
this.monthSalaryDetail(this.year + '-' + String(this.month - 1).padStart(2, 0))
},
getLastDayOfMonth(yearMonth) {
// 分割字符串,获取年和月
const [year, month] = yearMonth.split('-').map(Number)
// 创建一个日期对象,月份是从0开始的,所以这里要 month(而不是 month-1)
// 我们将日期设置为下个月的第0天,这会自动回到上个月的最后一天
const date = new Date(year, month, 0)
// 返回最后一天的日期
return yearMonth + '-' + date.getDate()
},
/**
* 个人月薪资明细
* @param {String} salaryMonth - 月份,格式为:YYYY-MM
* @return {Promise}
*/
monthSalaryDetail(salaryMonth) {
this.salaryMonth = salaryMonth
uni.$api.pointApi.monthSalaryDetail({ salaryMonth }).then(res => {
this.salaryDetail = res
})
const { phone: staffPhone } = uni.$storage.get('userInfo')
const params = {
staffPhone,
startTime: this.salaryMonth + '-01 00:00:00',
endTime: this.getLastDayOfMonth(this.salaryMonth) + ' 23:59:59'
}
uni.$api.pointApi.attendanceDetail(params).then(res => {
this.baseSalaryDetail = res
})
},
/**
......@@ -213,12 +269,20 @@ export default {
this.tipsDetail = item
this.tipsShow = true
},
showBaseDetail(item) {
this.baseShow = false
this.baseDetailShow = true
this.detail = item
},
/**
* 显示薪资明细
* @param {Object} item - 点击的月份对象
*/
showDetail(item) {
console.log(this.salaryDetail)
if (item.label == '基本工资') {
this.baseShow = true
return
}
const total = this.salaryDetail[item.value]
const recordList = this.salaryDetail[item.recordKey]
this.detail = { ...item, total, recordList }
......@@ -491,7 +555,6 @@ export default {
margin-top: 56rpx;
}
.verify-btn {
margin-top: 40rpx;
width: 288rpx;
height: 80rpx;
border-radius: 16rpx;
......@@ -502,7 +565,7 @@ export default {
color: #ffffff;
font-size: 32rpx;
line-height: 80rpx;
margin: 0 auto;
margin: 40rpx auto 0;
}
}
.income-footer {
......
......@@ -88,14 +88,14 @@
<view class="item-label">{{ item.label }}</view>
<uni-icons type="help" size="15" color="#A2A2A8" @click="clickTips(item)"></uni-icons>
<view class="item-value">{{ item.showUnit }}{{ formatNumber(salaryDetail[item.value] || '0') }}</view>
<view class="item-next" @click="showDetail(item)" v-if="item.tabelTh && salaryDetail[item.value]"></view>
<view class="item-next" @click="showDetail(item)"></view>
</view>
</template>
</view>
<view class="income-footer">个人所得税、社保、迟到、早退等月初统一核算,不包括在收入测算中。实际发放工资以工资核算为准。</view>
</view>
<Detail @close="show = false" :show="show" :detail="detail" :tabelTh="detail.tabelTh" :tabelTr="detail.tabelTr"></Detail>
<base-dialog @close="baseShow = false" @showBaseDetail="showBaseDetail" :show="baseShow"></base-dialog>
<base-dialog @close="baseShow = false" @showBaseDetail="showBaseDetail" :baseSalaryDetail="baseSalaryDetail" :show="baseShow"></base-dialog>
<base-detail
@close="
baseDetailShow = false
......@@ -152,6 +152,7 @@ export default {
baseDetailShow: false,
baseShow: false,
tipsDetail: {},
baseSalaryDetail: {},
tipsShow: false,
activeIndex: 1,
outputDetail: [
......@@ -232,11 +233,30 @@ export default {
}
},
methods: {
getLastDayOfMonth(yearMonth) {
// 分割字符串,获取年和月
const [year, month] = yearMonth.split('-').map(Number)
// 创建一个日期对象,月份是从0开始的,所以这里要 month(而不是 month-1)
// 我们将日期设置为下个月的第0天,这会自动回到上个月的最后一天
const date = new Date(year, month, 0)
// 返回最后一天的日期
return yearMonth + '-' + date.getDate()
},
getDetail(salaryMonth) {
uni.$api.pointApi.monthSalaryDetail({ salaryMonth: `${this.year}-${(this.month + '').padStart(2, '0')}`, calculationDataFlag: 'Y' }).then(res => {
this.salaryDetail = res || {}
})
console.log(this.salaryDetail, 'salaryDetail')
const { phone: staffPhone } = uni.$storage.get('userInfo')
const params = {
staffPhone,
startTime: salaryMonth + '-01 00:00:00',
endTime: this.getLastDayOfMonth(salaryMonth) + ' 23:59:59'
}
uni.$api.pointApi.attendanceDetail(params).then(res => {
this.baseSalaryDetail = res
})
},
/**
* @description 选择门店
......
<template>
<Dailog @close="close" v-if="show" width="1440rpx" :title="detail.label" :icon="detail.icon" :scale="detail.scale">
<Dailog @close="close" v-if="show" width="1440rpx" :title="detail.label" :icon="detail.icon">
<view class="dailog-body" slot="content">
<view class="table-container">
<table class="table-box">
<tr class="th">
<th v-for="(item, index) in detail.th" :key="index" :style="{ width: item.width + '%' }">{{ item.title }}</th>
</tr>
<tr class="tr" v-for="(item, index) in detail.recordList" :key="index">
<td v-for="(colValue, colKey) in detail.th" :key="colKey">66</td>
<tr class="tr" v-for="(item, index) in detail.exceptionDetailList" :key="index">
<td v-for="(colValue, colKey) in detail.th" :key="colKey">{{ item[colValue.value] ? item[colValue.value] : colValue.value == 'attendanceType' ? detail.desc : '' }}</td>
</tr>
</table>
</view>
<view class="table-footer flex">
<text>{{ detail.label }}合计:</text>
<text>合计:{{ detail.label }}{{ detail.exceptionDetailList && detail.exceptionDetailList.length }}次</text>
<text class="price">{{ detail.total }}</text>
<text class="total-text">{{ getCount(detail.exceptionDetailList) }}</text>
</view>
<view class="tips-box">{{ detail.tips }}</view>
</view>
......@@ -22,6 +23,7 @@
<script>
import Dailog from './Dailog'
import utils from '@/utils/utils'
export default {
props: {
detail: {
......@@ -40,6 +42,11 @@ export default {
return {}
},
methods: {
getCount(val) {
return val.reduce((pre, cur) => {
return utils.calcAdd(pre, isNaN(cur.deductionDays) ? 0 : cur.deductionDays)
}, 0)
},
close() {
this.$emit('close')
}
......
......@@ -11,12 +11,15 @@
<view class="month-fact">
<view class="fact-label">本月实际出勤天数:</view>
<view class="fact-num">
45
<text class="unit">天</text>
<text class="mark">(满勤)</text>
<text class="mark" v-if="baseSalaryDetail.actualAttendanceDays == baseSalaryDetail.requiredAttendanceDays && baseSalaryDetail.actualAttendanceDays">满勤</text>
<template v-else>
{{ baseSalaryDetail.actualAttendanceDays }}
<text class="unit">天</text>
</template>
<text class="tips" v-if="holidayCount">(满勤+法定节假日加班{{ holidayCount }}天)</text>
</view>
</view>
<view class="month-should">本月应出勤天数:26天</view>
<view class="month-should">本月应出勤天数:{{ baseSalaryDetail.requiredAttendanceDays }}天</view>
</view>
<view class="base-box flex">
<view class="base-item" v-for="(item, index) in baseList" :key="index">
......@@ -25,7 +28,7 @@
<text class="item-next" v-if="item.value"></text>
</view>
<view class="item-num">
{{ item.value }}
{{ item.exceptionCount || 0 }}
<text>次</text>
</view>
</view>
......@@ -38,27 +41,34 @@
<script>
const WORK_TH = [
{
title: '考勤日期'
title: '考勤日期',
value: 'clockInDate'
},
{
title: '类型'
title: '类型',
value: 'attendanceType'
},
{
title: '打开时间'
title: '打开时间',
value: 'clockInTime'
},
{
title: '扣减考勤天数'
title: '扣减考勤天数',
value: 'deductionDays'
}
]
const CLOTHING_TH = [
{
title: '考勤日期'
title: '考勤日期',
value: 'clockInDate'
},
{
title: '类型'
title: '类型',
value: 'attendanceType'
},
{
title: '扣减考勤天数'
title: '扣减考勤天数',
value: 'deductionDays'
}
]
export default {
......@@ -67,6 +77,10 @@ export default {
type: String,
default: '1440rpx'
},
baseSalaryDetail: {
type: Object,
default: () => {}
},
show: {
type: Boolean,
default: false
......@@ -74,50 +88,66 @@ export default {
},
data() {
return {
holidayCount: 0,
baseList: [
{
label: '迟到',
tips: '迟到30分钟(含30分钟)扣减0.5小时;迟到30分钟以上1小时以内,扣减1小时;按每天8小时工作进行扣减',
th: WORK_TH,
value: 0
value: 1
},
{
label: '早退',
th: WORK_TH,
tips: '早退每次扣减0.5天',
value: 1
value: 2
},
{
label: '缺卡',
th: WORK_TH,
tips: '当月前两次补卡不扣减,第三次开始每次扣减0.5天',
value: 1
value: 3
},
{
label: '调休/请假',
th: CLOTHING_TH,
tips: '按每天8小时工作进行;请假1小时=扣减0.12天',
value: 1
value: 4
},
{
label: '着装异常',
th: CLOTHING_TH,
desc: '着装异常',
tips: '着装异常每次扣减0.5天',
value: 1
value: 5
},
{
label: '法定节假日加班',
value: 1
value: 6
}
]
}
},
watch: {
baseSalaryDetail: {
handler(val) {
const { exceptionInfoList } = val
const key = exceptionInfoList.findIndex(i => i.exceptionType == 6)
this.holidayCount = exceptionInfoList[key]?.exceptionCount
this.baseList.forEach(item => {
const index = exceptionInfoList.findIndex(i => i.exceptionType == item.value)
Object.assign(item, { ...exceptionInfoList[index] })
})
console.log(this.baseList, 99)
},
deep: true
}
},
methods: {
close() {
this.$emit('close')
},
showDetail(item) {
console.log(8)
this.$emit('showBaseDetail', item)
}
}
......@@ -187,6 +217,10 @@ export default {
}
.mark {
color: #2cca74;
font-size: 48rpx;
}
.tips {
color: #3773f8;
font-size: 32rpx;
}
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!