ration.ts 14 KB

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