matter.ts 3.8 KB

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