ration.ts 12 KB

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