// 计算选项
export interface ICalcOption {
  calcMain: boolean;
  calcAdd: boolean;
  calcEst: boolean;
}

// 调价类型：
export enum TenderKinds {
  COE_CALC, // 正向调价-按系数计算
  REVERSE_RATION, // 反向调价－调子目
  REVERSE_GLJ, // 反向调价－调工料机
  NULL, // 无需参数时，用作占位
}

// 调价设置
export interface ITenderSetting {
  gljPriceTenderCoe: number; // 工料机单价调整系数
  tenderKind: TenderKinds;
}

// 强制修改叶子清单单价，分摊计算类型： 定额工程量、工料机消耗量
export enum DistributeModel {
  DISTR_RATION = 'DISTR_RATION',
  DISTR_GLJ = 'DISTR_GLJ',
}

// 强制修改叶子清单单价，分摊计算其下挂定额的工料机。列出被排除的工料机类型
export enum NoDistributeType {
  NO_DISTR_ESTIMATE = 'NO_DISTR_ESTIMATE',
  NO_DISTR_JIAGONG = 'NO_DISTR_JIAGONG',
  NO_DISTR_JIADING = 'NO_DISTR_JIADING',
  NO_DISTR_MAIN = 'NO_DISTR_MAIN',
  NO_DISTR_LABOUR = 'NO_DISTR_LABOUR',
  NO_DISTR_MACHINE = 'NO_DISTR_MACHINE',
}

export interface IDistributeSetting {
  distributeModel: DistributeModel;
  noDistributeTypes: NoDistributeType[];
}

export interface ICalcItem {
  ID: number;
  code: string;
  name: string;
  fieldName: string;
  dispExpr: string;
  dispExprUser?: string;
  expression: string;
  compiledExpr?: string;
  statement: string;
  feeRateID?: number;
  feeRate?: string;
  labourCoeID?: number;
  memo?: string;
  custom?: boolean;
  [key: string]: any;
}

export interface ICalcTemplate {
  ID: number;
  name: string;
  calcItems: ICalcItem[];
  [key: string]: any;
}

export interface IStdCalcProgram {
  ID: number;
  region: string;
  libName: string;
  displayName: string;
  compilationId: string;
  compilationName: string;
  templates: ICalcTemplate[];
}

export interface ICalcProgramFile {
  ID: string;
  projectID: string;
  name: string;
  libID: number;
  libName: string;
  programs: ICalcTemplate[];
}

// 增加费计算选项
interface IIncreaseCalcOption {
  // 分部分项是否计算管理费
  calcManageFBFX: boolean;
  // 措施项目是否计算管理费
  calcManageCSXM: boolean;
  // 分部分项是否计算利润
  calcProfitFBFX: boolean;
  // 措施项目是否计算利润
  calcProfitCSXM: boolean;
}

// 子目增加费计算选项
export type IItemIncreaseCalcOption = IIncreaseCalcOption;

// 安装增加费计算选项
export type IInstallIncreaseCalcOption = IIncreaseCalcOption;
