Commit 29dabc30 by Lin

feat: 工资申诉入口配置接口联调/申述最新记录回显接口联调

1 parent 41a0c7b1
......@@ -241,5 +241,9 @@ module.exports = {
// 查询订单可展示按钮类型
getMoreBtnAPI(data) {
return api.post('dj.api.smartcarlife.refundApplyRecord.button.select', data)
}
},
// 工资申述入口判断
hasPerformanceConfig(data) {
return api.post('dj.staff.api.has.performance.config.formerchant', data)
}
}
......@@ -2,6 +2,7 @@
import api from '~/utils/request/request.js'
// const api = wx.$request
module.exports = {
/** 工资申诉概览信息查询:
* appealMonth-申诉月份(YYYY-MM)
*/
......@@ -10,7 +11,7 @@ module.exports = {
'dj.api.staff.miniprogram.salaryapply.summary',
data,
[],
'/rop-dj-riskmanage/router'
'/rop-dj-staff-miniprogram/router'
)
},
/** 工资申诉订单统计查询
......@@ -23,7 +24,7 @@ module.exports = {
'dj.api.staff.miniprogram.salaryapply.order.statistics',
data,
[],
'/rop-dj-riskmanage/router'
'/rop-dj-staff-miniprogram/router'
)
},
/** 工资申诉复议记录查询
......@@ -34,7 +35,7 @@ module.exports = {
'dj.api.staff.miniprogram.salaryapply.reply.list',
data,
[],
'/rop-dj-riskmanage/router'
'/rop-dj-staff-miniprogram/router'
)
},
/** 新增平板录音申诉
......@@ -46,7 +47,7 @@ module.exports = {
'dj.api.staff.miniprogram.salaryapply.pad.create',
data,
[],
'/rop-dj-riskmanage/router'
'/rop-dj-staff-miniprogram/router'
)
},
/** 工资申诉最新记录查询
......@@ -58,7 +59,7 @@ module.exports = {
'dj.api.staff.miniprogram.salaryapply.latest',
data,
[],
'/rop-dj-riskmanage/router'
'/rop-dj-staff-miniprogram/router'
)
},
/** 4s店查询对应的园区店 */
......
// components/appealSelector/appealSelector.js
import api from '~/api/api'
import { createSalaryapply } from '../../api'
Component({
options: {
styleIsolation: 'shared'
......@@ -14,7 +14,10 @@ Component({
currentLabel: { type: String, value: '本月实际出勤天数' }, // 当前值标签
appealLabel: { type: String, value: '申诉修改实际出勤天数' }, // 申诉输入标签
unit: { type: String, value: '天' }, // 单位
maxValue: { type: Number, value: 31 } // 最大值
maxValue: { type: Number, value: 31 }, // 最大值
// 默认表单数据(用于最新记录回显)
// 支持字段:appealNum, imageList, remarks, otherIssues
defaultForm: { type: Object, value: null }
},
data: {
......@@ -48,7 +51,6 @@ Component({
})
this.triggerEvent('close')
},
onAppealNumInput(e) {
const { appealType, maxValue, unit } = this.properties
let value = e.detail.value
......
// packageEquity/pages/salaryAppeal/salaryAppeal.js
import { getSummaryInfo,querySceneRefByShop } from './api'
import { getSummaryInfo,querySceneRefByShop, getStatistics, getReplyList, getApplyLatest } from './api'
import comApi from '~/api/api'
Page({
......@@ -29,6 +29,8 @@ Page({
appealLabel: '申诉修改实际出勤天数', // 申诉输入标签
appealUnit: '天', // 单位
appealMaxValue: 31, // 最大值
// 最新申诉记录回显(透传给 appealSelector)
appealDefaultForm: null,
// 工资统计项配置
salaryItems: [
{
......@@ -287,12 +289,18 @@ Page({
* 工资项按钮点击事件
* @param {Object} e 事件对象
*/
onSalaryItemClick: function(e) {
async onSalaryItemClick(e) {
const { type, index } = e.currentTarget.dataset
const item = this.data.salaryItems[index]
console.log('点击工资项按钮:', type, item)
// 查询最新申诉记录回显
const res = await getApplyLatest({
appealMonth: this.data.currentMonth,
appealType: type == 'attendance' ? 1 : 2
})
console.log("getApplyLatest", res)
const appealDefaultForm = res.data
// 根据不同的按钮类型执行不同的操作
switch(type) {
case 'attendance':
......@@ -304,6 +312,7 @@ Page({
const maxDays = this.getDaysInMonth(this.data.currentMonth)
this.setData({
showAppealPopup: true,
appealDefaultForm,
actualDays: actualDays,
appealType: 'attendance',
appealTitle: '申诉考勤',
......@@ -327,6 +336,7 @@ Page({
const recordingCount = recordingMatch ? parseInt(recordingMatch[1]) : 12
this.setData({
showAppealPopup: true,
appealDefaultForm,
actualDays: recordingCount,
appealType: 'recording',
appealTitle: '申诉平板',
......@@ -397,8 +407,15 @@ Page({
async onLoad(options) {
// 获取用户信息并设置商户名称
this.initOrderObj()
// 获取概览信息
this.getStaffInfo()
// 获取订单统计信息
this.getStaffStatistics()
// 获取申诉答复记录
this.getStaffReplyList()
// 月份相关的初始化逻辑已移至组件内部处理
// 页面加载时自动获取员工列表并设置第一条数据
// 仅仅对超管和区域运营(区域经理)开放员工选择功能
const userInfo = wx.$util.getUserInfo()
this.setData({
staffAbled: userInfo?.isSuper || userInfo?.loginRole == 3
......@@ -411,7 +428,31 @@ Page({
}
}
},
async getStaffStatistics() {
const userInfo = wx.$util.getUserInfo()
const res = await getStatistics({
staffPhone: userInfo?.phone,
appealMonth: this.data.currentMonth
})
console.log(res, 'getStatistics')
},
async getStaffReplyList() {
const userInfo = wx.$util.getUserInfo()
const res = await getReplyList({
staffPhone: userInfo?.phone,
appealMonth: this.data.currentMonth
})
console.log(res, 'getUserInfo')
},
async getStaffInfo() {
const userInfo = wx.$util.getUserInfo()
// 先查4s店对应的园区店,再用园区店查员工
const res = await getSummaryInfo({
staffPhone: userInfo?.phone,
appealMonth: this.data.currentMonth
})
console.log(res, 'getSummaryInfo')
},
/**
* 初始化订单对象,获取商户名称
*/
......
......@@ -107,6 +107,7 @@
appeal-label="{{ appealLabel }}"
unit="{{ appealUnit }}"
max-value="{{ appealMaxValue }}"
default-form="{{ appealDefaultForm }}"
bind:close="onCloseAppealPopup"
bind:confirm="onAppealConfirm"
></appealSelector>
......@@ -99,5 +99,9 @@ module.exports = {
*/
checkMissingReception(data) {
return api.post('dj.api.smartcarlife.staff.missing.reception.report.mini.check', data)
},
// 工资申述入口判断
hasPerformanceConfig(data) {
return api.post('dj.staff.api.has.performance.config.formerchant', data, [], '/rop-dj-staff-miniprogram/router')
}
}
......@@ -1738,8 +1738,9 @@ Page({
}
})
// V5.6.1新增工资申诉模块
// api.hasPerformanceConfig({}).then(res => {
// if(res.data) {
api.hasPerformanceConfig({merchantId: userInfo.shopMerchantId || userInfo.merchantId}).then(res => {
let hasChange = false
if (!res.data) {
if (
(userInfo?.isSuper ||
userInfo?.loginRole == 3 ||
......@@ -1751,13 +1752,17 @@ Page({
icon: 'salary_appeal_icon',
path: 'packageEquity.salaryAppeal',
noCheckdailyReport: true,
params: {
type: 2
}
})
hasChange = true
}
// }
// })
}
// 异步 push menu 不会自动触发渲染,必须显式 setData
if (hasChange) {
this.setData({
menu: menu
})
}
})
// 区域运营角色审批退款申请入口
if (userInfo?.loginRole == 3 && menu.every(item => item.name != '待审批')) {
menu.push({
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!