| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452 |
- /*
- * @Descripttion:
- * @Author: vian
- * @Date: 2021-05-26 17:37:16
- */
- import { FromType, ITreeScm, SupplyType } from './base';
- // 工料机类型
- export enum GljType {
- LABOUR = 1, // 人工
- // ==============材料类型 ↓=================
- MATERIAL = 2, // 材料
- GENERAL_MATERIAL = 201, // 普通材料
- CONCRETE = 202, // 混凝土
- MORTAR = 203, // 砂浆
- MIX_RATIO = 204, // 配合比
- COMMERCIAL_CONCRETE = 205, // 商品混凝土
- COMMERCIAL_MORTAR = 206, // 商品砂浆
- OTHER_MATERIAL = 207, // 其它材料
- // ==============材料类型 ↑=================
- // ==============机械类型 ↓=================
- GENERAL_MACHINE = 301, // 机械台班
- MACHINE_COMPOSITION = 302, // 机械组成物
- MACHINE_LABOUR = 303, // 机上人工
- INSTRUMENT = 304, // 仪器仪表
- FUEL_POWER_FEE = 305, // 燃料动力费
- DEPRECIATION_FEE = 306, // 折旧费
- INSPECTION_FEE = 307, // 检修费
- MAINTENANCE = 308, // 维护费
- DISMANTLING_FREIGHT_FEE = 309, // 安拆费及场外运费
- VERIFICATION_FEE = 310, // 校验费
- OTHER_FEE = 311, // 其他费用
- OTHER_MACHINE_USED = 312, // 其他施工机具使用费
- // ==============机械类型 ↑=================
- MAIN_MATERIAL = 4, // 主材
- EQUIPMENT = 5, // 设备
- MANAGEMENT_FEE = 6, // 企业管理费
- PROFIT = 7, // 利润
- GENERAL_RISK_FEE = 8, // 一般风险费
- }
- export const hasCompMaterialTypes = [
- // 有组成物的材料类型, //混凝土、砂浆、配合比
- GljType.CONCRETE,
- GljType.MORTAR,
- GljType.MIX_RATIO,
- ];
- export const hasCompMachineTypes = [
- // 有组成物的机械类型
- GljType.GENERAL_MACHINE,
- GljType.INSTRUMENT,
- ];
- export const machineCompTypes = [
- // 可以做为机械组成物的类型
- GljType.MACHINE_COMPOSITION,
- GljType.MACHINE_LABOUR,
- GljType.FUEL_POWER_FEE, // 燃料动力费
- GljType.DEPRECIATION_FEE, // 折旧费
- GljType.INSPECTION_FEE, // 检修费
- GljType.MAINTENANCE, // 维护费
- GljType.DISMANTLING_FREIGHT_FEE, // 安拆费及场外运费
- GljType.VERIFICATION_FEE, // 校验费
- GljType.OTHER_FEE, // 其他费用
- ];
- export interface IBaseGlj {
- code: string;
- name: string;
- specs?: string;
- type: GljType;
- unit: string;
- [key: string]: any;
- }
- export interface IGljTypeShortName {
- [type: number]: string;
- }
- // 人材机类型简称
- export const GljTypeShortName: IGljTypeShortName = {
- 1: '人',
- 201: '材',
- 202: '砼',
- 203: '浆',
- 204: '配比',
- 205: '商砼',
- 206: '商浆',
- 207: '材',
- 208: '外购',
- 209: '苗木',
- 301: '机',
- 302: '机',
- 303: '机人',
- 304: '仪',
- 305: '动',
- 306: '折',
- 307: '检',
- 308: '维',
- 309: '安',
- 310: '校',
- 311: '机',
- 312: '机',
- 4: '主',
- 5: '设',
- 6: '管',
- 7: '利',
- 8: '险',
- };
- // 人材机类型全称
- export const GljTypeFullName: Record<number, string> = {
- 1: '人工',
- 201: '普通材料',
- 202: '混凝土',
- 203: '砂浆',
- 204: '配合比',
- 205: '商品混凝土',
- 206: '商品砂浆',
- 207: '其他材料费',
- 208: '外购砼构件',
- 209: '绿化苗木',
- 301: '机械台班',
- 302: '机械组成物',
- 303: '机上人工',
- 304: '仪器仪表',
- 305: '燃料动力费',
- 306: '折旧费',
- 307: '检修费',
- 308: '维护费',
- 309: '安拆费及场外运费',
- 310: '校验费',
- 311: '其他费用',
- 312: '其他施工机具使用费',
- 4: '主材',
- 5: '设备',
- 6: '企业管理费',
- 7: '利润',
- 8: '一般风险费',
- };
- export interface IComponent {
- ID: string;
- consumption: number; // 消耗量(有别于总消耗,此字段记录配合比的消耗量)
- gljID: string; // 工料机总库对应id (关联用)
- specs?: string; // 规格型号
- unit: string; // 单位
- name: string; // 名称
- code: string; // 对应工料机code
- type: GljType; // 工料机类型
- model?: number; // 机型
- from: FromType; // std, cpt 来自标准工料机库、补充工料机库
- }
- export enum MaterialType {
- GC = 1,
- GJ = 2,
- MC = 3,
- SN = 4,
- SPT = 5,
- SPSJ = 6,
- }
- export const MaterialDisplay = {
- 1: '钢材',
- 2: '钢筋',
- 3: '木材',
- 4: '水泥',
- 5: '商品砼',
- 6: '商品砂浆',
- };
- // 机型
- export enum GljModel {
- EXTRA_LARGE = 1,
- LARGE,
- MEDIUM,
- SMALL,
- }
- // 机型名称映射
- export const GljModelName = {
- 1: '特大',
- 2: '大',
- 3: '中',
- 4: '小',
- };
- export interface IProjectGlj {
- ID: string;
- gljID: string; // 工料机ID
- code: string; // 编码
- originalCode: string; // 原始的编码
- name: string; // 名称
- supply: SupplyType; // 供货方式
- supplyQuantity?: number; // 甲供数量
- delivery?: string; // 交货方式
- deliveryAddress?: string; // 送达地点
- noAdjustPrice: boolean; // 不调价 { type: boolean; default: false }
- noTaxEqp?: boolean; // 不计税设备 { type: boolean; default: false }
- adjCoe?: number; // 调整系数ID
- specs: string; // 规格型号
- type: GljType; // 类型
- model?: number; // 机型
- unit: string; // 单位
- isAdd: boolean; // 是否新增
- basePrice: number; // 基价单价
- marketPrice: number; // 市场单价
- components?: IComponent[]; // 组成物
- taxRate?: number; // 税率
- adjustPrice?: string; // 显示调整基价
- quantity?: number; // 显示关联的消耗量
- tenderQuantity?: number; // 调整后消耗量
- techQuantity?: number; // 技术措施项目消耗量
- subdivisionQuantity?: number; // 分部分项消耗量
- materialType?: MaterialType; // 三材类别
- materialCoe?: number; // 三材系数
- materialQuantity?: number; // 三材量
- // 经济指标数据
- materialIndexType?: string; // 工料指标类别
- materialIndexUnit?: string; // 工料指标单位
- materialIndexCoe: number; // 单位转换系数
- isMainMaterial: boolean; // 是否主要材料 (0为否 1为是) { type: boolean; default: false };
- remark?: string; // 备注
- originPlace?: string; // 产地
- vender?: string; // 厂家
- qualityGrade?: string; // 质量等级
- brand?: string; // 品牌
- priceFrom?: string; // 价格来源
- from: FromType; // std, cpt 来自标准工料机库、补充工料机库
- }
- export interface IProjectGljs {
- projectID: string;
- projectGljs: IProjectGlj[];
- }
- /* 标准人材机相关 ↓ */
- // 标准人材机库
- export interface IStdGljLib {
- dispName: string;
- compilationId: string;
- compilationName: string;
- ID: number;
- rationLibs: [{ dispName: string; ID: number }];
- }
- // 标准、补充人材机共用属性(原始数据)
- export interface IBaseRationGlj {
- code: string;
- name: string;
- specs?: string;
- basePrice: number;
- priceProperty?: any; // 多单价的情况
- model?: number; // 机型
- shortName: string;
- unit: string;
- adjCoe?: number;
- materialType?: MaterialType; // 三材类别
- materialCoe?: number; // 三材系数
- // 经济指标数据
- materialIndexType?: string; // 工料指标类别
- materialIndexUnit?: string; // 工料指标单位
- materialIndexCoe?: number; // 单位转换系数
- taxRate?: string; // 税率
- }
- // 人材机组成物
- export interface ILibComponent {
- ID: number | string; // 可为补充、标准
- consumeAmt: number;
- consumeAmtProperty?: any; // 多消耗量的情况
- }
- // 标准人材机(原始数据)
- export interface IRawStdGlj extends IBaseRationGlj {
- ID: number;
- repositoryId: number;
- gljClass: number;
- gljType: number;
- component: ILibComponent[];
- }
- // 标准人材机
- export interface IStdGlj extends IBaseRationGlj {
- ID: number;
- repositoryID: number;
- type: number;
- gljClass: number;
- components: ILibComponent[];
- from: FromType;
- }
- // 标准人材机分类树(原始数据)
- export interface IRawStdGljTree {
- ID: number;
- ParentID: number;
- NextSiblingID: number;
- repositoryId: number;
- Name: string;
- }
- // 标准人材机分类树
- export interface IStdGljTree extends ITreeScm {
- repositoryID: number;
- name: string;
- from: FromType;
- }
- /* 标准人材机相关 ↑ */
- /* 补充人材机相关 ↓ */
- // 补充人材机分类树-模板(后台设置)
- export interface IRawCptGljTreeTemplate {
- compilationId: string;
- Name: string;
- ID: number;
- ParentID: number;
- NextSiblingID: number;
- }
- // 补充人材机分类树
- export interface ICptGljTree extends ITreeScm {
- name: string;
- from: FromType;
- }
- // 补充人材机分类树容器
- export interface ICptGljTreeData {
- compilationID: string;
- ownerID: string; // 企业或用户
- treeData: ICptGljTree[];
- }
- // 补充人材机组成物
- export interface ICptComponent extends ILibComponent {
- from: FromType;
- }
- // 补充人材机组成物的组合数据(增加一些字段用于显示)
- export interface ICptDisplayComponent extends ICptComponent {
- code: string;
- name: string;
- unit: string;
- basePrice: number;
- }
- // 补充人材机
- export interface ICptGlj extends IBaseRationGlj {
- ID: string;
- ownerID: string;
- type: number;
- gljClass: string;
- compilationID: string;
- components: ICptComponent[];
- displayComponents?: ICptDisplayComponent[];
- from: FromType;
- }
- // 新增补充人材机接口传输的数据接口
- export interface IInsertCptGlj {
- ID: string;
- gljClass: string;
- code: string;
- name: string;
- unit: string;
- specs?: string;
- type: number;
- basePrice: number;
- model?: number;
- }
- // 准备组成物返回数据接口
- export interface IPrepareComponentResult {
- displayComponents: ICptDisplayComponent[];
- allowComponent: boolean;
- }
- // 补充人材机
- /* 补充人材机相关 ↑ */
- /* 选择人材机相关 ↓ */
- // 库下拉项
- export interface ISelectGljLibItem {
- name: string;
- repositoryID: number | string;
- key: string; // 与gljLibID拼接的形成的唯一值
- isPrior: boolean; // 优先的
- from: FromType;
- located?: boolean; // 定位到的库(替换时需要)
- }
- export interface IAddComponentOption {
- type: GljType;
- gljID?: number | string;
- }
- // 获取人材机分页数据接口选项
- export interface IGetPagingGljOptions {
- classList?: (number | string)[]; // 需要匹配的分类
- typeList?: GljType[]; // 需要匹配的人材机类型
- libID?: number | string; // 人材机库ID
- replaceGlj?: IBaseGlj; // 替换的人材机
- addComponent?: IAddComponentOption; // 添加组成物时的参数
- located?: boolean; // 是否需要定位(打开替换窗口时)
- limit?: number; // 分页数量
- gtCode?: string; // 分页排序$gt code
- search?: string; // 搜索的内容(匹配编号、名称)
- }
- // 选择人材机接口返回数据格式
- export interface ISelectGljResult {
- libData: ISelectGljLibItem[]; // 库下拉项
- treeData: (IStdGljTree | ICptGljTree)[]; // 人材机分类树
- gljData: (IStdGlj | ICptGlj)[]; // 人材机数据
- total: number; // 当前数据总数量
- locatedGlj?: IStdGlj | ICptGlj; // 需要定位到的人材机
- }
- /* 选择人材机相关 ↑ */
- // 补充定额库中,需要显示用的补充定额人材机
- export interface ICptDisplayRationGlj {
- ID: string | number; // 人材机ID(标准为number,补充为string)
- code: string;
- name: string;
- unit: string;
- specs?: string;
- basePrice: number;
- consumeAmt: number;
- from: FromType;
- type: GljType;
- }
- // 重算补充定额价格需要的人材机类型
- export interface IGljForCalcRationPrice {
- basePrice: number;
- consumeAmt: number;
- type: GljType;
- [props: string]: any;
- }
- // 价格变更人材机
- export interface IPriceChangeGlj {
- ID: string;
- basePrice: number;
- }
- // 添加组成物filter类型
- export interface IAddComponentFilter {
- projectGljID: string;
- libGljs: (IStdGlj | ICptGlj)[];
- }
|