import { EntityType } from './user'; import { ValuationType } from './compilation'; import { IIncreaseSetting } from './increaseFee'; import { ITreeScm, DeleteEnum, INumFileRef, IColumnMeta } from './base'; import { ICalcOption, ITenderSetting, IDistributeSetting } from './calculation'; import { ISharePermission } from './share'; // 项目类型 export enum ProjectType { FOLDER = 1, CONSTRUCTION, // 建设项目 SINGLE, // 单项工程 UNIT, // 单位工程 } export const projectTextMap = { [ProjectType.FOLDER]: '文件夹', [ProjectType.CONSTRUCTION]: '建设项目', [ProjectType.SINGLE]: '单项工程', [ProjectType.UNIT]: '单位工程', }; export interface IGLJCol { showAdjustPrice?: boolean; } // 小数位数 export interface IDecimal { bill: { unitPrice: number; totalPrice: number }; ration: { quantity: number; unitPrice: number; totalPrice: number }; glj: { quantity: number; unitPriceHasMix: number; unitPrice: number }; feeRate: number; quantityDetail: number; material: number; // 三材系数 process: number; } // 工程量精度 export interface IBillsQuantityDecimal { unit: string; decimal: number; ID: string; } // 呈现选项 export interface IDisplaySetting { billsAutoHeight: boolean; rationAutoHeight: boolean; disPlayMainMaterial: boolean; } // 累进区间 export interface IProgression { interval: string; // 区间字符 eg: '(0,100]' feeRate: boolean; } export interface IProgressiveInterval { ID: string; name: string; progression: IProgression[]; generalRate?: number; simpleRate?: number; } // 超高降效 export interface IOverHeight { name: string; code?: string; unit?: string; labourRate?: number; machineRate?: number; labourMachineRate?: number; benchmark?: number; extra?: number; limit?: number; } export enum OverHeightOption { SEPARATION = 1, // 对应清单或分部下(默认) MEASURE, // 指定措施清单011704001 SPECIFIC, // 指定具体位置,显示分部分项以及措施项目的树结构显示叶子清单(分项)供勾选 } // 承包人材料调整类型 export enum GLJAdjustType { PRICE_INFO = 'priceInfo', // 造价信息差额调整法 PRICE_COE = 'priceCoe', // 价格指数调整法 } // 计税方式 export enum TaxType { GENERAL = 1, SIMPLE, } // 文件类型 export enum FileType { SUBMISSION = 1, // 投标 INVITATION, // 招标 CONTROL, // 控制价 } export enum FileTypeName { SUBMISSION = '投标', INVITATION = '招标', CONTROL = '控制价', } export const FileTypeMap = { [FileType.SUBMISSION]: FileTypeName.SUBMISSION, [FileType.INVITATION]: FileTypeName.INVITATION, [FileType.CONTROL]: FileTypeName.CONTROL, }; // 工程特征、基本信息 export interface IInfoItem { ID: string; key: string; dispName: string; value?: string; required?: string; readonly?: string; options?: string; cellType?: string; fileKind?: FileTypeName; items?: IInfoItem[]; } // 基本信息类型 export interface IBasicInfo extends IInfoItem { ID: string; parentID: string; seq: number; } // 工程特征指标 interface IBaseEngineerFeature { value: string; name: string; exportName?: string; cellType?: string; options?: string; } export interface IStdEngineerFeature extends IBaseEngineerFeature { ID: number; ParentID: number; } export interface IEngineerFeature extends ITreeScm, IBaseEngineerFeature {} // 主要工料指标 export interface IMaterialIndex { ID: string; name: string; unit: string; coe: number; } // 主要工程量指标 export interface IMainQtyIndex { ID: string; name: string; unit: string; coe: number; } // 主要经济指标 export interface IEconomicIndex { ID: string; name: string; value: string; } // 面积增加类型 export enum AreaIncreaseType { LABOUR = 'labour', MATERIAL = 'material', MACHINE = 'machine', } export interface IAreaIncreaseSetting { [AreaIncreaseType.LABOUR]: number; [AreaIncreaseType.MATERIAL]: number; [AreaIncreaseType.MACHINE]: number; } // 关于计算取费方式 export enum BillGetFeeType { RATION_CONTENT = 0, RATION_PRICE_CONVERSE = 1, RATION_PRICE = 2, BILL_PRICE = 3, } // 项目属性 export interface IProperty { constructionID?: string; // 建设项目ID valuationType?: ValuationType; // 计价类型 valuationID?: string; // 计价规则 engineeringID?: string; // 工程专业ID fileType?: FileType; // 文件类型 taxType?: TaxType; // 计税方式 rationFeeType?: number; // 定额取费专业 unitFeeType?: number; // 单位工程取费专业 calcProgramLib?: INumFileRef; // 计算程序(标准) region?: string; showAdjustPrice?: boolean; // 是否显示调整价列 isInstall?: boolean; // 是否是安装工程 isItemIncrease?: boolean; // 是否是子目增加 itemIncreaseSetting?: IIncreaseSetting; isAreaIncrease?: boolean; // 是否是面积增加 areaIncreaseSetting?: IAreaIncreaseSetting; // 面积增加费设置 indexName?: string; // 指标名称 lockBills?: boolean; // 锁定清单 decimal?: IDecimal; // 小数位数 billsQuantityDecimal?: IBillsQuantityDecimal[]; // 清单工程量精度 displaySetting?: IDisplaySetting; // 呈现选项 billsCalcMode?: BillGetFeeType; // 清单计费取费方式 zanguCalcMode?: number; // 暂估合价计算方式 calcOption?: ICalcOption; // 计算选项 tenderSetting?: ITenderSetting; // 调价设置 overHeight?: IOverHeight[]; // 超高降效数据 overHeightOption?: OverHeightOption; // 超高降效选项 basicInfo?: IBasicInfo[]; // 基本信息 feature?: IInfoItem[]; // 工程特征 progressiveInterval?: IProgressiveInterval[]; // 累进区间 gljAdjustType?: GLJAdjustType; // 承包人材料调整类型 cptIllustration?: string; // 编制说明 engineerInfos?: IInfoItem[]; engineerFeatures?: IEngineerFeature[]; materials?: IMaterialIndex[]; mainQuantities?: IMainQtyIndex[]; economics?: IEconomicIndex[]; overHeightSpecificID?: string; // 超高子目指定清单ID distributeSetting?: IDistributeSetting; // 强制修改叶子清单的综合单价,分摊计算定额工程量 或 分摊计算定额下的工料机消耗量。 colMetas?: IColumnMeta[]; valuationName?: string; // 计价规则名称 maxLimitPriceRate?: number; // 设置最高限价单价浮动率 minLimitPriceRate?: number; // 设置最低限价单价浮动率 } // 原来的列设置太复杂了,没什么必要 export interface IMainTreeCol { cols: Array; headRowHeight: Array; treeCol?: number; headRows?: number; emptyRows?: number; } export enum ImportType { NONE, YBP, INTERFACE, } // 项目活动枚举 export enum ProjectActivity { // 新建 CREATE = 'create', // 编辑 EDIT = 'edit', // 删除 DELETE = 'delete', // 恢复 RECOVER = 'recover', } export interface IProject extends ITreeScm { type: ProjectType; compilationID: string; ownerID: string; // 拥有者ID(个人或企业) ownerType: EntityType; managerID: string; // 负责人ID creator: string; name: string; updateDate: number; // 更新时间 code?: string; createDate: number; property?: IProperty; changeMark?: string; remark?: string; fileVer?: string; lastFileVer?: string; imported?: ImportType; deleteType?: DeleteEnum; deleteDate?: number; deleteBy?: string; // 只是为了显示,不是自身的正在数据,比如汇总信息等 external?: { showShareMark?: boolean; // 是否显示分享标记 cost?: number; // 工程造价 // 有时候为了显示,需要一些特殊处理日期。如:项目管理-回收站,建设项目、单项工程的删除日期和创建日期需要显示为空 deleteDateForView?: number; createDateForView?: number; actualTreeData?: ITreeScm; // 真正的树结构数据。有时候可能需要暂时变更project的树结构数据,在这种时候需要存储原本的真实树结构数据 from?: string; // 来自于某用户名称 members?: string[]; // 成员协作 }; } export interface IProjectBulkRst { create: IProject[]; remove: string[]; } // 建设项目默认设置项(可以被恢复的) export interface IConstructionDefaultSetting { decimal: IProperty['decimal']; billsQuantityDecimal: IProperty['billsQuantityDecimal']; displaySetting: IProperty['displaySetting']; billsCalcMode: IProperty['billsCalcMode']; zanguCalcMode: IProperty['zanguCalcMode']; calcOption: IProperty['calcOption']; colMetas: IProperty['colMetas']; } // 项目权限 export interface IProjectPermission { projectID: string; readOnly: boolean; allowCopy: boolean; } // constructionTreeData接口 export interface IConstructionTreeData { construction: { project: IProject }; treeData: IProject[]; } // 项目活动 export interface IProjectActivity { activity: ProjectActivity; userID: string; date: number; } // 项目log export interface IProjectLog { // 企业ID enterpriseID: string; // 费用定额ID compilationID: string; // 费用定额名称 compilationName: string; // 建设项目ID constructionID: string; // 建设项目名称 constructionName: string; // 单位工程ID unitID: string; // 单位工程名称 unitName: string; // 更新时间 updateDate: number; // 管理者(所有者、负责人)ID managerID: string; // 活动 activity: ProjectActivity; // 活动时间 activityDate: number; // 活动者ID activityUserID: string; // 协作 cooperationCount?: number; } // 导入状态 export enum ImportStatus { IMPORTING = 0, FINISH = 1, FAIL = 3, } // 导入log export interface IImportLog { status: ImportStatus; errorMsg: string; stack?: any; }