matter.ts 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  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 IMatterReportConfig {
  17. component: string;
  18. enable: boolean;
  19. type: string;
  20. IDs: string | number[];
  21. compilationID?: string;
  22. }
  23. // 事项
  24. export interface IMatter {
  25. ID: string;
  26. gatherID: string;
  27. businessType: BusinessTypeKey;
  28. matterType: MatterTypeKey;
  29. parentID: string;
  30. name: string;
  31. sort: string;
  32. formSchema: any;
  33. // 组件名列表
  34. assembly: string[];
  35. dataID: string;
  36. // 审批金额组件配置
  37. auditAmountConfig?: IAuditSummaryConfig[];
  38. // 审核意见组件配置
  39. auditCommentsConfig?: IAuditCommentConfig;
  40. // 多文件组件合格率设置
  41. settlementPassingRate?: number;
  42. // 多文件组件区间来源可见性范围
  43. settlementSourceScope?: IScopeType[];
  44. // 多文件组件区间来源项目名称可见性范围
  45. settlementProjectScope?: IScopeType[];
  46. // 报表打印设置
  47. reportConfig?: IMatterReportConfig[];
  48. // 计价创建方式和导出方式权限控制
  49. settlementCost?: {
  50. create: IScopeType[];
  51. ybpx: IScopeType[];
  52. cos: IScopeType[];
  53. costExport: IScopeType[];
  54. };
  55. }
  56. export enum ESettlementCost {
  57. CREATE = 'create',
  58. YBPX = 'ybpx',
  59. COS = 'cos',
  60. COSTEXPORT = 'costExport',
  61. }
  62. export interface IGatherMatter extends IMatter {
  63. businessID: string;
  64. }
  65. export interface IStepMatter {
  66. ID: string;
  67. userID: string;
  68. gatherID: string;
  69. businessType: BusinessTypeKey;
  70. stepID: string;
  71. matterID: string;
  72. formPermission: string[];
  73. costPermission: string[];
  74. profilePermission: string[];
  75. auditCommentsPermission: string[];
  76. settlementPermission: string[];
  77. budgetComparePermission: string[];
  78. changeAuditPermission: string[];
  79. }
  80. export interface IGatherStepMatter extends IStepMatter {
  81. businessID: string;
  82. userID: string;
  83. }
  84. export interface IYsProfileTemplate {
  85. ID: string;
  86. parentID: string;
  87. gatherID: string;
  88. businessType: BusinessTypeKey;
  89. name: string;
  90. sort: string;
  91. enable: boolean;
  92. required: boolean;
  93. folder: boolean;
  94. mode: string[];
  95. selectMode?: string;
  96. fileNum?: number;
  97. remark?: string; // 备注
  98. profileIndex?: string; // 资料索引
  99. }
  100. export interface IGatherYsProfileTemplate extends IYsProfileTemplate {
  101. businessID: string;
  102. matterID?: string;
  103. matterListID?: string;
  104. dataID?: string;
  105. approvalID?: string;
  106. creatorId?: string;
  107. creatorName?: string;
  108. isEditNewFile?: boolean; // 是否在上个步骤被修改过
  109. }
  110. export interface IDynamicStep {
  111. ID: string;
  112. gatherID: string;
  113. businessType: BusinessTypeKey;
  114. stepID: string;
  115. nextStepID: string;
  116. executorID: boolean;
  117. }
  118. export interface IGatherDynamicStep extends IDynamicStep {
  119. businessID: string;
  120. }
  121. // 组件权限相关
  122. export interface IProcessComponentPermission {
  123. // 是否可编辑
  124. editable: boolean;
  125. // 是否可查看
  126. viewable: boolean;
  127. // 能否创建项目
  128. createProject?: boolean;
  129. // 新增
  130. add?: boolean;
  131. // 审核
  132. audit?: boolean;
  133. // 增报
  134. addReport?: boolean;
  135. // 区间来源
  136. scopeSource?: {
  137. // 能否看区间来源tab
  138. viewable: boolean;
  139. // 能否看项目名称
  140. projectNameViewable: boolean;
  141. };
  142. }
  143. // 步骤里的的组件
  144. export interface IProcessComponent<T = any> {
  145. // 组件名:'cost'、'form'...
  146. name: string;
  147. // 组件权限
  148. permission: IProcessComponentPermission;
  149. // 组件数据
  150. data?: T | null;
  151. // 组件标题
  152. componentTitle?: string;
  153. // 报表打印设置
  154. reportConfig?: IMatterReportConfig;
  155. }
  156. // 步骤里的事项
  157. export interface IProcessMatter {
  158. // 事项ID
  159. matterID: string;
  160. // 事项可用组件
  161. components: IProcessComponent[];
  162. }
  163. // 前端展示需要用的事项数据结构
  164. export interface IMatterNode {
  165. ID: string;
  166. seq: number;
  167. parentID: string;
  168. name: string;
  169. components: IProcessComponent[];
  170. }
  171. export const ComponentNameMap: Record<string, string> = {
  172. dataProfile: '送审资料',
  173. form: '表单',
  174. costProfile: '造价文件',
  175. auditAmountSummary: '审核金额汇总',
  176. auditComments: '审核意见',
  177. settlement: '造价文件',
  178. budgetCompare: '概算-预算阶段造价对比',
  179. resultsDocument: '成果文件',
  180. changeAudit: '传统变更审核',
  181. reviewRecord: '预算复核',
  182. auditScore: '审核评分',
  183. };