matter.ts 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. import { BusinessTypeKey, MatterTypeKey } from './gather';
  2. // 审批金额汇总组件阶段数据
  3. export interface IAuditSummaryConfig {
  4. // 阶段名称
  5. name: string;
  6. // 关联步骤ID(条件下有多个步骤)
  7. stepIDs: string[];
  8. }
  9. // 审核意见组件配置
  10. export interface IAuditCommentConfig {
  11. // 富文本模板
  12. template: string;
  13. }
  14. // 事项
  15. export interface IMatter {
  16. ID: string;
  17. gatherID: string;
  18. businessType: BusinessTypeKey;
  19. matterType: MatterTypeKey;
  20. parentID: string;
  21. name: string;
  22. sort: string;
  23. formSchema: any;
  24. // 组件名列表
  25. assembly: string[];
  26. dataID: string;
  27. // 审批金额组件配置
  28. auditAmountConfig?: IAuditSummaryConfig[];
  29. // 审核意见组件配置
  30. auditCommentsConfig?: IAuditCommentConfig;
  31. settlementPassingRate?: number;
  32. }
  33. export interface IGatherMatter extends IMatter {
  34. businessID: string;
  35. }
  36. export interface IStepMatter {
  37. ID: string;
  38. userID: string;
  39. gatherID: string;
  40. businessType: BusinessTypeKey;
  41. stepID: string;
  42. matterID: string;
  43. formPermission: string[];
  44. costPermission: string[];
  45. profilePermission: string[];
  46. auditCommentsPermission: string[];
  47. settlementPermission: string[];
  48. budgetComparePermission: string[];
  49. }
  50. export interface IGatherStepMatter extends IStepMatter {
  51. businessID: string;
  52. userID: string;
  53. }
  54. export interface IYsProfileTemplate {
  55. ID: string;
  56. parentID: string;
  57. gatherID: string;
  58. businessType: BusinessTypeKey;
  59. name: string;
  60. sort: string;
  61. enable: boolean;
  62. required: boolean;
  63. folder: boolean;
  64. mode: string[];
  65. selectMode?: string;
  66. fileNum?: number;
  67. }
  68. export interface IGatherYsProfileTemplate extends IYsProfileTemplate {
  69. businessID: string;
  70. }
  71. export interface IDynamicStep {
  72. ID: string;
  73. gatherID: string;
  74. businessType: BusinessTypeKey;
  75. stepID: string;
  76. nextStepID: string;
  77. executorID: boolean;
  78. }
  79. export interface IGatherDynamicStep extends IDynamicStep {
  80. businessID: string;
  81. }
  82. // 组件权限相关
  83. export interface IProcessComponentPermission {
  84. // 是否可编辑
  85. editable: boolean;
  86. // 是否可查看
  87. viewable: boolean;
  88. // 能否创建项目
  89. createProject?: boolean;
  90. // 新增
  91. add?: boolean;
  92. // 审核
  93. audit?: boolean;
  94. // 增报
  95. addReport?: boolean;
  96. }
  97. // 步骤里的的组件
  98. export interface IProcessComponent<T = any> {
  99. // 组件名:'cost'、'form'...
  100. name: string;
  101. // 组件权限
  102. permission: IProcessComponentPermission;
  103. // 组件数据
  104. data?: T | null;
  105. // 组件标题
  106. componentTitle?: string;
  107. }
  108. // 步骤里的事项
  109. export interface IProcessMatter {
  110. // 事项ID
  111. matterID: string;
  112. // 事项可用组件
  113. components: IProcessComponent[];
  114. }
  115. // 前端展示需要用的事项数据结构
  116. export interface IMatterNode {
  117. ID: string;
  118. seq: number;
  119. parentID: string;
  120. name: string;
  121. components: IProcessComponent[];
  122. }
  123. export const ComponentNameMap: Record<string, string> = {
  124. dataProfile: '送审资料',
  125. form: '表单',
  126. costProfile: '造价文件',
  127. auditAmountSummary: '审核金额汇总',
  128. auditComments: '审核意见',
  129. settlement: '造价文件',
  130. budgetCompare: '概算-预算阶段造价对比',
  131. };