project.ts 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404
  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. SUBMISSION = 1, // 投标
  72. INVITATION, // 招标
  73. CONTROL, // 控制价
  74. SETTLEMENT, // 结算
  75. }
  76. // 结算流程类型
  77. export enum ProcessType {
  78. CHANGE = 1, // 变更
  79. VISA, // 签证
  80. MISS, // 漏项
  81. CLAIM, // 索赔
  82. OTHER, // 其它
  83. }
  84. export enum FileTypeName {
  85. SUBMISSION = '投标',
  86. INVITATION = '招标',
  87. CONTROL = '控制价',
  88. SETTLEMENT = '结算',
  89. }
  90. export const FileTypeMap = {
  91. [FileType.SUBMISSION]: FileTypeName.SUBMISSION,
  92. [FileType.INVITATION]: FileTypeName.INVITATION,
  93. [FileType.CONTROL]: FileTypeName.CONTROL,
  94. };
  95. // 工程特征、基本信息
  96. export interface IInfoItem {
  97. ID: string;
  98. key: string;
  99. dispName: string;
  100. value?: string;
  101. code?: string;
  102. required?: string;
  103. readonly?: string;
  104. options?: string;
  105. cellType?: string;
  106. fileKind?: FileTypeName;
  107. items?: IInfoItem[];
  108. parentID: string;
  109. seq: number;
  110. }
  111. // 工程特征指标
  112. interface IBaseEngineerFeature {
  113. value: string;
  114. name: string;
  115. exportName?: string;
  116. cellType?: string;
  117. options?: string;
  118. }
  119. export interface IStdEngineerFeature extends IBaseEngineerFeature {
  120. ID: number;
  121. ParentID: number;
  122. }
  123. export interface IEngineerFeature extends ITreeScm, IBaseEngineerFeature {}
  124. // 主要工料指标
  125. export interface IMaterialIndex {
  126. ID: string;
  127. name: string;
  128. unit: string;
  129. coe: number;
  130. }
  131. // 主要工程量指标
  132. export interface IMainQtyIndex {
  133. ID: string;
  134. name: string;
  135. unit: string;
  136. coe: number;
  137. }
  138. // 主要经济指标
  139. export interface IEconomicIndex {
  140. ID: string;
  141. name: string;
  142. value: string;
  143. }
  144. // 面积增加类型
  145. export enum AreaIncreaseType {
  146. LABOUR = 'labour',
  147. MATERIAL = 'material',
  148. MACHINE = 'machine',
  149. }
  150. export interface IAreaIncreaseSetting {
  151. [AreaIncreaseType.LABOUR]: number;
  152. [AreaIncreaseType.MATERIAL]: number;
  153. [AreaIncreaseType.MACHINE]: number;
  154. }
  155. // 关于计算取费方式
  156. export enum BillGetFeeType {
  157. RATION_CONTENT = 0,
  158. RATION_PRICE_CONVERSE = 1,
  159. RATION_PRICE = 2,
  160. BILL_PRICE = 3,
  161. }
  162. export interface IInfoPriceOption {
  163. areaID: string;
  164. year: string;
  165. month: string;
  166. }
  167. // 项目属性
  168. export interface IProperty {
  169. constructionID?: string; // 建设项目ID
  170. valuationType?: ValuationType; // 计价类型
  171. valuationID?: string; // 计价规则
  172. engineeringID?: string; // 工程专业ID
  173. fileType?: FileType; // 文件类型
  174. processType?: ProcessType; // 结算项目里的流程类型,有变更,签证, 漏项......等
  175. taxType?: TaxType; // 计税方式
  176. rationFeeType?: number; // 定额取费专业
  177. unitFeeType?: number; // 单位工程取费专业
  178. calcProgramLib?: INumFileRef; // 计算程序(标准)
  179. region?: string; // 所属地区
  180. showAdjustPrice?: boolean; // 是否显示调整价列
  181. isInstall?: boolean; // 是否是安装工程
  182. isItemIncrease?: boolean; // 是否是子目增加
  183. itemIncreaseSetting?: IIncreaseSetting;
  184. isAreaIncrease?: boolean; // 是否是面积增加
  185. areaIncreaseSetting?: IAreaIncreaseSetting; // 面积增加费设置
  186. indexName?: string; // 指标名称
  187. lockBills?: boolean; // 锁定清单
  188. decimal?: IDecimal; // 小数位数
  189. billsQuantityDecimal?: IBillsQuantityDecimal[]; // 清单工程量精度
  190. displaySetting?: IDisplaySetting; // 呈现选项
  191. billsCalcMode?: BillGetFeeType; // 清单计费取费方式
  192. zanguCalcMode?: number; // 暂估合价计算方式
  193. calcOption?: ICalcOption; // 计算选项
  194. tenderSetting?: ITenderSetting; // 调价设置
  195. overHeight?: IOverHeight[]; // 超高降效数据
  196. overHeightSetting?: IOverHeightSetting; // 超高降效选项
  197. basicInfo?: IInfoItem[]; // 基本信息
  198. feature?: IInfoItem[]; // 工程特征
  199. progressiveInterval?: IProgressiveInterval[]; // 累进区间
  200. gljAdjustType?: GLJAdjustType; // 承包人材料调整类型
  201. cptIllustration?: string; // 编制说明
  202. engineerInfos?: IInfoItem[];
  203. engineerFeatures?: IEngineerFeature[];
  204. materials?: IMaterialIndex[];
  205. mainQuantities?: IMainQtyIndex[];
  206. economics?: IEconomicIndex[];
  207. overHeightSpecificID?: string; // 超高子目指定清单ID
  208. distributeSetting?: IDistributeSetting; // 强制修改叶子清单的综合单价,分摊计算定额工程量 或 分摊计算定额下的工料机消耗量。
  209. colMetas?: IColumnMeta[];
  210. valuationName?: string; // 计价规则名称
  211. maxLimitPriceRate?: number; // 设置最高限价单价浮动率
  212. minLimitPriceRate?: number; // 设置最低限价单价浮动率
  213. fileKind?: string; // 导入进来的属性,平台导出需要维持这个值不变
  214. infoPriceOption?: IInfoPriceOption; // 信息价选项 只用于搜索
  215. recommendPriceOption?: IInfoPriceOption; // 智能材价匹配时的选项
  216. saveLog?: boolean; // 记录项目编辑log
  217. normLib?:string;
  218. }
  219. // 原来的列设置太复杂了,没什么必要
  220. export interface IMainTreeCol {
  221. cols: Array<any>;
  222. headRowHeight: Array<number>;
  223. treeCol?: number;
  224. headRows?: number;
  225. emptyRows?: number;
  226. }
  227. export enum ImportType {
  228. NONE,
  229. YBP,
  230. INTERFACE,
  231. }
  232. // 项目活动枚举
  233. export enum ProjectActivity {
  234. // 新建
  235. CREATE = 'create',
  236. // 编辑
  237. EDIT = 'edit',
  238. // 删除
  239. DELETE = 'delete',
  240. // 恢复
  241. RECOVER = 'recover',
  242. }
  243. // 对项目的权限
  244. export enum PermissionType {
  245. READONLY = 'readonly',
  246. EDIT = 'edit',
  247. }
  248. export interface IProject extends ITreeScm {
  249. type: ProjectType;
  250. compilationID: string;
  251. ownerID: string; // 拥有者ID(个人或企业)
  252. ownerType: EntityType;
  253. managerID: string; // 负责人ID
  254. creator: string;
  255. name: string;
  256. updateDate: number; // 更新时间
  257. code?: string;
  258. createDate: number;
  259. property?: IProperty;
  260. changeMark?: string;
  261. remark?: string;
  262. fileVer?: string;
  263. lastFileVer?: string;
  264. imported?: ImportType;
  265. deleteType?: DeleteEnum;
  266. deleteDate?: number;
  267. deleteBy?: string;
  268. financialProjectID?: string; // 关联财审项目ID(不用财审项目关联此表,因为可能多个项目对应一个财审项目)
  269. // 流程信息
  270. processInfo?: {
  271. currentApprovalID: string; // 当前正处于哪个审批流中
  272. currentProcessID: string; // 当前正处于哪个环节的ID
  273. processName: string; // 环节名称 冗余数据用于列表显示
  274. // 当前所处流程里,哪些账号能编辑,哪些账号能查看或者审批等设置
  275. processAccounts?: {
  276. ID: string; // 用户ID
  277. permission: PermissionType;
  278. }[];
  279. };
  280. // 只是为了显示,不是自身的正在数据,比如汇总信息等
  281. external?: {
  282. showShareMark?: boolean; // 是否显示分享标记
  283. cost?: number; // 工程造价
  284. // 有时候为了显示,需要一些特殊处理日期。如:项目管理-回收站,建设项目、单项工程的删除日期和创建日期需要显示为空
  285. deleteDateForView?: number;
  286. createDateForView?: number;
  287. actualTreeData?: ITreeScm; // 真正的树结构数据。有时候可能需要暂时变更project的树结构数据,在这种时候需要存储原本的真实树结构数据
  288. from?: string; // 来自于某用户名称
  289. members?: string[]; // 成员协作
  290. };
  291. }
  292. export interface IProjectBulkRst {
  293. create: IProject[];
  294. remove: string[];
  295. }
  296. // 建设项目默认设置项(可以被恢复的)
  297. export interface IConstructionDefaultSetting {
  298. decimal: IProperty['decimal'];
  299. billsQuantityDecimal: IProperty['billsQuantityDecimal'];
  300. displaySetting: IProperty['displaySetting'];
  301. billsCalcMode: IProperty['billsCalcMode'];
  302. zanguCalcMode: IProperty['zanguCalcMode'];
  303. calcOption: IProperty['calcOption'];
  304. colMetas: IProperty['colMetas'];
  305. }
  306. // 项目权限
  307. export interface IProjectPermission {
  308. projectID: string;
  309. readOnly: boolean;
  310. allowCopy: boolean;
  311. }
  312. // constructionTreeData接口
  313. export interface IConstructionTreeData {
  314. construction: { project: IProject };
  315. treeData: IProject[];
  316. }
  317. // 项目活动
  318. export interface IProjectActivity {
  319. activity: ProjectActivity;
  320. userID: string;
  321. date: number;
  322. }
  323. // 项目log
  324. export interface IProjectLog {
  325. // 企业ID
  326. enterpriseID: string;
  327. // 费用定额ID
  328. compilationID: string;
  329. // 费用定额名称
  330. compilationName: string;
  331. // 建设项目ID
  332. constructionID: string;
  333. // 建设项目名称
  334. constructionName: string;
  335. // 单位工程ID
  336. unitID: string;
  337. // 单位工程名称
  338. unitName: string;
  339. // 更新时间
  340. updateDate: number;
  341. // 管理者(所有者、负责人)ID
  342. managerID: string;
  343. // 活动
  344. activity: ProjectActivity;
  345. // 活动时间
  346. activityDate: number;
  347. // 活动者ID
  348. activityUserID: string;
  349. // 协作
  350. cooperationCount?: number;
  351. // 是否与我协作
  352. cooperateWithMe?: boolean;
  353. }
  354. // 导入状态
  355. export enum ImportStatus {
  356. IMPORTING = 0,
  357. FINISH = 1,
  358. FAIL = 3,
  359. }
  360. // 导入log
  361. export interface IImportLog {
  362. status: ImportStatus;
  363. errorMsg: string;
  364. stack?: any;
  365. }