import { IReceivedShareLib } from './share'; /* eslint-disable camelcase */ import { RationPrefix, FromType, GljCreateType, CreateLocation, BRType, IBRBase, ITreeScm, } from './base'; import { IBookmark } from './bill'; import { GljType, ICptDisplayRationGlj, ICptGlj, IStdGlj, MaterialType, } from './glj'; import { IQuantityDetail } from './quantityDetail'; // 标准定额库 export interface IStdRationLib { dispName: string; compilationId: string; compilationName: string; gljLib: number; ID: number; } export interface IStdRationChapter { rationRepId: number; // 标准库的属性 ID: string; // 补充库的直接用新结构,所以有两种类型 parentID: string; seq: number; name: string; explanation?: string; // 说明 ruleText?: string; // 计算规则, jobContentSituation?: string; // 工作内容适用情况,ALL适用本项全部定额,PARTIAL适用本项部分定额 annotationSituation?: string; // 附注适用情况,ALL适用本项全部定额,PARTIAL适用本项部分定额 } export interface ICptRationChapter { name: string; ID: string; seq: number; parentID: string; // 以下预留数据,以后开放可用 explanation?: string; // 说明 ruleText?: string; // 计算规则, jobContentSituation?: string; // 工作内容适用情况,ALL适用本项全部定额,PARTIAL适用本项部分定额 annotationSituation?: string; // 附注适用情况,ALL适用本项全部定额,PARTIAL适用本项部分定额 } export interface IBaseRationGljRef { consumeAmt: number; proportion?: number; // 配合比,暂时无需使用,默认0 from?: FromType; // 可能有数据没有 } export interface IStdRationGljRef extends IBaseRationGljRef { gljId: number; // 原std库已经是这样,不能改成ID } export interface ICptRationGljRef extends IBaseRationGljRef { gljId: string | number; // 原std库已经是这样,不能改成ID } // 基准辅助定额 export interface IBaseRationAss { name: string; // 调整名称 assistCode: string; // 辅助定额号 stdValue: string; // 标准值 stepValue: string; // 步距 decimal: number; // 精度 carryBit: string; // 进位方式 minValue?: string; // 最小值 maxValue?: string; // 最大值 paramName?: string; // 参数名称 param?: string; // 参数 thirdRationCode?: string; // 第三定额 } // 标准定额辅助 export type IStdRationAss = IBaseRationAss; // 补充定额辅助 export interface ICptRationAss extends IBaseRationAss { ID: string; // 方便录入补充数据 } export interface IStdRationInstall { feeItemId: string; // 原std库已经是这样,不能改成ID sectionId: string; // 原std库已经是这样,不能改成ID } export interface IStdRationTemp { rationID: number; type: string; billsLocation: string; } export interface ILibRationCondition { keyword: string; rationRepIds: (number | string)[]; from: FromType; lastCode?: string; // 最后一行的定额编号 } export interface ICoeList { ID: number | string; no: number; } export enum CoeType { RATION = '定额', LABOUR = '人工', MATERIAL = '材料', MACHINE = '机械', TOOL = '施工机具', MAIN = '主材', EQUIPMENT = '设备', SINGLE = '单个工料机', REPLACE = '替换人材机', SELECT = '所选人材机', } export interface IBaseCoe { coeType: CoeType; // 系数类型,指作用范围: // 单个(如:111量0.001)、人工类、材料类、机械类、全部(如:定额×0.925)。 operator: string; // 运算符(*、+、-、=) amount: string; // 调整的量 gljCode: string; gljName?: string; replaceCode?: string; replaceName?: string; } export type IStdCoe = IBaseCoe; export interface ICptCoe extends IBaseCoe { ID: string; } export interface IBaseCoeItem { ID: number | string; serialNo?: number; // 编号 name: string; // 名称 content?: string; // 说明 coes: IBaseCoe[]; } export interface IOptionList { text: string; value: string; } export interface ICptCoeItem extends IBaseCoeItem { ID: string; ownerID: string; compilationID: string; coes: ICptCoe[]; } export interface IStdCoeItem extends IBaseCoeItem { ID: number; libID: number; // 所属定额定ID original_code?: string; // 原人材机编码 option_codes?: string; // 可选人材机编码 option_list?: IOptionList[]; // 下拉列表选项 coes: IStdCoe[]; } export interface IRationCoe { ID: string; stdID?: number; // 库里的ID name: string; content?: string; originalCode?: string; optionList?: IOptionList[]; optionCodes?: string; // 可选人材机编码 selectCode?: string; // 选中的人材机编码 isAdjust: boolean; // 默认 false coes: IStdCoe[]; } export interface IBaseRation { code: string; name?: string; unit?: string; basePrice: number; labourPrice: number; materialPrice: number; machinePrice: number; caption?: string; feeType?: number; jobContent?: string; annotation?: string; manageFeeRate?: string; // 管理费费率 rationCoeList?: ICoeList[]; rationAssList?: IBaseRationAss[]; rationInstList?: IStdRationInstall[]; rationTemplateList?: IStdRationTemp[]; from?: FromType; // 单条查找结果时用到 } export interface IStdRation extends IBaseRation { ID: number; rationRepId: number; sectionId: number; rationGljList: IStdRationGljRef[]; rationAssList?: IStdRationAss[]; chapter?: IStdRationChapter; } export interface ICptRation extends IBaseRation { ownerID: string; compilationID: string; ID: string; sectionId: string; rationGljList: ICptRationGljRef[]; rationAssList: ICptRationAss[]; chapter?: ICptRationChapter; } // 保存到项目下的定额工料机 export interface IRationGlj { ID: string; gljID?: string; repositoryID: number | string; name: string; code: string; originalCode: string; // 原始的编码 不带 “-”的 beforeReplaceCode?: string; // 替换工料机后记录原来的工料机编码,要做判断 有可能带“-” specs?: string; unit: string; type: GljType; model?: number; // 机型 adjCoe?: number; // 调整系数ID quantity: number; customQuantity?: number; rationQuantity?: number; tenderQuantity?: number; // 调整后消耗量 createType: GljCreateType; // normal、add、replace 正常、添加工料机、替换工料机 from: FromType; // std, cpt 来自标准工料机库、补充工料机库 } export interface IGljQtyCoe { labour: number; // 人工 material: number; // 材料 machine: number; // 机械 main: number; // 主材 equipment: number; // 设备 } // 实际保存到项目中的辅助定额数据 export interface IRationAss extends IBaseRationAss { ID: string; actualValue?: number; isAdjust: boolean; // 是否调整 groupList?: IRationAss[]; // 当有分组的时候用这个 // 这里辅助定额直接保存工料机的数据,用的时候不用再获取 rationGljList?: IRationGlj[]; // 定额工料机 } export interface ITemplateItem { ID: string; code: string; name: string; type: string; defaultLocation: string; // 记录默认给定的清单编号,恢复原始数据时用(目前复制整块) billsLocation: string; // 这个是清单编号 fxID: string; // 这个是分项对应的ID unit: string; quantity: number; coe: number; billID?: string; // 记取位置对应的清单ID } export interface IRationTemplate { createLocation: CreateLocation; // 提取位置 templateList: ITemplateItem[]; } // 定额安装增加费 export interface IRationInstall { ID: string; sectionID: string; // 分册章节id feeItemID: string; feeRuleID: string; itemName: string; sectionName: string; unifiedSetting: boolean; // 0:false 1:true 按统一设置 } export interface IThirdRation { ration: IStdRation; rationGljList: IRationGlj[]; } export interface IRation extends IBRBase { type?: GljType; // 子类型:1人工、201材料、301机械、4主材、5设备 contain?: number; // 含量 programID?: number; tenderQuantity?: string; // 调整后工程量 noAdjustPrice?: boolean; // { type: boolean; default: false }; // 不调价 targetUnitPrice?: string; // 目标单价 targetTotalFee?: string; // 目标合价 from?: FromType; // { type: string; default: 'std' }; // std, cpt 来自标准、补充 isSubcontract?: boolean; // 是否分包 installationKey?: string; // 用来记录安装增加费的关联字段 sectionID?: number | string; // 章节ID用来定位 maskName?: string; caption?: string; evaluationProject?: boolean; // { type: boolean; default: false }; // 1 true 0 false 估价项目 adjustState?: string; comments?: string; // 说明 content?: string; // 工作内容 annotation?: string; // 附注 ruleText?: string; // 计算规则 prefix?: RationPrefix; // { type: string; default: '' }; // 定额是补充、借用时用 补 借 referenceRationID?: string; // 如果是通过模板关联子目生成的定额,这里记录对应的主定额ID jobContentText?: string; // 工作内容 (选择自清单) manageFeeRate?: number; // 管理费率 // 是否记取面积增加费 areaIncreaseFee?: boolean | null; // { type: Schema.Types.Mixed; default: false }; // true 是,false否,null 不确定,三个状态 // 工料机特有属性 // 工料机类型的定额或者特殊清单会用到市场价和调后价 marketPrice?: number; tenderPrice?: number; marketTotalFee?: number; // 综合合价 gljID?: string; // 工料机在库中ID originalCode?: string; // 原始编码 specs?: string; // 规格型号 customQuantity?: string; // 自定义消耗 model?: number; // 机型 adjCoe?: number; remark?: string; // 备注 overHeight?: string; // 超高降效 referenceRationList?: any; // { type: Array; default: [] }; // 关联的定额ID列表,如超高子目关联的定额ID列表 // 定额子项 rationGljList?: IRationGlj[]; // 定额工料机 rationAssList?: IRationAss[]; // 辅助定额 thirdRation?: IThirdRation; // 第三定额 quantityDetails?: IQuantityDetail[]; // 工程量明细 -- 原先保存在另外的表中 rationCoeList?: IRationCoe[]; // 定额调整系数 rationTemplate?: IRationTemplate; // 定额模板 rationInstallList?: IRationInstall[]; // 定额安装增加 } export interface IRations { projectID: string; index: number; rations: IRation[]; } export interface ILibRationsAndGljsResult { total: number; rations: (IStdRation | ICptRation)[]; rationGljs: (IStdGlj | ICptGlj)[]; } // 补充定额章节树-模板(后台设置) export interface ICptRationTreeTemplate { compilationId: string; name: string; ID: number; ParentID: number; NextSiblingID: number; } // 补充定额章节树 export interface ICptRationTree extends ITreeScm { name: string; // 以下预留数据,以后开放可用 explanation?: string; // 说明 ruleText?: string; // 计算规则, jobContentSituation?: string; // 工作内容适用情况,ALL适用本项全部定额,PARTIAL适用本项部分定额 annotationSituation?: string; // 附注适用情况,ALL适用本项全部定额,PARTIAL适用本项部分定额 } // 补充定额章节树容器 export interface ICptRationTreeData { compilationID: string; ownerID: string; // 企业或用户 treeData: ICptRationTree[]; } // 新增补充定额接口传输的数据接口 export interface IInsertCptRation { ID: string; sectionId: string; code: string; name?: string; unit?: string; caption?: string; feeType?: number; labourPrice: number; materialPrice: number; machinePrice: number; basePrice: number; } // 更新补充定额人材机的请求数据 export interface IUpdateCptRationGlj { ID?: string | number; // 人材机ID code?: string; consumeAmt?: number; from?: FromType; } // 更新补充定额人材机的返回更新数据 export interface IUpdateCptRationGljResult { labourPrice: number; materialPrice: number; machinePrice: number; basePrice: number; rationGljList: ICptRationGljRef[]; displayRationGljList: ICptDisplayRationGlj[]; } // 新增补充子目换算接口传输的数据接口 export interface IInsertCptCoe { ID: string; name?: string; content?: string; } // 新增补充定额子目换算调整数据接口 export interface IInsertCptRationCoe { serialNo: number; // 编号 no: number; // 排序 } export interface ICptDisplayRationCoe { ID: string; serialNo: number; // 编号 no: number; // 排序 name?: string; content?: string; } // 定额下挂的几个子项属性 export enum RationSubProp { GLJ = 'rationGljList', // 定额工料机 COE = 'rationCoeList', // 定额子目换算 ASS = 'rationAssList', // 辅助定额 INS = 'rationInstallList', // 定额安装增加费 TPL = 'rationTemplate', // 定额子目模板 } // 进入定额库需要准备的数据(一些状态) export interface IPrepareCptRationLib { // 定额库分享人数 shareCount: number; // 接收到的分享定额库数据 receiveLibs: IReceivedShareLib[]; }