Commit 4aa1f91d by Jaxon

Merge remote-tracking branch 'origin/SAAS+V5.6.1' into SAAS+V5.6.0

# Conflicts:
#	app.json
#	config.js
#	pages/tab/workspace/workspace.js
#	pages/tab/workspace/workspace.sass
#	pages/tab/workspace/workspace.wxml
2 parents 435642b5 b75ec757
Showing 107 changed files with 9681 additions and 975 deletions
......@@ -423,5 +423,9 @@ module.exports = {
// 获取员工日报/周报/月报模版
getStaffTemplate(data) {
return api.post('dj.api.carboutique.find.staff.good.news.template', data)
},
// 获取异常订单待审核数量
getOrderWaitForAudit(data) {
return api.post('dj.api.smartcarlife.goodsOrderApplyRecord.waitForAudit.count', data)
}
}
//app.js
// 初始化sentry
import sentryInit from "~/utils/sentryConfig/sentryInit";
const sentry = sentryInit();
import sentryInit from '~/utils/sentryConfig/sentryInit'
const sentry = sentryInit()
wx.$sendSentry = function (e) {
sentry.captureException(e);
};
sentry.captureException(e)
}
// 解决showLoading 和 showToast显示异常的问题
import fixWxShowToast from "./utils/lib/fixWxShowToast";
fixWxShowToast();
import router from "./router/index.js";
import fixWxShowToast from './utils/lib/fixWxShowToast'
fixWxShowToast()
import router from './router/index.js'
// 判断小程序是否需要更新
import getUpdateManager from "./utils/lib/wxUpdateManager";
import util from "./utils/util.js";
import wxApi from "./utils/utils_wx";
import getUpdateManager from './utils/lib/wxUpdateManager'
import util from './utils/util.js'
import wxApi from './utils/utils_wx'
// 实例化对象存储
import { Storage } from "~/utils/cache/storage";
const $Storage = new Storage();
import { Storage } from '~/utils/cache/storage'
const $Storage = new Storage()
import {
setSystem_info,
getNoSignInUuid,
removeSystemStorage,
rmNoSignInUuid
} from "~/utils/cache/storageApi";
setSystem_info(); // 存储设备信息
import { checkYqdSuper, checkScene } from "~/store/index";
import eventbus from "./utils/eventbus";
import api from "./api/api";
import { Version } from "glsx-common-sdk";
import { areaList } from "@vant/area-data"; //预加载省市区
} from '~/utils/cache/storageApi'
setSystem_info() // 存储设备信息
import { checkYqdSuper, checkScene } from '~/store/index'
import eventbus from './utils/eventbus'
import api from './api/api'
import { Version } from 'glsx-common-sdk'
import { areaList } from '@vant/area-data' //预加载省市区
import globalDataFunction from './mixins/globalDataFunction'
......@@ -37,90 +37,90 @@ const $Track = new Track()
// 将 api.reNoSignIn() 函数包装为防抖函数
const debouncedReNoSignIn = debounce(function (noSignInUuid, that) {
console.log("debouncedReNoSignIn2222");
console.log('debouncedReNoSignIn2222')
api
.reNoSignIn({
noSignInUuid: noSignInUuid,
noSignInUuid: noSignInUuid
})
.then((res) => {
let { code, data } = res;
if (code == "0" && data) {
util.setSessionId(data?.sessionId);
.then(res => {
let { code, data } = res
if (code == '0' && data) {
util.setSessionId(data?.sessionId)
// debugger
// 还要判断一下他是不是全部登录完,不是直接打到账号选择页面
if (!data.needSelectAccount) {
wx.reLaunch({ url: "/pages/loading/loading" });
wx.reLaunch({ url: '/pages/loading/loading' })
} else {
// debugger
wx.reLaunch({ url: "/pages/accountItems/accountItems" });
wx.reLaunch({ url: '/pages/accountItems/accountItems' })
}
} else {
util.removeStorage();
removeSystemStorage();
that.login(false);
util.removeStorage()
removeSystemStorage()
that.login(false)
}
});
}, 0); // 设置防抖时间为 0 秒
})
}, 0) // 设置防抖时间为 0 秒
// }, 0); // 设置防抖时间为 5 秒
// 定义一个防抖函数
function debounce(func, timeout) {
let timer;
let timer
return (...args) => {
clearTimeout(timer);
clearTimeout(timer)
timer = setTimeout(() => {
func.apply(this, args);
}, timeout);
};
func.apply(this, args)
}, timeout)
}
}
App({
onLaunch() {
/**挂载到wx对象 */
wx.$storage = $Storage; /** 挂载全局缓存方法 */
wx.$router = router;
wx.$modal = this.showModal;
wx.$util = util;
wx.$api = wxApi;
wx.$eventbus = eventbus;
wx.$areaList = areaList;
wx.$storage = $Storage /** 挂载全局缓存方法 */
wx.$router = router
wx.$modal = this.showModal
wx.$util = util
wx.$api = wxApi
wx.$eventbus = eventbus
wx.$areaList = areaList
wx.$track = $Track
let userInfo = util.getStorageSync("dj_boutique_user_info");
let userInfo = util.getStorageSync('dj_boutique_user_info')
// ,this.globalData, userInfo
userInfo && this.gobalCheckYqdSuper(userInfo);
userInfo && this.gobalCheckYqdSuper(userInfo)
wx.$versionConfig = new Version({
request: {
baseUrl: "https://config-center-backend.glsx.com.cn/glsxAdmin/config",
isSign: false,
},
});
baseUrl: 'https://config-center-backend.glsx.com.cn/glsxAdmin/config',
isSign: false
}
})
wx.$globalDataFunction = globalDataFunction
},
async getVersionInfo(request) {
if (request) this.globalData.versionData = null;
const { versionData } = this.globalData;
if (versionData) return versionData;
if (request) this.globalData.versionData = null
const { versionData } = this.globalData
if (versionData) return versionData
else {
const res = await wx.$versionConfig.get({
moduleUrl: "dj-car-boutique-work-wechat",
moduleUrl: 'dj-car-boutique-work-wechat',
// moduleUrl: 'business-assistant',
env: "update",
});
this.globalData.versionData = res;
return res;
env: 'update'
})
this.globalData.versionData = res
return res
}
},
showModal(that, options, id = "#modal") {
showModal(that, options, id = '#modal') {
// id = id || "#modal";
that.selectComponent(id).showModal(options);
that.selectComponent(id).showModal(options)
},
gobalCheckYqdSuper(userInfo) {
checkYqdSuper(userInfo, this.globalData);
checkYqdSuper(userInfo, this.globalData)
},
onShow(options) {
wx.onMemoryWarning(function () {
console.log("onMemoryWarningReceive");
});
console.log('onMemoryWarningReceive')
})
// console.log('lifeshow')
getUpdateManager();
getUpdateManager()
// options = {
// query: {
// page: 'playVideo',
......@@ -133,26 +133,26 @@ App({
if (options) {
console.log('options', options)
let res = checkScene(options);
let res = checkScene(options)
// console.log(res, 'res')
// 如果需要重新登录 去掉30天免登录逻辑避免自动登录直接跳回到首页去
if (res) {
rmNoSignInUuid()
this.login(true, res);
this.login(true, res)
}
// res &&
}
},
login(relogin, context, RequestMethods) {
let that = this;
let that = this
// 清空多账号信息
if (relogin) {
// 判断有没有 30 天免登陆 有直接跳选园区
let noSignInUuid = getNoSignInUuid();
console.log("noSignInUuid", noSignInUuid);
let noSignInUuid = getNoSignInUuid()
console.log('noSignInUuid', noSignInUuid)
if (noSignInUuid) {
// 调用防抖函数
debouncedReNoSignIn(noSignInUuid, that);
debouncedReNoSignIn(noSignInUuid, that)
// util.debounce(() => {
// console.log(1112);
// api
......@@ -176,57 +176,62 @@ 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;
if (wx.__HAS_NOTLOGIN_MODAL) return false
wx.__HAS_NOTLOGIN_MODAL = true
wx.showModal({
title: "温馨提示",
content: context || "登录过期,请重新登录。",
title: '温馨提示',
content: context || '登录过期,请重新登录。',
showCancel: false,
confirmText: "去登录",
confirmColor: "#2C66F7",
confirmText: '去登录',
confirmColor: '#2C66F7',
success(res) {
if (res.confirm) {
that.globalData.yqdInfo = {};
that.globalData.YQorderSetting = "";
that.globalData.YQList = "";
that.globalData.businessSchoolScene = "";
util.removeStorage();
wx.$relogin = relogin;
router.reLaunch("pages.wxLogin");
that.globalData.yqdInfo = {}
that.globalData.YQorderSetting = ''
that.globalData.YQList = ''
that.globalData.businessSchoolScene = ''
util.removeStorage()
wx.$relogin = relogin
router.reLaunch('pages.wxLogin')
}
},
complete: () => {
// 这个延迟的目的是为了避免短时间内重复弹出
// 你要是没有这个需要也可以去掉,直接把标志位改成 false 就行
setTimeout(() => {
wx.__HAS_NOTLOGIN_MODAL = false;
}, 2000);
},
});
wx.__HAS_NOTLOGIN_MODAL = false
}, 2000)
}
})
}
} else {
this.globalData.yqdInfo = {};
this.globalData.YQorderSetting = "";
this.globalData.YQList = "";
this.globalData.businessSchoolScene = "";
util.removeStorage();
removeSystemStorage();
wx.$relogin = relogin;
router.reLaunch("pages.wxLogin");
this.globalData.yqdInfo = {}
this.globalData.YQorderSetting = ''
this.globalData.YQList = ''
this.globalData.businessSchoolScene = ''
util.removeStorage()
removeSystemStorage()
wx.$relogin = relogin
router.reLaunch('pages.wxLogin')
}
},
globalData: {
statusBarHeight: wx.getSystemInfoSync()["statusBarHeight"], // 头部导航栏的高度
statusBarHeight: wx.getSystemInfoSync()['statusBarHeight'], // 头部导航栏的高度
yqdInfo: {},
isYqdSuper: true,
isStaff: false,
YQorderSetting: "",
count: "",
YQorderSetting: '',
count: '',
versionData: null,
businessSchoolScene: "",
ROUTE_QUERY: {},//路由携带的参数
},
});
businessSchoolScene: '',
ROUTE_QUERY: {}, //路由携带的参数
isChoosingMedia: false
}
})
{
"pages": [
"pages/loading/loading",
"pages/sceneIndex/sceneIndex",
"pages/wxLogin/wxLogin",
"pages/accountItems/accountItems",
"pages/merchantList/merchantList",
"pages/nothing/nothing",
"pages/webView/webView",
"pages/tab/index/index",
"pages/tab/workspace/workspace",
"pages/tab/study/study",
"pages/tab/mine/mine",
"pages/log/log",
"pages/changeScene/changeScene",
"pages/h5AuthPhone/h5AuthPhone"
],
"window": {
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTitleText": "嘀加区域助手",
"navigationBarTextStyle": "black",
"pageOrientation": "auto"
},
"tabBar": {
"color": "#999999",
"selectedColor": "#222222",
"backgroundColor": "#FFFFFF",
"position": "bottom",
"list": [
{
"pagePath": "pages/tab/index/index",
"text": "首页",
"iconPath": "images/tab-home.png",
"selectedIconPath": "images/tab-home-active.png"
},
{
"pagePath": "pages/tab/workspace/workspace",
"text": "工作台",
"iconPath": "images/tab-workspace.png",
"selectedIconPath": "images/tab-workspace-active.png"
},
{
"pagePath": "pages/tab/study/study",
"text": "学习",
"iconPath": "images/tab-study.png",
"selectedIconPath": "images/tab-study-active.png"
},
{
"pagePath": "pages/tab/mine/mine",
"text": "我的",
"iconPath": "images/tab-mine.png",
"selectedIconPath": "images/tab-mine-active.png"
}
]
},
"subpackages": [
{
"root": "packageWorkspace",
"name": "packageWorkspace",
"pages": [
"pages/serverCenter/view/serverCenter/serverCenter",
"pages/serverCenter/view/companyNoticeDetail/companyNoticeDetail",
"pages": [
"pages/loading/loading",
"pages/sceneIndex/sceneIndex",
"pages/wxLogin/wxLogin",
"pages/accountItems/accountItems",
"pages/merchantList/merchantList",
"pages/nothing/nothing",
"pages/webView/webView",
"pages/tab/index/index",
"pages/tab/workspace/workspace",
"pages/tab/study/study",
"pages/tab/mine/mine",
"pages/log/log",
"pages/changeScene/changeScene",
"pages/h5AuthPhone/h5AuthPhone"
],
"window": {
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTitleText": "嘀加区域助手",
"navigationBarTextStyle": "black",
"pageOrientation": "auto"
},
"tabBar": {
"color": "#999999",
"selectedColor": "#222222",
"backgroundColor": "#FFFFFF",
"position": "bottom",
"list": [
{
"pagePath": "pages/tab/index/index",
"text": "首页",
"iconPath": "images/tab-home.png",
"selectedIconPath": "images/tab-home-active.png"
},
{
"pagePath": "pages/tab/workspace/workspace",
"text": "工作台",
"iconPath": "images/tab-workspace.png",
"selectedIconPath": "images/tab-workspace-active.png"
},
{
"pagePath": "pages/tab/study/study",
"text": "学习",
"iconPath": "images/tab-study.png",
"selectedIconPath": "images/tab-study-active.png"
},
{
"pagePath": "pages/tab/mine/mine",
"text": "我的",
"iconPath": "images/tab-mine.png",
"selectedIconPath": "images/tab-mine-active.png"
}
]
},
"subpackages": [
{
"root": "packageWorkspace",
"name": "packageWorkspace",
"pages": [
"pages/serverCenter/view/serverCenter/serverCenter",
"pages/serverCenter/view/companyNoticeDetail/companyNoticeDetail",
"pages/refundOperationList/refundOperationList",
"pages/refundDetailList/refundDetailList",
"pages/refundApply/refundApply",
"pages/receptionRecords/receptionRecords",
"pages/receptionDetail/receptionDetail",
"pages/newReceptionRecords/newReceptionRecords",
"pages/residentManage/residentManage",
"pages/recruitManage/recruitDetail/recruitDetail",
"pages/recruitManage/recruitInsert/recruitInsert",
"pages/recruitManage/recruitResult/recruitResult",
"pages/recruitManage/recruitManage/recruitManage",
"pages/supervisorDaily/supervisorDaily",
"pages/talentAnalysis/talentAnalysis",
"pages/carBrands/carBrands",
"pages/carSeries/carSeries",
"pages/performanceRating/rateList/retaList",
"pages/validReferralCount/referralCountList/referralCountList"
]
},
{
"root": "packageStudy",
"name": "packageStudy",
"pages": [
"pages/sceneMarket/index/index",
"pages/sceneMarket/clue/clue",
"pages/sceneMarket/clueForm/clueForm",
"pages/sceneMarket/materialPage/materialPage",
"pages/sceneMarket/carBrands/carBrands",
"pages/sceneMarket/carSeries/carSeries",
"pages/aiCheck/chat/chat",
"pages/aiCheck/result/result",
"pages/aiCheck/scene/scene",
"pages/aiCheck/start/start",
"pages/aiCheck/redundance/redundance",
"pages/aiCheck/detail/detail",
"pages/aiCheck/defense/defense"
]
}
],
"usingComponents": {
"gl-textarea": "/components/GlTextarea/GlTextarea",
"gl-cell": "/components/GlCell/GlCell",
"gl-cust-form": "/components/GLCustForm/GLCustForm",
"calendar": "/components/Calendar/Calendar",
"navigation-bar": "/components/navigationBar/navigationBar",
"popup": "/components/Popup/Popup",
"search-input": "/components/SearchInput/SearchInput",
"tab-bar": "/components/TabBar/TabBar",
"modal": "components/modal/modal",
"gl-image": "components/GlImage/index",
"van-field": "@vant/weapp/field/index",
"van-radio-group": "@vant/weapp/radio-group/index",
"van-radio": "@vant/weapp/radio/index",
"van-popup": "@vant/weapp/popup/index",
"van-dialog": "@vant/weapp/dialog/index",
"van-uploader": "@vant/weapp/uploader/index",
"glsx-privacy": "glsk-applet-component/GlsxPrivacy/index",
"empty-data": "/components/EmptyData/EmptyData",
"van-switch": "@vant/weapp/switch/index"
},
"resolveAlias": {
"~/*": "/*"
},
"sitemapLocation": "sitemap.json",
"permission": {
"scope.userLocation": {
"desc": "你的位置信息将用于小程序位置接口的效果展示"
}
},
"lazyCodeLoading": "requiredComponents",
"resizable": true
"pages/refundOperationList/refundOperationList",
"pages/refundDetailList/refundDetailList",
"pages/refundApply/refundApply",
"pages/receptionRecords/receptionRecords",
"pages/receptionDetail/receptionDetail",
"pages/newReceptionRecords/newReceptionRecords",
"pages/residentManage/residentManage",
"pages/recruitManage/recruitDetail/recruitDetail",
"pages/recruitManage/recruitInsert/recruitInsert",
"pages/recruitManage/recruitResult/recruitResult",
"pages/recruitManage/recruitManage/recruitManage",
"pages/supervisorDaily/supervisorDaily",
"pages/talentAnalysis/talentAnalysis",
"pages/carBrands/carBrands",
"pages/carSeries/carSeries",
"pages/performanceRating/rateList/retaList",
"pages/validReferralCount/referralCountList/referralCountList",
"pages/attendanceStatis/attendanceList/attendanceList",
"pages/appealFormManage/appealFormList/appealFormList",
"pages/orderApprovalManage/orderApprovalList/orderApprovalList",
"pages/orderApprovalManage/orderApprovalDetail/orderApprovalDetail",
"pages/performanceRating/ruleNote/ruleNote",
"pages/performanceRating/rateEdit/rateEdit",
"pages/performanceRating/rateDetail/rateDetail",
"pages/performanceRating/batchOperation/batchOperation",
"pages/validReferralCount/referraCountEdit/referraCountEdit",
"pages/attendanceStatis/attendanceDetail/attendanceDetail",
"pages/appealFormManage/appealFormDetail/appealFormDetail"
]
},
{
"root": "packageStudy",
"name": "packageStudy",
"pages": [
"pages/sceneMarket/index/index",
"pages/sceneMarket/clue/clue",
"pages/sceneMarket/clueForm/clueForm",
"pages/sceneMarket/materialPage/materialPage",
"pages/sceneMarket/carBrands/carBrands",
"pages/sceneMarket/carSeries/carSeries",
"pages/aiCheck/chat/chat",
"pages/aiCheck/result/result",
"pages/aiCheck/scene/scene",
"pages/aiCheck/start/start",
"pages/aiCheck/redundance/redundance",
"pages/aiCheck/detail/detail",
"pages/aiCheck/defense/defense"
]
}
],
"usingComponents": {
"gl-textarea": "/components/GlTextarea/GlTextarea",
"gl-cell": "/components/GlCell/GlCell",
"gl-cust-form": "/components/GLCustForm/GLCustForm",
"calendar": "/components/Calendar/Calendar",
"navigation-bar": "/components/navigationBar/navigationBar",
"popup": "/components/Popup/Popup",
"search-input": "/components/SearchInput/SearchInput",
"tab-bar": "/components/TabBar/TabBar",
"modal": "components/modal/modal",
"gl-image": "components/GlImage/index",
"van-field": "@vant/weapp/field/index",
"van-radio-group": "@vant/weapp/radio-group/index",
"van-radio": "@vant/weapp/radio/index",
"van-popup": "@vant/weapp/popup/index",
"van-dialog": "@vant/weapp/dialog/index",
"van-uploader": "@vant/weapp/uploader/index",
"glsx-privacy": "glsk-applet-component/GlsxPrivacy/index",
"empty-data": "/components/EmptyData/EmptyData",
"van-switch": "@vant/weapp/switch/index"
},
"resolveAlias": {
"~/*": "/*"
},
"sitemapLocation": "sitemap.json",
"permission": {
"scope.userLocation": {
"desc": "你的位置信息将用于小程序位置接口的效果展示"
}
},
"lazyCodeLoading": "requiredComponents",
"resizable": true
}
......@@ -9,6 +9,10 @@ Component({
emptyImageStyle: {
type: String,
value: 'width: var(--fontSize208);height: var(--fontSize208);'
},
emptyText: {
type: String,
value: '暂无数据'
}
},
......
<!--components/emptyData/emptyData.wxml-->
<view class="empty-box">
<image class="no-data-img" style="{{emptyImageStyle}}" src="{{IMG_URL}}empty-data.png" />
<view class="list-not-text">暂无数据</view>
<view class="list-not-text">{{emptyText || '暂无数据'}}</view>
</view>
\ No newline at end of file
// components/FilterBar/FilterBar.js
const IMG_URL =
"https://img02.glsx.com.cn/weapp/resource/miniprogram/regional-assistant/";
const date = new Date();
const years = [];
const months = [];
for (let i = 2020; i <= date.getFullYear() + 5; i++) {
years.push(i);
}
for (let i = 1; i <= 12; i++) {
months.push(i);
}
Component({
properties: {
height: {
type: String,
value: "40%",
},
searchPlaceholder: {
type: String,
value: "门店名称",
},
searchObj: {
type: Object,
value: {},
},
searchKey: {
type: String,
value: "keyword",
},
// Array of filter objects: { type: 'month'|'select'|'date-range', label: 'Label', key: 'key', optionList: [], value: '', startKey: '', endKey: '' }
filters: {
type: Array,
value: [],
},
},
data: {
IMG_URL,
years: years,
months: months,
searchValue: "",
formData: {},
// Popup State
showPopup: false,
activeFilterIndex: -1, // Index of the filter currently being edited
// Temp Values for Popups
tempDateIndex: [years.indexOf(date.getFullYear()), date.getMonth()],
tempDateValue: new Date().getTime(),
pickerViewValue: new Date().getTime(),
minDate: new Date(2020, 0, 1).getTime(),
maxDate: new Date(new Date().getFullYear() + 5, 11, 31).getTime(),
maxDateForCalendar: (function () {
const d = new Date();
const y = d.getFullYear();
const m = (d.getMonth() + 1).toString().padStart(2, "0");
const day = d.getDate().toString().padStart(2, "0");
return `${y}-${m}-${day}`;
})(),
tempSelectIndex: 0,
},
methods: {
// Search Handlers
onSearch(e) {
if (e.detail && e.detail.value !== undefined) {
this.setData({ searchValue: e.detail.value });
}
this.triggerEvent("filterChange", this.getFilterData());
},
onSearchInput(e) {
this.setData({ searchValue: e.detail.value });
},
clearSearch() {
this.setData({ searchValue: "" });
this.triggerEvent("filterChange", this.getFilterData());
},
// Filter Tag Click Handler
onFilterTagTap(e) {
const index = e.currentTarget.dataset.index;
const filter = this.properties.filters[index];
// const currentValue = this.data.formData[filter.key];
let minDate = new Date(2020, 0, 1).getTime();
let maxDate = new Date(new Date().getFullYear() + 5, 11, 31).getTime();
if (filter.minDate) {
let str = filter.minDate;
if (/^\d{4}-\d{2}$/.test(str)) str += "-01";
const d = new Date(str.replace(/-/g, "/"));
if (!isNaN(d.getTime())) minDate = d.getTime();
}
if (filter.maxDate) {
let str = filter.maxDate;
if (/^\d{4}-\d{2}$/.test(str)) str += "-01";
const d = new Date(str.replace(/-/g, "/"));
if (!isNaN(d.getTime())) maxDate = d.getTime();
}
this.setData({
activeFilterIndex: index,
showPopup: true,
formData: this.data.searchObj,
minDate,
maxDate
});
const currentValue = this.data.searchObj[filter.key]
if (filter.type === "month") {
this.initDatePicker(currentValue, filter.pickerType);
} else if (filter.type === "select") {
console.log('99999')
this.initSelectPicker(currentValue);
}
},
// Popup Logic
closePopup() {
this.setData({ showPopup: false, activeFilterIndex: -1 });
},
confirmPopup() {
const index = this.data.activeFilterIndex;
if (index === -1) return;
const filter = this.properties.filters[index];
let newValue = "";
if (filter.type === "month") {
newValue = this.getDateFromPicker(filter.pickerType);
} else if (filter.type === "select") {
newValue = this.data.formData[filter.key];
}
// Update the specific filter's value
const key = `formData.${filter.key}`;
this.setData({
[key]: newValue,
showPopup: false,
activeFilterIndex: -1,
});
this.triggerEvent("filterChange", this.getFilterData());
},
// Date Range Logic
onDateRangeSelect(e) {
const index = e.currentTarget.dataset.index;
const filter = this.properties.filters[index];
const { start, end } = e.detail.date;
if (!start || !end) return;
const displayValue = `${start} 至 ${end}`;
const updates = {};
// Update formData with the display string for the main key (for display in FilterBar)
this.updateForm(filter, displayValue, displayValue, updates);
// Update startKey and endKey if configured
if (filter.startKey) {
updates[`formData.${filter.startKey}`] = start + ' 00:00:00';
}
if (filter.endKey) {
updates[`formData.${filter.endKey}`] = end + ' 23:59:59';
}
this.setData(updates);
this.triggerEvent("filterChange", this.getFilterData());
},
// Date Logic
initDatePicker(currentValue, pickerType = "year-month") {
let val = new Date().getTime();
if (pickerType === "time") {
val = currentValue || "00:00";
} else {
if (currentValue) {
let str = currentValue;
// Handle YYYY-MM for year-month type
if (pickerType === "year-month" && /^\d{4}-\d{2}$/.test(str)) {
str += "-01";
}
val = new Date(str.replace(/-/g, "/")).getTime();
if (isNaN(val)) val = new Date().getTime();
}
}
this.setData({ tempDateValue: val, pickerViewValue: val });
},
onDatePickChange(e) {
this.setData({ tempDateValue: e.detail });
},
getDateFromPicker(pickerType = "year-month") {
const val = this.data.tempDateValue;
if (pickerType === "time") return val;
const date = new Date(val);
const y = date.getFullYear();
const m = (date.getMonth() + 1).toString().padStart(2, "0");
const d = date.getDate().toString().padStart(2, "0");
if (pickerType === "date") return `${y}-${m}-${d}`;
if (pickerType === "year-month") return `${y}-${m}`;
return `${y}-${m}-${d}`; // default fallback
},
// Select Logic
getSelectOptions(filter) {
let optionList = filter.optionList || [];
if (!filter.hideAllOption) {
optionList = [{ confId: "", confLabel: "全部" }, ...optionList];
}
return optionList;
},
initSelectPicker(currentValue) {
const filter = this.properties.filters[this.data.activeFilterIndex];
const optionList = this.getSelectOptions(filter);
let index = 0;
if (currentValue) {
index = optionList.findIndex((item) => item.confId == currentValue);
if (index == -1) index = 0;
} else {
// If currentValue is empty, it might mean "All" is selected (if available) or no selection.
// If "All" option exists (confId: ''), index should be 0.
// If no "All" option, but optionList exist, default to first.
index = 0;
}
// Default to first option if empty and not "All" (which is also empty string but valid)
// Actually, if we have "All" option, confId is '', so formData is empty string, which is fine.
// If we don't have "All" option, and currentValue is empty, we might want to default to first option.
if (!currentValue && optionList.length > 0) {
// If it's effectively "All" or unselected, we sync it.
const firstOption = optionList[0];
const updateData = {};
this.updateForm(
filter,
firstOption.confId,
firstOption.confLabel,
updateData,
);
this.setData(updateData);
}
console.log(index, "index---");
this.setData({
currentSelectOptions: optionList, // Store current optionList to use in wxml or change handler
}, () => {
this.setData({
tempSelectIndex: index
})
});
},
onSelectPickerChange(e) {
const { index } = e.detail;
// We need to use the same optionList list as displayed
const filter = this.properties.filters[this.data.activeFilterIndex];
const optionList =
this.data.currentSelectOptions || this.getSelectOptions(filter);
const value = optionList[index];
const updateData = {
tempSelectIndex: index,
};
// Update showKey if present
this.updateForm(
filter,
value ? value.confId : "",
value ? value.confLabel : "",
updateData,
);
this.setData(updateData);
},
/**
* Updates form data with value and optional display label
* @param {Object} filter - Filter configuration object
* @param {String|Number} keyVal - The value to set for the filter key
* @param {String} showKeyVal - The label to set for the showKey (if configured)
* @param {Object} targetObj - The object to mutate with updates
*/
updateForm(filter, keyVal, showKeyVal, targetObj) {
Object.assign(targetObj, {
[`formData.${filter.key}`]: keyVal,
...(filter.showKey && { [`formData.${filter.showKey}`]: showKeyVal }),
});
},
// Reset
resetFilters() {
// Reset search
this.setData({ searchValue: "" });
// Reset all filters
const updates = {};
this.properties.filters.forEach((f) => {
this.updateForm(f, "", "", updates);
if (f.startKey) updates[`formData.${f.startKey}`] = "";
if (f.endKey) updates[`formData.${f.endKey}`] = "";
});
this.setData(updates);
this.triggerEvent("filterChange", this.getFilterData());
},
// Helper
getFilterData() {
const result = {
[this.properties.searchKey]: this.data.searchValue,
};
this.properties.filters.forEach((f) => {
let keyVal = this.data.formData[f.key] || "";
let showKeyVal = f.showKey ? this.data.formData[f.showKey] || "" : "";
// 如果当前选中的confId为空并且confLabel为全部,则传‘’
// If the value is empty and the label is "全部", treat label as empty string for output
if (keyVal == "" && showKeyVal == "全部") {
showKeyVal = "";
}
result[f.key] = keyVal;
if (f.showKey) {
result[f.showKey] = showKeyVal;
}
// Add startKey and endKey if they exist
if (f.startKey) {
result[f.startKey] = this.data.formData[f.startKey] || "";
}
if (f.endKey) {
result[f.endKey] = this.data.formData[f.endKey] || "";
}
});
return result;
},
},
});
{
"component": true,
"usingComponents": {
"TopToolbarPopup": "../TopToolbarPopup/TopToolbarPopup",
"van-datetime-picker": "@vant/weapp/datetime-picker/index",
"van-picker": "@vant/weapp/picker/index",
"calendar": "../Calendar/Calendar"
}
}
<view class="filter-bar">
<!-- Search Area -->
<view class="search-box">
<view class="search-input">
<image src="/images/search.png" class="search-icon" />
<input type="text" placeholder="{{searchPlaceholder}}" class="input" value="{{ searchValue }}" placeholder-class="input-placeholder" bindinput="onSearchInput" bindconfirm="onSearch" />
<block wx:if="{{ searchValue }}">
<image src="/images/clear.png" class="search-clear" catchtap="clearSearch" />
</block>
</view>
</view>
<!-- Filter Area -->
<view class="filter-box" wx:if="{{filters.length > 0}}">
<view class="filter-list">
<block wx:for="{{filters}}" wx:key="key">
<!-- Date Range Filter -->
<block wx:if="{{item.type === 'date-range'}}">
<calendar
class="calendar-wrapper"
allowSameDay
shortcut
bindselect="onDateRangeSelect"
calenderColor="#347BFF"
vertical
dateType='range'
minDate="2025-01-01"
maxDate="{{ maxDateForCalendar }}"
isComponents
data-index="{{index}}"
>
<view class="filter-item {{searchObj[item.key] ? 'active' : ''}}">
<text class="filter-text">{{searchObj[item.showKey || item.key] || item.label}}</text>
<image class="filter-icon" src="{{IMG_URL}}{{searchObj[item.key] ? 'expand_icon_blue' : 'expand_icon'}}.png" mode="" />
</view>
</calendar>
</block>
<!-- Other Filters (Month, Select) -->
<block wx:else>
<view class="filter-item {{searchObj[item.key] ? 'active' : ''}}" bindtap="onFilterTagTap" data-index="{{index}}">
<text class="filter-text">{{searchObj[item.showKey || item.key] || item.label}}</text>
<image class="filter-icon" src="{{IMG_URL}}{{searchObj[item.key] ? 'expand_icon_blue' : 'expand_icon'}}.png" mode="" />
</view>
</block>
</block>
</view>
<!-- Reset Button -->
<view class="reset-btn" bindtap="resetFilters">
重置
</view>
</view>
</view>
<!-- Dynamic Popup -->
<TopToolbarPopup show="{{showPopup}}" title="" bind:cancel="closePopup" bind:confirm="confirmPopup" height="{{height}}">
<!-- Content depends on active filter type -->
<block wx:if="{{activeFilterIndex > -1}}">
<!-- Type: Month -->
<block wx:if="{{filters[activeFilterIndex].type === 'month'}}">
<van-datetime-picker
type="{{filters[activeFilterIndex].pickerType || 'year-month'}}"
value="{{pickerViewValue}}"
bind:input="onDatePickChange"
show-toolbar="{{false}}"
min-date="{{minDate}}"
max-date="{{maxDate}}"
/>
</block>
<!-- Type: Select -->
<block wx:elif="{{filters[activeFilterIndex].type === 'select'}}">
<van-picker
columns="{{ currentSelectOptions }}"
value-key="confLabel"
default-index="{{ tempSelectIndex }}"
bind:change="onSelectPickerChange"
show-toolbar="{{false}}"
/>
</block>
</block>
</TopToolbarPopup>
/* components/FilterBar/FilterBar.wxss */
.filter-bar {
background: #FFFFFF;
padding: 16rpx 24rpx;
}
/* Search Box */
.search-box {
margin-bottom: 16rpx;
}
.search-input {
background: #F7F8FA;
border-radius: 72rpx;
width: 100%;
height: 72rpx;
display: flex;
align-items: center;
}
.search-icon {
width: 28rpx;
height: 28rpx;
margin: 0 10rpx 0 26rpx;
flex-shrink: 0;
}
.search-clear {
width: 36rpx;
height: 36rpx;
margin: 0 26rpx 0 10rpx;
flex-shrink: 0;
z-index: 10;
}
.input {
font-size: 28rpx;
height: 38rpx;
line-height: 38rpx;
flex: 1;
color: #333;
}
.input-placeholder {
color: #BBBBBB;
}
/* Filter Box */
.filter-box {
display: flex;
justify-content: space-between;
align-items: center;
}
.filter-list {
display: flex;
align-items: center;
flex-wrap: wrap;
}
.filter-item {
height: 56rpx;
border-radius: 56rpx;
background: #F7F8FA;
padding: 0 16rpx 0 24rpx;
font-size: 26rpx;
color: #666666;
margin-right: 16rpx;
display: flex;
align-items: center;
/* Handle wrap if many filters */
}
.filter-item.active {
color: #2C66F7;
/* background: #F7F8FA; */
/* Background stays same in reference */
}
.filter-text {
line-height: 40rpx;
max-width: 170rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.filter-icon {
width: 32rpx;
height: 32rpx;
flex-shrink: 0;
margin-left: 4rpx;
}
.reset-btn {
color: #222222;
font-size: 26rpx;
padding: 10rpx;
flex-shrink: 0;
}
\ No newline at end of file
// components/TopToolbarPopup/TopToolbarPopup.js
Component({
externalClasses: ['popup-slot-class'],
properties: {
show: {
type: Boolean,
value: false,
observer: function (n, o) {
n && wx.hideKeyboard()
this.setData({
showPopup: n
})
}
},
title: String,
height: {
type: String,
value: '85%'
},
slotStyle: String
},
data: {
isFullSucreen: false
},
methods: {
noScroll() { },
hidePopup() {
this.setData({
show: false
})
this.triggerEvent('cancel')
},
confirm() {
this.triggerEvent('confirm')
}
},
attached() {
this.setData({
isFullSucreen: wx.$util && wx.$util.isFullSucreen ? wx.$util.isFullSucreen(true) : false
})
}
})
{
"component": true,
"usingComponents": {}
}
<view class="popup" hidden="{{ !showPopup }}" catchtouchmove="noScroll">
<view class="popup-bg" bindtap="hidePopup"></view>
<view class="popup-content" style="height:{{ height }}">
<view class="popup-header">
<view class="action-btn cancel" bind:tap="hidePopup">取消</view>
<view class="title" wx:if="{{ title }}">{{title}}</view>
<view class="action-btn confirm" bind:tap="confirm">确定</view>
</view>
<view class="popup-slot popup-slot-class {{ isFullSucreen?'isFullSucreen':'' }}" style="{{slotStyle}}">
<slot></slot>
</view>
</view>
</view>
/* components/TopToolbarPopup/TopToolbarPopup.wxss */
.popup {
position: fixed;
top: 0;
left: 0;
bottom: 0;
right: 0;
z-index: 998;
transform: translateZ(2px);
}
.popup-bg {
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
background-color: rgba(0, 0, 0, .6);
}
.popup-content {
position: absolute;
left: 0;
width: 100%;
background: #FFFFFF;
border-radius: var(--fontSize20) var(--fontSize20) 0 0;
animation: show-popup .5s forwards;
box-sizing: border-box;
padding: 0 var(--fontSize40);
display: flex;
flex-direction: column;
}
.popup-header {
height: var(--fontSize112);
display: flex;
align-items: center;
justify-content: space-between;
/* border-bottom: var(--fontSize2) solid #EBEDF0; */
flex-shrink: 0;
}
.popup-header .title {
font-size: var(--fontSize34);
color: #333333;
font-weight: bold;
}
.popup-header .action-btn {
font-size: var(--fontSize32);
padding: 0 var(--fontSize10);
}
.popup-header .cancel {
color: #666666;
}
.popup-header .confirm {
color: #2C66F7;
}
.popup-slot {
flex: 1;
overflow-y: auto;
/* height: calc(100% - var(--fontSize98)); */
}
.popup-slot.isFullSucreen {
padding-bottom: var(--fontSize68);
}
@keyframes show-popup {
0% {
bottom: -100%;
}
100% {
bottom: 0;
}
}
......@@ -11,11 +11,11 @@ Component({
},
methods: {
onModalBtn(e) {
this.triggerEvent('cancel');
this.triggerEvent('cancel')
},
onSelect(e) {
const item = e.currentTarget.dataset.item;
this.triggerEvent('select', item);
const item = e.currentTarget.dataset.item
this.triggerEvent('select', item)
}
}
})
......@@ -412,4 +412,60 @@ module.exports = {
outputValueStatistics(data) {
return api.post('dj.api.smartcarlife.vehicle.damage.upgrade.quotation.outputValueStatistics', data)
},
/** 门店有效引荐数列表 */
getReferralList(data) {
return api.post('dj.api.staff.miniprogram.effective.referral.store.list', data,
[],
'/rop-dj-staff-miniprogram/router')
},
/** 门店有效引荐数详情 */
getReferralDetail(data) {
return api.post('dj.api.staff.miniprogram.effective.referral.store.detail', data,
[],
'/rop-dj-staff-miniprogram/router')
},
/** 门店有效引荐数提交 */
referralSubmit(data) {
return api.post('dj.api.staff.miniprogram.effective.referral.store.submit', data,
[],
'/rop-dj-staff-miniprogram/router')
},
/** 考勤列表 */
getStaffAttendanceList(data) {
return api.post('dj.staff.api.attendance.list', data,
[],
'/rop-dj-staff-miniprogram/router')
},
/** 考勤明细汇总 */
getStaffAttendSummary(data) {
return api.post('dj.staff.api.attendance.summary', data,
[],
'/rop-dj-staff-miniprogram/router')
},
/** 考勤明细 */
getStaffDailyDetail(data) {
return api.post('dj.staff.api.attendance.daily.detail', data,
[],
'/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/performanceRating/components/selectPopup/selectPopup.js
const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/miniprogram/regional-assistant/'
Component({
options: {
addGlobalClass: true
},
properties: {
show: {
type: Boolean,
value: false
},
title: {
type: String,
value: ''
},
// 原始选项列表,支持任意字段名,通过 labelKey/valueKey 映射
options: {
type: Array,
value: []
},
// 是否多选
multiple: {
type: Boolean,
value: false
},
// 单选初始值
value: {
type: null,
value: null
},
// 多选初始值
values: {
type: Array,
value: []
},
// 字段映射
labelKey: {
type: String,
value: 'name'
},
valueKey: {
type: String,
value: 'value'
},
// 多选最大数量(不限制则设为 0 或不传)
max: {
type: Number,
value: 0
},
// 单选时点击即确认
confirmOnSelect: {
type: Boolean,
value: false
},
height: {
type: String
},
allowSearch: {
type: Boolean
}
},
data: {
IMG_URL,
displayOptions: [], // 带 checked 的渲染选项
selectedValues: [] // 选中的值列表(单选也统一用数组)
},
observers: {
'options, multiple, value, values': function(options, multiple, value, values) {
this.initDisplay(options || [], multiple, value, values)
},
show(n) {
// 进出场时保持数据一致
if (n) {
this.setData({
searchValue: ''
})
this.initDisplay(this.properties.options || [], this.properties.multiple, this.properties.value, this.properties.values)
}
}
},
methods: {
initDisplay(options = [], multiple = false, value = null, values = []) {
const vKey = this.properties.valueKey
// 初始选中值统一转为数组
const initSelected = multiple ? (Array.isArray(values) ? values.slice() : []) : (value !== null && value !== undefined ? value : [])
const display = (options || []).map(item => {
const val = item[vKey]
const checked = initSelected?.some(v => v === val)
return { ...item, checked }
})
this.setData({
displayOptions: display,
copyDisplayOptions: wx.$util.deepClone(display),
selectedValues: initSelected
})
},
toggle(e) {
const { index, item } = e.currentTarget.dataset
const { multiple, max, valueKey } = this.properties
let { displayOptions, copyDisplayOptions } = this.data
if (!item || item.disabled) return
if (multiple) {
let nextChecked = !item.checked
// 限制最大数量
if (nextChecked && max > 0) {
const selectedCount = this.data.selectedValues.length
if (selectedCount >= max) {
// 可根据项目规范提示用户,这里不做 UI 弹窗,保持组件纯净
this.triggerEvent('maxtips')
return
}
}
const selectIndex = displayOptions?.findIndex(v => v[valueKey] == item[valueKey])
this.setData({ [`displayOptions[${selectIndex}].checked`]: nextChecked })
const copySelectIndex = copyDisplayOptions?.findIndex(v => v[valueKey] == item[valueKey])
this.setData({ [`copyDisplayOptions[${copySelectIndex}].checked`]: nextChecked })
const val = item[valueKey]
let selected = this.data.selectedValues.slice()
const pos = selected.findIndex(v => v === val)
if (nextChecked && pos === -1) selected.push(val)
if (!nextChecked && pos > -1) selected.splice(pos, 1)
this.setData({ selectedValues: selected })
this.triggerEvent('change', { values: selected, items: this.getSelectedItems() })
} else {
// 单选:取消其他,选中当前
const currentVal = item[valueKey]
const display = this.data.displayOptions.map((it, idx) => ({ ...it, checked: idx === index ? !it.checked : false }))
const selected = display[index].checked ? [currentVal] : []
this.setData({ displayOptions: display, selectedValues: selected })
this.triggerEvent('change', { values: selected, items: this.getSelectedItems() })
if (this.properties.confirmOnSelect) {
this.onConfirm()
}
}
},
search(e) {
let { labelKey, copyDisplayOptions, displayOptions, selectedValues, valueKey } = this.data
let { value } = e.detail
if (!value) {
copyDisplayOptions.map(i => {
i.checked = false
if (selectedValues.includes(i[valueKey])) i.checked = true
return i
})
this.setData({
displayOptions: copyDisplayOptions
})
} else {
let arr = []
copyDisplayOptions.map(i => {
i.checked = false
if (selectedValues.includes(i[valueKey])) i.checked = true
if (i[labelKey].indexOf(value) != -1) {
arr.push(i)
}
})
this.setData({
displayOptions: arr
})
}
},
onCancel() {
this.triggerEvent('cancel')
},
onConfirm() {
const values = this.data.selectedValues
const items = this.getSelectedItems()
this.triggerEvent('confirm', { values, items })
},
getSelectedItems() {
return (this.data.copyDisplayOptions || []).filter(it => it.checked)
}
}
})
\ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
/* packageWorkspace/pages/performanceRating/components/selectPopup/selectPopup.wxss */
.sp-list {
padding: 0 32rpx;
box-sizing: border-box;
height: 100%;
&.hassearch {
height: calc(100% - 104rpx);
}
.sp-item {
display: flex;
align-items: center;
justify-content: space-between;
height: 96rpx;
border-bottom: 2rpx solid #F0F2F5;
color: #333;
font-size: 28rpx;
&:last-child {
border-bottom: none;
}
.label {
max-width: 580rpx;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.check {
width: 36rpx;
height: 36rpx;
}
}
.active {
.label {
color: #3D74FF;
}
}
}
\ No newline at end of file
<!--packageWorkspace/pages/performanceRating/components/selectPopup/selectPopup.wxml-->
<popup show="{{show}}" title="{{title}}" height="{{height || '50%'}}" bind:confirm="onConfirm" bind:cancel="onCancel" customPopupSlotStyle="overflow:auto;">
<view wx:if="{{allowSearch}}">
<search-input bindsearch="search" placeholder="搜索" value="{{ searchValue }}" />
</view>
<scroll-view scroll-y show-scrollbar="{{false}}" enhanced class="sp-list {{allowSearch ? 'hassearch' : ''}}">
<block wx:if="{{displayOptions.length}}">
<block wx:for="{{displayOptions}}" wx:key="index">
<view class="sp-item {{item.checked ? 'active' : ''}} {{item.disabled ? 'disabled' : ''}}" catchtap="toggle" data-index="{{index}}" data-item="{{item}}">
<text class="label">{{item[labelKey] || item.label || item.text}}</text>
<image class="check" src="{{IMG_URL}}checked.png" wx:if="{{item.checked}}" />
</view>
</block>
</block>
<block wx:else>
<empty-data />
</block>
</scroll-view>
</popup>
\ No newline at end of file
// packageWorkspace/pages/appealFormManage/appealFormDetail/appealFormDetail.js
import api from '../../../api'
Page({
/**
* 页面的初始数据
*/
data: {
routerParams: {},
info: {},
appealTypeStr: ''
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.setData({
routerParams: options
})
this.getDetailInfo()
},
dealInfo(data) {
data.createdDateTxt = new Date(data.createdDate).format("yyyy-MM-dd hh:mm:ss")
return data || {}
},
getDetailInfo() {
const {routerParams } = this.data
const params = {
id: routerParams.id
}
api.getSalaryApplyDetail(params).then(res => {
let { code, data, message } = res;
if (code == 0) {
this.setData({
info: this.dealInfo(data),
appealTypeStr: this.getAppealTypeStr(data.appealType)
})
}
})
},
getAppealTypeStr(type) {
const map = {
1: '考勤',
2: '平板'
};
return map[type] || '';
},
/**
* Preview Image
*/
previewImage(e) {
const current = e.currentTarget.dataset.url;
const urls = e.currentTarget.dataset.urls.map(item => item.fileUrl);
wx.previewImage({
current,
urls
});
}
})
\ No newline at end of file
{
"usingComponents": {
"van-icon": "@vant/weapp/icon/index"
},
"navigationBarTitleText": "申诉单详情",
"navigationBarBackgroundColor": "#FFFFFF"
}
\ No newline at end of file
/* packageWorkspace/pages/appealFormManage/appealFormDetail/appealFormDetail.wxss */
page {
background: #F2F3F7;
padding-bottom: 40rpx;
}
.detail-page {
padding: 24rpx;
}
.card {
background: #FFFFFF;
border-radius: 16rpx;
padding: 32rpx;
margin-bottom: 24rpx;
}
.card-title {
font-size: 32rpx;
font-weight: 600;
color: #222222;
margin-bottom: 10rpx;
}
.row {
display: flex;
align-items: center;
}
.row-between {
display: flex;
justify-content: space-between;
align-items: center;
}
.align-start {
align-items: flex-start;
}
.mt-20 {
margin-top: 20rpx;
}
.mt-30 {
margin-top: 30rpx;
}
.ml-20 {
margin-left: 20rpx;
}
.name {
font-size: 32rpx;
font-weight: 600;
color: #222222;
}
.time {
font-size: 24rpx;
color: #999999;
font-weight: 400;
margin-left: 16rpx;
}
.label {
font-size: 28rpx;
color: #999999;
flex-shrink: 0;
}
.value {
font-size: 28rpx;
color: #222222;
-webkit-box-orient: vertical;
word-break: break-all;
}
.bold {
font-weight: 500;
}
.nowrap {
white-space: nowrap;
}
.desc-text {
line-height: 1.6;
text-align: justify;
}
.image-grid {
display: flex;
flex-wrap: wrap;
gap: 16rpx;
}
.img {
width: 200rpx;
height: 200rpx;
border-radius: 8rpx;
background-color: #f8f8f8;
}
.flex-1 {
flex: 1;
}
<!--packageWorkspace/pages/appealFormManage/appealFormDetail/appealFormDetail.wxml-->
<view class="detail-page">
<!-- Header Card -->
<view class="card header-card">
<view class="row-between">
<view class="name">{{info.staffName}} <text class="time">{{info.createdDateTxt}}提交申请</text></view>
</view>
<view class="row mt-20">
<text class="label" style="color: #666666;">申诉类型:</text>
<text class="value">{{appealTypeStr}}</text>
</view>
</view>
<!-- Content Card -->
<view class="card content-card">
<view class="card-title">申诉内容</view>
<block wx:if="{{info.appealType == 1}}">
<view class="row mt-20">
<text class="label">本月实际出勤天数</text>
<text class="value ml-20">{{(info.actualAttendanceDays === null || info.actualAttendanceDays === undefined) ? '-' : (info.actualAttendanceDays + '天')}}</text>
</view>
<view class="row mt-20">
<text class="label">申诉修改实际出勤天数</text>
<text class="value ml-20">{{(info.applyActualAttendanceDays === null || info.applyActualAttendanceDays === undefined) ? '-' : (info.applyActualAttendanceDays + '天')}}</text>
</view>
</block>
<!-- Pad Info -->
<block wx:if="{{info.appealType == 2}}">
<view class="row mt-20">
<text class="label">平板录音完成总数</text>
<text class="value ml-20">{{(info.padRecordNum === null || info.padRecordNum === undefined) ? '-' : (info.padRecordNum + '条')}}</text>
</view>
<view class="row mt-20">
<text class="label">申诉修改录音完成总数</text>
<text class="value ml-20">{{(info.applyPadRecordNum === null || info.applyPadRecordNum === undefined) ? '-' : (info.applyPadRecordNum + '条')}}</text>
</view>
</block>
<view class="section-label mt-30 label">上传截图说明</view>
<view class="image-grid mt-20">
<block wx:for="{{info.attachmentList}}" wx:key="index">
<image
class="img"
src="{{item.fileUrl}}"
mode="aspectFill"
bindtap="previewImage"
data-url="{{item.fileUrl}}"
data-urls="{{info.attachmentList}}"
></image>
</block>
<view wx-if="{{!info.attachmentList.length}}">-</view>
</view>
<view class="row mt-30 align-start">
<text class="label nowrap">备注说明</text>
<text class="value ml-20 flex-1 desc-text">{{info.remark || '-'}}</text>
</view>
</view>
<!-- Reply Card -->
<!-- 处理状态(1:未处理,2:已处理) -->
<view class="card reply-card" wx-if="{{info.dealStatus == 2}}">
<view class="card-title">总部回复</view>
<!-- Attendance Reply -->
<block wx:if="{{info.appealType == 1}}">
<view class="row mt-30">
<text class="label">确认实际出勤天数</text>
<text class="value ml-20">{{(info.confirmActualAttendanceDays === null || info.confirmActualAttendanceDays === undefined) ? '-' : (info.confirmActualAttendanceDays + '天')}}</text>
</view>
</block>
<!-- Pad Reply -->
<block wx:if="{{info.appealType == 2}}">
<view class="row mt-30">
<text class="label">确认平板录音数</text>
<text class="value ml-20">{{(info.confirmPadRecordNum === null || info.confirmPadRecordNum === undefined) ? '-' : (info.confirmPadRecordNum + '条')}}</text>
</view>
</block>
<view class="row mt-30 align-start">
<text class="label nowrap">备注说明</text>
<text class="value ml-20 flex-1 desc-text">{{info.replyContent || '-'}}</text>
</view>
</view>
</view>
\ No newline at end of file
// packageWorkspace/pages/appealFormManage/appealFormList/appealFormList.js
import api from "../../../api";
Page({
/**
* 页面的初始数据
*/
data: {
searchObj: {
staffName: "",
applyStartTime: "",
applyEndTime: "",
},
filterConfig: [
{
type: "select",
label: "申诉类型",
key: "appealType",
showKey: "appealTypeTxt",
optionId: "confId",
optionLabel: "confLabel",
optionsName: "appealTypeList",
optionList: [],
},
{
type: "date-range",
label: "申诉日期",
key: "appealDate",
startKey: "applyStartTime",
endKey: "applyEndTime",
},
{
type: "select",
label: "处理状态",
key: "dealStatus",
showKey: "dealStatusTxt",
optionId: "confId",
optionLabel: "confLabel",
optionsName: "dealStatusList",
optionList: [],
},
],
list: [],
triggered: false,
nothing: false,
appealTypeMap: {
1: "考勤",
2: "平板",
},
dealStatusMap: {
1: "未处理",
2: "已处理",
},
baseData: {
appealTypeList: [
{
confLabel: "考勤",
confId: "1",
},
{
confLabel: "平板",
confId: "2",
},
],
dealStatusList: [
{
confLabel: "未处理",
confId: "1",
},
{
confLabel: "已处理",
confId: "2",
},
],
},
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.getOptionsList("filterConfig");
this.search();
},
/**
* 筛选回调
*/
onFilterChange(e) {
this.setData({
searchObj: e.detail,
});
this.search();
},
/**
* 搜索
*/
search() {
this.setData({
list: [],
pageNum: 1,
flag: false,
nothing: false,
});
this.getList();
},
/**
* 获取列表数据 (Mock)
*/
getList() {
let { pageNum, nothing, searchObj } = this.data;
let userInfo = wx.$util.getUserInfo();
if (nothing) return;
wx.$util.showLoading();
api
.getSalaryApplyList({
...searchObj,
pageNum,
pageSize: 10,
})
.then((res) => {
wx.$util.hideLoading();
let total = 0;
let list = [];
let { code, data, message } = res;
console.log(data);
if (code == 0) {
list = data.list;
total = data.total;
} else {
wx.$util.showToast(message);
}
if (total != 0) {
this.setData({
[`list[${pageNum - 1}]`]: list,
});
}
this.setData({
total,
flag: true,
triggered: false,
pageNum: pageNum + 1,
nothing: pageNum == data.pages,
});
});
},
/**
* 下拉刷新
*/
onPullDownRefresh() {
this.search();
},
onReachBottom() {
this.getList();
},
getOptionsList(formName, refreshSigle) {
const formList = this.data[formName];
const { baseData } = this.data;
if (refreshSigle) {
var item = formList.find((k) => k.key == refreshSigle);
var index = formList.findIndex((k) => k.key == refreshSigle);
this.setData({
[`${formName}[${index}].optionList`]: wx.$util.deepClone(
baseData[item.optionsName],
),
});
} else {
formList.forEach((item, index) => {
if (
["select", "radio"].includes(item.type) &&
baseData[item.optionsName].length
) {
this.setData({
[`${formName}[${index}].optionList`]: wx.$util.deepClone(
baseData[item.optionsName],
),
});
}
});
}
},
/**
* 跳转详情 (如果有)
*/
handleDetail(e) {
let { target } = e.currentTarget.dataset;
wx.navigateTo({
url:
"/packageWorkspace/pages/appealFormManage/appealFormDetail/appealFormDetail?id=" +
target.id,
});
},
});
\ No newline at end of file
{
"usingComponents": {
"FilterBar": "/components/FilterBar/FilterBar",
"van-icon": "@vant/weapp/icon/index"
},
"navigationBarTitleText": "申诉单列表"
}
\ No newline at end of file
/* packageWorkspace/pages/appealFormManage/appealFormList/appealFormList.wxss */
page {
background: #F2F3F7;
}
.list-page {
.top-box {
background: #FFFFFF;
}
.list {
.empty-box {
width: 100%;
height: 24rpx;
}
.item {
margin: 0 24rpx 24rpx;
border-radius: 32rpx;
background: #FFFFFF;
padding: 32rpx;
.item-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 24rpx;
.name {
font-size: 32rpx;
font-weight: 600;
color: #222222;
}
.ellipsis {
overflow: hidden;
display: -webkit-box !important;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
word-break: break-all;
}
.date-row {
display: flex;
align-items: center;
flex-shrink: 0;
margin-left: 20rpx;
.date {
font-size: 28rpx;
color: #333333;
margin-right: 8rpx;
}
.status-tag {
font-size: 24rpx;
padding: 6rpx 12rpx;
border-radius: 8rpx;
margin-right: 8rpx;
&.status-1 {
color: #FF9D0A;
background: #ff9d0a1a;
}
&.status-2 {
color: #35C376;
background: #35c3761a;
}
}
}
}
.item-body {
display: flex;
align-items: center;
.stat-item {
display: flex;
align-items: center;
.label {
font-size: 26rpx;
color: #999999;
margin-right: 32rpx;
}
.value {
font-size: 28rpx;
color: #222222;
font-weight: 500;
}
}
.stat-item:first-child {
margin-right: 27rpx;
}
}
}
.list-nothing {
text-align: center;
font-size: 24rpx;
color: #999;
padding: 20rpx 0;
}
}
}
\ No newline at end of file
<!--packageWorkspace/pages/appealFormManage/appealFormList/appealFormList.wxml-->
<view class="list-page">
<view class="top-box">
<FilterBar
searchPlaceholder="员工姓名"
searchKey="staffName"
filters="{{filterConfig}}"
searchObj="{{searchObj}}"
bind:filterChange="onFilterChange"
></FilterBar>
</view>
<scroll-view
scroll-y
enable-back-to-top
refresher-enabled="{{ true }}"
bindrefresherrefresh="search"
bindscrolltolower="onReachBottom"
class="list"
style="height:calc(100vh - var(--fontSize184));"
refresher-threshold="104"
refresher-triggered="{{ triggered }}"
>
<block wx:if="{{ list.length > 0 }}">
<view class="empty-box"></view>
<block wx:for="{{ list }}" wx:key="index">
<block wx:for="{{ item }}" wx:for-item="li" wx:for-index="ind" wx:key="ind">
<view class="item" bindtap="handleDetail" data-target="{{li}}">
<view class="item-header">
<view class="name ellipsis">{{li.staffName}}</view>
<view class="date-row">
<view class="status-tag status-{{li.dealStatus}}">{{dealStatusMap[li.dealStatus]}}</view>
<van-icon name="arrow" color="#ccc" size="16px" />
</view>
</view>
<view class="item-body">
<view class="stat-item">
<text class="label">申诉日期</text>
<text class="value">{{li.applyDate}}</text>
</view>
<view class="stat-item">
<text class="label">申诉类型</text>
<text class="value">{{appealTypeMap[li.appealType]}}</text>
</view>
</view>
</view>
</block>
</block>
<block wx:if="{{ nothing }}">
<view class="list-nothing">到底了~</view>
</block>
</block>
<block wx:else>
<empty-data />
</block>
</scroll-view>
</view>
\ No newline at end of file
// packageWorkspace/pages/attendanceStatis/attendanceDetail/attendanceDetail.js
const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/miniprogram/regional-assistant/'
import api from "../../../api";
// Store daily info at module level to be accessible by formatter
let dailyInfos = [];
Page({
/**
* 页面的初始数据
*/
data: {
IMG_URL,
routerParams: {},
summaryInfo: {},
detail: {},
formattedMonth: "",
minDate: new Date().getTime(),
maxDate: new Date().getTime(),
selectedDate: "", // YYYY-MM-DD
currentDayInfo: null, // { workTime, offWorkTime }
formatter(day) {
const date = new Date(day.date);
const year = date.getFullYear();
const month = (date.getMonth() + 1).toString().padStart(2, "0");
const d = date.getDate().toString().padStart(2, "0");
const dateStr = `${year}-${month}-${d}`;
// Find info for this date
const info = dailyInfos.find((item) => item.date === dateStr);
const hasRecord = info && (info.workTime || info.offWorkTime);
if (!hasRecord) {
day.className = "weekend-day";
}
return day;
},
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.setData({
routerParams: JSON.parse(options.info),
});
this.getSummary();
this.getDetail();
},
getSummary() {
const { mobilePhone, attendanceMonth } = this.data.routerParams;
const params = {
mobilePhone,
attendanceMonth,
};
api.getStaffAttendSummary(params).then((res) => {
console.log(res);
let { code, data, message } = res;
if (code == "0") {
data.nameAvatar = data.name.slice(-2) || ''
this.setData({
summaryInfo: data,
});
}
});
},
getDetail() {
const { mobilePhone, attendanceMonth } = this.data.routerParams;
const params = {
mobilePhone,
attendanceMonth,
};
api.getStaffDailyDetail(params).then((res) => {
console.log(res);
let { code, data, message } = res;
if (code == "0") {
// Update module-level variable
data.attendanceDailyInfoDTOs.forEach((item) => {
// 截取不要秒,格式 HH:MM
item.offWorkTime = item.offWorkTime
? item.offWorkTime.slice(0, 5)
: "";
item.workTime = item.workTime ? item.workTime.slice(0, 5) : "";
});
dailyInfos = data.attendanceDailyInfoDTOs || [];
// Calculate min and max date based on attendanceMonth
let minDate = new Date().getTime();
let maxDate = new Date().getTime();
let defaultDate = new Date().getTime();
if (data.attendanceMonth) {
const parts = data.attendanceMonth.split("-");
if (parts.length === 2) {
const year = parseInt(parts[0]);
const month = parseInt(parts[1]);
// minDate: 1st day of the month
minDate = new Date(year, month - 1, 1).getTime();
// maxDate: Last day of the month
maxDate = new Date(year, month, 0).getTime();
// Default to the 5th for demo purposes as per screenshot, or minDate
defaultDate = minDate;
// Ensure defaultDate is within range
if (defaultDate < minDate) defaultDate = minDate;
if (defaultDate > maxDate) defaultDate = maxDate;
}
}
this.setData({
detail: data,
formattedMonth: this.formatMonth(data.attendanceMonth),
minDate,
maxDate,
defaultDate,
});
// Initialize selection (simulate selecting the default date)
const dateObj = new Date(defaultDate);
this.handleDateSelect(dateObj);
}
});
},
formatMonth(monthStr) {
if (!monthStr) return "";
// 假设 monthStr 格式为 "YYYY-MM"
const parts = monthStr.split("-");
if (parts.length === 2) {
return `${parts[0]}年${parseInt(parts[1])}月`; // parseInt 去掉月份前导0
}
return monthStr;
},
onSelect(event) {
this.handleDateSelect(event.detail);
},
handleDateSelect(date) {
const year = date.getFullYear();
const month = (date.getMonth() + 1).toString().padStart(2, "0");
const day = date.getDate().toString().padStart(2, "0");
const dateStr = `${year}-${month}-${day}`;
// Find info for this date
const dayInfo = this.data.detail.attendanceDailyInfoDTOs.find(
(item) => item.date === dateStr,
);
this.setData({
selectedDate: dateStr,
currentDayInfo: dayInfo || null,
});
},
});
{
"usingComponents": {
"van-icon": "@vant/weapp/icon/index",
"van-calendar": "@vant/weapp/calendar/index"
},
"navigationBarTitleText": "考勤明细"
}
/* packageWorkspace/pages/attendanceStatis/attendanceDetail/attendanceDetail.wxss */
page {
background: #F2F3F7;
}
.card {
background: #FFFFFF;
border-radius: 32rpx;
margin-bottom: 16rpx;
}
.ellipsis {
overflow: hidden;
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
word-break: break-all;
}
/* User Card Styles */
.user-card {
display: flex;
align-items: center;
padding: 24rpx 32rpx;
border-radius: 0 0 32rpx 32rpx;
}
.avatar {
width: 72rpx;
height: 72rpx;
line-height: 72rpx;
text-align: center;
border-radius: 50%;
margin-right: 24rpx;
flex-shrink: 0;
background: #d5e4ff;
color: #2c66f7;
font-size: 28rpx;
font-weight: 600;
}
.name {
font-size: 28rpx;
font-weight: 600;
color: #222222;
margin-bottom: 8rpx;
}
.position {
font-size: 24rpx;
color: #666666;
}
/* Summary Card Styles */
.summary-card {
padding: 24rpx 32rpx;
}
.summary-title {
color: #222222;
font-size: 28rpx;
font-weight: 600;
margin-bottom: 16rpx;
}
.summary-grid {
display: flex;
justify-content: space-between;
}
.grid-item {
flex: 1;
display: flex;
flex-direction: column;
align-items: center;
text-align: center;
padding: 16rpx 28rpx;
}
.value {
color: #222222;
font-size: 40rpx;
font-weight: 600;
line-height: 1;
margin-bottom: 8rpx;
font-family: DINAlternate-Bold, "PingFang SC", sans-serif; /* Use number font if available */
}
.label {
font-size: 24rpx;
color: #666666;
}
/* Calendar Card Styles */
.calendar-card {
padding-bottom: 32rpx;
overflow: hidden; /* Ensure calendar corners are clipped */
}
/* Custom Calendar Header */
.calendar-header {
display: flex;
justify-content: center;
padding: 12rpx 0;
}
.date-pill {
width: 282rpx;
height: 64rpx;
line-height: 64rpx;
border-radius: 40rpx;
text-align: center;
background: #f2f3f5;
color: #222222;
font-size: 28rpx;
}
.calendar {
.van-calendar__header {
box-shadow: none;
}
.van-calendar__selected-day {
background-color: #2C66F7;
color: #FFFFFF;
width: 64rpx;
height: 64rpx;
border-radius: 50%;
}
.van-calendar__day {
padding: 16rpx 0;
}
}
/* Hide default month title inside van-calendar */
.calendar .van-calendar__month-title {
display: none !important;
height: 0 !important;
}
/* Weekend Style */
.weekend-day {
color: #C8C9CC !important;
}
.attendance-time {
margin: 24rpx 32rpx 0;
padding-top: 46rpx;
border-top: 1rpx solid #e6e7eb;
}
.section-title {
font-size: 24rpx;
color: #666666;
margin-bottom: 24rpx;
}
.timeline-item {
position: relative;
display: flex;
align-items: flex-start;
padding-bottom: 48rpx;
}
.timeline-item:last-child {
padding-bottom: 0;
}
.dot {
box-sizing: border-box;
width: 16rpx;
height: 16rpx;
border-radius: 50%;
border: 4rpx solid #35c376;
background-color: #fff;
z-index: 1;
margin-top: 12rpx;
flex-shrink: 0;
}
.dot-green {
border-color: #00B578;
}
.dot-red {
border-color: #FA5151;
}
.line {
position: absolute;
top: 16rpx;
left: 8rpx;
width: 2rpx;
height: 100%;
background-color: #e6eaf0;
z-index: 0;
}
.content {
margin-left: 24rpx;
display: flex;
align-items: baseline;
}
.status-text {
color: #181a1f;
font-size: 28rpx;
margin-right: 24rpx;
}
.text-red {
color: #FA5151;
}
.label-text {
color: #808291;
font-size: 28rpx;
}
<!--packageWorkspace/pages/attendanceStatis/attendanceDetail/attendanceDetail.wxml-->
<view class="container">
<!-- User Info Card -->
<view class="card user-card">
<!-- <image class="avatar" src="{{IMG_URL}}default-avatar.png" /> -->
<view class="avatar">{{ summaryInfo.nameAvatar }}</view>
<view class="user-info">
<view class="name ellipsis">{{summaryInfo.name}}</view>
<view class="position ellipsis">{{summaryInfo.positionName}}</view>
</view>
</view>
<!-- Summary Card -->
<view class="card summary-card">
<view class="summary-title">{{formattedMonth}}汇总</view>
<view class="summary-grid">
<view class="grid-item">
<view class="value">{{summaryInfo.totalWorkHours}}</view>
<view class="label">出勤工时 (H)</view>
</view>
<view class="grid-item">
<view class="value {{summaryInfo.lateEarlyHours ? 'text-red' : ''}}">{{summaryInfo.lateEarlyHours}}</view>
<view class="label">迟到早退 (H)</view>
</view>
<view class="grid-item">
<view class="value {{summaryInfo.missingPunchCount ? 'text-red' : ''}}">{{summaryInfo.missingPunchCount}}</view>
<view class="label">缺卡 (次数)</view>
</view>
</view>
</view>
<!-- Calendar Card -->
<view class="card calendar-card">
<view class="calendar-header">
<view class="date-pill">{{detail.attendanceMonth}}</view>
</view>
<van-calendar
poppable="{{ false }}"
show-confirm="{{ false }}"
show-title="{{ false }}"
show-subtitle="{{ false }}"
show-mark="{{ false }}"
min-date="{{ minDate }}"
max-date="{{ maxDate }}"
default-date="{{ defaultDate }}"
class="calendar"
row-height="32"
formatter="{{ formatter }}"
bind:select="onSelect"
/>
<!-- Attendance Time Timeline -->
<view class="attendance-time">
<view class="section-title">考勤时间</view>
<!-- Start Work -->
<view class="timeline-item">
<view class="dot {{currentDayInfo.workTime ? 'dot-green' : 'dot-red'}}"></view>
<view class="line"></view>
<view class="content">
<text class="status-text {{currentDayInfo.workTime ? '' : 'text-red'}}">{{currentDayInfo.workTime ? currentDayInfo.workTime : '缺卡'}}</text>
<text class="label-text" wx:if="{{currentDayInfo.workTime}}"> 上班</text>
</view>
</view>
<!-- Off Work -->
<view class="timeline-item">
<view class="dot {{currentDayInfo.offWorkTime ? 'dot-green' : 'dot-red'}}"></view>
<view class="content">
<text class="status-text {{currentDayInfo.offWorkTime ? '' : 'text-red'}}">{{currentDayInfo.offWorkTime ? currentDayInfo.offWorkTime : '缺卡'}}</text>
<text class="label-text" wx:if="{{currentDayInfo.offWorkTime}}"> 下班</text>
</view>
</view>
</view>
</view>
</view>
// packageWorkspace/pages/attendanceStatis/attendanceList/attendanceList.js
import api from '../../../api'
Page({
/**
* 页面的初始数据
*/
data: {
searchObj: {
name: "",
attendanceMonth: "",
},
filterConfig: [
{
type: "month",
label: "考勤月份",
key: "attendanceMonth",
},
],
list: [],
triggered: false,
nothing: false,
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.search();
},
/**
* 筛选回调
*/
onFilterChange(e) {
this.setData({
searchObj: e.detail,
});
this.search();
},
/**
* 搜索
*/
search() {
this.setData({
list: [],
pageNum: 1,
flag: false,
nothing: false,
});
this.getList();
},
/**
* 获取列表数据 (Mock)
*/
getList() {
// this.setData({
// list: [filteredList], // 二维数组结构,保持与referralCountList一致的渲染逻辑 if needed, but simple list is better.
// // Checking referralCountList.wxml: <block wx:for="{{ list }}" ...><block wx:for="{{ item }}" ...>
// // It seems referralCountList uses a 2D array for pagination pages. I will mimic that structure for consistency.
// triggered: false,
// nothing: true, // Mocking end of list
// });
let { pageNum, nothing, searchObj } = this.data;
let userInfo = wx.$util.getUserInfo();
if (nothing) return;
wx.$util.showLoading();
api
.getStaffAttendanceList({
...searchObj,
pageNum,
pageSize: 10,
})
.then((res) => {
wx.$util.hideLoading();
// let total = 0;
let list = [];
let { code, data, message } = res;
console.log(data)
if (code == 0) {
list = data;
// total = data.total;
} else {
wx.$util.showToast(message);
}
// if (total != 0) {
// this.setData({
// [`list[${pageNum - 1}]`]: list,
// });
// }
this.setData({
// total,
list,
flag: true,
triggered: false,
pageNum: pageNum + 1,
nothing: !!list.length,
});
});
},
/**
* 下拉刷新
*/
onPullDownRefresh() {
this.search();
},
/**
* 上拉加载
*/
onReachBottom() {
// Mock no more data
},
/**
* 跳转详情 (如果有)
*/
handleDetail(e) {
let { target } = e.currentTarget.dataset;
wx.navigateTo({
url:
"/packageWorkspace/pages/attendanceStatis/attendanceDetail/attendanceDetail?info=" +
JSON.stringify(target),
});
},
});
{
"usingComponents": {
"FilterBar": "/components/FilterBar/FilterBar",
"van-icon": "@vant/weapp/icon/index"
},
"navigationBarTitleText": "考勤列表"
}
/* packageWorkspace/pages/attendanceStatis/attendanceList/attendanceList.wxss */
page {
background: #F2F3F7;
}
.list-page {
.top-box {
background: #FFFFFF;
}
.list {
.empty-box {
width: 100%;
height: 24rpx;
}
.item {
margin: 0 24rpx 24rpx;
border-radius: 32rpx;
background: #FFFFFF;
padding: 32rpx;
.item-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 24rpx;
.name {
font-size: 32rpx;
font-weight: 600;
color: #222222;
}
.ellipsis {
overflow: hidden;
display: -webkit-box !important;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
word-break: break-all;
}
.date-row {
display: flex;
align-items: center;
flex-shrink: 0;
margin-left: 20rpx;
.date {
font-size: 28rpx;
color: #333333;
margin-right: 8rpx;
}
}
}
.item-body {
display: flex;
align-items: center;
.stat-item {
display: flex;
align-items: center;
width: 50%;
.label {
font-size: 26rpx;
color: #999999;
margin-right: 32rpx;
}
.value {
font-size: 28rpx;
color: #222222;
font-weight: 500;
}
}
}
}
.list-nothing {
text-align: center;
font-size: 24rpx;
color: #999;
padding: 20rpx 0;
}
}
}
<!--packageWorkspace/pages/attendanceStatis/attendanceList/attendanceList.wxml-->
<view class="list-page">
<view class="top-box">
<FilterBar
searchPlaceholder="员工姓名"
searchKey="name"
filters="{{filterConfig}}"
searchObj="{{searchObj}}"
bind:filterChange="onFilterChange"
></FilterBar>
</view>
<scroll-view
scroll-y
enable-back-to-top
refresher-enabled="{{ true }}"
bindrefresherrefresh="search"
bindscrolltolower="onReachBottom"
class="list"
style="height:calc(100vh - var(--fontSize184));"
refresher-threshold="104"
refresher-triggered="{{ triggered }}"
>
<block wx:if="{{ list.length > 0 }}">
<view class="empty-box"></view>
<!-- <block wx:for="{{ list }}" wx:key="index"> -->
<block wx:for="{{ list }}" wx:for-index="ind" wx:key="ind">
<view class="item" bindtap="handleDetail" data-target="{{item}}">
<view class="item-header">
<view class="name ellipsis">{{item.name}}</view>
<view class="date-row">
<text class="date">{{item.attendanceMonth}}</text>
<van-icon name="arrow" color="#ccc" size="16px" />
</view>
</view>
<view class="item-body">
<view class="stat-item">
<text class="label">应出勤天数</text>
<text class="value">{{item.expectedAttendanceDays}}</text>
</view>
<view class="stat-item">
<text class="label">实际出勤天数</text>
<text class="value">{{item.attendanceDays}}</text>
</view>
</view>
</view>
</block>
<!-- </block> -->
<block wx:if="{{ nothing }}">
<view class="list-nothing">到底了~</view>
</block>
</block>
<block wx:else>
<empty-data />
</block>
</scroll-view>
</view>
import api from '~/utils/request/request.js'
module.exports = {
// 获取订单审核列表
getOrderApplyList(data) {
return api.post('dj.api.smartcarlife.goodsOrderApplyRecord.page', data)
},
// 获取订单待审核详情
getOrderApplyDetail(data) {
return api.post('dj.api.smartcarlife.goodsOrderApplyRecord.detail.select', data)
},
// 订单申请审核
auditOrderApply(data) {
return api.post('dj.api.smartcarlife.goodsOrderApplyRecord.audit.update', data)
}
}
\ No newline at end of file
// packageWorkspace/pages/orderApprovalManage/components/approvalPopup/approvalPopup.js
Component({
/**
* 组件的属性列表
*/
properties: {
infoData: {
type: Object
},
show: {
type: Boolean,
observer: function(val) {
this.setData({remark: '', contentLength: 0})
}
}
},
/**
* 组件的初始数据
*/
data: {
contentLength: 0,
remark: ''
},
/**
* 组件的方法列表
*/
methods: {
textAreaInput(e) {
let val = e.detail.value || ""
if (val.length > 200) {
val = val.substring(0, 200)
}
this.setData({
remark: val,
contentLength: val.length
})
},
onConfirm() {
let { infoData, remark } = this.data
if (infoData.type == 2 && !remark) return wx.$util.showToast('请输入驳回备注')
this.triggerEvent('confirm', remark)
},
onCancel() {
this.triggerEvent('cancel')
}
}
})
\ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
/* packageWorkspace/pages/orderApprovalManage/components/approvalPopup/approvalPopup.wxss */
.container {
.label {
margin: 32rpx 0 16rpx;
font-size: 28rpx;
color: #222222;
.requiredLabel {
color: #F24724;
}
}
.textarea-wrap{
position: relative;
.textarea-input {
width: 100%;
height: 550rpx;
border-radius: 28rpx;
background: #f4f5f7;
padding: 24rpx;
box-sizing: border-box;
font-size: 28rpx;
}
.counter {
position: absolute;
right: 16rpx;
bottom: 8rpx;
font-size: 24rpx;
color: #BBBBBB;
}
}
.tips {
color: #999999;
font-size: 26rpx;
margin: 16rpx 0;
}
}
\ No newline at end of file
<!--packageWorkspace/pages/orderApprovalManage/components/approvalPopup/approvalPopup.wxml-->
<popup show="{{show}}" title="{{infoData.title}}" height="68%" bind:confirm="onConfirm" bind:cancel="onCancel" customPopupSlotStyle="overflow:auto;">
<scroll-view class="container">
<view class="label">{{infoData.label}}<text class="requiredLabel" wx:if="{{infoData.type == 2}}">*</text></view>
<view class="textarea-wrap">
<textarea class="textarea-input" placeholder-style="color:#BEC1C7" placeholder="请输入" maxlength="200" value="{{remark}}" bindinput="textAreaInput" />
<view class="counter">{{contentLength}}/200</view>
</view>
<view wx:if="{{infoData.type == 1}}" class="tips">审核通过后将自动流转至线上运营审核</view>
</scroll-view>
</popup>
\ No newline at end of file
// packageWorkspace/pages/orderApprovalManage/components/goodsOrderItem/goodsOrderItem.js
Component({
/**
* 组件的属性列表
*/
properties: {
title: {
type: String,
value: '商品信息'
},
goodsData: {
type: Object,
value: {
subOrderList: [],
packageGoodsList: []
}
}
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
}
})
\ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
/* packageWorkspace/pages/orderApprovalManage/components/goodsOrderItem/goodsOrderItem.wxss */
.flex {
display: flex;
align-items: center;
}
.column {
flex-flow: column;
}
.flex-start {
align-items: flex-start;
}
.just-space {
justify-content: space-between;
}
.section {
border-radius: 32rpx;
background: #ffffff;
margin: 24rpx 0;
padding: 24rpx 32rpx;
.section-title {
font-size: 30rpx;
font-weight: 500;
color: #222222;
margin-bottom: 24rpx;
}
.order-item {
border-radius: 20rpx;
background: #f7f8fa;
padding: 24rpx;
margin-bottom: 24rpx;
color: #222222;
font-size: 26rpx;
&:last-child {
margin-bottom: 0;
}
.just-space {
justify-content: space-between;
}
.package-item {
margin-bottom: 24rpx;
}
.name {
width: 410rpx;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
word-break: break-all;
}
.dot {
display: inline-block;
width: 12rpx;
height: 12rpx;
border-radius: 50%;
background: #347BFF;
margin: 12rpx 12rpx 0 0;
}
.gray {
font-size: 24rpx;
color: #999999;
margin-top: 8rpx;
.tag {
display: inline-block;
width: 56rpx;
height: 28rpx;
line-height: 28rpx;
border-radius: 6rpx;
border: 2rpx solid #f4a08f;
text-align: center;
color: #F24724;
}
}
.item-right {
text-align: right;
}
.pl-24 {
padding-left: 24rpx;
}
.split {
margin: 0 12rpx;
}
.ml-24 {
margin-left: 24rpx;
}
.count {
font-size: 24rpx;
color: #999999;
margin-top: 8rpx;
padding-left: 24rpx;
}
.item {
font-size: 26rpx;
color: #222222;
}
.package-list {
.list-item {
padding: 24rpx;
margin: 0 -24rpx;
border-top: 1px solid #dfe4f2;
&:last-child {
padding-bottom: 0;
}
}
}
}
}
\ No newline at end of file
<!--packageWorkspace/pages/orderApprovalManage/components/goodsOrderItem/goodsOrderItem.wxml-->
<view class="section">
<view class="section-title">{{ title }}</view>
<!-- 普通商品 -->
<view class="order-item" wx:for="{{ goodsData.subOrderList }}" wx:key="index">
<view class="flex just-space flex-start">
<view class="item-left">
<view class="flex flex-start">
<text class="dot"></text>
<text class="name">{{ item.upgradeGoodsName }}</text>
</view>
<view class="gray pl-24">
<text>原价¥{{ item.totalPrice }}</text>
<text wx:if="{{ item.discountType && item.discountType != 3 && item.discountType != 5 }}" class="split">|</text>
<block wx:if="{{ item.discountType == 1 || item.discountType == 2 }}">
<text wx:if="{{ item.discountType == 1 }}">{{ item.discountValue }}折</text>
<text wx:else>折扣¥{{ item.discountValue }}</text>
</block>
<block wx:if="{{ item.discountType == 4 }}">
<text class="tag">赠品</text>
</block>
</view>
</view>
<view class="item-right">
<view class="price">¥{{ item.finalPrice }}</view>
<view class="gray">
共<text class="split">{{ item.number }}</text>件
</view>
</view>
</view>
</view>
<!-- 套餐商品 -->
<view class="order-item" wx:for="{{ goodsData.packageGoodsList }}" wx:key="index">
<view class="item flex just-space package-item">
<view class="item-left flex flex-start">
<text class="dot"></text>
<text class="name">{{ item.packageName }}</text>
</view>
<view class="item-right">
<text class="price">¥{{ item.packagePrice }}</text>
</view>
</view>
<view class="package-list">
<view
wx:for="{{ item.packageGoodsOrderList }}"
wx:for-item="subItem"
wx:for-index="subIndex"
wx:key="subIndex"
class="list-item flex just-space flex-start"
>
<view class="item-left">
<view class="flex flex-start pl-24">
<text class="name">{{ subItem.upgradeGoodsName }}</text>
</view>
<view class="gray pl-24">
<text>原价¥{{ subItem.totalPrice }}</text>
<text wx:if="{{ subItem.discountType && subItem.discountType != 3 && subItem.discountType != 5 }}" class="split">|</text>
<block wx:if="{{ subItem.discountType == 1 || subItem.discountType == 2 }}">
<text wx:if="{{ subItem.discountType == 1 }}">{{ subItem.discountValue }}折</text>
<text wx:else>折扣¥{{ subItem.discountValue }}</text>
</block>
<block wx:if="{{ subItem.discountType == 4 }}">
<text class="tag">赠品</text>
</block>
</view>
</view>
<view class="item-right">
<view class="price">¥{{ subItem.finalPrice }}</view>
<view class="gray">
共<text class="split">{{ subItem.number }}</text>件
</view>
</view>
</view>
</view>
</view>
</view>
\ No newline at end of file
// packageWorkspace/pages/orderApprovalManage/orderApprovalDetail/orderApprovalDetail.js
import api from "~/packageWorkspace/pages/orderApprovalManage/api"
import NP from 'number-precision'
import dayjs from "dayjs"
Page({
/**
* 页面的初始数据
*/
data: {
// 订单信息
orderInfo: {},
statusMap: {
'1': {name: '待审核', tips: '请尽快处理', icon: 'more-o', color: '#FF9D0A'},
'2': {name: '已审核', tips: '订单已流转至线上运营审核', icon: 'passed', color: '#35C376'},
'3': {name: '已审核', tips: '订单已被线上运营审核通过', icon: 'passed', color: '#35C376'},
'4': {name: '已驳回', tips: '订单已驳回', icon: 'warning-o', color: '#666666'}
},
djOrderTypeMap: {
'': '订单类型',
'2': '打折策略',
'5': '组合付款',
'3': '买赠策略',
'4': '冲量活动',
'1': '正常订单'
},
orderForm:[{
label: '订单编号',
key: 'orderCode'
}, {
label: '订单类型',
key: 'djOrderType',
format: true
}, {
label: '总价',
key: 'finalPrice',
unit: '¥'
}, {
label: '提单人',
key: ['sellerName', 'merchantName'],
arr: true
}, {
label: '提单时间',
key: 'applyDate'
}],
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
// 可以从 options 中获取订单ID,然后加载详情
const { orderCode } = options
if (orderCode) {
this.loadOrderDetail(orderCode)
}
},
processOrderData(rawOrder) {
if (!rawOrder) return rawOrder
const processed = { ...rawOrder }
// 处理普通商品订单(goodsOrderDTO)
if (processed.goodsOrderDTO) {
processed.goodsOrderDTO = this.addPackagePrice(processed.goodsOrderDTO)
}
// 处理原错误订单(oldGoodsOrderDTO)
if (processed.oldGoodsOrderDTO) {
processed.oldGoodsOrderDTO = this.addPackagePrice(processed.oldGoodsOrderDTO)
}
return processed
},
addPackagePrice(orderDTO) {
const dto = { ...orderDTO }
if (Array.isArray(dto.packageGoodsList)) {
dto.packageGoodsList = dto.packageGoodsList.map(pkg => {
let total = 0
if (Array.isArray(pkg.packageGoodsOrderList)) {
total = pkg.packageGoodsOrderList.reduce((sum, item) => {
// const itemTotal = NP.times(item.finalPrice || 0, item.number || 1)
return NP.plus(sum, item.finalPrice)
}, 0)
}
return {
...pkg,
packagePrice: total
}
})
}
return dto
},
/**
* 加载订单详情
*/
loadOrderDetail(orderCode) {
let { orderForm } = this.data
wx.$util.showLoading()
api.getOrderApplyDetail({orderCode}).then(res => {
wx.$util.hideLoading()
let { code, data, message } = res
if (code == 0) {
// 处理商品信息
const processedData = this.processOrderData(res.data || {})
this.setData({
orderInfo: processedData,
'orderInfo.applyDate': res.data.applyDate ? dayjs(res.data.applyDate).format('YYYY-MM-DD HH:mm:ss') : '-'
})
if (res.data?.oldGoodsOrderDTO) {
this.setData({
'orderInfo.oldOrderCode': res?.data.oldGoodsOrderDTO?.orderCode
}, () => {
const typeAIndex = orderForm.findIndex(f => f.key === 'djOrderType')
orderForm.splice(typeAIndex, 0, {
label: '原错误订单编号',
key: 'oldOrderCode'
})
this.setData({
orderForm
})
})
}
} else {
wx.$util.showToast(message)
}
})
},
/**
* 通过审核
*/
pass() {
this.setData({
showPopup: true,
popupInfo: {
type: '1',
title: '审核通过',
label: '通过备注'
}
})
},
/**
* 驳回
*/
reject() {
this.setData({
showPopup: true,
popupInfo: {
type: '2',
title: '审核驳回',
label: '驳回备注'
}
})
},
/**
* 提交审核结果
*/
handlePopupConfirm(e) {
if (this.data.submitFlag) return
this.setData({
submitFlag: true
})
wx.$util.showLoading()
const { orderInfo, popupInfo } = this.data
api.auditOrderApply({auditResult: popupInfo?.type, orderCode: orderInfo.orderCode, remark: e.detail}).then(res => {
wx.$util.hideLoading()
this.setData({
submitFlag: false
})
let { code, data, message } = res
if (code == 0) {
this.loadOrderDetail(orderInfo.orderCode)
const pages = getCurrentPages()
if (pages?.[pages.length - 2]) { // 从列表进入,审核后返回列表页
wx.navigateBack()
} else { // 企微消息直接进入页面 审核后关闭页面跳转到列表页
wx.reLaunch({url: '/packageWorkspace/pages/orderApprovalManage/orderApprovalList/orderApprovalList'})
}
} else {
wx.$util.showToast(message)
}
}).catch(() => {
wx.$util.hideLoading()
this.setData({
submitFlag: false
})
})
},
hidePopup() {
this.setData({showPopup: false})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file
{
"usingComponents": {
"van-icon": "@vant/weapp/icon/index",
"approval-popup": "../components/approvalPopup/approvalPopup",
"goods-order-item": "../components/goodsOrderItem/goodsOrderItem"
},
"navigationBarTitleText": "审核详情"
}
\ No newline at end of file
page {
background: #F2F3F7;
}
.isFullSucreen-btn {
padding-bottom: 34px !important;
}
.flex {
display: flex;
align-items: center;
}
.column {
flex-flow: column;
}
.flex-start {
align-items: flex-start;
}
.page-container {
padding: 24rpx;
.content-scroll {
.status-section {
.status-text {
font-size: 36rpx;
font-weight: 500;
color: #222222;
margin-left: 20rpx;
}
.status-tip {
font-size: 26rpx;
color: #999999;
margin-left: 52rpx;
}
}
.section {
border-radius: 32rpx;
background: #ffffff;
margin: 24rpx 0;
padding: 24rpx 32rpx;
.section-title {
font-size: 30rpx;
font-weight: 500;
color: #222222;
margin-bottom: 24rpx;
}
.info-item {
display: flex;
align-items: center;
font-size: 26rpx;
color: #222222;
margin-bottom: 12rpx;
&:last-child {
margin-bottom: 0;
}
.info-label {
width: 184rpx;
margin-right: 32rpx;
color: #999999;
flex-shrink: 0;
}
.info-item {
.text-hide {
max-width: 280rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
&.name {
max-width: 120rpx;
}
}
.split {
margin: 0 8rpx;
}
}
}
}
}
.empty-box {
width: 100%;
height: 180rpx;
}
.footerBtn {
position: fixed;
left: 0;
width: 100%;
bottom: 0;
min-height: var(--fontSize100);
background: #FFFFFF;
box-sizing: border-box;
display: flex;
align-items: center;
justify-content: space-between;
font-size: var(--fontSize32);
font-weight: 500;
z-index: 99;
padding: 20rpx 32rpx;
.btn {
width: 320rpx;
height: 80rpx;
border-radius: 20rpx;
text-align: center;
line-height: 80rpx;
font-size: 32rpx;
}
.cancel {
height: 76rpx;
line-height: 76rpx;
border: 2rpx solid #2C66F7;
background: #f0f4ff;
color: #2C66F7;
}
.confirm {
color: #ffffff;
font-weight: 500;
height: 80rpx;
line-height: 80rpx;
background: #347BFF;
}
}
}
\ No newline at end of file
<!--packageWorkspace/pages/orderApprovalManage/orderApprovalDetail/orderApprovalDetail.wxml-->
<view class="page-container">
<!-- 页面内容 -->
<view class="content-scroll">
<!-- 审核状态标签 -->
<view class="status-section">
<view class="status-badge">
<van-icon name="{{statusMap[orderInfo.status].icon}}" color="{{statusMap[orderInfo.status].color}}"></van-icon>
<text class="status-text">{{statusMap[orderInfo.status].name}}</text>
</view>
<text class="status-tip">{{statusMap[orderInfo.status].tips}}</text>
</view>
<!-- 订单信息 -->
<view class="section">
<view class="section-title">订单信息</view>
<view class="info-item" wx:for="{{orderForm}}" wx:key="index">
<text class="info-label">{{item.label}}</text>
<block wx:if="{{item.format}}">
<view class="info-item">{{djOrderTypeMap[orderInfo[item.key]]}}</view>
</block>
<block wx:elif="{{item.arr}}">
<view class="info-item"><text class="name text-hide">{{orderInfo[item.key[0]]}}</text><text class="split">|</text><text class="text-hide">{{orderInfo[item.key[1]]}}</text></view>
</block>
<block wx:else>
<text class="info-value"><text style="margin-right: 8rpx;" wx:if="{{item.unit}}">{{item.unit}}</text>{{ orderInfo[item.key] }}</text>
</block>
</view>
</view>
<!-- 原错误订单商品信息 -->
<goods-order-item
wx:if="{{orderInfo.oldOrderCode}}"
title="原错误订单商品信息"
goodsData="{{orderInfo.oldGoodsOrderDTO}}"
/>
<!-- 新订单 / 普通订单 -->
<goods-order-item
title="{{orderInfo.oldOrderCode ? '新订单商品信息' : '商品信息'}}"
goodsData="{{orderInfo.goodsOrderDTO}}"
/>
<view class="empty-box"></view>
</view>
<view wx:if="{{orderInfo.status == 1}}" class="footerBtn {{ isFullSucreen?'isFullSucreen-btn':'' }}">
<view class="btn cancel" bindtap="reject">驳回</view>
<view class="btn confirm" bindtap="pass">通过</view>
</view>
</view>
<approval-popup wx:if="{{showPopup}}" show="{{ showPopup }}" infoData="{{popupInfo}}" bindconfirm="handlePopupConfirm" bindcancel="hidePopup"></approval-popup>
\ No newline at end of file
// packageWorkspace/pages/orderApprovalManage/orderApprovalList/orderApprovalList.js
import dayjs from 'dayjs'
const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/miniprogram/regional-assistant/'
import api from '~/packageWorkspace/pages/orderApprovalManage/api'
Page({
/**
* 页面的初始数据
*/
data: {
IMG_URL,
filterObj: {
djOrderType: '',
auditStatus: '1',
date: ''
},
maxDate: new Date().format('yyyy-MM-dd'),
djOrderTypeMap: {
'': '订单类型',
'2': '打折策略',
'5': '组合付款',
'3': '买赠策略',
'4': '冲量活动',
'1': '正常订单'
},
auditStatusMap: {
'': '订单状态',
'1': '待审核',
'2': '已审核',
'3': '已驳回'
},
listAuditStatusMap: {
'1': {name: '待审核', color: '#FF9D0A', background: '#ff9d0a1a'},
'2': {name: '已审核', color: '#35C376', background: '#35C3761a'}, // 线上运营待审核,区域运营已审核过显示为已审核
'3': {name: '已审核', color: '#35C376', background: '#35C3761a'},
'4': {name: '已驳回', color: '#777777', background: '#7777771a'}
},
djOrderTypeList: [{
name: '全部',
value: ''
}, {
name: '打折策略',
value: '2'
}, {
name: '组合付款',
value: '5'
}, {
name: '买赠策略',
value: '3'
}, {
name: '冲量活动',
value: '4'
}, {
name: '正常订单',
value: '1'
}],
auditStatusList: [{
name: '全部',
value: ''
}, {
name: '待审核',
value: '1'
}, {
name: '已审核',
value: '2'
}, {
name: '已驳回',
value: '3'
}],
list: [],
errorOrderItems: [{
label: '订单类型',
key: 'djOrderType',
format: true
}, {
label: '原错误订单编号',
key: 'associationOrderCode'
}, {
label: '提单人',
key: 'sellerName'
}, {
label: '提单时间',
key: 'applyDate'
}],
orderItems: [{
label: '订单类型',
key: 'djOrderType',
format: true
}, {
label: '提单人',
key: 'sellerName'
}, {
label: '提单时间',
key: 'applyDate'
}]
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
this.search()
},
input(e) {
let { value } = e.detail
this.setData({sellerName: value})
},
clear() {
this.setData({sellerName: ''})
this.search()
},
search() {
this.setData({
list: [],
pageNum: 1,
flag: false,
nothing: false,
})
this.getList()
},
getList() {
let { pageNum, nothing, filterObj, sellerName, endStr, startStr } = this.data
let userInfo = wx.$util.getUserInfo()
if (nothing) return
wx.$util.showLoading()
let params = {
sellerName,
djOrderType: filterObj.djOrderType,
auditStatus: filterObj.auditStatus,
pageNum,
pageSize: 10,
applyStartDateStr: startStr,
applyEndDateStr: endStr,
sceneType: userInfo?.sceneType
}
api.getOrderApplyList(params).then(res => {
wx.$util.hideLoading()
let total = 0
let list = []
let {
code,
data,
message
} = res
data?.list?.forEach(val => {
val.applyDate = dayjs(val.applyDate).format('YYYY-MM-DD HH:mm:ss')
})
if (code == 0) {
list = data.list
total = data.total
} else {
wx.$util.showToast(message)
}
if (total != 0) {
this.setData({
[`list[${pageNum - 1}]`]: list
})
}
this.setData({
total,
flag: true,
triggered: false,
pageNum: pageNum + 1,
nothing: pageNum == data?.pages
})
})
},
scrollonReachBottom() {
this.getList()
},
handleDetail(e) {
let { target } = e.currentTarget.dataset
wx.navigateTo({
url: `/packageWorkspace/pages/orderApprovalManage/orderApprovalDetail/orderApprovalDetail?orderCode=${target.orderCode}`,
})
},
rangeSelect(e) {
let {
date: { start, end }
} = e.detail
this.setData({
['filterObj.date']: `${start} 至 ${end}`,
startStr: start,
endStr: end
}, () => {
this.search()
})
},
// 重置筛选条件
handleFilterReset() {
this.setData({
filterObj: {
djOrderType: '',
auditStatus: '',
date: ''
},
startStr: '',
endStr: ''
}, () => {
this.search()
})
},
// 选择订单类型
handleOrderTypeFilter() {
let {
filterObj,
djOrderTypeList
} = this.data
this.setData({
showSelectPopup: true,
selectOptions: djOrderTypeList,
selectTitle: '订单类型',
selectMultiple: false,
selectValue: [filterObj.djOrderType],
selectType: 'djOrderType'
})
},
// 选择处理状态
handleOrderStatusFilter() {
let {
filterObj,
auditStatusList
} = this.data
this.setData({
showSelectPopup: true,
selectOptions: auditStatusList,
selectTitle: '订单状态',
selectMultiple: false,
selectValue: [filterObj.auditStatus],
selectType: 'auditStatus'
})
},
handlePopupConfirm(e) {
let { values } = e.detail
let { selectType } = this.data
this.setData({
[`filterObj.${selectType}`]: values[0]
}, () => {
this.search()
})
this.hideSelectPopup()
},
hideSelectPopup() {
this.setData({
showSelectPopup: false
})
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file
{
"usingComponents": {
"select-popup": "/packageWorkspace/components/selectPopup/selectPopup"
},
"navigationBarTitleText": "订单审核"
}
\ No newline at end of file
/* packageWorkspace/pages/orderApprovalManage/orderApprovalList/orderApprovalList.wxss */
page {
background: #F2F3F7;
}
.list-page {
.flex {
display: flex;
align-items: center;
}
.top-box {
background: #FFFFFF;
padding: 16rpx 24rpx 24rpx;
.search-input {
background: #F7F8FA;
border-radius: var(--fontSize72);
width: 100%;
height: var(--fontSize72);
display: flex;
align-items: center;
margin-bottom: 16rpx;
.search-icon {
width: var(--fontSize28);
height: var(--fontSize28);
margin: 0 var(--fontSize10) 0 var(--fontSize26);
}
.search-clear {
width: var(--fontSize36);
height: var(--fontSize36);
margin: 0 var(--fontSize26) 0 var(--fontSize10);
}
.input {
font-size: var(--fontSize28);
height: var(--fontSize38);
line-height: var(--fontSize38);
width: calc(100% - var(--fontSize136));
}
.input-placeholder {
color: #BBBBBB;
}
}
.filter-box {
justify-content: space-between;
.filter-item {
height: 56rpx;
border-radius: 56rpx;
background: #F7F8FA;
padding: 0 16rpx 0 24rpx;
font-size: 26rpx;
color: #666666;
margin-right: 16rpx;
&.active {
color: #2C66F7;
}
.hide-text {
max-width: 170rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
text {
line-height: 40rpx;
}
image {
width: 32rpx;
height: 32rpx;
flex-shrink: 0;
}
}
.reset-btn {
color: #222222;
font-size: 26rpx;
}
}
}
.list {
.empty-box {
width: 100%;
height: 24rpx;
}
.item {
margin: 0 24rpx 24rpx;
border-radius: 32rpx;
background: #FFFFFF;
padding: 24rpx 32rpx;
.item-top {
display: flex;
justify-content: space-between;
align-items: center;
margin: 0 -24rpx;
padding: 0 24rpx 24rpx;
font-size: 26rpx;
font-weight: 500;
color: #666666;
border-bottom: 2rpx dashed #F0F1F5;
.code-text {
color: #222222;
margin-left: 16rpx;
}
.status {
height: 48rpx;
line-height: 48rpx;
border-radius: 8rpx;
padding: 0 12rpx;
}
}
.order-list {
padding: 24rpx 0;
.order {
margin-bottom: 12rpx;
font-size: 26rpx;
color: #222222;
&:last-child {
margin-bottom: 0;
}
.order-label {
width: 184rpx;
margin-right: 32rpx;
color: #999999;
}
}
}
.btn-box {
justify-content: space-between;
font-weight: 500;
.label {
font-size: 26rpx;
color: #666666;
margin-right: 16rpx;
}
.unit {
margin-right: 8rpx;
}
.btn {
font-weight: 400;
width: 168rpx;
height: 64rpx;
line-height: 64rpx;
text-align: center;
border-radius: 16rpx;
font-size: 26rpx;
color: #2C66F7;
background: #2c66f71a;
&.primary {
color: #FFFFFF;
background: #2c66f7;
}
}
}
}
}
.list-nothing {
padding: 0 0 50rpx;
}
}
\ No newline at end of file
<!--packageWorkspace/pages/orderApprovalManage/orderApprovalList/orderApprovalList.wxml-->
<view class="list-page">
<view class="top-box">
<view class="search-box">
<view class="search-input">
<image src="/images/search.png" class="search-icon" />
<input type="text" placeholder="员工姓名" class="input" value="{{ sellerName }}" placeholder-class="input-placeholder" bindinput="input" bindconfirm="search" />
<block wx:if="{{ sellerName }}">
<image src="/images/clear.png" class="search-clear" bindtap="clear" />
</block>
</view>
</view>
<view class="filter-box flex">
<view class="flex">
<view class="filter-item flex {{filterObj.djOrderType ? 'active': ''}}" bindtap="handleOrderTypeFilter">
<text>{{djOrderTypeMap[filterObj.djOrderType]}}</text><image src="{{IMG_URL}}{{filterObj.djOrderType ? 'expand_icon_blue' : 'expand_icon'}}.png" mode=""/>
</view>
<view class="filter-item flex {{filterObj.auditStatus ? 'active': ''}}" bindtap="handleOrderStatusFilter">
<text>{{auditStatusMap[filterObj.auditStatus]}}</text><image src="{{IMG_URL}}{{filterObj.auditStatus ? 'expand_icon_blue' : 'expand_icon'}}.png" mode=""/>
</view>
<calendar id="calender" class="calendar" allowSameDay shortcut bindselect="rangeSelect" calenderColor="#347BFF" vertical dateType='range' minDate="2024-01-01" maxDate="{{ maxDate }}" isComponents>
<view class="filter-item flex {{filterObj.date ? 'active': ''}}">
<text class="hide-text">{{filterObj.date || '提单日期'}}</text>
<image src="{{IMG_URL}}{{filterObj.date ? 'expand_icon_blue' : 'expand_icon'}}.png" mode=""/>
</view>
</calendar>
</view>
<view class="reset-btn" bindtap="handleFilterReset">重置</view>
</view>
</view>
<scroll-view scroll-y enable-back-to-top
refresher-enabled="{{ true }}"
bindrefresherrefresh="search"
bindscrolltolower="scrollonReachBottom"
class="list"
style="height:calc(100vh - var(--fontSize184));"
refresher-threshold="104"
refresher-triggered="{{ triggered }}">
<block wx:if="{{ list.length > 0 }}">
<view class="empty-box"></view>
<block wx:for="{{ list }}" wx:key="index">
<block wx:for="{{ item }}" wx:for-item="li" wx:for-index="ind" wx:key="ind">
<view
data-ind="{{ ind }}"
data-index="{{ index }}"
>
<view
class="item content"
data-ind="{{ ind }}"
data-index="{{ index }}"
data-item="{{ li }}"
>
<view class="item-top">
<view class="code">
<text>订单编号</text>
<text class="code-text">{{li.orderCode}}</text>
</view>
<view class="status text-center" style="color:{{ listAuditStatusMap[li.status].color }};background-color:{{listAuditStatusMap[li.status].background }};">
{{listAuditStatusMap[li.status].name }}
</view>
</view>
<view class="order-list">
<block wx:for="{{li.associationOrderCode == 1 ? errorOrderItems : orderItems }}" wx:key="sindex" wx:for-index="sindex" wx:for-item="i">
<view class="order flex">
<view class="order-label">{{i.label}}</view>
<view class="order-value">
<block wx:if="{{ i.format }}">
<text>{{djOrderTypeMap[li[i.key]]}}</text>
</block>
<block wx:else>{{li[i.key] || ''}}</block>
</view>
</view>
</block>
</view>
<view class="btn-box flex">
<view><text class="label">总价</text><text class="unit">¥</text><text>{{li.finalPrice}}</text></view>
<view bindtap="handleDetail" data-target="{{li}}" class="btn {{li.status == 1 ? 'primary' : ''}}">{{li.status == 1 ? '审核' : '查看'}}</view>
</view>
</view>
</view>
</block>
</block>
<block wx:if="{{ nothing }}">
<view class="list-nothing">到底了~</view>
</block>
</block>
<block wx:else>
<empty-data />
</block>
</scroll-view>
</view>
<select-popup show="{{ showSelectPopup }}" options="{{ selectOptions }}" multiple="{{ selectMultiple }}" values="{{ selectValues }}" value="{{ selectValue }}" bindconfirm="handlePopupConfirm" title="{{ selectTitle }}" bindcancel="hideSelectPopup" customIsTab="{{ true }}"></select-popup>
\ No newline at end of file
import api from '~/utils/request/request.js'
const service = '/rop-dj-staff-miniprogram/router'
module.exports = {
// 获取绩效统计卡片
getPerformanceStatistics(data) {
return api.post('dj.staff.api.perf.appraisal.statistics.card', data, [], service)
},
// 获取月份绩效规则
getPerformanceRule(data) {
return api.post('dj.staff.api.perf.rule.config.get', data, [], service)
},
// 获取绩效考核列表
getPerformanceList(data) {
return api.post('dj.staff.api.perf.appraisal.list', data, [], service)
},
// 自动检测规则结果
autoDetectResult(data) {
return api.post('dj.staff.api.perf.appraisal.auto.detect.result', data, [], service)
},
// 绩效详情
performanceDetail(data) {
return api.post('dj.staff.api.perf.appraisal.detail', data, [], service)
},
// 单个提交规则评分
singleSubmit(data) {
return api.post('dj.staff.api.perf.appraisal.single.submit', data, [], service)
},
// 批量提交规则评分
batchSubmit(data) {
return api.post('dj.staff.api.perf.appraisal.batch.submit', data, [], service)
},
// 获取员工列表(过滤提交过两次的员工)
getStaffListAPI(data) {
return api.post('dj.staff.api.perf.staff.list', data, [], service)
},
// 获取批量员工的绩效详情数据
getBatchPerformanceInfo(data) {
return api.post('dj.staff.api.perf.appraisal.batch.detail', data, [], service)
},
// 获取算工资的时间节点
getPerformanceTimeCycle(data) {
return api.post(
'dj.staff.api.performance.time.cycle.list',
data,
[],
service
)
},
}
\ No newline at end of file
// packageWorkspace/pages/performanceRating/batchOperation/batchOperation.js
const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/miniprogram/regional-assistant/'
import { levelList } from '~/packageWorkspace/pages/performanceRating/constant'
import api from '~/packageWorkspace/pages/performanceRating/api'
import NP from 'number-precision'
Page({
/**
* 页面的初始数据
*/
data: {
IMG_URL,
selectedStaffList: [],
staffList: [],
batchConfigType: 1,
batchInfo: {
manualGradeCode: ''
},
levelList: levelList
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.setData({
pageQuery: options
}, () => {
// 获取员工列表
this.getStaffList()
// 获取当前月份的绩效配置规则
this.getRuleConfig()
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
getRuleConfig() {
let { pageQuery } = this.data
api.getPerformanceRule({queryMonth: pageQuery.queryMonth}).then(res => {
let { code, data, message } = res
if (code == 0) {
this.setData({
ruleConfigInfo: data
})
} else {
wx.$util.showToast(message)
}
})
},
getStaffList() {
let { pageQuery } = this.data
wx.$util.showLoading()
api.getStaffListAPI({queryMonth: pageQuery.queryMonth}).then(res => {
wx.$util.hideLoading()
let { code, data, message } = res
if (code == 0) {
data?.forEach(val => {
val.levelCode = val.adoptType == 1 ? val.autoGradeCode : val.adoptType == 2 ? val.manualGradeCode : ''
})
this.setData({
staffList: data || []
})
} else {
wx.$util.showToast(message)
}
})
},
// 批量选择员工
handleSelectStaff() {
let {
selectedStaffList,
staffList
} = this.data
this.setData({
showSelectPopup: true,
selectOptions: staffList,
selectTitle: '选择员工',
selectMultiple: true,
selectValues: selectedStaffList?.map(val => { return val.mobilePhone }),
selectType: 'staff'
})
},
handleMaxTips() {
wx.$util.showToast('最多支持选择20位员工')
},
handlePopupConfirm(e) {
let { selectType, singleSelectIndex, batchSingleList } = this.data
if (selectType == 'staff') {
let { items } = e.detail
this.setData({
selectedStaffList: items
}, () => {
// 获取批量员工的绩效数据
this.getBatchStaffPerformance()
})
} else {
let { values } = e.detail
let { ruleConfigInfo, batchInfo, batchFlag } = this.data
const obj = ruleConfigInfo?.performanceLevelDetailDTOS?.find(val => val.levelCode == values[0])
if (batchFlag) { // 统一设置等级
this.setData({
'batchInfo.manualGradeCode': values[0],
'batchInfo.manualScoreSymbolValue': obj.scoreSymbolValue,
'batchInfo.manualRewardCoefficient': obj.rewardCoefficient
})
} else {
this.setData({
[`batchSingleList[${singleSelectIndex}].manualGradeCode`]: values[0],
[`batchSingleList[${singleSelectIndex}].manualScoreSymbolValue`]: obj.scoreSymbolValue,
[`batchSingleList[${singleSelectIndex}].manualRewardCoefficient`]: obj.rewardCoefficient
})
// 未输入手动维护绩效金额 根据评分等级系数计算绩效工资
if (((batchSingleList[singleSelectIndex].manualFinalPerformanceAmount ?? '') === '')) {
const performanceSalary = NP.times(NP.times(batchSingleList[singleSelectIndex].afterAttendanceTotalBasicSalary, 0.3), obj.rewardCoefficient)
this.setData({
[`batchSingleList[${singleSelectIndex}].performanceSalary`]: performanceSalary,
[`batchSingleList[${singleSelectIndex}].basicSalary`]: NP.plus(performanceSalary, batchSingleList[singleSelectIndex].baseSalary)
})
}
}
}
this.hideSelectPopup()
},
hideSelectPopup() {
this.setData({showSelectPopup: false})
},
getBatchStaffPerformance() {
let { selectedStaffList, pageQuery } = this.data
if (!selectedStaffList.length) return
api.getBatchPerformanceInfo({queryMonth: pageQuery.queryMonth, mobilePhoneList: selectedStaffList?.map(val => { return val.mobilePhone })}).then(res => {
let { code, data, message } = res
if (code == 0) {
data?.forEach(val => {
val.gradeCode = val.adoptType == 1 ? val.autoGradeCode : val.adoptType == 2 ? val.manualGradeCode : '',
val.performanceSalary = !((val.manualFinalPerformanceAmount ?? '') === '') ? val.manualFinalPerformanceAmount : val.performanceSalary // 最终绩效工资
val.rewardCoefficient = val.adoptType == 1 ? val.autoRewardCoefficient : val.adoptType == 2 ? val.manualRewardCoefficient : '' // 最终奖励系数
val.scoreSymbolValue = val.adoptType == 1 ? val.autoScoreSymbolValue : val.adoptType == 2 ? val.manualScoreSymbolValue : '' // 最终分数范围
})
this.setData({
batchSingleList: data || []
})
} else {
wx.$util.showToast(message)
}
})
},
changeRadio(e) {
let { value } = e.currentTarget.dataset
let { selectedStaffList } = this.data
if (value == 2 && !selectedStaffList.length) return wx.$util.showToast('请选择员工')
this.setData({
batchConfigType: value
})
},
// 手动评分选择绩效等级
selectLevelCode(e) {
let { batch, index } = e.currentTarget.dataset
let {
batchInfo,
levelList,
batchSingleList
} = this.data
this.setData({
showSelectPopup: true,
selectOptions: levelList,
selectTitle: '绩效',
selectMultiple: false,
selectValue: batch ? [batchInfo.manualGradeCode] : [batchSingleList[index].manualGradeCode],
batchFlag: batch,
selectType: 'level',
singleSelectIndex: !batch ? index : null
})
},
priceInput(e) {
let { value } = e.detail
let { index } = e.currentTarget.dataset
let { batchConfigType, batchSingleList } = this.data
let cleanValue = value.replace(/[^\d.]/g, '')
const firstDotIndex = cleanValue.indexOf('.')
if (firstDotIndex != -1) {
cleanValue = cleanValue.substring(0, firstDotIndex + 1) + cleanValue.substring(firstDotIndex + 1).replace(/\./g, '')
}
if (cleanValue == '.') {
cleanValue = '0.'
}
if (cleanValue.length > 1 && cleanValue.startsWith('0') && !cleanValue.startsWith('0.')) {
cleanValue = cleanValue.replace(/^0+/, '')
if (cleanValue == '') {
cleanValue = '0'
}
}
const numericValue = parseFloat(cleanValue)
if (numericValue > 100000) {
cleanValue = '100000'
} else if (numericValue == 100000 && cleanValue.includes('.')) {
cleanValue = '100000'
}
const dotIndexAfterCheck = cleanValue.indexOf('.');
if (dotIndexAfterCheck != -1 && cleanValue.length > dotIndexAfterCheck + 3) {
cleanValue = cleanValue.substring(0, dotIndexAfterCheck + 3)
}
value = cleanValue
if (batchConfigType == 1) {
this.setData({
'batchInfo.manualFinalPerformanceAmount': value
})
} else {
// 计算绩效工资,没有手动维护金额按绩效等级系数进行计算
const computedValue = value || (batchSingleList[index]?.manualGradeCode ? NP.times(NP.times(batchSingleList[index]?.afterAttendanceTotalBasicSalary, 0.3), batchSingleList[index].manualRewardCoefficient) : 0)
this.setData({
[`batchSingleList[${index}].manualFinalPerformanceAmount`]: value,
[`batchSingleList[${index}].performanceSalary`]: computedValue,
[`batchSingleList[${index}].basicSalary`]: NP.plus(computedValue, batchSingleList[index]?.baseSalary)
})
}
},
handleHelpPopup() {
this.setData({
showHelpPopup: true
})
},
handleConfirm() {
const { batchConfigType, batchInfo, batchSingleList, selectedStaffList, pageQuery } = this.data
if (!selectedStaffList.length) {
return wx.$util.showToast('请选择员工')
}
const mapStaffToSubmitItem = (staff, source) => ({
mobilePhone: staff.mobilePhone,
evaluationMonth: pageQuery.queryMonth,
manualGradeCode: source.manualGradeCode,
manualRewardCoefficient: source.manualRewardCoefficient,
manualScoreSymbolValue: source.manualScoreSymbolValue,
manualFinalPerformanceAmount: source.manualFinalPerformanceAmount,
adoptType: 2,
amountCalculationType: !((source.manualFinalPerformanceAmount ?? '') === '') ? 2 : 1
})
let perfAppraisalSubmitReqDTO = []
if (batchConfigType == 1) {
// 批量统一设置
if (!batchInfo.manualGradeCode && !batchInfo.manualFinalPerformanceAmount) {
return wx.$util.showToast('请配置绩效评分')
}
perfAppraisalSubmitReqDTO = selectedStaffList.map(staff =>
mapStaffToSubmitItem(staff, batchInfo)
)
} else {
for (const staff of batchSingleList) {
const hasGrade = (staff.manualGradeCode ?? '') !== '';
const hasAmount = (staff.manualFinalPerformanceAmount ?? '') !== ''
if (!hasGrade && !hasAmount) {
wx.$util.showToast(`请配置【${staff.name}】的绩效评分`)
}
}
perfAppraisalSubmitReqDTO = batchSingleList.map(staff =>
mapStaffToSubmitItem(staff, staff)
)
}
if (this.data.confirmFlag) return
this.setData({ confirmFlag: true })
wx.$util.showLoading()
const params = {
evaluationMonth: pageQuery.queryMonth,
perfAppraisalSubmitReqDTO
}
api.batchSubmit(params)
.then(res => {
wx.$util.hideLoading();
this.setData({ confirmFlag: false })
const { code, message } = res
if (code == 0) {
wx.navigateBack()
} else {
wx.showModal({
title: '提示',
content: message,
showCancel: false,
confirmText: '我知道了',
confirmColor: '#222222'
})
}
})
.catch(() => {
wx.$util.hideLoading()
this.setData({ confirmFlag: false })
})
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file
{
"usingComponents": {
"select-popup": "/packageWorkspace/components/selectPopup/selectPopup",
"help-popup": "../components/helpPopup/helpPopup"
},
"navigationBarTitleText": "批量操作"
}
\ No newline at end of file
/* packageWorkspace/pages/performanceRating/batchOperation/batchOperation.wxss */
page {
background: #F2F3F7;
}
.blue {
color: #347BFF;
}
.page-container {
padding: 12rpx 24rpx;
.flex {
display: flex;
align-items: center;
}
.just-space {
justify-content: space-between;
}
.mar-l32 {
margin-left: 32rpx;
}
.content-box {
background: #FFFFFF;
border-radius: 32rpx;
padding: 32rpx 24rpx;
font-size: 28rpx;
margin-bottom: 24rpx;
.content-title {
font-weight: 500;
image {
width: 32rpx;
height: 32rpx;
}
.title-icon {
width: 6rpx;
height: 32rpx;
margin-right: 16rpx;
}
.nums {
font-weight: 400;
margin-right: 8rpx;
}
}
.tag-box {
margin-top: 32rpx;
display: flex;
flex-wrap: wrap;
gap: 8rpx;
.tag-item {
color: #2C66F7;
font-size: 24rpx;
font-weight: 500;
height: 52rpx;
padding: 0 16rpx;
border-radius: 4px;
background: #347bff1a;
max-width: calc(50% - 8rpx);
margin-bottom: 8rpx;
flex-wrap: nowrap;
.text-hidex {
flex-shrink: 0;
}
.level {
flex-shrink: 0;
.split {
margin: 0 6rpx;
}
}
}
}
.sub-title {
margin: 32rpx 0 16rpx 0;
font-weight: 500;
}
.radio-box {
.radio-item {
margin: 16rpx 0 24rpx;
padding: 10rpx 0;
&:last-child {
margin-bottom: 0;
}
.radio {
width: 28rpx;
height: 28rpx;
box-sizing: border-box;
padding: 4rpx;
flex-shrink: 0;
margin-right: 14rpx;
border-radius: 50%;
border: 2rpx solid #D0D2D6;
}
image {
width: 32rpx;
height: 32rpx;
margin-right: 10rpx;
}
}
}
.salary-box {
margin-top: 16rpx;
.salary-item {
flex: 1;
.label {
color: #999999;
font-size: 24rpx;
margin-bottom: 4rpx;
}
.value {
color: #222222;
font-size: 26rpx;
}
}
}
.manual-box {
margin-top: 16rpx;
border-radius: 20rpx;
background: #f7f8fa;
padding: 24rpx 20rpx;
font-size: 26rpx;
color: #222222;
.dot {
width: 12rpx;
height: 12rpx;
border-radius: 50%;
margin-right: 16rpx;
background: #347BFF;
}
.select {
margin: 12rpx 0 12rpx 28rpx;
height: 72rpx;
border-radius: 16rpx;
background: #FFFFFF;
border: 2rpx solid #EFF0F2;
color: #222222;
font-size: 28rpx;
font-weight: 500;
padding: 0 20rpx;
&.gary {
color: #999EA8;
font-weight: 400;
}
image {
width: 32rpx;
height: 32rpx;
}
}
.rate {
margin-left: 28rpx;
}
}
.input-content {
margin: 16rpx 0;
font-size: 28rpx;
color: #222222;
image {
width: 28rpx;
height: 28rpx;
flex-shrink: 0;
margin: 0 16rpx 0 8rpx;
}
.input-box {
width: 196rpx;
height: 72rpx;
line-height: 72rpx;
box-sizing: border-box;
padding: 0 20rpx;
position: relative;
border-radius: 16rpx;
border: 2rpx solid #eff0f2;
.input {
height: 72rpx;
line-height: 72rpx;
width: 100%;
font-weight: 700;
}
}
}
.input-tips {
font-size: 24rpx;
color: #888888;
line-height: 1.5;
}
}
.btn-box {
padding: 32rpx 40rpx 68rpx;
font-size: 32rpx;
.btn {
width: 100%;
height: 88rpx;
border-radius: 24rpx;
margin-bottom: 20rpx;
text-align: center;
line-height: 88rpx;
background: #FFFFFF;
&.confirm {
background: #2C66F7;
color: #FFFFFF;
font-weight: 500;
}
}
}
}
\ No newline at end of file
<!--packageWorkspace/pages/performanceRating/batchOperation/batchOperation.wxml-->
<view class="page-container">
<view class="content-box">
<view class="content-title flex just-space">
<view class="flex">
<image class="title-icon" src="{{IMG_URL}}title_icon.png" mode=""/>
<text>当前选中</text>
</view>
<view class="flex" bindtap="handleSelectStaff">
<view class="nums">{{selectedStaffList.length}}位员工</view>
<image src="{{IMG_URL}}arrow-left.png" mode=""/>
</view>
</view>
<view class="tag-box" wx:if="{{selectedStaffList.length}}">
<block wx:for="{{selectedStaffList}}" wx:key="index">
<view class="tag-item flex"><view class="text-hide">{{item.name}}</view><view class="level" wx:if="{{item.levelCode}}"><text class="split">·</text>{{item.levelCode}}级</view></view>
</block>
</view>
</view>
<view class="content-box">
<view class="content-title flex">
<image class="title-icon" src="{{IMG_URL}}title_icon.png" mode=""/>
<text>批量操作类型</text>
</view>
<view class="sub-title">批量设置绩效等级</view>
<view class="radio-box">
<view class="radio-item flex" bindtap="changeRadio" data-value="1">
<image wx:if="{{batchConfigType == 1}}" src="{{IMG_URL}}radio-checked.png" mode=""/>
<view wx:else class="radio"></view>
<view class="label">统一设置相同等级</view>
</view>
<view class="radio-item flex" bindtap="changeRadio" data-value="2">
<image wx:if="{{batchConfigType == 2}}" src="{{IMG_URL}}radio-checked.png" mode=""/>
<view wx:else class="radio"></view>
<view class="label">手工单个调整评级</view>
</view>
</view>
</view>
<block wx:if="{{batchConfigType == 1}}">
<view class="content-box">
<view class="content-title flex">
<image class="title-icon" src="{{IMG_URL}}title_icon.png" mode=""/>
<text>统一评等级</text>
</view>
<view class="manual-box">
<view class="flex">
<view class="dot"></view>
<view>手动评分</view>
</view>
<view class="select flex just-space {{batchInfo.manualGradeCode ? '' : 'gary'}}" bindtap="selectLevelCode" data-batch="{{true}}">
{{batchInfo.manualGradeCode || '请选择等级'}}
<image src="{{IMG_URL}}expand_icon.png" mode=""/>
</view>
<view class="blue rate">
<text>评分:</text>
<text>{{batchInfo.manualScoreSymbolValue || 0}}分</text>
<text class="mar-l32">系数:</text>
<text>{{batchInfo.manualRewardCoefficient || '0'}}</text>
</view>
</view>
<view class="input-content flex">
<view>手动维护最终绩效金额</view>
<image src="{{IMG_URL}}caption-icon.png" class="help-icon" bindtap="handleHelpPopup" mode=""/>
<view class="input-box flex">
<input class='input' placeholder="请输入" value="{{batchInfo.manualFinalPerformanceAmount}}" placeholder-style="color: #999EA8;" bindinput="priceInput" type="digit"/>
<view>元</view>
</view>
</view>
<view class="input-tips">根据系数算出绩效,如觉得绩效金额不合适,可<text class="blue">手动输入</text>最终绩效金额</view>
</view>
</block>
<block wx:else>
<view class="content-box" wx:for="{{batchSingleList}}" wx:key="index">
<view class="content-title flex">
<image class="title-icon" src="{{IMG_URL}}note-icon.png" mode=""/>
<text>{{item.name}}</text><text wx:if="{{item.gradeCode}}">·{{item.gradeCode}}级</text>
</view>
<view class="salary-box flex">
<view class="salary-item">
<view class="label">绩效工资</view>
<view class="value">{{item.performanceSalary}}</view>
</view>
<view class="salary-item">
<view class="label">底薪</view>
<view class="value">{{item.baseSalary}}</view>
</view>
<view class="salary-item">
<view class="label">基本工资</view>
<view class="value">{{item.basicSalary}}</view>
</view>
</view>
<view class="manual-box">
<view class="flex">
<view class="dot"></view>
<view>手动评分</view>
</view>
<view class="select flex just-space {{item.manualGradeCode ? '' : 'gary'}}" bindtap="selectLevelCode" data-index="{{index}}">
{{item.manualGradeCode || '请选择等级'}}
<image src="{{IMG_URL}}expand_icon.png" mode=""/>
</view>
<view class="blue rate">
<text>评分:</text>
<text>{{item.manualScoreSymbolValue || 0}}分</text>
<text class="mar-l32">系数:</text>
<text>{{item.manualRewardCoefficient || '0'}}</text>
</view>
</view>
<view class="input-content flex">
<view>手动维护最终绩效金额</view>
<image src="{{IMG_URL}}caption-icon.png" class="help-icon" bindtap="handleHelpPopup" mode=""/>
<view class="input-box flex">
<input class='input' placeholder="请输入" value="{{item.manualFinalPerformanceAmount}}" data-index="{{index}}" placeholder-style="color: #999EA8;font-weight: 400;" bindinput="priceInput" type="digit"/>
<view>元</view>
</view>
</view>
<view class="input-tips">根据系数算出绩效,如觉得绩效金额不合适,可<text class="blue">手动输入</text>最终绩效金额</view>
</view>
</block>
<view class="btn-box">
<view class="btn confirm" bindtap="handleConfirm">提交</view>
</view>
</view>
<select-popup show="{{ showSelectPopup }}" height="{{selectType == 'staff' ? '75%' : '50%'}}" allowSearch="{{selectMultiple}}" options="{{ selectOptions }}" valueKey="{{selectType == 'staff' ? 'mobilePhone' : 'value'}}" multiple="{{ selectMultiple }}" values="{{ selectValues }}" value="{{ selectValue }}" bindconfirm="handlePopupConfirm" max="{{20}}" bindmaxtips="handleMaxTips" title="{{ selectTitle }}" bindcancel="hideSelectPopup" customIsTab="{{ true }}"></select-popup>
<help-popup show="{{showHelpPopup}}" />
\ No newline at end of file
// packageWorkspace/pages/performanceRating/components/helpPopup/helpPopup.js
const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/miniprogram/regional-assistant/'
Component({
/**
* 组件的属性列表
*/
properties: {
show: {
type: Boolean, //目前接受的类型包括:String, Number, Boolean, Object, Array, null(表示任意类型)
value: false, // 默认值
observer(newVal, oldVal) {
if (newVal) {
this.createMaskAnimate(true)
} else {
this.createMaskAnimate(false)
}
}
},
},
/**
* 组件的初始数据
*/
data: {
IMG_URL,
helpContents: [{
title: '底薪',
value: '底薪=工资标准 / 应出勤天数×实际出勤天数×70%'
}, {
title: '绩效工资',
value: '绩效工资=工资标准 / 应出勤天数 × 实际出勤天数 × 30% × 绩效系数(如有手动维护绩效工资,则取最终手工维护的绩效金额)'
}, {
title: '基本工资',
value: '基本工资=底薪+绩效工资'
}, {
title: '手动维护最终绩效金额',
value: '手动维护最终绩效金额字段大于等级字段'
}],
maskAnimate: [],
frameAnimate: [],
},
/**
* 组件的方法列表
*/
methods: {
close() {
this.setData({
show: !this.data.show
})
},
//动画-遮罩层淡入淡出
createMaskAnimate(currentStatu) {
if (currentStatu) {
this.setData({
_show: currentStatu
})
this.createframeAnimate(true)
} else {
setTimeout(() => {
this.setData({
_show: false
})
}, 300)
this.createframeAnimate(false)
}
let maskAnimate = wx.createAnimation({
duration: 300,
timingFunction: 'ease-in-out',
delay: 0
})
this.maskAnimate = maskAnimate
maskAnimate.opacity(currentStatu ? 0.7 : 0).step()
setTimeout(() => {
this.setData({
maskAnimate: maskAnimate.export()
})
}, 50)
},
//动画-弹层内容Q弹
createframeAnimate(currentStatu) {
// return
let frameAnimate = wx.createAnimation({
duration: 300,
timingFunction: 'ease',
delay: 0
})
this.frameAnimate = frameAnimate
frameAnimate
.translate('-50%', '-50%')
.opacity(currentStatu ? 0.5 : 1)
.step()
// .scale(currentStatu ? 1.05 : 1)
this.setData({
frameAnimate: frameAnimate.export()
})
setTimeout(() => {
// 执行第二组动画
frameAnimate
.opacity(currentStatu ? 1 : 0)
.scale(currentStatu ? 1 : 0.9)
.step()
// 给数据对象储存的第一组动画,更替为执行完第二组动画的动画对象
this.setData({
frameAnimate: frameAnimate.export()
})
}, 150)
}
}
})
\ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
/* packageWorkspace/pages/performanceRating/components/helpPopup/helpPopup.wxss */
.popV {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 999;
width: 100vw;
height: 100vh;
}
.popV-mask {
position: absolute;
width: 100%;
height: 100%;
background: rgba(0, 0, 0);
opacity: 0;
display: block;
}
.popV-content {
position: absolute;
top: 50%;
left: 50%;
transform: translateY(-50%);
transform: translate(-50%);
width: var(--fontSize640);
box-sizing: border-box;
background: #FFFFFF;
border-radius: var(--fontSize32);
z-index: 1000;
display: flex;
flex-direction: column;
overflow: hidden;
opacity: 1;
.gradient {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 360rpx;
z-index: -1;
background: linear-gradient(to bottom, #DCE8FA, #FFFFFF);
}
.container {
padding: 48rpx;
.title {
text-align: center;
font-weight: 500;
font-size: 36rpx;
margin-bottom: 36rpx;
}
.content {
font-size: 28rpx;
color: #222222;
.cont-title {
display: flex;
align-items: center;
font-weight: 500;
margin: 16rpx 0;
image {
width: 6rpx;
height: 24rpx;
margin-right: 16rpx;
}
}
.cont-value {
font-size: 26rpx;
color: #666666;
}
}
}
.btn {
height: 96rpx;
line-height: 96rpx;
text-align: center;
border-top: 2rpx solid #F6F6F7;
color: #222222;
font-size: 32rpx;
}
}
\ No newline at end of file
<!--packageWorkspace/pages/performanceRating/components/helpPopup/helpPopup.wxml-->
<view wx:if="{{ _show }}" class="popV" catchtouchmove="move">
<view class="popV-mask" bindtap="selectMask" animation="{{ maskAnimate }}" />
<view class="popV-content" animation="{{ frameAnimate }}">
<view class="gradient"></view>
<view class="container">
<view class="title">帮助</view>
<view class="content">
<view wx:for="{{helpContents}}" wx:key="index">
<view class="cont-title">
<image src="{{IMG_URL}}title_icon.png" mode=""/>
<view class="label">{{item.title}}</view>
</view>
<view class="cont-value">{{item.value}}</view>
</view>
</view>
</view>
<view class="btn" bindtap="close">我知道了</view>
</view>
</view>
\ No newline at end of file
// packageWorkspace/pages/performanceRating/components/levelRate/levelRate.js
import { starCountObj, levelColorObj } from '~/packageWorkspace/pages/performanceRating/constant'
Component({
/**
* 组件的属性列表
*/
properties: {
info: {
type: Object
},
hideStar: {
type: Boolean
}
},
/**
* 组件的初始数据
*/
data: {
colorObj: levelColorObj,
starCountObj: starCountObj
},
/**
* 组件的方法列表
*/
methods: {
}
})
\ No newline at end of file
{
"component": true,
"usingComponents": {
"van-rate": "@vant/weapp/rate/index"
}
}
\ No newline at end of file
/* packageWorkspace/pages/performanceRating/components/levelRate/levelRate.wxss */
.rate-item {
display: flex;
align-items: center;
.level-item {
display: flex;
align-items: center;
justify-content: center;
width: 232rpx;
height: 60rpx;
border-radius: 40rpx;
margin-right: 24rpx;
color: #222222;
font-weight: 500;
font-size: 28rpx;
}
.coeff {
margin-left: 12rpx;
color: #222222;
}
}
\ No newline at end of file
<!--packageWorkspace/pages/performanceRating/components/levelRate/levelRate.wxml-->
<view class="rate-item">
<view class="level-item" style="background: {{colorObj[info.levelCode]}};">{{info.levelCode}}级:{{info.scoreSymbolValue}}分</view>
<block wx:if="{{!hideStar}}">
<view class="rate-box">
<van-rate readonly value="{{ starCountObj[info.levelCode] }}" count="{{6}}" void-icon="star" size="16px" void-color="#DEE0E3" color="#FFB742" />
</view>
<view class="coeff">系数:{{info.rewardCoefficient}}</view>
</block>
</view>
export const levelColorObj = {
'S': '#E9E0FA',
'A': '#D8F4D4',
'B+': '#D6F5EF',
'B': '#E6EFFF',
'B-': '#D5F1FA',
'C': '#F7EFCD',
'D': '#F9E0E0'
}
export const starCountObj = {
'S': 6,
'A': 5,
'B+': 4,
'B': 3,
'B-': 2,
'C': 1,
'D': 0
}
export const levelMap = {
'': '绩效',
'S': 'S',
'A': 'A',
'B+': 'B+',
'B': 'B',
'B-': 'B-',
'C': 'C',
'D': 'D'
}
export const levelList = [{
name: 'S',
value: 'S'
}, {
name: 'A',
value: 'A'
}, {
name: 'B+',
value: 'B+'
}, {
name: 'B',
value: 'B'
}, {
name: 'B-',
value: 'B-'
}, {
name: 'C',
value: 'C'
}, {
name: 'D',
value: 'D'
}]
export const statusMap = {
'': {name: '处理状态'},
'0': {name: '未处理', color: '#FF9D0A', background: '#ff9d0a1a'},
'1': {name: '已处理', color: '#35C376', background: '#35c3761a'}
}
export const statusList = [{
name: '已处理',
value: '1'
}, {
name: '未处理',
value: '0'
}]
\ No newline at end of file
// packageWorkspace/pages/performanceRating/rateDetail/rateDetail.js
const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/miniprogram/regional-assistant/'
import api from '~/packageWorkspace/pages/performanceRating/api'
import dayjs from 'dayjs'
Page({
/**
* 页面的初始数据
*/
data: {
IMG_URL,
navBarHeight: 0,
},
navbarReady(e) {
let navBarHeight = e.detail.height
this.setData({
navBarHeight
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.setData({
pageQuery: options,
currentMobile: options.mobilePhone
}, () => {
// 获取绩效评分详情
this.getDetail(options.mobilePhone)
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
getDetail(mobilePhone) {
let { pageQuery } = this.data
api.performanceDetail({queryMonth: pageQuery.queryMonth, mobilePhone}).then(res => {
let {code, message, data} = res
if (code == 0) {
this.setData({
info: {
...data,
entryDate: data?.entryDate ? dayjs(data?.entryDate).format('YYYY-MM-DD') : ''
},
performanceInfo: {
levelCode: data?.adoptType == 1 ? data?.autoGradeCode : data?.adoptType == 2 ? data?.manualGradeCode : '',
rewardCoefficient: data?.adoptType == 1 ? `${data?.autoRewardCoefficient}` : data?.adoptType == 2 ? `${data?.manualRewardCoefficient}` : '',
scoreSymbolValue: data?.adoptType == 1 ? data?.autoScoreSymbolValue : data?.adoptType == 2 ? data?.manualScoreSymbolValue : ''
}
})
} else {
wx.$util.showToast(message)
}
})
},
handleHelpPopup() {
this.setData({
showHelpPopup: true
})
},
back() {
wx.navigateBack()
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file
{
"usingComponents": {
"level-rate": "../components/levelRate/levelRate",
"help-popup": "../components/helpPopup/helpPopup"
},
"navigationStyle": "custom"
}
\ No newline at end of file
/* packageWorkspace/pages/performanceRating/rateDetail/rateDetail.wxss */
page {
background: #F2F3F7;
}
.title {
max-length: 360rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.flex {
display: flex;
align-items: center;
}
.just-space {
justify-content: space-between;
}
.mar-t32 {
margin-top: 32rpx;
}
.mar-l32 {
margin-left: 32rpx;
}
.container {
padding: 12rpx 24rpx;
.blue {
color: #347BFF;
}
.help-icon {
width: 28rpx;
height: 28rpx;
flex-shrink: 0;
margin-left: 8rpx;
}
.content-box {
border-radius: 32rpx;
background: #ffffff;
padding: 24rpx 28rpx;
margin-bottom: 24rpx;
color: #222222;
font-size: 26rpx;
.content-title {
font-size: 28rpx;
color: #222222;
font-weight: 500;
margin-bottom: 16rpx;
.title-icon {
width: 6rpx;
height: 32rpx;
margin-right: 16rpx;
}
image {
width: 32rpx;
height: 32rpx;
flex-shrink: 0;
margin-right: 8rpx;
}
.left {
width: 6rpx;
height: 32rpx;
border-radius: 6rpx;
overflow: hidden;
background: #347bff33;
position: relative;
margin-right: 16rpx;
.left-top {
width: 6rpx;
height: 16rpx;
border-radius: 6rpx;
overflow: hidden;
background: linear-gradient(180deg, #2c66f7 0%, #389fff 100%);
position: absolute;
top: 0;
left: 0;
}
}
.tips {
margin-left: 16rpx;
color: #888888;
font-size: 22rpx;
}
}
.label {
font-weight: 500;
}
.unit {
margin: 0 4rpx;
font-size: 28rpx;
font-weight: 500;
&.font-s20{
font-size: 40rpx;
}
}
.price-box {
font-weight: 500;
color: #222222;
.left,.right {
flex: 1;
}
.price {
margin: 16rpx 0;
font-size: 40rpx;
font-family: "numberBold";
}
}
.fancy-divider {
position: relative;
width: 100%;
height: 1px;
background: #347bff80;
&::before {
content: '';
position: absolute;
left: 30rpx;
top: -10rpx;
width: 16rpx;
height: 16rpx;
background-color: #FFFFFF;
border: 2rpx solid #347bff80;
border-color: transparent transparent #347bff80 #347bff80;
transform: rotate(-45deg);
}
}
.base-box {
margin-top: 24rpx;
.comput-price {
margin-top: 16rpx;
font-size: 40rpx;
font-family: "numberBold";
}
}
.gross-price {
text-align: center;
font-family: "numberBold";
font-size: 68rpx;
}
}
.top {
display: flex;
align-items: center;
justify-content: space-between;
padding: 28rpx 32rpx;
.name {
font-size: 30rpx;
color: #222222;
font-weight: 500;
text {
font-size: 22rpx;
color: #999999;
font-weight: 400;
margin-left: 16rpx;
}
}
.merchant {
margin-top: 10rpx;
font-size: 26rpx;
color: #666666;
}
.bg-image {
margin: -24rpx 0;
width: 186rpx;
height: 138rpx;
}
}
}
\ No newline at end of file
<!--packageWorkspace/pages/performanceRating/rateDetail/rateDetail.wxml-->
<navigation-bar class="navigation-header" bindnavbarReady="navbarReady" showBack="{{true}}" bindback="back">
<view class="title">{{info.name}}绩效评分详情</view>
</navigation-bar>
<view class="container" style="margin-top: {{navBarHeight}}px;">
<view class="content-box top">
<view>
<view class="name">{{info.name}}<text>{{info.entryDate || '-'}}入职</text></view>
<view class="merchant">{{info.merchantName || '-'}}</view>
</view>
<image class="bg-image" src="{{IMG_URL}}rate_bg_image.png" mode=""/>
</view>
<view class="content-box">
<view class="content-title flex">
<image class="title-icon" src="{{IMG_URL}}title_icon.png" mode=""/>
<view>绩效评分</view>
</view>
<level-rate info="{{performanceInfo}}" />
</view>
<view class="content-box">
<view class="content-title flex">
<image class="title-icon" src="{{IMG_URL}}title_icon.png" mode=""/>
<view>工资</view>
<view class="tips">当前收入是预估的,可在收到工资条后发起考勤等申诉</view>
</view>
<view class="flex price-box">
<view class="left">
<view class="flex"><view class="label">绩效工资</view><image class="help-icon" bindtap="handleHelpPopup" src="{{IMG_URL}}caption-icon.png" mode=""/></view>
<view class="price blue">{{info.performanceSalary}}<text class="unit blue">元</text></view>
</view>
<view class="right">
<view class="flex"><view class="label">底薪</view><image class="help-icon" bindtap="handleHelpPopup" src="{{IMG_URL}}caption-icon.png" mode=""/></view>
<view class="price blue">{{info.baseSalary}}<text class="unit blue">元</text></view>
</view>
</view>
<view class="fancy-divider"></view>
<view class="base-box">
<view class="flex"><view class="label">基本工资</view><image class="help-icon" bindtap="handleHelpPopup" src="{{IMG_URL}}caption-icon.png" mode=""/></view>
<view class="comput-price">{{info.performanceSalary}}<text class="unit font-s20">+</text>{{info.baseSalary}}<text class="unit font-s20">=</text><text class="blue">{{info.basicSalary}}</text><text class="blue unit">元</text></view>
</view>
</view>
<view class="content-box">
<view class="content-title flex">
<image class="title-icon" src="{{IMG_URL}}title_icon.png" mode=""/>
<view>合计应发工资</view>
<view class="tips">工资条上的金额</view>
</view>
<block wx:if="{{info.totalGrossSalary}}">
<view class="gross-price blue">{{info.totalGrossSalary}}<text class="unit">元</text></view>
</block>
<block wx:else>
<empty-data emptyText="总部运营-薪酬专员 未出工资条" />
</block>
</view>
</view>
<help-popup show="{{showHelpPopup}}" />
\ No newline at end of file
// packageWorkspace/pages/performanceRating/rateDetail/rateDetail.js
const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/miniprogram/regional-assistant/'
import { levelList } from '~/packageWorkspace/pages/performanceRating/constant'
import api from '~/packageWorkspace/pages/performanceRating/api'
import NP from 'number-precision'
import dayjs from 'dayjs'
Page({
/**
* 页面的初始数据
*/
data: {
IMG_URL,
navBarHeight: 0,
info: {},
resultInfo: {},
levelList: levelList,
pageQuery: {},
performanceList: [],
isT1DateRange: false,
T1EndDateStr: ''
},
navbarReady(e) {
let navBarHeight = e.detail.height
this.setData({
navBarHeight
})
},
back() {
wx.navigateBack()
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.setData({
pageQuery: options,
currentMobile: options.mobilePhone
}, () => {
// 获取当前月份的绩效配置规则
this.getRuleConfig()
// 获取自动检测结果
this.getAutoResult(options.mobilePhone)
// 获取绩效评分详情
this.getDetail(options.mobilePhone)
// 获取全部员工绩效
this.getList()
// 获取算工资的时间节点
this.getCycleTime()
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
getDayOfMonthText(dateStr) {
const date = new Date(dateStr.replace(' ', 'T'))
const day = date.getDate()
return day
},
// t1时间段内可编辑上月绩效
isExpired(endDateStr) {
const now = new Date()
const endDate = new Date(endDateStr)
if (now > endDate) {
return true
}
},
getCycleTime() {
api.getPerformanceTimeCycle({}).then(res => {
let { code, data, message } = res
if (code == 0) {
const T1EndDate = data?.find(val => val.cycleCode == 'T1')?.endDate
this.setData({
isT1DateRange: this.isExpired(T1EndDate),
T1EndDateStr: this.getDayOfMonthText(T1EndDate)
})
} else {
wx.$util.showToast(message)
}
})
},
getAutoResult(mobilePhone) {
let { pageQuery } = this.data
api.autoDetectResult({queryMonth: pageQuery.queryMonth, mobilePhone}).then(res => {
let { code, data, message } = res
if (code == 0) {
data.autoRewardCoefficient = !((data.autoRewardCoefficient ?? '') === '') ? `${data?.autoRewardCoefficient}` : ''
this.setData({
resultInfo: data || {}
})
} else {
wx.$util.showToast(message)
}
})
},
getRuleConfig() {
let { pageQuery } = this.data
api.getPerformanceRule({queryMonth: pageQuery.queryMonth}).then(res => {
let { code, data, message } = res
if (code == 0) {
this.setData({
ruleConfigInfo: data
})
} else {
wx.$util.showToast(message)
}
})
},
getDetail(mobilePhone) {
let { pageQuery } = this.data
wx.$util.showLoading()
api.performanceDetail({queryMonth: pageQuery.queryMonth, mobilePhone}).then(res => {
wx.$util.hideLoading()
let {code, message, data} = res
if (code == 0) {
this.setData({
info: {
...data,
entryDate: data?.entryDate ? dayjs(data?.entryDate).format('YYYY-MM-DD') : '',
adoptType: data?.isAutoPerformance == 0 || !data?.isAutoPerformance ? 2 : data?.adoptType,
},
autoInfo: {
levelCode: data?.autoGradeCode,
rewardCoefficient: !((data?.autoRewardCoefficient ?? '') === '') ? `${data?.autoRewardCoefficient}` : '',
scoreSymbolValue: data?.autoScoreSymbolValue
}
})
// 非手动维护金额 计算绩效工资数
if (data?.adoptType == 2 && ((data?.manualFinalPerformanceAmount ?? '') === '')) {
this.setData({
'info.performanceSalary': NP.round(NP.times(NP.times(res.data.afterAttendanceTotalBasicSalary, 0.3), res.data.manualRewardCoefficient), 2)
})
}
this.setData({ navigating: false })
} else {
wx.$util.showToast(message)
}
})
},
checkIsFirstOrLast(list, targetMobile) {
if (!Array.isArray(list) || list.length === 0) {
return { isFirst: false, isLast: false }
}
const first = list[0].mobilePhone
const last = list[list.length - 1].mobilePhone
return {
isFirst: targetMobile == first,
isLast: targetMobile == last
}
},
getList() {
let { pageQuery } = this.data
api.getPerformanceList({queryMonth: pageQuery.queryMonth}).then(res => {
let { code, data, message } = res
if (code == 0) {
this.setData({
performanceList: data || [],
showLastBtn: !this.checkIsFirstOrLast(data, pageQuery.mobilePhone).isFirst,
showNextBtn: !this.checkIsFirstOrLast(data, pageQuery.mobilePhone).isLast
})
} else {
wx.$util.showToast(message)
}
})
},
handleHelpPopup() {
this.setData({
showHelpPopup: true
})
},
// 手动评分选择绩效等级
selectLevelCode() {
let {
info,
levelList,
isT1DateRange
} = this.data
if (isT1DateRange || info.submitCount >= 2 || !((info.totalGrossSalary ?? '') === '')) return
this.setData({
showSelectPopup: true,
selectOptions: levelList,
selectTitle: '绩效',
selectMultiple: false,
selectValue: [info.manualGradeCode],
})
},
handlePopupConfirm(e) {
let { values } = e.detail
let { ruleConfigInfo, info } = this.data
const obj = ruleConfigInfo?.performanceLevelDetailDTOS?.find(val => val.levelCode == values[0])
this.setData({
[`info.manualGradeCode`]: values[0],
['info.manualScoreSymbolValue']: obj.scoreSymbolValue,
['info.manualRewardCoefficient']: obj.rewardCoefficient
})
// 未输入手动维护绩效金额 根据评分等级系数计算绩效工资
if (((info.manualFinalPerformanceAmount ?? '') === '')) {
const performanceSalary = NP.round(NP.times(NP.times(info.afterAttendanceTotalBasicSalary, 0.3), obj.rewardCoefficient), 2)
this.setData({
'info.performanceSalary': performanceSalary,
'info.basicSalary': NP.plus(performanceSalary, info.baseSalary)
})
}
this.hideSelectPopup()
},
hideSelectPopup() {
this.setData({
showSelectPopup: false
})
},
priceInput(e) {
let { value } = e.detail
let { info } = this.data
let cleanValue = value.replace(/[^\d.]/g, '')
const firstDotIndex = cleanValue.indexOf('.')
if (firstDotIndex !== -1) {
cleanValue = cleanValue.substring(0, firstDotIndex + 1) + cleanValue.substring(firstDotIndex + 1).replace(/\./g, '')
}
if (cleanValue === '.') {
cleanValue = '0.'
}
if (cleanValue.length > 1 && cleanValue.startsWith('0') && !cleanValue.startsWith('0.')) {
cleanValue = cleanValue.replace(/^0+/, '')
if (cleanValue === '') {
cleanValue = '0'
}
}
const numericValue = parseFloat(cleanValue)
if (numericValue > 100000) {
cleanValue = '100000'
} else if (numericValue === 100000 && cleanValue.includes('.')) {
cleanValue = '100000'
}
const dotIndexAfterCheck = cleanValue.indexOf('.');
if (dotIndexAfterCheck !== -1 && cleanValue.length > dotIndexAfterCheck + 3) {
cleanValue = cleanValue.substring(0, dotIndexAfterCheck + 3)
}
value = cleanValue
// 计算绩效工资,没有手动维护金额按绩效等级系数进行计算
const computedValue = value || (info.manualGradeCode ? NP.round(NP.times(NP.times(info.afterAttendanceTotalBasicSalary, 0.3), info.manualRewardCoefficient), 2) : 0)
this.setData({
'info.manualFinalPerformanceAmount': value,
'info.performanceSalary': computedValue,
'info.basicSalary': NP.plus(computedValue, info.baseSalary)
})
},
// 查看规则
goRule() {
let { info, pageQuery } = this.data
wx.navigateTo({
url: `/packageWorkspace/pages/performanceRating/ruleNote/ruleNote?autoGradeType=${info.autoGradeType}&queryMonth=${pageQuery.queryMonth}`,
})
},
// 切换
changeRadio(e) {
let { value } = e.currentTarget.dataset
let { isT1DateRange, info } = this.data
if (isT1DateRange || info.submitCount >= 2 || !((info.totalGrossSalary ?? '') === '')) return
this.setData({
'info.adoptType': value,
'info.manualFinalPerformanceAmount': ''
})
if (value == 1) {
const computedValue = NP.round(NP.times(NP.times(info.afterAttendanceTotalBasicSalary, 0.3), info.autoRewardCoefficient), 2)
this.setData({
'info.performanceSalary': computedValue,
'info.basicSalary': NP.plus(computedValue, info.baseSalary)
})
} else {
if (info.manualGradeCode) {
const performanceSalary = NP.round(NP.times(NP.times(info.afterAttendanceTotalBasicSalary, 0.3), info.manualRewardCoefficient), 2)
this.setData({
'info.performanceSalary': performanceSalary,
'info.basicSalary': NP.plus(performanceSalary, info.baseSalary)
})
} else {
this.setData({
'info.performanceSalary': 0,
'info.basicSalary': NP.plus(0, info.baseSalary)
})
}
}
},
// 提交
handleConfirm() {
let { info, T1EndDateStr, isT1DateRange } = this.data
if (isT1DateRange || info.submitCount >= 2 || !((info.totalGrossSalary ?? '') === '')) return
if (!((info.totalGrossSalary ?? '') === '')) { // 已出工资条 不能提交
return wx.showModal({
title: '提示',
content: '亲,总部已出首次工资条,如有问题请联系总部运营,统一增加扣减金额',
showCancel: false,
confirmText: '我知道了',
confirmColor: '#222222',
complete: (res) => {
}
})
}
if (info.submitCount < 2) {
if (info.adoptType == 2 && !info.manualGradeCode && !info.manualFinalPerformanceAmount) return wx.$util.showToast('请配置绩效评分')
wx.showModal({
title: '提交绩效确认',
content: `确认提交驻店销售的绩效考核评分吗?当前月${T1EndDateStr}号前可进行修改2次。`,
complete: (res) => {
if (res.confirm) {
wx.$util.showLoading()
let params = {
mobilePhone: info.mobilePhone,
evaluationMonth: info.evaluationMonth,
adoptType: info.adoptType,
amountCalculationType: info.adoptType == 2 && !((info.manualFinalPerformanceAmount ?? '') === '') ? 2 : 1,
manualGradeCode: info.adoptType == 2 ? info.manualGradeCode : '',
manualRewardCoefficient: info.adoptType == 2 ? info.manualRewardCoefficient : '',
manualScoreSymbolValue: info.adoptType == 2 ? info.manualScoreSymbolValue : '',
manualFinalPerformanceAmount: info.manualFinalPerformanceAmount || ''
}
api.singleSubmit(params).then(res => {
wx.$util.hideLoading()
let { code, message } = res
if (code == 0) {
this.getDetail(info.mobilePhone)
wx.showToast({
title: '提交成功',
icon: 'success'
})
} else {
wx.showModal({
title: '提示',
content: message,
showCancel: false,
confirmText: '我知道了',
confirmColor: '#222222'
})
}
})
}
}
})
} else {
wx.showModal({
title: '提示',
content: '亲,每月只有修改2次绩效次数,如有问题请联系总部运营,统一增加扣减金额',
showCancel: false,
confirmColor: '#222222',
confirmText: '我知道了',
complete: (res) => {
}
})
}
},
_getCurrentIndex() {
let { performanceList, currentMobile } = this.data
return performanceList.findIndex(item => item.mobilePhone == currentMobile)
},
// 上一位
handleLast() {
if (this.data.navigating) return
this.setData({ navigating: true })
let { performanceList } = this.data
const currentIndex = this._getCurrentIndex()
const prevPhone = performanceList[currentIndex - 1].mobilePhone
this.setData({
currentMobile: prevPhone,
showLastBtn: !this.checkIsFirstOrLast(performanceList, prevPhone).isFirst,
showNextBtn: !this.checkIsFirstOrLast(performanceList, prevPhone).isLast
})
this.getDetail(prevPhone)
},
// 下一位
handleNext() {
if (this.data.navigating) return
this.setData({ navigating: true })
let { performanceList } = this.data
const currentIndex = this._getCurrentIndex()
const nextPhone = performanceList[currentIndex + 1].mobilePhone
this.setData({
currentMobile: nextPhone,
showLastBtn: !this.checkIsFirstOrLast(performanceList, nextPhone).isFirst,
showNextBtn: !this.checkIsFirstOrLast(performanceList, nextPhone).isLast
})
this.getDetail(nextPhone)
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file
{
"usingComponents": {
"select-popup": "/packageWorkspace/components/selectPopup/selectPopup",
"level-rate": "../components/levelRate/levelRate",
"help-popup": "../components/helpPopup/helpPopup"
},
"navigationStyle": "custom"
}
\ No newline at end of file
/* packageWorkspace/pages/performanceRating/rateDetail/rateDetail.wxss */
page {
background: #F2F3F7;
}
.title {
max-length: 360rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.flex {
display: flex;
align-items: center;
}
.just-space {
justify-content: space-between;
}
.mar-t32 {
margin-top: 32rpx;
}
.mar-l32 {
margin-left: 32rpx;
}
.container {
padding: 12rpx 24rpx;
.blue {
color: #347BFF;
}
.help-icon {
width: 28rpx;
height: 28rpx;
flex-shrink: 0;
margin-left: 8rpx;
}
.content-box {
border-radius: 32rpx;
background: #ffffff;
padding: 24rpx 28rpx;
margin-bottom: 24rpx;
color: #222222;
font-size: 26rpx;
.content-title {
font-size: 28rpx;
color: #222222;
font-weight: 500;
margin-bottom: 16rpx;
.title-icon {
width: 6rpx;
height: 32rpx;
margin-right: 16rpx;
}
image {
width: 32rpx;
height: 32rpx;
flex-shrink: 0;
margin-right: 8rpx;
}
.left {
width: 6rpx;
height: 32rpx;
border-radius: 6rpx;
overflow: hidden;
background: #347bff33;
position: relative;
margin-right: 16rpx;
.left-top {
width: 6rpx;
height: 16rpx;
border-radius: 6rpx;
overflow: hidden;
background: linear-gradient(180deg, #2c66f7 0%, #389fff 100%);
position: absolute;
top: 0;
left: 0;
}
}
.tips {
margin-left: 16rpx;
color: #888888;
font-size: 22rpx;
}
}
.level-box {
margin-top: 16rpx;
border-radius: 16rpx;
background: #f2f7ff;
padding: 24rpx;
font-size: 28rpx;
color: #133667;
.box-title {
font-weight: 500;
}
.mr-16 {
margin: 16rpx 0;
}
.weight {
font-weight: 600;
margin-left: 8rpx;
}
.rule-box {
border-radius: 28rpx;
background: #ffffffb0;
padding: 4rpx 20rpx;
font-size: 22rpx;
color: #666666;
image {
width: 24rpx;
height: 24rpx;
}
}
}
.radio-box {
border-bottom: 2rpx solid #F2F3F5;
}
.radio-item {
margin: 16rpx 0 24rpx;
padding: 10rpx 0;
.radio {
width: 28rpx;
height: 28rpx;
box-sizing: border-box;
padding: 4rpx;
flex-shrink: 0;
margin-right: 12rpx;
border-radius: 50%;
border: 2rpx solid #D0D2D6;
}
image {
width: 32rpx;
height: 32rpx;
margin-right: 8rpx;
}
}
.manual-box {
border-radius: 20rpx;
background: #f7f8fa;
padding: 24rpx 20rpx;
font-size: 26rpx;
color: #222222;
.dot {
width: 12rpx;
height: 12rpx;
border-radius: 50%;
margin-right: 16rpx;
background: #347BFF;
}
.select {
margin: 12rpx 0 12rpx 28rpx;
height: 72rpx;
border-radius: 16rpx;
background: #FFFFFF;
border: 2rpx solid #EFF0F2;
color: #222222;
font-size: 28rpx;
font-weight: 500;
padding: 0 20rpx;
&.gary {
color: #999EA8;
font-weight: 400;
}
image {
width: 32rpx;
height: 32rpx;
}
}
.rate {
margin-left: 28rpx;
}
}
.input-content {
margin: 16rpx 0;
font-size: 28rpx;
color: #222222;
image {
width: 28rpx;
height: 28rpx;
flex-shrink: 0;
margin: 0 16rpx 0 8rpx;
}
.input-box {
width: 196rpx;
height: 72rpx;
line-height: 72rpx;
box-sizing: border-box;
padding: 0 20rpx;
position: relative;
border-radius: 16rpx;
border: 2rpx solid #eff0f2;
.input {
height: 72rpx;
line-height: 72rpx;
width: 100%;
font-weight: 700;
}
}
}
.input-tips {
font-size: 24rpx;
color: #888888;
line-height: 1.5;
}
.label {
font-weight: 500;
}
.unit {
margin: 0 4rpx;
font-size: 28rpx;
font-weight: 500;
&.font-s20{
font-size: 40rpx;
}
}
.price-box {
font-weight: 500;
color: #222222;
.left,.right {
flex: 1;
}
.price {
margin: 16rpx 0;
font-size: 40rpx;
font-family: "numberBold";
}
}
.fancy-divider {
position: relative;
width: 100%;
height: 1px;
background: #347bff80;
&::before {
content: '';
position: absolute;
left: 30rpx;
top: -10rpx;
width: 16rpx;
height: 16rpx;
background-color: #FFFFFF;
border: 2rpx solid #347bff80;
border-color: transparent transparent #347bff80 #347bff80;
transform: rotate(-45deg);
}
}
.base-box {
margin-top: 24rpx;
.comput-price {
margin-top: 16rpx;
font-size: 40rpx;
font-family: "numberBold";
}
}
.gross-price {
text-align: center;
font-family: "numberBold";
font-size: 68rpx;
}
}
.top {
display: flex;
align-items: center;
justify-content: space-between;
padding: 28rpx 32rpx;
.name {
font-size: 30rpx;
color: #222222;
font-weight: 500;
text {
font-size: 22rpx;
color: #999999;
font-weight: 400;
margin-left: 16rpx;
}
}
.merchant {
margin-top: 10rpx;
font-size: 26rpx;
color: #666666;
}
.bg-image {
margin: -24rpx 0;
width: 186rpx;
height: 138rpx;
}
}
.btn-box {
padding: 32rpx 40rpx 68rpx;
font-size: 32rpx;
.btn {
width: 100%;
height: 88rpx;
border-radius: 24rpx;
margin-bottom: 20rpx;
text-align: center;
line-height: 88rpx;
background: #FFFFFF;
&.confirm {
background: #2C66F7;
color: #FFFFFF;
font-weight: 500;
}
}
.btn-disabled {
opacity: .5;
}
}
.disabled {
background: #F7F8FA !important;
}
}
\ No newline at end of file
<!--packageWorkspace/pages/performanceRating/rateDetail/rateDetail.wxml-->
<navigation-bar class="navigation-header" bindnavbarReady="navbarReady" showBack="{{true}}" bindback="back">
<view class="title">{{info.name}}绩效评分</view>
</navigation-bar>
<view class="container" style="margin-top: {{navBarHeight}}px;">
<view class="content-box top">
<view>
<view class="name">{{info.name}}<text>{{info.entryDate || '-'}}入职</text></view>
<view class="merchant">{{info.merchantName || '-'}}</view>
</view>
<image class="bg-image" src="{{IMG_URL}}rate_bg_image.png" mode=""/>
</view>
<view class="content-box" wx:if="{{info.isAutoPerformance == 1}}">
<view class="content-title flex">
<image src="{{IMG_URL}}note-icon.png" mode=""/>
<text>系统检测到以下规则适用:</text>
</view>
<block wx:if="{{resultInfo.autoGradeType == 3 || resultInfo.autoGradeType == 4}}">
<view>1.非当月入职员工</view>
</block>
<block wx:else>
<view>1.当月入职员工</view>
<view>2.实际出勤≥{{resultInfo.monthOnboardAttendanceDays}}天<text class="blue">({{resultInfo.actualAttendanceDays}}天)</text></view>
<view>3.当月产值<{{resultInfo.monthOnboardOutputThreshold}}元 <text class="blue">(¥{{resultInfo.outputValue}})</text></view>
</block>
<view class="level-box">
<view class="flex just-space">
<view class="box-title">根据规则:</view>
<view class="rule-box flex" bindtap="goRule">
<text>查看规则</text>
<image src="{{IMG_URL}}arrow-left.png" mode=""/>
</view>
</view>
<view class="mr-16">绩效等级强制设为<text class="weight">{{resultInfo.autoGradeCode}}级</text></view>
<view>奖励系数强制设为<text class="weight">{{resultInfo.autoRewardCoefficient}}</text></view>
</view>
</view>
<view class="content-box">
<view class="content-title flex">
<image class="title-icon" src="{{IMG_URL}}title_icon.png" mode=""/>
<view>绩效评分</view>
<view class="tips">支持手动修改</view>
</view>
<view class="mar-t32">当前状态</view>
<view class="radio-box" style="padding-bottom: {{info.adoptType == 2 ? '16rpx' : ''}}">
<view class="radio-item flex" bindtap="changeRadio" data-value="1" wx:if="{{info.isAutoPerformance == 1}}">
<image wx:if="{{info.adoptType == 1}}" src="{{IMG_URL}}{{isT1DateRange || info.submitCount >= 2 ? 'radio-disabled' : 'radio-checked'}}.png" mode=""/>
<view wx:else class="radio {{isT1DateRange || info.submitCount >= 2 || info.totalGrossSalary != null ? 'disabled' : ''}}"></view>
<view class="label">系统自动设置</view>
<view style="margin-left: 8rpx;" wx:if="{{info.adoptType == 1 && info.autoGradeCode == 'D'}}"><level-rate info="{{autoInfo}}" hideStar="{{true}}" /></view>
</view>
<view wx:if="{{info.adoptType == 1 && info.autoGradeCode != 'D'}}"><level-rate info="{{autoInfo}}" /></view>
<view class="radio-item flex" bindtap="changeRadio" data-value="2">
<image wx:if="{{info.adoptType == 2}}" src="{{IMG_URL}}{{isT1DateRange || info.submitCount >= 2 ? 'radio-disabled' : 'radio-checked'}}.png" mode=""/>
<view wx:else class="radio {{isT1DateRange || info.submitCount >= 2 || info.totalGrossSalary != null ? 'disabled' : ''}}"></view>
<view class="label">手动设置评分</view>
</view>
<block wx:if="{{info.adoptType == 2}}">
<view class="manual-box">
<view class="flex">
<view class="dot"></view>
<view>手动评分</view>
</view>
<view class="select flex just-space {{info.manualGradeCode ? '' : 'gary'}} {{isT1DateRange || info.submitCount >= 2 || info.totalGrossSalary != null ? 'disabled' : ''}}" bindtap="selectLevelCode">
{{info.manualGradeCode || '请选择等级'}}
<image src="{{IMG_URL}}expand_icon.png" mode=""/>
</view>
<view class="blue rate">
<text>评分:</text>
<text>{{info.manualScoreSymbolValue || 0}}分</text>
<text class="mar-l32">系数:</text>
<text>{{info.manualRewardCoefficient || '0'}}</text>
</view>
</view>
</block>
</view>
<!-- <block wx:if="{{info.adoptType == 2}}"> -->
<view class="input-content flex">
<view>手动维护最终绩效金额</view>
<image src="{{IMG_URL}}caption-icon.png" class="help-icon" bindtap="handleHelpPopup" mode=""/>
<view class="input-box flex {{isT1DateRange || info.submitCount >= 2 || info.totalGrossSalary != null ? 'disabled' : ''}}">
<input class="input" disabled="{{isT1DateRange || info.submitCount >= 2 || info.totalGrossSalary != null}}" placeholder="请输入" value="{{info.manualFinalPerformanceAmount}}" placeholder-style="color: #999EA8;font-weight: 400;" bindinput="priceInput" type="digit"/>
<view>元</view>
</view>
</view>
<view class="input-tips">根据系数算出绩效,如觉得绩效金额不合适,可<text class="blue">手动输入</text>最终绩效金额</view>
<!-- </block> -->
</view>
<view class="content-box">
<view class="content-title flex">
<image class="title-icon" src="{{IMG_URL}}title_icon.png" mode=""/>
<view>工资</view>
<view class="tips">当前收入是预估的,可在收到工资条后发起考勤等申诉</view>
</view>
<view class="flex price-box">
<view class="left">
<view class="flex"><view class="label">绩效工资</view><image class="help-icon" bindtap="handleHelpPopup" src="{{IMG_URL}}caption-icon.png" mode=""/></view>
<view class="price blue">{{info.performanceSalary}}<text class="unit blue">元</text></view>
</view>
<view class="right">
<view class="flex"><view class="label">底薪</view><image class="help-icon" bindtap="handleHelpPopup" src="{{IMG_URL}}caption-icon.png" mode=""/></view>
<view class="price blue">{{info.baseSalary}}<text class="unit blue">元</text></view>
</view>
</view>
<view class="fancy-divider"></view>
<view class="base-box">
<view class="flex"><view class="label">基本工资</view><image class="help-icon" bindtap="handleHelpPopup" src="{{IMG_URL}}caption-icon.png" mode=""/></view>
<view class="comput-price">{{info.performanceSalary}}<text class="unit font-s20">+</text>{{info.baseSalary}}<text class="unit font-s20">=</text><text class="blue">{{info.basicSalary}}</text><text class="blue unit">元</text></view>
</view>
</view>
<view class="content-box">
<view class="content-title flex">
<image class="title-icon" src="{{IMG_URL}}title_icon.png" mode=""/>
<view>合计应发工资</view>
<view class="tips">工资条上的金额</view>
</view>
<block wx:if="{{info.totalGrossSalary}}">
<view class="gross-price blue">{{info.totalGrossSalary}}<text class="unit">元</text></view>
</block>
<block wx:else>
<empty-data emptyText="总部运营-薪酬专员 未出工资条" />
</block>
</view>
<view class="btn-box">
<view class="btn confirm {{isT1DateRange || info.submitCount >= 2 || info.totalGrossSalary != null ? 'btn-disabled' : ''}}" bindtap="handleConfirm">提交</view>
<view class="btn" bindtap="handleLast" wx:if="{{showLastBtn}}">上一位</view>
<view class="btn" bindtap="handleNext" wx:if="{{showNextBtn}}">下一位</view>
</view>
</view>
<select-popup show="{{ showSelectPopup }}" options="{{ selectOptions }}" multiple="{{ selectMultiple }}" values="{{ selectValues }}" value="{{ selectValue }}" bindconfirm="handlePopupConfirm" title="{{ selectTitle }}" bindcancel="hideSelectPopup" customIsTab="{{ true }}"></select-popup>
<help-popup show="{{showHelpPopup}}" />
\ No newline at end of file
// packageWorkspace/pages/performanceRating/rateList/retaList.js
const __NOW__ = new Date()
const __CUR_YM_TS__ = new Date(__NOW__.getFullYear(), __NOW__.getMonth() - 1, 1).getTime()
const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/miniprogram/regional-assistant/'
const sysInfo = wx.getSystemInfoSync()
const rpxToPx = sysInfo.screenWidth / 750
import {statusMap, statusList, levelList, levelMap, starCountObj} from '~/packageWorkspace/pages/performanceRating/constant'
import dayjs from 'dayjs'
import api from '../api'
Page({
/**
* 页面的初始数据
*/
data: {
IMG_URL,
monthText: `${dayjs(__CUR_YM_TS__).format('YYYY年MM月')}`,
maxMonthDate: new Date(__NOW__.getFullYear(), __NOW__.getMonth(), 1).getTime(),
monthPickerValue: __CUR_YM_TS__,
pendingMonthValue: 0,
showRule: false,
rulesData: {
performanceLevelDetailDTOS: [],
autoPerformRuleDetailDTO: {}
},
row1: [
{ label: '总人数', key: 'totalCount', value: 0 },
{ label: '当月入职人数', key: 'entryCount', value: 0 }
],
row2: [
{ label: 'S', key: 'scount' },
{ label: 'A', key: 'acount' },
{ label: 'B+', key: 'bplusCount' },
{ label: 'B', key: 'bcount' },
{ label: 'B-', key: 'bminusCount' },
{ label: 'C', key: 'ccount' },
{ label: 'D', key: 'dcount' }
],
staticsData: {},
filterObj: {
performanceLevel: '',
handleStatus: ''
},
statusMap: statusMap,
levelList: levelList,
statusList: statusList,
levelMap: levelMap,
starCountObj: starCountObj,
list: []
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
const query = wx.createSelectorQuery().in(this)
query.select('.sticky-box').boundingClientRect()
query.exec(res => {
this.setData({
stickyRectTop: res[0]?.top
})
})
let { levelList, statusList } = this.data
this.setData({
levelList: [{name: '全部', value: ''}].concat(levelList),
statusList: [{name: '全部', value: ''}].concat(statusList)
})
},
/**
......@@ -26,9 +78,316 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow() {
this.getStatics()
this.search()
},
input(e) {
let { value } = e.detail
this.setData({merchantAndStaffSearch: value})
},
clear() {
this.setData({
merchantAndStaffSearch: ''
}, () => {
this.search()
})
},
search() {
this.setData({
list: [],
flag: false,
nothing: false,
})
this.getList()
},
// 获取列表数据
getList() {
let { filterObj, merchantAndStaffSearch, monthPickerValue, isSticky, stickyRectTop, ruleCardHeight, showRule } = this.data
wx.$util.showLoading()
api.getPerformanceList({queryMonth: dayjs(monthPickerValue).format('YYYY-MM'), merchantAndStaffSearch, performanceLevel: filterObj.performanceLevel, handleStatus: filterObj.handleStatus}).then(res => {
wx.$util.hideLoading()
let {
code,
data,
message
} = res
if (code == 0) {
data?.forEach(val => {
val.performanceLevel = val.manualGradeCode || val.autoGradeCode || '',
val.coefficient = val.manualRewardCoefficient || `${val.autoRewardCoefficient}` || '',
val.symbolValue = val.manualScoreSymbolValue?.replace('=', '') || val.autoScoreSymbolValue?.replace('=', '') || ''
})
if (data?.length) {
this.setData({
list: data
}, () => {
if (isSticky) {
setTimeout(() => {
this.setData({
scrollTop: (showRule ? ruleCardHeight : 0) + stickyRectTop - 88 * rpxToPx
})
}, 200)
}
})
}
} else {
wx.$util.showToast(message)
}
this.setData({
flag: true,
triggered: false,
nothing: true
})
})
},
scrollonReachBottom() {
this.getList()
},
openMonthPicker() {
this.setData({ monthPickerShow: true, pendingMonthValue: this.data.monthPickerValue })
},
closeMonthPicker() {
this.setData({ monthPickerShow: false })
},
popupConfirm() {
const val = this.data.pendingMonthValue || this.data.monthPickerValue
if (val) {
const d = new Date(val)
this.setData({
monthPickerValue: val,
monthText: `${d.getFullYear()}年${d.getMonth() + 1}月`,
boardMonthActive: true,
boardScopeActive: false
}, () => {
this.getRule()
this.search()
this.getStatics()
this.isHistoryMonth()
})
}
this.closeMonthPicker()
},
cancel() {
this.closeMonthPicker()
},
onMonthChange(e) {
const values = e.detail.getValues()
const year = Number(String(values?.[0] || '').replace(/[年月日时分]/g, ''))
const month = Number(String(values?.[1] || '').replace(/[年月日时分]/g, ''))
if (!year || !month) return
const ts = new Date(year, month - 1, 1).getTime()
this.setData({ pendingMonthValue: ts })
},
// 展示规则说明
handleRuleShow() {
// 获取月份绩效规则
this.getRule(true)
},
getRule(flag) {
let { monthPickerValue } = this.data
api.getPerformanceRule({queryMonth: dayjs(monthPickerValue).format('YYYY-MM')}).then(res => {
let { code, data, message } = res
if (code == 0) {
data?.performanceLevelDetailDTOS?.forEach(val => {
val.rewardCoefficient = !((val.rewardCoefficient ?? '') === '') ? val.rewardCoefficient : ''
})
this.setData({
rulesData: data || {}
}, () => {
if (flag) {
this.setData({showRule: true, scrollTop: 0})
const query = wx.createSelectorQuery().in(this)
query.select('.rule-card').boundingClientRect()
query.exec(res => {
this.setData({
ruleCardHeight: res[0]?.height
})
})
}
})
} else {
wx.$util.showToast(message)
}
})
},
isHistoryMonth() {
const now = new Date()
const { monthPickerValue } = this.data
const currentYear = now.getFullYear()
const currentMonth = now.getMonth()
let lastYear, lastMonth;
if (currentMonth === 0) {
lastYear = currentYear - 1
lastMonth = 12
} else {
lastYear = currentYear
lastMonth = currentMonth
}
const lastMonthStr = `${lastYear}-${String(lastMonth).padStart(2, '0')}`
this.setData({
isHistoryMonthFlag: dayjs(monthPickerValue).format('YYYY-MM') !== lastMonthStr
})
return dayjs(monthPickerValue).format('YYYY-MM') !== lastMonthStr
},
isExpired(endDateStr) {
const now = new Date()
const endDate = new Date(endDateStr)
if (now > endDate) {
return true
}
},
// 批量操作
handleBatch() {
let {monthPickerValue} = this.data
wx.$util.showLoading()
api.getPerformanceTimeCycle({}).then(res => {
wx.$util.hideLoading()
let { code, data, message } = res
if (code == 0) {
const T1EndDate = data?.find(val => val.cycleCode == 'T1')?.endDate
if (this.isExpired(T1EndDate) || this.isHistoryMonth()) {
return wx.showModal({
title: '提示',
content: '亲,记得在运营配置的T1周期内来评绩效哦',
showCancel: false,
confirmText: '我知道了',
confirmColor: '#222222',
complete: (res) => {
}
})
} else {
wx.navigateTo({
url: `/packageWorkspace/pages/performanceRating/batchOperation/batchOperation?queryMonth=${dayjs(monthPickerValue).format('YYYY-MM')}`,
})
}
} else {
wx.$util.showToast(message)
}
})
},
// 获取统计数据
getStatics() {
let {monthPickerValue} = this.data
api.getPerformanceStatistics({queryMonth: dayjs(monthPickerValue).format('YYYY-MM')}).then(res => {
this.setData({
staticsData: res?.data || {}
})
})
},
// 收起规则
handleRuleClose() {
this.setData({
showRule: false,
scrollTop: 0
})
},
// 重置筛选条件
handleFilterReset() {
this.setData({
filterObj: {
performanceLevel: '',
handleStatus: ''
}
}, () => {
this.search()
})
},
onScroll(e) {
const query = wx.createSelectorQuery().in(this)
query.select('.sticky-box').boundingClientRect()
query.select('.top-box').boundingClientRect()
query.exec(res => {
const stickyRect = res[0]
const topRect = res[1]
if (!stickyRect || !topRect) return
const marginTopPx = 8 * rpxToPx
// 判断 sticky-box 是否“吸顶”
const stickyThreshold = topRect.top + topRect.height + marginTopPx
if (stickyRect.top <= stickyThreshold) {
// 已吸顶
this.setData({ isSticky: true, stickyThreshold: stickyThreshold })
} else {
this.setData({ isSticky: false })
}
})
},
// 选择绩效等级
handleLevelFilter() {
let {
filterObj,
levelList
} = this.data
console.log(levelList)
this.setData({
showSelectPopup: true,
selectOptions: levelList,
selectTitle: '绩效',
selectMultiple: false,
selectValue: [filterObj.performanceLevel],
selectType: 'performanceLevel'
})
},
// 选择处理状态
handleStatusFilter() {
let {
filterObj,
statusList
} = this.data
this.setData({
showSelectPopup: true,
selectOptions: statusList,
selectTitle: '处理状态',
selectMultiple: false,
selectValue: [filterObj.handleStatus],
selectType: 'handleStatus'
})
},
handlePopupConfirm(e) {
let { values } = e.detail
let { selectType } = this.data
this.setData({
[`filterObj.${selectType}`]: values[0]
}, () => {
this.search()
this.hideSelectPopup()
})
},
hideSelectPopup() {
this.setData({
showSelectPopup: false
})
},
// 查看
handleDetail(e) {
let { target } = e.currentTarget.dataset
let { monthPickerValue } = this.data
wx.navigateTo({
url: `/packageWorkspace/pages/performanceRating/rateDetail/rateDetail?mobilePhone=${target.mobilePhone}&queryMonth=${dayjs(monthPickerValue).format('YYYY-MM')}`,
})
},
// 编辑
handleEdit(e) {
let { target } = e.currentTarget.dataset
let { monthPickerValue } = this.data
wx.navigateTo({
url: `/packageWorkspace/pages/performanceRating/rateEdit/rateEdit?mobilePhone=${target.mobilePhone}&queryMonth=${dayjs(monthPickerValue).format('YYYY-MM')}`,
})
},
/**
* 生命周期函数--监听页面隐藏
*/
......
{
"usingComponents": {}
"usingComponents": {
"van-datetime-picker": "@vant/weapp/datetime-picker/index",
"level-rate": "../components/levelRate/levelRate",
"select-popup": "/packageWorkspace/components/selectPopup/selectPopup",
"van-rate": "@vant/weapp/rate/index"
},
"navigationBarTitleText": "绩效考核评分"
}
\ No newline at end of file
/* packageWorkspace/pages/performanceRating/rateList/retaList.wxss */
\ No newline at end of file
/* packageWorkspace/pages/performanceRating/rateList/retaList.wxss */
page {
background: #F2F3F7;
}
.ratelist {
.flex {
display: flex;
align-items: center;
}
.top-box {
background: #FFF;
width: 100%;
height: var(--fontSize88);
padding: 0 var(--fontSize32);
justify-content: space-between;
box-sizing: border-box;
.date-box {
width: var(--fontSize286);
height: var(--fontSize64);
border-radius: var(--fontSize40);
background: #f2f3f5;
font-size: var(--fontSize32);
color: #222222;
justify-content: center;
image {
width: var(--fontSize32);
height: var(--fontSize32);
}
}
.btn-box {
font-size: 28rpx;
image {
width: 32rpx;
height: 32rpx;
margin-right: 8rpx;
}
.note {
margin-right: 16rpx;
}
}
}
.container {
box-sizing: border-box;
height: calc(100vh - var(--fontSize88));
.rule-card {
background: #FFFFFF;
padding: 24rpx;
border-radius: 0 0 32rpx 32rpx;
.title {
font-size: 28rpx;
color: #222222;
font-weight: 500;
margin-bottom: 32rpx;
image {
width: 32rpx;
height: 32rpx;
flex-shrink: 0;
margin-right: 8rpx;
}
}
.box {
font-size: 24rpx;
color: #777777;
margin-bottom: 32rpx;
.box-title {
font-size: 26rpx;
color: #222222;
margin-bottom: 16rpx;
}
}
.arrow-btn {
justify-content: center;
font-size: 24rpx;
color: #999999;
image {
width: 32rpx;
height: 32rpx;
transform: rotate(-90deg);
margin-left: 8rpx;
}
}
}
.empty-box {
width: 100%;
height: 16rpx;
}
.top {
margin: 0 24rpx 16rpx;
.title {
font-size: 26rpx;
color: #222222;
margin-bottom: 16rpx;
.tips {
color: #666666;
font-size: 24rpx;
margin-left: 8rpx;
}
}
.card-row {
display: flex;
flex-wrap: wrap;
gap: 16rpx;
margin-bottom: 16rpx;
&.card-row2 {
display: grid;
grid-template-columns: repeat(4, 1fr);
margin-bottom: 0;
}
.card {
flex: 1;
display: flex;
flex-flow: column;
justify-content: center;
align-items: center;
height: 128rpx;
border-radius: 24rpx;
background: #ffffff;
.label {
font-size: 24rpx;
color: #666666;
}
.value {
font-size: 36rpx;
color: #0066ff;
font-weight: bold;
margin-top: 10rpx;
}
}
}
}
.list-box {
margin: 24rpx;
min-height: 100%;
.sticky-box {
position: sticky;
top: 0;
margin: -16rpx -24rpx 0;
padding: 16rpx 24rpx;
z-index: 99;
background: #F2F3F7;
}
.is-sticky {
background: #FFFFFF;
.search-input {
background: #f7f8fa;
}
.filter-item {
background: #f7f8fa !important;
}
}
.search-input {
background: #ffffff;
border-radius: var(--fontSize38);
width: 100%;
height: var(--fontSize72);
display: flex;
align-items: center;
margin-bottom: 16rpx;
.search-icon {
width: var(--fontSize28);
height: var(--fontSize28);
margin: 0 var(--fontSize10) 0 var(--fontSize26);
}
.search-clear {
width: var(--fontSize36);
height: var(--fontSize36);
margin: 0 var(--fontSize26) 0 var(--fontSize10);
}
.input {
font-size: var(--fontSize28);
height: var(--fontSize38);
line-height: var(--fontSize38);
width: calc(100% - var(--fontSize136));
}
.input-placeholder {
color: #BBBBBB;
}
}
.filter-box {
justify-content: space-between;
.filter-item {
height: 56rpx;
border-radius: 56rpx;
background: #ffffff;
padding: 0 16rpx 0 24rpx;
font-size: 26rpx;
color: #666666;
margin-right: 16rpx;
&.active {
color: #2C66F7;
}
text {
line-height: 40rpx;
}
image {
width: 32rpx;
height: 32rpx;
flex-shrink: 0;
margin-left: 8rpx;
}
}
.reset-btn {
color: #222222;
font-size: 26rpx;
}
}
.list {
.item {
border-radius: 32rpx;
background: #ffffff;
margin-bottom: 24rpx;
padding: 32rpx;
.item-top {
display: flex;
align-items: center;
justify-content: space-between;
font-size: 32rpx;
color: #222222;
margin-bottom: 24rpx;
.name {
max-width: calc(100% - 110rpx);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-weight: 500;
}
.status {
font-size: 24rpx;
padding: 0 12rpx;
height: 44rpx;
line-height: 44rpx;
border-radius: 8rpx;
}
}
.list-item {
display: flex;
align-items: center;
margin-bottom: 12rpx;
font-size: 28rpx;
.label {
width: 144rpx;
flex-shrink: 0;
margin-right: 32rpx;
color: #999999;
}
.split {
margin: 0 8rpx;
}
.score {
margin-left: 12rpx;
}
}
.btn-box {
justify-content: flex-end;
margin-top: 24rpx;
.btn {
width: 168rpx;
height: 64rpx;
line-height: 64rpx;
border-radius: 16rpx;
background: #2c66f71a;
text-align: center;
color: #2C66F7;
font-size: 26rpx;
}
.primary {
color: #FFFFFF;
margin-left: 24rpx;
background: #2C66F7;
}
}
}
}
}
}
}
\ No newline at end of file
<!--packageWorkspace/pages/performanceRating/rateList/retaList.wxml-->
<text>packageWorkspace/pages/performanceRating/rateList/retaList.wxml</text>
\ No newline at end of file
<view class="ratelist">
<view class="top-box flex">
<view class="date-box flex" bindtap="openMonthPicker">
<text>{{monthText}}</text>
<image src="{{IMG_URL}}expand_icon.png" mode=""/>
</view>
<view class="flex btn-box">
<view class="note flex" bindtap="handleRuleShow">
<image src="{{IMG_URL}}note-icon.png" mode=""/>
<view>规则说明</view>
</view>
<view class="flex" bindtap="handleBatch">
<image src="{{IMG_URL}}batch-icon.png" mode=""/>
<view>批量操作</view>
</view>
</view>
</view>
<scroll-view class="container" scroll-y show-scrollbar="{{false}}" scroll-top="{{scrollTop}}" enhanced="true" bindscroll="onScroll">
<view class="rule-card" wx:if="{{showRule}}">
<view class="title flex"><image src="{{IMG_URL}}overview-icon.png" mode=""/>绩效评分规则总览</view>
<view class="box" wx:if="{{rulesData.autoPerformRuleDetailDTO.isAutoPerform == 1}}">
<view class="box-title">当月入职新员工规则</view>
<view class="box-content"><view>当月入职,出勤≥{{rulesData.autoPerformRuleDetailDTO.monthOnboardAttendanceDays}}天,产值<{{rulesData.autoPerformRuleDetailDTO.monthOnboardOutputThreshold}}元 → 自动{{rulesData.autoPerformRuleDetailDTO.monthOnboardTriggerLevelCode}}级(系数:{{rulesData.autoPerformRuleDetailDTO.monthOnboardTriggerRewardCoefficient}})</view>除上述规则以外,当月入职的新员工绩效默认为【{{rulesData.autoPerformRuleDetailDTO.monthOnboardDefaultLevelCode}}】</view>
</view>
<view class="box">
<view class="box-title">常规评分规则</view>
<block wx:for="{{rulesData.performanceLevelDetailDTOS}}" wx:key="index">
<view style="margin-bottom: 24rpx;">
<level-rate info="{{item}}" />
</view>
</block>
</view>
<view class="box" wx:if="{{rulesData.autoPerformRuleDetailDTO.isAutoPerform == 1}}">
<view class="box-title">非当月入职新员工规则</view>
<view class="box-content"><view>当月总产值<{{rulesData.autoPerformRuleDetailDTO.noMonthOnboardOutputThreshold}}元 → 自动{{rulesData.autoPerformRuleDetailDTO.noMonthOnboardTriggerLevelCode}}级(系数:{{rulesData.autoPerformRuleDetailDTO.noMonthOnboardTriggerRewardCoefficient}})</view>除上述规则以外,当月入职的新员工绩效默认为【{{rulesData.autoPerformRuleDetailDTO.noMonthOnboardDefaultLevelCode}}】</view>
</view>
<view class="arrow-btn flex"><view class="flex" bindtap="handleRuleClose">收起规则<image src="{{IMG_URL}}arrow-left.png" mode=""/></view></view>
</view>
<view class="empty-box"></view>
<view class="top">
<view class="title">统计卡片<text class="tips">规则影响统计</text></view>
<view class="card-row">
<view wx:for="{{row1}}" wx:key="index" class="card">
<text class="label">{{item.label}}</text>
<text class="value">{{staticsData[item.key] || 0}}</text>
</view>
</view>
<view class="card-row card-row2">
<view wx:for="{{row2}}" wx:key="index" class="card">
<text class="label">{{item.label}}</text>
<text class="value">{{staticsData[item.key] || 0}}</text>
</view>
</view>
</view>
<view class="list-box">
<view class="sticky-box {{isSticky ? 'is-sticky' : ''}}">
<view class="search-box">
<view class="search-input">
<image src="/images/search.png" class="search-icon" />
<input type="text" placeholder="门店/员工姓名" class="input" value="{{ merchantAndStaffSearch }}" placeholder-class="input-placeholder" bindinput="input" bindconfirm="search" />
<block wx:if="{{ merchantAndStaffSearch }}">
<image src="/images/clear.png" class="search-clear" bindtap="clear" />
</block>
</view>
</view>
<view class="filter-box flex">
<view class="flex">
<view class="filter-item flex {{filterObj.performanceLevel ? 'active': ''}}" bindtap="handleLevelFilter">
<text>{{levelMap[filterObj.performanceLevel]}}</text><image src="{{IMG_URL}}{{filterObj.performanceLevel ? 'expand_icon_blue' : 'expand_icon'}}.png" mode=""/>
</view>
<view class="filter-item flex {{filterObj.handleStatus ? 'active': ''}}" bindtap="handleStatusFilter">
<text>{{statusMap[filterObj.handleStatus].name}}</text><image src="{{IMG_URL}}{{filterObj.handleStatus ? 'expand_icon_blue' : 'expand_icon'}}.png" mode=""/>
</view>
</view>
<view class="reset-btn" bindtap="handleFilterReset">重置</view>
</view>
</view>
<view class="list" style="min-height: 300rpx;">
<view wx:if="{{isSticky}}" class="empty-box"></view>
<block wx:if="{{ list.length > 0 }}">
<block wx:for="{{ list }}" wx:key="index">
<view class="item content">
<view class="item-top">
<view class="name">{{item.name}}</view>
<view class="status text-center" style="color:{{ statusMap[item.handleStatus].color }};background-color:{{statusMap[item.handleStatus].background }};">
{{statusMap[item.handleStatus].name }}
</view>
</view>
<view class="list-item">
<view class="label">入职门店</view>
<view class="value">{{item.merchantName || '-'}}</view>
</view>
<view class="list-item">
<view class="label">绩效分数</view>
<block wx:if="{{item.performanceLevel}}">
<van-rate readonly value="{{ starCountObj[item.performanceLevel] }}" count="{{6}}" void-icon="star" size="16px" void-color="#DEE0E3" color="#FFB742" />
<view class="score">{{item.symbolValue}}分</view>
</block>
<block wx:else>-</block>
</view>
<view class="list-item">
<view class="label">绩效等级</view>
<block wx:if="{{item.performanceLevel}}">
<view class="value"><text wx:if="{{item.performanceLevel}}">{{item.performanceLevel}}级</text><text wx:if="{{item.performanceLevel && item.coefficient}}" class="split">|</text><text wx:if="{{item.coefficient}}">系数{{item.coefficient}}</text></view>
</block>
<block wx:else>-</block>
</view>
<view class="btn-box flex">
<view bindtap="handleDetail" data-target="{{item}}" class="btn">查看</view>
<view bindtap="handleEdit" data-target="{{item}}" wx:if="{{!isHistoryMonthFlag}}" class="btn primary">编辑{{(2 - item.submitCount)}}/2</view>
</view>
</view>
</block>
<block wx:if="{{ nothing }}">
<view class="list-nothing">到底了~</view>
</block>
<view class="empty-box" style="height: 80rpx;"></view>
</block>
<block wx:else>
<empty-data />
</block>
</view>
</view>
</scroll-view>
</view>
<popup bind:hidePopup="cancel" bind:confirm="popupConfirm" customPopupSlotStyle="{{'height: calc(100% - 210rpx)'}}" show="{{monthPickerShow}}" title="选择月份" height="60%">
<van-datetime-picker
id="datePicker"
type="year-month"
model:value="{{pendingMonthValue}}"
max-date="{{maxMonthDate}}"
show-toolbar="{{false}}"
bind:change="onMonthChange"
/>
</popup>
<select-popup show="{{ showSelectPopup }}" options="{{ selectOptions }}" multiple="{{ selectMultiple }}" values="{{ selectValues }}" value="{{ selectValue }}" bindconfirm="handlePopupConfirm" title="{{ selectTitle }}" bindcancel="hideSelectPopup" customIsTab="{{ true }}"></select-popup>
\ No newline at end of file
import api from '../api'
// packageWorkspace/pages/performanceRating/ruleNote/rulwNote.js
const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/miniprogram/regional-assistant/'
Page({
/**
* 页面的初始数据
*/
data: {
IMG_URL,
title: '',
ruleInfo: {}
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.getAutoResult(options)
this.setData({
title: ['1', '2'].includes(options.autoGradeType) ? '新员工绩效 · 规则详情' : ['3', '4'] ? '老员工绩效 · 规则详情' : '无启用自动评绩效规则详情'
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
getAutoResult(options) {
api.getPerformanceRule({queryMonth: options.queryMonth}).then(res => {
let { code, data, message } = res
if (code == 0) {
if (['1', '2'].includes(options.autoGradeType)) {
this.setData({
ruleInfo: {
autoGradeType: options.autoGradeType,
days: data?.autoPerformRuleDetailDTO?.monthOnboardAttendanceDays,
threshold: data?.autoPerformRuleDetailDTO?.monthOnboardOutputThreshold,
levelCode: data?.autoPerformRuleDetailDTO?.monthOnboardTriggerLevelCode,
coefficient: data?.autoPerformRuleDetailDTO?.monthOnboardTriggerRewardCoefficient,
defaultLevelCode: data?.autoPerformRuleDetailDTO?.monthOnboardDefaultLevelCode
}
})
} else if (['3', '4'].includes(options.autoGradeType)) {
this.setData({
ruleInfo: {
autoGradeType: options.autoGradeType,
threshold: data?.autoPerformRuleDetailDTO?.noMonthOnboardOutputThreshold,
levelCode: data?.autoPerformRuleDetailDTO?.noMonthOnboardTriggerLevelCode,
coefficient: data?.autoPerformRuleDetailDTO?.noMonthOnboardTriggerRewardCoefficient,
defaultLevelCode: data?.autoPerformRuleDetailDTO?.noMonthOnboardDefaultLevelCode
}
})
}
} else {
wx.$util.showToast(message)
}
})
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file
{
"usingComponents": {},
"navigationBarTitleText": "规则说明"
}
\ No newline at end of file
/* packageWorkspace/pages/performanceRating/ruleNote/rulwNote.wxss */
page {
background: #F2F3F7;
}
.note-page {
.bg {
position: absolute;
right: 0;
top: 0;
width: 264rpx;
height: 196rpx;
z-index: -1;
}
.title {
text-align: center;
font-size: 32rpx;
color: #222222;
font-weight: 500;
margin: 40rpx auto 28rpx;
}
.container {
min-height: calc(100vh - 224rpx);
margin: 0 24rpx;
border-radius: 32px;
background: linear-gradient(0deg, #ffffff 88%, #ffffffb3 100%);
backdrop-filter: blur(8rpx);
padding: 32rpx;
.cont-title {
display: flex;
align-items: center;
color: #0755E6;
font-size: 28rpx;
font-weight: 500;
margin-bottom: 24rpx;
.dot {
width: 25rpx;
height: 25rpx;
background: #347BFF;
border-radius: 50%;
flex-shrink: 0;
margin-right: 12rpx;
}
}
.content {
margin-bottom: 40rpx;
font-size: 26rpx;
color: #333333;
line-height: 1.5;
&.mb-0 {
margin-bottom: 0;
}
.mb-24 {
margin-bottom: 24rpx;
}
.gray {
color: #888888;
}
}
}
.empty-box {
width: 100%;
height: 50rpx;
}
}
\ No newline at end of file
<!--packageWorkspace/pages/performanceRating/ruleNote/rulwNote.wxml-->
<view class="note-page">
<view class="bg"><image src="{{IMG_URL}}rate_bg_image.png" mode=""/></view>
<view class="title">{{title}}</view>
<view class="container">
<!-- 自动设置规则 -->
<block wx:if="{{ruleInfo.autoGradeType}}">
<view class="cont-title"><view class="dot"></view>自动设置规则</view>
<view class="content">
<view class="mb-24">
<view>适用条件(同时满足):</view>
<view>1.<text wx:if="{{ruleInfo.autoGradeType == 3 || ruleInfo.autoGradeType == 4}}">非</text>当月入职员工</view>
<view wx:if="{{ruleInfo.autoGradeType == 1 || ruleInfo.autoGradeType == 2}}">2.实际出勤天数 ≥ {{ruleInfo.days}}天</view>
<view><text>{{ruleInfo.autoGradeType == 1 || ruleInfo.autoGradeType == 2 ? 3 : 2}}</text>.当月总产值 < {{ruleInfo.threshold}}元</view>
</view>
<view class="mb-24">
<view>自动设置:</view>
<view>· 绩效等级:{{ruleInfo.levelCode}}级</view>
<view>· 奖励系数:{{ruleInfo.coefficient}}</view>
</view>
<view>
<view>例外情况:</view>
<view wx:if="{{ruleInfo.autoGradeType == 1 || ruleInfo.autoGradeType == 2}}">· 出勤 < {{ruleInfo.days}}天 → 按实际出勤比例计算</view>
<view>· 除上述规则以外,{{ruleInfo.autoGradeType == 1 || ruleInfo.autoGradeType == 2 ? '当月入职的新员工' : '非当月入职的员工'}}绩效默认为【{{ruleInfo.defaultLevelCode}}】</view>
</view>
</view>
</block>
<!-- 数据来源 -->
<block>
<view class="cont-title"><view class="dot"></view>数据来源说明</view>
<view class="content">
<view class="mb-24">
<view>出勤数据:企微考勤系统</view>
<view>计算方式:有效打卡天数</view>
</view>
<view class="mb-24">
<view>产值数据:业务系统</view>
<view>包含:订单总额</view>
</view>
<view class="mb-24">
<view>入职数据:北森HR系统</view>
<view>判端标准:入职日期</view>
</view>
</view>
</block>
<!-- 影响说明 -->
<block wx:if="{{ruleInfo.autoGradeType}}">
<view class="cont-title"><view class="dot"></view>影响说明</view>
<view class="content mb-0">
<view class="mb-24">对薪资的影响:</view>
<view class="mb-24 gray">
<view>底薪:正常计算(有疑问可让驻店销售走考勤申诉通道)</view>
<view>绩效工资:0</view>
<view>基本工资 = 底薪 + 0</view>
</view>
<view class="mb-24">可手动调整</view>
<view class="gray">区域经理可手动修改评分,也可手工维护最终一个绩效金额</view>
</view>
</block>
</view>
<view class="empty-box"></view>
</view>
\ No newline at end of file
// packageWorkspace/pages/refundApply/refundApply.js
import { getSubOrderInfoAPI, auditRefundAllpyAPI, getRefundDetailInfoAPI, getRefundStatusAPI, getRefundLogByOrderCodeAPI} from './api'
import {
getSubOrderInfoAPI,
auditRefundAllpyAPI,
getRefundDetailInfoAPI,
getRefundStatusAPI,
getRefundLogByOrderCodeAPI
} from './api'
import refundAPI from './api'
import NP from 'number-precision'
import api from '~/api/api.js'
import reportPageTrackMixin from '~/mixins/reportPageTrackMixin'
const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/'
const IMG_URL =
'https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/'
let toastList = {
payee: "收款人姓名不能为空",
openAccBankName: "开户行名称不能为空",
openAccBranchBankName: "开户支行名称不能为空",
bankAccountNo: "银行卡号不能为空",
remark: "退款原因不能为空"
payee: '收款人姓名不能为空',
openAccBankName: '开户行名称不能为空',
openAccBranchBankName: '开户支行名称不能为空',
bankAccountNo: '银行卡号不能为空',
remark: '退款原因不能为空'
}
import dayjs from 'dayjs'
Page({
......@@ -20,35 +27,44 @@ Page({
*/
data: {
IMG_URL,
messageObj: [{
label: '门店名称',
value: 'shopMerchantName',
required: true
}, {
label: '园区店名称',
value: 'yqMerchantName',
required: true
}, {
label: '订单编号',
value: 'orderCode',
required: true
}],
roleMessageObj: [{
label: '申请人',
value: 'applyStaffName'
}, {
label: '门店名称',
value: 'shopMerchantName',
required: true
}, {
label: '园区店名称',
value: 'yqMerchantName',
required: true
}, {
label: '订单编号',
value: 'orderCode',
required: true
}],
messageObj: [
{
label: '门店名称',
value: 'shopMerchantName',
required: true
},
{
label: '园区店名称',
value: 'yqMerchantName',
required: true
},
{
label: '订单编号',
value: 'orderCode',
required: true
}
],
roleMessageObj: [
{
label: '申请人',
value: 'applyStaffName'
},
{
label: '门店名称',
value: 'shopMerchantName',
required: true
},
{
label: '园区店名称',
value: 'yqMerchantName',
required: true
},
{
label: '订单编号',
value: 'orderCode',
required: true
}
],
infoData: {
merchantName: '',
yqMerchantName: '',
......@@ -82,9 +98,9 @@ Page({
wx.$SCENE = null
let userInfo = wx.$util.getUserInfo()
if (options.refundPayType == 2) {
wx.setNavigationBarTitle({title: '退款标记申请'})
wx.setNavigationBarTitle({ title: '退款标记申请' })
} else {
wx.setNavigationBarTitle({title: '零售退款申请表'})
wx.setNavigationBarTitle({ title: '零售退款申请表' })
}
this.setData({
scene: userInfo?.sceneType, // 埋点业务场景
......@@ -97,7 +113,8 @@ Page({
track_event_code: 'apply_refund_view_page'
})
this.fetchSubOrderInfo(options, userInfo)
} else { // 退款详情
} else {
// 退款详情
this.setData({
track_event_code: 'refund_detail_view_page'
})
......@@ -114,7 +131,9 @@ Page({
return
}
// 获取退款记录
let result = await getRefundLogByOrderCodeAPI({ orderCode: options.orderCode })
let result = await getRefundLogByOrderCodeAPI({
orderCode: options.orderCode
})
if (result.code != 0) {
wx.$util.showToast(result.message)
return
......@@ -124,15 +143,20 @@ Page({
// 处理子订单商品规格
res.data?.map(val => {
let listShowSpecificationData = this.filterSpeciation(val)
val.upgradeGoodsName = listShowSpecificationData ? `${val.upgradeGoodsName}(${listShowSpecificationData})` : val.upgradeGoodsName
val.upgradeGoodsName = listShowSpecificationData
? `${val.upgradeGoodsName}(${listShowSpecificationData})`
: val.upgradeGoodsName
return val
})
// 处理退款记录商品规格
result?.data?.forEach(val => {
if (val.refundTime) val.refundTime = dayjs(val.refundTime).format("YYYY-MM-DD HH:mm:ss")
if (val.refundTime)
val.refundTime = dayjs(val.refundTime).format('YYYY-MM-DD HH:mm:ss')
val?.refundApplyDetailList?.forEach(v => {
let listShowSpecificationData = this.filterSpeciation(v)
v.upgradeGoodsName = listShowSpecificationData ? `${v.goodsName}(${listShowSpecificationData})` : v.goodsName
v.upgradeGoodsName = listShowSpecificationData
? `${v.goodsName}(${listShowSpecificationData})`
: v.goodsName
})
})
this.setData({
......@@ -145,9 +169,9 @@ Page({
'infoData.refundedOrderList': result?.data || []
})
// 判断是否默认选中部分退款
if (res.data.filter(val => val.status == 2)?.length) this.setData({showAllRefundBtn: false, 'infoData.refundType': 2})
} catch (error) {
}
if (res.data.filter(val => val.status == 2)?.length)
this.setData({ showAllRefundBtn: false, 'infoData.refundType': 2 })
} catch (error) {}
},
// 获取退款详情数据
async fetchRefundInfo(options, userInfo) {
......@@ -159,30 +183,42 @@ Page({
return
}
// 退款成功 退款时间处理
if (res?.data?.refundTime) res.data.refundTime = dayjs(res.data.refundTime).format("YYYY-MM-DD HH:mm:ss")
if (res?.data?.refundTime)
res.data.refundTime = dayjs(res.data.refundTime).format(
'YYYY-MM-DD HH:mm:ss'
)
// 获取退款详情
const result = await getRefundDetailInfoAPI({ applyCode: options?.applyCode })
const result = await getRefundDetailInfoAPI({
applyCode: options?.applyCode
})
const { code, data, message } = result
if (code != 0) {
wx.$util.showToast(message)
return
}
data?.refundedOrderList?.forEach(val => {
if (val.refundTime) val.refundTime = dayjs(val.refundTime).format("YYYY-MM-DD HH:mm:ss")
if (val.refundTime)
val.refundTime = dayjs(val.refundTime).format('YYYY-MM-DD HH:mm:ss')
val?.refundApplyDetailList?.forEach(v => {
let listShowSpecificationData = this.filterSpeciation(v)
v.upgradeGoodsName = listShowSpecificationData ? `${v.goodsName}(${listShowSpecificationData})` : v.goodsName
v.upgradeGoodsName = listShowSpecificationData
? `${v.goodsName}(${listShowSpecificationData})`
: v.goodsName
})
})
let subOrderList = []
// 审核不通过并且是驻店进入页面 获取子订单数据
if (res.data.afterStatus == 5 && userInfo.loginRole != 3) {
const re = await getSubOrderInfoAPI({ orderCode: result.data.orderCode })
const re = await getSubOrderInfoAPI({
orderCode: result.data.orderCode
})
if (re.code == 0) {
subOrderList = re.data || []
subOrderList.forEach(val => {
const listShowSpecificationData = this.filterSpeciation(val)
val.upgradeGoodsName = listShowSpecificationData ? `${val.upgradeGoodsName}(${listShowSpecificationData})` : val.upgradeGoodsName
val.upgradeGoodsName = listShowSpecificationData
? `${val.upgradeGoodsName}(${listShowSpecificationData})`
: val.upgradeGoodsName
data?.refundApplyDetailList?.forEach(v => {
if (val.subOrderCode === v.subOrderCode) {
val.checked = true
......@@ -192,41 +228,55 @@ Page({
})
}
} else {
const refundApplyDetailList = (data?.refundApplyDetailList || []).map(val => {
const listShowSpecificationData = this.filterSpeciation(val);
val.upgradeGoodsName = listShowSpecificationData ? `${val.goodsName}(${listShowSpecificationData})` : val.goodsName
val.upgradeGoodsAlias = val.goodsAlias
val.checked = true
return val
})
const refundApplyDetailList = (data?.refundApplyDetailList || []).map(
val => {
const listShowSpecificationData = this.filterSpeciation(val)
val.upgradeGoodsName = listShowSpecificationData
? `${val.goodsName}(${listShowSpecificationData})`
: val.goodsName
val.upgradeGoodsAlias = val.goodsAlias
val.checked = true
return val
}
)
subOrderList = refundApplyDetailList
}
// 处理主订单总支付金额 用于显示可选可退总金额
this.setOrderPayPrice(subOrderList)
this.setData({
infoData: {
...data,
yqMerchantName: data?.applyStaffYqMerchantName,
yqMerchantId: data?.applyStaffYqMerchantId,
beforeStatus: res.data.beforeStatus,
afterStatus: res.data.afterStatus,
transferStatus: res.data.transferStatus,
subOrderList,
refundTime: res.data.refundTime ? dayjs(res.data.refundTime).format('YYYY/MM/DD HH:mm:ss') : '', // 状态流转下展示的退款成功时间
payAmount: res.data.payAmount, // 状态流转下展示的实际退款金额
reviewRemark: res.data.remark || `你的申请被【${res.data.oaSpFailAuditorName || '总部'}】驳回,请联系驳回人员!` // 状态流转下展示的审批不通过原因
this.setData(
{
infoData: {
...data,
yqMerchantName: data?.applyStaffYqMerchantName,
yqMerchantId: data?.applyStaffYqMerchantId,
beforeStatus: res.data.beforeStatus,
afterStatus: res.data.afterStatus,
transferStatus: res.data.transferStatus,
subOrderList,
refundTime: res.data.refundTime
? dayjs(res.data.refundTime).format('YYYY/MM/DD HH:mm:ss')
: '', // 状态流转下展示的退款成功时间
payAmount: res.data.payAmount, // 状态流转下展示的实际退款金额
reviewRemark:
res.data.remark ||
`你的申请被【${res.data.oaSpFailAuditorName || '总部'}】驳回,请联系驳回人员!` // 状态流转下展示的审批不通过原因
}
},
() => {
this.setRefundAblePrice()
}
}, () => {
this.setRefundAblePrice()
})
} catch (error) {
}
)
} catch (error) {}
},
// 处理规格数据
filterSpeciation(val) {
let listShowSpecificationData = ''
let specificationTypeSequenceArr = val?.specificationTypeSequence ? val?.specificationTypeSequence?.split(';~;') : []
let specificationValueSequenceArr = val?.specificationData?.includes(";~;") ? val?.specificationData?.split(';~;') : []
let specificationTypeSequenceArr = val?.specificationTypeSequence
? val?.specificationTypeSequence?.split(';~;')
: []
let specificationValueSequenceArr = val?.specificationData?.includes(';~;')
? val?.specificationData?.split(';~;')
: []
const suffixMapping = {
1: '年',
2: '(km/万)',
......@@ -240,8 +290,11 @@ Page({
}
})
listShowSpecificationData = specificationValueSequenceArr?.join('/')
} else if (val?.specificationData?.includes(";~;")) {
listShowSpecificationData = val?.specificationData?.replace(RegExp(';~;', 'g'), '/')
} else if (val?.specificationData?.includes(';~;')) {
listShowSpecificationData = val?.specificationData?.replace(
RegExp(';~;', 'g'),
'/'
)
}
return listShowSpecificationData
},
......@@ -249,9 +302,7 @@ Page({
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
onReady() {},
/**
* 生命周期函数--监听页面显示
......@@ -265,7 +316,7 @@ Page({
setOrderPayPrice(orderData) {
let allTotalPrice = 0
orderData?.forEach(val => {
allTotalPrice = NP.plus(allTotalPrice, val.totalPrice)
allTotalPrice = NP.plus(allTotalPrice, val.finalPrice)
})
this.setData({
allTotalPrice // 订单支付金额
......@@ -279,7 +330,7 @@ Page({
let customerRefundPrice = 0
infoData.subOrderList?.map(val => {
if (val.checked) {
customerRefundPrice = NP.plus(customerRefundPrice, val.totalPrice)
customerRefundPrice = NP.plus(customerRefundPrice, val.finalPrice)
}
})
this.setData({
......@@ -289,9 +340,10 @@ Page({
// 选择退款方式
chooseRefundType(e) {
let {type} = e.currentTarget.dataset
let { type } = e.currentTarget.dataset
let { infoData } = this.data
if (type == 1) { // 全额退款可选可退总金额=订单支付总金额
if (type == 1) {
// 全额退款可选可退总金额=订单支付总金额
this.setOrderPayPrice(infoData.subOrderList)
} else {
// 重置之前选择未保存的部分退款选项
......@@ -313,12 +365,15 @@ Page({
// 选择子订单
checkSubOrder(e) {
let { item, index } = e.currentTarget.dataset
this.setData({
[`infoData.subOrderList[${index}].checked`]: !item.checked,
[`infoData.subOrderList[${index}].refundPrice`]: ''
}, () => {
this.setRefundAblePrice()
})
this.setData(
{
[`infoData.subOrderList[${index}].checked`]: !item.checked,
[`infoData.subOrderList[${index}].refundPrice`]: ''
},
() => {
this.setRefundAblePrice()
}
)
},
// 金额输入限制
......@@ -337,8 +392,8 @@ Page({
// 输入退款金额
changePrice(e) {
let { index } = e.currentTarget.dataset
let {value} = e.detail
let {infoData} = this.data
let { value } = e.detail
let { infoData } = this.data
let number = this.priceFormat(value)
this.setData({
[`infoData.subOrderList[${index}].refundPrice`]: number
......@@ -349,7 +404,10 @@ Page({
} else {
val.errorZero = false
}
if (!((val.refundPrice ?? '') === '') && val.refundPrice > val.totalPrice) {
if (
!((val.refundPrice ?? '') === '') &&
val.refundPrice > val.finalPrice
) {
val.errorTarget = true
} else {
val.errorTarget = false
......@@ -371,13 +429,15 @@ Page({
_this.setData({
loadingFlag: true
})
const uploadImages = async (tempFiles) => {
const uploadImages = async tempFiles => {
try {
for (const item of tempFiles) {
const val = item.tempFilePath
const imgType = val.split('.')[1]
const type = imgType === 'unknown' ? 'jpg' : imgType
const fileName = val.substring(val.lastIndexOf('/') + 1)?.split('.')[0]
const fileName = val
.substring(val.lastIndexOf('/') + 1)
?.split('.')[0]
const _res = await new Promise((resolve, reject) => {
wx.getFileSystemManager().readFile({
filePath: val, // 选择图片返回的相对路径
......@@ -391,7 +451,10 @@ Page({
})
const { code, data, message } = img
if (code == 0) {
infoData.attachmentList.push({ fileUrl: data, fileName: fileName })
infoData.attachmentList.push({
fileUrl: data,
fileName: fileName
})
_this.setData({
[`infoData.attachmentList`]: infoData.attachmentList
})
......@@ -400,7 +463,7 @@ Page({
}
}
} catch (error) {
wx.$util.showToast("上传失败,请重试")
wx.$util.showToast('上传失败,请重试')
} finally {
_this.setData({
loadingFlag: false
......@@ -415,7 +478,9 @@ Page({
// 图片预览
previewImage(e) {
let { url, index } = e.currentTarget.dataset
let imageUrl = url?.map(v => { return v.fileUrl})
let imageUrl = url?.map(v => {
return v.fileUrl
})
wx.previewImage({
urls: imageUrl,
current: imageUrl[index]
......@@ -427,20 +492,25 @@ Page({
let { index } = e.currentTarget.dataset
let { infoData } = this.data
infoData.attachmentList.splice(index, 1)
this.setData({infoData})
this.setData({ infoData })
},
// 区域运营审核
review(e) {
let { type } = e.currentTarget.dataset
let { infoData } = this.data
if (type == 1) { // 审核通过
auditRefundAllpyAPI({applyCode: infoData.applyCode, auditStatus: 1, id: infoData.id}).then(res => {
if (type == 1) {
// 审核通过
auditRefundAllpyAPI({
applyCode: infoData.applyCode,
auditStatus: 1,
id: infoData.id
}).then(res => {
let { code, message } = res
if (code == 0) {
wx.showToast({
title: "操作成功",
icon: "success"
title: '操作成功',
icon: 'success'
})
// 跳转到退款审批列表
setTimeout(() => {
......@@ -457,7 +527,8 @@ Page({
wx.$util.showToast(message)
}
})
} else { // 审核不通过
} else {
// 审核不通过
this.setData({
repealVisible: true,
disapprovalReason: ''
......@@ -466,10 +537,11 @@ Page({
},
textareaInput(e) {
let {
value
} = e.detail
value = value.replace(/[^\u4e00-\u9fa5a-zA-Z0-9,。、;:?!""''()《》【】\-\+=/*.,;:?!@#$%^&*()_+=\[\]{}|\\<>\/\s]/g, '')
let { value } = e.detail
value = value.replace(
/[^\u4e00-\u9fa5a-zA-Z0-9,。、;:?!""''()《》【】\-\+=/*.,;:?!@#$%^&*()_+=\[\]{}|\\<>\/\s]/g,
''
)
this.setData({
disapprovalReason: value.trim()
})
......@@ -479,13 +551,18 @@ Page({
let { disapprovalReason, repealStatus, infoData } = this.data
if (repealStatus) return
if (!disapprovalReason) return wx.$util.showToast('审核不通过原因不能为空')
this.setData({repealStatus: true})
auditRefundAllpyAPI({applyCode: infoData.applyCode, auditStatus: 2, remark: disapprovalReason, id: infoData.id}).then(res => {
this.setData({ repealStatus: true })
auditRefundAllpyAPI({
applyCode: infoData.applyCode,
auditStatus: 2,
remark: disapprovalReason,
id: infoData.id
}).then(res => {
let { code, message } = res
if (code == 0) {
wx.showToast({
title: "操作成功",
icon: "success"
title: '操作成功',
icon: 'success'
})
this.cancelRepeal()
// 跳转到退款审批列表
......@@ -500,7 +577,7 @@ Page({
}
}, 300)
} else {
this.setData({repealStatus: false})
this.setData({ repealStatus: false })
wx.$util.showToast(message)
}
})
......@@ -514,14 +591,15 @@ Page({
input(e) {
let { name } = e.currentTarget.dataset
let {
value
} = e.detail
let { value } = e.detail
if (name == 'bankAccountNo') {
value = value.replace(/[^0-9]/g, '')
} else {
// 限制只能输入汉字英文数字常用特殊符号
value = value.replace(/[^\u4e00-\u9fa5a-zA-Z0-9,。、;:?!""''()《》【】\-\+=/*.,;:?!@#$%^&*()_+=\[\]{}|\\<>\/\s]/g, '')
value = value.replace(
/[^\u4e00-\u9fa5a-zA-Z0-9,。、;:?!""''()《》【】\-\+=/*.,;:?!@#$%^&*()_+=\[\]{}|\\<>\/\s]/g,
''
)
}
this.setData({
[`infoData.${name}`]: value.trim()
......@@ -529,13 +607,19 @@ Page({
},
checkRequired(infoData) {
let target = ['payee', 'openAccBankName', 'openAccBranchBankName', 'bankAccountNo', 'remark']
let target = [
'payee',
'openAccBankName',
'openAccBranchBankName',
'bankAccountNo',
'remark'
]
try {
target.map((key) => {
target.map(key => {
if ((infoData[key] ?? '') === '') {
throw key
}
});
})
} catch (error) {
return error
}
......@@ -543,7 +627,11 @@ Page({
},
checkSubOrderValid(subOrderList) {
if (!subOrderList?.filter(v => v.checked).length && this.data.infoData.refundType == 2) return '请选择具体退款项'
if (
!subOrderList?.filter(v => v.checked).length &&
this.data.infoData.refundType == 2
)
return '请选择具体退款项'
let [errorZeroNum, errTargetNum, errorEmptyNum] = [0, 0, 0]
subOrderList?.map(val => {
if ((val.refundPrice ?? '') === '' && val.checked) errorEmptyNum++
......@@ -557,43 +645,49 @@ Page({
return '退款金额不能为0'
}
if (errTargetNum) {
return "退款金额不能大于支付金额"
return '退款金额不能大于支付金额'
}
},
// 提交申请
submit() {
let {submitStatus, infoData, userInfo, refundPayType} = this.data
let { submitStatus, infoData, userInfo, refundPayType } = this.data
// 校验是否选择退款方式
if (!infoData.refundType) return wx.$util.showToast('请选择退款方式')
// 部分退款校验子订单
let checkKey = this.checkSubOrderValid(infoData.subOrderList)
if (checkKey) return wx.$util.showToast(checkKey)
if (infoData.refundType == 2 && !infoData.subOrderList?.filter(v => v.checked)?.length) return wx.$util.showToast('')
if (
infoData.refundType == 2 &&
!infoData.subOrderList?.filter(v => v.checked)?.length
)
return wx.$util.showToast('')
let key = this.checkRequired(infoData)
if (key && refundPayType != 2) {
toastList[key] && wx.$util.showToast(toastList[key]);
toastList[key] && wx.$util.showToast(toastList[key])
toastList[key] &&
wx.pageScrollTo({
selector: `.${key}`,
});
return;
selector: `.${key}`
})
return
}
// 门店收款标记退款,客户退款回单必传
if (refundPayType == 2 && !infoData.attachmentList?.length) return wx.$util.showToast('客户退款回单不能为空')
if (refundPayType == 2 && !infoData.attachmentList?.length)
return wx.$util.showToast('客户退款回单不能为空')
if (submitStatus) return
this.setData({
submitStatus: true,
submitStatus: true
})
const refundApplyDetailList = (infoData?.subOrderList || [])
.filter(val => infoData.refundType == 1 || val.checked)
.map(val => ({
totalPrice: val.totalPrice,
subOrderCode: val.subOrderCode,
orderCode: infoData.orderCode,
refundAmount: infoData.refundType == 1 ? val.totalPrice : val.refundPrice
}))
.filter(val => infoData.refundType == 1 || val.checked)
.map(val => ({
finalPrice: val.finalPrice,
subOrderCode: val.subOrderCode,
orderCode: infoData.orderCode,
refundAmount:
infoData.refundType == 1 ? val.finalPrice : val.refundPrice
}))
let params = {
sourceApplyId: infoData.id,
refundType: infoData.refundType,
......@@ -608,16 +702,18 @@ Page({
remark: infoData?.remark,
orderCode: infoData?.orderCode,
sceneType: userInfo?.sceneType,
attachmentList: infoData.attachmentList?.map(val => { return { fileUrl: val.fileUrl, fileName: val.fileName } }),
attachmentList: infoData.attachmentList?.map(val => {
return { fileUrl: val.fileUrl, fileName: val.fileName }
}),
refundApplyDetailList
}
const eventObj = refundPayType == 2 ? 'markAsRefundedAPI' : 'applyRefundAPI'
refundAPI[eventObj](params).then(res => {
let {code, message} = res
let { code, message } = res
if (code == 0) {
wx.showToast({
title: "操作成功",
icon: "success"
title: '操作成功',
icon: 'success'
})
setTimeout(() => {
const pages = getCurrentPages()
......@@ -630,7 +726,7 @@ Page({
}
}, 300)
} else {
this.setData({submitStatus: false})
this.setData({ submitStatus: false })
wx.$util.showToast(message)
}
})
......@@ -655,14 +751,10 @@ Page({
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
onPullDownRefresh() {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
})
\ No newline at end of file
onReachBottom() {}
})
<!--packageWorkspace/pages/refundApply/refundApply.wxml-->
<wxs src="../../refund.wxs" module="filter" />
<view class="apply-content">
<view class="status-box">
<block wx:if="{{refundPayType != 2}}">
<review-status infoData="{{infoData}}"></review-status>
</block>
<block wx:else>
<label-refund-status infoData="{{infoData}}"></label-refund-status>
</block>
</view>
<view class="form-item">
<view wx:for="{{userInfo.loginRole == 3 ? roleMessageObj : messageObj}}" wx:key="index">
<gl-cell required="{{ item.required }}" border valueAlign="right" label="{{item.label}}" requiredAfter value="{{infoData[item.value]}}" labelWidth="var(--fontSize280)">
</gl-cell>
</view>
</view>
<view class="form-item">
<view class="item_title">退款明细</view>
<view class="choose_box">
<block wx:if="{{(infoData.afterStatus === '' && !filter.filterShowBtn(infoData.subOrderList).length) || (infoData.afterStatus == 5 && userInfo.loginRole != 3 && filter.filterOrderStatus(infoData) && !filter.filterShowBtn(infoData.subOrderList).length) || infoData.refundType == 1}}">
<view class="radio_box">
<block wx:if="{{infoData.refundType == 1}}">
<image src="/components/images/radio.png" />
</block>
<block wx:else>
<view class="arc" bindtap="chooseRefundType" data-type="1" />
</block>
<view class="radio_label" bindtap="chooseRefundType" data-type="1">全额退款</view>
<view class="sub_order_box" wx:if="{{infoData.refundType == 1}}">
<view class="item" wx:for="{{infoData.subOrderList}}" wx:key="index">
<view class="left">
<view class="circle"></view>
</view>
<view class="right">
<view class="name">
<view>
<text class="name_item">{{item.upgradeGoodsName}}</text>
</view>
</view>
<view class="alias" wx:if="{{item.upgradeGoodsAlias}}">{{item.upgradeGoodsAlias}}</view>
<view class="price-box">
<view class="price">支付金额:¥{{item.totalPrice}}</view>
<view class="refund_price">申请退款:¥{{item.totalPrice}}</view>
</view>
</view>
</view>
<view class="computed_price">
<view class="label">可选可退总价</view>
<view class="value">¥{{allTotalPrice}}</view>
</view>
</view>
</view>
</block>
<block wx:if="{{infoData.afterStatus === '' || (infoData.afterStatus == 5 && userInfo.loginRole != 3 && filter.filterOrderStatus(infoData)) || infoData.refundType == 2}}">
<view class="radio_box">
<block wx:if="{{infoData.refundType == 2}}">
<image src="/components/images/radio.png" />
</block>
<block wx:else>
<view class="arc" bindtap="chooseRefundType" data-type="2"/>
</block>
<view class="radio_label" bindtap="chooseRefundType" data-type="2">部分退款</view>
<view class="sub_order_box {{!filter.filterRefundDisabled(infoData, userInfo) ? 'set_sub_order_box' : ''}}" wx:if="{{infoData.refundType == 2}}">
<block wx:for="{{infoData.subOrderList}}" wx:key="index">
<view class="item" wx:if="{{item.status != 2}}">
<view class="left">
<view class="check_box" wx:if="{{!filter.filterRefundDisabled(infoData, userInfo)}}" catchtap="checkSubOrder" data-item="{{item}}" data-index="{{index}}">
<block wx:if="{{item.checked}}">
<image src="{{IMG_URL}}check.png" mode=""/>
</block>
<block wx:else>
<view class="arc"></view>
</block>
</view>
<view wx:else class="circle"></view>
</view>
<view class="right">
<view class="name">
<view>
<text class="name_item">{{item.upgradeGoodsName}}</text>
</view>
</view>
<view class="alias" wx:if="{{item.upgradeGoodsAlias}}">{{item.upgradeGoodsAlias}}</view>
<block>
<view class="price-box">
<view class="price">支付金额:¥{{item.totalPrice}}</view>
<view wx:if="{{!filter.filterRefundDisabled(infoData, userInfo) && item.checked}}" class="refund_price">
退款金额
<view class="price">
<text style="color: {{item.refundPrice !== '' ? '#222222' : '#B6B6B8'}}">¥</text>
<input type="digit" value="{{ item.refundPrice }}" bindinput="changePrice" placeholder-style="color: #B6B6B8;" placeholder="请输入" data-index="{{ index }}" class="{{item.errorZero || item.errorTarget ? 'error' : ''}}" always-embed />
</view>
</view>
<view wx:if="{{filter.filterRefundDisabled(infoData, userInfo)}}" class="refund_price">申请退款:¥{{item.refundAmount}}</view>
</view>
</block>
</view>
</view>
</block>
<view class="computed_price" wx:if="{{refundablePrice}}">
<view class="label">可选可退总价</view>
<view class="value">¥{{refundablePrice}}<text wx:if="{{filter.filterShowBtn(infoData.subOrderList).length}}">,订单支付总额 ¥{{allTotalPrice}}</text></view>
</view>
<view class="refund_log" wx:if="{{infoData.refundType == 2 && infoData.refundedOrderList.length}}">
<view class="log_item" wx:for="{{infoData.refundedOrderList}}" wx:key="index">
<view class="title">退款记录{{index + 1}}:<view class="time" wx:if="{{item.refundTime}}">{{item.refundTime}}</view></view>
<view class="sub_item" wx:for="{{item.refundApplyDetailList}}" wx:for-item="li" wx:for-key="idx" wx:key="idx">
<view>{{li.upgradeGoodsName}}支付金额 ¥{{li.totalPrice}},申请退款 ¥{{li.refundAmount}}</view>
</view>
<view class="sub_item" wx:if="{{item.refundTime}}">实际退款: ¥{{item.payAmount}}</view>
</view>
</view>
</view>
</view>
</block>
</view>
<block wx:if="{{refundPayType != 2}}">
<gl-cell border valueAlign="right" label="收款人姓名" requiredAfter labelWidth="var(--fontSize280)" required>
<input placeholder="点击输入" class="input" maxlength="20" placeholder-class="placeholder-class" value="{{ infoData.payee }}" bindinput="input" data-name="payee" disabled="{{ filter.filterRefundDisabled(infoData, userInfo) }}" always-embed></input>
</gl-cell>
<gl-cell border valueAlign="right" label="开户行名称" requiredAfter labelWidth="var(--fontSize280)" required>
<input placeholder="点击输入" class="input" maxlength="50" placeholder-class="placeholder-class" value="{{ infoData.openAccBankName }}" bindinput="input" data-name="openAccBankName" disabled="{{ filter.filterRefundDisabled(infoData, userInfo) }}" always-embed></input>
</gl-cell>
<gl-cell border valueAlign="right" label="开户支行名称" requiredAfter labelWidth="var(--fontSize280)" required>
<input placeholder="点击输入" class="input" maxlength="50" placeholder-class="placeholder-class" value="{{ infoData.openAccBranchBankName }}" bindinput="input" data-name="openAccBranchBankName" disabled="{{ filter.filterRefundDisabled(infoData, userInfo) }}" always-embed></input>
</gl-cell>
<gl-cell border valueAlign="right" label="银行卡号" requiredAfter labelWidth="var(--fontSize280)" required>
<input placeholder="点击输入" class="input" type="number" maxlength="30" placeholder-class="placeholder-class" value="{{ infoData.bankAccountNo }}" bindinput="input" data-name="bankAccountNo" disabled="{{ filter.filterRefundDisabled(infoData, userInfo) }}" always-embed></input>
</gl-cell>
<view class="reason_box">
<view class="label">退款原因说明</view>
<view class="textarea_box">
<textarea value="{{ infoData.remark }}" disabled="{{filter.filterRefundDisabled(infoData, userInfo)}}" placeholder="请输入 (500字以内)" placeholder-class="placeholder-class" class="textarea" maxlength="500" bindinput="input" data-name="remark" />
</view>
</view>
<view class="upload_box" wx:if="{{infoData.afterStatus === '' || (infoData.afterStatus == 5 && !filter.filterRefundDisabled(infoData, userInfo)) || infoData.attachmentList.length}}">
<view class="label">上传图片</view>
<view class="label-tips first">原厂延保退款:退款须告知门店,请上传沟通确认凭证截图</view>
<view class="label-tips">嘀加权益退款:退款需上传自愿退款协议及告知客户退款后服务作废凭证截图</view>
<view class="content_box">
<view class="image_content" wx:for="{{infoData.attachmentList}}" wx:key="index">
<image bindtap="previewImage" class="image_box" data-url="{{infoData.attachmentList}}" data-index="{{index}}" src="{{item.fileUrl}}"/>
<image class="del_icon" wx:if="{{!filter.filterRefundDisabled(infoData, userInfo)}}" src="{{IMG_URL}}zy_paf_del_icon.png" mode="" bindtap="deleteFile" data-index="{{index}}" />
</view>
<view class="upload_content" bindtap="uploadImages" wx:if="{{!filter.filterRefundDisabled(infoData, userInfo) && infoData.attachmentList.length < 5}}">
<image src="{{IMG_URL}}zy-upload_icon.png"></image>
<text class="text">最多5张</text>
</view>
</view>
</view>
</block>
<block wx:else>
<view class="upload_box">
<view class="label">客户退款回单<text class='required'>*</text></view>
<view class="label-tips"></view>
<view class="content_box">
<view class="image_content" wx:for="{{infoData.attachmentList}}" wx:key="index">
<image bindtap="previewImage" class="image_box" data-url="{{infoData.attachmentList}}" data-index="{{index}}" src="{{item.fileUrl}}"/>
<image class="del_icon" wx:if="{{!filter.filterRefundDisabled(infoData, userInfo)}}" src="{{IMG_URL}}zy_paf_del_icon.png" mode="" bindtap="deleteFile" data-index="{{index}}" />
</view>
<view class="upload_content" bindtap="uploadImages" wx:if="{{!filter.filterRefundDisabled(infoData, userInfo) && infoData.attachmentList.length < 5}}">
<image src="{{IMG_URL}}zy-upload_icon.png"></image>
<text class="text">最多5张</text>
</view>
</view>
</view>
</block>
</view>
<!-- 区域运营审核 -->
<view class="review_box" wx:if="{{infoData.beforeStatus == 6 && infoData.afterStatus == 7 && userInfo.loginRole == 3 && infoData.auditableFlag == 'Y'}}">
<view class="btn pass_btn" bindtap="review" data-type="1">审核通过</view>
<view class="btn no_pass_btn" bindtap="review" data-type="2">审核不通过</view>
</view>
<view class="status-box">
<block wx:if="{{ refundPayType != 2 }}">
<review-status infoData="{{ infoData }}"></review-status>
</block>
<block wx:else>
<label-refund-status infoData="{{ infoData }}"></label-refund-status>
</block>
</view>
<view class="form-item">
<view wx:for="{{ userInfo.loginRole == 3 ? roleMessageObj : messageObj }}" wx:key="index">
<gl-cell
required="{{ item.required }}"
border
valueAlign="right"
label="{{ item.label }}"
requiredAfter
value="{{ infoData[item.value] }}"
labelWidth="var(--fontSize280)"
></gl-cell>
</view>
</view>
<view class="form-item">
<view class="item_title">退款明细</view>
<view class="choose_box">
<block
wx:if="{{ (infoData.afterStatus === '' && !filter.filterShowBtn(infoData.subOrderList).length) || (infoData.afterStatus == 5 && userInfo.loginRole != 3 && filter.filterOrderStatus(infoData) && !filter.filterShowBtn(infoData.subOrderList).length) || infoData.refundType == 1 }}"
>
<view class="radio_box">
<block wx:if="{{ infoData.refundType == 1 }}">
<image src="/components/images/radio.png" />
</block>
<block wx:else>
<view class="arc" bindtap="chooseRefundType" data-type="1" />
</block>
<view class="radio_label" bindtap="chooseRefundType" data-type="1">全额退款</view>
<view class="sub_order_box" wx:if="{{ infoData.refundType == 1 }}">
<view class="item" wx:for="{{ infoData.subOrderList }}" wx:key="index">
<view class="left">
<view class="circle"></view>
</view>
<view class="right">
<view class="name">
<view>
<text class="name_item">{{item.upgradeGoodsName}}</text>
</view>
</view>
<view class="alias" wx:if="{{ item.upgradeGoodsAlias }}">{{item.upgradeGoodsAlias}}</view>
<view class="price-box">
<view class="price">支付金额:¥{{item.finalPrice}}</view>
<view class="refund_price">申请退款:¥{{item.finalPrice}}</view>
</view>
</view>
</view>
<view class="computed_price">
<view class="label">可选可退总价</view>
<view class="value">¥{{allTotalPrice}}</view>
</view>
</view>
</view>
</block>
<block
wx:if="{{ infoData.afterStatus === '' || (infoData.afterStatus == 5 && userInfo.loginRole != 3 && filter.filterOrderStatus(infoData)) || infoData.refundType == 2 }}"
>
<view class="radio_box">
<block wx:if="{{ infoData.refundType == 2 }}">
<image src="/components/images/radio.png" />
</block>
<block wx:else>
<view class="arc" bindtap="chooseRefundType" data-type="2" />
</block>
<view class="radio_label" bindtap="chooseRefundType" data-type="2">部分退款</view>
<view
class="sub_order_box {{ !filter.filterRefundDisabled(infoData, userInfo) ? 'set_sub_order_box' : '' }}"
wx:if="{{ infoData.refundType == 2 }}"
>
<block wx:for="{{ infoData.subOrderList }}" wx:key="index">
<view class="item" wx:if="{{ item.status != 2 }}">
<view class="left">
<view
class="check_box"
wx:if="{{ !filter.filterRefundDisabled(infoData, userInfo) }}"
catchtap="checkSubOrder"
data-item="{{ item }}"
data-index="{{ index }}"
>
<block wx:if="{{ item.checked }}">
<image src="{{ IMG_URL }}check.png" mode="" />
</block>
<block wx:else>
<view class="arc"></view>
</block>
</view>
<view wx:else class="circle"></view>
</view>
<view class="right">
<view class="name">
<view>
<text class="name_item">{{item.upgradeGoodsName}}</text>
</view>
</view>
<view class="alias" wx:if="{{ item.upgradeGoodsAlias }}">{{item.upgradeGoodsAlias}}</view>
<block>
<view class="price-box">
<view class="price">支付金额:¥{{item.finalPrice}}</view>
<view wx:if="{{ !filter.filterRefundDisabled(infoData, userInfo) && item.checked }}" class="refund_price">
退款金额
<view class="price">
<text style="color: {{ item.refundPrice !== '' ? '#222222' : '#B6B6B8' }}">¥</text>
<input
type="digit"
value="{{ item.refundPrice }}"
bindinput="changePrice"
placeholder-style="color: #B6B6B8;"
placeholder="请输入"
data-index="{{ index }}"
class="{{ item.errorZero || item.errorTarget ? 'error' : '' }}"
always-embed
/>
</view>
</view>
<view wx:if="{{ filter.filterRefundDisabled(infoData, userInfo) }}" class="refund_price">申请退款:¥{{item.refundAmount}}</view>
</view>
</block>
</view>
</view>
</block>
<view class="computed_price" wx:if="{{ refundablePrice }}">
<view class="label">可选可退总价</view>
<view class="value">
¥{{refundablePrice}}
<text wx:if="{{ filter.filterShowBtn(infoData.subOrderList).length }}">,订单支付总额 ¥{{allTotalPrice}}</text>
</view>
</view>
<view class="refund_log" wx:if="{{ infoData.refundType == 2 && infoData.refundedOrderList.length }}">
<view class="log_item" wx:for="{{ infoData.refundedOrderList }}" wx:key="index">
<view class="title">
退款记录{{index + 1}}:
<view class="time" wx:if="{{ item.refundTime }}">{{item.refundTime}}</view>
</view>
<view class="sub_item" wx:for="{{ item.refundApplyDetailList }}" wx:for-item="li" wx:for-key="{{ idx }}" wx:key="idx">
<view>{{li.upgradeGoodsName}}支付金额 ¥{{li.finalPrice}},申请退款 ¥{{li.refundAmount}}</view>
</view>
<view class="sub_item" wx:if="{{ item.refundTime }}">实际退款: ¥{{item.payAmount}}</view>
</view>
</view>
</view>
</view>
</block>
</view>
<block wx:if="{{ refundPayType != 2 }}">
<gl-cell border valueAlign="right" label="收款人姓名" requiredAfter labelWidth="var(--fontSize280)" required>
<input
placeholder="点击输入"
class="input"
maxlength="20"
placeholder-class="placeholder-class"
value="{{ infoData.payee }}"
bindinput="input"
data-name="payee"
disabled="{{ filter.filterRefundDisabled(infoData, userInfo) }}"
always-embed
></input>
</gl-cell>
<gl-cell border valueAlign="right" label="开户行名称" requiredAfter labelWidth="var(--fontSize280)" required>
<input
placeholder="点击输入"
class="input"
maxlength="50"
placeholder-class="placeholder-class"
value="{{ infoData.openAccBankName }}"
bindinput="input"
data-name="openAccBankName"
disabled="{{ filter.filterRefundDisabled(infoData, userInfo) }}"
always-embed
></input>
</gl-cell>
<gl-cell border valueAlign="right" label="开户支行名称" requiredAfter labelWidth="var(--fontSize280)" required>
<input
placeholder="点击输入"
class="input"
maxlength="50"
placeholder-class="placeholder-class"
value="{{ infoData.openAccBranchBankName }}"
bindinput="input"
data-name="openAccBranchBankName"
disabled="{{ filter.filterRefundDisabled(infoData, userInfo) }}"
always-embed
></input>
</gl-cell>
<gl-cell border valueAlign="right" label="银行卡号" requiredAfter labelWidth="var(--fontSize280)" required>
<input
placeholder="点击输入"
class="input"
type="number"
maxlength="30"
placeholder-class="placeholder-class"
value="{{ infoData.bankAccountNo }}"
bindinput="input"
data-name="bankAccountNo"
disabled="{{ filter.filterRefundDisabled(infoData, userInfo) }}"
always-embed
></input>
</gl-cell>
<view class="reason_box">
<view class="label">退款原因说明</view>
<view class="textarea_box">
<textarea
value="{{ infoData.remark }}"
disabled="{{ filter.filterRefundDisabled(infoData, userInfo) }}"
placeholder="请输入 (500字以内)"
placeholder-class="placeholder-class"
class="textarea"
maxlength="500"
bindinput="input"
data-name="remark"
/>
</view>
</view>
<view
class="upload_box"
wx:if="{{ infoData.afterStatus === '' || (infoData.afterStatus == 5 && !filter.filterRefundDisabled(infoData, userInfo)) || infoData.attachmentList.length }}"
>
<view class="label">上传图片</view>
<view class="label-tips first">原厂延保退款:退款须告知门店,请上传沟通确认凭证截图</view>
<view class="label-tips">嘀加权益退款:退款需上传自愿退款协议及告知客户退款后服务作废凭证截图</view>
<view class="content_box">
<view class="image_content" wx:for="{{ infoData.attachmentList }}" wx:key="index">
<image
bindtap="previewImage"
class="image_box"
data-url="{{ infoData.attachmentList }}"
data-index="{{ index }}"
src="{{ item.fileUrl }}"
/>
<image
class="del_icon"
wx:if="{{ !filter.filterRefundDisabled(infoData, userInfo) }}"
src="{{ IMG_URL }}zy_paf_del_icon.png"
mode=""
bindtap="deleteFile"
data-index="{{ index }}"
/>
</view>
<view
class="upload_content"
bindtap="uploadImages"
wx:if="{{ !filter.filterRefundDisabled(infoData, userInfo) && infoData.attachmentList.length < 5 }}"
>
<image src="{{ IMG_URL }}zy-upload_icon.png"></image>
<text class="text">最多5张</text>
</view>
</view>
</view>
</block>
<block wx:else>
<view class="upload_box">
<view class="label">
客户退款回单
<text class="required">*</text>
</view>
<view class="label-tips"></view>
<view class="content_box">
<view class="image_content" wx:for="{{ infoData.attachmentList }}" wx:key="index">
<image
bindtap="previewImage"
class="image_box"
data-url="{{ infoData.attachmentList }}"
data-index="{{ index }}"
src="{{ item.fileUrl }}"
/>
<image
class="del_icon"
wx:if="{{ !filter.filterRefundDisabled(infoData, userInfo) }}"
src="{{ IMG_URL }}zy_paf_del_icon.png"
mode=""
bindtap="deleteFile"
data-index="{{ index }}"
/>
</view>
<view
class="upload_content"
bindtap="uploadImages"
wx:if="{{ !filter.filterRefundDisabled(infoData, userInfo) && infoData.attachmentList.length < 5 }}"
>
<image src="{{ IMG_URL }}zy-upload_icon.png"></image>
<text class="text">最多5张</text>
</view>
</view>
</view>
</block>
</view>
<!-- 区域运营审核 -->
<view
class="review_box"
wx:if="{{ infoData.beforeStatus == 6 && infoData.afterStatus == 7 && userInfo.loginRole == 3 && infoData.auditableFlag == 'Y' }}"
>
<view class="btn pass_btn" bindtap="review" data-type="1">审核通过</view>
<view class="btn no_pass_btn" bindtap="review" data-type="2">审核不通过</view>
</view>
</view>
<view class="btns {{ isFullSucreen?'isFullSucreen-btn':'' }}" wx:if="{{!filter.filterRefundDisabled(infoData, userInfo)}}">
<view class="btns-con">
<view class="confirm text-center" bindtap="submit">{{infoData.afterStatus === '' ? '提交' : '重新提交'}}</view>
</view>
<view class="btns {{ isFullSucreen?'isFullSucreen-btn':'' }}" wx:if="{{ !filter.filterRefundDisabled(infoData, userInfo) }}">
<view class="btns-con">
<view class="confirm text-center" bindtap="submit">{{infoData.afterStatus === '' ? '提交' : '重新提交'}}</view>
</view>
</view>
<view class="repeal-modal" wx:if="{{ repealVisible }}">
<view class="repeal-wrap">
<view class="title">审核不通过原因</view>
<view class="textarea-wrap">
<textarea class="textarea" maxlength="{{ 100 }}" value="{{ disapprovalReason }}" bindinput="textareaInput" focus="{{ true }}" placeholder-style="color: #BBBBBB; font-size: var(--fontSize28);" placeholder="请输入退款审核不通过原因" ></textarea>
</view>
<view class="footer">
<view class="btn cancel_btn" bindtap="cancelRepeal">取消</view>
<view class="btn confirm_btn" bindtap="confirmRepeal">确定</view>
</view>
</view>
<view class="repeal-wrap">
<view class="title">审核不通过原因</view>
<view class="textarea-wrap">
<textarea
class="textarea"
maxlength="{{ 100 }}"
value="{{ disapprovalReason }}"
bindinput="textareaInput"
focus="{{ true }}"
placeholder-style="color: #BBBBBB; font-size: var(--fontSize28);"
placeholder="请输入退款审核不通过原因"
></textarea>
</view>
<view class="footer">
<view class="btn cancel_btn" bindtap="cancelRepeal">取消</view>
<view class="btn confirm_btn" bindtap="confirmRepeal">确定</view>
</view>
</view>
</view>
<block wx:if="{{loadingFlag}}">
<van-popup show="{{true}}" close-on-click-overlay="{{false}}" >
<van-loading custom-class="loading-box" color="#FFFFFF" type="spinner" size="45px" vertical>上传中</van-loading>
</van-popup>
<block wx:if="{{ loadingFlag }}">
<van-popup show="{{ true }}" close-on-click-overlay="{{ false }}">
<van-loading custom-class="loading-box" color="#FFFFFF" type="spinner" size="45px" vertical>上传中</van-loading>
</van-popup>
</block>
\ No newline at end of file
// packageWorkspace/pages/refundDetailList/refundDetailList.js
import api from "~/api/api"
import api from '~/api/api'
import dayjs from 'dayjs'
const obj = [{
label: '退款类型',
key: 'refundPayTypeText'
}, {
label: '订单编号',
key: 'orderCode'
}, {
label: '申请时间',
key: 'createdDate'
}]
const obj = [
{
label: '退款类型',
key: 'refundPayTypeText'
},
{
label: '订单编号',
key: 'orderCode'
},
{
label: '申请时间',
key: 'createdDate'
}
]
Page({
/**
* 页面的初始数据
*/
data: {
orderObj: [ // 申请退款未成功退款
orderObj: [
// 申请退款未成功退款
...obj,
{
label: '订单支付总额',
key: 'orderTotalPrice',
unit: true
}, {
label: '退款申请金额',
key: 'applyRefundAmount',
unit: true
}],
reviewObj: [ // 申请退款成功退款
{
label: '订单支付总额',
key: 'orderFinalPrice',
unit: true
},
{
label: '退款申请金额',
key: 'applyRefundAmount',
unit: true
}
],
reviewObj: [
// 申请退款成功退款
...obj,
{
label: '退款时间',
key: 'refundTime'
}, {
label: '订单支付总额',
key: 'orderTotalPrice',
unit: true
}, {
label: '退款申请金额',
key: 'applyRefundAmount',
unit: true
}],
labelObj: [ // 标记退款
{
label: '退款时间',
key: 'refundTime'
},
{
label: '订单支付总额',
key: 'orderFinalPrice',
unit: true
},
{
label: '退款申请金额',
key: 'applyRefundAmount',
unit: true
}
],
labelObj: [
// 标记退款
...obj,
{
label: '订单支付总额',
key: 'orderTotalPrice',
unit: true
}, {
label: '实际退款总额',
key: 'applyRefundAmount',
unit: true
}],
{
label: '订单支付总额',
key: 'orderFinalPrice',
unit: true
},
{
label: '实际退款总额',
key: 'applyRefundAmount',
unit: true
}
],
list: [],
flag: true,
reviewStatusObj: {
......@@ -104,58 +117,76 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.setData({
pageOptions: options
}, () => {
this.getDetailList()
})
this.setData(
{
pageOptions: options
},
() => {
this.getDetailList()
}
)
},
getDetailList() {
let { refundPayTypeObj, pageOptions } = this.data
// 获取退款详情列表
api.getRefundDetailListAPI({orderCode: pageOptions.orderCode}).then(res => {
let { code, data } = res
if (code == 0) {
// 处理审批状态
data.forEach(val => {
if (val.beforeStatus == 6 && val.afterStatus == 7) {
val.reviewStatus = 0 // 区域运营审批
}
if (val.beforeStatus == 7 && val.afterStatus == 5) {
val.reviewStatus = 1 // 区域审核不通过
}
if (([0, 1, 2, 8].includes(val.beforeStatus) && [0, 1, 2, 3].includes(val.afterStatus)) || (val.beforeStatus == 7 && val.afterStatus == 8)) {
val.reviewStatus = 2 // 总部审核
}
if ([0, 1, 2, 3].includes(val.beforeStatus) && val.afterStatus == 5) {
val.reviewStatus = 3 // 总部审核不通过
}
if (val.afterStatus == 4) {
val.reviewStatus = 4 // 待退款
}
if (val.transferStatus == 3) {
val.reviewStatus = 5 // 已退款
}
val.orderCode = pageOptions.orderCode
if (val.createdDate) val.createdDate = dayjs(val.createdDate).format("YYYY-MM-DD HH:mm:ss")
if (val.refundTime) val.refundTime = dayjs(val.refundTime).format("YYYY-MM-DD HH:mm:ss")
val.remark = val.remark || `你的申请被【${val.oaSpFailAuditorName || '总部'}】驳回,请联系驳回人员!`
val.refundPayTypeText = refundPayTypeObj[val.refundPayType] || ''
})
this.setData({
list: data || []
})
}
})
api
.getRefundDetailListAPI({ orderCode: pageOptions.orderCode })
.then(res => {
let { code, data } = res
if (code == 0) {
// 处理审批状态
data.forEach(val => {
if (val.beforeStatus == 6 && val.afterStatus == 7) {
val.reviewStatus = 0 // 区域运营审批
}
if (val.beforeStatus == 7 && val.afterStatus == 5) {
val.reviewStatus = 1 // 区域审核不通过
}
if (
([0, 1, 2, 8].includes(val.beforeStatus) &&
[0, 1, 2, 3].includes(val.afterStatus)) ||
(val.beforeStatus == 7 && val.afterStatus == 8)
) {
val.reviewStatus = 2 // 总部审核
}
if (
[0, 1, 2, 3].includes(val.beforeStatus) &&
val.afterStatus == 5
) {
val.reviewStatus = 3 // 总部审核不通过
}
if (val.afterStatus == 4) {
val.reviewStatus = 4 // 待退款
}
if (val.transferStatus == 3) {
val.reviewStatus = 5 // 已退款
}
val.orderCode = pageOptions.orderCode
if (val.createdDate)
val.createdDate = dayjs(val.createdDate).format(
'YYYY-MM-DD HH:mm:ss'
)
if (val.refundTime)
val.refundTime = dayjs(val.refundTime).format(
'YYYY-MM-DD HH:mm:ss'
)
val.remark =
val.remark ||
`你的申请被【${val.oaSpFailAuditorName || '总部'}】驳回,请联系驳回人员!`
val.refundPayTypeText = refundPayTypeObj[val.refundPayType] || ''
})
this.setData({
list: data || []
})
}
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
onReady() {},
/**
* 生命周期函数--监听页面显示
......@@ -167,35 +198,25 @@ Page({
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
onHide() {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
onUnload() {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
onPullDownRefresh() {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
onReachBottom() {},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file
onShareAppMessage() {}
})
import api from "../../api"
import api from '../../api'
import { getWaitAuditCountAPI } from '~/api/api'
import dayjs from 'dayjs'
// packageWorkspace/pages/refundOperationList/refundOperationList.js
const obj = [{
label: '退款类型',
key: 'refundPayTypeText'
}, {
label: '订单编号',
key: 'orderCode'
}, {
label: '申请人',
arr: ['applyStaffYqMerchantName', 'applyStaffName']
}, {
label: '申请时间',
key: 'createdDate'
}, {
label: '审批状态',
key: 'reviewText'
},]
const obj = [
{
label: '退款类型',
key: 'refundPayTypeText'
},
{
label: '订单编号',
key: 'orderCode'
},
{
label: '申请人',
arr: ['applyStaffYqMerchantName', 'applyStaffName']
},
{
label: '申请时间',
key: 'createdDate'
},
{
label: '审批状态',
key: 'reviewText'
}
]
Page({
/**
* 页面的初始数据
*/
data: {
tabList: [{
text: '全部'
}, {
text: '待审批',
count: 0
}, {
text: '已审批'
}],
tabList: [
{
text: '全部'
},
{
text: '待审批',
count: 0
},
{
text: '已审批'
}
],
activeIndex: 0,
flag: false,
list: [],
......@@ -53,42 +62,52 @@ Page({
color: '#F24724'
}
},
reviewObj: [ // 非门店收款申请退款 未审批
reviewObj: [
// 非门店收款申请退款 未审批
...obj,
{
label: '退款状态',
key: 'refundText'
}, {
label: '订单支付总额',
key: 'orderTotalPrice',
unit: true
}, {
label: '退款申请金额',
key: 'applyRefundAmount',
unit: true
}],
orderObj: [ // 非门店收款申请退款 已审批(通过/不通过)
{
label: '退款状态',
key: 'refundText'
},
{
label: '订单支付总额',
key: 'orderFinalPrice',
unit: true
},
{
label: '退款申请金额',
key: 'applyRefundAmount',
unit: true
}
],
orderObj: [
// 非门店收款申请退款 已审批(通过/不通过)
...obj,
{
label: '审批人',
key: 'auditor'
}, {
label: '退款状态',
key: 'refundText'
}, {
label: '订单支付总额',
key: 'orderTotalPrice',
unit: true
}, {
label: '退款申请金额',
key: 'applyRefundAmount',
unit: true
}],
labelObj: [ // 门店收款标记退款待审批
{
label: '审批人',
key: 'auditor'
},
{
label: '退款状态',
key: 'refundText'
},
{
label: '订单支付总额',
key: 'orderFinalPrice',
unit: true
},
{
label: '退款申请金额',
key: 'applyRefundAmount',
unit: true
}
],
labelObj: [
// 门店收款标记退款待审批
...obj,
{
label: '订单支付总额',
key: 'orderTotalPrice',
key: 'orderFinalPrice',
unit: true
},
{
......@@ -97,7 +116,8 @@ Page({
unit: true
}
],
reviewLabelObj: [ // 门店收款标记退款已审批(通过/不通过)
reviewLabelObj: [
// 门店收款标记退款已审批(通过/不通过)
...obj,
{
label: '审批人',
......@@ -105,7 +125,7 @@ Page({
},
{
label: '订单支付总额',
key: 'orderTotalPrice',
key: 'orderFinalPrice',
unit: true
},
{
......@@ -124,8 +144,7 @@ Page({
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
onLoad(options) {},
scrollonReachBottom() {
this.getList()
......@@ -137,18 +156,21 @@ Page({
list: [],
pageNum: 1,
flag: false,
nothing: false,
nothing: false
})
this.getList()
this.getStatByStatus()
},
tabClick(e) {
this.setData({
tabIndex: e.detail
}, () => {
this.search()
})
this.setData(
{
tabIndex: e.detail
},
() => {
this.search()
}
)
},
// 获取待审批数目
getStatByStatus() {
......@@ -156,81 +178,102 @@ Page({
let { activeIndex, nothing } = this.data
const status = activeIndex == 1 ? 0 : activeIndex == 2 ? 1 : ''
if (nothing) return
getWaitAuditCountAPI({sceneType: userInfo?.sceneType, status}).then(res => {
let { code, data } = res
if (code == 0) {
this.setData({
[`tabList[1].count`]: data.waiteForAuditNum || 0
})
getWaitAuditCountAPI({ sceneType: userInfo?.sceneType, status }).then(
res => {
let { code, data } = res
if (code == 0) {
this.setData({
[`tabList[1].count`]: data.waiteForAuditNum || 0
})
}
}
})
)
},
// 获取列表数据
getList() {
let { pageNum, tabIndex, nothing, reviewStatusObj, refundPayTypeObj } = this.data
let { pageNum, tabIndex, nothing, reviewStatusObj, refundPayTypeObj } =
this.data
let userInfo = wx.$util.getUserInfo()
if (nothing) return
const auditStatus = tabIndex == 1 ? 0 : tabIndex == 2 ? 3 : ''
wx.$util.showLoading()
api.getRefundReviewListAPI({sceneType: userInfo.sceneType, auditStatus, pageNum, pageSize: 4}).then(res => {
wx.$util.hideLoading()
let total = 0
let list = []
let {
code,
data,
message
} = res
if (code == 0) {
data?.list?.forEach(val => {
val.reviewText = reviewStatusObj[val.auditStatus]?.text
if (val.beforeStatus == 6 && val.afterStatus == 7) {
val.refundText = '区域运营审核中' // 区域运营审批
val.refundStatus = 0
}
if (val.beforeStatus == 7 && val.afterStatus == 5) {
val.refundText = '区域运营审核不通过' // 区域审核不通过
val.refundStatus = 1
}
if (([0, 1, 2, 8].includes(val.beforeStatus) && [0, 1, 2, 3].includes(val.afterStatus)) || (val.beforeStatus == 7 && val.afterStatus == 8)) {
val.refundText = '总部审核' // 总部审核
val.refundStatus = 2
}
if ([0, 1, 2, 3].includes(val.beforeStatus) && val.afterStatus == 5) {
val.refundText = '总部审核不通过' // 总部审核不通过
val.refundStatus = 3
}
if (val.afterStatus == 4) {
val.refundText = '待退款'
val.refundStatus = 4
}
if (val.transferStatus == 3) {
val.refundText = '已退款' // 已退款
val.refundStatus = 5
}
if (val.createdDate) val.createdDate = dayjs(val.createdDate).format("YYYY-MM-DD HH:mm:ss")
if (val.refundTime) val.refundTime = dayjs(val.refundTime).format("YYYY-MM-DD HH:mm:ss")
val.remark = val.remark || `你的申请被【${val.oaSpFailAuditorName || '总部'}】驳回,请联系驳回人员!`
val.refundPayTypeText = refundPayTypeObj[val.refundPayType] || ''
})
list = data.list
total = data.total
} else {
wx.$util.showToast(message)
}
if (total != 0) {
api
.getRefundReviewListAPI({
sceneType: userInfo.sceneType,
auditStatus,
pageNum,
pageSize: 4
})
.then(res => {
wx.$util.hideLoading()
let total = 0
let list = []
let { code, data, message } = res
if (code == 0) {
data?.list?.forEach(val => {
val.reviewText = reviewStatusObj[val.auditStatus]?.text
if (val.beforeStatus == 6 && val.afterStatus == 7) {
val.refundText = '区域运营审核中' // 区域运营审批
val.refundStatus = 0
}
if (val.beforeStatus == 7 && val.afterStatus == 5) {
val.refundText = '区域运营审核不通过' // 区域审核不通过
val.refundStatus = 1
}
if (
([0, 1, 2, 8].includes(val.beforeStatus) &&
[0, 1, 2, 3].includes(val.afterStatus)) ||
(val.beforeStatus == 7 && val.afterStatus == 8)
) {
val.refundText = '总部审核' // 总部审核
val.refundStatus = 2
}
if (
[0, 1, 2, 3].includes(val.beforeStatus) &&
val.afterStatus == 5
) {
val.refundText = '总部审核不通过' // 总部审核不通过
val.refundStatus = 3
}
if (val.afterStatus == 4) {
val.refundText = '待退款'
val.refundStatus = 4
}
if (val.transferStatus == 3) {
val.refundText = '已退款' // 已退款
val.refundStatus = 5
}
if (val.createdDate)
val.createdDate = dayjs(val.createdDate).format(
'YYYY-MM-DD HH:mm:ss'
)
if (val.refundTime)
val.refundTime = dayjs(val.refundTime).format(
'YYYY-MM-DD HH:mm:ss'
)
val.remark =
val.remark ||
`你的申请被【${val.oaSpFailAuditorName || '总部'}】驳回,请联系驳回人员!`
val.refundPayTypeText = refundPayTypeObj[val.refundPayType] || ''
})
list = data.list
total = data.total
} else {
wx.$util.showToast(message)
}
if (total != 0) {
this.setData({
[`list[${pageNum - 1}]`]: list
})
}
this.setData({
[`list[${pageNum - 1}]`]: list
total,
flag: true,
triggered: false,
pageNum: pageNum + 1,
nothing: pageNum == data.pages
})
}
this.setData({
total,
flag: true,
triggered: false,
pageNum: pageNum + 1,
nothing: pageNum == data.pages
})
})
},
jump(e) {
......@@ -243,9 +286,7 @@ Page({
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
onReady() {},
/**
* 生命周期函数--监听页面显示
......@@ -257,35 +298,25 @@ Page({
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
onHide() {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
onUnload() {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
onPullDownRefresh() {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
onReachBottom() {},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file
onShareAppMessage() {}
})
// packageWorkspace/pages/validReferralCount/components/detailItem/detailItem.js
const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/miniprogram/regional-assistant/'
Component({
properties: {
item: {
type: Object,
value: {},
observer(newVal) {
if (newVal) {
this.initData(newVal);
}
}
}
},
data: {
IMG_URL,
// 业务场景:1-精品升级(轻改);2-会员权益(广联权益);3-单延保;
sceneMap: {
1: '轻改',
2: '广联权益',
3: '单延保'
},
fileList: []
},
methods: {
initData(item) {
if (item.imageUrls) {
const urls = item.imageUrls.split(',').filter(i => i);
const fileList = urls.map(url => ({
fileUrl: url,
}));
this.setData({ fileList });
} else {
this.setData({ fileList: [] });
}
},
previewImage(e) {
const { index } = e.currentTarget.dataset;
const { fileList } = this.data;
const urls = fileList.map(v => v.fileUrl);
wx.previewImage({
urls: urls,
current: urls[index]
});
}
}
})
/* packageWorkspace/pages/validReferralCount/components/detailItem/detailItem.wxss */
.detail-item-container {
background-color: #fff;
border-radius: 16rpx;
// padding: 24rpx; // Assuming padding inside container
}
.header {
margin-bottom: 20rpx;
}
.title-bar {
display: flex;
align-items: center;
font-weight: 500;
margin: 16rpx 0;
image {
width: 6rpx;
height: 24rpx;
margin-right: 16rpx;
}
}
.title {
font-size: 30rpx;
font-weight: bold;
color: #333;
}
.brand-list {
margin-bottom: 30rpx;
}
.brand-item {
margin-bottom: 30rpx;
&:last-child {
margin-bottom: 0;
}
}
.data-grid {
display: flex;
justify-content: space-between;
align-items: flex-start;
}
.grid-col {
display: flex;
flex-direction: column;
padding-right: 28rpx;
&:first-child {
width: 184rpx;
}
&:last-child {
flex-shrink: 0;
width: 252rpx;
padding-right: 0;
}
}
.label-text {
font-size: 24rpx;
color: #999;
margin-bottom: 12rpx;
line-height: 1.2;
}
.value-text {
font-size: 32rpx;
color: #1989fa; // Blue color
font-weight: 500;
}
.section {
margin-bottom: 30rpx;
}
.section-title {
margin-bottom: 20rpx;
}
.label {
font-size: 28rpx;
color: #333;
font-weight: 600;
}
.image-list {
display: flex;
flex-wrap: wrap;
gap: 20rpx;
}
.image-item {
width: 192rpx;
height: 192rpx;
border-radius: 12rpx;
background-color: #F5F5F7;
}
.remark-content {
font-size: 28rpx;
color: #333;
line-height: 1.5;
text-align: justify;
word-break: break-all;
}
<!--packageWorkspace/pages/validReferralCount/components/detailItem/detailItem.wxml-->
<wxs module="utils">
var formatBrandName = function (name) {
if (!name) return '';
if (name.length > 10) {
return name.substring(0, 10) + '...';
}
return name;
}
module.exports = {
formatBrandName: formatBrandName
}
</wxs>
<view class="detail-item-container">
<!-- Title -->
<view class="header">
<view class="title-bar">
<image src="{{IMG_URL}}title_icon.png" mode="" />
<text class="title">{{sceneMap[item.sceneType] || ''}}</text>
</view>
</view>
<!-- List of Brands -->
<view class="brand-list">
<block wx:for="{{item.effectiveReferralCountDTOS}}" wx:key="brandType" wx:for-item="dto">
<view class="brand-item">
<!-- Grid Layout -->
<view class="data-grid">
<!-- Column 1: Delivery Count -->
<view class="grid-col">
<view class="label-text">{{utils.formatBrandName(dto.brandName)}}交车数</view>
<view class="value-text">{{(dto.deliveryCount === null || dto.deliveryCount === undefined) ? '-' : dto.deliveryCount}}</view>
</view>
<!-- Column 2: Effective Referral Count -->
<view class="grid-col">
<view class="label-text">有效引荐数</view>
<view class="value-text">{{(dto.effectiveReferralCount === null || dto.effectiveReferralCount === undefined) ? '-' : dto.effectiveReferralCount}}</view>
</view>
<!-- Column 3: Reviewed Effective Count -->
<view class="grid-col">
<view class="label-text">运营修正有效引荐数</view>
<view class="value-text">{{(dto.reviewedEffectiveCount === null || dto.reviewedEffectiveCount === undefined) ? '-' : dto.reviewedEffectiveCount}}</view>
</view>
</view>
</view>
</block>
</view>
<!-- Evidence -->
<view class="section" wx:if="{{fileList.length > 0}}">
<view class="section-title label">凭证</view>
<view class="image-list" wx-if="{{fileList.length}}">
<block wx:for="{{fileList}}" wx:key="index">
<image class="image-item" src="{{item.fileUrl}}" mode="aspectFill" data-index="{{index}}" bindtap="previewImage" />
</block>
</view>
<view wx:else>
<empty-data />
</view>
</view>
<!-- Remark -->
<view class="section" style="margin: 0;">
<view class="section-title label">备注</view>
<view class="remark-content">
<text>{{item.remark || '-'}}</text>
</view>
</view>
</view>
\ No newline at end of file
// packageWorkspace/pages/validReferralCount/components/editItem/editItem.js
import api from '~/api/api.js'
const IMG_URL =
'https://img02.glsx.com.cn/weapp/resource/miniprogram/regional-assistant/'
Component({
properties: {
item: {
type: Object,
value: {},
observer(newVal, oldVal) {
if (newVal) {
const newUrls = newVal.imageUrls || "";
const oldUrls = (oldVal && oldVal.imageUrls) || "";
if (newUrls !== oldUrls) {
this.initData(newVal);
}
this.checkRemarkRequired(newVal);
}
},
},
},
data: {
IMG_URL,
// 业务场景:1-精品升级(轻改);2-会员权益(广联权益);3-单延保;
sceneMap: {
1: "轻改",
2: "广联权益",
3: "单延保",
},
isRemarkRequired: false,
fileList: [],
fileMaxLen: 15,
},
lifetimes: {
attached() {
if (this.data.item) {
this.checkRemarkRequired(this.data.item);
}
},
},
methods: {
initData(item) {
// Initialize fileList from imageUrls
if (item.imageUrls) {
const urls = item.imageUrls.split(",").filter((i) => i);
const fileList = urls.map((url) => ({
fileUrl: url,
}));
this.setData({ fileList });
} else {
this.setData({ fileList: [] });
}
},
// Check if remark is required
checkRemarkRequired(item) {
let isRequired = false;
const list = item?.effectiveReferralCountDTOS || [];
for (const dto of list) {
const referral = parseInt(dto.effectiveReferralCount || 0, 10);
const delivery = parseInt(dto.deliveryCount || 0, 10);
if (referral != delivery) {
isRequired = true;
break;
}
}
this.setData({ isRemarkRequired: isRequired });
},
// Handle Effective Referral Count Change
onCountChange(e) {
const index = e.currentTarget.dataset.index;
let value = e.detail;
// Ensure it's a string
value = String(value);
// Remove any non-digit characters (integer only)
let sanitizedValue = value.replace(/\D/g, "");
// Handle range check (0-100,000,000)
if (sanitizedValue !== "") {
let num = parseInt(sanitizedValue, 10);
if (num > 100000000) {
num = 100000000;
}
sanitizedValue = String(num);
}
const key = `item.effectiveReferralCountDTOS[${index}].effectiveReferralCount`;
this.setData(
{
[key]: sanitizedValue,
},
() => {
// Re-check remark requirement
this.checkRemarkRequired(this.data.item);
this.triggerEvent("change", this.data.item);
},
);
},
// Handle Remark Change
onRemarkChange(e) {
this.setData(
{
"item.remark": e.detail.value,
},
() => {
this.triggerEvent("change", this.data.item);
},
);
},
// Upload Images
uploadImages() {
let _this = this;
let { fileList, fileMaxLen } = _this.data;
getApp().globalData.isChoosingMedia = true;
wx.chooseMedia({
count: fileMaxLen - fileList?.length,
sizeType: ["original"],
mediaType: ["image"],
complete() {
setTimeout(() => {
getApp().globalData.isChoosingMedia = false;
}, 500);
},
success(res) {
wx.showLoading({ title: "上传中" });
_this.setData({
loadingFlag: true,
});
const uploadImages = async (tempFiles) => {
try {
for (const item of tempFiles) {
const val = item.tempFilePath;
const imgType = val.split(".")[1];
const type = imgType === "unknown" ? "jpg" : imgType;
const _res = await new Promise((resolve, reject) => {
wx.getFileSystemManager().readFile({
filePath: val,
encoding: "base64",
success: resolve,
fail: reject,
});
});
const img = await api.uploadImg({
file: `${type}@${_res.data}`,
});
const { code, data, message } = img;
if (code == 0) {
fileList.push({ fileUrl: data });
_this.setData({
fileList,
});
_this.updateImageUrls(fileList);
} else {
wx.showToast({ title: message, icon: "none" });
}
}
} catch (error) {
wx.$util.showToast("上传失败,请重试");
} finally {
wx.hideLoading();
_this.setData({
loadingFlag: false,
});
}
};
uploadImages(res?.tempFiles);
},
});
},
// Preview Image
previewImage(e) {
let { url, index } = e.currentTarget.dataset;
let imageUrl = url?.map((v) => {
return v.fileUrl;
});
wx.previewImage({
urls: imageUrl,
current: imageUrl[index],
});
},
// Delete File
deleteFile(e) {
let { index } = e.currentTarget.dataset;
let { fileList } = this.data;
fileList.splice(index, 1);
this.setData({ fileList });
this.updateImageUrls(fileList);
},
updateImageUrls(fileList) {
const urls = fileList.map((file) => file.fileUrl).join(",");
this.setData(
{
"item.imageUrls": urls,
},
() => {
this.triggerEvent("change", this.data.item);
},
);
},
// Validate Referral Counts
validateReferralCounts() {
const { effectiveReferralCountDTOS, remark } = this.data.item;
const { isRemarkRequired, fileList } = this.data;
if (effectiveReferralCountDTOS && effectiveReferralCountDTOS.length > 0) {
for (const dto of effectiveReferralCountDTOS) {
const val = dto.effectiveReferralCount;
if (val == null || val == undefined || val === "") {
wx.showToast({
title: `${dto.brandName}交车数有效引荐数未填`,
icon: "none",
});
return false;
}
}
}
if (isRemarkRequired) {
if (fileList.length === 0) {
wx.showToast({
title: "有效引荐数与交车数不一致,请上传凭证",
icon: "none",
});
return false;
}
if (!remark) {
wx.showToast({
title: "有效引荐数与交车数不一致,请填写备注",
icon: "none",
});
return false;
}
}
return true;
},
// Save Draft
onDraft() {
if (!this.validateReferralCounts()) return;
this.triggerEvent("draft", this.data.item);
},
// Submit
onSubmit() {
if (!this.validateReferralCounts()) return;
this.triggerEvent("submit", this.data.item);
},
},
});
{
"component": true,
"usingComponents": {
"van-cell": "@vant/weapp/cell/index",
"van-cell-group": "@vant/weapp/cell-group/index",
"van-field": "@vant/weapp/field/index",
"van-uploader": "@vant/weapp/uploader/index",
"van-button": "@vant/weapp/button/index",
"van-icon": "@vant/weapp/icon/index"
}
}
\ No newline at end of file
/* packageWorkspace/pages/validReferralCount/components/editItem/editItem.wxss */
.edit-item-container {
background-color: #fff;
border-radius: 16rpx;
}
.header {
margin-bottom: 20rpx;
}
.title-bar {
display: flex;
align-items: center;
font-weight: 500;
margin: 16rpx 0 24rpx;
image {
width: 6rpx;
height: 24rpx;
margin-right: 16rpx;
}
}
.title {
font-size: 30rpx;
font-weight: bold;
color: #333;
}
.brand-item {
border-bottom: 1rpx solid #e6e7eb;
border-radius: 16rpx 16rpx 0 0;
margin-bottom: 20rpx;
}
.ellipsis {
overflow: hidden;
display: -webkit-box !important;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
word-break: break-all;
}
.info-row {
display: flex;
align-items: center;
margin-bottom: 4rpx;
font-size: 28rpx;
// padding: 0 32rpx;
}
.flex {
display: flex;
}
.label {
font-size: 28rpx;
color: #333;
}
.label-tip {
font-size: 28rpx;
color: #999999;
}
.brand-name {
display: inline-block;
max-width: 372rpx;
}
.info-row .value {
color: #2C66F7;
margin-left: 8rpx;
}
.notes {
font-size: 24rpx;
color: #888888;
margin-bottom: 24rpx;
}
.section {
margin-bottom: 30rpx;
}
.section-title {
margin-bottom: 24rpx;
}
.remark-box {
background-color: #f7f8fa;
padding: 20rpx;
border-radius: 16rpx;
}
.remark-textarea {
width: 100%;
height: 160rpx;
font-size: 28rpx;
color: #333;
}
.footer {
background-color: #fff;
display: flex;
justify-content: space-between;
}
.btn-wrapper {
flex: 1;
}
.btn-wrapper:first-child {
margin-right: 24rpx;
}
.btn {
height: 64rpx !important;
border-radius: 16rpx !important;
border: none !important;
}
.btn-draft {
background-color: #e8f0fe !important;
color: #2C66F7 !important;
}
.btn-submit {
background-color: #2C66F7 !important;
color: #fff !important;
}
.field-no-padding {
padding-left: 0 !important;
padding-right: 0 !important;
}
.upload_box {
.content_box {
display: flex;
flex-wrap: wrap;
gap: 24rpx;
.image_content {
display: inline-block;
position: relative;
border-radius: 12rpx;
overflow: hidden;
.image_box {
width: 192rpx;
height: 192rpx;
display: block;
border-radius: 12rpx;
background-color: #F5F5F7;
}
.del_icon {
width: 36rpx;
height: 36rpx;
position: absolute;
top: 12rpx;
right: 12rpx;
z-index: 2;
}
}
.upload_content {
width: 192rpx;
height: 192rpx;
background: #F5F5F7;
border-radius: 12rpx;
display: flex;
flex-flow: column;
align-items: center;
justify-content: center;
image {
width: 40rpx;
height: 40rpx;
}
.text {
font-size: 24rpx;
color: #9B9B9E;
margin-top: 20rpx;
}
}
}
}
<!--packageWorkspace/pages/validReferralCount/components/editItem/editItem.wxml-->
<view class="edit-item-container">
<!-- Title -->
<view class="header">
<view class="title-bar">
<image src="{{IMG_URL}}title_icon.png" mode=""/>
<text class="title">{{sceneMap[item.sceneType] || ''}}</text>
</view>
</view>
<!-- List of Brands -->
<view class="brand-list">
<block wx:for="{{item.effectiveReferralCountDTOS}}" wx:key="brandType" wx:for-item="dto" wx:for-index="idx">
<view class="brand-item">
<!-- Delivery Count Row -->
<view class="info-row flex">
<text class="label brand-name ellipsis">{{dto.brandName}}</text>
<text class="label">交车数</text>
<text class="value">{{dto.deliveryCount}}</text>
</view>
<!-- Input Row -->
<van-cell-group border="{{false}}">
<van-field
value="{{ dto.effectiveReferralCount }}"
placeholder="请输入"
type="number"
border="{{ false }}"
bind:change="onCountChange"
data-index="{{idx}}"
input-align="right"
custom-class="field-no-padding"
>
<view slot="label" class="label-tip">
有效引荐数<text style="color: #ee0a24; margin-left: 8rpx;">*</text>
</view>
</van-field>
</van-cell-group>
</view>
</block>
</view>
<!-- Notes -->
<view class="notes">
剔除试驾车、HW大客户、拖车、门店有痕报备无法引荐的
</view>
<!-- Uploader -->
<view class="section">
<view class="section-title label">
上传凭证<text wx:if="{{isRemarkRequired}}" style="color: #ee0a24; margin-left: 8rpx;">*</text>
</view>
<view class="upload_box">
<view class="content_box">
<view class="image_content" wx:for="{{fileList}}" wx:key="index">
<image bindtap="previewImage" class="image_box" data-url="{{fileList}}" data-index="{{index}}" src="{{item.fileUrl}}"/>
<image class="del_icon" src="{{IMG_URL}}zy_paf_del_icon.png" mode="" bindtap="deleteFile" data-index="{{index}}" />
</view>
<view class="upload_content" bindtap="uploadImages" wx:if="{{fileList.length < fileMaxLen}}">
<image src="{{IMG_URL}}zy-upload_icon.png"></image>
<text class="text">{{fileList.length}}/{{fileMaxLen}}</text>
</view>
</view>
</view>
</view>
<!-- Remark -->
<view class="section">
<view class="section-title label">
备注<text wx:if="{{isRemarkRequired}}" style="color: #ee0a24; margin-left: 8rpx;">*</text>
</view>
<view class="remark-box">
<textarea
class="remark-textarea"
placeholder="请输入(300字以内)"
value="{{item.remark}}"
bindinput="onRemarkChange"
maxlength="300"
></textarea>
</view>
</view>
<!-- Footer Buttons -->
<view class="footer">
<view class="btn-wrapper">
<van-button type="default" block custom-class="btn btn-draft" bind:click="onDraft">存草稿</van-button>
</view>
<view class="btn-wrapper">
<van-button type="info" block custom-class="btn btn-submit" bind:click="onSubmit">提交</van-button>
</view>
</view>
</view>
// packageWorkspace/pages/validReferralCount/referraCountEdit/referraCountEdit.js
import api from '../../../api'
Page({
/**
* 页面的初始数据
*/
data: {
routerParams: {},
detailInfo: {},
loading: false,
/** 本次草稿/提交的业务场景
* 1-精品升级(轻改);2-会员权益(广联权益);3-单延保;
* 用于存草稿/提交后,仅更新当前的场景值
*/
editCurScene: null
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.setData({
routerParams: JSON.parse(options.info)
});
// 提交状态:0-未提交 1-已提交
wx.setNavigationBarTitle({
title: (this.data.routerParams.submitStatus == 0 && this.data.routerParams.updateFlag == 1) ? '编辑门店引荐数' : '查看门店引荐数'
})
this.getDetail();
},
defaultFillVal(data) {
data.sceneTypeEffectiveReferrals.forEach(item => {
// updateFlag 是否可编辑:0-不可编辑,1-可编辑(优先级最高)
// status状态:0-未提交,1-草稿,2-已提交
if (item.status == 0 && data.updateFlag == 1) {
if (item.effectiveReferralCountDTOS && item.effectiveReferralCountDTOS.length) {
item.effectiveReferralCountDTOS.forEach(k => {
k.effectiveReferralCount = (k.deliveryCount || 0) + ''
})
}
}
})
return data || {}
},
dealEditedVal(data) {
let { editCurScene, detailInfo } = this.data
console.log(detailInfo)
// updateFlag 是否可编辑:0-不可编辑,1-可编辑(优先级最高)
// status状态:0-未提交,1-草稿,2-已提交
if (data.updateFlag == 1) {
detailInfo.sceneTypeEffectiveReferrals.forEach((item, idx) => {
let obj = data.sceneTypeEffectiveReferrals.find(k => k.sceneType == item.sceneType)
if (editCurScene == item.sceneType || obj.status == 2) {
detailInfo.sceneTypeEffectiveReferrals[idx] = obj
}
})
} else {
detailInfo = data
}
return detailInfo || {}
},
// Simulate fetching data from backend
getDetail() {
let { merchantId, reviewMonth } = this.data.routerParams
let { editCurScene } = this.data
const params = {
merchantId,
reviewMonth
}
api.getReferralDetail(params).then(res => {
let { code, data, message } = res;
if (code == 0) {
let list = editCurScene != null ? this.dealEditedVal(data) : this.defaultFillVal(data)
this.setData({
detailInfo: list,
editCurScene: null
})
}
})
},
handleEditChange(e) {
const { detailInfo } = this.data
const updatedItem = e.detail;
const idx = detailInfo.sceneTypeEffectiveReferrals.findIndex(item => item.sceneType == updatedItem.sceneType)
detailInfo.sceneTypeEffectiveReferrals[idx] = updatedItem
this.setData({
detailInfo
})
},
// Handle Save Draft
onDraft(e) {
const updatedItem = e.detail;
console.log('Save Draft:', updatedItem);
this.updateLocalList('draft', updatedItem);
},
// Handle Submit
onSubmitItem(e) {
const updatedItem = e.detail;
console.log('Submit Item:', updatedItem);
this.updateLocalList('submit', updatedItem);
},
/** typeStatus: 草稿(draft),提交(submit) */
updateLocalList(typeStatus, updatedItem) {
let { loading } = this.data
if (loading) {
return
}
// const targetItem = updatedItem.sceneTypeEffectiveReferrals;
// const index = list.findIndex(item => item.sceneType === updatedItem.sceneType);
const tipsObj = {
'draft': '数据保存成功,未提交复核。',
'submit': '有效引荐数提交成功。',
}
const params = {
// 1-草稿,2-已提交
...updatedItem,
status: typeStatus == 'submit' ? 2 : 1
}
console.log(params, 'params---')
wx.$util.showLoading()
this.setData({
loading: true,
editCurScene: updatedItem.sceneType || null
})
api.referralSubmit(params).then(res => {
let { code, data, message } = res
wx.$util.showToast(code == '0' ? `${tipsObj[typeStatus]}` : message);
this.getDetail()
}).finally(() => {
wx.hideLoading();
this.setData({
loading: false
})
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
{
"navigationBarTitleText": "编辑门店引荐数",
"usingComponents": {
"edit-item": "../components/editItem/editItem",
"detail-item": "../components/detailItem/detailItem"
}
}
/* packageWorkspace/pages/validReferralCount/referraCountEdit/referraCountEdit.wxss */
page {
background: #F2F3F7;
}
.container {
padding: 24rpx;
min-height: 100vh;
box-sizing: border-box;
}
.edit-box {
background: #FFFFFF;
border-radius: 32rpx;
padding: 24rpx 32rpx;
margin-bottom: 24rpx;
}
.merchant-name {
color: #222222;
font-size: 28rpx;
margin-bottom: 28rpx;
font-weight: 600;
}
.edit-item-wrapper {
display: block;
}
<!--packageWorkspace/pages/validReferralCount/referraCountEdit/referraCountEdit.wxml-->
<view class="container">
<view wx:for="{{detailInfo.sceneTypeEffectiveReferrals}}" class="edit-box">
<view class="merchant-name" wx:if="{{index == 0}}">{{detailInfo.merchantName}}</view>
<!-- updateFlag 是否可编辑:0-不可编辑,1-可编辑(优先级最高)
status 状态:0-未提交,1-草稿,2-已提交 -->
<block wx:if="{{item.status == 2 || detailInfo.updateFlag == 0 }}">
<detail-item
item="{{item}}"
class="edit-item-wrapper"
/>
</block>
<!-- Render Edit View if status is 0 (Unsubmitted) or 1 (Draft) -->
<block wx:else>
<edit-item
item="{{item}}"
bind:change="handleEditChange"
bind:draft="onDraft"
bind:submit="onSubmitItem"
class="edit-item-wrapper"
/>
</block>
</view>
</view>
// packageWorkspace/pages/validReferralCount/referralCountList/referralCountList.js
import api from "../../../api"
Page({
/**
* 页面的初始数据
*/
data: {
searchObj: {
merchantName: "",
reviewMonth: "",
submitStatus: "",
},
list: [],
filterConfig: [
{
type: "month",
label: "月份",
key: "reviewMonth",
minDate: "2025-11",
},
{
type: "select",
label: "状态",
key: "submitStatus",
showKey: "submitStatusTxt",
optionId: "confId",
optionLabel: "confLabel",
optionsName: "submitStatusList",
optionList: [],
},
],
orderStatusMap: {
0: { name: "未提交", color: "#FF9D0A", background: "#ff9d0a1a" },
1: { name: "已提交", color: "#35C376", background: "#35C3761a" },
},
orderItem: [
{
label: "单延保",
key: "singleExtendedWarrantySubmitStatus",
},
{
label: "广联权益",
key: "interestSubmitStatus",
},
{
label: "轻改",
key: "lightModificationSubmitStatus",
},
],
singleSubmitStatusMap: {
0: "未提交",
1: "草稿",
2: "已提交",
},
baseData: {
submitStatusList: [
{
confLabel: "未提交",
confId: "0",
},
{
confLabel: "已提交",
confId: "1",
},
],
},
},
/**
* Filter Change Handler
*/
onFilterChange(e) {
console.log("Filter Changed:", e.detail);
this.setData({
searchObj: e.detail,
});
if(!this.data.searchObj.reviewMonth) {
this.defaultMonth()
}
this.search();
// TODO: Call API to fetch data with new filters
},
search() {
this.setData({
list: [],
nothing: false,
});
this.getList();
},
getList() {
let { nothing, searchObj, flag } = this.data;
if (nothing) return;
if (flag) return;
this.setData({
flag: true
})
wx.$util.showLoading();
api
.getReferralList({
...searchObj
})
.then((res) => {
wx.$util.hideLoading();
let list = [];
let { code, data, message } = res;
if (code == 0) {
list = data;
} else {
wx.$util.showToast(message);
}
this.setData({
list: list,
triggered: false,
nothing: !!list.length,
});
}).finally(() => {
this.setData({
flag: false
});
});
},
scrollonReachBottom() {
this.getList();
},
getOptionsList(formName, refreshSigle) {
const formList = this.data[formName];
const { baseData } = this.data;
if (refreshSigle) {
var item = formList.find((k) => k.key == refreshSigle);
var index = formList.findIndex((k) => k.key == refreshSigle);
this.setData({
[`${formName}[${index}].optionList`]: wx.$util.deepClone(
baseData[item.optionsName],
),
});
} else {
formList.forEach((item, index) => {
if (
["select", "radio"].includes(item.type) &&
baseData[item.optionsName].length
) {
this.setData({
[`${formName}[${index}].optionList`]: wx.$util.deepClone(
baseData[item.optionsName],
),
});
}
});
}
},
handleDetail(e) {
let { target } = e.currentTarget.dataset;
wx.navigateTo({
url:
"/packageWorkspace/pages/validReferralCount/referraCountEdit/referraCountEdit?info=" +
JSON.stringify(target),
});
},
defaultMonth() {
const date = new Date();
date.setMonth(date.getMonth() - 1); // 取上个月
const year = date.getFullYear();
const month = (date.getMonth() + 1).toString().padStart(2, "0");
this.setData({
"searchObj.reviewMonth": `${year}-${month}`,
});
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.defaultMonth();
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
onReady() {},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
this.getOptionsList("filterConfig");
this.search();
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
onHide() {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
onUnload() {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
onPullDownRefresh() {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
onReachBottom() {},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file
onShareAppMessage() {},
});
{
"usingComponents": {}
"usingComponents": {
"FilterBar": "/components/FilterBar/FilterBar"
}
}
\ No newline at end of file
/* packageWorkspace/pages/validReferralCount/referralCountList/referralCountList.wxss */
\ No newline at end of file
/* packageWorkspace/pages/validReferralCount/referralCountList/referralCountList.wxss */
page {
background: #F2F3F7;
}
.list-page {
.flex {
display: flex;
align-items: center;
}
.top-box {
background: #FFFFFF;
}
.list {
.empty-box {
width: 100%;
height: 24rpx;
}
.item {
margin: 0 24rpx 24rpx;
border-radius: 32rpx;
background: #FFFFFF;
padding: 24rpx 32rpx;
.item-top {
display: flex;
justify-content: space-between;
align-items: flex-start;
font-size: 32rpx;
font-weight: 500;
color: #666666;
.code-text {
color: #222222;
margin-right: 28rpx;
overflow: hidden;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
word-break: break-all;
}
.status {
font-size: 24rpx;
flex-shrink: 0;
height: 48rpx;
line-height: 48rpx;
border-radius: 8rpx;
padding: 0 12rpx;
}
}
.order-list {
padding: 24rpx 0 12rpx;
flex-wrap: wrap;
.order {
width: 50%;
display: flex;
font-size: 28rpx;
color: #222222;
margin-bottom: 12rpx;
.order-label {
width: 144rpx;
margin-right: 32rpx;
color: #999999;
}
.order-value {
}
}
}
.btn-box {
flex-direction: row-reverse;
justify-content: space-between;
font-weight: 500;
.label {
font-size: 26rpx;
color: #666666;
margin-right: 16rpx;
}
.unit {
margin-right: 8rpx;
}
.btn {
font-weight: 400;
width: 168rpx;
height: 64rpx;
line-height: 64rpx;
text-align: center;
border-radius: 16rpx;
font-size: 26rpx;
color: #2C66F7;
background: #2c66f71a;
&.primary {
color: #FFFFFF;
background: #2c66f7;
}
}
}
}
}
}
\ No newline at end of file
<!--packageWorkspace/pages/validReferralCount/referralCountList/referralCountList.wxml-->
<text>packageWorkspace/pages/validReferralCount/referralCountList/referralCountList.wxml</text>
\ No newline at end of file
<view class="list-page">
<view class="top-box">
<FilterBar searchPlaceholder="门店名称" searchKey="merchantName" filters="{{filterConfig}}" searchObj="{{searchObj}}" bind:filterChange="onFilterChange"></FilterBar>
</view>
<scroll-view scroll-y enable-back-to-top refresher-enabled="{{ true }}" bindrefresherrefresh="search" bindscrolltolower="scrollonReachBottom" class="list" style="height:calc(100vh - var(--fontSize184));" refresher-threshold="104" refresher-triggered="{{ triggered }}">
<block wx:if="{{ list.length > 0 }}">
<view class="empty-box"></view>
<!-- <block wx:for="{{ list }}" wx:key="index"> -->
<block wx:for="{{ list }}" wx:for-index="ind" wx:key="ind">
<view data-ind="{{ ind }}" data-index="{{ index }}">
<view class="item content" data-ind="{{ ind }}" data-index="{{ index }}" data-item="{{ item }}">
<view class="item-top">
<view class="code">
<text class="code-text">{{item.merchantName}}</text>
</view>
<view class="status text-center" style="color:{{ orderStatusMap[item.submitStatus].color }};background-color:{{orderStatusMap[item.submitStatus].background }};">
{{orderStatusMap[item.submitStatus].name }}
</view>
</view>
<view class="order-list flex">
<block wx:for="{{ orderItem }}" wx:for-index="sindex" wx:for-item="i">
<view class="order" wx-if="{{ item[i.key] != null }}" wx:key="sindex">
<view class="order-label">{{i.label}}</view>
<view class="order-value">{{singleSubmitStatusMap[item[i.key]]}}</view>
</view>
</block>
</view>
<view class="btn-box flex">
<view bindtap="handleDetail" data-target="{{item}}" class="btn {{(item.submitStatus == 0 && item.updateFlag == 1) ? 'primary' : ''}}">{{(item.submitStatus == 0 && item.updateFlag == 1) ? '编辑' : '查看'}}</view>
</view>
</view>
</view>
</block>
<!-- </block> -->
<block wx:if="{{ nothing }}">
<view class="list-nothing">到底了~</view>
</block>
</block>
<block wx:else>
<empty-data />
</block>
</scroll-view>
</view>
\ No newline at end of file
// pages/tab/workspace/workspace.js
const IMG_URL = "https://img02.glsx.com.cn/weapp/resource/miniprogram/regional-assistant/";
import { getWaitAuditCountAPI, waitstaffstateAPI, getStaffTemplate } from "~/api/api";
import { getWaitAuditCountAPI, waitstaffstateAPI, getStaffTemplate, getOrderWaitForAudit } from "~/api/api";
import Dialog from "@vant/weapp/dialog/dialog";
import { dialogOptions, noticeSort, ServerCenterEnum } from "~/utils/enum/index.js";
......@@ -15,14 +15,12 @@ Page({
IMG_URL,
navBarHeight: 0,
showBanner: true,
approvalMenus: [
{
name: "退款审批",
icon: "refund-review",
url: "packageWorkspace.refundOperationList",
trackingCode: "regional-assistant-refund-approval",
},
],
approvalMenus: [{
name: '退款审批',
icon: 'refund-review',
url: 'packageWorkspace.refundOperationList',
trackingCode: 'regional-assistant-refund-approval'
}],
storeManagementMenus: [
{
name: "驻店管理",
......@@ -78,6 +76,38 @@ Page({
trackingCode: "regional-assistant-talent-analysis",
},
],
compensationMenus: [
{
name: '绩效评分',
path: '/packageWorkspace/pages/performanceRating/rateList/retaList',
icon: 'performance_rating_icon',
trackingCode: 'regional-assistant-performance-rating'
},
{
name: '有效引荐数',
path: '/packageWorkspace/pages/validReferralCount/referralCountList/referralCountList',
icon: 'valid_referrals_icon',
trackingCode: 'regional-assistant-valid-referrals'
},
{
name: '考勤统计',
path: '/packageWorkspace/pages/attendanceStatis/attendanceList/attendanceList',
icon: 'attendance_statistics_icon',
trackingCode: 'regional-assistant-attendance-statistics'
},
{
name: '申诉单',
path: '/packageWorkspace/pages/appealFormManage/appealFormList/appealFormList',
icon: 'appeal_form_icon',
trackingCode: 'regional-assistant-appeal-form'
},
{
name: '订单审核',
path: '/packageWorkspace/pages/orderApprovalManage/orderApprovalList/orderApprovalList',
icon: 'order_approval_icon',
trackingCode: 'regional-assistant-order-approval'
}
],
showReportPopup: false,
reportTemplateList: [],
currentReportItem: null,
......@@ -219,6 +249,8 @@ Page({
this.getWaitAuditCount(userInfo);
// 获取招聘管理待处理数量
this.getWaitStaff();
// 获取待审核订单数量
this.getWaitAudit();
},
);
if (!this.data.isShowingModal) {
......@@ -256,6 +288,20 @@ Page({
})
.catch((err) => {});
},
// 获取订单待审核角标数量
getWaitAudit() {
let { compensationMenus } = this.data
let userInfo = wx.$util.getUserInfo()
let index = compensationMenus.findIndex(e => e.name == '订单审核')
getOrderWaitForAudit({sceneType: userInfo.sceneType }).then(res => {
let { code, data } = res
if (code == 0) {
this.setData({
[`compensationMenus[${index}].tipsNum`]: data.waitAuditNum
})
}
})
},
jump(e) {
// 创建节流函数,1500ms 内只能触发一次
......@@ -289,26 +335,30 @@ Page({
},
jumpTo(e) {
let { url, query, trackingCode, params } = e.currentTarget.dataset.target;
let item = e.currentTarget.dataset.target;
console.log(item, "00000");
if (item.url == "packageWorkspace.supervisorDaily") {
this.openWorkReportTemp(item);
return;
}
let userInfo = wx.$util.getUserInfo();
let { url, query, trackingCode, params, path } =
e.currentTarget.dataset.target
let userInfo = wx.$util.getUserInfo()
// 埋点
if (trackingCode) {
wx.$track.setTrackData(0, trackingCode, {}, "", userInfo?.sceneType);
wx.$track.setTrackData(0, trackingCode, {}, '', userInfo?.sceneType)
let item = e.currentTarget.dataset.target
if (item.url == 'packageWorkspace.supervisorDaily') {
this.openWorkReportTemp(item)
return
}
if (url == "packageWorkspace.receptionRecords" && query) {
if (url == 'packageWorkspace.receptionRecords' && query) {
return wx.navigateTo({
url: "/packageWorkspace/pages/receptionRecords/receptionRecords?hideScore=1",
});
url: '/packageWorkspace/pages/receptionRecords/receptionRecords?hideScore=1'
})
}
if (path) {
wx.navigateTo({
url: `${path}`
})
return
}
wx.$router.go(url, {
params: params || {},
});
params: params || {}
})
},
/**
......
/* pages/tab/workspace/workspace.wxss */
page {
background: #f2f3f7;
background: #F2F3F7;
}
.page-title {
font-size: var(--fontSize34);
......@@ -10,7 +10,7 @@ page {
.bg {
width: 100%;
height: var(--fontSize400);
background: url("https://img02.glsx.com.cn/weapp/resource/miniprogram/regional-assistant/page-bg.png") no-repeat;
background: url('https://img02.glsx.com.cn/weapp/resource/miniprogram/regional-assistant/page-bg.png') no-repeat;
background-size: 100% var(--fontSize400);
position: fixed;
left: 0;
......@@ -19,6 +19,8 @@ page {
}
.container {
padding-top: var(--fontSize1);
padding-bottom: var(--fontSize30);
overflow: auto;
}
.banner-box {
height: var(--fontSize192);
......@@ -37,7 +39,7 @@ page {
margin: var(--fontSize32) var(--fontSize24);
border-radius: var(--fontSize36);
background: #ffffff;
padding: var(--fontSize24) var(--fontSize32) var(--fontSize12);
padding: var(--fontSize24) var(--fontSize32);
.label {
color: #222222;
font-size: var(--fontSize28);
......@@ -49,33 +51,33 @@ page {
grid-template-columns: repeat(4, minmax(var(--fontSize100), 1fr));
justify-content: space-between;
align-items: center;
padding-top: var(--fontSize12);
background: #ffffff;
padding-top: var(--fontSize24);
background: #FFFFFF;
border-radius: var(--fontSize16);
gap: var(--fontSize18);
.label {
font-family: PingFangSC-Regular;
font-size: var(--fontSize24);
color: #292d33;
color: #292D33;
}
.item {
display: flex;
flex-flow: column;
align-items: center;
position: relative;
margin: var(--fontSize12) 0;
image {
width: var(--fontSize72);
height: var(--fontSize72);
}
.hot_icon {
position: absolute;
right: var(--fontSize40);
right: var(--fontSize20);
top: 0;
width: var(--fontSize38);
height: var(--fontSize32);
background: #f24724;
background: #F24724;
border-radius: var(--fontSize16);
color: #ffffff;
color: #FFFFFF;
font-size: var(--fontSize22);
display: flex;
justify-content: center;
......@@ -87,7 +89,7 @@ page {
top: var(--fontSize12);
width: var(--fontSize16);
height: var(--fontSize16);
background: #f24724;
background: #F24724;
border-radius: var(--fontSize16);
display: flex;
justify-content: center;
......
......@@ -7,79 +7,66 @@
</view>
</navigation-bar>
<view class="bg"></view>
<view class="container" style="margin-top: {{ navBarHeight }}px;">
<view class="banner-box" wx:if="{{ showBanner }}">
<image class="image"
src="{{ IMG_URL }}work-banner.png"
mode="" />
<image class="close-icon"
bindtap="closeBannaer"
src="{{ IMG_URL }}blue-close.png"
alt="" />
<view class="container" style="margin-top: {{navBarHeight}}px;height: calc(100vh - {{navBarHeight}}px);">
<view class="banner-box" wx:if="{{showBanner}}">
<image class="image" src="{{IMG_URL}}work-banner.png" mode=""/>
<image class="close-icon" bindtap="closeBannaer" src="{{IMG_URL}}blue-close.png" alt=""/>
</view>
<view class="box">
<view class="label">
审批管理
</view>
<view class="label">审批管理</view>
<view class="menu">
<block wx:for="{{ approvalMenus }}" wx:key="index">
<view class="item"
bindtap="jump"
data-target="{{ item }}">
<image src="{{ IMG_URL }}{{ item.icon }}.png" />
<view class="label">
{{ item.name }}
</view>
<view class="hot_icon" wx:if="{{ item.tipsNum }}">
{{ item.tipsNum > 99?'99+': item.tipsNum }}
</view>
<view class="item" bindtap="jump" data-target="{{ item }}">
<image src="{{ IMG_URL}}{{item.icon }}.png" />
<view class="label">{{item.name}}</view>
<view class="hot_icon" wx:if="{{ item.tipsNum }}">{{item.tipsNum > 99?'99+': item.tipsNum}}</view>
</view>
</block>
</view>
</view>
<view class="box">
<view class="label">
门店运营管理
</view>
<view class="label">门店运营管理</view>
<view class="menu">
<block wx:for="{{ storeManagementMenus }}" wx:key="index">
<view class="item"
bind:tap="jump"
data-target="{{ item }}">
<image src="{{ IMG_URL }}{{ item.icon }}.png" />
<view class="label">
{{ item.name }}
</view>
<view class="hot_icon" wx:if="{{ item.tipsNum }}">
{{ item.tipsNum > 99?'99+': item.tipsNum }}
</view>
<view class="item" bindtap="jump" data-target="{{ item }}">
<image src="{{ IMG_URL}}{{item.icon }}.png" />
<view class="label">{{item.name}}</view>
<view class="hot_icon" wx:if="{{ item.tipsNum }}">{{item.tipsNum > 99?'99+': item.tipsNum}}</view>
</view>
</block>
</view>
</view>
<view class="box">
<view class="label">
人员发展管理
</view>
<view class="label">人员发展管理</view>
<view class="menu">
<block wx:for="{{ staffDevelopmentMenus }}" wx:key="index">
<view class="item"
bindtap="jump"
data-target="{{ item }}">
<image src="{{ IMG_URL }}{{ item.icon }}.png" />
<view class="label">
{{ item.name }}
</view>
<view class="hot_icon" wx:if="{{ item.tipsNum }}">
{{ item.tipsNum > 99?'99+': item.tipsNum }}
</view>
<view class="item" bindtap="jump" data-target="{{ item }}">
<image src="{{ IMG_URL}}{{item.icon }}.png" />
<view class="label">{{item.name}}</view>
<view class="hot_icon" wx:if="{{ item.tipsNum }}">{{item.tipsNum > 99?'99+': item.tipsNum}}</view>
</view>
</block>
</view>
</view>
<view class="box">
<view class="label">驻店薪酬管理</view>
<view class="menu">
<block wx:for="{{ compensationMenus }}" wx:key="index">
<view class="item" bindtap="jump" data-target="{{ item }}">
<image src="{{ IMG_URL}}{{item.icon }}.png" />
<view class="label">{{item.name}}</view>
<view class="hot_icon" wx:if="{{ item.tipsNum }}">{{item.tipsNum > 99?'99+': item.tipsNum}}</view>
</view>
</block>
</view>
</view>
</view>
<report-template-popup show="{{ showReportPopup }}"
templateList="{{ reportTemplateList }}"
bind:cancel="onReportPopupCancel"
bind:select="onReportPopupSelect" />
<report-template-popup
show="{{showReportPopup}}"
templateList="{{reportTemplateList}}"
bind:cancel="onReportPopupCancel"
bind:select="onReportPopupSelect"
/>
<van-dialog id="van-dialog" confirm-button-color="#2C66F7" />
......@@ -12,8 +12,10 @@ export const checkYqdSuper = (userInfo, globalData) => {
})
// 解决传入app 在初始化获取不到的bug
// console.log(userInfo, 'userInfo')
globalData.isYqdSuper = userInfo.userType != 2 && !userInfo.isSuper && merchantAccountType
globalData.isStaff = userInfo.userType == 2 && !userInfo.isSuper && merchantAccountType
globalData.isYqdSuper =
userInfo.userType != 2 && !userInfo.isSuper && merchantAccountType
globalData.isStaff =
userInfo.userType == 2 && !userInfo.isSuper && merchantAccountType
const loginRole = userInfo.loginRole
if (loginRole) {
globalData.isYqdSuper = [2, 3].includes(loginRole)
......@@ -66,7 +68,8 @@ export const getYQInfo = userInfo => {
if (data.length > 1) {
if (userInfo.merchantId != userInfo.subLoginUser.merchantId) {
data.map((e, index) => {
if (e.merchantId == userInfo.subLoginUser.merchantId) subIndex = index + 1
if (e.merchantId == userInfo.subLoginUser.merchantId)
subIndex = index + 1
})
}
arr = [all, ...data]
......@@ -121,7 +124,9 @@ export const getYQorderInfo = () => {
// 过滤园区店是否需要屏蔽手机号选项
let filterYqPhoneConfig = JSON.parse(data.yqPhoneConfig)
// console.log(filterYqPhoneConfig)
data.yqPhoneConfig = filterYqPhoneConfig?.find(item => item.yqMerchantId == merchantId)?.shopMerchantPhoneList || false
data.yqPhoneConfig =
filterYqPhoneConfig?.find(item => item.yqMerchantId == merchantId)
?.shopMerchantPhoneList || false
// console.log(data)
app.globalData.YQorderSetting = data
// this.checkSeverType(userInfo)
......@@ -174,7 +179,10 @@ export const getBusinessSchoolScene = () => {
const app = getApp()
return new Promise((resolve, reject) => {
// 如果有 直接返回
if (app.globalData.businessSchoolScene != '' && app.globalData.businessSchoolScene != null) {
if (
app.globalData.businessSchoolScene != '' &&
app.globalData.businessSchoolScene != null
) {
// debugger
return resolve(app.globalData.businessSchoolScene)
} else {
......@@ -207,6 +215,7 @@ export const getBusinessSchoolScene = () => {
// 扫码进来的处理
export const checkScene = options => {
// if (getApp().globalData.isChoosingMedia) return
// let query = options.query
let { query } = options
......@@ -243,30 +252,39 @@ export const checkScene = options => {
createOrder: 'tabWorkOrder/pages/createOrder/createOrder',
followUpOrder: 'tabDate/pages/detail',
staffDaily: 'tabWorkOrder/pages/staffDaily/staffDaily',
playVideo: 'packageEquity/pages/trainingMaterials/pages/playVideo/index',
upgradeStaffDaily: 'tabWorkOrder/pages/upgradeStaffDaily/upgradeStaffDaily',
playVideo:
'packageEquity/pages/trainingMaterials/pages/playVideo/index',
upgradeStaffDaily:
'tabWorkOrder/pages/upgradeStaffDaily/upgradeStaffDaily',
deliveryTarget: 'packageEquity/pages/deliveryTarget/deliveryTarget',
'aiDetail': 'packageEquity/pages/aiExcercise/ai/ai',
'tabDateIndex': 'pages/tabDateIndex/pages/tabDateIndex',
'tabDateIndex': 'pages/tabDateIndex/pages/tabDateIndex',
'h5AuthPhone': 'pages/h5AuthPhone/h5AuthPhone',
'mentorShipManage': 'tabWorkOrder/pages/mentorshipManage/mentorshipManage',
'refundApply': 'tabWorkOrder/pages/refundApply/refundApply'
'refundApply': 'tabWorkOrder/pages/refundApply/refundApply',
'recruitDetail': 'packageEquity/pages/recruitManage/recruitDetail/recruitDetail',
'performanceRate': 'packageWorkspace/pages/performanceRating/rateList/retaList',
'validReferralCount': 'packageWorkspace/pages/validReferralCount/referralCountList/referralCountList',
'orderApprovalDetail': '/packageWorkspace/pages/orderApprovalManage/orderApprovalDetail/orderApprovalDetail'
}
options.path = pagePath[query.page]
}
console.log(options, query, 'options')
console.log(userInfo, 'userInfo');
console.log(userInfo, 'userInfo')
wx.$SCENE = options
// 跳转登录页就去掉这个跳转逻辑
if (options.path == "pages/wxLogin/wxLogin") {
if (options.path == 'pages/wxLogin/wxLogin') {
wx.$SCENE = null
}
if (query.merchantId && !query.reportDate && !query.title) {
// &&options.patch == 'tabIndex/pages/index/index'
// 需要已登录并且是当前门店的 不是就重新登录
if (userInfo?.subLoginUser?.merchantId && (userInfo?.subLoginUser?.merchantId != query.merchantId)) {
if (
userInfo?.subLoginUser?.merchantId &&
userInfo?.subLoginUser?.merchantId != query.merchantId
) {
wx.$SCENE = null
// return this.login(true)
// return true // 重新登录
......@@ -276,7 +294,18 @@ export const checkScene = options => {
console.log(options.path, 'options.path')
// wx.$SCENE = options
if (!userInfo && !['pages/accountItems/accountItems', 'pages/wxLogin/wxLogin', 'tabWorkOrder/pages/staffDaily/staffDaily', 'tabWorkOrder/pages/upgradeStaffDaily/upgradeStaffDaily', 'packageEquity/pages/trainingMaterials/pages/playVideo/index', 'packageEquity/pages/deliveryTarget/deliveryTarget', 'pages/h5AuthPhone/h5AuthPhone'].includes(options.path)) {
if (
!userInfo &&
![
'pages/accountItems/accountItems',
'pages/wxLogin/wxLogin',
'tabWorkOrder/pages/staffDaily/staffDaily',
'tabWorkOrder/pages/upgradeStaffDaily/upgradeStaffDaily',
'packageEquity/pages/trainingMaterials/pages/playVideo/index',
'packageEquity/pages/deliveryTarget/deliveryTarget',
'pages/h5AuthPhone/h5AuthPhone'
].includes(options.path)
) {
// if (!userInfo) {
// console.log(userInfo);
console.log('未登录,请登录。')
......@@ -298,7 +327,9 @@ export const setWebSocket = () => {
let thisPage = wx.$router.getPageInstance()
console.log('socket', data)
let _data_ = JSON.parse(data.data)
if (thisPage.route == 'tabWorkOrder/pages/confirmOrder/confirmOrder') {
if (
thisPage.route == 'tabWorkOrder/pages/confirmOrder/confirmOrder'
) {
console.log(thisPage.data.orderInfo.orderCode, _data_.content)
if (thisPage.data.orderInfo.orderCode == _data_.content) {
console.log(_data_.type)
......@@ -318,11 +349,15 @@ export const setWebSocket = () => {
}
/** 获取园区店下的4S店 */
export const get4SStoreList = (options, isSupervision, noScene) => { // isSupervision是否是区域运营/超管/飞行督导 noScene登录未选场景时
export const get4SStoreList = (options, isSupervision, noScene) => {
// isSupervision是否是区域运营/超管/飞行督导 noScene登录未选场景时
return new Promise((resolve, reject) => {
wx.$util.showLoading()
let all = { merchantName: '全部' }
let event = noScene || !isSupervision ? 'getSceneMerchantRefStoreList' : 'getCurShopList'
let event =
noScene || !isSupervision
? 'getSceneMerchantRefStoreList'
: 'getCurShopList'
if (event == 'getCurShopList') {
options.sceneType = options.scene
}
......@@ -336,7 +371,8 @@ export const get4SStoreList = (options, isSupervision, noScene) => { // isSuperv
// debugger
// console.log(data);
// getCurShopList 接口数据结构不一致,要修改
let resolveData = (event == 'getCurShopList' ? data?.list : data) || []
let resolveData =
(event == 'getCurShopList' ? data?.list : data) || []
if (isSupervision) resolveData = [all, ...resolveData]
// console.log(resolveData, 'resolveData');
resolve(resolveData)
......@@ -473,12 +509,10 @@ export const loginLogAdd = options => {
options.loginDeviceType = isPad ? 1 : 2 // 登录设备类型(1.pad,2手机)
options.loginSource = 1 // 登录来源(1.嘀加区域助手小程序,默认)
// "登录方式(1账号密码登录,2.手机号授权,3验证码)"
api.loginLogAdd(options).then((result) => {
}).catch((err) => {
});
api
.loginLogAdd(options)
.then(result => {})
.catch(err => {})
}
})
}
......@@ -63,9 +63,10 @@ const domain_items = {
// dj: "http://192.168.1.169:8292", //蔡远明
// dj: 'http://192.168.1.104:8292',//范富荣
// dj: 'http://192.168.1.89:8292', //周杭
// dj: 'http://192.168.1.76:8292', //璐琦
dj: 'http://192.168.1.76:8292', //璐琦
// dj: 'http://192.168.1.111:8594',
// dj: 'http://192.168.1.227:8292',//陈希
dj: 'http://192.168.1.67:8292',//周立明
// dj: 'http://192.168.1.67:8292',//周立明
// dj: 'http://192.168.148.235:8292',// 熊正顺
// dj: 'http://192.168.148.221:8292',
// scrm: 'http://192.168.1.165:8292'
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!