matter.ts 5.2 KB

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