Commit 9dbc508d by 胡悦

feat(wageAppeal): 完善工资申诉功能并调整环境配置

- 在主页框架拦截列表中添加工资申诉页面
- 考勤申诉弹窗支持动态申诉时间显示和数据回显
- 工资申诉主页面优化数据显示逻辑和样式
- 调整环境配置文件中的默认环境
1 parent 7f8426e2
......@@ -720,7 +720,7 @@ export default {
async entranceClick (item) {
console.log(item, 'item')
// 清除评估单的图片视频资源缓存
const noInterceptPage = ['DailyReport', 'DeliveryManagement', 'ReportManagement'],
const noInterceptPage = ['DailyReport', 'DeliveryManagement', 'ReportManagement', 'WageAppeal'],
{ sceneType } = this
if (!noInterceptPage.includes(item.name)) {
if (sceneType != 7) {
......
const target = ['ip', 'dev', 'uat', 'prod', 'beta']
const index = 0
const index = 1
/**
*
0本地
......
......@@ -2,13 +2,13 @@
<RightPopup ref="rightPopup" :title="title[type]" :showFooter="true" @confirm="confirm" :confirmDisabled="confirmDisabled">
<view class="popup-content">
<view class="appeal-desc">
<view class="sprite-icon icon-icon-appeal"></view>规定申诉时间为<view class="blod-text">每月6号-每月15号</view>
<view class="sprite-icon icon-icon-appeal"></view>规定申诉时间为<view class="blod-text">每月{{appealStartTime}}号-每月{{appealEndTime}}号</view>
,支持提交修订异议处理,总部流转审批,请在规定时间内完成,逾期不再受理。
</view>
<view class="form-item flex-item line">
<view class="label">{{formItem[type][0].label}}</view>
<view class="value"><text class="blue-text">{{ currentCount }}</text> {{formItem[type][1].unit}}</view>
<view class="value"><text class="blue-text">{{ count }}</text> {{formItem[type][1].unit}}</view>
</view>
<view class="form-item">
......@@ -94,7 +94,15 @@ export default {
lastRecord: {
type: Object,
default: () => {}
}
},
appealStartTime: {
type: String,
default: ''
},
appealEndTime: {
type: String,
default: ''
},
},
data() {
return {
......@@ -106,7 +114,8 @@ export default {
remark: '',
otherAbnormalMessage: ''
},
confirmDisabled: true
confirmDisabled: true,
count: ''
}
},
watch: {
......@@ -119,23 +128,31 @@ export default {
},
lastRecord: {
handler(val) {
console.log(val)
if (!val) return
const { appealType, actualAttendanceDays, applyActualAttendanceDays, padRecordNum, applyPadRecordNum, remark, otherAbnormalMessage, attachmentList } = val
const { appealType, actualAttendanceDays, applyActualAttendanceDays, padRecordNum, applyPadRecordNum, remark, otherAbnormalMessage, attachmentList, shopCount } = val
const typeMap = {
1: { count: actualAttendanceDays, modify: applyActualAttendanceDays },
2: { count: padRecordNum, modify: applyPadRecordNum }
}
const currentType = typeMap[appealType]
if (currentType) {
this.currentCount = currentType.count
this.count = currentType.count
if (currentType.modify) this.formData.modifyCount = currentType.modify
}
if (remark) this.formData.remark = remark
if (otherAbnormalMessage) this.formData.otherAbnormalMessage = otherAbnormalMessage
if (attachmentList) this.formData.images = attachmentList
if (shopCount) this.formData.shopCount = shopCount
console.log(this.formData, '==')
},
deep: true
},
currentCount: {
handler(val) {
if (val) this.count = val
}
}
},
methods: {
......@@ -252,7 +269,7 @@ export default {
})
},
async confirm() {
const { modifyCount, remark, images, otherAbnormalMessage} = this.formData, {currentCount} = this
const { modifyCount, remark, images, otherAbnormalMessage, shopCount} = this.formData, {currentCount} = this
// 校验申诉天数是否在上个月自然日天数内
if (this.type == 'attendance' && modifyCount && !this.checkLastNaturalDay(modifyCount)) return
const { sceneType, shopMerchantId } = uni.$storage.get('userInfo')
......@@ -267,6 +284,7 @@ export default {
if (this.type == 'record') {
params.appealType = 2
params.padRecordNum = currentCount
params.shopCount = shopCount
if (modifyCount) params.applyPadRecordNum = modifyCount
} else if (this.type == 'attendance') {
params.appealType = 1
......@@ -276,10 +294,14 @@ export default {
console.log(params, 'params')
const res = await uni.$api.commonApi.addWageAppeal(params)
console.log(res, '=res')
// this.$emit('confirm', {
// month: this.month,
// ...this.formData
// })
if (res) uni.showToast({
title: '申诉成功',
icon: 'success'
})
this.$emit('confirm', {
month: this.month,
...this.formData
})
this.close()
}
}
......@@ -288,14 +310,14 @@ export default {
<style scoped lang="scss">
.popup-content {
padding: 16rpx 64rpx;
padding: toRpx(16) toRpx(64);
}
.appeal-desc {
border-radius: 8rpx;
font-size: 24rpx;
border-radius: toRpx(8);
font-size: toRpx(24);
line-height: 1.5;
margin-bottom: 56rpx;
margin-bottom: toRpx(56);
display: inline-block;
display: block;
......@@ -307,12 +329,12 @@ export default {
.sprite-icon {
display: inline-block;
vertical-align: middle;
margin-right: 8rpx;
margin-right: toRpx(8);
}
}
.form-item {
margin-bottom: 32rpx;
margin-bottom: toRpx(32);
&.flex-item {
display: flex;
......@@ -321,60 +343,60 @@ export default {
}
&.line {
border-bottom: 1rpx solid #EFF0F2;
padding-bottom: 32rpx;
border-bottom: toRpx(1) solid #EFF0F2;
padding-bottom: toRpx(32);
}
.label {
font-size: 28rpx;
font-size: toRpx(28);
font-weight: 500;
color: #333;
&.m-b {
margin-bottom: 16rpx;
margin-bottom: toRpx(16);
}
}
.value {
font-size: 28rpx;
font-size: toRpx(28);
color: #333;
.blue-text {
color: #2A82E4;
margin-right: 8rpx;
margin-right: toRpx(8);
}
}
.input-box {
background: #F5F6F8;
border-radius: 16rpx;
height: 80rpx;
border-radius: toRpx(16);
height: toRpx(80);
display: flex;
align-items: center;
padding: 0 24rpx;
padding: 0 toRpx(24);
input {
flex: 1;
font-size: 28rpx;
font-size: toRpx(28);
color: #333;
}
.suffix {
font-size: 28rpx;
font-size: toRpx(28);
color: #333;
margin-left: 16rpx;
margin-left: toRpx(16);
}
}
.textarea-box {
background: #F5F6F8;
border-radius: 8rpx;
padding: 24rpx;
border-radius: toRpx(8);
padding: toRpx(24);
textarea {
width: 100%;
height: 192rpx;
font-size: 28rpx;
height: toRpx(192);
font-size: toRpx(28);
color: #333;
line-height: 1.5;
}
......@@ -384,12 +406,12 @@ export default {
.upload-container {
display: flex;
flex-wrap: wrap;
gap: 20rpx;
gap: toRpx(20);
.image-item {
width: 160rpx;
height: 160rpx;
border-radius: 16rpx;
width: toRpx(160);
height: toRpx(160);
border-radius: toRpx(16);
position: relative;
overflow: hidden;
......@@ -402,8 +424,8 @@ export default {
position: absolute;
top: 0;
right: 0;
width: 40rpx;
height: 40rpx;
width: toRpx(40);
height: toRpx(40);
background: rgba(0, 0, 0, 0.5);
// border-bottom-left-radius: 8rpx;
border-radius: 50%;
......@@ -414,19 +436,19 @@ export default {
}
.upload-btn {
width: 160rpx;
height: 160rpx;
width: toRpx(160);
height: toRpx(160);
background: #F5F8FF;
border-radius: 8rpx;
border-radius: toRpx(8);
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
.count {
font-size: 24rpx;
font-size: toRpx(24);
color: #999;
margin-top: 8rpx;
margin-top: toRpx(8);
}
}
}
......
......@@ -9,7 +9,9 @@
<view class="card-item">
<view class="card-top">
<view class="card-title">实际出勤天数</view>
<view class="card-value">{{ appealData.actualAttendanceDays || 0 }}天</view>
<view class="card-value">{{ appealData.actualAttendanceDays != null ? appealData.actualAttendanceDays : '-' }}
<view v-if="appealData.actualAttendanceDays != null" class="card-unit">天</view>
</view>
</view>
<view class="card-desc">根据打卡数据产生</view>
<view v-if="appealData.attendanceAppealable" class="action-btn" @click="handleAppeal('attendance')">申诉考勤</view>
......@@ -19,12 +21,14 @@
<view class="card-item">
<view class="card-top">
<view class="card-title">日报完成天数</view>
<view class="card-value">{{ appealData.dailyReportDays || 0 }}天</view>
<view class="card-value">{{ appealData.dailyReportDays != null ? appealData.dailyReportDays : '-' }}
<view v-if="appealData.dailyReportDays != null" class="card-unit">天</view>
</view>
</view>
<view class="card-desc">填写驻店日报天数</view>
<view class="deduction">扣款 <text class="amount">-{{ appealData.dailyReportDeductionAmount || 0 }}元</text></view>
<view class="deduction">扣款 <text class="amount">-{{ appealData.dailyReportDeductionAmount != null ? appealData.dailyReportDeductionAmount + '元' : '-' }}</text></view>
<view class="missing-days" v-if="appealData.missingDailyReportDates && appealData.missingDailyReportDates.length">
缺失天数为 <text class="warning-content"><text v-for="(day, idx) in appealData.missingDailyReportDates" :key="idx">{{ day }}{{ idx < appealData.missingDailyReportDates.length - 1 ? '、' : '' }}</text>号</text>
<text class="warning-text">缺失天数为</text> <text class="warning-content"><text v-for="(day, idx) in appealData.missingDailyReportDates" :key="idx">{{ day }}{{ idx < appealData.missingDailyReportDates.length - 1 ? '、' : '' }}</text>号</text>
</view>
<view v-if="appealData.dailyReportable" class="action-btn" @click="handleAppeal('dailyReport')">去补日报</view>
</view>
......@@ -33,10 +37,12 @@
<view class="card-item">
<view class="card-top">
<view class="card-title">平板录音完成总数</view>
<view class="card-value">{{ appealData.padRecordNum || 0 }}条</view>
<view class="card-value">{{ appealData.padRecordNum != null ? appealData.padRecordNum : '-' }}
<view v-if="appealData.padRecordNum != null" class="card-unit">条</view>
</view>
</view>
<view class="card-desc">触客总数为 <text class="blue-text">{{ appealData.touchCustomerTotal || 0 }}条</text></view>
<view class="deduction">扣款 <text class="amount">-{{ appealData.padDeductionAmount || 0 }}元</text></view>
<view class="card-desc">触客总数为 <text :class="{'blue-text': appealData.touchCustomerTotal != null}">{{ appealData.touchCustomerTotal != null ? appealData.touchCustomerTotal + '条' : '-' }}</text></view>
<view class="deduction">扣款 <text :class="{'amount': appealData.padDeductionAmount != null}">{{ appealData.padDeductionAmount != null ? '-' + appealData.padDeductionAmount + '元' : '-' }}</text></view>
<view v-if="appealData.padAppealable" class="action-btn" @click="handleAppeal('record')">申诉平板</view>
</view>
</view>
......@@ -47,10 +53,12 @@
<text class="subtitle">订单数若有异常请跟总部联系</text>
</view>
<view class="order-stats-box">
<view class="stat-item" v-for="(item, index) in orderStats" :key="index">
<view class="stat-label">{{ item.label }}</view>
<view class="stat-value">{{ item.value }}</view>
</view>
<template v-for="(item, index) in orderStats">
<view class="stat-item" :key="index" v-if="item.value != null">
<view class="stat-label">{{ item.label }}</view>
<view class="stat-value">{{ item.value }}</view>
</view>
</template>
</view>
<!-- 申诉答复记录 -->
......@@ -61,7 +69,7 @@
<view class="reply-content">{{ item.replyContent }}</view>
<view class="reply-footer">
<text>申诉类型:{{ item.appealType === 1 ? '考勤' : '平板' }}</text>
<text class="time">{{ item.createdDate }}</text>
<text class="time">{{ formatTime(item.createdDate, 'YYYY-MM-DD HH:mm:ss') }}</text>
</view>
</view>
<view v-if="replyList.length === 0" class="empty-text">
......@@ -71,11 +79,12 @@
</view>
</view>
</scroll-view>
<AttendanceRecord ref="attendanceRecord" :lastRecord="lastRecord" :currentCount="currentCount" :type="popType" :month="month" />
<AttendanceRecord @confirm="handleConfirm" :appealStartTime="appealData.appealStartTime" :appealEndTime="appealData.appealEndTime" ref="attendanceRecord" :lastRecord="lastRecord" :currentCount="currentCount" :type="popType" :month="month" />
</view>
</template>
<script>
import dayjs from 'dayjs'
import { EQUITY_ORDER_COUNT_FIELDS, BOUTIQUE_ORDER_COUNT_FIELDS } from './components/contant'
import AttendanceRecord from './components/AttendanceRecord.vue';
export default {
......@@ -104,20 +113,6 @@ export default {
return {
month: '',
appealData: {
actualAttendanceDays: 26,
attendanceDeduction: 100,
dailyReportDays: 26,
dailyReportDeductionAmount: 12300,
missingDailyReportDates: [12, 13, 17],
padRecordNum: 12,
touchCustomerTotal: 11,
padDeductionAmount: 100,
boutiqueAccessoryDealCount: 12,
windowFilmDealCount: 32,
carCoverDealCount: 20,
attendanceAppealable: true,
dailyReportable: true,
padAppealable: true
},
replyList: [],
popType: '',
......@@ -141,28 +136,14 @@ export default {
this.loadData(this.lastMonth)
},
methods: {
// 格式化时间
formatTime(time, formatStr) {
if (!time) return '-';
return dayjs(time).format(formatStr);
},
async loadData(month) {
// 模拟加载数据,实际应调用接口
console.log('Loading data for month:', month)
// setTimeout(() => {
// const getRandomTwoDigit = () => Math.floor(Math.random() * 90) + 10;
// const data = {
// "windowFilmDealCount": getRandomTwoDigit(),
// "carCoverDealCount": getRandomTwoDigit(),
// "boutiqueAccessoryDealCount": getRandomTwoDigit(),
// "wholeCarWarrantyDealCount": getRandomTwoDigit(),
// "tireInsuranceAchieveCount": getRandomTwoDigit(),
// "safePackageMaxAchieveCount": getRandomTwoDigit(),
// "safePackageAchieveCount": getRandomTwoDigit(),
// "batteryWarrantyDealCount": getRandomTwoDigit(),
// "baicWorryFreeDealCount": getRandomTwoDigit(),
// "guangAiWorryFreeDealCount": getRandomTwoDigit(),
// "guangLianBenefitDealCount": getRandomTwoDigit()
// }
// this.orderStats.forEach(item => {
// this.$set(item, 'value', data[item.prop] || 0)
// })
// })
const { phone } = uni.$storage.get('userInfo')
// 参数
const params = {
......@@ -174,12 +155,13 @@ export default {
// 工资申诉订单统计查询
const res1 = await uni.$api.commonApi.getWageAppealStatistics(params)
this.orderStats.forEach(item => {
this.$set(item, 'value', res1[item.prop] || 0)
this.$set(item, 'value', res1[item.prop])
})
const res2 = await uni.$api.commonApi.replyList(params)
this.replyList = res2 || []
},
async handleAppeal(type) {
console.log(type, 'type')
// 根据类型跳转或弹窗
if (type === 'dailyReport') {
// 去补日报逻辑
......@@ -191,24 +173,21 @@ export default {
appealMonth: this.month,
appealType: type == 'record' ? 2 : type == 'attendance' ? 1 : ''
}
// const res = await uni.$api.commonApi.getWageAppealLatestRecord(params)
// console.log('getWageAppealLatestRecord', res)
// this.lastRecord = res || {}
this.lastRecord = {
appealMonth: '2525-12',
actualAttendanceDays: 24,
applyActualAttendanceDays: 30,
appealType: type == 'record' ? 2 : type == 'attendance' ? 1 : '',
applyPadRecordNum: 90,
attachmentList: [{fileUrl: '121', fileName: '2323'}]
}
const res = await uni.$api.commonApi.getWageAppealLatestRecord(params)
console.log('getWageAppealLatestRecord', res)
this.lastRecord = res || {}
if (type == 'record') {
this.currentCount = this.appealData.padRecordNum
this.lastRecord.shopCount = this.appealData.touchCustomerTotal
} else if (type == 'attendance') {
this.currentCount = this.appealData.actualAttendanceDays
}
this.$refs.attendanceRecord.open()
}
},
handleConfirm(val) {
console.log(val)
this.loadData(this.lastMonth)
}
}
}
......@@ -221,25 +200,25 @@ export default {
}
.header {
font-size: 36rpx;
font-size: toRpx(36);
font-weight: 500;
color: #333;
margin-bottom: 32rpx;
margin-bottom: toRpx(32);
}
.section {
height: calc(100% - #{120rpx});
height: calc(100% - #{toRpx(120)});
}
.card-row {
display: flex;
justify-content: space-between;
margin: 0 48rpx 40rpx 48rpx;
margin: 0 toRpx(48) toRpx(40) toRpx(48);
}
.card-item {
width: 32%;
background: #fff;
border-radius: 24rpx;
padding: 32rpx 24rpx;
border-radius: toRpx(24);
padding: toRpx(32) toRpx(24);
box-sizing: border-box;
display: flex;
flex-direction: column;
......@@ -249,25 +228,32 @@ export default {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 16rpx;
margin-bottom: toRpx(16);
.card-title {
font-size: 28rpx;
font-size: toRpx(28);
font-weight: 500;
color: #333;
}
.card-value {
font-size: 28rpx;
font-size: toRpx(28);
font-weight: 500;
color: #333;
}
.card-unit {
display: inline-block;
font-size: toRpx(24);
}
}
.card-desc {
font-size: 24rpx;
font-size: toRpx(24);
color: #999;
margin-bottom: 16rpx;
margin-bottom: toRpx(16);
text {
margin-left: toRpx(8);
}
.blue-text {
color: #3B73FF;
......@@ -275,9 +261,12 @@ export default {
}
.deduction {
font-size: 24rpx;
font-size: toRpx(24);
color: #666;
margin-bottom: 24rpx;
margin-bottom: toRpx(24);
text {
margin-left: toRpx(8);
}
.amount {
color: #FF6B00;
......@@ -286,10 +275,13 @@ export default {
}
.missing-days {
font-size: 24rpx;
font-size: toRpx(24);
color: #757980;
margin-bottom: 24rpx;
margin-bottom: toRpx(24);
line-height: 1.4;
.warning-text {
margin-right: toRpx(8);
}
.warning-content {
color: #2A82E4;
}
......@@ -298,102 +290,103 @@ export default {
.action-btn {
margin-top: auto;
width: 100%;
height: 64rpx;
line-height: 64rpx;
height: toRpx(64);
line-height: toRpx(64);
text-align: center;
background: #EFF4FF;
border-radius: 32rpx;
border-radius: toRpx(32);
color: #3B73FF;
font-size: 28rpx;
font-size: toRpx(28);
font-weight: 500;
}
}
.section-title {
margin: 0 48rpx;
font-size: 28rpx;
margin: 0 toRpx(48);
font-size: toRpx(28);
font-weight: 500;
color: #333;
margin-bottom: 24rpx;
margin-bottom: toRpx(24);
display: flex;
align-items: center;
.subtitle {
font-size: 24rpx;
font-size: toRpx(24);
color: #999EA8;
font-weight: normal;
margin-left: 8rpx;
margin-left: toRpx(8);
}
}
.order-stats-box {
background: #fff;
border-radius: 24rpx;
padding: 32rpx 24rpx;
border-radius: toRpx(24);
padding: toRpx(32) toRpx(24);
display: flex;
flex-wrap: wrap;
margin: 0 48rpx;
margin-bottom: 40rpx;
margin: 0 toRpx(48);
margin-bottom: toRpx(40);
.stat-item {
width: 25%; // 四列布局
margin-bottom: 32rpx;
margin-bottom: toRpx(32);
&:nth-last-child(-n+4) {
margin-bottom: 0;
}
.stat-label {
font-size: 24rpx;
font-size: toRpx(24);
color: #777;
margin-bottom: 8rpx;
margin-bottom: toRpx(8);
}
.stat-value {
font-size: 32rpx;
font-size: toRpx(32);
font-weight: 500;
color: #222;
}
}
}
.reply-container {
padding-bottom: 32rpx;
padding-bottom: toRpx(32);
}
.reply-list {
flex: 1;
background: #fff;
border-radius: 24rpx;
padding: 32rpx 24rpx;
margin: 0 48rpx;
border-radius: toRpx(24);
padding: toRpx(32) toRpx(24);
margin: 0 toRpx(48);
box-sizing: border-box;
overflow: hidden;
.reply-item {
background: #FAFAFA;
border-radius: 16rpx;
padding: 24rpx;
margin-bottom: 24rpx;
border-radius: toRpx(16);
padding: toRpx(24);
margin-bottom: toRpx(24);
&:last-child {
margin-bottom: 0;
}
.reply-content {
font-size: 28rpx;
font-size: toRpx(28);
color: #292D33;
line-height: 1.5;
margin-bottom: 16rpx;
margin-bottom: toRpx(16);
word-break: break-all;
}
.reply-footer {
display: flex;
justify-content: flex-end;
align-items: center;
font-size: 24rpx;
font-size: toRpx(24);
color: #757B85;
.time {
margin-left: 24rpx;
margin-left: toRpx(24);
color: #999EA8;
}
}
......@@ -402,11 +395,11 @@ export default {
.empty-text {
text-align: center;
color: #999EA8;
font-size: 24rpx;
font-size: toRpx(24);
margin: 0 auto;
.empty-image {
width: 128rpx;
height: 128rpx;
width: toRpx(128);
height: toRpx(128);
}
}
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!