/**
 * 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',
    projectInfo: 'project_info',
    evaluate_list:'evaluate_list',
    contractor_list:'contractor_list',
    bid_evaluation_list:'bid_evaluation_list'
};

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 = commonConstants.rationType;
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 = commonConstants.supplyType;
const supplyText = commonConstants.supplyText;

//三材类别
const materialType = {
    1: '钢材',
    2: '钢筋',
    3: '木材',
    4: '水泥',
    5: '商品砼',
    6: '商品砂浆'
};
const materialTypeMap = {
    GC: 1,
    GJ: 2,
    MC: 3,
    SN: 4,
    ST: 5,
    SS: 6,
    1:'GC',
    2:'GJ',
    3:'MC',
    4:'SN',
    5:'ST',
    6:'SS'

}

//清单固定行
const fixedFlag = commonConstants.fixedFlag;
// 只读的固定类别（工程量、单价、综合合价只读，相当于是标题）
const titleFlags = [
    fixedFlag.PROVISIONAL,
    fixedFlag.ESTIMATE,
    fixedFlag.ENGINEERING_ESITIMATE,
    fixedFlag.DAYWORK,
    fixedFlag.LABOUR,
    fixedFlag.MATERIAL,
    fixedFlag.MACHINE,
    fixedFlag.TURN_KEY_CONTRACT,
    fixedFlag.CLAIM_VISA,
    fixedFlag.CLAIM,
    fixedFlag.VISA
];
const gljKeyArray =['code','name','specs','unit','type'];
const rationKeyArray =['code','name','specs','unit','subType'];
const gljLibKeyArray =['code', 'name', 'specs', 'unit', 'gljType'];
const billType = commonConstants.billType;
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,//补项
    DXFY:6//大项费用
};

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',
    AMAE:'12',
    PBCL:'13'
};
// 文件类型
const _fileKind = {
    // 投标
    tender: 1,
    // 招标
    bid: 2,
    // 控制价
    control: 3
};
const filterTypeArray = ['1','2','3','4','5'];

const installFeeType = ['子目费用','分项费用','措施费用'];
const installSectionBase = ['分别按人材机乘系数','人工','材料','机械'];
//2019-04-02 ,{text:"部分甲供",value:1}  “部分甲供”隐藏，“完全甲供”改文字为“甲供材料”。
const supplyComboMap = [{text:"自行采购",value:0},{text:"甲供材料",value:2},{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.ST],value:materialTypeMap.ST},
    {text:materialType[materialTypeMap.SS],value:materialTypeMap.SS}
];

//定额计算基数简称对应关系，目前只有导出标准接口使用
const rationBaseShort = {
    '[定额人工费]': 'RGF',
    '[定额材料费]': 'CLF',
    '[定额其他材料费]': 'QTCLF',
    '[定额施工机具使用费]': 'JXF',
    '[市场价主材费]': 'SCJZCF',
    '[市场价设备费]': 'SCJSBF',
    '[人工工日]': 'RGGR',
    '[人工费价差]': 'RGJC',
    '[材料费价差]': 'CLJC',
    '[机上人工费价差]': 'JSRGJC',
    '[燃料动力费价差]': 'RLDLJC',
    '[建筑面积]': 'JZMJ',
    '[甲供定额人工费]': 'JGRGF',
    '[甲供定额材料费]': 'JGCLF',
    '[甲供定额施工机具费]': 'JGJXF',
    '[甲供主材费]': 'JGZCF',
    '[暂估材料费]': 'ZGF',
    '[机械折旧费]': 'JXZJF',
    '[特大机械检修费]': 'TDJXJXF',
    '[中小机械检修费]': 'ZXJXJXF',
    '[特大机械维护费]': 'TDJXWHF',
    '[中小机械维护费]': 'ZXJXWHF',
    '[安拆费及场外运输费]': 'ACCWYSF',
    '[定额仪器仪表费]': 'YQYBF',
};
