base.ts 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348
  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. approvalStatus = 'approvalStatus', // 审批状态关系表
  140. gatherMatter = 'gatherMatter', // 事项-前台
  141. gatherStepMatter = 'gatherStepMatter', // 步骤事项关系表
  142. }
  143. // 无数据表的模块名称的枚举
  144. export enum SubModelName {
  145. bookmarks = 'bookmarks', // 书签批注
  146. components = 'components', // 组成物
  147. rationSubs = 'rationSubs', // 定额的子项
  148. }
  149. export enum ActionType {
  150. ADD = 'add',
  151. UPDATE = 'update',
  152. REPLACE = 'replace', // 和update不同,如替换定额,替换清单等,操作不一样
  153. DELETE = 'delete',
  154. }
  155. // 特殊的action
  156. export enum ActionName {
  157. // 项目属性相关
  158. RESET_COL_METAS = 'resetColMetas', // 重置默认列设置
  159. UPDATE_PROPERTY = 'updateProperty', // 更新项目属性
  160. // ration相关property
  161. ADD_LIB_RATIONS = 'addLibRations', // 添加标准/补充定额
  162. ADD_GLJ_RATIONS = 'addGljRations', // 插入工料机类型的定额
  163. CLEAN_ZMHS = 'cleanZmhs', // 清空子目换算
  164. RESET_INSTALL_FEE = 'resetInstallFee', // 重置安装增加费设置
  165. CALC_AREA_INCREASE = 'calcAreaIncrease', // 计算面积增加费
  166. // 定额工料机相关
  167. UPDATE_INDEX_KEY = 'updateIndexKey', // 修改定额工料机的名称,规格,单位
  168. UPDATE_GLJ_CODE = 'updateGljCode', // 修改定额工料机的编码
  169. ADD_RATION_GLJS = 'addRationGljs', // 添加定额工料机(多个)
  170. REPLACE_RATION_GLJ = 'replaceRationGlj', // 替换定额工料机(单个)
  171. // 项目工料机相关
  172. APPLY_ALL_INFO_PRICE = 'applyAllInfoPrice', // 批量套用信息价
  173. PROJECT_GLJ_EXIST_CHECK = 'projectGljExistCheck', // 检查工料机是否已经存在
  174. // 安装增加费
  175. CALC_INSTALL_FEE = 'calcInstallFee', // 计算安装增加费
  176. // 清单相关
  177. ADD_STD_BILLS = 'addStdBills', // 添加标准清单
  178. PASTE_BLOCK = 'pasteBlock', // 复制整块
  179. IMPORT_EXCEL_BILL = 'importExcelBill', // 导入excel清单
  180. BILL_CHECK = 'billCheck', // 清单检测
  181. // 费率相关
  182. RESET_FEE_RATE = 'resetFeeRate', // 重选标准
  183. // 补充人材机相关
  184. CHANGE_CPT_RATION_TREE = 'changeCptRationTree', // 补充定额章节树数据变更
  185. CHANGE_CPT_RATION = 'changeCptRation', // 补充定额数据变更
  186. CHANGE_CPT_RATION_GLJ = 'changeCptRationGlj', // 补充定额人材机变更
  187. CHANGE_CPT_RATION_COE = 'changeCptRationCoe', // 补充定额子目换算变更
  188. CHANGE_CPT_COE = 'changeCptCoe', // 补充子目换算数据变更
  189. ADD_RATION_COE_TO_SECTION = 'addRationCoeToSection', // 添加子目换算到本节其他定额
  190. UPDATE_CALCPROGRAM_TEMPLATE = 'updateCalcProgramTemplate',
  191. UPDATE_CALCPROGRAM_CALCITEM = 'updateCalcProgramCalcItem',
  192. BILL_UPGRADE = 'billUpgrade',
  193. BILL_DOWNGRADE = 'billDowngrade',
  194. CHANGE_FEATRUE_PRJTYPE = 'changeFeaturePrjType',
  195. }
  196. export interface IBaseFilter {
  197. ID: string;
  198. prop?: string;
  199. }
  200. export interface IFilter {
  201. ID: string;
  202. [key: string]: string;
  203. }
  204. // 统一subject更新提交数据入口,为撤销功能做准备
  205. export interface ISetData<T = any, F = any, R = any> {
  206. projectID: string; // 考虑到可能会跨项目更新,提高一层
  207. module: CptModelName | SubModelName;
  208. action: ActionType;
  209. createLog?: boolean; // 是否生成这个setData包的修改记录
  210. prop?: string; // 用来指表中的数组属性名,针对如configMaterial里,一个collections 里有多个数组数据的情况
  211. actionName?: ActionName; // 除了增删改查,还会有更复杂的操作,用这个来区分
  212. filter?: F; // 查询条件
  213. update?: Partial<T>; // 和update类型对应,
  214. documents?: T[]; // add 类型对应,批量插入
  215. oDocs?: any[]; // 存放撤销的原始数据?
  216. oldData?: T; // 旧数据,造价书中节点是引用同一个对象,编辑后是直接修改源数据,生成log时取不到旧数据
  217. result?: R; // 特殊的返回结果
  218. }
  219. export interface IColumnMeta {
  220. ID: string;
  221. title: string;
  222. data: string;
  223. renderer?: string;
  224. editor?: string;
  225. readOnly?: boolean;
  226. width: number;
  227. type?: string;
  228. numericFormat?: { pattern?: string; zeroFormat?: string };
  229. visible?: boolean;
  230. source?: string[];
  231. }
  232. // subject getData数据接口
  233. export interface ISubjectGetData {
  234. project: IProject;
  235. [CptModelName.bills]: IBill[];
  236. [CptModelName.rations]: IRation[];
  237. [CptModelName.projectGljs]: IProjectGlj[];
  238. [CptModelName.feeRateFile]: IFeeRateFile;
  239. [CptModelName.calcProgramFile]: ICalcProgramFile;
  240. [CptModelName.configMaterials]: IConfigMaterial;
  241. [CptModelName.installationFee]: IInstallationFee;
  242. [CptModelName.processData]?: IProcessData[];
  243. }
  244. // getData数据接口
  245. export interface IGetData {
  246. subject: ISubjectGetData;
  247. construction: { project?: IProject };
  248. treeData: IProject[];
  249. isManager: boolean;
  250. projectsPermission: IProjectPermission[];
  251. approval?: IProjectApproval;
  252. }
  253. export interface IFee {
  254. tenderTotalFee: number;
  255. tenderUnitPrice: number;
  256. totalFee: number;
  257. unitPrice: number;
  258. }
  259. // 费用字段
  260. export interface IFees {
  261. [key: string]: IFee;
  262. }
  263. export enum BaseEXP {
  264. QDL = 'QDL',
  265. ZXGCLHJ = 'ZXGCLHJ', // 子项工程量合计
  266. GCLMXHJ = 'GCLMXHJ',
  267. MBGCL = 'MBGCL', // 模板工程量
  268. }
  269. // 定额和清单共有的属性,造价书中很多地方需要
  270. export interface IBRBase {
  271. ID: string;
  272. parentID: string;
  273. seq: number;
  274. kind: BRType;
  275. stdID?: string; // 原始数据存在库中的ID(补充定额时也共用这个字段)
  276. repositoryID?: number | string; // 定额库/清单库 ID
  277. unit?: string;
  278. code?: string;
  279. name?: string;
  280. quantity?: number;
  281. quantityEXP?: BaseEXP | string;
  282. quantityDetails?: IQuantityDetail[]; // 工程量明细 -- 原先保存在另外的表中
  283. // 是否记取面积增加费
  284. areaIncreaseFee?: boolean | null; // { type: Schema.Types.Mixed; default: false }; // true 是,false否,null 不确定,三个状态
  285. fees?: IFees; // 费用字段
  286. bookmarks?: IBookmark[]; // 书签批注
  287. overHeight?: string; // 超高降效
  288. targetUnitPrice?: number; // 调价:目标综合单价
  289. targetTotalFee?: number; // 调价:目标综合合价
  290. readjustUnitPrice?: number; // 调价:调整后综合单价
  291. readjustTotalFee?: number; // 调价:调整后综合合价
  292. rationQtyCoe?: number; // 调价:子目工程量调整系数
  293. gljQtyCoe?: IGljQtyCoe; // 调价:工料机消耗量调整系数
  294. }
  295. export const SeparateString = '|----|';
  296. // 检查subjec tree返回类型
  297. export enum CheckSubjectTreeType {
  298. // 项目被删除
  299. PROJECT_DELETED = 1,
  300. // 项目被取消分享
  301. PROJECT_CANCEL_SHARED,
  302. // 权限限制(未知情况)
  303. PERMISSION_LIMITED,
  304. }
  305. // 检查subjec tree返回结果
  306. export interface ICheckSubjectTreeRst {
  307. checkType: CheckSubjectTreeType;
  308. }