/**
 * Created by jimiz on 2017/4/19.
 */
const ModuleNames = {
    project:'project',
    bills: 'bills',
    ration: 'ration',
    GLJ: 'GLJ',
    feeRate: 'feeRate',
    projectGLJ: 'projectGLJ',
    ration_glj:'ration_glj',
    ration_coe:'ration_coe',
    ration_ass:'ration_ass',
    ration_installation:'ration_installation',
    ration_template:'ration_template',
    quantity_detail:'quantity_detail',
    labour_coe: 'labour_coe',
    calc_program: 'calc_program',
    installation_fee:'installation_fee'
};

let gljType = gljUtil.gljType;
let gljTypeSeq =gljUtil.getGljTypeSeq(); /*[gljType.LABOUR,gljType.MAIN_MATERIAL,gljType.CONCRETE,gljType.MORTAR,gljType.MIX_RATIO,gljType.COMMERCIAL_CONCRETE,
    gljType.COMMERCIAL_MORTAR,gljType.GENERAL_MATERIAL,gljType.OTHER_MATERIAL,gljType.GENERAL_MACHINE,gljType.INSTRUMENT,gljType.OTHER_MACHINE_USED,
    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,gljType.EQUIPMENT,gljType.MANAGEMENT_FEE,gljType.PROFIT,gljType.GENERAL_RISK_FEE];*/

// 计算基数 [定额基价材料费] 要用到的材料类型。
const baseMaterialTypes = [
    gljType.GENERAL_MATERIAL,
    gljType.CONCRETE,
    gljType.MORTAR,
    gljType.MIX_RATIO,
    gljType.COMMERCIAL_CONCRETE,
    gljType.COMMERCIAL_MORTAR
];
// 计算基数 [定额基价机械费] 要用到的机械类型。
const baseMachineTypes = [
    gljType.GENERAL_MACHINE,
    gljType.MACHINE_COMPOSITION,
    gljType.MACHINE_LABOUR
];

const baseMachineMasterTypes = [
    gljType.GENERAL_MACHINE
];

// 全部材料类型。用于暂估等 (多了主材和设备)
const allMaterialTypes = [
    gljType.GENERAL_MATERIAL,
    gljType.CONCRETE,
    gljType.MORTAR,
    gljType.MIX_RATIO,
    gljType.COMMERCIAL_CONCRETE,
    gljType.COMMERCIAL_MORTAR,
    gljType.MAIN_MATERIAL,
    gljType.EQUIPMENT
];
// 会有组成物的材料、机械台班
const compositionTypes =gljUtil.notEditType;//统一定义，方便覆盖

const CP_Col_Width = {          // 多处计算程序界面的列宽统一设置
    rowHeader: 30,
    colHeader: 30,              // 这个是标题栏高度不是宽度，也写在一起
    code: 70,
    serialNo: 50,
    name: 200,
    dispExprUser: 180,
    feeRate: 60,
    displayFieldName: 120,
    statement: 380,
    memo: 120,
    unitFee: 90,
    totalFee: 90
};

const treeNodeCalcType = {
    ctRationCalcProgram: 1,
    ctBillCalcProgram: 2,       // 汇总清单下所有定额的工料机
    ctGatherRationsFees: 3,     // 汇总定额的各个费
    ctGatherBillsFees: 4,       // 汇总清单的各个费
    ctCalcBaseValue: 5,
    ctNull: 6
    // ctCommonUnitFee: 6       // 树结点的手工输入综合单价的方式已废弃，现综合单价只读，引入市场单价。
};

const tenderTypes = {
  ttCalc: 1,                // 正向调价
  ttReverseRation: 2,       // 反向调价－调子目
  ttReverseGLJ: 3          // 反向调价－调工料机
};

