ration.ts 10 KB

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