project.ts 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285
  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. bills: { 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 interface IProperty {
  151. constructionID?: string; // 建设项目ID
  152. valuationType?: ValuationType; // 计价类型
  153. valuationID?: string; // 计价规则
  154. engineeringID?: string; // 工程专业ID
  155. fileType?: FileType; // 文件类型
  156. taxType?: TaxType; // 计税方式
  157. rationFeeType?: number; // 定额取费专业
  158. unitFeeType?: number; // 单位工程取费专业
  159. calcProgramLib?: INumFileRef; // 计算程序(标准)
  160. region?: string;
  161. showAdjustPrice?: boolean; // 是否显示调整价列
  162. isInstall?: boolean; // 是否是安装工程
  163. isItemIncrease?: boolean; // 是否是子目增加
  164. itemIncreaseSetting?: IIncreaseSetting;
  165. isAreaIncrease?: boolean; // 是否是面积增加
  166. areaIncreaseSetting?: IAreaIncreaseSetting; // 面积增加费设置
  167. indexName?: string; // 指标名称
  168. lockBills?: boolean; // 锁定清单
  169. decimal?: IDecimal; // 小数位数
  170. billsQuantityDecimal?: IBillsQuantityDecimal[]; // 清单工程量精度
  171. displaySetting?: IDisplaySetting; // 呈现选项
  172. billsCalcMode?: number; // 清单计费取费方式
  173. zanguCalcMode?: number; // 暂估合价计算方式
  174. calcOption?: ICalcOption; // 计算选项
  175. tenderSetting?: ITenderSetting; // 调价设置
  176. overHeight?: IOverHeight[]; // 超高降效数据
  177. overHeightOption?: OverHeightOption; // 超高降效选项
  178. basicInfo?: IInfoItem[]; // 基本信息
  179. feature?: IInfoItem[]; // 工程特征
  180. progressiveInterval?: IProgressiveInterval[]; // 累进区间
  181. gljAdjustType?: GLJAdjustType; // 承包人材料调整类型
  182. cptIllustration?: string; // 编制说明
  183. engineerInfos?: IInfoItem[];
  184. engineerFeatures?: IEngineerFeature[];
  185. materials?: IMaterialIndex[];
  186. mainQuantities?: IMainQtyIndex[];
  187. economics?: IEconomicIndex[];
  188. }
  189. // 原来的列设置太复杂了,没什么必要
  190. export interface IMainTreeCol {
  191. cols: Array<any>;
  192. headRowHeight: Array<number>;
  193. treeCol?: number;
  194. headRows?: number;
  195. emptyRows?: number;
  196. }
  197. export enum ImportType {
  198. NONE,
  199. YBP,
  200. INTERFACE,
  201. }
  202. export interface IProject extends ITreeScm {
  203. type: ProjectType;
  204. compilationID: string;
  205. ownerID: string;
  206. ownerType: EntityType;
  207. creator: string;
  208. name: string;
  209. code?: string;
  210. createDate: number;
  211. property?: IProperty;
  212. colMetas?: IColumnMeta[];
  213. changeMark?: string;
  214. remark?: string;
  215. fileVer?: string;
  216. lastFileVer?: string;
  217. imported?: ImportType;
  218. deleteType?: DeleteEnum;
  219. deleteDate?: number;
  220. deleteBy?: string;
  221. // 只是为了显示,不是自身的正在数据,比如汇总信息等
  222. external?: {
  223. cost?: number; // 工程造价
  224. // 有时候为了显示,需要一些特殊处理日期。如:项目管理-回收站,建设项目、单项工程的删除日期和创建日期需要显示为空
  225. deleteDateForView?: number;
  226. createDateForView?: number;
  227. actualTreeData?: ITreeScm; // 真正的树结构数据。有时候可能需要暂时变更project的树结构数据,在这种时候需要存储原本的真实树结构数据
  228. from?: string; // 来自于某用户名称
  229. };
  230. }
  231. export interface IProjectBulkRst {
  232. create: IProject[];
  233. remove: string[];
  234. }
  235. // 建设项目默认设置项(可以被恢复的)
  236. export interface IConstructionDefaultSetting {
  237. decimal: IProperty['decimal'];
  238. billsQuantityDecimal: IProperty['billsQuantityDecimal'];
  239. displaySetting: IProperty['displaySetting'];
  240. billsCalcMode: IProperty['billsCalcMode'];
  241. zanguCalcMode: IProperty['zanguCalcMode'];
  242. calcOption: IProperty['calcOption'];
  243. colMetas: IProject['colMetas'];
  244. }
  245. // 项目权限
  246. export interface IProjectPermission {
  247. projectID: string;
  248. share: ISharePermission;
  249. }
  250. // constructionTreeData接口
  251. export interface IConstructionTreeData {
  252. construction: { project: IProject };
  253. treeData: IProject[];
  254. }