Просмотр исходного кода

Merge branch 'master' of http://192.168.1.41:3000/SmartCost/SCCommon

qinlaiqiao 5 лет назад
Родитель
Сommit
0472acd779

+ 11 - 1
mathUtil/src/index.ts

@@ -1,6 +1,6 @@
 /* eslint-disable no-restricted-globals */
 // 判断传入的是否是数字或者可转为数字的字符串
-export const isNumber = (value: string | number) => {
+export const isNumber = (value: string | number): boolean => {
   return /^(-|\+)?\d+(\.\d+)?$/.test(value as string);
 };
 
@@ -23,3 +23,13 @@ export const roundToString = (
   const value = roundForObj(obj, decimal);
   return value.toFixed(decimal);
 };
+
+// 取单位前的数字,并转换成整数
+export const getNumberFromUnit = (unit: string): number => {
+  const reg = new RegExp('^[0-9]+');
+  if (unit && reg.test(unit)) {
+    const arr: any = unit.match(reg);
+    return parseInt(arr[0], 10);
+  }
+  return 1;
+};

+ 1 - 1
types/package.json

@@ -1,6 +1,6 @@
 {
   "name": "@sc/types",
-  "version": "1.0.2",
+  "version": "1.0.4",
   "description": "共用类型文件",
   "main": "./dist/index.cjs.js",
   "module": "./dist/index.esm.js",

+ 6 - 0
types/src/interface/User.ts

@@ -16,6 +16,10 @@ export enum UserType {
   PROFESSIONAL = 'professional',
 }
 
+export interface IContact {
+  userID: string;
+}
+
 export interface IUserResult {
   _id?: string;
   ssoId?: number;
@@ -34,6 +38,7 @@ export interface IUserResult {
   latest_login?: number;
   // 最近使用编办
   latest_used?: string;
+  contacts?: IContact[];
   [key: string]: any;
 }
 
@@ -52,5 +57,6 @@ export interface IUser {
   isSmsLogin?: number;
   latestLogin?: number;
   latestUsed?: string;
+  contacts?: IContact[];
   [key: string]: any;
 }

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

@@ -13,12 +13,59 @@ export interface IFileRef {
   name: string;
 }
 
+export interface INumFileRef {
+  ID: number;
+  name: string;
+}
+
 export enum DeleteEnum {
   NORMAL = 1,
   DELETED,
   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;

+ 58 - 0
types/src/interface/bill.ts

@@ -0,0 +1,58 @@
+import { BRType } from './base';
+
+export interface IBillsItem {
+  ID: string;
+  parentID: string;
+  seq: number;
+  kind: BRType;
+  code?: string;
+  name?: string;
+  quantity?: number;
+  unit: string;
+  [key: string]: any; // 剩下的之后补充
+}
+
+export interface IBills {
+  projectID: string;
+  bills: IBillsItem[];
+}
+
+export interface IJobContent {
+  id: number;
+  code: number;
+  content: string;
+  billsLibId: number;
+  deleted: boolean;
+}
+
+export interface IItemCharacter {
+  id: number;
+  code: number;
+  content: string;
+  itemValue: any;
+  billsLibId: number;
+  deleted: boolean;
+}
+
+export interface IStdBill {
+  ID: string;
+  parentID: string;
+  seq: number;
+  code: string;
+  name: string;
+  unit: string;
+  ruleText: string;
+  engineering: number; // 工程专业,填计算程序工程专业ID
+  Expression: string;
+  comment: string; // 备注,后台清单精灵录入
+  jobs: [];
+  items: [];
+  recharge: string;
+  billsLibId: number;
+  // 经济指标属性
+  economicType: string; // 工程经济指标类别
+  quantityIndexType: string; // 工程量指标类别
+  quantityIndexUnit: string; // 工程量指标单位
+  quantityIndexCoe: number; // 单位转换系数
+  deleted: boolean;
+}

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

@@ -17,3 +17,45 @@ export interface ITenderSetting {
   gljPriceTenderCoe: number; // 工料机单价调整系数
   calcPriceOption: TenderOption; // 根据调整系数计算报价
 }
+
+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;
+}
+
+export interface ICalcTemplate {
+  ID: number;
+  name: string;
+  calcItems: ICalcItem[];
+}
+
+export interface IStdCalcProgram {
+  ID: number;
+  region: string;
+  libName: string;
+  displayName: string;
+  compilationId: string;
+  compilationName: string;
+  templates: ICalcTemplate[];
+}
+
+export interface ICalcProgram {
+  ID: string;
+  projectID: string;
+  name: string;
+  libID: number;
+  libName: string;
+  templates: ICalcTemplate[];
+}

+ 7 - 8
types/src/interface/Compliation.ts

@@ -1,7 +1,6 @@
-/* eslint-disable camelcase */
-import { ELockInfo } from './User';
+import { ELockInfo } from './user';
 import { TaxType, IGLJCol } from './project';
-import { IFileRef } from './base';
+import { IFileRef, INumFileRef } from './base';
 
 export interface ICptItem {
   ID: string;
@@ -9,7 +8,7 @@ export interface ICptItem {
   description: string;
 }
 
-export interface IProgramLib extends IFileRef {
+export interface IProgramLib extends INumFileRef {
   displayName: string;
 }
 
@@ -42,11 +41,11 @@ export interface IEngineering {
   engineerInfoLib?: IFileRef[];
   infoLib?: IFileRef[];
   featureLib?: IFileRef[];
-  artificialLib?: IFileRef[];
-  billLib?: IFileRef[];
+  artificialLib?: INumFileRef[];
+  billLib?: INumFileRef[];
   billsGuidanceLib?: IFileRef[];
-  gljLib?: IFileRef[];
-  rationLib?: IFileRef[];
+  gljLib?: INumFileRef[];
+  rationLib?: INumFileRef[];
   progressiveLib?: IFileRef[];
   taxGroup: ITaxGroup[];
 }

+ 65 - 0
types/src/interface/feeRate.ts

@@ -0,0 +1,65 @@
+import { DeleteEnum, ITreeScm } from './base';
+
+export interface ISubFeeRateOption {
+  name: string;
+  value: string;
+  selected: boolean;
+}
+
+export interface ISubFeeRateRecord {
+  ID: number;
+  name: string;
+  optionList: ISubFeeRateOption[];
+}
+
+export interface IFeeRateValueMap {
+  ID: string;
+  value: number;
+}
+
+export interface ISubFeeRate {
+  records: ISubFeeRateRecord[];
+  valueMaps: IFeeRateValueMap[];
+}
+
+export interface IFeeRate extends ITreeScm {
+  name: string;
+  rate: number;
+  originalRate: number;
+  memo?: string; // 备注
+  subFeeRate: ISubFeeRate;
+}
+
+export interface IFeeRateFile {
+  ID: string;
+  rootProjectID: string;
+  userID: string;
+  name: string;
+  libID: string;
+  libName: string;
+  rates: IFeeRate[];
+  deleteType?: DeleteEnum;
+}
+
+export interface IStdSubFeeRate {
+  recodes: ISubFeeRateRecord[];
+  records?: ISubFeeRateRecord[]; // 标准数据recodes拼写错误,解决拼写错误
+  valueMaps: IFeeRateValueMap[];
+}
+
+export interface IStdFeeRate {
+  ID: number;
+  ParentID: number;
+  name: string;
+  rate: number;
+  memo?: string;
+  subFeeRate: IStdSubFeeRate;
+}
+
+export interface IStdFeeRateFile {
+  ID: string;
+  libName: string;
+  compilationId: string;
+  compilationName: string;
+  rates: IStdFeeRate[];
+}

+ 74 - 0
types/src/interface/increaseFee.ts

@@ -0,0 +1,74 @@
+import { IAny } from './base';
+
+export interface IStdFeeRule {
+  ID: string;
+  code: string;
+  rule: string;
+  base: string;
+  feeRate?: number;
+  labour: number;
+  material: number;
+  machine: number;
+}
+
+export interface IStdInstallFeeItem {
+  rationRepId: number;
+  ID: string;
+  feeItem: string;
+  feeType: string;
+  position?: string;
+  section: { ID: string }[];
+}
+
+export interface IStdInstallSection {
+  rationRepId: number;
+  ID: string;
+  name: string;
+  feeItemId: string;
+  feeRule: IStdFeeRule[];
+}
+
+export interface IFeeRule extends IStdFeeRule {
+  sectionID: string;
+  feeItemID: string;
+  position?: string; // 记取位置
+  billID?: string; // 记取位置对应的清单ID
+}
+
+export interface IInstallSection {
+  ID: string;
+  feeItemID: string;
+  feeRuleID: string;
+  name: string;
+}
+
+export interface IInstallFeeItem {
+  ID: string;
+  feeItem: string; // 费用项
+  feeType: string; // 费用类型
+  isCalc?: boolean; // 是否记取
+  position?: string; // 记取位置
+  billID?: string; // 记取位置对应的清单ID
+}
+
+export interface IInstallFee {
+  ID?: string;
+  libID?: number;
+  libName?: string;
+  projectID?: string;
+  installFeeItem: IInstallFeeItem[];
+  installSection: IInstallSection[];
+  feeRule: IFeeRule[];
+}
+
+export interface IIncreaseSettngItem {
+  name: string;
+  base: string;
+  coe: number;
+  scope: IAny;
+}
+
+export interface IIncreaseSetting {
+  isCalc: boolean;
+  setting: IIncreaseSettngItem[];
+}

+ 9 - 2
types/src/interface/index.ts

@@ -1,6 +1,13 @@
 export * from './base';
-export * from './Compliation';
-export * from './User';
+export * from './compilation';
+export * from './user';
 export * from './calculation';
 export * from './systemSetting';
 export * from './project';
+export * from './increaseFee';
+export * from './labourCoe';
+export * from './unitPrice';
+export * from './feeRate';
+export * from './share';
+export * from './ration';
+export * from './bill';

+ 29 - 0
types/src/interface/labourCoe.ts

@@ -0,0 +1,29 @@
+import { ITreeScm } from './base';
+
+export interface IStdLabourCoeItem {
+  ID: number;
+  ParentID: number;
+  name: string;
+  coe: number;
+}
+
+export interface IStdLabourCoe {
+  ID: number;
+  libName: string;
+  region: string;
+  coes: IStdLabourCoeItem[];
+}
+
+export interface ILabourCoeItem extends ITreeScm {
+  name: string;
+  coe: number;
+}
+
+export interface ILabourCoe {
+  ID: string;
+  projectID: string;
+  name: string;
+  libID: number;
+  libName: string;
+  coes: ILabourCoeItem[];
+}

+ 61 - 9
types/src/interface/project.ts

@@ -1,4 +1,6 @@
-import { ITreeScm, IFileRef, DeleteEnum } from './base';
+import { ILabourCoe } from './labourCoe';
+import { IIncreaseSetting } from './increaseFee';
+import { ITreeScm, IFileRef, DeleteEnum, INumFileRef } from './base';
 import { ICalcOption, ITenderSetting } from './calculation';
 
 export enum ProjectType {
@@ -52,12 +54,12 @@ export interface IOverHeight {
   name: string;
   code?: string;
   unit?: string;
-  labourRate?: string;
-  machineRate?: string;
-  labourMachineRate?: string;
-  benchmark?: string;
-  extra?: string;
-  limit?: string;
+  labourRate?: number;
+  machineRate?: number;
+  labourMachineRate?: number;
+  benchmark?: number;
+  extra?: number;
+  limit?: number;
 }
 
 export enum OverHeightOption {
@@ -110,16 +112,53 @@ export interface IInfoItem {
   items?: IInfoItem[];
 }
 
+// 工程特征指标
+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 {
+  name: string;
+  unit: string;
+  coe: number;
+}
+
+// 主要工程量指标
+export interface IMainQtyIndex {
+  name: string;
+  unit: string;
+  coe: number;
+}
+
+// 主要经济指标
+export interface IEconomicIndex {
+  name: string;
+  value: string;
+}
+
 // 项目属性
 export interface IProperty {
   rootProjectID?: string; // 建设项目ID
   valuationID?: string; // 计价规则
-  engineeringID?: string; // 工程专业
+  programID?: number; // 工程专业,填计算程序工程专业ID
+  engineeringID?: string; // 工程专业ID
   fileType?: FileType; // 文件类型
   taxType?: TaxType; // 计税方式
   rationFeeType?: number; // 定额取费专业
   unitFeeType?: number; // 单位工程取费专业
-  calcProgram?: IFileRef; // 计算程序
+  calcProgramLib?: INumFileRef; // 计算程序(标准)
+  calcProgramFile?: IFileRef; // 计算程序(用户数据)
   colLibID?: string; // 列设置
   templateLibID?: string; // 清单模板
   unitPriceFile?: IFileRef; // 单价文件
@@ -127,6 +166,7 @@ export interface IProperty {
   region?: string;
   isInstall?: boolean; // 是否是安装工程
   isItemIncrease?: boolean; // 是否是子目增加
+  itemIncreaseSetting?: IIncreaseSetting;
   isAreaIncrease?: boolean; // 是否是面积增加
   featureLibID?: string; // 工程特征
   indexName?: string; // 指标名称
@@ -148,8 +188,15 @@ export interface IProperty {
   overHeightOption?: OverHeightOption; // 超高降效选项
   basicInfo?: IInfoItem[]; // 基本信息
   feature?: IInfoItem[]; // 工程特征
+  progressiveInterval?: IProgressiveInterval[]; // 累进区间
   gljAdjustType?: GLJAdjustType; // 承包人材料调整类型
   cptIllustration?: string; // 编制说明
+  labourCoeFile?: ILabourCoe; // 人工系数文件
+  engineerInfos?: IInfoItem[];
+  engineerFeatures?: IEngineerFeature[];
+  materials?: IMaterialIndex[];
+  mainQuantities?: IMainQtyIndex[];
+  economics?: IEconomicIndex[];
 }
 
 export interface IMainTreeCol {
@@ -185,3 +232,8 @@ export interface IProject extends ITreeScm {
   deleteDate?: number;
   deleteBy?: string;
 }
+
+export interface IProjectBulkRst {
+  create: IProject[];
+  remove: string[];
+}

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

@@ -0,0 +1,386 @@
+/* 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 IProjectGljs {
+  projectID: string;
+  projectGLJs: IProjectGlj[];
+}
+
+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[];
+}

+ 55 - 6
types/src/interface/share.ts

@@ -1,8 +1,57 @@
-enum ShareType {
-  PROJECT = 1,
-  RATION_LIB, // 补充定额库
-  GLJ_LIB, // 单项工程
-  BLOCK_LIB, // 单位工程
+export enum ShareType {
+  PROJECT = 1, // 项目
+  RATION_LIB, // 定额库
+  GLJ_LIB, // 工料机库
+  PRICE_TEMPLATE, // 租价模板
 }
 
-export default ShareType;
+export interface IShareProject {
+  shareDate?: number;
+  updateDate?: number;
+  projectID: string; // 项目ID
+  isRead?: boolean;
+  allowCopy: boolean;
+  allowCooperate: boolean;
+}
+
+export interface IShareLib {
+  shareDate?: number;
+  updateDate?: number;
+  compilationID: string;
+  allowCopy: boolean;
+  allowCooperate: boolean;
+}
+
+export interface IShare {
+  ID: string;
+  owner: string;
+  receiver: string;
+  recentDate: number;
+  projectList: IShareProject[];
+  rationLibList: IShareLib[];
+  gljLibList: IShareLib[];
+  priceTemplateList: IShareLib[];
+}
+
+export type ShareItem = IShareProject | IShareLib;
+
+export interface ICreatShare {
+  doc: ShareItem;
+  type: ShareType;
+}
+
+export interface IUpdateShare {
+  filter: { projectID?: string; compilationID?: string };
+  update: {
+    updateDate?: number;
+    isRead?: boolean;
+    allowCopy?: boolean;
+    allowCooperate?: boolean;
+  };
+  type: ShareType;
+}
+
+export interface IDelShare {
+  filter: { projectID?: string; compilationID?: string };
+  type: ShareType;
+}

+ 41 - 0
types/src/interface/unitPrice.ts

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