Commit ffcfc00d by 张立顺

fix 工资绩效 优化

1 parent dfcff4f5
......@@ -155,7 +155,7 @@ App({
} else {
let thisPage = wx.$router.getPageInstance()
// 启动页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;
wx.__HAS_NOTLOGIN_MODAL = true;
......
......@@ -18,7 +18,7 @@ export const appId = "wx570d9331f9ace0bd";
* 4预发布
* 5cdptest
*/
let index = 2;
let index = 3;
const accountInfo = wx.getAccountInfoSync();
const systemInfo = wx.getSystemInfoSync();
const envName = accountInfo.miniProgram.envVersion;
......
......@@ -120,6 +120,7 @@ Page({
item.paySuccessTimeLabel = wx.$util.tsFormatTime(item.paySuccessTime, 'Y年M月D日 h:m:s')
return item
})
data.orderList = data.orderList.slice(0, 100)
// wx.$util.tsFormatTime(data.orderTime, 'Y年M月D日 h:m:s')
orderList.push({ ...data })
// 当获取不到数据 无法触发scroll-view 触底加载 手动触发加载
......@@ -165,7 +166,7 @@ Page({
}
item.staffDataList = item.staffDataList.map((childItem) => {
// 工资=最终工资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)) {
// childItem.finalWage = childItem.minimumWage
// // item.performanceWage = 0
......@@ -209,22 +210,22 @@ Page({
})
},
// 减法运算解决精度丢失问题
Subtr(num1, num2) {
Subtr(num1, num2) {
var r1, r2, m, n
try{
try {
r1 = num1.toString().split('.')[1].length
} catch(e) {
} catch (e) {
r1 = 0
}
try{
}
try {
r2 = num2.toString().split(".")[1].length
}catch(e) {
} catch (e) {
r2 = 0
}
}
m = Math.pow(10, Math.max(r1, r2))
n = (r1 >= r2) ? r1 : r2
return ((num1 * m - num2 * m) / m).toFixed(n)
},
},
getDetailInfo() {
let monthArray = this.getYearMonthArray()
this.setData({
......
......@@ -1120,23 +1120,37 @@ Page({
});
},
getIsBusinessSchoolEnableCurrentUser() {
getBusinessSchoolScene({}).then((res) => {
let { menu } = this.data;
let userInfo = wx.$util.getUserInfo();
if (
(res || userInfo?.isSuper) &&
menu.every((item) => item.name != "工资绩效")
) {
menu.push({
name: "工资绩效",
icon: "businessschoo",
path: "",
});
this.setData({
menu,
});
}
});
let { menu } = this.data;
let userInfo = wx.$util.getUserInfo();
if (userInfo?.isSuper && menu.every((item) => item.name != "工资绩效")) {
menu.push({
name: "工资绩效",
icon: "businessschoo",
path: "",
});
this.setData({
menu
});
console.log(menu, userInfo?.isSuper && menu.every((item) => item.name != "工资绩效"), 'userInfo?.isSuper');
} else {
getBusinessSchoolScene({}).then((res) => {
if (res && menu.every((item) => item.name != "工资绩效")
) {
menu.push({
name: "工资绩效",
icon: "businessschoo",
path: "",
});
this.setData({
menu,
});
}
});
}
},
customerOnReady() {
......@@ -1159,7 +1173,7 @@ Page({
let { menu, newMenu } = this.data;
let userInfo = wx.$util.getUserInfo();
const isNoStaff = userInfo?.loginRole != 4 && userInfo?.loginRole != null;
this.getIsBusinessSchoolEnableCurrentUser();
// 不是员工类型
if (isNoStaff) {
menu = [
......@@ -1218,7 +1232,7 @@ Page({
url: "pages.pointsReview",
icon: "points_review",
})
}
}
if (checklist.includes(userInfo?.accountName)) {
menu = menu.filter((e) => e.name != "预约管理");
}
......@@ -1244,6 +1258,8 @@ Page({
isNoStaff,
newMenu,
});
this.getIsBusinessSchoolEnableCurrentUser();
},
onRoute(options) {
options && this.checkShowOrderPop(options);
......@@ -1294,7 +1310,6 @@ Page({
this.checkIsPadOrNot();
if (!userInfo?.isSuper && userInfo?.loginRole != 3) this.get4SStoreList();
// this.getIsBusinessSchoolEnableCurrentUser();
// 获取驻店员工目标
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!