glj.ts 12 KB

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