Commit aa7df2fa by 杨明

工资测算

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