소스 검색

feat(types): 添加定额类型,以及甚而的枚举类型

zhangweicheng 5 년 전
부모
커밋
2e1bc949fd
4개의 변경된 파일440개의 추가작업 그리고 14개의 파일을 삭제
  1. 42 0
      types/src/interface/base.ts
  2. 1 0
      types/src/interface/index.ts
  3. 381 0
      types/src/interface/ration.ts
  4. 16 14
      types/src/interface/unitPrice.ts

+ 42 - 0
types/src/interface/base.ts

@@ -24,6 +24,48 @@ export enum DeleteEnum {
   COMPLETEDELETED,
 }
 
+export enum fromType {
+  STD = 'std',
+  CPT = 'cpt',
+}
+
+export enum prefix {
+  BOR = '借',
+  CPT = '补',
+}
+
+// 工料机生成的类型
+export enum gljCreateType {
+  NORMAL = 'normal',
+  ADD = 'add',
+  REPLACE = 'replace',
+}
+
+export enum createLocation {
+  CSXM = 1, // 模板子目分别放在措施项目下
+  FBFX = 2, // 模板子目分别放在分部分项下
+  HNTZM = 3, // 模板子目分别放在对应混凝土子目下
+}
+
+export enum BRType { // 1 :大项费用 2:分部 3分项 4清单;5补项   6 定额、7 量价、8 工料机定额
+  DXFY = 1, // 大项费用
+  FB = 2, // 分部
+  FX = 3, // 分项
+  BILL = 4, // 清单
+  BX = 5, // 这个补项因为旧版本是后定义的,所以放在后面,为了统一不混淆
+  RATION = 10, // 定额
+  VP = 11, // 量价
+  GLJ = 12, // 工料机
+}
+
+export enum supplyType {
+  ZXCG = 1, // 自行采购
+  BFJG, // 部分甲供
+  WQJG, // 完全甲供
+  JGCL, // 甲供材料 (“完全甲供”改文字为“甲供材料”)
+  JDYG, // 甲定乙供
+}
+
 export interface IUpdate<T extends IAny> {
   filter: T;
   update: T;

+ 1 - 0
types/src/interface/index.ts

@@ -8,3 +8,4 @@ export * from './increaseFee';
 export * from './labourCoe';
 export * from './unitPrice';
 export * from './feeRate';
+export * from './ration';

+ 381 - 0
types/src/interface/ration.ts

@@ -0,0 +1,381 @@
+/* eslint-disable camelcase */
+import {
+  prefix,
+  fromType,
+  gljCreateType,
+  supplyType,
+  createLocation,
+  BRType,
+} from './base';
+
+export interface IStdRationChapter {
+  rationRepId: number; // 标准库的属性
+  ID: number; // 补充库的直接用新结构,所以有两种类型
+  parentID: number;
+  seq: number;
+  name: string;
+  explanation?: string; // 说明
+  ruleText?: string; // 计算规则,
+  jobContentSituation?: string; // 工作内容适用情况,ALL适用本项全部定额,PARTIAL适用本项部分定额
+  annotationSituation?: string; // 附注适用情况,ALL适用本项全部定额,PARTIAL适用本项部分定额
+}
+
+export interface ICptRationChapter {
+  name: string;
+  ID: { type: string; index: true };
+  seq: number;
+  parentID: string;
+  // 以下预留数据,以后开放可用
+  explanation?: string; // 说明
+  ruleText?: string; // 计算规则,
+  jobContentSituation?: string; // 工作内容适用情况,ALL适用本项全部定额,PARTIAL适用本项部分定额
+  annotationSituation?: string; // 附注适用情况,ALL适用本项全部定额,PARTIAL适用本项部分定额
+}
+
+export interface IBaseRationGljRef {
+  consumeAmt: number;
+  proportion?: number; // 配合比,暂时无需使用,默认0
+  type?: fromType; // 可能有数据没有
+}
+
+export interface IStdRationGljRef extends IBaseRationGljRef {
+  gljId: number; // 原std库已经是这样,不能改成ID
+}
+
+export interface ICptRationGljRef extends IBaseRationGljRef {
+  gljId: string; // 原std库已经是这样,不能改成ID
+}
+export interface IStdRationAss {
+  name: string;
+  assistCode: string;
+  stdValue: string;
+  stepValue: string;
+  decimal: number;
+  carryBit: string;
+  minValue: string;
+  maxValue: string;
+  paramName: string; // 参数名称
+  param: string; // 参数
+  thirdRationCode: string; // 第三定额
+}
+
+export interface IStdRationInstall {
+  feeItemId: string; // 原std库已经是这样,不能改成ID
+  sectionId: string; // 原std库已经是这样,不能改成ID
+}
+
+export interface IStdRationTemp {
+  rationID: number;
+  type: string;
+  billsLocation: string;
+}
+
+export interface ICoeList {
+  ID: number;
+  no: number;
+}
+export interface IStdCoe {
+  coeType: string; // 系数类型,指作用范围:
+  // 单个(如:111量0.001)、人工类、材料类、机械类、全部(如:定额×0.925)。
+  gljID?: number; // 要调整的工料机ID(当coeType=0时有效)
+  operator: string; // 运算符(*、+、-、=)
+  amount: string; // 调整的量
+  gljCode: string;
+  gljName?: string;
+  replaceCode?: string;
+  replaceName?: string;
+}
+
+export interface IBaseCoeItem {
+  ID: number;
+  serialNo?: number; // 编号
+  name: string; // 名称
+  content?: string; // 说明
+  coes: IStdCoe[];
+}
+
+export interface IOptionList {
+  text: string;
+  value: string;
+}
+export interface ICptCoeItem extends IBaseCoeItem {
+  userID: string;
+  compilationID: string;
+}
+
+export interface IStdCoeItem extends IBaseCoeItem {
+  libID: number; // 所属定额定ID
+  original_code?: string; // 原人材机编码
+  option_codes?: string; // 可选人材机编码
+  option_list?: IOptionList[]; // 下拉列表选项
+}
+
+export interface IRationCoe {
+  ID: string;
+  stdID?: number | string; // 库里的ID
+  name: string;
+  content?: string;
+  originalCode?: string;
+  optionList?: IOptionList[];
+  optionCodes?: 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: IStdRationAss[];
+  rationInstList: IStdRationInstall[];
+  rationTemplateList: IStdRationTemp[];
+  fromType?: fromType; // 单条查找结果时用到
+}
+export interface IStdRation extends IBaseRation {
+  ID: number;
+  rationRepId: number;
+  sectionId: number;
+  rationGljList: IStdRationGljRef[];
+
+  chapter?: IStdRationChapter;
+}
+
+export interface ICptRation extends IBaseRation {
+  userID: string;
+  compilationID: string;
+  ID: string;
+  sectionId: string;
+  rationGljList: ICptRationGljRef[];
+  chapter?: ICptRationChapter;
+}
+
+export interface IStdComponent {
+  ID: number;
+  consumeAmt: number;
+  consumeAmtProperty: any; // 多消耗量的情况
+}
+export interface ICptComponent {
+  ID: string; // 补充的ID改成了UUID ,标准的不变,但是这里
+  consumeAmt: number;
+  consumeAmtProperty: any; // 多消耗量的情况
+  from: fromType;
+}
+
+export interface IBaseRationGlj {
+  code: string;
+  name: string;
+  specs?: string;
+  basePrice: number;
+  priceProperty: any; // 多单价的情况
+  gljClass: number;
+  type: number; // 这个要和项目工料机等统一,所以在查找项目工料机的时候转一下,
+  gljType: number;
+  model: number; // 机型
+  shortName: string;
+  unit: string;
+  adjCoe: number;
+  materialType: number; // 三材类别
+  materialCoe: number; // 三材系数
+  // 经济指标数据
+  materialIndexType: string; // 工料指标类别
+  materialIndexUnit: string; // 工料指标单位
+  materialIndexCoe: number; // 单位转换系数
+  taxRate: string; // 税率
+}
+
+// 保存到项目下的定额工料机
+export interface IRationGlj {
+  ID: string;
+  gljID?: string;
+  repositoryID?: number;
+  name: string;
+  code: string;
+  originalCode: string; // 原始的编码
+  rcode?: string; // 替换工料机后记录原来的工料机编码,要做判断
+  specs?: string;
+  unit: string;
+  type: number;
+  model?: number; // 机型
+  adjCoe?: number; // 调整系数ID
+  quantity: number;
+  customQuantity?: number;
+  rationItemQuantity: number;
+  tenderQuantity?: number; // 调整后消耗量
+  createType: gljCreateType; // normal、add、replace  正常、添加工料机、替换工料机
+  from: fromType; // std, cpt  来自标准工料机库、补充工料机库
+}
+
+export interface IProjectGlj {
+  ID: string;
+  gljID: string; // 工料机ID
+  code: string; // 编码
+  originalCode: string; // 原始的编码
+  name: string; // 名称
+  isEvaluate?: boolean; // 是否暂估 (false为否 true为是) //这个属性考虑放弃
+  supply: supplyType; // 供货方式
+  supplyQuantity?: number; // 甲供数量
+  delivery?: string; // 交货方式
+  deliveryAddress?: string; // 送达地点
+  noAdjustPrice: boolean; // 不调价  { type: boolean; default: false }
+  nTaxEqp: boolean; // 不计税设备  { type: boolean; default: false }
+  adjCoe?: number; // 调整系数ID
+  specs: string; // 规格型号
+  type: number; // 类型
+  model?: number; // 机型
+  unit: string; // 单位
+  adjustPrice?: string; // 显示调整基价
+  quantity?: number; // 显示关联的消耗量
+  techQuantity?: string; // 技术措施项目消耗量
+  subdivisionQuantity?: string; // 分部分项消耗量
+  tenderPrice?: string; // 调整后价格
+  materialType?: number; // 三材类别
+  materialCoe?: number; // 三材系数
+  // 经济指标数据
+  materialIndexType?: string; // 工料指标类别
+  materialIndexUnit?: string; // 工料指标单位
+  materialIndexCoe: number; // 单位转换系数
+  isMainMaterial: boolean; // 是否主要材料 (0为否 1为是) { type: boolean; default: false };
+  remark?: string;
+  originPlace?: string; // 产地
+  vender?: string; // 厂家
+  qualityGrace?: string; // 质量等级
+  brand?: string; // 品牌
+  from: fromType; // std, cpt  来自标准工料机库、补充工料机库
+}
+
+export interface IStdRationGlj extends IBaseRationGlj {
+  ID: number;
+  repositoryId: number;
+  components: IStdComponent[];
+}
+
+export interface ICptRationGlj extends IBaseRationGlj {
+  ID: string;
+  userID: string;
+  compilationID: string;
+  components: ICptComponent[];
+}
+
+export interface IGljQtyCoe {
+  labour: string; // 人工
+  material: string; // 材料
+  machine: string; // 机械
+  main: string; // 主材
+  equipment: string; // 设备
+}
+
+// 实际保存到项目中的辅助定额数据
+export interface IRationAss extends IStdRationAss {
+  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;
+  ruleID: string;
+  itemName: string;
+  sectionName: string;
+  unifiedSetting: boolean; // 0:false 1:true  按统一设置
+}
+
+export interface IRationItem {
+  ID: string;
+  parentID: string;
+  seq: number;
+  kind: BRType;
+  code?: string;
+  name?: string;
+  unit?: string;
+  type?: number; // 子类型:1人工、201材料、301机械、4主材、5设备
+  quantity?: number;
+  contain?: number; // 含量
+  quantityEXP?: string; // 工程量表达式
+  programID?: number;
+  fees?: any; // 费用字段
+  gljQtyCoe?: IGljQtyCoe; // 工料机消耗量调整系数字段
+  rationQtyCoe?: string; // 子目工程量调整系数
+  tenderQuantity?: string; // 调整后工程量
+  noAdjustPrice?: boolean; // { type: boolean; default: false }; // 不调价
+  targetUnitFee?: string; // 目标单价
+  targetTotalFee?: string; // 目标合价
+  from?: fromType; // { type: string; default: 'std' }; // std, cpt  来自标准、补充
+  isSubcontract?: boolean; // 是否分包
+  installationKey?: string; // 用来记录安装增加费的关联字段
+  // 定额特有属性:
+  stdID?: string; // 来自的标准定额ID
+  repositoryID?: number; // 定额库ID
+  maskName?: string;
+  caption?: string;
+  evaluationProject?: boolean; // { type: boolean; default: false }; // 1 true 0 false 估价项目
+  isFromDetail: boolean; // { type: boolean; default: false }; // 1 true 0 false
+  adjustState?: string;
+  comments?: string; // 说明
+  content?: string; // 工作内容
+  annotation?: string; // 附注
+  ruleText?: string; // 计算规则
+  prefix?: prefix; // { type: string; default: '' }; // 定额是补充、借用时用  补 借
+  referenceRationID?: string; // 如果是通过模板关联子目生成的定额,这里记录对应的主定额ID
+  jobContentText?: string; // 工作内容 (选择自清单)
+  manageFeeRate?: string; // 管理费率
+  // 是否记取面积增加费
+  areaIncreaseFee?: boolean | null; // { type: Schema.Types.Mixed; default: false }; // true 是,false否,null 不确定,三个状态
+  // 工料机特有属性
+  gljID?: string; // 工料机在库中ID
+  originalCode?: string; // 原始编码
+  specs?: string; // 规格型号
+  customQuantity?: string; // 自定义消耗
+  model?: number; // 机型
+  adjCoe?: number;
+  remark?: string;
+  bookmarkBackground?: string; // 书签背景色
+  bookmarkAnnotation?: string; // 批注
+  overHeight?: string; // 超高降效
+  referenceRationList?: any; // { type: Array; default: [] }; // 关联的定额ID列表,如超高子目关联的定额ID列表
+  // 定额子项
+  rationGljList?: IRationGlj[]; // 定额工料机
+  rationAssList?: IRationAss[]; // 辅助定额
+  quantityDetails?: any; // 工程量明细 -- 原先保存在另外的表中
+  rationCoeList: IRationCoe[]; // 定额调整系数
+  rationTemplate?: IRationTemplate; // 定额模板
+  rationInstallList: IRationInstall[]; // 定额安装增加
+}
+
+export interface IRations {
+  projectID: string;
+  index: number;
+  rations: IRationItem[];
+}

+ 16 - 14
types/src/interface/unitPrice.ts

@@ -1,38 +1,40 @@
-import { DeleteEnum } from './base';
+import { DeleteEnum, fromType } from './base';
 
-export interface IMixRatio {
+export interface IComponent {
   ID: string;
   consumption: number; // 消耗量(有别于总消耗,此字段记录配合比的消耗量)
-  gljID: number; // 工料机总库对应id (关联用)
-  specs: string; // 规格型号
+  gljID: string; // 工料机总库对应id (关联用)
+  specs?: string; // 规格型号
   unit: string; // 单位
   name: string; // 名称
   code: string; // 对应工料机code
   type: number; // 工料机类型
-  model: number; // 机型
+  model?: number; // 机型
+  from: fromType; // std, cpt  来自标准工料机库、补充工料机库
 }
 
 export interface IUnitPrice {
   ID: string;
-  basePrice: string; // 基价单价
-  marketPrice: string; // 市场单价
-  taxRate?: string; // 税率
+  basePrice: number; // 基价单价
+  marketPrice: number; // 市场单价
+  taxRate?: number; // 税率
   code: string; // 编码
   originalCode: string; // 原始的编码
   name: string; // 名称
-  specs: string; // 规格型号
+  specs?: string; // 规格型号
   unit: string; // 单位
+  model?: number; // 机型
   type: number; // 类型
-  gljID: number; // 对应标准库工料机id
-  priceFrom?: string; // 价格来源
-  mixRatios: IMixRatio[];
-  isAdd: boolean;
+  gljID: string; // 对应标准库工料机id
+  from: fromType; // std, cpt  来自标准工料机库、补充工料机库
+  components?: IComponent[]; // 组成物
+  isAdd: boolean; // 是否新增
 }
 
 export interface IUnitPriceFile {
   ID: string;
   name: string;
-  userID: string;
+  userID?: string;
   rootProjectID: string;
   unitPrices: IUnitPrice[];
   deleteType?: DeleteEnum;