Commit 1e5e356d by 张立顺

feat 功能开发

1 parent d3ba905e
...@@ -8,9 +8,14 @@ module.exports = { ...@@ -8,9 +8,14 @@ module.exports = {
}, },
/**微信登录 */ /**微信登录 */
ssoLogin(data) { ssoLogin(data) {
return api.post("scrm.api.sso.weapp.jscode.getOpenId", data, [], return api.post(
"scrm.api.sso.weapp.jscode.getOpenId",
data,
[],
"/rop-scrm-sso/router", "/rop-scrm-sso/router",
"scrm",false); "scrm",
false
);
}, },
/**微信手机号登录 */ /**微信手机号登录 */
authPhone(data) { authPhone(data) {
...@@ -34,8 +39,8 @@ module.exports = { ...@@ -34,8 +39,8 @@ module.exports = {
}, },
/** 免登录 */ /** 免登录 */
loginLogAdd(data) { loginLogAdd(data) {
data.productCode = 'PC00c2' data.productCode = "PC00c2";
return api.post('dj.api.smartcarlife.login.log.add', data) return api.post("dj.api.smartcarlife.login.log.add", data);
}, },
/** 记录登录设置类型 */ /** 记录登录设置类型 */
reNoSignIn(data) { reNoSignIn(data) {
...@@ -290,14 +295,17 @@ module.exports = { ...@@ -290,14 +295,17 @@ module.exports = {
loginRecordSave(data, name) { loginRecordSave(data, name) {
// console.log(name, 'loginRecordSave'); // console.log(name, 'loginRecordSave');
// debugger // debugger
return api.post( return api.post("dj.api.smartcarlife.staff.login.record.save", data);
"dj.api.smartcarlife.staff.login.record.save",
data
);
//selectMerchantScene //selectMerchantScene
}, },
// 获取侧边栏切换门店4s店列表 // 获取侧边栏切换门店4s店列表
getCurShopList(data) { getCurShopList(data) {
return api.post("dj.api.smartcarlife.serviceMerchant.curShopList", data) return api.post("dj.api.smartcarlife.serviceMerchant.curShopList", data);
} },
/** 查询该店员工日报是否开启 */
staffDailyReportMerchantValid(data) {
// return api.post('dj.api.smartcarlife.staff.daily.report.merchant.valid', data)
return api.post("dj.api.smartcarlife.staff.daily.report.popup.need", data);
},
}; };
let modalQueue = [];
import api from "~/api.js";
// async checkDailyReport() {
const checkDailyReport = () => {
let eventRequest = [];
// 判读是否要填写日报
eventRequest.push(this.staffDailyReport(wx.$util.getUserInfo()));
return new Promise((resolve) => {
Promise.all(eventRequest).then(() => {
this.showNextModal();
});
});
};
const staffDailyReport = (userInfo) => {
return new Promise((resolve, reject) => {
api
.staffDailyReportMerchantValid({
merchantId: userInfo.shopMerchantId,
yqMerchantId: userInfo.merchantId,
staffUuid: userInfo.uuid,
sceneType: 1,
})
.then((res) => {
if (res.data) {
// 获取当前日期
let currentDate = new Date();
// 获取上一天的日期
let previousDate = new Date(currentDate);
previousDate.setDate(currentDate.getDate() - 1);
// toISOString 方法会丢失时区 导致与北京时间差八小时
let hour = previousDate.getHours() + 8;
previousDate.setHours(hour);
// 格式化日期为"yyyy-mm-dd"
let formattedDate = previousDate.toISOString().split("T")[0];
if (
wx.__HAS_NOTLOGIN_MODAL ||
userInfo?.isSuper ||
userInfo?.loginRole == 3
)
return false;
addModalToQueue(
"日报提醒",
"您有未填写的日报,请点击前往。",
"前往填写",
false,
2,
(res) => {
if (res.confirm) {
wx.$router.go("tabWorkOrder.upgradeStaffDaily", {
reportDate: formattedDate,
});
}
}
);
}
resolve();
})
.catch((err) => {
resolve();
console.log(err);
});
});
};
const addModalToQueue = (
title,
content,
confirmText,
showCancel,
priority,
eventCallback
) => {
if (modalQueue.findIndex((val) => val.content == content) < 0)
modalQueue.push({
title,
content,
confirmText,
showCancel,
priority,
eventCallback,
});
modalQueue.sort((a, b) => a.priority - b.priority);
};
export default {
checkDailyReport,
staffDailyReport,
addModalToQueue,
};
import api from '~/utils/request/request.js' import api from "~/utils/request/request.js";
// const api = wx.$request // const api = wx.$request
module.exports = { module.exports = {
/**获取当前登录账号能查看的园区店列表 */ /**获取当前登录账号能查看的园区店列表 */
getYQList() { getYQList() {
return api.post('dj.api.smartcarlife.serviceMerchant.curYqList') return api.post("dj.api.smartcarlife.serviceMerchant.curYqList");
}, },
/**门店礼券发放数据 */ /**门店礼券发放数据 */
getMerchantCouponList(data) { getMerchantCouponList(data) {
return api.post( return api.post(
// 'dj.api.smartcarlife.couponDayReport.countByMerchant', // 'dj.api.smartcarlife.couponDayReport.countByMerchant',
// 'dj.api.smartcarlife.couponDayReport.countByMerchantByOrderReport', // 'dj.api.smartcarlife.couponDayReport.countByMerchantByOrderReport',
'dj.api.smartcarlife.couponDayReport.countByMerchantByOrderSummary',//接口替换 "dj.api.smartcarlife.couponDayReport.countByMerchantByOrderSummary", //接口替换
{ {
pageSize: 9999, pageSize: 9999,
pageNum: 1, pageNum: 1,
...data ...data,
} }
) );
}, },
/** 首页账户数据 */ /** 首页账户数据 */
getHomeReport() { getHomeReport() {
return api.post('dj.api.smartcarlife.report.home') return api.post("dj.api.smartcarlife.report.home");
}, },
/**切换子登录信息 */ /**切换子登录信息 */
swtichSubLoginInfo(data) { swtichSubLoginInfo(data) {
data.productCode = 'PC00c2' data.productCode = "PC00c2";
return api.post('dj.api.smartcarlife.switch.subLoginInfo', data) return api.post("dj.api.smartcarlife.switch.subLoginInfo", data);
}, },
/** 修改统计的贴膜台次 */ /** 修改统计的贴膜台次 */
updateCouponDayReport(data) { updateCouponDayReport(data) {
return api.post('dj.api.smartcarlife.couponDayReport.updateOrInsertDayReport', data) return api.post(
"dj.api.smartcarlife.couponDayReport.updateOrInsertDayReport",
data
);
}, },
/** 待补录订单统计 */ /** 待补录订单统计 */
waitinputorder(data) { waitinputorder(data) {
let params = data || {} let params = data || {};
params.inputStatus = 0 params.inputStatus = 0;
// params.payType = 1 // params.payType = 1
return api.post('dj.api.smartcarlife.weapp.waitinputorder.count', params) return api.post("dj.api.smartcarlife.weapp.waitinputorder.count", params);
}, },
/** 查询负责人产值 */ /** 查询负责人产值 */
goodsOrderOutputValueBelong(data) { goodsOrderOutputValueBelong(data) {
return api.post('dj.api.smartcarlife.goodsOrderOutputValueBelong.listOutputValue', data) return api.post(
"dj.api.smartcarlife.goodsOrderOutputValueBelong.listOutputValue",
data
);
}, },
/** 首页统计数据 */ /** 首页统计数据 */
userStat(data) { userStat(data) {
return api.post('dj.api.smartcarlife.user.stat', data) return api.post("dj.api.smartcarlife.user.stat", data);
}, },
/** 查询当周员工日报是否填写列表 */ /** 查询当周员工日报是否填写列表 */
staffDailyReportDetailWeeklyList(data) { staffDailyReportDetailWeeklyList(data) {
return api.post('dj.api.smartcarlife.staff.daily.report.weekly.list', data) return api.post("dj.api.smartcarlife.staff.daily.report.weekly.list", data);
},
/** 查询该店员工日报是否开启 */
staffDailyReportMerchantValid(data) {
// return api.post('dj.api.smartcarlife.staff.daily.report.merchant.valid', data)
return api.post('dj.api.smartcarlife.staff.daily.report.popup.need', data)
}, },
/** 员工是否需要推送开单预警 */ /** 员工是否需要推送开单预警 */
orderStaffValid(data) { orderStaffValid(data) {
return api.post('dj.api.smartcarlife.order.staff.valid', data) return api.post("dj.api.smartcarlife.order.staff.valid", data);
} },
} };
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!