matter.ts 5.1 KB

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