Commit ffcfc00d by 张立顺

fix 工资绩效 优化

1 parent dfcff4f5
...@@ -155,7 +155,7 @@ App({ ...@@ -155,7 +155,7 @@ App({
} else { } else {
let thisPage = wx.$router.getPageInstance() let thisPage = wx.$router.getPageInstance()
// 启动页loading中的埋点接口 在触发登录超时后 ios端wx.showModal会被页面跳转截断,导致无弹窗,将loading页面这个埋点接口的登录超时不做弹窗处理 // 启动页loading中的埋点接口 在触发登录超时后 ios端wx.showModal会被页面跳转截断,导致无弹窗,将loading页面这个埋点接口的登录超时不做弹窗处理
if (thisPage.route == 'pages/loading/loading' && RequestMethods.includes('dj.api.smartcarlife.staff.login.record.save')) return if (thisPage?.route == 'pages/loading/loading' && RequestMethods.includes('dj.api.smartcarlife.staff.login.record.save')) return
// 标志位 解决安卓查复弹框问题 // 标志位 解决安卓查复弹框问题
if (wx.__HAS_NOTLOGIN_MODAL) return false; if (wx.__HAS_NOTLOGIN_MODAL) return false;
wx.__HAS_NOTLOGIN_MODAL = true; wx.__HAS_NOTLOGIN_MODAL = true;
......
...@@ -18,7 +18,7 @@ export const appId = "wx570d9331f9ace0bd"; ...@@ -18,7 +18,7 @@ export const appId = "wx570d9331f9ace0bd";
* 4预发布 * 4预发布
* 5cdptest * 5cdptest
*/ */
let index = 2; let index = 3;
const accountInfo = wx.getAccountInfoSync(); const accountInfo = wx.getAccountInfoSync();
const systemInfo = wx.getSystemInfoSync(); const systemInfo = wx.getSystemInfoSync();
const envName = accountInfo.miniProgram.envVersion; const envName = accountInfo.miniProgram.envVersion;
......
...@@ -120,6 +120,7 @@ Page({ ...@@ -120,6 +120,7 @@ Page({
item.paySuccessTimeLabel = wx.$util.tsFormatTime(item.paySuccessTime, 'Y年M月D日 h:m:s') item.paySuccessTimeLabel = wx.$util.tsFormatTime(item.paySuccessTime, 'Y年M月D日 h:m:s')
return item return item
}) })
data.orderList = data.orderList.slice(0, 100)
// wx.$util.tsFormatTime(data.orderTime, 'Y年M月D日 h:m:s') // wx.$util.tsFormatTime(data.orderTime, 'Y年M月D日 h:m:s')
orderList.push({ ...data }) orderList.push({ ...data })
// 当获取不到数据 无法触发scroll-view 触底加载 手动触发加载 // 当获取不到数据 无法触发scroll-view 触底加载 手动触发加载
...@@ -165,7 +166,7 @@ Page({ ...@@ -165,7 +166,7 @@ Page({
} }
item.staffDataList = item.staffDataList.map((childItem) => { item.staffDataList = item.staffDataList.map((childItem) => {
// 工资=最终工资finalWage-绩效提成performanceWage // 工资=最终工资finalWage-绩效提成performanceWage
childItem.wages = this.Subtr(childItem?.finalWage, childItem?.performanceWage) childItem.wages = this.Subtr(childItem?.finalWage, childItem?.performanceWage)
// if (Boolean(childItem.minimumWage && childItem.minimumWage > childItem.finalWage)) { // if (Boolean(childItem.minimumWage && childItem.minimumWage > childItem.finalWage)) {
// childItem.finalWage = childItem.minimumWage // childItem.finalWage = childItem.minimumWage
// // item.performanceWage = 0 // // item.performanceWage = 0
...@@ -209,22 +210,22 @@ Page({ ...@@ -209,22 +210,22 @@ Page({
}) })
}, },
// 减法运算解决精度丢失问题 // 减法运算解决精度丢失问题
Subtr(num1, num2) { Subtr(num1, num2) {
var r1, r2, m, n var r1, r2, m, n
try{ try {
r1 = num1.toString().split('.')[1].length r1 = num1.toString().split('.')[1].length
} catch(e) { } catch (e) {
r1 = 0 r1 = 0
} }
try{ try {
r2 = num2.toString().split(".")[1].length r2 = num2.toString().split(".")[1].length
}catch(e) { } catch (e) {
r2 = 0 r2 = 0
} }
m = Math.pow(10, Math.max(r1, r2)) m = Math.pow(10, Math.max(r1, r2))
n = (r1 >= r2) ? r1 : r2 n = (r1 >= r2) ? r1 : r2
return ((num1 * m - num2 * m) / m).toFixed(n) return ((num1 * m - num2 * m) / m).toFixed(n)
}, },
getDetailInfo() { getDetailInfo() {
let monthArray = this.getYearMonthArray() let monthArray = this.getYearMonthArray()
this.setData({ this.setData({
......
...@@ -1120,23 +1120,37 @@ Page({ ...@@ -1120,23 +1120,37 @@ Page({
}); });
}, },
getIsBusinessSchoolEnableCurrentUser() { getIsBusinessSchoolEnableCurrentUser() {
getBusinessSchoolScene({}).then((res) => { let { menu } = this.data;
let { menu } = this.data; let userInfo = wx.$util.getUserInfo();
let userInfo = wx.$util.getUserInfo(); if (userInfo?.isSuper && menu.every((item) => item.name != "工资绩效")) {
if ( menu.push({
(res || userInfo?.isSuper) && name: "工资绩效",
menu.every((item) => item.name != "工资绩效") icon: "businessschoo",
) { path: "",
menu.push({ });
name: "工资绩效", this.setData({
icon: "businessschoo", menu
path: "", });
}); console.log(menu, userInfo?.isSuper && menu.every((item) => item.name != "工资绩效"), 'userInfo?.isSuper');
this.setData({
menu, } else {
}); getBusinessSchoolScene({}).then((res) => {
} if (res && menu.every((item) => item.name != "工资绩效")
}); ) {
menu.push({
name: "工资绩效",
icon: "businessschoo",
path: "",
});
this.setData({
menu,
});
}
});
}
}, },
customerOnReady() { customerOnReady() {
...@@ -1159,7 +1173,7 @@ Page({ ...@@ -1159,7 +1173,7 @@ Page({
let { menu, newMenu } = this.data; let { menu, newMenu } = this.data;
let userInfo = wx.$util.getUserInfo(); let userInfo = wx.$util.getUserInfo();
const isNoStaff = userInfo?.loginRole != 4 && userInfo?.loginRole != null; const isNoStaff = userInfo?.loginRole != 4 && userInfo?.loginRole != null;
this.getIsBusinessSchoolEnableCurrentUser();
// 不是员工类型 // 不是员工类型
if (isNoStaff) { if (isNoStaff) {
menu = [ menu = [
...@@ -1218,7 +1232,7 @@ Page({ ...@@ -1218,7 +1232,7 @@ Page({
url: "pages.pointsReview", url: "pages.pointsReview",
icon: "points_review", icon: "points_review",
}) })
} }
if (checklist.includes(userInfo?.accountName)) { if (checklist.includes(userInfo?.accountName)) {
menu = menu.filter((e) => e.name != "预约管理"); menu = menu.filter((e) => e.name != "预约管理");
} }
...@@ -1244,6 +1258,8 @@ Page({ ...@@ -1244,6 +1258,8 @@ Page({
isNoStaff, isNoStaff,
newMenu, newMenu,
}); });
this.getIsBusinessSchoolEnableCurrentUser();
}, },
onRoute(options) { onRoute(options) {
options && this.checkShowOrderPop(options); options && this.checkShowOrderPop(options);
...@@ -1294,7 +1310,6 @@ Page({ ...@@ -1294,7 +1310,6 @@ Page({
this.checkIsPadOrNot(); this.checkIsPadOrNot();
if (!userInfo?.isSuper && userInfo?.loginRole != 3) this.get4SStoreList(); if (!userInfo?.isSuper && userInfo?.loginRole != 3) this.get4SStoreList();
// this.getIsBusinessSchoolEnableCurrentUser();
// 获取驻店员工目标 // 获取驻店员工目标
if (app.globalData.isStaff) this.getStaffTargetTask(); if (app.globalData.isStaff) this.getStaffTargetTask();
}, },
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!