project.ts 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478
  1. import { EntityType } from './user';
  2. import { ValuationType } from './compilation';
  3. import { IIncreaseSetting } from './increaseFee';
  4. import { ITreeScm, DeleteEnum, INumFileRef, IColumnMeta } from './base';
  5. import {
  6. ICalcOption,
  7. ITenderSetting,
  8. IDistributeSetting,
  9. IItemIncreaseCalcOption,
  10. IInstallIncreaseCalcOption,
  11. } from './calculation';
  12. import { IOverHeight, IOverHeightSetting } from './overHeight';
  13. import { ICheckOptions, IPriceScope } from './bill';
  14. // 项目类型
  15. export enum ProjectType {
  16. FOLDER = 1,
  17. CONSTRUCTION, // 建设项目
  18. SINGLE, // 单项工程
  19. UNIT, // 单位工程
  20. }
  21. export const projectTextMap = {
  22. [ProjectType.FOLDER]: '文件夹',
  23. [ProjectType.CONSTRUCTION]: '建设项目',
  24. [ProjectType.SINGLE]: '单项工程',
  25. [ProjectType.UNIT]: '单位工程',
  26. };
  27. export interface IGLJCol {
  28. showAdjustPrice?: boolean;
  29. }
  30. // 小数位数
  31. export interface IDecimal {
  32. bill: { unitPrice: number; totalPrice: number };
  33. ration: { quantity: number; unitPrice: number; totalPrice: number };
  34. glj: { quantity: number; unitPriceHasMix: number; unitPrice: number };
  35. feeRate: number;
  36. quantityDetail: number;
  37. material: number; // 三材系数
  38. process: number;
  39. }
  40. // 工程量精度
  41. export interface IBillsQuantityDecimal {
  42. unit: string;
  43. decimal: number;
  44. ID: string;
  45. }
  46. // 呈现选项
  47. export interface IDisplaySetting {
  48. billsAutoHeight: boolean;
  49. rationAutoHeight: boolean;
  50. disPlayMainMaterial: boolean;
  51. }
  52. // 累进区间
  53. export interface IProgression {
  54. interval: string; // 区间字符 eg: '(0,100]'
  55. feeRate: boolean;
  56. }
  57. export interface IProgressiveInterval {
  58. ID: string;
  59. name: string;
  60. progression: IProgression[];
  61. generalRate?: number;
  62. simpleRate?: number;
  63. }
  64. // 承包人材料调整类型
  65. export enum GLJAdjustType {
  66. PRICE_INFO = 'priceInfo', // 造价信息差额调整法
  67. PRICE_COE = 'priceCoe', // 价格指数调整法
  68. }
  69. // 计税方式
  70. export enum TaxType {
  71. GENERAL = 1,
  72. SIMPLE,
  73. }
  74. // 文件类型
  75. export enum FileType {
  76. // 预算类型, 投标,招标属于预算子类
  77. SUBMISSION = 1, // 投标
  78. INVITATION = 2, // 招标
  79. CONTROL = 3, // 控制价
  80. // 预算类型 --- end
  81. ESTIMATE = 5, // 概算
  82. SETTLEMENT = 10, // 结算
  83. GUSUAN = 15, // 估算
  84. }
  85. // 结算流程类型
  86. export enum ProcessType {
  87. CHANGE = 1, // 变更
  88. VISA, // 签证
  89. MISS, // 漏项
  90. CLAIM, // 索赔
  91. OTHER, // 其它
  92. }
  93. export enum FileTypeName {
  94. SUBMISSION = '预算',
  95. INVITATION = '预算',
  96. ESTIMATE = '概算',
  97. SETTLEMENT = '结算',
  98. GUSUAN = '估算',
  99. }
  100. export const FileTypeMap = {
  101. [FileType.SUBMISSION]: FileTypeName.SUBMISSION,
  102. [FileType.INVITATION]: FileTypeName.INVITATION,
  103. };
  104. // 工程特征、基本信息
  105. export interface IInfoItem {
  106. ID: string;
  107. key: string;
  108. dispName: string;
  109. value?: string;
  110. code?: string;
  111. required?: string;
  112. readonly?: string;
  113. options?: string;
  114. cellType?: string;
  115. fileKind?: FileTypeName;
  116. items?: IInfoItem[];
  117. parentID: string;
  118. seq: number;
  119. }
  120. // 工程特征指标
  121. interface IBaseEngineerFeature {
  122. value: string;
  123. name: string;
  124. exportName?: string;
  125. cellType?: string;
  126. options?: string;
  127. }
  128. export interface IStdEngineerFeature extends IBaseEngineerFeature {
  129. ID: number;
  130. ParentID: number;
  131. }
  132. export interface IEngineerFeature extends ITreeScm, IBaseEngineerFeature {}
  133. // 主要工料指标
  134. export interface IMaterialIndex {
  135. ID: string;
  136. name: string;
  137. unit: string;
  138. coe: number;
  139. }
  140. // 主要工程量指标
  141. export interface IMainQtyIndex {
  142. ID: string;
  143. name: string;
  144. unit: string;
  145. coe: number;
  146. }
  147. // 主要经济指标
  148. export interface IEconomicIndex {
  149. ID: string;
  150. name: string;
  151. value: string;
  152. }
  153. // 面积增加类型
  154. export enum AreaIncreaseType {
  155. LABOUR = 'labour',
  156. MATERIAL = 'material',
  157. MACHINE = 'machine',
  158. }
  159. export interface IAreaIncreaseSetting {
  160. [AreaIncreaseType.LABOUR]: number;
  161. [AreaIncreaseType.MATERIAL]: number;
  162. [AreaIncreaseType.MACHINE]: number;
  163. }
  164. // 关于计算取费方式
  165. export enum BillGetFeeType {
  166. RATION_CONTENT = 0,
  167. RATION_PRICE_CONVERSE = 1,
  168. RATION_PRICE = 2,
  169. BILL_PRICE = 3,
  170. }
  171. export interface IInfoPriceOption {
  172. areaID: string;
  173. year: string;
  174. month: string;
  175. }
  176. // 项目属性
  177. export interface IProperty {
  178. constructionID?: string; // 建设项目ID
  179. valuationType?: ValuationType; // 计价类型
  180. valuationID?: string; // 计价规则
  181. engineeringID?: string; // 工程专业ID
  182. fileType?: FileType; // 文件类型
  183. processType?: ProcessType; // 结算项目里的流程类型,有变更,签证, 漏项......等
  184. taxType?: TaxType; // 计税方式
  185. rationFeeType?: number; // 定额取费专业
  186. unitFeeType?: number; // 单位工程取费专业
  187. calcProgramLib?: INumFileRef; // 计算程序(标准)
  188. region?: string; // 所属地区
  189. showAdjustPrice?: boolean; // 是否显示调整价列
  190. isInstall?: boolean; // 是否是安装工程
  191. isItemIncrease?: boolean; // 是否是子目增加
  192. itemIncreaseSetting?: IIncreaseSetting;
  193. isAreaIncrease?: boolean; // 是否是面积增加
  194. isShowRation?: boolean; // 是否显示定额
  195. areaIncreaseSetting?: IAreaIncreaseSetting; // 面积增加费设置
  196. indexName?: string; // 指标名称
  197. lockBills?: boolean; // 锁定清单
  198. decimal?: IDecimal; // 小数位数
  199. billsQuantityDecimal?: IBillsQuantityDecimal[]; // 清单工程量精度
  200. displaySetting?: IDisplaySetting; // 呈现选项
  201. billsCalcMode?: BillGetFeeType; // 清单计费取费方式
  202. zanguCalcMode?: number; // 暂估合价计算方式
  203. calcOption?: ICalcOption; // 计算选项
  204. tenderSetting?: ITenderSetting; // 调价设置
  205. overHeight?: IOverHeight[]; // 超高降效数据
  206. overHeightSetting?: IOverHeightSetting; // 超高降效选项
  207. basicInfo?: IInfoItem[]; // 基本信息
  208. feature?: IInfoItem[]; // 工程特征
  209. singleInfo?: IInfoItem[]; // 单项信息
  210. progressiveInterval?: IProgressiveInterval[]; // 累进区间
  211. gljAdjustType?: GLJAdjustType; // 承包人材料调整类型
  212. cptIllustration?: string; // 编制说明
  213. engineerInfos?: IInfoItem[];
  214. engineerFeatures?: IEngineerFeature[];
  215. materials?: IMaterialIndex[];
  216. mainQuantities?: IMainQtyIndex[];
  217. economics?: IEconomicIndex[];
  218. overHeightSpecificID?: string; // 超高子目指定清单ID
  219. distributeSetting?: IDistributeSetting; // 强制修改叶子清单的综合单价,分摊计算定额工程量 或 分摊计算定额下的工料机消耗量。
  220. colMetas?: IColumnMeta[];
  221. valuationName?: string; // 计价规则名称
  222. maxLimitPriceRate?: number; // 设置最高限价单价浮动率
  223. minLimitPriceRate?: number; // 设置最低限价单价浮动率
  224. fileKind?: string; // 导入进来的属性,平台导出需要维持这个值不变
  225. infoPriceOption?: IInfoPriceOption; // 信息价选项 只用于搜索
  226. recommendPriceOption?: IInfoPriceOption; // 智能材价匹配时的选项
  227. saveLog?: boolean; // 记录项目编辑log
  228. indexType?: string; // 指标项目分类用于指标入库
  229. normLib?: string;
  230. saveToIndex?: boolean; // 是否已经入库
  231. checkOptions?: ICheckOptions; // 指标检测的选项
  232. priceScope?: IPriceScope; // 价格区间
  233. checkOptionSetting?: ICheckOptions; // 检测清单、设置指标弹窗确定共用的保存设置的位置
  234. itemIncreaseCalcOption?: IItemIncreaseCalcOption; // 子目增加费计算选项
  235. installIncreaseCalcOption?: IInstallIncreaseCalcOption; // 安装增加费计算选项
  236. }
  237. // 原来的列设置太复杂了,没什么必要
  238. export interface IMainTreeCol {
  239. cols: Array<any>;
  240. headRowHeight: Array<number>;
  241. treeCol?: number;
  242. headRows?: number;
  243. emptyRows?: number;
  244. }
  245. export enum ImportType {
  246. NONE,
  247. YBP,
  248. INTERFACE,
  249. }
  250. // 项目活动枚举
  251. export enum ProjectActivity {
  252. // 新建
  253. CREATE = 'create',
  254. // 编辑
  255. EDIT = 'edit',
  256. // 删除
  257. DELETE = 'delete',
  258. // 恢复
  259. RECOVER = 'recover',
  260. }
  261. // 对项目的权限
  262. export enum PermissionType {
  263. READONLY = 'readonly',
  264. EDIT = 'edit',
  265. }
  266. export interface IProject extends ITreeScm {
  267. type: ProjectType;
  268. compilationID: string;
  269. ownerID: string; // 拥有者ID(个人或企业)
  270. ownerType: EntityType;
  271. managerID: string; // 负责人ID
  272. creator: string;
  273. name: string;
  274. updateDate: number; // 更新时间
  275. code?: string;
  276. createDate: number;
  277. property?: IProperty;
  278. changeMark?: string;
  279. remark?: string;
  280. fileVer?: string;
  281. lastFileVer?: string;
  282. imported?: ImportType;
  283. deleteType?: DeleteEnum;
  284. deleteDate?: number;
  285. deleteBy?: string;
  286. financialProjectID?: string; // 关联财审项目ID(不用财审项目关联此表,因为可能多个项目对应一个财审项目)
  287. edition?: string; // 数据版本号
  288. // 流程信息
  289. processInfo?: {
  290. currentApprovalID: string; // 当前正处于哪个审批流中
  291. currentProcessID: string; // 当前正处于哪个环节的ID
  292. processName: string; // 环节名称 冗余数据用于列表显示
  293. // 当前所处流程里,哪些账号能编辑,哪些账号能查看或者审批等设置
  294. processAccounts?: {
  295. ID: string; // 用户ID
  296. permission: PermissionType;
  297. }[];
  298. };
  299. // 只是为了显示,不是自身的正在数据,比如汇总信息等
  300. external?: {
  301. showShareMark?: boolean; // 是否显示分享标记
  302. cost?: number; // 工程造价
  303. // 有时候为了显示,需要一些特殊处理日期。如:项目管理-回收站,建设项目、单项工程的删除日期和创建日期需要显示为空
  304. deleteDateForView?: number;
  305. createDateForView?: number;
  306. actualTreeData?: ITreeScm; // 真正的树结构数据。有时候可能需要暂时变更project的树结构数据,在这种时候需要存储原本的真实树结构数据
  307. from?: string; // 来自于某用户名称
  308. members?: string[]; // 成员协作
  309. };
  310. }
  311. export interface IProjectBulkRst {
  312. create: IProject[];
  313. remove: string[];
  314. }
  315. // 建设项目默认设置项(可以被恢复的)
  316. export interface IConstructionDefaultSetting {
  317. decimal: IProperty['decimal'];
  318. billsQuantityDecimal: IProperty['billsQuantityDecimal'];
  319. displaySetting: IProperty['displaySetting'];
  320. billsCalcMode: IProperty['billsCalcMode'];
  321. zanguCalcMode: IProperty['zanguCalcMode'];
  322. calcOption: IProperty['calcOption'];
  323. colMetas: IProperty['colMetas'];
  324. }
  325. // 项目权限
  326. export interface IProjectPermission {
  327. projectID: string;
  328. readOnly: boolean;
  329. allowCopy: boolean;
  330. }
  331. // constructionTreeData接口
  332. export interface IConstructionTreeData {
  333. construction: { project: IProject };
  334. treeData: IProject[];
  335. }
  336. // 项目活动
  337. export interface IProjectActivity {
  338. activity: ProjectActivity;
  339. userID: string;
  340. date: number;
  341. }
  342. // 项目log
  343. export interface IProjectLog {
  344. // 企业ID
  345. enterpriseID: string;
  346. // 费用定额ID
  347. compilationID: string;
  348. // 费用定额名称
  349. compilationName: string;
  350. // 建设项目ID
  351. constructionID: string;
  352. // 建设项目名称
  353. constructionName: string;
  354. // 单位工程ID
  355. unitID: string;
  356. // 单位工程名称
  357. unitName: string;
  358. // 更新时间
  359. updateDate: number;
  360. // 管理者(所有者、负责人)ID
  361. managerID: string;
  362. // 活动
  363. activity: ProjectActivity;
  364. // 活动时间
  365. activityDate: number;
  366. // 活动者ID
  367. activityUserID: string;
  368. // 协作
  369. cooperationCount?: number;
  370. // 是否与我协作
  371. cooperateWithMe?: boolean;
  372. // 版本号
  373. edition?: string;
  374. }
  375. // 导入状态
  376. export enum ImportStatus {
  377. IMPORTING = 0,
  378. FINISH = 1,
  379. FAIL = 3,
  380. }
  381. // 导入log
  382. export interface IImportLog {
  383. status: ImportStatus;
  384. errorMsg: string;
  385. stack?: any;
  386. constructID?: string;
  387. constructName?: string;
  388. }
  389. export interface ISaveProjectInfo {
  390. ID: string;
  391. parentID: string;
  392. seq: number;
  393. type: ProjectType;
  394. name?: string;
  395. unitName?: string;
  396. singleName?: string;
  397. constructionName?: string;
  398. unitID?: string;
  399. singleID?: string;
  400. constructionID?: string;
  401. indexType: string; // 工程分类
  402. indexTypes: string[]; // 自身的工程分类以及祖先项的分类数组
  403. constructionIndexType?: string; // 建设项目的工程分类,查询条件用
  404. firstSingleIndexType?: string; // 第一个单项工程的工程分类,查询用
  405. projLocation: string;
  406. year: string;
  407. month: string;
  408. fileType: FileType;
  409. unit?: string;
  410. quantity?: string;
  411. sourceName: string;
  412. }
  413. export interface ICommonIndex {
  414. ID: string;
  415. parentID: string;
  416. seq: number;
  417. type: ProjectType;
  418. sourceName: string;
  419. name?: string;
  420. constructionID?: string;
  421. constructionIndexType?: string; // 建设项目的工程分类,查询条件用
  422. firstSingleIndexType?: string; // 第一个单项工程的工程分类,查询用
  423. indexType: string; // 工程分类
  424. indexTypes: string[];
  425. projLocation: string;
  426. year: string;
  427. month: string;
  428. fileType: FileType;
  429. unit?: string;
  430. quantity?: string;
  431. composite: string; // 综合指标
  432. engineeringCost: number;
  433. dynamicIndex: Record<string, string>; // 动态指标,年-月为key 这里的值 保存的是动态总造价,动态的综合指标实时算,前端动态计算时不方便拿quantity
  434. }