matter.ts 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  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. settlementCostPrice?: boolean;
  57. }
  58. export enum ESettlementCost {
  59. CREATE = 'create',
  60. YBPX = 'ybpx',
  61. COS = 'cos',
  62. COSTEXPORT = 'costExport',
  63. }
  64. export interface IGatherMatter extends IMatter {
  65. businessID: string;
  66. }
  67. export interface IStepMatter {
  68. ID: string;
  69. userID: string;
  70. gatherID: string;
  71. businessType: BusinessTypeKey;
  72. stepID: string;
  73. matterID: string;
  74. formPermission: string[];
  75. costPermission: string[];
  76. profilePermission: string[];
  77. auditCommentsPermission: string[];
  78. settlementPermission: string[];
  79. budgetComparePermission: string[];
  80. changeAuditPermission: string[];
  81. }
  82. export interface IGatherStepMatter extends IStepMatter {
  83. businessID: string;
  84. userID: string;
  85. }
  86. export interface IYsProfileTemplate {
  87. ID: string;
  88. parentID: string;
  89. gatherID: string;
  90. businessType: BusinessTypeKey;
  91. name: string;
  92. sort: string;
  93. enable: boolean;
  94. required: boolean;
  95. folder: boolean;
  96. mode: string[];
  97. selectMode?: string;
  98. fileNum?: number;
  99. remark?: string; // 备注
  100. profileIndex?: string; // 资料索引
  101. templateFiles: { originalName: string; realName: string }[]; // 文件模板名称
  102. }
  103. export interface IGatherYsProfileTemplate extends IYsProfileTemplate {
  104. businessID: string;
  105. matterID?: string;
  106. matterListID?: string;
  107. dataID?: string;
  108. approvalID?: string;
  109. creatorId?: string;
  110. creatorName?: string;
  111. isEditNewFile?: boolean; // 是否在上个步骤被修改过
  112. isReadProcess?: string[]; // 已读步骤
  113. }
  114. export interface IDynamicStep {
  115. ID: string;
  116. gatherID: string;
  117. businessType: BusinessTypeKey;
  118. stepID: string;
  119. nextStepID: string;
  120. executorID: boolean;
  121. }
  122. export interface IGatherDynamicStep extends IDynamicStep {
  123. businessID: string;
  124. }
  125. // 组件权限相关
  126. export interface IProcessComponentPermission {
  127. // 是否可编辑
  128. editable: boolean;
  129. // 是否可查看
  130. viewable: boolean;
  131. // 是否可删除
  132. deletable?: boolean;
  133. // 能否创建项目
  134. createProject?: boolean;
  135. // 新增
  136. add?: boolean;
  137. // 审核
  138. audit?: boolean;
  139. // 增报
  140. addReport?: boolean;
  141. // 区间来源
  142. scopeSource?: {
  143. // 能否看区间来源tab
  144. viewable: boolean;
  145. // 能否看项目名称
  146. projectNameViewable: boolean;
  147. };
  148. }
  149. // 步骤里的的组件
  150. export interface IProcessComponent<T = any> {
  151. // 组件名:'cost'、'form'...
  152. name: string;
  153. // 组件权限
  154. permission: IProcessComponentPermission;
  155. // 组件数据
  156. data?: T | null;
  157. // 组件标题
  158. componentTitle?: string;
  159. // 报表打印设置
  160. reportConfig?: IMatterReportConfig;
  161. }
  162. // 步骤里的事项
  163. export interface IProcessMatter {
  164. // 事项ID
  165. matterID: string;
  166. // 事项可用组件
  167. components: IProcessComponent[];
  168. }
  169. // 前端展示需要用的事项数据结构
  170. export interface IMatterNode {
  171. ID: string;
  172. seq: number;
  173. parentID: string;
  174. name: string;
  175. components: IProcessComponent[];
  176. }
  177. export const ComponentNameMap: Record<string, string> = {
  178. dataProfile: '送审资料',
  179. form: '表单',
  180. costProfile: '造价文件',
  181. auditAmountSummary: '审核金额汇总',
  182. auditComments: '审核意见',
  183. settlement: '造价文件',
  184. budgetCompare: '概算-预算阶段造价对比',
  185. resultsDocument: '成果文件',
  186. changeAudit: '传统变更审核',
  187. reviewRecord: '预算复核',
  188. auditScore: '审核评分',
  189. };
  190. // 后台模板文件
  191. export interface IGypFileTemplate {
  192. ID: string;
  193. url: string;
  194. originalName: string;
  195. realName: string;
  196. gypID: string;
  197. businessID: string;
  198. }
  199. // 事项库
  200. export interface IMatterList {
  201. ID: string;
  202. name: string;
  203. approvalID: string;
  204. createdID: string;
  205. createdTime: number;
  206. }