glj.ts 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326
  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. export interface IProjectGlj {
  140. ID: string;
  141. gljID: string; // 工料机ID
  142. code: string; // 编码
  143. originalCode: string; // 原始的编码
  144. name: string; // 名称
  145. supply: supplyType; // 供货方式
  146. supplyQuantity?: number; // 甲供数量
  147. delivery?: string; // 交货方式
  148. deliveryAddress?: string; // 送达地点
  149. noAdjustPrice: boolean; // 不调价 { type: boolean; default: false }
  150. noTaxEqp?: boolean; // 不计税设备 { type: boolean; default: false }
  151. adjCoe?: number; // 调整系数ID
  152. specs: string; // 规格型号
  153. type: GljType; // 类型
  154. model?: number; // 机型
  155. unit: string; // 单位
  156. isAdd: boolean; // 是否新增
  157. basePrice: number; // 基价单价
  158. marketPrice: number; // 市场单价
  159. components?: IComponent[]; // 组成物
  160. taxRate?: number; // 税率
  161. adjustPrice?: string; // 显示调整基价
  162. quantity?: number; // 显示关联的消耗量
  163. tenderQuantity?: number; // 调整后消耗量
  164. techQuantity?: number; // 技术措施项目消耗量
  165. subdivisionQuantity?: number; // 分部分项消耗量
  166. materialType?: MaterialType; // 三材类别
  167. materialCoe?: number; // 三材系数
  168. materialQuantity?: number; // 三材量
  169. // 经济指标数据
  170. materialIndexType?: string; // 工料指标类别
  171. materialIndexUnit?: string; // 工料指标单位
  172. materialIndexCoe: number; // 单位转换系数
  173. isMainMaterial: boolean; // 是否主要材料 (0为否 1为是) { type: boolean; default: false };
  174. remark?: string; // 备注
  175. originPlace?: string; // 产地
  176. vender?: string; // 厂家
  177. qualityGrade?: string; // 质量等级
  178. brand?: string; // 品牌
  179. priceFrom?: string; // 价格来源
  180. from: FromType; // std, cpt 来自标准工料机库、补充工料机库
  181. }
  182. export interface IProjectGljs {
  183. projectID: string;
  184. projectGljs: IProjectGlj[];
  185. }
  186. /* 标准人材机相关 ↓ */
  187. // 标准、补充人材机共用属性(原始数据)
  188. export interface IBaseRationGlj {
  189. code: string;
  190. name: string;
  191. specs?: string;
  192. basePrice: number;
  193. priceProperty: any; // 多单价的情况
  194. gljClass: number;
  195. model: number; // 机型
  196. shortName: string;
  197. unit: string;
  198. adjCoe: number;
  199. materialType: MaterialType; // 三材类别
  200. materialCoe: number; // 三材系数
  201. // 经济指标数据
  202. materialIndexType: string; // 工料指标类别
  203. materialIndexUnit: string; // 工料指标单位
  204. materialIndexCoe: number; // 单位转换系数
  205. taxRate: string; // 税率
  206. }
  207. // 标准人材机组成物
  208. export interface IStdComponent {
  209. ID: number;
  210. consumeAmt: number;
  211. consumeAmtProperty: any; // 多消耗量的情况
  212. }
  213. // 标准人材机(原始数据)
  214. export interface IRawStdGlj extends IBaseRationGlj {
  215. ID: number;
  216. repositoryId: number;
  217. gljType: number;
  218. component: IStdComponent[];
  219. }
  220. // 标准人材机
  221. export interface IStdGlj extends IBaseRationGlj {
  222. ID: number;
  223. repositoryID: number;
  224. type: number;
  225. components: IStdComponent[];
  226. from: FromType;
  227. }
  228. // 标准人材机分类树(原始数据)
  229. export interface IRawStdGljTree {
  230. ID: number;
  231. ParentID: number;
  232. NextSiblingID: number;
  233. repositoryId: number;
  234. Name: string;
  235. }
  236. // 标准人材机分类树
  237. export interface IStdGljTree extends ITreeScm {
  238. repositoryID: number;
  239. name: string;
  240. from: FromType;
  241. }
  242. /* 标准人材机相关 ↑ */
  243. /* 补充人材机相关 ↓ */
  244. // 补充人材机分类树
  245. export interface ICptGljTree extends ITreeScm {
  246. name: string;
  247. from: FromType;
  248. }
  249. // 补充人材机分类树容器
  250. export interface ICptGljTreeData {
  251. compilationID: string;
  252. ownerID: string; // 企业或用户
  253. treeData: ICptGljTree[];
  254. }
  255. // 补充人材机组成物
  256. export interface ICptComponent {
  257. ID: string; // 补充的ID改成了UUID ,标准的不变,但是这里
  258. consumeAmt: number;
  259. consumeAmtProperty: any; // 多消耗量的情况
  260. from: FromType;
  261. }
  262. // 补充人材机
  263. export interface ICptGlj extends IBaseRationGlj {
  264. ID: string;
  265. ownerID: string;
  266. type: number;
  267. compilationID: string;
  268. components: ICptComponent[];
  269. from: FromType;
  270. }
  271. /* 补充人材机相关 ↑ */
  272. /* 选择人材机相关 ↓ */
  273. // 库下拉项
  274. export interface ISelectGljLibItem {
  275. name: string;
  276. repositoryID: number | string;
  277. key: string; // 与gljLibID拼接的形成的唯一值
  278. isPrior: boolean; // 优先的
  279. from: FromType;
  280. located?: boolean; // 定位到的库(替换时需要)
  281. }
  282. // 获取人材机分页数据接口选项
  283. export interface IGetPagingGljOptions {
  284. classList?: number[]; // 需要匹配的分类
  285. typeList?: GljType[]; // 需要匹配的人材机类型
  286. libID?: number | string; // 人材机库ID
  287. replaceGlj?: IBaseGlj; // 替换的人材机
  288. located?: boolean; // 是否需要定位(打开替换窗口时)
  289. limit?: number; // 分页数量
  290. gtCode?: string; // 分页排序$gt code
  291. search?: string; // 搜索的内容(匹配编号、名称)
  292. }
  293. // 选择人材机接口返回数据格式
  294. export interface ISelectGljResult {
  295. libData: ISelectGljLibItem[]; // 库下拉项
  296. treeData: IStdGljTree[]; // 人材机分类树
  297. gljData: (IStdGlj | ICptGlj)[]; // 人材机数据
  298. total: number; // 当前数据总数量
  299. locatedGlj?: IStdGlj | ICptGlj; // 需要定位到的人材机
  300. }
  301. /* 选择人材机相关 ↑ */