2026-06-04 15:09:31 +00:00
|
|
|
|
/**
|
|
|
|
|
|
* 公共常量 - 从统一配置中心导入并重新导出
|
|
|
|
|
|
* 保持向后兼容,所有旧引用无需修改
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
import {
|
|
|
|
|
|
ANIMATION_CONFIG,
|
|
|
|
|
|
PAGINATION_CONFIG,
|
|
|
|
|
|
PROGRESS_THRESHOLDS,
|
|
|
|
|
|
} from '../config/app';
|
|
|
|
|
|
|
|
|
|
|
|
// ==================== 状态映射配置 ====================
|
|
|
|
|
|
|
|
|
|
|
|
/** 计划状态枚举值(消除散落的字符串字面量) */
|
|
|
|
|
|
export const PLAN_STATUS = {
|
|
|
|
|
|
PENDING: 'pending',
|
|
|
|
|
|
PRODUCING: 'producing',
|
|
|
|
|
|
COMPLETED: 'completed',
|
|
|
|
|
|
REJECTED: 'rejected',
|
|
|
|
|
|
} as const;
|
|
|
|
|
|
|
|
|
|
|
|
/** 流程步骤状态枚举值 */
|
|
|
|
|
|
export const STEP_STATUS = {
|
|
|
|
|
|
PENDING: 'pending',
|
|
|
|
|
|
ACTIVE: 'active',
|
|
|
|
|
|
COMPLETED: 'completed',
|
|
|
|
|
|
REJECTED: 'rejected',
|
|
|
|
|
|
} as const;
|
|
|
|
|
|
|
|
|
|
|
|
/** 工厂类型枚举值 */
|
|
|
|
|
|
export const FACTORY_TYPE = {
|
|
|
|
|
|
TEXTILE: 'textile',
|
|
|
|
|
|
WASHING: 'washing',
|
|
|
|
|
|
} as const;
|
|
|
|
|
|
|
|
|
|
|
|
/** 仓库类型枚举值 */
|
|
|
|
|
|
export const WAREHOUSE_TYPE = {
|
|
|
|
|
|
RAW_FABRIC: 'raw_fabric',
|
|
|
|
|
|
FABRIC: 'fabric',
|
|
|
|
|
|
FINISHED: 'finished',
|
|
|
|
|
|
YARN: 'yarn',
|
|
|
|
|
|
} as const;
|
|
|
|
|
|
|
|
|
|
|
|
/** 结款状态枚举值 */
|
|
|
|
|
|
export const PAYMENT_STATUS = {
|
|
|
|
|
|
PENDING: 'pending',
|
|
|
|
|
|
COMPLETED: 'completed',
|
|
|
|
|
|
} as const;
|
|
|
|
|
|
|
|
|
|
|
|
/** 分享链接状态枚举值 */
|
|
|
|
|
|
export const SHARE_LINK_STATUS = {
|
|
|
|
|
|
PENDING: 'pending',
|
|
|
|
|
|
CLICKED: 'clicked',
|
|
|
|
|
|
CONFIRMED: 'confirmed',
|
|
|
|
|
|
REJECTED: 'rejected',
|
|
|
|
|
|
EXPIRED: 'expired',
|
|
|
|
|
|
CANCELLED: 'cancelled',
|
|
|
|
|
|
} as const;
|
|
|
|
|
|
|
|
|
|
|
|
/** 水洗计划状态枚举值 */
|
|
|
|
|
|
export const WASHING_PLAN_STATUS = {
|
|
|
|
|
|
PENDING: 'pending',
|
|
|
|
|
|
IN_PROGRESS: 'in_progress',
|
|
|
|
|
|
COMPLETED: 'completed',
|
|
|
|
|
|
} as const;
|
|
|
|
|
|
|
|
|
|
|
|
/** 出入库记录类型 */
|
|
|
|
|
|
export const INVENTORY_RECORD_TYPE = {
|
|
|
|
|
|
IN: 'in',
|
|
|
|
|
|
OUT: 'out',
|
|
|
|
|
|
} as const;
|
|
|
|
|
|
|
|
|
|
|
|
/** 出库类型 */
|
|
|
|
|
|
export const OUTBOUND_TYPE = {
|
|
|
|
|
|
MANUAL: 'manual',
|
|
|
|
|
|
AUTO: 'auto',
|
|
|
|
|
|
} as const;
|
|
|
|
|
|
|
|
|
|
|
|
// ==================== UI 状态映射 ====================
|
|
|
|
|
|
|
2026-07-07 18:56:04 +08:00
|
|
|
|
// 水洗计划状态映射
|
|
|
|
|
|
export const washingStatusMap: Record<string, { label: string; color: string; bgColor: string; borderColor: string }> = {
|
|
|
|
|
|
[WASHING_PLAN_STATUS.PENDING]: { label: '待处理', color: 'text-amber-700', bgColor: 'bg-amber-50', borderColor: 'border-amber-200' },
|
|
|
|
|
|
[WASHING_PLAN_STATUS.IN_PROGRESS]: { label: '处理中', color: 'text-purple-700', bgColor: 'bg-purple-50', borderColor: 'border-purple-200' },
|
|
|
|
|
|
[WASHING_PLAN_STATUS.COMPLETED]: { label: '已完成', color: 'text-emerald-700', bgColor: 'bg-emerald-50', borderColor: 'border-emerald-200' },
|
|
|
|
|
|
};
|
|
|
|
|
|
|
2026-05-26 05:15:10 +00:00
|
|
|
|
// 状态映射配置
|
|
|
|
|
|
export const statusMap: Record<string, { label: string; color: string; bgColor: string; borderColor: string }> = {
|
2026-06-04 15:09:31 +00:00
|
|
|
|
[PLAN_STATUS.PENDING]: { label: '待确定', color: 'text-amber-700', bgColor: 'bg-amber-50', borderColor: 'border-amber-200' },
|
|
|
|
|
|
[PLAN_STATUS.PRODUCING]: { label: '生产中', color: 'text-blue-700', bgColor: 'bg-blue-50', borderColor: 'border-blue-200' },
|
|
|
|
|
|
[PLAN_STATUS.COMPLETED]: { label: '已完成', color: 'text-emerald-700', bgColor: 'bg-emerald-50', borderColor: 'border-emerald-200' },
|
|
|
|
|
|
[PLAN_STATUS.REJECTED]: { label: '已拒绝', color: 'text-gray-700', bgColor: 'bg-gray-100', borderColor: 'border-gray-300' }
|
2026-05-26 05:15:10 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// 简化的状态映射(用于纺织厂)
|
|
|
|
|
|
export const simpleStatusMap: Record<string, { label: string; color: string }> = {
|
2026-06-04 15:09:31 +00:00
|
|
|
|
[PLAN_STATUS.PENDING]: { label: '待确定', color: 'bg-yellow-100 text-yellow-700' },
|
|
|
|
|
|
[PLAN_STATUS.PRODUCING]: { label: '生产中', color: 'bg-blue-100 text-blue-700' },
|
|
|
|
|
|
[PLAN_STATUS.COMPLETED]: { label: '已完成', color: 'bg-green-100 text-green-700' },
|
|
|
|
|
|
[PLAN_STATUS.REJECTED]: { label: '已拒绝', color: 'bg-gray-100 text-gray-600' }
|
2026-05-26 05:15:10 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
2026-06-04 15:09:31 +00:00
|
|
|
|
// ==================== 步骤配置 ====================
|
|
|
|
|
|
|
2026-05-26 05:15:10 +00:00
|
|
|
|
// 步骤类型配置
|
|
|
|
|
|
export const stepTypeConfig: Record<string, { name: string; icon: string }> = {
|
|
|
|
|
|
confirm: { name: '确认计划', icon: 'Check' },
|
|
|
|
|
|
yarn_purchase: { name: '采纱', icon: 'Clock' },
|
|
|
|
|
|
dyeing: { name: '染纱', icon: 'Clock' },
|
|
|
|
|
|
machine_start: { name: '上机', icon: 'Clock' },
|
|
|
|
|
|
fabric_warehouse: { name: '坯布生产', icon: 'Package' }
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// 步骤名称映射
|
|
|
|
|
|
export const stepNames: Record<string, string> = {
|
|
|
|
|
|
confirm: '确认计划',
|
|
|
|
|
|
yarn_purchase: '采纱',
|
|
|
|
|
|
dyeing: '染纱',
|
|
|
|
|
|
machine_start: '上机',
|
|
|
|
|
|
fabric_warehouse: '坯布生产'
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// 步骤顺序
|
|
|
|
|
|
export const stepOrder = ['confirm', 'yarn_purchase', 'dyeing', 'machine_start', 'fabric_warehouse'];
|
|
|
|
|
|
|
2026-06-04 15:09:31 +00:00
|
|
|
|
// ==================== 从配置中心导出的常量(向后兼容) ====================
|
|
|
|
|
|
|
2026-05-26 05:15:10 +00:00
|
|
|
|
// 动画配置
|
2026-06-04 15:09:31 +00:00
|
|
|
|
export const animationConfig = ANIMATION_CONFIG;
|
2026-05-26 05:15:10 +00:00
|
|
|
|
|
|
|
|
|
|
// 分页配置
|
|
|
|
|
|
export const paginationConfig = {
|
2026-06-04 15:09:31 +00:00
|
|
|
|
defaultPageSize: PAGINATION_CONFIG.defaultPageSize,
|
|
|
|
|
|
maxInventoryRecords: PAGINATION_CONFIG.maxInventoryRecords,
|
|
|
|
|
|
maxPriceHistory: PAGINATION_CONFIG.maxPriceHistory,
|
2026-05-26 05:15:10 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// 进度阈值
|
|
|
|
|
|
export const progressThresholds = {
|
2026-06-04 15:09:31 +00:00
|
|
|
|
complete: PROGRESS_THRESHOLDS.complete,
|
2026-05-26 05:15:10 +00:00
|
|
|
|
};
|