base.ts 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356
  1. import { IProcessData, IProjectApproval } from './process';
  2. import { IProjectGlj } from './glj';
  3. import { IBill, IBookmark } from './bill';
  4. import { IProject, IProjectPermission } from './project';
  5. import { IGljQtyCoe, IRation } from './ration';
  6. import { IFeeRateFile } from './feeRate';
  7. import { ICalcProgramFile } from './calculation';
  8. import { IConfigMaterial } from './configMaterial';
  9. import { IQuantityDetail } from './quantityDetail';
  10. import { IInstallationFee } from './installation';
  11. export interface IAny {
  12. [prop: string]: any;
  13. }
  14. export interface ITreeScm {
  15. ID: string;
  16. parentID: string;
  17. seq: number;
  18. }
  19. export interface IFileRef {
  20. ID: string;
  21. name: string;
  22. type?: number;
  23. isDefault?: boolean;
  24. }
  25. export interface INumFileRef {
  26. ID: number;
  27. name: string;
  28. type?: number;
  29. isDefault?: boolean;
  30. }
  31. export enum DeleteEnum {
  32. NORMAL = 1,
  33. DELETED,
  34. COMPLETEDELETED,
  35. }
  36. // 返回数据接口
  37. export interface IResult<T = any> {
  38. errno: number;
  39. message: string;
  40. data: T;
  41. }
  42. export enum FromType {
  43. STD = 'std',
  44. CPT = 'cpt',
  45. }
  46. export enum RationPrefix {
  47. EMT = '',
  48. BOR = '借',
  49. CPT = '补',
  50. REP = '换',
  51. }
  52. // 工料机生成的类型
  53. export enum GljCreateType {
  54. NORMAL = 'normal',
  55. ADD = 'add',
  56. REPLACE = 'replace',
  57. }
  58. export enum CreateLocation {
  59. CSXM = 1, // 模板子目分别放在措施项目下
  60. FBFX = 2, // 模板子目分别放在分部分项下
  61. HNTZM = 3, // 模板子目分别放在对应混凝土子目下
  62. }
  63. export enum BRType { // 1 :大项费用 2:分部 3分项 4清单;5补项 6 定额、7 量价、8 工料机定额
  64. DXFY = 1, // 大项费用
  65. FB = 2, // 分部
  66. FX = 3, // 分项
  67. BILL = 4, // 清单
  68. BX = 5, // 这个补项因为旧版本是后定义的,所以放在后面,为了统一不混淆
  69. CS = 6, // 分类
  70. DT = 7, // 费用明细
  71. RATION = 20, // 定额
  72. INST = 21, // 安装增加费生成的定额
  73. VP = 22, // 量价
  74. GLJ = 23, // 工料机
  75. OH = 24, // 超高子目
  76. ITEM = 25, // 子目增加
  77. // 虚拟节点,主材、设备,只是显示
  78. MAIN = 50, // 主材
  79. EQUIP = 51, // 设备
  80. }
  81. export enum SupplyType {
  82. ZXCG = 1, // 自行采购
  83. BFJG, // 部分甲供
  84. WQJG, // 完全甲供
  85. JGCL, // 甲供材料 (“完全甲供”改文字为“甲供材料”)
  86. JDYG, // 甲定乙供
  87. }
  88. export interface IUpdate<T extends IAny = any> {
  89. filter: T;
  90. update: T;
  91. }
  92. export interface ICreate<T extends IAny = any> {
  93. document: T;
  94. }
  95. export interface IDelete<T extends IAny = any> {
  96. filter: T;
  97. }
  98. export interface IBulkWrite<T extends IAny = any> {
  99. update?: IUpdate<T>[];
  100. create?: ICreate<T>[];
  101. remove?: IDelete<T>[];
  102. }
  103. export enum CptModelName {
  104. projects = 'projects',
  105. quantityNumSheets = 'quantityNumSheets',
  106. bills = 'bills',
  107. billCodeSeqs = 'billCodeSeqs',
  108. rations = 'rations',
  109. rationGljs = 'rationGljs',
  110. unitPriceFile = 'unitPriceFile',
  111. feeRateFile = 'feeRateFile',
  112. labourCoeFile = 'labourCoeFile',
  113. importLogs = 'importLogs',
  114. cptGljLib = 'cptGljLib',
  115. cptGlj = 'cptGlj',
  116. cptGljTree = 'cptGljTree',
  117. cptRationLib = 'cptRationLib',
  118. cptRationTree = 'cptRationTree',
  119. cptRation = 'cptRation',
  120. cptRationCoe = 'cptRationCoe',
  121. cptRationChapterTrees = 'cptRationChapterTrees',
  122. configMaterials = 'configMaterials',
  123. projectGljs = 'projectGljs',
  124. calcProgramFile = 'calcProgramFile',
  125. options = 'options',
  126. installationFee = 'installationFee',
  127. financialProject = 'financialProject',
  128. approval = 'approval', // 后台设置的流程,相关于模板
  129. projectApproval = 'projectApproval', // 上报后项目实际使用的流程
  130. processAuditMoney = 'processAuditMoney', // 每个环节的审批金额
  131. financialProjectType = 'financialProjectType',
  132. editLogs = 'editLogs', // 项目修改记录
  133. processData = 'processData', // 流程备份数据
  134. billIndex = 'billIndex', // 清单指标库
  135. FBIndex = 'FBIndex', // 分部指标库
  136. commonIndex = 'commonIndex', // 综合指标库
  137. gatherExecutor = 'gatherExecutor', // 三合一执行人
  138. budgetData = 'budgetData', // 表单数据
  139. reviewRecord = 'reviewRecord', // 预算复核
  140. approvalStatus = 'approvalStatus', // 审批状态关系表
  141. gatherMatter = 'gatherMatter', // 事项-前台
  142. gatherStepMatter = 'gatherStepMatter', // 步骤事项关系表
  143. conditionSetting = 'conditionSetting',
  144. auditComment = 'auditComment', // 审批意见
  145. processLogs = 'processLogs', // 审批流程环节日志
  146. resultsDocument = 'resultsDocument', // 成果文件
  147. rptTemplates = 'rptTemplates', // 报表模板(表单)
  148. rptGatherTemplates = 'rptGatherTemplates', // 业务中报表模板(表单)
  149. gatherResultsDocument = 'gatherResultsDocument', // 业务中成果文件表
  150. }
  151. // 无数据表的模块名称的枚举
  152. export enum SubModelName {
  153. bookmarks = 'bookmarks', // 书签批注
  154. components = 'components', // 组成物
  155. rationSubs = 'rationSubs', // 定额的子项
  156. }
  157. export enum ActionType {
  158. ADD = 'add',
  159. UPDATE = 'update',
  160. REPLACE = 'replace', // 和update不同,如替换定额,替换清单等,操作不一样
  161. DELETE = 'delete',
  162. }
  163. // 特殊的action
  164. export enum ActionName {
  165. // 项目属性相关
  166. RESET_COL_METAS = 'resetColMetas', // 重置默认列设置
  167. UPDATE_PROPERTY = 'updateProperty', // 更新项目属性
  168. // ration相关property
  169. ADD_LIB_RATIONS = 'addLibRations', // 添加标准/补充定额
  170. ADD_GLJ_RATIONS = 'addGljRations', // 插入工料机类型的定额
  171. CLEAN_ZMHS = 'cleanZmhs', // 清空子目换算
  172. RESET_INSTALL_FEE = 'resetInstallFee', // 重置安装增加费设置
  173. CALC_AREA_INCREASE = 'calcAreaIncrease', // 计算面积增加费
  174. // 定额工料机相关
  175. UPDATE_INDEX_KEY = 'updateIndexKey', // 修改定额工料机的名称,规格,单位
  176. UPDATE_GLJ_CODE = 'updateGljCode', // 修改定额工料机的编码
  177. ADD_RATION_GLJS = 'addRationGljs', // 添加定额工料机(多个)
  178. REPLACE_RATION_GLJ = 'replaceRationGlj', // 替换定额工料机(单个)
  179. // 项目工料机相关
  180. APPLY_ALL_INFO_PRICE = 'applyAllInfoPrice', // 批量套用信息价
  181. PROJECT_GLJ_EXIST_CHECK = 'projectGljExistCheck', // 检查工料机是否已经存在
  182. // 安装增加费
  183. CALC_INSTALL_FEE = 'calcInstallFee', // 计算安装增加费
  184. // 清单相关
  185. ADD_STD_BILLS = 'addStdBills', // 添加标准清单
  186. PASTE_BLOCK = 'pasteBlock', // 复制整块
  187. IMPORT_EXCEL_BILL = 'importExcelBill', // 导入excel清单
  188. BILL_CHECK = 'billCheck', // 清单检测
  189. // 费率相关
  190. RESET_FEE_RATE = 'resetFeeRate', // 重选标准
  191. // 补充人材机相关
  192. CHANGE_CPT_RATION_TREE = 'changeCptRationTree', // 补充定额章节树数据变更
  193. CHANGE_CPT_RATION = 'changeCptRation', // 补充定额数据变更
  194. CHANGE_CPT_RATION_GLJ = 'changeCptRationGlj', // 补充定额人材机变更
  195. CHANGE_CPT_RATION_COE = 'changeCptRationCoe', // 补充定额子目换算变更
  196. CHANGE_CPT_COE = 'changeCptCoe', // 补充子目换算数据变更
  197. ADD_RATION_COE_TO_SECTION = 'addRationCoeToSection', // 添加子目换算到本节其他定额
  198. UPDATE_CALCPROGRAM_TEMPLATE = 'updateCalcProgramTemplate',
  199. UPDATE_CALCPROGRAM_CALCITEM = 'updateCalcProgramCalcItem',
  200. BILL_UPGRADE = 'billUpgrade',
  201. BILL_DOWNGRADE = 'billDowngrade',
  202. CHANGE_FEATRUE_PRJTYPE = 'changeFeaturePrjType',
  203. }
  204. export interface IBaseFilter {
  205. ID: string;
  206. prop?: string;
  207. }
  208. export interface IFilter {
  209. ID: string;
  210. [key: string]: string;
  211. }
  212. // 统一subject更新提交数据入口,为撤销功能做准备
  213. export interface ISetData<T = any, F = any, R = any> {
  214. projectID: string; // 考虑到可能会跨项目更新,提高一层
  215. module: CptModelName | SubModelName;
  216. action: ActionType;
  217. createLog?: boolean; // 是否生成这个setData包的修改记录
  218. prop?: string; // 用来指表中的数组属性名,针对如configMaterial里,一个collections 里有多个数组数据的情况
  219. actionName?: ActionName; // 除了增删改查,还会有更复杂的操作,用这个来区分
  220. filter?: F; // 查询条件
  221. update?: Partial<T>; // 和update类型对应,
  222. documents?: T[]; // add 类型对应,批量插入
  223. oDocs?: any[]; // 存放撤销的原始数据?
  224. oldData?: T; // 旧数据,造价书中节点是引用同一个对象,编辑后是直接修改源数据,生成log时取不到旧数据
  225. result?: R; // 特殊的返回结果
  226. }
  227. export interface IColumnMeta {
  228. ID: string;
  229. title: string;
  230. data: string;
  231. renderer?: string;
  232. editor?: string;
  233. readOnly?: boolean;
  234. width: number;
  235. type?: string;
  236. numericFormat?: { pattern?: string; zeroFormat?: string };
  237. visible?: boolean;
  238. source?: string[];
  239. }
  240. // subject getData数据接口
  241. export interface ISubjectGetData {
  242. project: IProject;
  243. [CptModelName.bills]: IBill[];
  244. [CptModelName.rations]: IRation[];
  245. [CptModelName.projectGljs]: IProjectGlj[];
  246. [CptModelName.feeRateFile]: IFeeRateFile;
  247. [CptModelName.calcProgramFile]: ICalcProgramFile;
  248. [CptModelName.configMaterials]: IConfigMaterial;
  249. [CptModelName.installationFee]: IInstallationFee;
  250. [CptModelName.processData]?: IProcessData[];
  251. }
  252. // getData数据接口
  253. export interface IGetData {
  254. subject: ISubjectGetData;
  255. construction: { project?: IProject };
  256. treeData: IProject[];
  257. isManager: boolean;
  258. projectsPermission: IProjectPermission[];
  259. approval?: IProjectApproval;
  260. }
  261. export interface IFee {
  262. tenderTotalFee: number;
  263. tenderUnitPrice: number;
  264. totalFee: number;
  265. unitPrice: number;
  266. }
  267. // 费用字段
  268. export interface IFees {
  269. [key: string]: IFee;
  270. }
  271. export enum BaseEXP {
  272. QDL = 'QDL',
  273. ZXGCLHJ = 'ZXGCLHJ', // 子项工程量合计
  274. GCLMXHJ = 'GCLMXHJ',
  275. MBGCL = 'MBGCL', // 模板工程量
  276. }
  277. // 定额和清单共有的属性,造价书中很多地方需要
  278. export interface IBRBase {
  279. ID: string;
  280. parentID: string;
  281. seq: number;
  282. kind: BRType;
  283. stdID?: string; // 原始数据存在库中的ID(补充定额时也共用这个字段)
  284. repositoryID?: number | string; // 定额库/清单库 ID
  285. unit?: string;
  286. code?: string;
  287. name?: string;
  288. quantity?: number;
  289. quantityEXP?: BaseEXP | string;
  290. quantityDetails?: IQuantityDetail[]; // 工程量明细 -- 原先保存在另外的表中
  291. // 是否记取面积增加费
  292. areaIncreaseFee?: boolean | null; // { type: Schema.Types.Mixed; default: false }; // true 是,false否,null 不确定,三个状态
  293. fees?: IFees; // 费用字段
  294. bookmarks?: IBookmark[]; // 书签批注
  295. overHeight?: string; // 超高降效
  296. targetUnitPrice?: number; // 调价:目标综合单价
  297. targetTotalFee?: number; // 调价:目标综合合价
  298. readjustUnitPrice?: number; // 调价:调整后综合单价
  299. readjustTotalFee?: number; // 调价:调整后综合合价
  300. rationQtyCoe?: number; // 调价:子目工程量调整系数
  301. gljQtyCoe?: IGljQtyCoe; // 调价:工料机消耗量调整系数
  302. }
  303. export const SeparateString = '|----|';
  304. // 检查subjec tree返回类型
  305. export enum CheckSubjectTreeType {
  306. // 项目被删除
  307. PROJECT_DELETED = 1,
  308. // 项目被取消分享
  309. PROJECT_CANCEL_SHARED,
  310. // 权限限制(未知情况)
  311. PERMISSION_LIMITED,
  312. }
  313. // 检查subjec tree返回结果
  314. export interface ICheckSubjectTreeRst {
  315. checkType: CheckSubjectTreeType;
  316. }