glj.ts 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376
  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 interface IBaseGlj {
  41. code: string;
  42. name: string;
  43. specs?: string;
  44. type: GljType;
  45. unit: string;
  46. [key: string]: any;
  47. }
  48. export interface IGljTypeShortName {
  49. [type: number]: string;
  50. }
  51. // 人材机类型简称
  52. export const GljTypeShortName: IGljTypeShortName = {
  53. 1: '人',
  54. 201: '材',
  55. 202: '砼',
  56. 203: '浆',
  57. 204: '配比',
  58. 205: '商砼',
  59. 206: '商浆',
  60. 207: '材',
  61. 208: '外购',
  62. 209: '苗木',
  63. 301: '机',
  64. 302: '机',
  65. 303: '机人',
  66. 304: '仪',
  67. 305: '动',
  68. 306: '折',
  69. 307: '检',
  70. 308: '维',
  71. 309: '安',
  72. 310: '校',
  73. 311: '机',
  74. 312: '机',
  75. 4: '主',
  76. 5: '设',
  77. 6: '管',
  78. 7: '利',
  79. 8: '险',
  80. };
  81. // 人材机类型全称
  82. export const GljTypeFullName: Record<number, string> = {
  83. 1: '人工',
  84. 201: '普通材料',
  85. 202: '混凝土',
  86. 203: '砂浆',
  87. 204: '配合比',
  88. 205: '商品混凝土',
  89. 206: '商品砂浆',
  90. 207: '其他材料费',
  91. 208: '外购砼构件',
  92. 209: '绿化苗木',
  93. 301: '机械台班',
  94. 302: '机械组成物',
  95. 303: '机上人工',
  96. 304: '仪器仪表',
  97. 305: '燃料动力费',
  98. 306: '折旧费',
  99. 307: '检修费',
  100. 308: '维护费',
  101. 309: '安拆费及场外运费',
  102. 310: '校验费',
  103. 311: '其他费用',
  104. 312: '其他施工机具使用费',
  105. 4: '主材',
  106. 5: '设备',
  107. 6: '企业管理费',
  108. 7: '利润',
  109. 8: '一般风险费',
  110. };
  111. export interface IComponent {
  112. ID: string;
  113. consumption: number; // 消耗量(有别于总消耗,此字段记录配合比的消耗量)
  114. gljID: string; // 工料机总库对应id (关联用)
  115. specs?: string; // 规格型号
  116. unit: string; // 单位
  117. name: string; // 名称
  118. code: string; // 对应工料机code
  119. type: GljType; // 工料机类型
  120. model?: number; // 机型
  121. from: FromType; // std, cpt 来自标准工料机库、补充工料机库
  122. }
  123. export enum MaterialType {
  124. GC = 1,
  125. GJ = 2,
  126. MC = 3,
  127. SN = 4,
  128. SPT = 5,
  129. SPSJ = 6,
  130. }
  131. export const MaterialDisplay = {
  132. 1: '钢材',
  133. 2: '钢筋',
  134. 3: '木材',
  135. 4: '水泥',
  136. 5: '商品砼',
  137. 6: '商品砂浆',
  138. };
  139. // 机型
  140. export enum GljModel {
  141. EXTRA_LARGE = 1,
  142. LARGE,
  143. MEDIUM,
  144. SMALL,
  145. }
  146. // 机型名称映射
  147. export const GljModelName = {
  148. 1: '特大',
  149. 2: '大',
  150. 3: '中',
  151. 4: '小',
  152. };
  153. export interface IProjectGlj {
  154. ID: string;
  155. gljID: string; // 工料机ID
  156. code: string; // 编码
  157. originalCode: string; // 原始的编码
  158. name: string; // 名称
  159. supply: SupplyType; // 供货方式
  160. supplyQuantity?: number; // 甲供数量
  161. delivery?: string; // 交货方式
  162. deliveryAddress?: string; // 送达地点
  163. noAdjustPrice: boolean; // 不调价 { type: boolean; default: false }
  164. noTaxEqp?: boolean; // 不计税设备 { type: boolean; default: false }
  165. adjCoe?: number; // 调整系数ID
  166. specs: string; // 规格型号
  167. type: GljType; // 类型
  168. model?: number; // 机型
  169. unit: string; // 单位
  170. isAdd: boolean; // 是否新增
  171. basePrice: number; // 基价单价
  172. marketPrice: number; // 市场单价
  173. components?: IComponent[]; // 组成物
  174. taxRate?: number; // 税率
  175. adjustPrice?: string; // 显示调整基价
  176. quantity?: number; // 显示关联的消耗量
  177. tenderQuantity?: number; // 调整后消耗量
  178. techQuantity?: number; // 技术措施项目消耗量
  179. subdivisionQuantity?: number; // 分部分项消耗量
  180. materialType?: MaterialType; // 三材类别
  181. materialCoe?: number; // 三材系数
  182. materialQuantity?: number; // 三材量
  183. // 经济指标数据
  184. materialIndexType?: string; // 工料指标类别
  185. materialIndexUnit?: string; // 工料指标单位
  186. materialIndexCoe: number; // 单位转换系数
  187. isMainMaterial: boolean; // 是否主要材料 (0为否 1为是) { type: boolean; default: false };
  188. remark?: string; // 备注
  189. originPlace?: string; // 产地
  190. vender?: string; // 厂家
  191. qualityGrade?: string; // 质量等级
  192. brand?: string; // 品牌
  193. priceFrom?: string; // 价格来源
  194. from: FromType; // std, cpt 来自标准工料机库、补充工料机库
  195. }
  196. export interface IProjectGljs {
  197. projectID: string;
  198. projectGljs: IProjectGlj[];
  199. }
  200. /* 标准人材机相关 ↓ */
  201. // 标准、补充人材机共用属性(原始数据)
  202. export interface IBaseRationGlj {
  203. code: string;
  204. name: string;
  205. specs?: string;
  206. basePrice: number;
  207. priceProperty?: any; // 多单价的情况
  208. model?: number; // 机型
  209. shortName: string;
  210. unit: string;
  211. adjCoe?: number;
  212. materialType?: MaterialType; // 三材类别
  213. materialCoe?: number; // 三材系数
  214. // 经济指标数据
  215. materialIndexType?: string; // 工料指标类别
  216. materialIndexUnit?: string; // 工料指标单位
  217. materialIndexCoe?: number; // 单位转换系数
  218. taxRate?: string; // 税率
  219. }
  220. // 标准人材机组成物
  221. export interface IStdComponent {
  222. ID: number;
  223. consumeAmt: number;
  224. consumeAmtProperty: any; // 多消耗量的情况
  225. }
  226. // 标准人材机(原始数据)
  227. export interface IRawStdGlj extends IBaseRationGlj {
  228. ID: number;
  229. repositoryId: number;
  230. gljClass: number;
  231. gljType: number;
  232. component: IStdComponent[];
  233. }
  234. // 标准人材机
  235. export interface IStdGlj extends IBaseRationGlj {
  236. ID: number;
  237. repositoryID: number;
  238. type: number;
  239. gljClass: number;
  240. components: IStdComponent[];
  241. from: FromType;
  242. }
  243. // 标准人材机分类树(原始数据)
  244. export interface IRawStdGljTree {
  245. ID: number;
  246. ParentID: number;
  247. NextSiblingID: number;
  248. repositoryId: number;
  249. Name: string;
  250. }
  251. // 标准人材机分类树
  252. export interface IStdGljTree extends ITreeScm {
  253. repositoryID: number;
  254. name: string;
  255. from: FromType;
  256. }
  257. /* 标准人材机相关 ↑ */
  258. /* 补充人材机相关 ↓ */
  259. // 补充人材机分类树-模板(后台设置)
  260. export interface IRawCptGljTreeTemplate {
  261. compilationId: string;
  262. Name: string;
  263. ID: number;
  264. ParentID: number;
  265. NextSiblingID: number;
  266. }
  267. // 补充人材机分类树
  268. export interface ICptGljTree extends ITreeScm {
  269. name: string;
  270. from: FromType;
  271. }
  272. // 补充人材机分类树容器
  273. export interface ICptGljTreeData {
  274. compilationID: string;
  275. ownerID: string; // 企业或用户
  276. treeData: ICptGljTree[];
  277. }
  278. // 补充人材机组成物
  279. export interface ICptComponent {
  280. ID: number | string; // 可为补充、标准
  281. consumeAmt: number;
  282. consumeAmtProperty?: any; // 多消耗量的情况
  283. from: FromType;
  284. }
  285. // 补充人材机组成物的组合数据(增加一些字段用于显示)
  286. export interface ICptDisplayComponent extends ICptComponent {
  287. code: string;
  288. name: string;
  289. unit: string;
  290. basePrice: number;
  291. }
  292. // 补充人材机
  293. export interface ICptGlj extends IBaseRationGlj {
  294. ID: string;
  295. ownerID: string;
  296. type: number;
  297. gljClass: string;
  298. compilationID: string;
  299. components: ICptComponent[];
  300. displayComponents?: ICptDisplayComponent[];
  301. from: FromType;
  302. }
  303. // 新增补充人材机接口传输的数据接口
  304. export interface IInsertCptGlj {
  305. ID: string;
  306. gljClass: string;
  307. code: string;
  308. name: string;
  309. unit: string;
  310. specs?: string;
  311. type: number;
  312. basePrice: number;
  313. model?: number;
  314. }
  315. // 补充人材机
  316. /* 补充人材机相关 ↑ */
  317. /* 选择人材机相关 ↓ */
  318. // 库下拉项
  319. export interface ISelectGljLibItem {
  320. name: string;
  321. repositoryID: number | string;
  322. key: string; // 与gljLibID拼接的形成的唯一值
  323. isPrior: boolean; // 优先的
  324. from: FromType;
  325. located?: boolean; // 定位到的库(替换时需要)
  326. }
  327. // 获取人材机分页数据接口选项
  328. export interface IGetPagingGljOptions {
  329. classList?: number[]; // 需要匹配的分类
  330. typeList?: GljType[]; // 需要匹配的人材机类型
  331. libID?: number | string; // 人材机库ID
  332. replaceGlj?: IBaseGlj; // 替换的人材机
  333. located?: boolean; // 是否需要定位(打开替换窗口时)
  334. limit?: number; // 分页数量
  335. gtCode?: string; // 分页排序$gt code
  336. search?: string; // 搜索的内容(匹配编号、名称)
  337. }
  338. // 选择人材机接口返回数据格式
  339. export interface ISelectGljResult {
  340. libData: ISelectGljLibItem[]; // 库下拉项
  341. treeData: IStdGljTree[]; // 人材机分类树
  342. gljData: (IStdGlj | ICptGlj)[]; // 人材机数据
  343. total: number; // 当前数据总数量
  344. locatedGlj?: IStdGlj | ICptGlj; // 需要定位到的人材机
  345. }
  346. /* 选择人材机相关 ↑ */