ration.ts 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484
  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. from?: FromType; // 单条查找结果时用到
  182. }
  183. export interface IStdRation extends IBaseRation {
  184. ID: number;
  185. rationRepId: number;
  186. sectionId: number;
  187. rationGljList: IStdRationGljRef[];
  188. rationAssList?: IStdRationAss[];
  189. chapter?: IStdRationChapter;
  190. }
  191. export interface ICptRation extends IBaseRation {
  192. libID: string;
  193. compilationID: string;
  194. ID: string;
  195. sectionId: string;
  196. rationGljList: ICptRationGljRef[];
  197. rationAssList: ICptRationAss[];
  198. chapter?: ICptRationChapter;
  199. }
  200. // 保存到项目下的定额工料机
  201. export interface IRationGlj {
  202. ID: string;
  203. gljID?: string;
  204. repositoryID: number | string;
  205. name: string;
  206. code: string;
  207. originalCode: string; // 原始的编码 不带 “-”的
  208. beforeReplaceCode?: string; // 替换工料机后记录原来的工料机编码,要做判断 有可能带“-”
  209. specs?: string;
  210. unit: string;
  211. type: GljType;
  212. model?: number; // 机型
  213. adjCoe?: number; // 调整系数ID
  214. quantity: number;
  215. customQuantity?: number;
  216. rationQuantity?: number;
  217. tenderQuantity?: number; // 调整后消耗量
  218. createType: GljCreateType; // normal、add、replace 正常、添加工料机、替换工料机
  219. from: FromType; // std, cpt 来自标准工料机库、补充工料机库
  220. }
  221. export interface IGljQtyCoe {
  222. labour: number; // 人工
  223. material: number; // 材料
  224. machine: number; // 机械
  225. main: number; // 主材
  226. equipment: number; // 设备
  227. }
  228. // 实际保存到项目中的辅助定额数据
  229. export interface IRationAss extends IBaseRationAss {
  230. ID: string;
  231. actualValue?: number;
  232. isAdjust: boolean; // 是否调整
  233. groupList?: IRationAss[]; // 当有分组的时候用这个
  234. // 这里辅助定额直接保存工料机的数据,用的时候不用再获取
  235. rationGljList?: IRationGlj[]; // 定额工料机
  236. }
  237. export interface ITemplateItem {
  238. ID: string;
  239. code: string;
  240. name: string;
  241. type: string;
  242. defaultLocation: string; // 记录默认给定的清单编号,恢复原始数据时用(目前复制整块)
  243. billsLocation: string; // 这个是清单编号
  244. fxID: string; // 这个是分项对应的ID
  245. unit: string;
  246. quantity: number;
  247. coe?: number;
  248. billID?: string; // 记取位置对应的清单ID
  249. }
  250. export interface IRationTemplate {
  251. createLocation: CreateLocation; // 提取位置
  252. templateList: ITemplateItem[];
  253. }
  254. // 定额安装增加费
  255. export interface IRationInstall {
  256. ID: string;
  257. sectionID: string; // 分册章节id
  258. feeItemID: string;
  259. feeRuleID: string;
  260. itemName: string;
  261. sectionName: string;
  262. unifiedSetting: boolean; // 0:false 1:true 按统一设置
  263. }
  264. export interface IThirdRation {
  265. ration: IStdRation;
  266. rationGljList: IRationGlj[];
  267. }
  268. export interface IRation extends IBRBase {
  269. type?: GljType; // 子类型:1人工、201材料、301机械、4主材、5设备
  270. contain?: number; // 含量
  271. programID?: number;
  272. tenderQuantity?: string; // 调整后工程量
  273. noAdjustPrice?: boolean; // { type: boolean; default: false }; // 不调价
  274. // targetUnitPrice?: string; // 目标单价
  275. // targetTotalFee?: string; // 目标合价
  276. from?: FromType; // { type: string; default: 'std' }; // std, cpt 来自标准、补充
  277. isSubcontract?: boolean; // 是否分包
  278. installationKey?: string; // 用来记录安装增加费的关联字段
  279. sectionID?: number | string; // 章节ID用来定位
  280. maskName?: string;
  281. caption?: string;
  282. evaluationProject?: boolean; // { type: boolean; default: false }; // 1 true 0 false 估价项目
  283. adjustState?: string;
  284. comments?: string; // 说明
  285. content?: string; // 工作内容
  286. annotation?: string; // 附注
  287. ruleText?: string; // 计算规则
  288. prefix?: RationPrefix; // { type: string; default: '' }; // 定额是补充、借用时用 补 借
  289. referenceRationID?: string; // 如果是通过模板关联子目生成的定额,这里记录对应的主定额ID
  290. jobContentText?: string; // 工作内容 (选择自清单)
  291. manageFeeRate?: number; // 管理费率
  292. // 工料机特有属性
  293. // 工料机类型的定额或者特殊清单会用到市场价和调后价
  294. marketPrice?: number;
  295. tenderPrice?: number;
  296. marketTotalFee?: number; // 综合合价
  297. gljID?: string; // 工料机在库中ID
  298. originalCode?: string; // 原始编码
  299. specs?: string; // 规格型号
  300. customQuantity?: string; // 自定义消耗
  301. model?: number; // 机型
  302. adjCoe?: number;
  303. remark?: string; // 备注
  304. overHeight?: string; // 超高降效
  305. referenceRationList?: any; // { type: Array; default: [] }; // 关联的定额ID列表,如超高子目关联的定额ID列表
  306. // 定额子项
  307. rationGljList?: IRationGlj[]; // 定额工料机
  308. rationAssList?: IRationAss[]; // 辅助定额
  309. thirdRation?: IThirdRation; // 第三定额
  310. quantityDetails?: IQuantityDetail[]; // 工程量明细 -- 原先保存在另外的表中
  311. rationCoeList?: IRationCoe[]; // 定额调整系数
  312. rationTemplate?: IRationTemplate; // 定额模板
  313. rationInstallList?: IRationInstall[]; // 定额安装增加
  314. }
  315. export interface IRations {
  316. projectID: string;
  317. index: number;
  318. rations: IRation[];
  319. }
  320. export interface ILibRationsAndGljsResult {
  321. total: number;
  322. rations: (IStdRation | ICptRation)[];
  323. rationGljs: (IStdGlj | ICptGlj)[];
  324. }
  325. // 补充定额章节树-模板(后台设置)
  326. export interface ICptRationTreeTemplate {
  327. compilationId: string;
  328. name: string;
  329. ID: number;
  330. ParentID: number;
  331. NextSiblingID: number;
  332. }
  333. // 补充定额章节树
  334. export interface ICptRationTree extends ITreeScm {
  335. name: string;
  336. // 以下预留数据,以后开放可用
  337. explanation?: string; // 说明
  338. ruleText?: string; // 计算规则,
  339. jobContentSituation?: string; // 工作内容适用情况,ALL适用本项全部定额,PARTIAL适用本项部分定额
  340. annotationSituation?: string; // 附注适用情况,ALL适用本项全部定额,PARTIAL适用本项部分定额
  341. }
  342. // 补充定额章节树容器
  343. export interface ICptRationTreeData {
  344. libID: string;
  345. ID: string;
  346. compilationID: string;
  347. treeData: ICptRationTree[];
  348. }
  349. // 新增补充定额接口传输的数据接口
  350. export interface IInsertCptRation {
  351. ID: string;
  352. sectionId: string;
  353. code: string;
  354. name?: string;
  355. unit?: string;
  356. caption?: string;
  357. feeType?: number;
  358. labourPrice: number;
  359. materialPrice: number;
  360. machinePrice: number;
  361. basePrice: number;
  362. }
  363. // 更新补充定额人材机的请求数据
  364. export interface IUpdateCptRationGlj {
  365. ID?: string | number; // 人材机ID
  366. code?: string;
  367. consumeAmt?: number;
  368. from?: FromType;
  369. }
  370. // 更新补充定额人材机的返回更新数据
  371. export interface IUpdateCptRationGljResult {
  372. labourPrice: number;
  373. materialPrice: number;
  374. machinePrice: number;
  375. basePrice: number;
  376. rationGljList: ICptRationGljRef[];
  377. displayRationGljList: ICptDisplayRationGlj[];
  378. }
  379. // 新增补充子目换算接口传输的数据接口
  380. export interface IInsertCptCoe {
  381. ID: string;
  382. name?: string;
  383. content?: string;
  384. }
  385. // 新增补充定额子目换算调整数据接口
  386. export interface IInsertCptRationCoe {
  387. serialNo: number; // 编号
  388. no: number; // 排序
  389. }
  390. export interface ICptDisplayRationCoe {
  391. ID: string;
  392. serialNo: number; // 编号
  393. no: number; // 排序
  394. name?: string;
  395. content?: string;
  396. }
  397. // 定额下挂的几个子项属性
  398. export enum RationSubProp {
  399. GLJ = 'rationGljList', // 定额工料机
  400. COE = 'rationCoeList', // 定额子目换算
  401. ASS = 'rationAssList', // 辅助定额
  402. INS = 'rationInstallList', // 定额安装增加费
  403. TPL = 'rationTemplate', // 定额子目模板
  404. }
  405. // 补充定额库选项
  406. export interface ICptRationLibOption {
  407. ID: string;
  408. name: string;
  409. readOnly: boolean;
  410. enterpriseID?: string; // 库来自企业的ID(企业分享会有)
  411. enterpriseName?: string; // 库来自企业的名称(企业分享会有)
  412. }
  413. // 进入定额库需要准备的数据(一些状态)
  414. export interface IPrepareCptRationLib {
  415. // 定额库分享人数
  416. shareCount: number;
  417. // 库下拉选项
  418. libOptions: ICptRationLibOption[];
  419. }
  420. // 补充定额库
  421. export interface ICptRationLib {
  422. ID: string;
  423. // 库名称,预留字段,以后可能允许自行新建补充库
  424. name?: string;
  425. // 费用定额ID
  426. compilationID: string;
  427. // 企业ID,可为空字符串
  428. enterpriseID: string;
  429. // 用户ID
  430. userID: string;
  431. // 是否为企业内部库
  432. isEnterpriseInternal: boolean;
  433. createDate: number;
  434. }
  435. // 定额库下拉项
  436. export interface ISelectRationLibItem extends IFileRef {
  437. enterpriseID?: string; // 库来自企业的ID(企业分享会有)
  438. enterpriseName?: string; // 库来自企业的名称(企业分享会有)
  439. }