Files
SupplierSystem/miniprogram/utils/constants.js
T
Ubuntu deb3e72750
CI / server typecheck + tests (push) Canceled after 0s
CI / web typecheck + tests + miniprogram syntax (push) Canceled after 0s
CI / eslint (观察项,C7 骨架) (push) Canceled after 0s
CI / npm audit (critical 硬拦) (push) Canceled after 0s
chore: 以 AI 生鲜配送系统 当前版本作为 SupplierSystem 起点
来源仓库:jxc/ai-fresh-delivery
来源提交:f0b1a180e2deb7e4673b9d1c8542619f7bc0f73d
快照树:  09f679334ff38f0ff25e907961c94a8223bcaedd(与来源 HEAD 工作树逐字节一致,3801 个文件)

按约定本仓库不带任何历史提交:来源仓库的历史中含真实凭据
(生产 SSH 私钥 deploy/id_rsa_tencent、server/.env、.env.tencent/.env.production/.env.gitea、
deploy/小程序AppSecret.txt,其中 MP_APPSECRET / S3 AccessKey 经哈希比对与线上同值),
整包推送会把这些凭据永久带入本仓库,故只取「当前版本」的单提交快照。
供应商系统后续开发自本提交开始。
2026-10-08 17:35:43 +08:00

106 lines
2.7 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
const ROLE_OPTIONS = [
{ value: 'admin', label: '管理员', hint: '管理员/超级管理员账号' },
{ value: 'operator', label: '运营', hint: '运营角色或订单管理权限账号' },
{ value: 'purchaser', label: '采购员', hint: '使用采购员账号登录' },
{ value: 'supplier', label: '供应商', hint: '使用供应商管理中创建的账号' },
{ value: 'warehouse', label: '仓管员', hint: '到货验收、加工与验收' },
{ value: 'picker', label: '分拣员', hint: '分拣复核、提交出库' },
{ value: 'order_entry', label: '录单员', hint: '使用录单权限账号登录' },
{ value: 'delivery', label: '配送员', hint: '配送任务、验货上车' },
];
const ROLE_LABELS = {
admin: '管理员',
operator: '运营',
purchaser: '采购员',
supplier: '供应商',
warehouse: '仓管员',
inspector: '检验人员',
picker: '分拣员',
order_entry: '录单员',
delivery: '配送员',
};
const SESSION_KEY = 'canteen.mp.session';
/** 录单常用加工方式(与 Web processingMethods 对齐) */
const PROCESSING_METHOD_OPTIONS = [
'原材料',
'净菜',
'切配',
'熟食',
'砍',
'去皮',
'切片',
'切块',
'切丝',
'切段',
'切丁',
'清洗',
'洗净',
'打包',
'分装',
'剁碎',
'去根',
'去叶',
];
const ORDER_STATUS_LABELS = {
20: '待分配',
30: '待备货',
40: '待验收',
41: '拒收待处理',
45: '待分拣',
50: '待配送',
60: '配送中',
90: '已完成',
};
const ORDER_ADVANCE_LABELS = {
20: '确认分配',
30: '确认备货',
40: '确认验收',
45: '分拣出库',
50: '开始配送',
60: '完成配送',
};
const DELIVERY_TIME_SLOT_LABELS = {
morning: '上午',
afternoon: '下午',
evening: '晚上',
noon: '中午',
all: '全天',
custom: '自定义',
};
function deliveryTimeSlotLabel(value) {
const key = String(value || '').trim().toLowerCase();
if (!key) return '';
return DELIVERY_TIME_SLOT_LABELS[key] || value;
}
function displayCustomerDeliveryDeadline(raw) {
const trimmed = String(raw || '').trim();
if (!trimmed) return '';
const m = trimmed.match(/^(\d{1,2})[::](\d{2})(?::\d{2})?$/);
if (!m) return trimmed;
const hour = Number(m[1]);
const minute = Number(m[2]);
if (!Number.isInteger(hour) || !Number.isInteger(minute)) return trimmed;
if (hour < 0 || hour > 23 || minute < 0 || minute > 59) return trimmed;
return `${String(hour).padStart(2, '0')}:${String(minute).padStart(2, '0')}`;
}
module.exports = {
ROLE_OPTIONS,
ROLE_LABELS,
SESSION_KEY,
PROCESSING_METHOD_OPTIONS,
ORDER_STATUS_LABELS,
ORDER_ADVANCE_LABELS,
DELIVERY_TIME_SLOT_LABELS,
deliveryTimeSlotLabel,
displayCustomerDeliveryDeadline,
};