ration.ts 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439
  1. /* eslint-disable camelcase */
  2. import {
  3. RationPrefix,
  4. FromType,
  5. GljCreateType,
  6. CreateLocation,
  7. BRType,
  8. IBRBase,
  9. ITreeScm,
  10. } from './base';
  11. import { IBookmark } from './bill';
  12. import {
  13. GljType,
  14. ICptDisplayRationGlj,
  15. ICptGlj,
  16. IStdGlj,
  17. MaterialType,
  18. } from './glj';
  19. import { IQuantityDetail } from './quantityDetail';
  20. // 标准定额库
  21. export interface IStdRationLib {
  22. dispName: string;
  23. compilationId: string;
  24. compilationName: string;
  25. gljLib: number;
  26. ID: number;
  27. }
  28. export interface IStdRationChapter {
  29. rationRepId: number; // 标准库的属性
  30. ID: string; // 补充库的直接用新结构,所以有两种类型
  31. parentID: string;
  32. seq: number;
  33. name: string;
  34. explanation?: string; // 说明
  35. ruleText?: string; // 计算规则,
  36. jobContentSituation?: string; // 工作内容适用情况,ALL适用本项全部定额,PARTIAL适用本项部分定额
  37. annotationSituation?: string; // 附注适用情况,ALL适用本项全部定额,PARTIAL适用本项部分定额
  38. }
  39. export interface ICptRationChapter {
  40. name: string;
  41. ID: string;
  42. seq: number;
  43. parentID: string;
  44. // 以下预留数据,以后开放可用
  45. explanation?: string; // 说明
  46. ruleText?: string; // 计算规则,
  47. jobContentSituation?: string; // 工作内容适用情况,ALL适用本项全部定额,PARTIAL适用本项部分定额
  48. annotationSituation?: string; // 附注适用情况,ALL适用本项全部定额,PARTIAL适用本项部分定额
  49. }
  50. export interface IBaseRationGljRef {
  51. consumeAmt: number;
  52. proportion?: number; // 配合比,暂时无需使用,默认0
  53. from?: FromType; // 可能有数据没有
  54. }
  55. export interface IStdRationGljRef extends IBaseRationGljRef {
  56. gljId: number; // 原std库已经是这样,不能改成ID
  57. }
  58. export interface ICptRationGljRef extends IBaseRationGljRef {
  59. gljId: string | number; // 原std库已经是这样,不能改成ID
  60. }
  61. // 基准辅助定额
  62. export interface IBaseRationAss {
  63. name: string; // 调整名称
  64. assistCode: string; // 辅助定额号
  65. stdValue: string; // 标准值
  66. stepValue: string; // 步距
  67. decimal: number; // 精度
  68. carryBit: string; // 进位方式
  69. minValue?: string; // 最小值
  70. maxValue?: string; // 最大值
  71. paramName?: string; // 参数名称
  72. param?: string; // 参数
  73. thirdRationCode?: string; // 第三定额
  74. }
  75. // 标准定额辅助
  76. export type IStdRationAss = IBaseRationAss;
  77. // 补充定额辅助
  78. export interface ICptRationAss extends IBaseRationAss {
  79. ID: string; // 方便录入补充数据
  80. }
  81. export interface IStdRationInstall {
  82. feeItemId: string; // 原std库已经是这样,不能改成ID
  83. sectionId: string; // 原std库已经是这样,不能改成ID
  84. }
  85. export interface IStdRationTemp {
  86. rationID: number;
  87. type: string;
  88. billsLocation: string;
  89. }
  90. export interface ILibRationCondition {
  91. keyword: string;
  92. rationRepIds: (number | string)[];
  93. from: FromType;
  94. lastCode?: string; // 最后一行的定额编号
  95. }
  96. export interface ICoeList {
  97. ID: number | string;
  98. no: number;
  99. }
  100. export enum CoeType {
  101. RATION = '定额',
  102. LABOUR = '人工',
  103. MATERIAL = '材料',
  104. MACHINE = '机械',
  105. TOOL = '施工机具',
  106. MAIN = '主材',
  107. EQUIPMENT = '设备',
  108. SINGLE = '单个工料机',
  109. REPLACE = '替换人材机',
  110. SELECT = '所选人材机',
  111. }
  112. export interface IBaseCoe {
  113. coeType: CoeType; // 系数类型,指作用范围:
  114. // 单个(如:111量0.001)、人工类、材料类、机械类、全部(如:定额×0.925)。
  115. operator: string; // 运算符(*、+、-、=)
  116. amount: string; // 调整的量
  117. gljCode: string;
  118. gljName?: string;
  119. replaceCode?: string;
  120. replaceName?: string;
  121. }
  122. export type IStdCoe = IBaseCoe;
  123. export interface ICptCoe extends IBaseCoe {
  124. ID: string;
  125. }
  126. export interface IBaseCoeItem {
  127. ID: number | string;
  128. serialNo?: number; // 编号
  129. name: string; // 名称
  130. content?: string; // 说明
  131. coes: IBaseCoe[];
  132. }
  133. export interface IOptionList {
  134. text: string;
  135. value: string;
  136. }
  137. export interface ICptCoeItem extends IBaseCoeItem {
  138. ID: string;
  139. ownerID: string;
  140. compilationID: string;
  141. coes: ICptCoe[];
  142. }
  143. export interface IStdCoeItem extends IBaseCoeItem {
  144. ID: number;
  145. libID: number; // 所属定额定ID
  146. original_code?: string; // 原人材机编码
  147. option_codes?: string; // 可选人材机编码
  148. option_list?: IOptionList[]; // 下拉列表选项
  149. coes: IStdCoe[];
  150. }
  151. export interface IRationCoe {
  152. ID: string;
  153. stdID?: number; // 库里的ID
  154. name: string;
  155. content?: string;
  156. originalCode?: string;
  157. optionList?: IOptionList[];
  158. optionCodes?: string; // 可选人材机编码
  159. selectCode?: string; // 选中的人材机编码
  160. isAdjust: boolean; // 默认 false
  161. coes: IStdCoe[];
  162. }
  163. export interface IBaseRation {
  164. code: string;
  165. name?: string;
  166. unit?: string;
  167. basePrice: number;
  168. labourPrice: number;
  169. materialPrice: number;
  170. machinePrice: number;
  171. caption?: string;
  172. feeType?: number;
  173. jobContent?: string;
  174. annotation?: string;
  175. manageFeeRate?: string; // 管理费费率
  176. rationCoeList?: ICoeList[];
  177. rationAssList?: IBaseRationAss[];
  178. rationInstList?: IStdRationInstall[];
  179. rationTemplateList?: IStdRationTemp[];
  180. from?: FromType; // 单条查找结果时用到
  181. }
  182. export interface IStdRation extends IBaseRation {
  183. ID: number;
  184. rationRepId: number;
  185. sectionId: number;
  186. rationGljList: IStdRationGljRef[];
  187. rationAssList?: IStdRationAss[];
  188. chapter?: IStdRationChapter;
  189. }
  190. export interface ICptRation extends IBaseRation {
  191. ownerID: string;
  192. compilationID: string;
  193. ID: string;
  194. sectionId: string;
  195. rationGljList: ICptRationGljRef[];
  196. rationAssList: ICptRationAss[];
  197. chapter?: ICptRationChapter;
  198. }
  199. // 保存到项目下的定额工料机
  200. export interface IRationGlj {
  201. ID: string;
  202. gljID?: string;
  203. repositoryID: number | string;
  204. name: string;
  205. code: string;
  206. originalCode: string; // 原始的编码 不带 “-”的
  207. beforeReplaceCode?: string; // 替换工料机后记录原来的工料机编码,要做判断 有可能带“-”
  208. specs?: string;
  209. unit: string;
  210. type: GljType;
  211. model?: number; // 机型
  212. adjCoe?: number; // 调整系数ID
  213. quantity: number;
  214. customQuantity?: number;
  215. rationQuantity?: number;
  216. tenderQuantity?: number; // 调整后消耗量
  217. createType: GljCreateType; // normal、add、replace 正常、添加工料机、替换工料机
  218. from: FromType; // std, cpt 来自标准工料机库、补充工料机库
  219. }
  220. export interface IGljQtyCoe {
  221. labour: number; // 人工
  222. material: number; // 材料
  223. machine: number; // 机械
  224. main: number; // 主材
  225. equipment: number; // 设备
  226. }
  227. // 实际保存到项目中的辅助定额数据
  228. export interface IRationAss extends IBaseRationAss {
  229. ID: string;
  230. actualValue?: number;
  231. isAdjust: boolean; // 是否调整
  232. groupList?: IRationAss[]; // 当有分组的时候用这个
  233. // 这里辅助定额直接保存工料机的数据,用的时候不用再获取
  234. rationGljList?: IRationGlj[]; // 定额工料机
  235. }
  236. export interface ITemplateItem {
  237. ID: string;
  238. code: string;
  239. name: string;
  240. type: string;
  241. defaultLocation: string; // 记录默认给定的清单编号,恢复原始数据时用(目前复制整块)
  242. billsLocation: string; // 这个是清单编号
  243. fxID: string; // 这个是分项对应的ID
  244. unit: string;
  245. quantity: number;
  246. coe: number;
  247. billID?: string; // 记取位置对应的清单ID
  248. }
  249. export interface IRationTemplate {
  250. createLocation: CreateLocation; // 提取位置
  251. templateList: ITemplateItem[];
  252. }
  253. // 定额安装增加费
  254. export interface IRationInstall {
  255. ID: string;
  256. sectionID: string; // 分册章节id
  257. feeItemID: string;
  258. ruleID: string;
  259. itemName: string;
  260. sectionName: string;
  261. unifiedSetting: boolean; // 0:false 1:true 按统一设置
  262. }
  263. export interface IThirdRation {
  264. ration: IStdRation;
  265. rationGljList: IRationGlj[];
  266. }
  267. export interface IRation extends IBRBase {
  268. type?: GljType; // 子类型:1人工、201材料、301机械、4主材、5设备
  269. contain?: number; // 含量
  270. programID?: number;
  271. tenderQuantity?: string; // 调整后工程量
  272. noAdjustPrice?: boolean; // { type: boolean; default: false }; // 不调价
  273. targetUnitPrice?: string; // 目标单价
  274. targetTotalFee?: string; // 目标合价
  275. from?: FromType; // { type: string; default: 'std' }; // std, cpt 来自标准、补充
  276. isSubcontract?: boolean; // 是否分包
  277. installationKey?: string; // 用来记录安装增加费的关联字段
  278. repositoryID?: number | string; // 定额库ID
  279. sectionID?: number | string; // 章节ID用来定位
  280. maskName?: string;
  281. caption?: string;
  282. evaluationProject?: boolean; // { type: boolean; default: false }; // 1 true 0 false 估价项目
  283. adjustState?: string;
  284. comments?: string; // 说明
  285. content?: string; // 工作内容
  286. annotation?: string; // 附注
  287. ruleText?: string; // 计算规则
  288. prefix?: RationPrefix; // { type: string; default: '' }; // 定额是补充、借用时用 补 借
  289. referenceRationID?: string; // 如果是通过模板关联子目生成的定额,这里记录对应的主定额ID
  290. jobContentText?: string; // 工作内容 (选择自清单)
  291. manageFeeRate?: string; // 管理费率
  292. // 是否记取面积增加费
  293. areaIncreaseFee?: boolean | null; // { type: Schema.Types.Mixed; default: false }; // true 是,false否,null 不确定,三个状态
  294. // 工料机特有属性
  295. gljID?: string; // 工料机在库中ID
  296. originalCode?: string; // 原始编码
  297. specs?: string; // 规格型号
  298. customQuantity?: string; // 自定义消耗
  299. model?: number; // 机型
  300. adjCoe?: number;
  301. remark?: string; // 备注
  302. overHeight?: string; // 超高降效
  303. referenceRationList?: any; // { type: Array; default: [] }; // 关联的定额ID列表,如超高子目关联的定额ID列表
  304. // 定额子项
  305. rationGljList?: IRationGlj[]; // 定额工料机
  306. rationAssList?: IRationAss[]; // 辅助定额
  307. thirdRation?: IThirdRation; // 第三定额
  308. quantityDetails?: IQuantityDetail[]; // 工程量明细 -- 原先保存在另外的表中
  309. rationCoeList?: IRationCoe[]; // 定额调整系数
  310. rationTemplate?: IRationTemplate; // 定额模板
  311. rationInstallList?: IRationInstall[]; // 定额安装增加
  312. }
  313. export interface IRations {
  314. projectID: string;
  315. index: number;
  316. rations: IRation[];
  317. }
  318. export interface ILibRationsAndGljsResult {
  319. total: number;
  320. rations: (IStdRation | ICptRation)[];
  321. rationGljs: (IStdGlj | ICptGlj)[];
  322. }
  323. export enum RationListType {
  324. ASS = 'rationAssList',
  325. COE = 'rationCoeList',
  326. GLJ = 'rationGljList',
  327. }
  328. // 补充定额章节树-模板(后台设置)
  329. export interface ICptRationTreeTemplate {
  330. compilationId: string;
  331. name: string;
  332. ID: number;
  333. ParentID: number;
  334. NextSiblingID: number;
  335. }
  336. // 补充定额章节树
  337. export interface ICptRationTree extends ITreeScm {
  338. name: string;
  339. // 以下预留数据,以后开放可用
  340. explanation?: string; // 说明
  341. ruleText?: string; // 计算规则,
  342. jobContentSituation?: string; // 工作内容适用情况,ALL适用本项全部定额,PARTIAL适用本项部分定额
  343. annotationSituation?: string; // 附注适用情况,ALL适用本项全部定额,PARTIAL适用本项部分定额
  344. }
  345. // 补充定额章节树容器
  346. export interface ICptRationTreeData {
  347. compilationID: string;
  348. ownerID: string; // 企业或用户
  349. treeData: ICptRationTree[];
  350. }
  351. // 新增补充定额接口传输的数据接口
  352. export interface IInsertCptRation {
  353. ID: string;
  354. sectionId: string;
  355. code: string;
  356. name?: string;
  357. unit?: string;
  358. caption?: string;
  359. feeType?: number;
  360. labourPrice: number;
  361. materialPrice: number;
  362. machinePrice: number;
  363. basePrice: number;
  364. }
  365. // 更新补充定额人材机的请求数据
  366. export interface IUpdateCptRationGlj {
  367. ID?: string | number; // 人材机ID
  368. code?: string;
  369. consumeAmt?: number;
  370. from?: FromType;
  371. }
  372. // 更新补充定额人材机的返回更新数据
  373. export interface IUpdateCptRationGljResult {
  374. labourPrice: number;
  375. materialPrice: number;
  376. machinePrice: number;
  377. basePrice: number;
  378. rationGljList: ICptRationGljRef[];
  379. displayRationGljList: ICptDisplayRationGlj[];
  380. }
  381. // 新增补充子目换算接口传输的数据接口
  382. export interface IInsertCptCoe {
  383. ID: string;
  384. name?: string;
  385. content?: string;
  386. }
  387. // 新增补充定额子目换算调整数据接口
  388. export interface IInsertCptRationCoe {
  389. serialNo: number; // 编号
  390. no: number; // 排序
  391. }
  392. export interface ICptDisplayRationCoe {
  393. ID: string;
  394. serialNo: number; // 编号
  395. no: number; // 排序
  396. name?: string;
  397. content?: string;
  398. }