完善店务员工工时与订单记录

This commit is contained in:
2026-07-24 14:23:13 +08:00
parent 3a543f1d69
commit eff4e73427
20 changed files with 440 additions and 225 deletions
@@ -1,6 +1,16 @@
const employeesApi = require('../../api/employees')
const EMPLOYEE_COLORS = ['#7AA9C2', '#8EB99B', '#BDA7D8', '#D7B17D', '#D98D8D']
const EMPTY_FIELD_TEXT = '未填写'
function displayText(value) {
const text = String(value || '').trim()
return text || EMPTY_FIELD_TEXT
}
function buildRoleText(data) {
return Number(data.type) === 2 ? '店长' : '店员'
}
Page({
data: {
@@ -34,6 +44,12 @@ Page({
name,
shortName: name.slice(-1),
color: data.color || EMPLOYEE_COLORS[0],
roleText: buildRoleText(data),
accountText: displayText(data.account),
phoneText: displayText(data.phone),
contactPhoneText: displayText(data.contactPhone),
wechatIdText: displayText(data.wechatId),
identityText: displayText(data.identity),
monthOrders,
monthAmount,
avgAmount: monthOrders > 0 ? Math.round(monthAmount / monthOrders) : 0