project.ts 9.3 KB

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