glj.ts 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452
  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. adjustPrice?: string; // 显示调整基价
  199. quantity?: number; // 显示关联的消耗量
  200. tenderQuantity?: number; // 调整后消耗量
  201. techQuantity?: number; // 技术措施项目消耗量
  202. subdivisionQuantity?: number; // 分部分项消耗量
  203. materialType?: MaterialType; // 三材类别
  204. materialCoe?: number; // 三材系数
  205. materialQuantity?: number; // 三材量
  206. // 经济指标数据
  207. materialIndexType?: string; // 工料指标类别
  208. materialIndexUnit?: string; // 工料指标单位
  209. materialIndexCoe: number; // 单位转换系数
  210. isMainMaterial: boolean; // 是否主要材料 (0为否 1为是) { type: boolean; default: false };
  211. remark?: string; // 备注
  212. originPlace?: string; // 产地
  213. vender?: string; // 厂家
  214. qualityGrade?: string; // 质量等级
  215. brand?: string; // 品牌
  216. priceFrom?: string; // 价格来源
  217. from: FromType; // std, cpt 来自标准工料机库、补充工料机库
  218. }
  219. export interface IProjectGljs {
  220. projectID: string;
  221. projectGljs: IProjectGlj[];
  222. }
  223. /* 标准人材机相关 ↓ */
  224. // 标准人材机库
  225. export interface IStdGljLib {
  226. dispName: string;
  227. compilationId: string;
  228. compilationName: string;
  229. ID: number;
  230. rationLibs: [{ dispName: string; ID: number }];
  231. }
  232. // 标准、补充人材机共用属性(原始数据)
  233. export interface IBaseRationGlj {
  234. code: string;
  235. name: string;
  236. specs?: string;
  237. basePrice: number;
  238. priceProperty?: any; // 多单价的情况
  239. model?: number; // 机型
  240. shortName: string;
  241. unit: string;
  242. adjCoe?: number;
  243. materialType?: MaterialType; // 三材类别
  244. materialCoe?: number; // 三材系数
  245. // 经济指标数据
  246. materialIndexType?: string; // 工料指标类别
  247. materialIndexUnit?: string; // 工料指标单位
  248. materialIndexCoe?: number; // 单位转换系数
  249. taxRate?: string; // 税率
  250. }
  251. // 人材机组成物
  252. export interface ILibComponent {
  253. ID: number | string; // 可为补充、标准
  254. consumeAmt: number;
  255. consumeAmtProperty?: any; // 多消耗量的情况
  256. }
  257. // 标准人材机(原始数据)
  258. export interface IRawStdGlj extends IBaseRationGlj {
  259. ID: number;
  260. repositoryId: number;
  261. gljClass: number;
  262. gljType: number;
  263. component: ILibComponent[];
  264. }
  265. // 标准人材机
  266. export interface IStdGlj extends IBaseRationGlj {
  267. ID: number;
  268. repositoryID: number;
  269. type: number;
  270. gljClass: number;
  271. components: ILibComponent[];
  272. from: FromType;
  273. }
  274. // 标准人材机分类树(原始数据)
  275. export interface IRawStdGljTree {
  276. ID: number;
  277. ParentID: number;
  278. NextSiblingID: number;
  279. repositoryId: number;
  280. Name: string;
  281. }
  282. // 标准人材机分类树
  283. export interface IStdGljTree extends ITreeScm {
  284. repositoryID: number;
  285. name: string;
  286. from: FromType;
  287. }
  288. /* 标准人材机相关 ↑ */
  289. /* 补充人材机相关 ↓ */
  290. // 补充人材机分类树-模板(后台设置)
  291. export interface IRawCptGljTreeTemplate {
  292. compilationId: string;
  293. Name: string;
  294. ID: number;
  295. ParentID: number;
  296. NextSiblingID: number;
  297. }
  298. // 补充人材机分类树
  299. export interface ICptGljTree extends ITreeScm {
  300. name: string;
  301. from: FromType;
  302. }
  303. // 补充人材机分类树容器
  304. export interface ICptGljTreeData {
  305. compilationID: string;
  306. ownerID: string; // 企业或用户
  307. treeData: ICptGljTree[];
  308. }
  309. // 补充人材机组成物
  310. export interface ICptComponent extends ILibComponent {
  311. from: FromType;
  312. }
  313. // 补充人材机组成物的组合数据(增加一些字段用于显示)
  314. export interface ICptDisplayComponent extends ICptComponent {
  315. code: string;
  316. name: string;
  317. unit: string;
  318. basePrice: number;
  319. }
  320. // 补充人材机
  321. export interface ICptGlj extends IBaseRationGlj {
  322. ID: string;
  323. ownerID: string;
  324. type: number;
  325. gljClass: string;
  326. compilationID: string;
  327. components: ICptComponent[];
  328. displayComponents?: ICptDisplayComponent[];
  329. from: FromType;
  330. }
  331. // 新增补充人材机接口传输的数据接口
  332. export interface IInsertCptGlj {
  333. ID: string;
  334. gljClass: string;
  335. code: string;
  336. name: string;
  337. unit: string;
  338. specs?: string;
  339. type: number;
  340. basePrice: number;
  341. model?: number;
  342. }
  343. // 准备组成物返回数据接口
  344. export interface IPrepareComponentResult {
  345. displayComponents: ICptDisplayComponent[];
  346. allowComponent: boolean;
  347. }
  348. // 补充人材机
  349. /* 补充人材机相关 ↑ */
  350. /* 选择人材机相关 ↓ */
  351. // 库下拉项
  352. export interface ISelectGljLibItem {
  353. name: string;
  354. repositoryID: number | string;
  355. key: string; // 与gljLibID拼接的形成的唯一值
  356. isPrior: boolean; // 优先的
  357. from: FromType;
  358. located?: boolean; // 定位到的库(替换时需要)
  359. }
  360. export interface IAddComponentOption {
  361. type: GljType;
  362. gljID?: number | string;
  363. }
  364. // 获取人材机分页数据接口选项
  365. export interface IGetPagingGljOptions {
  366. classList?: (number | string)[]; // 需要匹配的分类
  367. typeList?: GljType[]; // 需要匹配的人材机类型
  368. libID?: number | string; // 人材机库ID
  369. replaceGlj?: IBaseGlj; // 替换的人材机
  370. addComponent?: IAddComponentOption; // 添加组成物时的参数
  371. located?: boolean; // 是否需要定位(打开替换窗口时)
  372. limit?: number; // 分页数量
  373. gtCode?: string; // 分页排序$gt code
  374. search?: string; // 搜索的内容(匹配编号、名称)
  375. }
  376. // 选择人材机接口返回数据格式
  377. export interface ISelectGljResult {
  378. libData: ISelectGljLibItem[]; // 库下拉项
  379. treeData: (IStdGljTree | ICptGljTree)[]; // 人材机分类树
  380. gljData: (IStdGlj | ICptGlj)[]; // 人材机数据
  381. total: number; // 当前数据总数量
  382. locatedGlj?: IStdGlj | ICptGlj; // 需要定位到的人材机
  383. }
  384. /* 选择人材机相关 ↑ */
  385. // 补充定额库中,需要显示用的补充定额人材机
  386. export interface ICptDisplayRationGlj {
  387. ID: string | number; // 人材机ID(标准为number,补充为string)
  388. code: string;
  389. name: string;
  390. unit: string;
  391. specs?: string;
  392. basePrice: number;
  393. consumeAmt: number;
  394. from: FromType;
  395. type: GljType;
  396. }
  397. // 重算补充定额价格需要的人材机类型
  398. export interface IGljForCalcRationPrice {
  399. basePrice: number;
  400. consumeAmt: number;
  401. type: GljType;
  402. [props: string]: any;
  403. }
  404. // 价格变更人材机
  405. export interface IPriceChangeGlj {
  406. ID: string;
  407. basePrice: number;
  408. }
  409. // 添加组成物filter类型
  410. export interface IAddComponentFilter {
  411. projectGljID: string;
  412. libGljs: (IStdGlj | ICptGlj)[];
  413. }