project.ts 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344
  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 } 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. }
  38. // 呈现选项
  39. export interface IDisplaySetting {
  40. billsAutoHeight: boolean;
  41. rationAutoHeight: boolean;
  42. disPlayMainMaterial: boolean;
  43. }
  44. // 累进区间
  45. export interface IProgression {
  46. interval: string; // 区间字符 eg: '(0,100]'
  47. feeRate: boolean;
  48. }
  49. export interface IProgressiveInterval {
  50. name: string;
  51. progression: IProgression[];
  52. }
  53. // 超高降效
  54. export interface IOverHeight {
  55. name: string;
  56. code?: string;
  57. unit?: string;
  58. labourRate?: number;
  59. machineRate?: number;
  60. labourMachineRate?: number;
  61. benchmark?: number;
  62. extra?: number;
  63. limit?: number;
  64. }
  65. export enum OverHeightOption {
  66. SEPARATION = 1, // 对应清单或分部下(默认)
  67. MEASURE, // 指定措施清单011704001
  68. SPECIFIC, // 指定具体位置,显示分部分项以及措施项目的树结构显示叶子清单(分项)供勾选
  69. }
  70. // 承包人材料调整类型
  71. export enum GLJAdjustType {
  72. PRICE_INFO = 'priceInfo', // 造价信息差额调整法
  73. PRICE_COE = 'priceCoe', // 价格指数调整法
  74. }
  75. // 计税方式
  76. export enum TaxType {
  77. GENERAL = 1,
  78. SIMPLE,
  79. }
  80. // 文件类型
  81. export enum FileType {
  82. SUBMISSION = 1, // 投标
  83. INVITATION, // 招标
  84. CONTROL, // 控制价
  85. }
  86. export enum FileTypeName {
  87. SUBMISSION = '投标',
  88. INVITATION = '招标',
  89. CONTROL = '控制价',
  90. }
  91. export const FileTypeMap = {
  92. [FileType.SUBMISSION]: FileTypeName.SUBMISSION,
  93. [FileType.INVITATION]: FileTypeName.INVITATION,
  94. [FileType.CONTROL]: FileTypeName.CONTROL,
  95. };
  96. // 工程特征、基本信息
  97. export interface IInfoItem {
  98. key: string;
  99. dispName: string;
  100. value?: string;
  101. required?: string;
  102. readonly?: string;
  103. options?: string;
  104. cellType?: string;
  105. fileKind?: FileTypeName;
  106. items?: IInfoItem[];
  107. }
  108. // 工程特征指标
  109. interface IBaseEngineerFeature {
  110. value: string;
  111. name: string;
  112. exportName?: string;
  113. cellType?: string;
  114. options?: string;
  115. }
  116. export interface IStdEngineerFeature extends IBaseEngineerFeature {
  117. ID: number;
  118. ParentID: number;
  119. }
  120. export interface IEngineerFeature extends ITreeScm, IBaseEngineerFeature {}
  121. // 主要工料指标
  122. export interface IMaterialIndex {
  123. name: string;
  124. unit: string;
  125. coe: number;
  126. }
  127. // 主要工程量指标
  128. export interface IMainQtyIndex {
  129. name: string;
  130. unit: string;
  131. coe: number;
  132. }
  133. // 主要经济指标
  134. export interface IEconomicIndex {
  135. name: string;
  136. value: string;
  137. }
  138. // 面积增加类型
  139. export enum AreaIncreaseType {
  140. LABOUR = 'labour',
  141. MATERIAL = 'material',
  142. MACHINE = 'machine',
  143. }
  144. export interface IAreaIncreaseSetting {
  145. [AreaIncreaseType.LABOUR]: number;
  146. [AreaIncreaseType.MATERIAL]: number;
  147. [AreaIncreaseType.MACHINE]: number;
  148. }
  149. // 关于计算取费方式
  150. export enum BillGetFeeType {
  151. RATION_CONTENT = 0,
  152. RATION_PRICE_CONVERSE = 1,
  153. RATION_PRICE = 2,
  154. BILL_PRICE = 3,
  155. }
  156. // 项目属性
  157. export interface IProperty {
  158. constructionID?: string; // 建设项目ID
  159. valuationType?: ValuationType; // 计价类型
  160. valuationID?: string; // 计价规则
  161. engineeringID?: string; // 工程专业ID
  162. fileType?: FileType; // 文件类型
  163. taxType?: TaxType; // 计税方式
  164. rationFeeType?: number; // 定额取费专业
  165. unitFeeType?: number; // 单位工程取费专业
  166. calcProgramLib?: INumFileRef; // 计算程序(标准)
  167. region?: string;
  168. showAdjustPrice?: boolean; // 是否显示调整价列
  169. isInstall?: boolean; // 是否是安装工程
  170. isItemIncrease?: boolean; // 是否是子目增加
  171. itemIncreaseSetting?: IIncreaseSetting;
  172. isAreaIncrease?: boolean; // 是否是面积增加
  173. areaIncreaseSetting?: IAreaIncreaseSetting; // 面积增加费设置
  174. indexName?: string; // 指标名称
  175. lockBills?: boolean; // 锁定清单
  176. decimal?: IDecimal; // 小数位数
  177. billsQuantityDecimal?: IBillsQuantityDecimal[]; // 清单工程量精度
  178. displaySetting?: IDisplaySetting; // 呈现选项
  179. billsCalcMode?: BillGetFeeType; // 清单计费取费方式
  180. zanguCalcMode?: number; // 暂估合价计算方式
  181. calcOption?: ICalcOption; // 计算选项
  182. tenderSetting?: ITenderSetting; // 调价设置
  183. overHeight?: IOverHeight[]; // 超高降效数据
  184. overHeightOption?: OverHeightOption; // 超高降效选项
  185. basicInfo?: IInfoItem[]; // 基本信息
  186. feature?: IInfoItem[]; // 工程特征
  187. progressiveInterval?: IProgressiveInterval[]; // 累进区间
  188. gljAdjustType?: GLJAdjustType; // 承包人材料调整类型
  189. cptIllustration?: string; // 编制说明
  190. engineerInfos?: IInfoItem[];
  191. engineerFeatures?: IEngineerFeature[];
  192. materials?: IMaterialIndex[];
  193. mainQuantities?: IMainQtyIndex[];
  194. economics?: IEconomicIndex[];
  195. overHeightSpecificID?: string; // 超高子目指定清单ID
  196. }
  197. // 原来的列设置太复杂了,没什么必要
  198. export interface IMainTreeCol {
  199. cols: Array<any>;
  200. headRowHeight: Array<number>;
  201. treeCol?: number;
  202. headRows?: number;
  203. emptyRows?: number;
  204. }
  205. export enum ImportType {
  206. NONE,
  207. YBP,
  208. INTERFACE,
  209. }
  210. // 项目活动枚举
  211. export enum ProjectActivity {
  212. // 新建
  213. CREATE = 'create',
  214. // 查看
  215. CHECK = 'check',
  216. // 编辑
  217. EDIT = 'edit',
  218. // 删除
  219. DELETE = 'delete',
  220. // 恢复
  221. RECOVER = 'recover',
  222. }
  223. // 项目活动
  224. export interface IProjectActivity {
  225. activity: ProjectActivity;
  226. userID: string;
  227. date: number;
  228. }
  229. export interface IProject extends ITreeScm {
  230. type: ProjectType;
  231. compilationID: string;
  232. ownerID: string; // 拥有者ID(个人或企业)
  233. ownerType: EntityType;
  234. managerID: string; // 负责人ID
  235. creator: string;
  236. name: string;
  237. updateDate: number; // 更新时间
  238. activities: IProjectActivity[]; // 活动
  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. cost?: number; // 工程造价
  254. // 有时候为了显示,需要一些特殊处理日期。如:项目管理-回收站,建设项目、单项工程的删除日期和创建日期需要显示为空
  255. deleteDateForView?: number;
  256. createDateForView?: number;
  257. actualTreeData?: ITreeScm; // 真正的树结构数据。有时候可能需要暂时变更project的树结构数据,在这种时候需要存储原本的真实树结构数据
  258. from?: string; // 来自于某用户名称
  259. };
  260. }
  261. export interface IProjectBulkRst {
  262. create: IProject[];
  263. remove: string[];
  264. }
  265. // 建设项目默认设置项(可以被恢复的)
  266. export interface IConstructionDefaultSetting {
  267. decimal: IProperty['decimal'];
  268. billsQuantityDecimal: IProperty['billsQuantityDecimal'];
  269. displaySetting: IProperty['displaySetting'];
  270. billsCalcMode: IProperty['billsCalcMode'];
  271. zanguCalcMode: IProperty['zanguCalcMode'];
  272. calcOption: IProperty['calcOption'];
  273. colMetas: IProject['colMetas'];
  274. }
  275. // 项目权限
  276. export interface IProjectPermission {
  277. projectID: string;
  278. share: ISharePermission;
  279. }
  280. // constructionTreeData接口
  281. export interface IConstructionTreeData {
  282. construction: { project: IProject };
  283. treeData: IProject[];
  284. }
  285. // 项目log
  286. export interface IProjectLog {
  287. // 费用定额ID
  288. compilationID: string;
  289. // 费用定额名称
  290. compilationName: string;
  291. // 建设项目ID
  292. constructionID: string;
  293. // 建设项目名称
  294. constructionName: string;
  295. // 单位工程ID
  296. unitID: string;
  297. // 单位工程名称
  298. unitName: string;
  299. // 更新时间
  300. updateDate: number;
  301. // 管理者(所有者、负责人)ID
  302. managerID: string;
  303. // 活动
  304. activity: ProjectActivity;
  305. // 活动时间
  306. activityDate: number;
  307. // 活动者ID
  308. activityUserID: string;
  309. }