ration.ts 11 KB

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