glj.ts 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517
  1. import { IInfoKeyword, IInfoPriceItem } from '.';
  2. import { FromType, ITreeScm, SupplyType } from './base';
  3. // 工料机类型
  4. export enum GljType {
  5. LABOUR = 1, // 人工
  6. // ==============材料类型 ↓=================
  7. MATERIAL = 2, // 材料
  8. GENERAL_MATERIAL = 201, // 普通材料
  9. CONCRETE = 202, // 混凝土
  10. MORTAR = 203, // 砂浆
  11. MIX_RATIO = 204, // 配合比
  12. COMMERCIAL_CONCRETE = 205, // 商品混凝土
  13. COMMERCIAL_MORTAR = 206, // 商品砂浆
  14. OTHER_MATERIAL = 207, // 其它材料
  15. // ==============材料类型 ↑=================
  16. // ==============机械类型 ↓=================
  17. GENERAL_MACHINE = 301, // 机械台班
  18. MACHINE_COMPOSITION = 302, // 机械组成物
  19. MACHINE_LABOUR = 303, // 机上人工
  20. INSTRUMENT = 304, // 仪器仪表
  21. FUEL_POWER_FEE = 305, // 燃料动力费
  22. DEPRECIATION_FEE = 306, // 折旧费
  23. INSPECTION_FEE = 307, // 检修费
  24. MAINTENANCE = 308, // 维护费
  25. DISMANTLING_FREIGHT_FEE = 309, // 安拆费及场外运费
  26. VERIFICATION_FEE = 310, // 校验费
  27. OTHER_FEE = 311, // 其他费用
  28. OTHER_MACHINE_USED = 312, // 其他施工机具使用费
  29. // ==============机械类型 ↑=================
  30. MAIN_MATERIAL = 4, // 主材
  31. EQUIPMENT = 5, // 设备
  32. MANAGEMENT_FEE = 6, // 企业管理费
  33. PROFIT = 7, // 利润
  34. GENERAL_RISK_FEE = 8, // 一般风险费
  35. }
  36. export const hasCompMaterialTypes = [
  37. // 有组成物的材料类型, //混凝土、砂浆、配合比
  38. GljType.CONCRETE,
  39. GljType.MORTAR,
  40. GljType.MIX_RATIO,
  41. ];
  42. export const hasCompMachineTypes = [
  43. // 有组成物的机械类型
  44. GljType.GENERAL_MACHINE,
  45. GljType.INSTRUMENT,
  46. ];
  47. export const machineCompTypes = [
  48. // 可以做为机械组成物的类型
  49. GljType.MACHINE_COMPOSITION,
  50. GljType.MACHINE_LABOUR,
  51. GljType.FUEL_POWER_FEE, // 燃料动力费
  52. GljType.DEPRECIATION_FEE, // 折旧费
  53. GljType.INSPECTION_FEE, // 检修费
  54. GljType.MAINTENANCE, // 维护费
  55. GljType.DISMANTLING_FREIGHT_FEE, // 安拆费及场外运费
  56. GljType.VERIFICATION_FEE, // 校验费
  57. GljType.OTHER_FEE, // 其他费用
  58. ];
  59. export interface IBaseGlj {
  60. code: string;
  61. name: string;
  62. specs?: string;
  63. type: GljType;
  64. unit: string;
  65. [key: string]: any;
  66. }
  67. export interface IGljTypeShortName {
  68. [type: number]: string;
  69. }
  70. // 人材机类型简称
  71. export const GljTypeShortName: IGljTypeShortName = {
  72. 1: '人',
  73. 201: '材',
  74. 202: '砼',
  75. 203: '浆',
  76. 204: '配比',
  77. 205: '商砼',
  78. 206: '商浆',
  79. 207: '材',
  80. 208: '外购',
  81. 209: '苗木',
  82. 301: '机',
  83. 302: '机',
  84. 303: '机人',
  85. 304: '仪',
  86. 305: '动',
  87. 306: '折',
  88. 307: '检',
  89. 308: '维',
  90. 309: '安',
  91. 310: '校',
  92. 311: '机',
  93. 312: '机',
  94. 4: '主',
  95. 5: '设',
  96. 6: '管',
  97. 7: '利',
  98. 8: '险',
  99. };
  100. // 人材机类型全称
  101. export const GljTypeFullName: Record<number, string> = {
  102. 1: '人工',
  103. 201: '普通材料',
  104. 202: '混凝土',
  105. 203: '砂浆',
  106. 204: '配合比',
  107. 205: '商品混凝土',
  108. 206: '商品砂浆',
  109. 207: '其他材料费',
  110. 208: '外购砼构件',
  111. 209: '绿化苗木',
  112. 301: '机械台班',
  113. 302: '机械组成物',
  114. 303: '机上人工',
  115. 304: '仪器仪表',
  116. 305: '燃料动力费',
  117. 306: '折旧费',
  118. 307: '检修费',
  119. 308: '维护费',
  120. 309: '安拆费及场外运费',
  121. 310: '校验费',
  122. 311: '其他费用',
  123. 312: '其他施工机具使用费',
  124. 4: '主材',
  125. 5: '设备',
  126. 6: '企业管理费',
  127. 7: '利润',
  128. 8: '一般风险费',
  129. };
  130. export interface IComponent {
  131. ID: string;
  132. consumption: number; // 消耗量(有别于总消耗,此字段记录配合比的消耗量)
  133. gljID: string; // 工料机总库对应id (关联用)
  134. specs?: string; // 规格型号
  135. unit: string; // 单位
  136. name: string; // 名称
  137. code: string; // 对应工料机code
  138. type: GljType; // 工料机类型
  139. model?: number; // 机型
  140. from: FromType; // std, cpt 来自标准工料机库、补充工料机库
  141. }
  142. export enum MaterialType {
  143. GC = 1,
  144. GJ = 2,
  145. MC = 3,
  146. SN = 4,
  147. SPT = 5,
  148. SPSJ = 6,
  149. }
  150. export const MaterialDisplay = {
  151. 1: '钢材',
  152. 2: '钢筋',
  153. 3: '木材',
  154. 4: '水泥',
  155. 5: '商品砼',
  156. 6: '商品砂浆',
  157. };
  158. // 机型
  159. export enum GljModel {
  160. EXTRA_LARGE = 1,
  161. LARGE,
  162. MEDIUM,
  163. SMALL,
  164. }
  165. // 机型名称映射
  166. export const GljModelName = {
  167. 1: '特大',
  168. 2: '大',
  169. 3: '中',
  170. 4: '小',
  171. };
  172. export interface IMatchedInfoPrice {
  173. basePrice: string;
  174. key: string;
  175. keywordList: IInfoKeyword[];
  176. marketPrice: string;
  177. name: string;
  178. specs: string;
  179. unit: string;
  180. dateRemark?: string;
  181. classCode: string;
  182. code: string;
  183. }
  184. export interface IProjectGlj {
  185. ID: string;
  186. gljID: string; // 工料机ID
  187. code: string; // 编码
  188. originalCode: string; // 原始的编码
  189. name: string; // 名称
  190. supply: SupplyType; // 供货方式
  191. supplyQuantity?: number; // 甲供数量
  192. delivery?: string; // 交货方式
  193. deliveryAddress?: string; // 送达地点
  194. noAdjustPrice: boolean; // 不调价 { type: boolean; default: false }
  195. noTaxEqp?: boolean; // 不计税设备 { type: boolean; default: false }
  196. adjCoe?: number; // 调整系数ID
  197. specs?: string; // 规格型号
  198. type: GljType; // 类型
  199. model?: number; // 机型
  200. unit: string; // 单位
  201. isAdd: boolean; // 是否新增
  202. basePrice: number; // 基价单价
  203. marketPrice: number; // 市场单价
  204. components?: IComponent[]; // 组成物
  205. taxRate?: number; // 税率
  206. tenderPrice?: number; // 调后价
  207. adjustPrice?: number; // 调整价
  208. quantity?: number; // 显示关联的消耗量
  209. tenderQuantity?: number; // 调整后消耗量
  210. techQuantity?: number; // 技术措施项目消耗量
  211. tenderTechQuantity?: number; // 调整后技术措施项目消耗量
  212. subdivisionQuantity?: number; // 分部分项消耗量
  213. tenderSubdivisionQuantity?: number; // 调整后分部分项消耗量
  214. materialType?: MaterialType; // 三材类别
  215. materialCoe?: number; // 三材系数
  216. materialQuantity?: number; // 三材量
  217. // 经济指标数据
  218. materialIndexType?: string; // 工料指标类别
  219. materialIndexUnit?: string; // 工料指标单位
  220. materialIndexCoe?: number; // 单位转换系数
  221. isMainMaterial: boolean; // 是否主要材料 (0为否 1为是) { type: boolean; default: false };
  222. remark?: string; // 备注
  223. originPlace?: string; // 产地
  224. vender?: string; // 厂家
  225. qualityGrade?: string; // 质量等级
  226. brand?: string; // 品牌
  227. priceFrom?: string; // 价格来源
  228. infoPrice?: number | null; // 信息价
  229. purchaseFeeRate?: number; // 采保费率
  230. from: FromType; // std, cpt 来自标准工料机库、补充工料机库
  231. matchedInfoPrice?: IMatchedInfoPrice | null; // 材料检查后匹配到的信息价
  232. }
  233. export interface IProjectGljs {
  234. projectID: string;
  235. projectGljs: IProjectGlj[];
  236. }
  237. /* 标准人材机相关 ↓ */
  238. // 标准人材机库
  239. export interface IStdGljLib {
  240. dispName: string;
  241. compilationId: string;
  242. compilationName: string;
  243. ID: number;
  244. rationLibs: [{ dispName: string; ID: number }];
  245. }
  246. // 标准、补充人材机共用属性(原始数据)
  247. export interface IBaseRationGlj {
  248. code: string;
  249. name: string;
  250. specs?: string;
  251. basePrice: number;
  252. priceProperty?: any; // 多单价的情况
  253. model?: number; // 机型
  254. shortName: string;
  255. unit: string;
  256. adjCoe?: number;
  257. materialType?: MaterialType; // 三材类别
  258. materialCoe?: number; // 三材系数
  259. // 经济指标数据
  260. materialIndexType?: string; // 工料指标类别
  261. materialIndexUnit?: string; // 工料指标单位
  262. materialIndexCoe?: number; // 单位转换系数
  263. taxRate?: string; // 税率
  264. }
  265. // 人材机组成物
  266. export interface ILibComponent {
  267. ID: number | string; // 可为补充、标准
  268. consumeAmt: number;
  269. consumeAmtProperty?: any; // 多消耗量的情况
  270. }
  271. // 标准人材机(原始数据)
  272. export interface IRawStdGlj extends IBaseRationGlj {
  273. ID: number;
  274. repositoryId: number;
  275. gljClass: number;
  276. gljType: number;
  277. component: ILibComponent[];
  278. }
  279. // 标准人材机
  280. export interface IStdGlj extends IBaseRationGlj {
  281. ID: number;
  282. repositoryID: number;
  283. type: number;
  284. gljClass: number;
  285. components: ILibComponent[];
  286. from: FromType;
  287. }
  288. // 标准人材机分类树(原始数据)
  289. export interface IRawStdGljTree {
  290. ID: number;
  291. ParentID: number;
  292. NextSiblingID: number;
  293. repositoryId: number;
  294. Name: string;
  295. }
  296. // 标准人材机分类树
  297. export interface IStdGljTree extends ITreeScm {
  298. repositoryID: number;
  299. name: string;
  300. from: FromType;
  301. }
  302. /* 标准人材机相关 ↑ */
  303. /* 补充人材机相关 ↓ */
  304. // 补充人材机分类树-模板(后台设置)
  305. export interface IRawCptGljTreeTemplate {
  306. compilationId: string;
  307. Name: string;
  308. ID: number;
  309. ParentID: number;
  310. NextSiblingID: number;
  311. }
  312. // 补充人材机分类树
  313. export interface ICptGljTree extends ITreeScm {
  314. name: string;
  315. from: FromType;
  316. }
  317. // 补充人材机分类树容器
  318. export interface ICptGljTreeData {
  319. libID: string;
  320. ID: string;
  321. compilationID: string;
  322. treeData: ICptGljTree[];
  323. }
  324. // 补充人材机组成物
  325. export interface ICptComponent extends ILibComponent {
  326. from: FromType;
  327. }
  328. // 补充人材机组成物的组合数据(增加一些字段用于显示)
  329. export interface ICptDisplayComponent extends ICptComponent {
  330. code: string;
  331. name: string;
  332. unit: string;
  333. basePrice: number;
  334. }
  335. // 补充人材机
  336. export interface ICptGlj extends IBaseRationGlj {
  337. libID: string;
  338. ID: string;
  339. compilationID: string;
  340. type: number;
  341. gljClass: string;
  342. components: ICptComponent[];
  343. displayComponents?: ICptDisplayComponent[];
  344. from: FromType;
  345. creatorID?: string; // 创建者ID
  346. creatorName?: string; // 创建者姓名
  347. createTime?: number; // 创建时间
  348. displayLibName?: string; // 工料机所在库在前端UI上的显示,如:[企业库]。
  349. alias?: string; // 别名(名称 规格)
  350. period?: string; // 期数
  351. }
  352. // 新增补充人材机接口传输的数据接口
  353. export interface IInsertCptGlj {
  354. ID: string;
  355. gljClass: string;
  356. code: string;
  357. name: string;
  358. unit: string;
  359. specs?: string;
  360. type: number;
  361. basePrice: number;
  362. model?: number;
  363. }
  364. // 准备组成物返回数据接口
  365. export interface IPrepareComponentResult {
  366. displayComponents: ICptDisplayComponent[];
  367. }
  368. // 补充人材机
  369. /* 补充人材机相关 ↑ */
  370. /* 选择人材机相关 ↓ */
  371. // 库下拉项
  372. export interface ISelectGljLibItem {
  373. name: string;
  374. repositoryID: number | string;
  375. key: string; // 与gljLibID拼接的形成的唯一值
  376. isPrior: boolean; // 优先的
  377. from: FromType;
  378. isShare?: boolean; // 是否是被人分享的
  379. located?: boolean; // 定位到的库(替换时需要)
  380. enterpriseID?: string; // 库来自企业的ID(企业分享会有)
  381. enterpriseName?: string; // 库来自企业的名称(企业分享会有)
  382. }
  383. export interface IAddComponentOption {
  384. type: GljType;
  385. gljID?: number | string;
  386. }
  387. // 获取人材机分页数据接口选项
  388. export interface IGetPagingGljOptions {
  389. classList?: (number | string)[]; // 需要匹配的分类
  390. typeList?: GljType[]; // 需要匹配的人材机类型
  391. libID?: number | string; // 人材机库ID
  392. replaceGlj?: IBaseGlj; // 替换的人材机
  393. addComponent?: IAddComponentOption; // 添加组成物时的参数
  394. located?: boolean; // 是否需要定位(打开替换窗口时)
  395. limit?: number; // 分页数量
  396. gtCode?: string; // 分页排序$gt code
  397. search?: string; // 搜索的内容(匹配编号、名称)
  398. excludeIDs?: (number | string)[]; // 排除的人材机ID
  399. }
  400. // 选择人材机接口返回数据格式
  401. export interface ISelectGljResult {
  402. libData: ISelectGljLibItem[]; // 库下拉项
  403. treeData: (IStdGljTree | ICptGljTree)[]; // 人材机分类树
  404. gljData: (IStdGlj | ICptGlj)[]; // 人材机数据
  405. total: number; // 当前数据总数量
  406. locatedGlj?: IStdGlj | ICptGlj; // 需要定位到的人材机
  407. }
  408. /* 选择人材机相关 ↑ */
  409. // 补充定额库中,需要显示用的补充定额人材机
  410. export interface ICptDisplayRationGlj {
  411. ID: string | number; // 人材机ID(标准为number,补充为string)
  412. code: string;
  413. name: string;
  414. unit: string;
  415. specs?: string;
  416. basePrice: number;
  417. consumeAmt: number;
  418. from: FromType;
  419. type: GljType;
  420. }
  421. // 重算补充定额价格需要的人材机类型
  422. export interface IGljForCalcRationPrice {
  423. basePrice: number;
  424. consumeAmt: number;
  425. type: GljType;
  426. [props: string]: any;
  427. }
  428. // 价格变更人材机
  429. export interface IPriceChangeGlj {
  430. ID: string;
  431. basePrice: number;
  432. }
  433. // 添加组成物filter类型
  434. export interface IAddComponentFilter {
  435. projectGljID: string;
  436. libGljs: (IStdGlj | ICptGlj)[];
  437. processID?: string;
  438. }
  439. // 补充定额库选项
  440. export interface ICptGljLibOption {
  441. ID: string;
  442. name: string;
  443. readOnly: boolean;
  444. enterpriseID?: string; // 库来自企业的ID(企业分享会有)
  445. enterpriseName?: string; // 库来自企业的名称(企业分享会有)
  446. }
  447. // 进入定额库需要准备的数据(一些状态)
  448. export interface IPrepareCptGljLib {
  449. // 人材机库分享人数
  450. shareCount: number;
  451. // 库下拉选项
  452. libOptions: ICptGljLibOption[];
  453. }
  454. // 补充人材机库
  455. export interface ICptGljLib {
  456. ID: string;
  457. // 库名称,预留字段,以后可能允许自行新建补充库
  458. name?: string;
  459. // 费用定额ID
  460. compilationID: string;
  461. // 企业ID,可为空字符串
  462. enterpriseID: string;
  463. // 用户ID
  464. userID: string;
  465. // 是否为企业内部库
  466. isEnterpriseInternal: boolean;
  467. createDate: number;
  468. }
  469. // 以工料机五大项为key,映射表
  470. export interface IGljKeyMap {
  471. [key: string]: IBaseGlj;
  472. }