project.ts 12 KB

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