// 编码体系类型定义 // ========== 编码规则 ========== export interface CodeRuleVO { id: number; ruleCode: string; ruleName: string; scope: string; pattern: string; prefix: string; separator?: string; length: number; resetCycle: string; maxSeq: number; description?: string; status: number; // 0启用 1冻结 2已注销 lifecycleStatus: number; // 0草稿 1待审批 2启用 3已撤销 createdBy?: string; createTime: string; updateTime?: string; } export interface CodeRuleSaveParams { id?: number; ruleCode: string; ruleName: string; scope: string; pattern: string; prefix: string; separator?: string; length: number; resetCycle: string; maxSeq: number; description?: string; status?: number; lifecycleStatus?: number; } export interface CodeRulePageParams { pageNo: number; pageSize: number; ruleCode?: string; ruleName?: string; scope?: string; status?: number; lifecycleStatus?: number; } export const CODE_RULE_STATUS = { 0: { label: '启用', color: 'success' }, 1: { label: '冻结', color: 'default' }, 2: { label: '已注销', color: 'error' }, } as const; export const CODE_RULE_LIFECYCLE = { 0: { label: '草稿', color: 'processing' }, 1: { label: '待审批', color: 'warning' }, 2: { label: '启用', color: 'success' }, 3: { label: '已撤销', color: 'error' }, } as const; // ========== 编码生成日志 ========== export interface CodeLogVO { id: number; code: string; scope: string; trigger: string; // 手动 / 业务模块 / 事件驱动 caller: string; ruleCode: string; seq: number; createTime: string; } export interface CodeLogPageParams { pageNo: number; pageSize: number; scope?: string; trigger?: string; startTime?: string; endTime?: string; } // ========== 编码对照 ========== export interface CodeMappingVO { id: number; oldCode: string; newCode: string; entityType: string; effectDate: string; expireDate: string; reason?: string; status: number; // 0启用 1已过期 transition: string; } export interface CodeMappingSaveParams { id?: number; oldCode: string; newCode: string; entityType: string; effectDate: string; expireDate?: string; reason?: string; } export interface CodeMappingPageParams { pageNo: number; pageSize: number; entityType?: string; status?: number; } export const CODE_MAPPING_STATUS = { 0: { label: '启用', color: 'success' }, 1: { label: '已过期', color: 'default' }, } as const; export const CODE_MAPPING_TRANSITION = { '进行中': { label: '进行中', color: 'processing' }, '已结束': { label: '已结束', color: 'default' }, } as const; // ========== 审批管理 ========== export interface ApprovalVO { id: number; type: string; // 准入 / 变更 / 注销 applicant: string; ruleCode: string; ruleName: string; submitTime: string; status: string; // 待审批 / 已通过 / 已拒绝 approver?: string; approveTime?: string; comment?: string; changeDetail?: { before: { pattern: string; length: number }; after: { pattern: string; length: number }; }; } // ========== 同步管理 ========== export interface SyncRecordVO { id: number; ruleCode: string; ruleName: string; system: string; status: string; // 成功 / 失败 / 进行中 / 待同步 time: string; trigger: string; retryCount: number; reason?: string; } // ========== 变量字典 ========== export interface VariableDictVO { id: number; key: string; name: string; desc: string; scope: string; example: string; status: number; // 0启用 1停用 } export const VARIABLE_DICT_STATUS = { 0: { label: '启用', color: 'success' }, 1: { label: '停用', color: 'error' }, } as const; // ========== 序列池 ========== export interface SeqPoolVO { id: number; ruleCode: string; cycleStart: string; curSeq: number; maxSeq: number; resetCycle: string; lastCode: string; status: string; } // ========== 编码范围选项 ========== export const CODING_SCOPE_OPTIONS = [ '物料', '设备', '客户', '组织', 'BOM', '工艺', '质量', '仓库', '工模具', '计量器具', '样品', '配方', '废料', '合金主数据', '标准', '客户技术规格', '客户特殊要求', '客户禁止/限制要求', '规约配置', 'APQP文件包', '产品族', '物料类', ];