project.ts 13 KB

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