project.ts 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379
  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. // 项目类型
  8. export enum ProjectType {
  9. FOLDER = 1,
  10. CONSTRUCTION, // 建设项目
  11. SINGLE, // 单项工程
  12. UNIT, // 单位工程
  13. }
  14. export const projectTextMap = {
  15. [ProjectType.FOLDER]: '文件夹',
  16. [ProjectType.CONSTRUCTION]: '建设项目',
  17. [ProjectType.SINGLE]: '单项工程',
  18. [ProjectType.UNIT]: '单位工程',
  19. };
  20. export interface IGLJCol {
  21. showAdjustPrice?: boolean;
  22. }
  23. // 小数位数
  24. export interface IDecimal {
  25. bill: { unitPrice: number; totalPrice: number };
  26. ration: { quantity: number; unitPrice: number; totalPrice: number };
  27. glj: { quantity: number; unitPriceHasMix: number; unitPrice: number };
  28. feeRate: number;
  29. quantityDetail: number;
  30. material: number; // 三材系数
  31. process: number;
  32. }
  33. // 工程量精度
  34. export interface IBillsQuantityDecimal {
  35. unit: string;
  36. decimal: number;
  37. ID: string;
  38. }
  39. // 呈现选项
  40. export interface IDisplaySetting {
  41. billsAutoHeight: boolean;
  42. rationAutoHeight: boolean;
  43. disPlayMainMaterial: boolean;
  44. }
  45. // 累进区间
  46. export interface IProgression {
  47. interval: string; // 区间字符 eg: '(0,100]'
  48. feeRate: boolean;
  49. }
  50. export interface IProgressiveInterval {
  51. ID: string;
  52. name: string;
  53. progression: IProgression[];
  54. generalRate?: number;
  55. simpleRate?: number;
  56. }
  57. // 超高降效
  58. export interface IOverHeight {
  59. name: string;
  60. code?: string;
  61. unit?: string;
  62. labourRate?: number;
  63. machineRate?: number;
  64. labourMachineRate?: number;
  65. benchmark?: number;
  66. extra?: number;
  67. limit?: number;
  68. }
  69. export enum OverHeightOption {
  70. SEPARATION = 1, // 对应清单或分部下(默认)
  71. MEASURE, // 指定措施清单011704001
  72. SPECIFIC, // 指定具体位置,显示分部分项以及措施项目的树结构显示叶子清单(分项)供勾选
  73. }
  74. // 承包人材料调整类型
  75. export enum GLJAdjustType {
  76. PRICE_INFO = 'priceInfo', // 造价信息差额调整法
  77. PRICE_COE = 'priceCoe', // 价格指数调整法
  78. }
  79. // 计税方式
  80. export enum TaxType {
  81. GENERAL = 1,
  82. SIMPLE,
  83. }
  84. // 文件类型
  85. export enum FileType {
  86. SUBMISSION = 1, // 投标
  87. INVITATION, // 招标
  88. CONTROL, // 控制价
  89. }
  90. export enum FileTypeName {
  91. SUBMISSION = '投标',
  92. INVITATION = '招标',
  93. CONTROL = '控制价',
  94. }
  95. export const FileTypeMap = {
  96. [FileType.SUBMISSION]: FileTypeName.SUBMISSION,
  97. [FileType.INVITATION]: FileTypeName.INVITATION,
  98. [FileType.CONTROL]: FileTypeName.CONTROL,
  99. };
  100. // 工程特征、基本信息
  101. export interface IInfoItem {
  102. ID: string;
  103. key: string;
  104. dispName: string;
  105. value?: string;
  106. required?: string;
  107. readonly?: string;
  108. options?: string;
  109. cellType?: string;
  110. fileKind?: FileTypeName;
  111. items?: IInfoItem[];
  112. }
  113. // 基本信息类型
  114. export interface IBasicInfo extends IInfoItem {
  115. ID: string;
  116. parentID: string;
  117. seq: number;
  118. }
  119. // 工程特征指标
  120. interface IBaseEngineerFeature {
  121. value: string;
  122. name: string;
  123. exportName?: string;
  124. cellType?: string;
  125. options?: string;
  126. }
  127. export interface IStdEngineerFeature extends IBaseEngineerFeature {
  128. ID: number;
  129. ParentID: number;
  130. }
  131. export interface IEngineerFeature extends ITreeScm, IBaseEngineerFeature {}
  132. // 主要工料指标
  133. export interface IMaterialIndex {
  134. ID: string;
  135. name: string;
  136. unit: string;
  137. coe: number;
  138. }
  139. // 主要工程量指标
  140. export interface IMainQtyIndex {
  141. ID: string;
  142. name: string;
  143. unit: string;
  144. coe: number;
  145. }
  146. // 主要经济指标
  147. export interface IEconomicIndex {
  148. ID: string;
  149. name: string;
  150. value: string;
  151. }
  152. // 面积增加类型
  153. export enum AreaIncreaseType {
  154. LABOUR = 'labour',
  155. MATERIAL = 'material',
  156. MACHINE = 'machine',
  157. }
  158. export interface IAreaIncreaseSetting {
  159. [AreaIncreaseType.LABOUR]: number;
  160. [AreaIncreaseType.MATERIAL]: number;
  161. [AreaIncreaseType.MACHINE]: number;
  162. }
  163. // 关于计算取费方式
  164. export enum BillGetFeeType {
  165. RATION_CONTENT = 0,
  166. RATION_PRICE_CONVERSE = 1,
  167. RATION_PRICE = 2,
  168. BILL_PRICE = 3,
  169. }
  170. // 项目属性
  171. export interface IProperty {
  172. constructionID?: string; // 建设项目ID
  173. valuationType?: ValuationType; // 计价类型
  174. valuationID?: string; // 计价规则
  175. engineeringID?: string; // 工程专业ID
  176. fileType?: FileType; // 文件类型
  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. areaIncreaseSetting?: IAreaIncreaseSetting; // 面积增加费设置
  188. indexName?: string; // 指标名称
  189. lockBills?: boolean; // 锁定清单
  190. decimal?: IDecimal; // 小数位数
  191. billsQuantityDecimal?: IBillsQuantityDecimal[]; // 清单工程量精度
  192. displaySetting?: IDisplaySetting; // 呈现选项
  193. billsCalcMode?: BillGetFeeType; // 清单计费取费方式
  194. zanguCalcMode?: number; // 暂估合价计算方式
  195. calcOption?: ICalcOption; // 计算选项
  196. tenderSetting?: ITenderSetting; // 调价设置
  197. overHeight?: IOverHeight[]; // 超高降效数据
  198. overHeightOption?: OverHeightOption; // 超高降效选项
  199. basicInfo?: IBasicInfo[]; // 基本信息
  200. feature?: IInfoItem[]; // 工程特征
  201. progressiveInterval?: IProgressiveInterval[]; // 累进区间
  202. gljAdjustType?: GLJAdjustType; // 承包人材料调整类型
  203. cptIllustration?: string; // 编制说明
  204. engineerInfos?: IInfoItem[];
  205. engineerFeatures?: IEngineerFeature[];
  206. materials?: IMaterialIndex[];
  207. mainQuantities?: IMainQtyIndex[];
  208. economics?: IEconomicIndex[];
  209. overHeightSpecificID?: string; // 超高子目指定清单ID
  210. distributeSetting?: IDistributeSetting; // 强制修改叶子清单的综合单价,分摊计算定额工程量 或 分摊计算定额下的工料机消耗量。
  211. colMetas?: IColumnMeta[];
  212. valuationName?: string; // 计价规则名称
  213. }
  214. // 原来的列设置太复杂了,没什么必要
  215. export interface IMainTreeCol {
  216. cols: Array<any>;
  217. headRowHeight: Array<number>;
  218. treeCol?: number;
  219. headRows?: number;
  220. emptyRows?: number;
  221. }
  222. export enum ImportType {
  223. NONE,
  224. YBP,
  225. INTERFACE,
  226. }
  227. // 项目活动枚举
  228. export enum ProjectActivity {
  229. // 新建
  230. CREATE = 'create',
  231. // 编辑
  232. EDIT = 'edit',
  233. // 删除
  234. DELETE = 'delete',
  235. // 恢复
  236. RECOVER = 'recover',
  237. }
  238. export interface IProject extends ITreeScm {
  239. type: ProjectType;
  240. compilationID: string;
  241. ownerID: string; // 拥有者ID(个人或企业)
  242. ownerType: EntityType;
  243. managerID: string; // 负责人ID
  244. creator: string;
  245. name: string;
  246. updateDate: number; // 更新时间
  247. code?: string;
  248. createDate: number;
  249. property?: IProperty;
  250. changeMark?: string;
  251. remark?: string;
  252. fileVer?: string;
  253. lastFileVer?: string;
  254. imported?: ImportType;
  255. deleteType?: DeleteEnum;
  256. deleteDate?: number;
  257. deleteBy?: string;
  258. // 只是为了显示,不是自身的正在数据,比如汇总信息等
  259. external?: {
  260. showShareMark?: boolean; // 是否显示分享标记
  261. cost?: number; // 工程造价
  262. // 有时候为了显示,需要一些特殊处理日期。如:项目管理-回收站,建设项目、单项工程的删除日期和创建日期需要显示为空
  263. deleteDateForView?: number;
  264. createDateForView?: number;
  265. actualTreeData?: ITreeScm; // 真正的树结构数据。有时候可能需要暂时变更project的树结构数据,在这种时候需要存储原本的真实树结构数据
  266. from?: string; // 来自于某用户名称
  267. members?: string[]; // 成员协作
  268. };
  269. }
  270. export interface IProjectBulkRst {
  271. create: IProject[];
  272. remove: string[];
  273. }
  274. // 建设项目默认设置项(可以被恢复的)
  275. export interface IConstructionDefaultSetting {
  276. decimal: IProperty['decimal'];
  277. billsQuantityDecimal: IProperty['billsQuantityDecimal'];
  278. displaySetting: IProperty['displaySetting'];
  279. billsCalcMode: IProperty['billsCalcMode'];
  280. zanguCalcMode: IProperty['zanguCalcMode'];
  281. calcOption: IProperty['calcOption'];
  282. colMetas: IProperty['colMetas'];
  283. }
  284. // 项目权限
  285. export interface IProjectPermission {
  286. projectID: string;
  287. readOnly: boolean;
  288. allowCopy: boolean;
  289. }
  290. // constructionTreeData接口
  291. export interface IConstructionTreeData {
  292. construction: { project: IProject };
  293. treeData: IProject[];
  294. }
  295. // 项目活动
  296. export interface IProjectActivity {
  297. activity: ProjectActivity;
  298. userID: string;
  299. date: number;
  300. }
  301. // 项目log
  302. export interface IProjectLog {
  303. // 企业ID
  304. enterpriseID: string;
  305. // 费用定额ID
  306. compilationID: string;
  307. // 费用定额名称
  308. compilationName: string;
  309. // 建设项目ID
  310. constructionID: string;
  311. // 建设项目名称
  312. constructionName: string;
  313. // 单位工程ID
  314. unitID: string;
  315. // 单位工程名称
  316. unitName: string;
  317. // 更新时间
  318. updateDate: number;
  319. // 管理者(所有者、负责人)ID
  320. managerID: string;
  321. // 活动
  322. activity: ProjectActivity;
  323. // 活动时间
  324. activityDate: number;
  325. // 活动者ID
  326. activityUserID: string;
  327. // 协作
  328. cooperationCount?: number;
  329. }
  330. // 导入状态
  331. export enum ImportStatus {
  332. IMPORTING = 0,
  333. FINISH = 1,
  334. FAIL = 3,
  335. }
  336. // 导入log
  337. export interface IImportLog {
  338. status: ImportStatus;
  339. errorMsg: string;
  340. stack?: any;
  341. }