glj.ts 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548
  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. ID: string;
  174. basePrice: string;
  175. key: string;
  176. keywordList: IInfoKeyword[];
  177. marketPrice: string;
  178. name: string;
  179. specs: string;
  180. unit: string;
  181. dateRemark?: string;
  182. classCode: string;
  183. code: string;
  184. isManual?: boolean; // 是否手工关联
  185. }
  186. export interface IProjectGlj {
  187. ID: string;
  188. gljID: string; // 工料机ID
  189. code: string; // 编码
  190. originalCode: string; // 原始的编码
  191. name: string; // 名称
  192. supply: SupplyType; // 供货方式
  193. supplyQuantity?: number; // 甲供数量
  194. delivery?: string; // 交货方式
  195. deliveryAddress?: string; // 送达地点
  196. noAdjustPrice: boolean; // 不调价 { type: boolean; default: false }
  197. noTaxEqp?: boolean; // 不计税设备 { type: boolean; default: false }
  198. adjCoe?: number; // 调整系数ID
  199. specs?: string; // 规格型号
  200. type: GljType; // 类型
  201. model?: number; // 机型
  202. unit: string; // 单位
  203. isAdd: boolean; // 是否新增
  204. basePrice: number; // 基价单价
  205. marketPrice: number; // 市场单价
  206. components?: IComponent[]; // 组成物
  207. taxRate?: number; // 税率
  208. tenderPrice?: number; // 调后价
  209. adjustPrice?: number; // 调整价
  210. quantity?: number; // 显示关联的消耗量
  211. tenderQuantity?: number; // 调整后消耗量
  212. measureQuantity?: number; // 措施项目消耗量
  213. tenderMeasureQuantity?: number; // 调整后措施项目消耗量
  214. subdivisionQuantity?: number; // 分部分项消耗量
  215. tenderSubdivisionQuantity?: number; // 调整后分部分项消耗量
  216. materialType?: MaterialType; // 三材类别
  217. materialCoe?: number; // 三材系数
  218. materialQuantity?: number; // 三材量
  219. // 经济指标数据
  220. materialIndexType?: string; // 工料指标类别
  221. materialIndexUnit?: string; // 工料指标单位
  222. materialIndexCoe?: number; // 单位转换系数
  223. isMainMaterial: boolean; // 是否主要材料 (0为否 1为是) { type: boolean; default: false };
  224. remark?: string; // 备注
  225. originPlace?: string; // 产地
  226. vender?: string; // 厂家
  227. qualityGrade?: string; // 质量等级
  228. brand?: string; // 品牌
  229. priceFrom?: string; // 价格来源
  230. infoPrice?: number | null; // 信息价
  231. purchaseFeeRate?: number; // 采保费率
  232. from: FromType; // std, cpt 来自标准工料机库、补充工料机库
  233. matchedInfoPrice?: IMatchedInfoPrice | null; // 材料检查后匹配到的信息价
  234. // 以下仅普通材料可用
  235. grossWeightCoe?: number; // 毛重系数
  236. purchaseStorageRate?: number; // 采购保管费率
  237. offSiteTransportLossRate?: number; // 场外运输损耗率
  238. handlingLossRate?: number; // 每增一次装卸损耗率
  239. }
  240. export interface IProjectGljs {
  241. projectID: string;
  242. projectGljs: IProjectGlj[];
  243. }
  244. /* 标准人材机相关 ↓ */
  245. // 标准人材机库
  246. export interface IStdGljLib {
  247. dispName: string;
  248. compilationId: string;
  249. compilationName: string;
  250. ID: number;
  251. rationLibs: [{ dispName: string; ID: number }];
  252. }
  253. // 标准、补充人材机共用属性(原始数据)
  254. export interface IBaseRationGlj {
  255. code: string;
  256. name: string;
  257. specs?: string;
  258. basePrice: number;
  259. priceProperty?: any; // 多单价的情况
  260. model?: number; // 机型
  261. shortName: string;
  262. unit: string;
  263. adjCoe?: number;
  264. materialType?: MaterialType; // 三材类别
  265. materialCoe?: number; // 三材系数
  266. // 经济指标数据
  267. materialIndexType?: string; // 工料指标类别
  268. materialIndexUnit?: string; // 工料指标单位
  269. materialIndexCoe?: number; // 单位转换系数
  270. taxRate?: string; // 税率
  271. // 以下仅普通材料可用
  272. grossWeightCoe?: number; // 毛重系数
  273. purchaseStorageRate?: number; // 采购保管费率
  274. offSiteTransportLossRate?: number; // 场外运输损耗率
  275. handlingLossRate?: number; // 每增一次装卸损耗率
  276. }
  277. // 人材机组成物
  278. export interface ILibComponent {
  279. ID: number | string; // 可为补充、标准
  280. consumeAmt: number;
  281. consumeAmtProperty?: any; // 多消耗量的情况
  282. }
  283. // 标准人材机(原始数据)
  284. export interface IRawStdGlj extends IBaseRationGlj {
  285. ID: number;
  286. repositoryId: number;
  287. gljClass: number;
  288. gljType: number;
  289. component: ILibComponent[];
  290. }
  291. // 标准人材机
  292. export interface IStdGlj extends IBaseRationGlj {
  293. ID: number;
  294. repositoryID: number;
  295. type: number;
  296. gljClass: number;
  297. components: ILibComponent[];
  298. from: FromType;
  299. }
  300. // 标准人材机分类树(原始数据)
  301. export interface IRawStdGljTree {
  302. ID: number;
  303. ParentID: number;
  304. NextSiblingID: number;
  305. repositoryId: number;
  306. Name: string;
  307. }
  308. // 标准人材机分类树
  309. export interface IStdGljTree extends ITreeScm {
  310. repositoryID: number;
  311. name: string;
  312. from: FromType;
  313. }
  314. /* 标准人材机相关 ↑ */
  315. /* 补充人材机相关 ↓ */
  316. // 补充人材机分类树-模板(后台设置)
  317. export interface IRawCptGljTreeTemplate {
  318. compilationId: string;
  319. Name: string;
  320. ID: number;
  321. ParentID: number;
  322. NextSiblingID: number;
  323. }
  324. // 补充人材机分类树
  325. export interface ICptGljTree extends ITreeScm {
  326. name: string;
  327. from: FromType;
  328. }
  329. // 补充人材机分类树容器
  330. export interface ICptGljTreeData {
  331. libID: string;
  332. ID: string;
  333. compilationID: string;
  334. treeData: ICptGljTree[];
  335. }
  336. // 补充人材机组成物
  337. export interface ICptComponent extends ILibComponent {
  338. from: FromType;
  339. }
  340. // 补充人材机组成物的组合数据(增加一些字段用于显示)
  341. export interface ICptDisplayComponent extends ICptComponent {
  342. code: string;
  343. name: string;
  344. unit: string;
  345. basePrice: number;
  346. }
  347. // 补充人材机
  348. export interface ICptGlj extends IBaseRationGlj {
  349. libID: string;
  350. ID: string;
  351. compilationID: string;
  352. type: number;
  353. gljClass: string;
  354. components: ICptComponent[];
  355. displayComponents?: ICptDisplayComponent[];
  356. from: FromType;
  357. creatorID?: string; // 创建者ID
  358. creatorName?: string; // 创建者姓名
  359. createTime?: number; // 创建时间
  360. displayLibName?: string; // 工料机所在库在前端UI上的显示,如:[企业库]。
  361. alias?: string; // 别名(名称 规格)
  362. period?: string; // 期数
  363. areaName?: string; // 价格地区
  364. areaID?: string; // 价格地区
  365. operationID?: string; // 操作ID 防止未来需要撤销批量入库
  366. matchedInfoPrice?: IMatchedInfoPrice | null; // 匹配到的信息价
  367. priceFrom?: string; // 价格来源
  368. constructionName?: string; // 建设项目名称
  369. constructionID?: string; // 建设项目ID
  370. engineeringID?: string; // 工程专业ID
  371. engineeringName?: string; // 工程专业名称
  372. weight?: number; // 排序权重
  373. }
  374. // 新增补充人材机接口传输的数据接口
  375. export interface IInsertCptGlj {
  376. ID: string;
  377. gljClass: string;
  378. code: string;
  379. name: string;
  380. unit: string;
  381. specs?: string;
  382. type: number;
  383. basePrice: number;
  384. model?: number;
  385. }
  386. // 准备组成物返回数据接口
  387. export interface IPrepareComponentResult {
  388. displayComponents: ICptDisplayComponent[];
  389. }
  390. // 补充人材机
  391. /* 补充人材机相关 ↑ */
  392. /* 选择人材机相关 ↓ */
  393. // 库下拉项
  394. export interface ISelectGljLibItem {
  395. name: string;
  396. repositoryID: number | string;
  397. key: string; // 与gljLibID拼接的形成的唯一值
  398. isPrior: boolean; // 优先的
  399. from: FromType;
  400. isShare?: boolean; // 是否是被人分享的
  401. located?: boolean; // 定位到的库(替换时需要)
  402. enterpriseID?: string; // 库来自企业的ID(企业分享会有)
  403. enterpriseName?: string; // 库来自企业的名称(企业分享会有)
  404. }
  405. export interface IAddComponentOption {
  406. type: GljType;
  407. gljID?: number | string;
  408. }
  409. // 获取人材机分页数据接口选项
  410. export interface IGetPagingGljOptions {
  411. classList?: (number | string)[]; // 需要匹配的分类
  412. typeList?: GljType[]; // 需要匹配的人材机类型
  413. libID?: number | string; // 人材机库ID
  414. replaceGlj?: IBaseGlj; // 替换的人材机
  415. addComponent?: IAddComponentOption; // 添加组成物时的参数
  416. located?: boolean; // 是否需要定位(打开替换窗口时)
  417. limit?: number; // 分页数量
  418. gtCode?: string; // 分页排序$gt code
  419. search?: string; // 搜索的内容(匹配编号、名称)
  420. excludeIDs?: (number | string)[]; // 排除的人材机ID
  421. }
  422. // 选择人材机接口返回数据格式
  423. export interface ISelectGljResult {
  424. libData: ISelectGljLibItem[]; // 库下拉项
  425. treeData: (IStdGljTree | ICptGljTree)[]; // 人材机分类树
  426. gljData: (IStdGlj | ICptGlj)[]; // 人材机数据
  427. total: number; // 当前数据总数量
  428. locatedGlj?: IStdGlj | ICptGlj; // 需要定位到的人材机
  429. }
  430. /* 选择人材机相关 ↑ */
  431. // 补充定额库中,需要显示用的补充定额人材机
  432. export interface ICptDisplayRationGlj {
  433. ID: string | number; // 人材机ID(标准为number,补充为string)
  434. code: string;
  435. name: string;
  436. unit: string;
  437. specs?: string;
  438. basePrice: number;
  439. consumeAmt: number;
  440. from: FromType;
  441. type: GljType;
  442. }
  443. // 重算补充定额价格需要的人材机类型
  444. export interface IGljForCalcRationPrice {
  445. basePrice: number;
  446. consumeAmt: number;
  447. type: GljType;
  448. [props: string]: any;
  449. }
  450. // 价格变更人材机
  451. export interface IPriceChangeGlj {
  452. ID: string;
  453. basePrice: number;
  454. }
  455. // 添加组成物filter类型
  456. export interface IAddComponentFilter {
  457. projectGljID: string;
  458. libGljs: (IStdGlj | ICptGlj)[];
  459. processID?: string;
  460. }
  461. // 补充定额库选项
  462. export interface ICptGljLibOption {
  463. ID: string;
  464. name: string;
  465. readOnly: boolean;
  466. enterpriseID?: string; // 库来自企业的ID(企业分享会有)
  467. enterpriseName?: string; // 库来自企业的名称(企业分享会有)
  468. }
  469. // 进入定额库需要准备的数据(一些状态)
  470. export interface IPrepareCptGljLib {
  471. // 人材机库分享人数
  472. shareCount: number;
  473. // 库下拉选项
  474. libOptions: ICptGljLibOption[];
  475. }
  476. // 补充人材机库
  477. export interface ICptGljLib {
  478. ID: string;
  479. // 库名称,预留字段,以后可能允许自行新建补充库
  480. name?: string;
  481. // 费用定额ID
  482. compilationID: string;
  483. // 企业ID,可为空字符串
  484. enterpriseID: string;
  485. // 用户ID
  486. userID: string;
  487. // 是否为企业内部库
  488. isEnterpriseInternal: boolean;
  489. createDate: number;
  490. }
  491. // 以工料机五大项为key,映射表
  492. export interface IGljKeyMap {
  493. [key: string]: IBaseGlj;
  494. }
  495. // 添加定额人材机的document
  496. export interface IAddRationGljDoc {
  497. code: string;
  498. repositoryID?: number | string;
  499. projectGljID?: string;
  500. }