models.ts 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. // 基础数据模型类型
  2. // 用户角色常量
  3. export const RoleSystemAdmin = 'system_admin';
  4. export const RoleFactoryAdmin = 'factory_admin';
  5. export const RoleWorker = 'worker';
  6. // 工单/批次状态常量
  7. export const StatusPending = 'pending';
  8. export const StatusInProgress = 'in_progress';
  9. export const StatusCompleted = 'completed';
  10. export const StatusCancelled = 'cancelled';
  11. // 计件记录状态常量
  12. export const RecordStatusNormal = 'normal';
  13. export const RecordStatusReverted = 'reverted';
  14. // 工资周期状态常量
  15. export const SalaryStatusPending = 'pending';
  16. export const SalaryStatusLocked = 'locked';
  17. // 工厂类型
  18. export interface Factory {
  19. id: string;
  20. name: string;
  21. db_path: string;
  22. status: number; // 1=启用, 0=禁用
  23. created_at: string;
  24. updated_at: string;
  25. }
  26. // 裁床批次类型
  27. export interface CutBatch {
  28. id: number;
  29. work_order_id: number;
  30. batch_no: string;
  31. color: string;
  32. total_qty: number;
  33. completed_qty: number;
  34. status: string;
  35. created_at: string;
  36. updated_at: string;
  37. }
  38. // 扎号(分扎)类型
  39. export interface CutBundle {
  40. id: number;
  41. batch_id: number;
  42. bundle_no: string;
  43. size: string;
  44. quantity: number;
  45. qr_code: string;
  46. status: string;
  47. created_at: string;
  48. updated_at: string;
  49. }
  50. // 工价模板类型
  51. export interface PriceTemplate {
  52. id: number;
  53. style: string;
  54. process_id: number;
  55. price: number;
  56. remark: string;
  57. created_at: string;
  58. updated_at: string;
  59. }