Commit cf6b3206 by chenwq

feat: 实现工资申诉记录列表和详情功能

- 新增工资申诉记录分页查询和详情查询 API
- 申诉列表页接入真实接口,替换模拟数据
- 申诉详情页接入真实接口,优化数据显示逻辑
- 修复考勤统计列表页数据渲染问题
- 申诉类型显示使用映射关系优化展示
1 parent 729f2a23
...@@ -440,4 +440,18 @@ module.exports = { ...@@ -440,4 +440,18 @@ module.exports = {
[], [],
'/rop-dj-staff-miniprogram/router') '/rop-dj-staff-miniprogram/router')
}, },
/** 员工工资申诉记录分页查询 */
getSalaryApplyList(data) {
return api.post('dj.api.staff.miniprogram.salaryapply.page', data,
[],
'/rop-dj-staff-miniprogram/router')
},
/** 员工工资申诉记录详情根据id查询 */
getSalaryApplyDetail(data) {
return api.post('dj.api.staff.miniprogram.salaryapply.detailById', data,
[],
'/rop-dj-staff-miniprogram/router')
},
}; };
// packageWorkspace/pages/appealFormManage/appealFormDetail/appealFormDetail.js // packageWorkspace/pages/appealFormManage/appealFormDetail/appealFormDetail.js
import api from '../../../api'
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
routerParams: {},
info: {}, info: {},
appealTypeStr: '' appealTypeStr: ''
}, },
...@@ -13,57 +15,36 @@ Page({ ...@@ -13,57 +15,36 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
// In a real scenario, use options.id to fetch data this.setData({
// this.getDetail(options.id); routerParams: options
})
// For now, use mock data based on user request this.getDetailInfo()
this.setMockData();
}, },
setMockData() { getDetailInfo() {
const mockData = { const {routerParams } = this.data
"id": 123, console.log(routerParams, '----')
"staffName": "方敏", const params = {
"staffPhone": "13800000000", id: routerParams.id
"appealType": 1, // 1:考勤,2:平板录音 }
"dealStatus": 1, api.getSalaryApplyDetail(params).then(res => {
"appealMonth": "2025-01", let { code, data, message } = res;
"sceneType": 1, console.log(data)
"merchantId": 1001, if (code == 0) {
"actualAttendanceDays": 22, this.setData({
"applyActualAttendanceDays": 26, info: data,
"confirmActualAttendanceDays": 26, appealTypeStr: this.getAppealTypeStr(data.appealType)
"padRecordNum": 0, })
"applyPadRecordNum": 0, }
"confirmPadRecordNum": 0, })
"remark": "分享时机,在不同的时机分析用户是否有分享的意愿,提供给他们合适的分享内容,能让分享的效果更好。尤其是刚上线的产品,很难通过产品的内部体系来实现快速的用户增长,所以会更加依赖于分享来达到广泛的传播,获取目标用户。所以监听用户的截图操作,提示用户进行分享,既缩短了以前分享截图的操作路径,避免了在之前长路径中的行为流失(比如截图完成后忘记分享或觉得麻烦放弃分享等等),也让用户觉得更加贴心。共200个字显示样式。",
"otherAbnormalMessage": "",
"replyContent": "分享时机,在不同的时机分析用户是否有分享的意愿,提供给他们合适的分享内容,能让分享的效果更好。尤其是刚上线的产品,很难通过产品的内部体系来实现快速的用户增长,所以会更加依赖于分享来达到广泛的传播,获取目标用户。所以监听用户的截图操作,提示用户进行分享,既缩短了以前分享截图的操作路径,避免了在之前长路径中的行为流失(比如截图完成后忘记分享或觉得麻烦放弃分享等等),也让用户觉得更加贴心。共200个字显示样式。",
"createdBy": "方敏",
"createdDate": "2025-01-05 14:30:20",
"attachmentList": [
{ "fileName": "img1.jpg", "fileUrl": "https://img02.glsx.com.cn/weapp/resource/miniprogram/regional-assistant/recruit-insert.png" },
{ "fileName": "img2.jpg", "fileUrl": "https://img02.glsx.com.cn/weapp/resource/miniprogram/regional-assistant/recruit-insert.png" },
{ "fileName": "img3.jpg", "fileUrl": "https://img02.glsx.com.cn/weapp/resource/miniprogram/regional-assistant/recruit-insert.png" },
{ "fileName": "img4.jpg", "fileUrl": "https://img02.glsx.com.cn/weapp/resource/miniprogram/regional-assistant/recruit-insert.png" },
{ "fileName": "img5.jpg", "fileUrl": "https://img02.glsx.com.cn/weapp/resource/miniprogram/regional-assistant/recruit-insert.png" },
{ "fileName": "img6.jpg", "fileUrl": "https://img02.glsx.com.cn/weapp/resource/miniprogram/regional-assistant/recruit-insert.png" }
]
};
this.setData({
info: mockData,
appealTypeStr: this.getAppealTypeStr(mockData.appealType)
});
}, },
getAppealTypeStr(type) { getAppealTypeStr(type) {
const map = { const map = {
1: '考勤', 1: '考勤',
2: '平板录音', 2: '平板'
3: '考勤、平板录音' // Assuming 3 is combination if needed
}; };
return map[type] || '未知'; return map[type] || '';
}, },
/** /**
......
...@@ -21,15 +21,14 @@ ...@@ -21,15 +21,14 @@
<text class="value ml-20 bold">{{appealTypeStr}}</text> <text class="value ml-20 bold">{{appealTypeStr}}</text>
</view> </view>
<!-- Attendance Info -->
<block wx:if="{{info.appealType == 1 || info.appealType == 3}}"> <block wx:if="{{info.appealType == 1 || info.appealType == 3}}">
<view class="row mt-20"> <view class="row mt-20">
<text class="label">本月实际出勤天数</text> <text class="label">本月实际出勤天数</text>
<text class="value ml-20">{{info.actualAttendanceDays}}天</text> <text class="value ml-20">{{info.actualAttendanceDays || ''}}天</text>
</view> </view>
<view class="row mt-20"> <view class="row mt-20">
<text class="label">申诉修改实际出勤天数</text> <text class="label">申诉修改实际出勤天数</text>
<text class="value ml-20">{{info.applyActualAttendanceDays}}天</text> <text class="value ml-20">{{info.applyActualAttendanceDays || ''}}天</text>
</view> </view>
</block> </block>
...@@ -37,11 +36,11 @@ ...@@ -37,11 +36,11 @@
<block wx:if="{{info.appealType == 2 || info.appealType == 3}}"> <block wx:if="{{info.appealType == 2 || info.appealType == 3}}">
<view class="row mt-20"> <view class="row mt-20">
<text class="label">平板录音数</text> <text class="label">平板录音数</text>
<text class="value ml-20">{{info.padRecordNum}}</text> <text class="value ml-20">{{info.padRecordNum || ''}}条</text>
</view> </view>
<view class="row mt-20"> <view class="row mt-20">
<text class="label">申诉修改平板录音数</text> <text class="label">申诉修改平板录音数</text>
<text class="value ml-20">{{info.applyPadRecordNum}}</text> <text class="value ml-20">{{info.applyPadRecordNum || ''}}条</text>
</view> </view>
</block> </block>
...@@ -61,19 +60,19 @@ ...@@ -61,19 +60,19 @@
<view class="row mt-30 align-start"> <view class="row mt-30 align-start">
<text class="label nowrap">备注说明</text> <text class="label nowrap">备注说明</text>
<text class="value ml-20 flex-1 desc-text">{{info.remark || '无'}}</text> <text class="value ml-20 flex-1 desc-text">{{info.remark || '-'}}</text>
</view> </view>
</view> </view>
<!-- Reply Card --> <!-- Reply Card -->
<view class="card reply-card"> <!-- 处理状态(1:未处理,2:已处理) -->
<view class="card reply-card" wx-if="{{info.dealStatus == 2}}">
<view class="card-title">总部回复</view> <view class="card-title">总部回复</view>
<!-- Attendance Reply --> <!-- Attendance Reply -->
<block wx:if="{{info.appealType == 1 || info.appealType == 3}}"> <block wx:if="{{info.appealType == 1 || info.appealType == 3}}">
<view class="row mt-30"> <view class="row mt-30">
<text class="label">确认实际出勤天数</text> <text class="label">确认实际出勤天数</text>
<text class="value ml-20">{{info.confirmActualAttendanceDays}}天</text> <text class="value ml-20">{{info.confirmActualAttendanceDays || ''}}天</text>
</view> </view>
</block> </block>
...@@ -81,13 +80,13 @@ ...@@ -81,13 +80,13 @@
<block wx:if="{{info.appealType == 2 || info.appealType == 3}}"> <block wx:if="{{info.appealType == 2 || info.appealType == 3}}">
<view class="row mt-30"> <view class="row mt-30">
<text class="label">确认平板录音数</text> <text class="label">确认平板录音数</text>
<text class="value ml-20">{{info.confirmPadRecordNum}}</text> <text class="value ml-20">{{info.confirmPadRecordNum || ''}}条</text>
</view> </view>
</block> </block>
<view class="row mt-30 align-start"> <view class="row mt-30 align-start">
<text class="label nowrap">备注说明</text> <text class="label nowrap">备注说明</text>
<text class="value ml-20 flex-1 desc-text">{{info.replyContent || '无'}}</text> <text class="value ml-20 flex-1 desc-text">{{info.replyContent || '-'}}</text>
</view> </view>
</view> </view>
</view> </view>
\ No newline at end of file \ No newline at end of file
// packageWorkspace/pages/appealFormManage/appealFormList/appealFormList.js // packageWorkspace/pages/appealFormManage/appealFormList/appealFormList.js
import api from '../../../api'
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
...@@ -21,6 +22,10 @@ Page({ ...@@ -21,6 +22,10 @@ Page({
list: [], list: [],
triggered: false, triggered: false,
nothing: false, nothing: false,
appealTypeMap: {
1: "考勤",
2: "平板",
},
}, },
/** /**
...@@ -46,43 +51,52 @@ Page({ ...@@ -46,43 +51,52 @@ Page({
search() { search() {
this.setData({ this.setData({
list: [], list: [],
pageNum: 1,
flag: false,
nothing: false, nothing: false,
}); });
// 模拟接口请求 this.getList();
setTimeout(() => {
this.getList();
}, 500);
}, },
/** /**
* 获取列表数据 (Mock) * 获取列表数据 (Mock)
*/ */
getList() { getList() {
// 模拟数据 let { pageNum, nothing, searchObj } = this.data;
const mockList = [ let userInfo = wx.$util.getUserInfo();
{ if (nothing) return;
id: 1, wx.$util.showLoading();
staffName: "张三", api
applyDate: "2026-01-10", .getSalaryApplyList({
appealType: "补卡申请", ...searchObj,
status: "待审批", pageNum,
}, pageSize: 10,
{ })
id: 2, .then((res) => {
staffName: "李四", wx.$util.hideLoading();
applyDate: "2026-01-12", let total = 0;
appealType: "请假申请", let list = [];
status: "已通过", let { code, data, message } = res;
}, console.log(data)
]; if (code == 0) {
list = data.list;
let filteredList = mockList; total = data.total;
} else {
this.setData({ wx.$util.showToast(message);
list: [filteredList], // 二维数组结构 }
triggered: false, if (total != 0) {
nothing: true, this.setData({
}); [`list[${pageNum - 1}]`]: list,
});
}
this.setData({
total,
flag: true,
triggered: false,
pageNum: pageNum + 1,
nothing: pageNum == data.pages,
});
});
}, },
/** /**
...@@ -96,7 +110,7 @@ Page({ ...@@ -96,7 +110,7 @@ Page({
* 上拉加载 * 上拉加载
*/ */
onReachBottom() { onReachBottom() {
// Mock no more data this.getList()
}, },
/** /**
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
</view> </view>
<view class="stat-item"> <view class="stat-item">
<text class="label">申诉类型</text> <text class="label">申诉类型</text>
<text class="value">{{li.appealType}}</text> <text class="value">{{appealTypeMap[li.appealType]}}</text>
</view> </view>
</view> </view>
</view> </view>
......
...@@ -74,26 +74,28 @@ Page({ ...@@ -74,26 +74,28 @@ Page({
}) })
.then((res) => { .then((res) => {
wx.$util.hideLoading(); wx.$util.hideLoading();
let total = 0; // let total = 0;
let list = []; let list = [];
let { code, data, message } = res; let { code, data, message } = res;
console.log(data)
if (code == 0) { if (code == 0) {
list = data.list; list = data;
total = data.total; // total = data.total;
} else { } else {
wx.$util.showToast(message); wx.$util.showToast(message);
} }
if (total != 0) { // if (total != 0) {
this.setData({ // this.setData({
[`list[${pageNum - 1}]`]: list, // [`list[${pageNum - 1}]`]: list,
}); // });
} // }
this.setData({ this.setData({
total, // total,
list,
flag: true, flag: true,
triggered: false, triggered: false,
pageNum: pageNum + 1, pageNum: pageNum + 1,
nothing: pageNum == data.pages, nothing: !!list.length,
}); });
}); });
}, },
......
...@@ -22,29 +22,29 @@ ...@@ -22,29 +22,29 @@
> >
<block wx:if="{{ list.length > 0 }}"> <block wx:if="{{ list.length > 0 }}">
<view class="empty-box"></view> <view class="empty-box"></view>
<block wx:for="{{ list }}" wx:key="index"> <!-- <block wx:for="{{ list }}" wx:key="index"> -->
<block wx:for="{{ item }}" wx:for-item="li" wx:for-index="ind" wx:key="ind"> <block wx:for="{{ list }}" wx:for-index="ind" wx:key="ind">
<view class="item" bindtap="handleDetail" data-target="{{li}}"> <view class="item" bindtap="handleDetail" data-target="{{item}}">
<view class="item-header"> <view class="item-header">
<view class="name ellipsis">{{li.name}}</view> <view class="name ellipsis">{{item.name}}</view>
<view class="date-row"> <view class="date-row">
<text class="date">{{li.attendanceMonth}}</text> <text class="date">{{item.attendanceMonth}}</text>
<van-icon name="arrow" color="#ccc" size="16px" /> <van-icon name="arrow" color="#ccc" size="16px" />
</view> </view>
</view> </view>
<view class="item-body"> <view class="item-body">
<view class="stat-item"> <view class="stat-item">
<text class="label">应出勤天数</text> <text class="label">应出勤天数</text>
<text class="value">{{li.expectedAttendanceDays}}</text> <text class="value">{{item.expectedAttendanceDays}}</text>
</view> </view>
<view class="stat-item"> <view class="stat-item">
<text class="label">实际出勤天数</text> <text class="label">实际出勤天数</text>
<text class="value">{{li.attendanceDays}}</text> <text class="value">{{item.attendanceDays}}</text>
</view> </view>
</view> </view>
</view> </view>
</block> </block>
</block> <!-- </block> -->
<block wx:if="{{ nothing }}"> <block wx:if="{{ nothing }}">
<view class="list-nothing">到底了~</view> <view class="list-nothing">到底了~</view>
</block> </block>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!