const calcAllType = {
    catAll: 'all',
    catBills: 'bills',
    catRations: 'ration'
};
const priceTypes = {
    ptBasePrice: 1,
    ptAdjustPrice: 2,
    ptMarketPrice: 3,
    ptDiffPrice: 4
};
const subSheetIndex = {
    ssiRationGLJ: 0,
    ssiRationCoe: 1,
    // ssiRationAssistant: 2,
    ssiQuantityDetail: 3,
    ssiCalcProgram: 2,
    ssiMemo: 5,
    ssiFeature: 6
};
const volumePriceMaps = {
    "量人": gljType.LABOUR,
    "量材": gljType.GENERAL_MATERIAL,
    "量机": gljType.GENERAL_MACHINE,
    "量主": gljType.MAIN_MATERIAL,
    "量设": gljType.EQUIPMENT,

    "人工": gljType.LABOUR,
    "材料": gljType.GENERAL_MATERIAL,
    "机械": gljType.GENERAL_MACHINE,
    "主材": gljType.MAIN_MATERIAL,
    "设备": gljType.EQUIPMENT,

    1: "量人",
    201: "量材",
    301: "量机",
    4: "量主",
    5: "量设"
};
const rationType = {
    ration: 1,
    volumePrice: 2,
    gljRation: 3,
    install:4
};
const rationPrefix = { //定额前缀，补/借
    none: '',
    complementary: '补',
    borrow: '借',
    replace: '换'
};
const rationFrom = {
    std: 'std',
    cpt: 'cpt'
};
let leafBillGetFeeType = {
    rationContent: 0,
    rationPriceConverse: 1,
    rationPrice: 2,
    billsPrice: 3
};
const zanguCalcType = {
    common: 0,
    gatherMaterial: 1
};

//供货方式
const supplyType = {
    //自行采购
    ZXCG: 0,
    //部分甲供
    BFJG: 1,
    //完全甲供
    WQJG: 2,
    //甲定乙供
    JDYG: 3
};

const supplyText = {
    //自行采购
    ZXCG: '自行采购',
    //部分甲供
    BFJG: '部分甲供',
    //完全甲供
    WQJG: '完全甲供',
    //甲定乙供
    JDYG: '甲定乙供'
};

//三材类别
const materialType = {
    1: '钢材',
    2: '钢筋',
    3: '木材',
    4: '水泥',
    5: '标准砖'
};
const materialTypeMap = {
    GC: 1,
    GJ: 2,
    MC: 3,
    SN: 4,
    SZ: 5,
    1:'GC',
    2:'GJ',
    3:'MC',
    4:'SN',
    5:'SZ'

}

//清单固定行
const fixedFlag = {
    // 分部分项工程
    SUB_ENGINERRING: 1,
    // 措施项目
    MEASURE: 2,
    // 施工技术措施项目
    CONSTRUCTION_TECH: 3,
    // 安全文明施工按实计算费用
    SAFETY_CONSTRUCTION_ACTUAL: 4,
    // 施工组织措施专项费用
    CONSTRUCTION_ORGANIZATION: 5,
    // 安全文明施工专项费用
    SAFETY_CONSTRUCTION: 6,
    // 其他项目
    OTHER: 7,
    // 暂列金额
    PROVISIONAL: 8,
    // 暂估价
    ESTIMATE: 9,
    // 材料（工程设备）暂估价
    MATERIAL_PROVISIONAL: 10,
    // 专业工程暂估价
    ENGINEERING_ESITIMATE: 11,
    // 计日工
    DAYWORK: 12,
    // 总承包服务费
    TURN_KEY_CONTRACT: 13,
    // 索赔与现场签证
    CLAIM_VISA: 14,
    // 规费
    CHARGE: 15,
    // 社会保险费及住房公积金 Social insurance fee and housing accumulation fund
    SOCIAL_INSURANCE_HOUSING_FUND: 16,
    // 工程排污费 charges for disposing pollutants
    POLLUTANTS: 17,
    // 税金
    TAX: 18,
    //工程造价
    ENGINEERINGCOST: 19,
    //增值税
    ADDED_VALUE_TAX: 20
};

const gljKeyArray =['code','name','specs','unit','type'];
const rationKeyArray =['code','name','specs','unit','subType'];
const gljLibKeyArray =['code', 'name', 'specs', 'unit', 'gljType'];
const billType ={
    DXFY:1,//大项费用
    FB:2,//分部
    FX:3,//分项
    BILL:4,//清单
    BX:5//补项
};
const billText = {
    1:'费用',
    2:'分部',
    3:'分项',
    4:'清单',
    5:'补项'
};

