enums.dart 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. /// OA 模块数据库枚举常量。
  2. ///
  3. /// PRD/Database §6 枚举取值统一维护点。
  4. /// 枚举值(value)与数据库 VARCHAR 存储值一致,
  5. /// labelKey 为 i18n 键,前端展示通过 `l10n.get(labelKey)` 获取。
  6. class EnumEntry {
  7. final String value;
  8. final String labelKey;
  9. const EnumEntry(this.value, this.labelKey);
  10. }
  11. // ═══════════════════════════════════════════
  12. // §6.1 单据审批状态
  13. // ═══════════════════════════════════════════
  14. class ApprovalStatus {
  15. ApprovalStatus._();
  16. static const draft = EnumEntry('draft', 'draft');
  17. static const pending = EnumEntry('pending', 'statusPending');
  18. static const approved = EnumEntry('approved', 'statusApproved');
  19. static const rejected = EnumEntry('rejected', 'statusRejected');
  20. static const withdrawn = EnumEntry('withdrawn', 'statusWithdrawn');
  21. static const completed = EnumEntry('completed', 'completed');
  22. static const returned = EnumEntry('returned', 'returned');
  23. static const values = [draft, pending, approved, rejected, withdrawn];
  24. }
  25. // ═══════════════════════════════════════════
  26. // §6.2 付款状态
  27. // ═══════════════════════════════════════════
  28. class PaymentStatus {
  29. PaymentStatus._();
  30. static const unpaid = EnumEntry('unpaid', 'statusWaitPay');
  31. static const paid = EnumEntry('paid', 'paid');
  32. static const values = [unpaid, paid];
  33. }
  34. // ═══════════════════════════════════════════
  35. // §6.3 费用大类(ExpenseTypes)
  36. // ═══════════════════════════════════════════
  37. class ExpenseType {
  38. ExpenseType._();
  39. static const travel = EnumEntry('travel', 'filterExpenseTravel');
  40. static const entertainment = EnumEntry(
  41. 'entertainment',
  42. 'filterExpenseEntertainment',
  43. );
  44. static const procurement = EnumEntry('procurement', 'expenseTypeProcurement');
  45. static const activity = EnumEntry('activity', 'expenseTypeActivity');
  46. static const office = EnumEntry('office', 'filterExpenseOffice');
  47. static const meeting = EnumEntry('meeting', 'filterExpenseMeeting');
  48. static const training = EnumEntry('training', 'expenseTypeTraining');
  49. static const values = [
  50. travel,
  51. entertainment,
  52. procurement,
  53. activity,
  54. office,
  55. meeting,
  56. training,
  57. ];
  58. }
  59. // ═══════════════════════════════════════════
  60. // §6.4 紧急程度
  61. // ═══════════════════════════════════════════
  62. class Urgency {
  63. Urgency._();
  64. static const normal = EnumEntry('normal', 'normal');
  65. static const urgent = EnumEntry('urgent', 'urgent');
  66. static const critical = EnumEntry('critical', 'filterCritical');
  67. static const values = [normal, urgent, critical];
  68. }
  69. // ═══════════════════════════════════════════
  70. // §6.5 交通工具
  71. // ═══════════════════════════════════════════
  72. class TransportType {
  73. TransportType._();
  74. static const plane = EnumEntry('plane', 'transportPlane');
  75. static const highSpeedRail = EnumEntry(
  76. 'high_speed_rail',
  77. 'transportHighSpeedRail',
  78. );
  79. static const train = EnumEntry('train', 'transportTrain');
  80. static const selfDrive = EnumEntry('self_drive', 'transportSelfDrive');
  81. static const values = [plane, highSpeedRail, train, selfDrive];
  82. }
  83. // ═══════════════════════════════════════════
  84. // §6.6 招待层级
  85. // ═══════════════════════════════════════════
  86. class EntertainmentLevel {
  87. EntertainmentLevel._();
  88. static const normal = EnumEntry('normal', 'normal');
  89. static const important = EnumEntry('important', 'important');
  90. static const vip = EnumEntry('vip', 'entertainmentVip');
  91. static const values = [normal, important, vip];
  92. }
  93. // ═══════════════════════════════════════════
  94. // §6.9 加班类型
  95. // ═══════════════════════════════════════════
  96. class OtType {
  97. OtType._();
  98. static const workday = EnumEntry('workday', 'workdayOvertime');
  99. static const weekend = EnumEntry('weekend', 'weekendOvertime');
  100. static const holiday = EnumEntry('holiday', 'holidayOvertime');
  101. static const values = [workday, weekend, holiday];
  102. }
  103. // ═══════════════════════════════════════════
  104. // §6.10 补偿方式
  105. // ═══════════════════════════════════════════
  106. class CompensationType {
  107. CompensationType._();
  108. static const overtimePay = EnumEntry(
  109. 'overtime_pay',
  110. 'compensationOvertimePay',
  111. );
  112. static const compLeave = EnumEntry('comp_leave', 'compensationCompLeave');
  113. static const mixed = EnumEntry('mixed', 'compensationMixed');
  114. static const values = [overtimePay, compLeave, mixed];
  115. }
  116. // ═══════════════════════════════════════════
  117. // §6.11 用车目的
  118. // ═══════════════════════════════════════════
  119. class VehiclePurpose {
  120. VehiclePurpose._();
  121. static const reception = EnumEntry('reception', 'customerReception');
  122. static const business = EnumEntry('business', 'businessTrip');
  123. static const official = EnumEntry('official', 'official');
  124. static const values = [reception, business, official];
  125. }
  126. // ═══════════════════════════════════════════
  127. // §6.14 公告分类
  128. // ═══════════════════════════════════════════
  129. class AnnouncementType {
  130. AnnouncementType._();
  131. static const notice = EnumEntry('notice', 'noticeAnnouncement');
  132. static const policy = EnumEntry('policy', 'hrPolicy');
  133. static const activity = EnumEntry('activity', 'holidayActivity');
  134. static const values = [notice, policy, activity];
  135. }