|
|
@@ -0,0 +1,1026 @@
|
|
|
+/**
|
|
|
+ * 枚举值中文映射工具
|
|
|
+ * 用于将后端返回的枚举值转换为中文显示
|
|
|
+ */
|
|
|
+
|
|
|
+// 订单状态 - 匹配后端 OrderStatus.java
|
|
|
+export const ORDER_STATUS: Record<string, { label: string; type: string }> = {
|
|
|
+ CREATED: { label: '待支付', type: 'info' },
|
|
|
+ PAID: { label: '已支付', type: '' },
|
|
|
+ ALLOCATED: { label: '已分配', type: 'warning' },
|
|
|
+ SHIPPED: { label: '已发货', type: 'success' },
|
|
|
+ DELIVERED: { label: '已签收', type: 'success' },
|
|
|
+ COMPLETED: { label: '已完成', type: 'success' },
|
|
|
+ CANCELLED: { label: '已取消', type: 'danger' },
|
|
|
+};
|
|
|
+
|
|
|
+// 发货状态 - 匹配后端 ShippingStatus.java
|
|
|
+export const SHIPPING_STATUS: Record<string, { label: string; type: string }> = {
|
|
|
+ UNSHIPPED: { label: '未发货', type: 'info' },
|
|
|
+ PROCESSING: { label: '处理中', type: 'warning' },
|
|
|
+ SHIPPED: { label: '已发货', type: 'primary' },
|
|
|
+ IN_TRANSIT: { label: '运输中', type: 'primary' },
|
|
|
+ DELIVERED: { label: '已签收', type: 'success' },
|
|
|
+};
|
|
|
+
|
|
|
+// 支付状态 - 匹配后端 PaymentStatus.java
|
|
|
+export const PAYMENT_STATUS: Record<string, { label: string; type: string }> = {
|
|
|
+ UNPAID: { label: '待支付', type: 'warning' },
|
|
|
+ PENDING: { label: '待支付', type: 'warning' },
|
|
|
+ PAID: { label: '已支付', type: 'success' },
|
|
|
+};
|
|
|
+
|
|
|
+// 订单优先级
|
|
|
+export const ORDER_PRIORITY: Record<string, string> = {
|
|
|
+ urgent: '加急',
|
|
|
+ high: '高',
|
|
|
+ normal: '普通',
|
|
|
+ low: '低',
|
|
|
+};
|
|
|
+
|
|
|
+// 异常标签
|
|
|
+export const EXCEPTION_TAG: Record<string, string> = {
|
|
|
+ '正常': '正常',
|
|
|
+ '地址需复核': '地址需复核',
|
|
|
+ '高频下单': '高频下单',
|
|
|
+ '金额异常': '金额异常',
|
|
|
+ '库存不足': '库存不足',
|
|
|
+ '物流异常': '物流异常',
|
|
|
+ '收货地址异常': '收货地址异常',
|
|
|
+ '买家异常': '买家异常',
|
|
|
+};
|
|
|
+
|
|
|
+// 售后状态
|
|
|
+export const AFTER_SALE_STATUS: Record<string, { label: string; type: string }> = {
|
|
|
+ pending: { label: '待处理', type: 'warning' },
|
|
|
+ approved: { label: '已同意', type: 'success' },
|
|
|
+ rejected: { label: '已拒绝', type: 'danger' },
|
|
|
+ processing: { label: '处理中', type: 'primary' },
|
|
|
+ completed: { label: '已完成', type: 'success' },
|
|
|
+ closed: { label: '已关闭', type: 'info' },
|
|
|
+};
|
|
|
+
|
|
|
+// 售后审核状态
|
|
|
+export const AUDIT_STATUS: Record<string, { label: string; type: string }> = {
|
|
|
+ 待审核: { label: '待审核', type: 'warning' },
|
|
|
+ 已通过: { label: '已通过', type: 'success' },
|
|
|
+ 已拒绝: { label: '已拒绝', type: 'danger' },
|
|
|
+ pending: { label: '待审核', type: 'warning' },
|
|
|
+ approved: { label: '已通过', type: 'success' },
|
|
|
+ rejected: { label: '已拒绝', type: 'danger' },
|
|
|
+};
|
|
|
+
|
|
|
+// 退款状态
|
|
|
+export const REFUND_STATUS: Record<string, { label: string; type: string }> = {
|
|
|
+ 未退款: { label: '未退款', type: 'info' },
|
|
|
+ 已退款: { label: '已退款', type: 'success' },
|
|
|
+ 补发中: { label: '补发中', type: 'warning' },
|
|
|
+ 已补发: { label: '已补发', type: 'success' },
|
|
|
+ 已退货待入库: { label: '已退货待入库', type: 'warning' },
|
|
|
+ pending: { label: '未退款', type: 'info' },
|
|
|
+ refunded: { label: '已退款', type: 'success' },
|
|
|
+ resending: { label: '补发中', type: 'warning' },
|
|
|
+ resent: { label: '已补发', type: 'success' },
|
|
|
+ returned: { label: '已退货待入库', type: 'warning' },
|
|
|
+};
|
|
|
+
|
|
|
+// 售后类型
|
|
|
+export const AFTER_SALE_TYPE: Record<string, { label: string; type: string }> = {
|
|
|
+ '退款': { label: '退款', type: 'danger' },
|
|
|
+ '退货退款': { label: '退货退款', type: 'warning' },
|
|
|
+ '换货': { label: '换货', type: 'primary' },
|
|
|
+ refund_only: { label: '仅退款', type: 'danger' },
|
|
|
+ return_refund: { label: '退货退款', type: 'warning' },
|
|
|
+ exchange: { label: '换货', type: 'primary' },
|
|
|
+ repair: { label: '维修', type: 'info' },
|
|
|
+};
|
|
|
+
|
|
|
+// 仓库状态
|
|
|
+export const WAREHOUSE_STATUS: Record<string, { label: string; type: string }> = {
|
|
|
+ '启用': { label: '启用', type: 'success' },
|
|
|
+ '停用': { label: '停用', type: 'info' },
|
|
|
+ '锁定': { label: '锁定', type: 'danger' },
|
|
|
+ active: { label: '启用', type: 'success' },
|
|
|
+ inactive: { label: '停用', type: 'info' },
|
|
|
+ locked: { label: '锁定', type: 'danger' },
|
|
|
+};
|
|
|
+
|
|
|
+export function getWarehouseStatus(value: string) {
|
|
|
+ return getEnumWithStyle(WAREHOUSE_STATUS, value);
|
|
|
+}
|
|
|
+
|
|
|
+// 产品状态
|
|
|
+export const PRODUCT_STATUS: Record<string, { label: string; type: string }> = {
|
|
|
+ draft: { label: '草稿', type: 'info' },
|
|
|
+ active: { label: '上架', type: 'success' },
|
|
|
+ inactive: { label: '下架', type: 'warning' },
|
|
|
+ deleted: { label: '已删除', type: 'danger' },
|
|
|
+};
|
|
|
+
|
|
|
+// 供应商状态
|
|
|
+export const SUPPLIER_STATUS: Record<string, { label: string; type: string }> = {
|
|
|
+ '合作中': { label: '合作中', type: 'success' },
|
|
|
+ '已停用': { label: '已停用', type: 'danger' },
|
|
|
+ '待审核': { label: '待审核', type: 'warning' },
|
|
|
+ '已拉黑': { label: '已拉黑', type: 'danger' },
|
|
|
+ active: { label: '合作中', type: 'success' },
|
|
|
+ inactive: { label: '已停用', type: 'danger' },
|
|
|
+ pending: { label: '待审核', type: 'warning' },
|
|
|
+ blacklisted: { label: '已拉黑', type: 'danger' },
|
|
|
+};
|
|
|
+
|
|
|
+// 通用枚举转换函数
|
|
|
+export function getEnumLabel(enumMap: Record<string, string>, value: string | undefined | null): string {
|
|
|
+ if (!value) return '-';
|
|
|
+ return enumMap[value] || value;
|
|
|
+}
|
|
|
+
|
|
|
+export function getEnumWithStyle(
|
|
|
+ enumMap: Record<string, { label: string; type: string }>,
|
|
|
+ value: string | undefined | null
|
|
|
+): { label: string; type: string } {
|
|
|
+ if (!value) return { label: '-', type: 'info' };
|
|
|
+ return enumMap[value] || { label: value, type: 'info' };
|
|
|
+}
|
|
|
+
|
|
|
+// 快捷函数
|
|
|
+export function getOrderStatus(value: string) {
|
|
|
+ return getEnumWithStyle(ORDER_STATUS, value);
|
|
|
+}
|
|
|
+
|
|
|
+export function getShippingStatus(value: string) {
|
|
|
+ return getEnumWithStyle(SHIPPING_STATUS, value);
|
|
|
+}
|
|
|
+
|
|
|
+export function getPaymentStatus(value: string) {
|
|
|
+ return getEnumWithStyle(PAYMENT_STATUS, value);
|
|
|
+}
|
|
|
+
|
|
|
+export function getPriorityLabel(value: string) {
|
|
|
+ return getEnumLabel(ORDER_PRIORITY, value);
|
|
|
+}
|
|
|
+
|
|
|
+export function getExceptionLabel(value: string) {
|
|
|
+ return getEnumLabel(EXCEPTION_TAG, value);
|
|
|
+}
|
|
|
+
|
|
|
+export function getAfterSaleStatus(value: string) {
|
|
|
+ return getEnumWithStyle(AFTER_SALE_STATUS, value);
|
|
|
+}
|
|
|
+
|
|
|
+export function getProductStatus(value: string) {
|
|
|
+ return getEnumWithStyle(PRODUCT_STATUS, value);
|
|
|
+}
|
|
|
+
|
|
|
+export function getSupplierStatus(value: string) {
|
|
|
+ return getEnumWithStyle(SUPPLIER_STATUS, value);
|
|
|
+}
|
|
|
+
|
|
|
+export function getAuditStatus(value: string) {
|
|
|
+ return getEnumWithStyle(AUDIT_STATUS, value);
|
|
|
+}
|
|
|
+
|
|
|
+export function getRefundStatus(value: string) {
|
|
|
+ return getEnumWithStyle(REFUND_STATUS, value);
|
|
|
+}
|
|
|
+
|
|
|
+// 对账状态
|
|
|
+export const RECONCILE_STATUS: Record<string, { label: string; type: string }> = {
|
|
|
+ '待对账': { label: '待对账', type: 'warning' },
|
|
|
+ '已确认': { label: '已确认', type: 'success' },
|
|
|
+ '有差异': { label: '有差异', type: 'danger' },
|
|
|
+ pending: { label: '待对账', type: 'warning' },
|
|
|
+ confirmed: { label: '已确认', type: 'success' },
|
|
|
+ discrepancy: { label: '有差异', type: 'danger' },
|
|
|
+};
|
|
|
+
|
|
|
+export function getReconcileStatus(value: string) {
|
|
|
+ return getEnumWithStyle(RECONCILE_STATUS, value);
|
|
|
+}
|
|
|
+
|
|
|
+// 退款状态(财务)
|
|
|
+export const REFUND_FINANCE_STATUS: Record<string, { label: string; type: string }> = {
|
|
|
+ '待退款': { label: '待退款', type: 'warning' },
|
|
|
+ '退款中': { label: '退款中', type: 'primary' },
|
|
|
+ '已退款': { label: '已退款', type: 'success' },
|
|
|
+ '退款失败': { label: '退款失败', type: 'danger' },
|
|
|
+ pending: { label: '待退款', type: 'warning' },
|
|
|
+ processing: { label: '退款中', type: 'primary' },
|
|
|
+ success: { label: '已退款', type: 'success' },
|
|
|
+ failed: { label: '退款失败', type: 'danger' },
|
|
|
+};
|
|
|
+
|
|
|
+export function getRefundFinanceStatus(value: string) {
|
|
|
+ return getEnumWithStyle(REFUND_FINANCE_STATUS, value);
|
|
|
+}
|
|
|
+
|
|
|
+// 营销活动状态
|
|
|
+export const PROMOTION_STATUS: Record<string, { label: string; type: string }> = {
|
|
|
+ '未开始': { label: '未开始', type: 'info' },
|
|
|
+ '进行中': { label: '进行中', type: 'success' },
|
|
|
+ '已结束': { label: '已结束', type: 'info' },
|
|
|
+ '已暂停': { label: '已暂停', type: 'warning' },
|
|
|
+ pending: { label: '未开始', type: 'info' },
|
|
|
+ active: { label: '进行中', type: 'success' },
|
|
|
+ ended: { label: '已结束', type: 'info' },
|
|
|
+ paused: { label: '已暂停', type: 'warning' },
|
|
|
+};
|
|
|
+
|
|
|
+// 工单优先级
|
|
|
+export const TICKET_PRIORITY: Record<string, { label: string; type: string }> = {
|
|
|
+ '低': { label: '低', type: 'info' },
|
|
|
+ '中': { label: '中', type: '' },
|
|
|
+ '高': { label: '高', type: 'warning' },
|
|
|
+ '紧急': { label: '紧急', type: 'danger' },
|
|
|
+ low: { label: '低', type: 'info' },
|
|
|
+ medium: { label: '中', type: '' },
|
|
|
+ high: { label: '高', type: 'warning' },
|
|
|
+ urgent: { label: '紧急', type: 'danger' },
|
|
|
+};
|
|
|
+
|
|
|
+// 工单状态
|
|
|
+export const TICKET_STATUS: Record<string, { label: string; type: string }> = {
|
|
|
+ '待处理': { label: '待处理', type: 'warning' },
|
|
|
+ '处理中': { label: '处理中', type: 'primary' },
|
|
|
+ '已解决': { label: '已解决', type: 'success' },
|
|
|
+ '已关闭': { label: '已关闭', type: 'info' },
|
|
|
+ pending: { label: '待处理', type: 'warning' },
|
|
|
+ processing: { label: '处理中', type: 'primary' },
|
|
|
+ resolved: { label: '已解决', type: 'success' },
|
|
|
+ closed: { label: '已关闭', type: 'info' },
|
|
|
+};
|
|
|
+
|
|
|
+export function getPromotionStatus(value: string) {
|
|
|
+ return getEnumWithStyle(PROMOTION_STATUS, value);
|
|
|
+}
|
|
|
+
|
|
|
+export function getTicketPriority(value: string) {
|
|
|
+ return getEnumWithStyle(TICKET_PRIORITY, value);
|
|
|
+}
|
|
|
+
|
|
|
+export function getTicketStatus(value: string) {
|
|
|
+ return getEnumWithStyle(TICKET_STATUS, value);
|
|
|
+}
|
|
|
+
|
|
|
+// 采购订单状态
|
|
|
+export const PURCHASE_ORDER_STATUS: Record<string, { label: string; type: string }> = {
|
|
|
+ '待确认': { label: '待确认', type: 'warning' },
|
|
|
+ '已确认': { label: '已确认', type: 'primary' },
|
|
|
+ '部分到货': { label: '部分到货', type: 'warning' },
|
|
|
+ '已到货': { label: '已到货', type: 'success' },
|
|
|
+ '已取消': { label: '已取消', type: 'danger' },
|
|
|
+ pending: { label: '待确认', type: 'warning' },
|
|
|
+ confirmed: { label: '已确认', type: 'primary' },
|
|
|
+ partial: { label: '部分到货', type: 'warning' },
|
|
|
+ received: { label: '已到货', type: 'success' },
|
|
|
+ cancelled: { label: '已取消', type: 'danger' },
|
|
|
+};
|
|
|
+
|
|
|
+// 采购申请状态
|
|
|
+export const PURCHASE_REQUEST_STATUS: Record<string, { label: string; type: string }> = {
|
|
|
+ '待审批': { label: '待审批', type: 'warning' },
|
|
|
+ '已通过': { label: '已通过', type: 'success' },
|
|
|
+ '已拒绝': { label: '已拒绝', type: 'danger' },
|
|
|
+ '采购中': { label: '采购中', type: 'primary' },
|
|
|
+ '已完成': { label: '已完成', type: 'success' },
|
|
|
+ pending: { label: '待审批', type: 'warning' },
|
|
|
+ approved: { label: '已通过', type: 'success' },
|
|
|
+ rejected: { label: '已拒绝', type: 'danger' },
|
|
|
+ purchasing: { label: '采购中', type: 'primary' },
|
|
|
+ completed: { label: '已完成', type: 'success' },
|
|
|
+};
|
|
|
+
|
|
|
+// 采购紧急程度
|
|
|
+export const PURCHASE_PRIORITY: Record<string, { label: string; type: string }> = {
|
|
|
+ '紧急': { label: '紧急', type: 'danger' },
|
|
|
+ '高': { label: '高', type: 'warning' },
|
|
|
+ '中': { label: '中', type: '' },
|
|
|
+ '低': { label: '低', type: 'info' },
|
|
|
+ urgent: { label: '紧急', type: 'danger' },
|
|
|
+ high: { label: '高', type: 'warning' },
|
|
|
+ medium: { label: '中', type: '' },
|
|
|
+ low: { label: '低', type: 'info' },
|
|
|
+};
|
|
|
+
|
|
|
+// 物流商状态
|
|
|
+export const LOGISTICS_STATUS: Record<string, { label: string; type: string }> = {
|
|
|
+ '启用': { label: '启用', type: 'success' },
|
|
|
+ '停用': { label: '停用', type: 'danger' },
|
|
|
+ '维护中': { label: '维护中', type: 'warning' },
|
|
|
+ active: { label: '启用', type: 'success' },
|
|
|
+ inactive: { label: '停用', type: 'danger' },
|
|
|
+ maintenance: { label: '维护中', type: 'warning' },
|
|
|
+};
|
|
|
+
|
|
|
+// 供应能力状态
|
|
|
+export const CAPABILITY_STATUS: Record<string, { label: string; type: string }> = {
|
|
|
+ '启用': { label: '启用', type: 'success' },
|
|
|
+ '停用': { label: '停用', type: 'info' },
|
|
|
+ active: { label: '启用', type: 'success' },
|
|
|
+ inactive: { label: '停用', type: 'info' },
|
|
|
+};
|
|
|
+
|
|
|
+// 供应商绩效状态
|
|
|
+export const PERFORMANCE_STATUS: Record<string, { label: string; type: string }> = {
|
|
|
+ '优秀': { label: '优秀', type: 'success' },
|
|
|
+ '良好': { label: '良好', type: 'primary' },
|
|
|
+ '一般': { label: '一般', type: 'warning' },
|
|
|
+ '较差': { label: '较差', type: 'danger' },
|
|
|
+ excellent: { label: '优秀', type: 'success' },
|
|
|
+ good: { label: '良好', type: 'primary' },
|
|
|
+ average: { label: '一般', type: 'warning' },
|
|
|
+ poor: { label: '较差', type: 'danger' },
|
|
|
+};
|
|
|
+
|
|
|
+export function getPurchaseOrderStatus(value: string) {
|
|
|
+ return getEnumWithStyle(PURCHASE_ORDER_STATUS, value);
|
|
|
+}
|
|
|
+
|
|
|
+export function getPurchaseRequestStatus(value: string) {
|
|
|
+ return getEnumWithStyle(PURCHASE_REQUEST_STATUS, value);
|
|
|
+}
|
|
|
+
|
|
|
+export function getPurchasePriority(value: string) {
|
|
|
+ return getEnumWithStyle(PURCHASE_PRIORITY, value);
|
|
|
+}
|
|
|
+
|
|
|
+export function getLogisticsStatus(value: string) {
|
|
|
+ return getEnumWithStyle(LOGISTICS_STATUS, value);
|
|
|
+}
|
|
|
+
|
|
|
+export function getCapabilityStatus(value: string) {
|
|
|
+ return getEnumWithStyle(CAPABILITY_STATUS, value);
|
|
|
+}
|
|
|
+
|
|
|
+export function getPerformanceStatus(value: string) {
|
|
|
+ return getEnumWithStyle(PERFORMANCE_STATUS, value);
|
|
|
+}
|
|
|
+
|
|
|
+// IQC质检结果
|
|
|
+export const IQC_RESULT: Record<string, { label: string; type: string }> = {
|
|
|
+ '合格': { label: '合格', type: 'success' },
|
|
|
+ '不合格': { label: '不合格', type: 'danger' },
|
|
|
+ '待检': { label: '待检', type: 'warning' },
|
|
|
+ pass: { label: '合格', type: 'success' },
|
|
|
+ fail: { label: '不合格', type: 'danger' },
|
|
|
+ pending: { label: '待检', type: 'warning' },
|
|
|
+};
|
|
|
+
|
|
|
+export function getIQCResult(value: string) {
|
|
|
+ return getEnumWithStyle(IQC_RESULT, value);
|
|
|
+}
|
|
|
+
|
|
|
+// 补货计划状态
|
|
|
+export const REPLENISHMENT_STATUS: Record<string, { label: string; type: string }> = {
|
|
|
+ '正常': { label: '正常', type: 'success' },
|
|
|
+ '库存不足': { label: '库存不足', type: 'danger' },
|
|
|
+ '即将缺货': { label: '即将缺货', type: 'warning' },
|
|
|
+ normal: { label: '正常', type: 'success' },
|
|
|
+ low_stock: { label: '库存不足', type: 'danger' },
|
|
|
+ warning: { label: '即将缺货', type: 'warning' },
|
|
|
+};
|
|
|
+
|
|
|
+export function getReplenishmentStatus(value: string) {
|
|
|
+ return getEnumWithStyle(REPLENISHMENT_STATUS, value);
|
|
|
+}
|
|
|
+
|
|
|
+// CRM聊天状态
|
|
|
+export const CHAT_STATUS: Record<string, { label: string; type: string }> = {
|
|
|
+ waiting: { label: '等待中', type: 'warning' },
|
|
|
+ ongoing: { label: '进行中', type: 'primary' },
|
|
|
+ ended: { label: '已结束', type: 'info' },
|
|
|
+};
|
|
|
+
|
|
|
+// CRM处理方式(AI/人工)
|
|
|
+export const CHAT_HANDLED_TYPE: Record<string, { label: string; type: string }> = {
|
|
|
+ true: { label: 'AI接待', type: 'success' },
|
|
|
+ false: { label: '人工客服', type: 'warning' },
|
|
|
+};
|
|
|
+
|
|
|
+// 知识库状态
|
|
|
+export const KNOWLEDGE_STATUS: Record<string, { label: string; type: string }> = {
|
|
|
+ enabled: { label: '启用', type: 'success' },
|
|
|
+ disabled: { label: '禁用', type: 'info' },
|
|
|
+ active: { label: '启用', type: 'success' },
|
|
|
+ inactive: { label: '禁用', type: 'info' },
|
|
|
+};
|
|
|
+
|
|
|
+// 满意度处理状态
|
|
|
+export const SATISFACTION_HANDLE_STATUS: Record<string, { label: string; type: string }> = {
|
|
|
+ '待处理': { label: '待处理', type: 'danger' },
|
|
|
+ '处理中': { label: '处理中', type: 'warning' },
|
|
|
+ '已处理': { label: '已处理', type: 'success' },
|
|
|
+ pending: { label: '待处理', type: 'danger' },
|
|
|
+ processing: { label: '处理中', type: 'warning' },
|
|
|
+ resolved: { label: '已处理', type: 'success' },
|
|
|
+};
|
|
|
+
|
|
|
+// 服务绩效状态(解决率/满意度等)
|
|
|
+export const PERFORMANCE_RATE_STATUS: Record<string, string> = {
|
|
|
+ high: '优秀',
|
|
|
+ good: '良好',
|
|
|
+ average: '一般',
|
|
|
+ poor: '较差',
|
|
|
+};
|
|
|
+
|
|
|
+// 渠道优先级
|
|
|
+export const CHANNEL_PRIORITY: Record<string, { label: string; type: string }> = {
|
|
|
+ '1': { label: 'P1', type: 'danger' },
|
|
|
+ '2': { label: 'P2', type: 'danger' },
|
|
|
+ '3': { label: 'P3', type: 'danger' },
|
|
|
+ '4': { label: 'P4', type: 'warning' },
|
|
|
+ '5': { label: 'P5', type: 'warning' },
|
|
|
+ '6': { label: 'P6', type: 'info' },
|
|
|
+ '7': { label: 'P7', type: 'info' },
|
|
|
+};
|
|
|
+
|
|
|
+// 渠道状态
|
|
|
+export const CHANNEL_STATUS: Record<string, { label: string; type: string }> = {
|
|
|
+ true: { label: '已启用', type: 'success' },
|
|
|
+ false: { label: '已禁用', type: 'info' },
|
|
|
+ enabled: { label: '已启用', type: 'success' },
|
|
|
+ disabled: { label: '已禁用', type: 'info' },
|
|
|
+};
|
|
|
+
|
|
|
+// 渠道机器人状态
|
|
|
+export const CHANNEL_ROBOT_STATUS: Record<string, { label: string; type: string }> = {
|
|
|
+ true: { label: '已启用', type: 'success' },
|
|
|
+ false: { label: '已禁用', type: 'info' },
|
|
|
+};
|
|
|
+
|
|
|
+export function getChatStatus(value: string) {
|
|
|
+ return getEnumWithStyle(CHAT_STATUS, value);
|
|
|
+}
|
|
|
+
|
|
|
+export function getChatHandledType(value: boolean) {
|
|
|
+ return getEnumWithStyle(CHAT_HANDLED_TYPE, String(value));
|
|
|
+}
|
|
|
+
|
|
|
+export function getKnowledgeStatus(value: string) {
|
|
|
+ return getEnumWithStyle(KNOWLEDGE_STATUS, value);
|
|
|
+}
|
|
|
+
|
|
|
+export function getSatisfactionHandleStatus(value: string) {
|
|
|
+ return getEnumWithStyle(SATISFACTION_HANDLE_STATUS, value);
|
|
|
+}
|
|
|
+
|
|
|
+export function getChannelPriority(value: string | number) {
|
|
|
+ const key = String(value);
|
|
|
+ return CHANNEL_PRIORITY[key] || { label: `P${key}`, type: 'info' };
|
|
|
+}
|
|
|
+
|
|
|
+export function getChannelStatus(value: boolean | string) {
|
|
|
+ return getEnumWithStyle(CHANNEL_STATUS, String(value));
|
|
|
+}
|
|
|
+
|
|
|
+export function getChannelRobotStatus(value: boolean) {
|
|
|
+ return getEnumWithStyle(CHANNEL_ROBOT_STATUS, String(value));
|
|
|
+}
|
|
|
+
|
|
|
+// 映射状态
|
|
|
+export const MAPPING_STATUS: Record<string, { label: string; type: string }> = {
|
|
|
+ '已映射': { label: '已映射', type: 'success' },
|
|
|
+ '未映射': { label: '未映射', type: 'info' },
|
|
|
+ mapped: { label: '已映射', type: 'success' },
|
|
|
+ unmapped: { label: '未映射', type: 'info' },
|
|
|
+};
|
|
|
+
|
|
|
+// 校验状态
|
|
|
+export const VALIDATE_STATUS: Record<string, { label: string; type: string }> = {
|
|
|
+ '通过': { label: '通过', type: 'success' },
|
|
|
+ '失败': { label: '失败', type: 'danger' },
|
|
|
+ '未校验': { label: '未校验', type: 'info' },
|
|
|
+ passed: { label: '通过', type: 'success' },
|
|
|
+ failed: { label: '失败', type: 'danger' },
|
|
|
+ pending: { label: '未校验', type: 'info' },
|
|
|
+};
|
|
|
+
|
|
|
+// 价格规则状态
|
|
|
+export const PRICING_RULE_STATUS: Record<string, { label: string; type: string }> = {
|
|
|
+ '生效中': { label: '生效中', type: 'success' },
|
|
|
+ '待生效': { label: '待生效', type: 'warning' },
|
|
|
+ '已停用': { label: '已停用', type: 'info' },
|
|
|
+ active: { label: '生效中', type: 'success' },
|
|
|
+ pending: { label: '待生效', type: 'warning' },
|
|
|
+ inactive: { label: '已停用', type: 'info' },
|
|
|
+};
|
|
|
+
|
|
|
+// 预警状态
|
|
|
+export const WARNING_STATUS: Record<string, { label: string; type: string }> = {
|
|
|
+ '正常': { label: '正常', type: 'success' },
|
|
|
+ '低于安全库存': { label: '低于安全库存', type: 'danger' },
|
|
|
+ '库存不足': { label: '库存不足', type: 'danger' },
|
|
|
+ normal: { label: '正常', type: 'success' },
|
|
|
+ low_stock: { label: '低于安全库存', type: 'danger' },
|
|
|
+};
|
|
|
+
|
|
|
+// 库存状态
|
|
|
+export const INVENTORY_STATUS: Record<string, { label: string; type: string }> = {
|
|
|
+ '有库存': { label: '有库存', type: 'success' },
|
|
|
+ '零库存': { label: '零库存', type: 'warning' },
|
|
|
+ '负库存': { label: '负库存', type: 'danger' },
|
|
|
+ in_stock: { label: '有库存', type: 'success' },
|
|
|
+ out_of_stock: { label: '零库存', type: 'warning' },
|
|
|
+ negative: { label: '负库存', type: 'danger' },
|
|
|
+};
|
|
|
+
|
|
|
+// 发货工作状态
|
|
|
+export const SHIPPING_WORK_STATUS: Record<string, { label: string; type: string }> = {
|
|
|
+ '待拣货': { label: '待拣货', type: 'info' },
|
|
|
+ '待发货': { label: '待发货', type: 'warning' },
|
|
|
+ '已发货': { label: '已发货', type: 'success' },
|
|
|
+ pending_pick: { label: '待拣货', type: 'info' },
|
|
|
+ pending_ship: { label: '待发货', type: 'warning' },
|
|
|
+ shipped: { label: '已发货', type: 'success' },
|
|
|
+};
|
|
|
+
|
|
|
+// 回传状态
|
|
|
+export const RETURN_STATUS: Record<string, { label: string; type: string }> = {
|
|
|
+ '未回传': { label: '未回传', type: 'info' },
|
|
|
+ '已回传': { label: '已回传', type: 'success' },
|
|
|
+ '回传失败': { label: '回传失败', type: 'danger' },
|
|
|
+ not_returned: { label: '未回传', type: 'info' },
|
|
|
+ returned: { label: '已回传', type: 'success' },
|
|
|
+ failed: { label: '回传失败', type: 'danger' },
|
|
|
+};
|
|
|
+
|
|
|
+export function getMappingStatus(value: string) {
|
|
|
+ return getEnumWithStyle(MAPPING_STATUS, value);
|
|
|
+}
|
|
|
+
|
|
|
+export function getValidateStatus(value: string) {
|
|
|
+ return getEnumWithStyle(VALIDATE_STATUS, value);
|
|
|
+}
|
|
|
+
|
|
|
+export function getPricingRuleStatus(value: string) {
|
|
|
+ return getEnumWithStyle(PRICING_RULE_STATUS, value);
|
|
|
+}
|
|
|
+
|
|
|
+export function getWarningStatus(value: string) {
|
|
|
+ return getEnumWithStyle(WARNING_STATUS, value);
|
|
|
+}
|
|
|
+
|
|
|
+export function getInventoryStatus(value: string) {
|
|
|
+ return getEnumWithStyle(INVENTORY_STATUS, value);
|
|
|
+}
|
|
|
+
|
|
|
+export function getShippingWorkStatus(value: string) {
|
|
|
+ return getEnumWithStyle(SHIPPING_WORK_STATUS, value);
|
|
|
+}
|
|
|
+
|
|
|
+export function getReturnStatus(value: string) {
|
|
|
+ return getEnumWithStyle(RETURN_STATUS, value);
|
|
|
+}
|
|
|
+
|
|
|
+// 发票状态
|
|
|
+export const INVOICE_STATUS: Record<string, { label: string; type: string }> = {
|
|
|
+ '待开票': { label: '待开票', type: 'warning' },
|
|
|
+ '已开票': { label: '已开票', type: 'success' },
|
|
|
+ '已作废': { label: '已作废', type: 'info' },
|
|
|
+ '已红冲': { label: '已红冲', type: 'danger' },
|
|
|
+ pending: { label: '待开票', type: 'warning' },
|
|
|
+ issued: { label: '已开票', type: 'success' },
|
|
|
+ voided: { label: '已作废', type: 'info' },
|
|
|
+ reversed: { label: '已红冲', type: 'danger' },
|
|
|
+};
|
|
|
+
|
|
|
+// 发票类型
|
|
|
+export const INVOICE_TYPE: Record<string, string> = {
|
|
|
+ '增值税专用发票': '增值税专用发票',
|
|
|
+ '增值税普通发票': '增值税普通发票',
|
|
|
+ '电子发票': '电子发票',
|
|
|
+ '专用': '增值税专用发票',
|
|
|
+ '普通': '增值税普通发票',
|
|
|
+ '电子': '电子发票',
|
|
|
+ special: '增值税专用发票',
|
|
|
+ ordinary: '增值税普通发票',
|
|
|
+ electronic: '电子发票',
|
|
|
+};
|
|
|
+
|
|
|
+// 结算状态
|
|
|
+export const SETTLEMENT_STATUS: Record<string, { label: string; type: string }> = {
|
|
|
+ '待确认': { label: '待确认', type: 'warning' },
|
|
|
+ '待付款': { label: '待付款', type: 'primary' },
|
|
|
+ '已付款': { label: '已付款', type: 'success' },
|
|
|
+ '已关闭': { label: '已关闭', type: 'info' },
|
|
|
+ pending: { label: '待确认', type: 'warning' },
|
|
|
+ to_pay: { label: '待付款', type: 'primary' },
|
|
|
+ paid: { label: '已付款', type: 'success' },
|
|
|
+ closed: { label: '已关闭', type: 'info' },
|
|
|
+};
|
|
|
+
|
|
|
+// 优惠券状态
|
|
|
+export const COUPON_STATUS: Record<string, { label: string; type: string }> = {
|
|
|
+ '待发放': { label: '待发放', type: 'info' },
|
|
|
+ '进行中': { label: '进行中', type: 'success' },
|
|
|
+ '已暂停': { label: '已暂停', type: 'warning' },
|
|
|
+ '已结束': { label: '已结束', type: 'info' },
|
|
|
+ pending: { label: '待发放', type: 'info' },
|
|
|
+ active: { label: '进行中', type: 'success' },
|
|
|
+ paused: { label: '已暂停', type: 'warning' },
|
|
|
+ ended: { label: '已结束', type: 'info' },
|
|
|
+};
|
|
|
+
|
|
|
+// 优惠券类型
|
|
|
+export const COUPON_TYPE: Record<string, { label: string; type: string }> = {
|
|
|
+ '满减': { label: '满减券', type: 'primary' },
|
|
|
+ '折扣': { label: '折扣券', type: 'success' },
|
|
|
+ '兑换': { label: '兑换券', type: 'warning' },
|
|
|
+ fixed_discount: { label: '满减券', type: 'primary' },
|
|
|
+ percentage: { label: '折扣券', type: 'success' },
|
|
|
+ exchange: { label: '兑换券', type: 'warning' },
|
|
|
+};
|
|
|
+
|
|
|
+// 价格预警状态
|
|
|
+export const PRICE_ALERT_STATUS: Record<string, { label: string; type: string }> = {
|
|
|
+ '正常': { label: '正常', type: 'success' },
|
|
|
+ '价格高': { label: '价格高', type: 'danger' },
|
|
|
+ '价格低': { label: '价格低', type: 'success' },
|
|
|
+ '价差大': { label: '价差大', type: 'warning' },
|
|
|
+ normal: { label: '正常', type: 'success' },
|
|
|
+ high_price: { label: '价格高', type: 'danger' },
|
|
|
+ low_price: { label: '价格低', type: 'success' },
|
|
|
+ large_diff: { label: '价差大', type: 'warning' },
|
|
|
+};
|
|
|
+
|
|
|
+// 退件状态
|
|
|
+export const RETURN_PACKAGE_STATUS: Record<string, { label: string; type: string }> = {
|
|
|
+ '待认领': { label: '待认领', type: 'warning' },
|
|
|
+ '处理中': { label: '处理中', type: 'primary' },
|
|
|
+ '已完成': { label: '已完成', type: 'success' },
|
|
|
+ pending: { label: '待认领', type: 'warning' },
|
|
|
+ processing: { label: '处理中', type: 'primary' },
|
|
|
+ completed: { label: '已完成', type: 'success' },
|
|
|
+};
|
|
|
+
|
|
|
+// 商品状态(退件)
|
|
|
+export const PRODUCT_CONDITION_STATUS: Record<string, { label: string; type: string }> = {
|
|
|
+ '可售': { label: '可售', type: 'success' },
|
|
|
+ '不可售': { label: '不可售', type: 'danger' },
|
|
|
+ sellable: { label: '可售', type: 'success' },
|
|
|
+ unsellable: { label: '不可售', type: 'danger' },
|
|
|
+};
|
|
|
+
|
|
|
+// 库存变动类型
|
|
|
+export const INVENTORY_CHANGE_TYPE: Record<string, { label: string; type: string }> = {
|
|
|
+ '入库': { label: '入库', type: 'success' },
|
|
|
+ '出库': { label: '出库', type: 'danger' },
|
|
|
+ '调拨': { label: '调拨', type: 'warning' },
|
|
|
+ '盘点': { label: '盘点', type: 'info' },
|
|
|
+ '调整': { label: '调整', type: '' },
|
|
|
+ inbound: { label: '入库', type: 'success' },
|
|
|
+ outbound: { label: '出库', type: 'danger' },
|
|
|
+ transfer: { label: '调拨', type: 'warning' },
|
|
|
+ count: { label: '盘点', type: 'info' },
|
|
|
+ adjustment: { label: '调整', type: '' },
|
|
|
+};
|
|
|
+
|
|
|
+export function getInvoiceStatus(value: string) {
|
|
|
+ return getEnumWithStyle(INVOICE_STATUS, value);
|
|
|
+}
|
|
|
+
|
|
|
+export function getInvoiceType(value: string) {
|
|
|
+ return getEnumLabel(INVOICE_TYPE, value);
|
|
|
+}
|
|
|
+
|
|
|
+export function getSettlementStatus(value: string) {
|
|
|
+ return getEnumWithStyle(SETTLEMENT_STATUS, value);
|
|
|
+}
|
|
|
+
|
|
|
+export function getCouponStatus(value: string) {
|
|
|
+ return getEnumWithStyle(COUPON_STATUS, value);
|
|
|
+}
|
|
|
+
|
|
|
+export function getCouponType(value: string) {
|
|
|
+ return getEnumWithStyle(COUPON_TYPE, value);
|
|
|
+}
|
|
|
+
|
|
|
+export function getPriceAlertStatus(value: string) {
|
|
|
+ return getEnumWithStyle(PRICE_ALERT_STATUS, value);
|
|
|
+}
|
|
|
+
|
|
|
+export function getReturnPackageStatus(value: string) {
|
|
|
+ return getEnumWithStyle(RETURN_PACKAGE_STATUS, value);
|
|
|
+}
|
|
|
+
|
|
|
+export function getProductConditionStatus(value: string) {
|
|
|
+ return getEnumWithStyle(PRODUCT_CONDITION_STATUS, value);
|
|
|
+}
|
|
|
+
|
|
|
+export function getInventoryChangeType(value: string) {
|
|
|
+ return getEnumWithStyle(INVENTORY_CHANGE_TYPE, value);
|
|
|
+}
|
|
|
+
|
|
|
+// ============ 系统管理模块枚举 ============
|
|
|
+
|
|
|
+// 员工状态
|
|
|
+export const EMPLOYEE_STATUS: Record<string, { label: string; type: string }> = {
|
|
|
+ '在职': { label: '在职', type: 'success' },
|
|
|
+ '离职': { label: '离职', type: 'info' },
|
|
|
+ '待入职': { label: '待入职', type: 'warning' },
|
|
|
+ active: { label: '在职', type: 'success' },
|
|
|
+ inactive: { label: '离职', type: 'info' },
|
|
|
+ pending: { label: '待入职', type: 'warning' },
|
|
|
+};
|
|
|
+
|
|
|
+// 员工角色
|
|
|
+export const EMPLOYEE_ROLE: Record<string, string> = {
|
|
|
+ 'admin': '管理员',
|
|
|
+ 'manager': '经理',
|
|
|
+ 'operator': '运营',
|
|
|
+ 'procurement': '采购',
|
|
|
+ 'warehouse': '仓库',
|
|
|
+ 'customer_service': '客服',
|
|
|
+ 'finance': '财务',
|
|
|
+};
|
|
|
+
|
|
|
+// 部门状态
|
|
|
+export const DEPARTMENT_STATUS: Record<string, { label: string; type: string }> = {
|
|
|
+ '正常': { label: '正常', type: 'success' },
|
|
|
+ '已停用': { label: '已停用', type: 'info' },
|
|
|
+ active: { label: '正常', type: 'success' },
|
|
|
+ inactive: { label: '已停用', type: 'info' },
|
|
|
+};
|
|
|
+
|
|
|
+// 消息模板类型
|
|
|
+export const MESSAGE_TEMPLATE_TYPE: Record<string, { label: string; type: string }> = {
|
|
|
+ '邮件': { label: '邮件', type: 'primary' },
|
|
|
+ '短信': { label: '短信', type: 'success' },
|
|
|
+ '站内信': { label: '站内信', type: 'warning' },
|
|
|
+ email: { label: '邮件', type: 'primary' },
|
|
|
+ sms: { label: '短信', type: 'success' },
|
|
|
+ notification: { label: '站内信', type: 'warning' },
|
|
|
+};
|
|
|
+
|
|
|
+// 消息模板状态
|
|
|
+export const MESSAGE_TEMPLATE_STATUS: Record<string, { label: string; type: string }> = {
|
|
|
+ '启用': { label: '启用', type: 'success' },
|
|
|
+ '停用': { label: '停用', type: 'danger' },
|
|
|
+ active: { label: '启用', type: 'success' },
|
|
|
+ inactive: { label: '停用', type: 'danger' },
|
|
|
+};
|
|
|
+
|
|
|
+// 通知类型
|
|
|
+export const NOTIFICATION_TYPE: Record<string, { label: string; type: string }> = {
|
|
|
+ '系统通知': { label: '系统通知', type: 'info' },
|
|
|
+ '业务通知': { label: '业务通知', type: 'success' },
|
|
|
+ '待办提醒': { label: '待办提醒', type: 'warning' },
|
|
|
+ '公告': { label: '公告', type: '' },
|
|
|
+ system: { label: '系统通知', type: 'info' },
|
|
|
+ business: { label: '业务通知', type: 'success' },
|
|
|
+ todo: { label: '待办提醒', type: 'warning' },
|
|
|
+ announcement: { label: '公告', type: '' },
|
|
|
+};
|
|
|
+
|
|
|
+// 通知状态
|
|
|
+export const NOTIFICATION_STATUS: Record<string, { label: string; type: string }> = {
|
|
|
+ '未读': { label: '未读', type: 'primary' },
|
|
|
+ '已读': { label: '已读', type: 'info' },
|
|
|
+ unread: { label: '未读', type: 'primary' },
|
|
|
+ read: { label: '已读', type: 'info' },
|
|
|
+};
|
|
|
+
|
|
|
+// 审批流程状态
|
|
|
+export const APPROVAL_FLOW_STATUS: Record<string, { label: string; type: string }> = {
|
|
|
+ '启用': { label: '启用', type: 'success' },
|
|
|
+ '停用': { label: '停用', type: 'danger' },
|
|
|
+ active: { label: '启用', type: 'success' },
|
|
|
+ inactive: { label: '停用', type: 'danger' },
|
|
|
+};
|
|
|
+
|
|
|
+// 审批流程类型
|
|
|
+export const APPROVAL_FLOW_TYPE: Record<string, { label: string; type: string }> = {
|
|
|
+ '采购审批': { label: '采购审批', type: 'primary' },
|
|
|
+ '费用报销': { label: '费用报销', type: 'success' },
|
|
|
+ '请假申请': { label: '请假申请', type: 'warning' },
|
|
|
+ '合同审批': { label: '合同审批', type: '' },
|
|
|
+ purchase: { label: '采购审批', type: 'primary' },
|
|
|
+ expense: { label: '费用报销', type: 'success' },
|
|
|
+ leave: { label: '请假申请', type: 'warning' },
|
|
|
+ contract: { label: '合同审批', type: '' },
|
|
|
+};
|
|
|
+
|
|
|
+// API密钥状态
|
|
|
+export const API_KEY_STATUS: Record<string, { label: string; type: string }> = {
|
|
|
+ '启用': { label: '启用', type: 'success' },
|
|
|
+ '停用': { label: '停用', type: 'info' },
|
|
|
+ '已过期': { label: '已过期', type: 'danger' },
|
|
|
+ '轮换中': { label: '轮换中', type: 'warning' },
|
|
|
+ active: { label: '启用', type: 'success' },
|
|
|
+ inactive: { label: '停用', type: 'info' },
|
|
|
+ expired: { label: '已过期', type: 'danger' },
|
|
|
+ rotating: { label: '轮换中', type: 'warning' },
|
|
|
+};
|
|
|
+
|
|
|
+// 快捷函数 - 系统管理模块
|
|
|
+export function getEmployeeStatus(value: string) {
|
|
|
+ return getEnumWithStyle(EMPLOYEE_STATUS, value);
|
|
|
+}
|
|
|
+
|
|
|
+export function getEmployeeRole(value: string) {
|
|
|
+ return getEnumLabel(EMPLOYEE_ROLE, value);
|
|
|
+}
|
|
|
+
|
|
|
+export function getDepartmentStatus(value: string) {
|
|
|
+ return getEnumWithStyle(DEPARTMENT_STATUS, value);
|
|
|
+}
|
|
|
+
|
|
|
+export function getMessageTemplateType(value: string) {
|
|
|
+ return getEnumWithStyle(MESSAGE_TEMPLATE_TYPE, value);
|
|
|
+}
|
|
|
+
|
|
|
+export function getMessageTemplateStatus(value: string) {
|
|
|
+ return getEnumWithStyle(MESSAGE_TEMPLATE_STATUS, value);
|
|
|
+}
|
|
|
+
|
|
|
+export function getNotificationType(value: string) {
|
|
|
+ return getEnumWithStyle(NOTIFICATION_TYPE, value);
|
|
|
+}
|
|
|
+
|
|
|
+export function getNotificationStatus(value: string) {
|
|
|
+ return getEnumWithStyle(NOTIFICATION_STATUS, value);
|
|
|
+}
|
|
|
+
|
|
|
+export function getApprovalFlowStatus(value: string) {
|
|
|
+ return getEnumWithStyle(APPROVAL_FLOW_STATUS, value);
|
|
|
+}
|
|
|
+
|
|
|
+export function getApprovalFlowType(value: string) {
|
|
|
+ return getEnumWithStyle(APPROVAL_FLOW_TYPE, value);
|
|
|
+}
|
|
|
+
|
|
|
+export function getApiKeyStatus(value: string) {
|
|
|
+ return getEnumWithStyle(API_KEY_STATUS, value);
|
|
|
+}
|
|
|
+
|
|
|
+// ============ 报表模块枚举 ============
|
|
|
+
|
|
|
+// 营销活动类型
|
|
|
+export const MARKETING_ACTIVITY_TYPE: Record<string, { label: string; type: string }> = {
|
|
|
+ '折扣活动': { label: '折扣活动', type: 'primary' },
|
|
|
+ '优惠券': { label: '优惠券', type: 'success' },
|
|
|
+ '买赠活动': { label: '买赠活动', type: 'warning' },
|
|
|
+ '满减活动': { label: '满减活动', type: 'danger' },
|
|
|
+ discount: { label: '折扣活动', type: 'primary' },
|
|
|
+ coupon: { label: '优惠券', type: 'success' },
|
|
|
+ buy_gift: { label: '买赠活动', type: 'warning' },
|
|
|
+ full_reduction: { label: '满减活动', type: 'danger' },
|
|
|
+};
|
|
|
+
|
|
|
+// 营销活动状态
|
|
|
+export const MARKETING_ACTIVITY_STATUS: Record<string, { label: string; type: string }> = {
|
|
|
+ '进行中': { label: '进行中', type: 'success' },
|
|
|
+ '已结束': { label: '已结束', type: 'info' },
|
|
|
+ '未开始': { label: '未开始', type: 'info' },
|
|
|
+ '已暂停': { label: '已暂停', type: 'warning' },
|
|
|
+ active: { label: '进行中', type: 'success' },
|
|
|
+ ended: { label: '已结束', type: 'info' },
|
|
|
+ pending: { label: '未开始', type: 'info' },
|
|
|
+ paused: { label: '已暂停', type: 'warning' },
|
|
|
+};
|
|
|
+
|
|
|
+// 库存周转状态
|
|
|
+export const INVENTORY_TURNOVER_STATUS: Record<string, { label: string; type: string }> = {
|
|
|
+ '正常': { label: '正常', type: 'success' },
|
|
|
+ '滞销': { label: '滞销', type: 'warning' },
|
|
|
+ '严重滞销': { label: '严重滞销', type: 'danger' },
|
|
|
+ normal: { label: '正常', type: 'success' },
|
|
|
+ slow_moving: { label: '滞销', type: 'warning' },
|
|
|
+ critical: { label: '严重滞销', type: 'danger' },
|
|
|
+};
|
|
|
+
|
|
|
+// 库存建议
|
|
|
+export const INVENTORY_SUGGESTION: Record<string, { label: string; type: string }> = {
|
|
|
+ '正常': { label: '正常', type: 'info' },
|
|
|
+ '加仓': { label: '加仓', type: 'success' },
|
|
|
+ '促销': { label: '促销', type: 'warning' },
|
|
|
+ '清仓': { label: '清仓', type: 'danger' },
|
|
|
+ normal: { label: '正常', type: 'info' },
|
|
|
+ replenish: { label: '加仓', type: 'success' },
|
|
|
+ promotion: { label: '促销', type: 'warning' },
|
|
|
+ clearance: { label: '清仓', type: 'danger' },
|
|
|
+};
|
|
|
+
|
|
|
+// 配送状态
|
|
|
+export const DELIVERY_STATUS: Record<string, { label: string; type: string }> = {
|
|
|
+ '已签收': { label: '已签收', type: 'success' },
|
|
|
+ '配送中': { label: '配送中', type: 'primary' },
|
|
|
+ '待配送': { label: '待配送', type: 'warning' },
|
|
|
+ '配送失败': { label: '配送失败', type: 'danger' },
|
|
|
+ delivered: { label: '已签收', type: 'success' },
|
|
|
+ in_transit: { label: '配送中', type: 'primary' },
|
|
|
+ pending: { label: '待配送', type: 'warning' },
|
|
|
+ failed: { label: '配送失败', type: 'danger' },
|
|
|
+};
|
|
|
+
|
|
|
+// 质检状态
|
|
|
+export const QUALITY_STATUS: Record<string, { label: string; type: string }> = {
|
|
|
+ '合格': { label: '合格', type: 'success' },
|
|
|
+ '待检': { label: '待检', type: 'warning' },
|
|
|
+ '不合格': { label: '不合格', type: 'danger' },
|
|
|
+ pass: { label: '合格', type: 'success' },
|
|
|
+ pending: { label: '待检', type: 'warning' },
|
|
|
+ fail: { label: '不合格', type: 'danger' },
|
|
|
+};
|
|
|
+
|
|
|
+// 客户等级(VIP等级)
|
|
|
+export const CUSTOMER_VIP_LEVEL: Record<string, { label: string; type: string }> = {
|
|
|
+ '钻石': { label: '钻石', type: 'danger' },
|
|
|
+ '金牌': { label: '金牌', type: 'warning' },
|
|
|
+ '银牌': { label: '银牌', type: 'primary' },
|
|
|
+ '普通': { label: '普通', type: 'info' },
|
|
|
+ diamond: { label: '钻石', type: 'danger' },
|
|
|
+ gold: { label: '金牌', type: 'warning' },
|
|
|
+ silver: { label: '银牌', type: 'primary' },
|
|
|
+ normal: { label: '普通', type: 'info' },
|
|
|
+};
|
|
|
+
|
|
|
+// 供应商等级
|
|
|
+export const SUPPLIER_LEVEL: Record<string, { label: string; type: string }> = {
|
|
|
+ 'A': { label: 'A级', type: 'success' },
|
|
|
+ 'B': { label: 'B级', type: 'warning' },
|
|
|
+ 'C': { label: 'C级', type: 'info' },
|
|
|
+ 'D': { label: 'D级', type: 'danger' },
|
|
|
+};
|
|
|
+
|
|
|
+// 报表分析状态
|
|
|
+export const REPORT_ANALYSIS_STATUS: Record<string, { label: string; type: string }> = {
|
|
|
+ '正常': { label: '正常', type: 'success' },
|
|
|
+ '警告': { label: '警告', type: 'warning' },
|
|
|
+ '异常': { label: '异常', type: 'danger' },
|
|
|
+ normal: { label: '正常', type: 'success' },
|
|
|
+ warning: { label: '警告', type: 'warning' },
|
|
|
+ abnormal: { label: '异常', type: 'danger' },
|
|
|
+};
|
|
|
+
|
|
|
+// 报表函数
|
|
|
+export function getMarketingActivityType(value: string) {
|
|
|
+ return getEnumWithStyle(MARKETING_ACTIVITY_TYPE, value);
|
|
|
+}
|
|
|
+
|
|
|
+export function getMarketingActivityStatus(value: string) {
|
|
|
+ return getEnumWithStyle(MARKETING_ACTIVITY_STATUS, value);
|
|
|
+}
|
|
|
+
|
|
|
+export function getInventoryTurnoverStatus(value: string) {
|
|
|
+ return getEnumWithStyle(INVENTORY_TURNOVER_STATUS, value);
|
|
|
+}
|
|
|
+
|
|
|
+export function getInventorySuggestion(value: string) {
|
|
|
+ return getEnumWithStyle(INVENTORY_SUGGESTION, value);
|
|
|
+}
|
|
|
+
|
|
|
+export function getDeliveryStatus(value: string) {
|
|
|
+ return getEnumWithStyle(DELIVERY_STATUS, value);
|
|
|
+}
|
|
|
+
|
|
|
+export function getQualityStatus(value: string) {
|
|
|
+ return getEnumWithStyle(QUALITY_STATUS, value);
|
|
|
+}
|
|
|
+
|
|
|
+export function getCustomerVipLevel(value: string) {
|
|
|
+ return getEnumWithStyle(CUSTOMER_VIP_LEVEL, value);
|
|
|
+}
|
|
|
+
|
|
|
+// 买家等级(与客户VIP等级相同)
|
|
|
+export function getBuyerLevel(value: string) {
|
|
|
+ return getCustomerVipLevel(value);
|
|
|
+}
|
|
|
+
|
|
|
+export function getSupplierLevel(value: string) {
|
|
|
+ return getEnumWithStyle(SUPPLIER_LEVEL, value);
|
|
|
+}
|
|
|
+
|
|
|
+export function getReportAnalysisStatus(value: string) {
|
|
|
+ return getEnumWithStyle(REPORT_ANALYSIS_STATUS, value);
|
|
|
+}
|
|
|
+
|
|
|
+// ============ 系统日志枚举 ============
|
|
|
+
|
|
|
+// 操作结果状态
|
|
|
+export const OPERATION_RESULT: Record<string, { label: string; type: string }> = {
|
|
|
+ '成功': { label: '成功', type: 'success' },
|
|
|
+ '失败': { label: '失败', type: 'danger' },
|
|
|
+ success: { label: '成功', type: 'success' },
|
|
|
+ failed: { label: '失败', type: 'danger' },
|
|
|
+ error: { label: '失败', type: 'danger' },
|
|
|
+};
|
|
|
+
|
|
|
+// 快捷函数 - 系统日志模块
|
|
|
+export function getOperationResult(value: string) {
|
|
|
+ return getEnumWithStyle(OPERATION_RESULT, value);
|
|
|
+}
|
|
|
+
|
|
|
+// 预警级别
|
|
|
+export const ALERT_LEVEL: Record<string, { label: string; type: string }> = {
|
|
|
+ 'critical': { label: '严重', type: 'danger' },
|
|
|
+ 'warning': { label: '警告', type: 'warning' },
|
|
|
+ 'info': { label: '提示', type: 'info' },
|
|
|
+ '严重': { label: '严重', type: 'danger' },
|
|
|
+ '警告': { label: '警告', type: 'warning' },
|
|
|
+ '提示': { label: '提示', type: 'info' },
|
|
|
+};
|
|
|
+
|
|
|
+export function getAlertLevel(value: string) {
|
|
|
+ return getEnumWithStyle(ALERT_LEVEL, value);
|
|
|
+}
|