ration.ts 14 KB

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