let cpFeeTypes = [
    {type: 'direct', name: '直接费'},
    {type: 'labour', name: '人工费'},
    {type: 'material', name: '材料费'},
    {type: 'machine', name: '机械费'},
    {type: 'mainMaterial', name: '主材费'},
    {type: 'equipment', name: '设备费'},
    {type: 'manage', name: '企业管理费'},
    {type: 'profit', name: '利润'},
    {type: 'risk', name: '风险费'},
    {type: 'labourDiff', name: '人工价差'},
    {type: 'materialDiff', name: '材料价差'},
    {type: 'machineDiff', name: '机械价差'},
    {type: 'adjustLabour', name: '调整人工费'},
    {type: 'adjustMachineLabour', name: '调整机上人工费'},
    {type: 'unratedMaterial', name: '未计价材料费'},
    {type: 'organizeMeasures', name: '组织措施费'},
    {type: 'safeCivilization', name: '安全文明施工费'},
    {type: 'night', name: '夜间施工费'},
    {type: 'secondHandling', name: '二次搬运费'},
    {type: 'winterRainy', name: '冬雨季施工增加费'},
    {type: 'protection', name: '已完工程及设备保护费'},
    {type: 'clean', name: '工程定位复测点交及场地清理费'},
    {type: 'quotaDetermine', name: '工程定额测定费'},
    {type: 'materialInspect', name: '材料检验试验费'},
    {type: 'acceptance', name: '住宅工程质量分户验收费'},
    {type: 'docManage', name: '档案管理费'},
    {type: 'forceFee', name: '规费'},
    {type: 'fiveOne', name: '五险一金'},
    {type: 'sewage', name: '工程排污费'},
    {type: 'tax', name: '税金'},

// {type: 'estimate', name: '暂估费'},
    {type: 'common', name: '工程造价'},
    {type: 'fee1', name: '费用1'}//,
    // {type: 'fee2', name: '费用2'},
    // {type: 'fee3', name: '费用3'},
    // {type: 'fee4', name: '费用4'},
    // {type: 'fee5', name: '费用5'},
    // {type: 'fee6', name: '费用6'},
    // {type: 'fee7', name: '费用7'},
    // {type: 'fee8', name: '费用8'},
    // {type: 'fee9', name: '费用9'}

];
//8-27 zhang 这个已经不能用来判断工程类型了
/*const engineeringType = {
    // 建筑工程
    ARCHITECTURE: 1,
    // 装饰工程
    DECORATE: 2,
    // 仿古建筑工程
    ANTIQUE_ARCHITECTURE: 3,
    // 安装工程
    BUILD_IN: 4,
    // 市政土建工程
    MUNICIPAL_CONSTRUCTION: 5,
    // 市政安装工程
    MUNICIPAL_BUILD_IN: 6,
    // 人工土石方工程
    ARTIFICIAL_EARTHWORK: 7,
    // 机械土石方工程
    MECHANICAL_EARTHWORK: 8,
    // 炉窖砌筑工程
    KILN_MASONRY: 9,
    // 园林工程
    GARDEN: 10,
    // 绿化工程
    PLANTING: 11,
    // 单拆除工程
    DISMANTLE: 12,
    // 建筑修缮工程
    BUILDING_REPAIR: 13,
    // 安装修缮工程
    BUILD_IN_REPAIR: 14
};*/
const blockType ={
    RATION:1,//定额
    FB:2,//分部
    FX:3,//分项
    BILL:4,//清单
    BX:5//补项
};

const filterType = {
    ALL:'0',
    LABOUR:'1',
    GENERAL_MATERIAL:'2',
    GENERAL_MACHINE:'3',
    MAIN_MATERIAL:'4',
    EQUIPMENT:'5',
    FBFX:'6',
    TECH:'7',
    JGCL:'8',
    ZGCL:'9',
    SCHZ:'10',
    ZYCL:'11'
};
const filterTypeArray = ['1','2','3','4','5'];

const installFeeType = ['子目费用','分项费用','措施费用'];
const installSectionBase = ['分别按人材机乘系数','人工','材料','机械'];
const supplyComboMap = [{text:"自行采购",value:0},{text:"完全甲供",value:2},{text:"部分甲供",value:1},{text:"甲定乙供",value:3}];//后来调整了下拉选项的顺序，为了不改之前的业务逻辑，这里的值对换了一下
const materialComboMap = [
    {text:materialType[materialTypeMap.GC],value:materialTypeMap.GC},
    {text:materialType[materialTypeMap.GJ],value:materialTypeMap.GJ},
    {text:materialType[materialTypeMap.MC],value:materialTypeMap.MC},
    {text:materialType[materialTypeMap.SN],value:materialTypeMap.SN},
    {text:materialType[materialTypeMap.SZ],value:materialTypeMap.SZ}
];
