provider.js 5.5 KB
import * as types from '../constants/ActionTypes';

const initialState = {
    formDefind: [],
    providerList: {},
    recruitProviderList: {},
    providerDel: {},
    is_import: 'init',
    errorMeg: '',
    provider_is_ok: 'init',
    providerAccount: {},
    agentList: [],
    agentListDetail: [],
    billingdetails_list: [],
    lookover_list: [],
    getLookOverbroker_list: [],
    getPosttion_list: [],
    agentIndexCollectAchieveSettle: [],
    manageIndexCollectAchieveSettle: [],
    providerAreaList: {},
    import_broker: '',
    messageAll: '',
    auditingList: [],
    rebateAddSubtractList: [],
};

export default function environment(state = initialState, action) {
    switch (action.type) {
        case types.PROVIDER_AREA_LIST:
            return Object.assign({}, state, {
                providerAreaList: action.providerAreaList
            });
        case types.PROVIDER_LOAD_FORM:
            return Object.assign({}, state, {
                formDefind: action.formDefind
            });
        case types.PROVIDER_LIST:
            return Object.assign({}, state, {
                providerList: action.providerList
            });
        case types.RECRUIT_PROVIDER_LIST:
            return Object.assign({}, state, {
                recruitProviderList: action.recruitProviderList
            });
        case types.PROVIDER_DEL:
            return Object.assign({}, state, {
                providerDel: action.providerDel
            });
        case types.IMPORT_PROVIDER:
            return Object.assign({}, state, {
                is_import: action.is_import,
                errorMeg: action.errorMeg
            });
        case types.PROVIDER_IS_OK:
            return Object.assign({}, state, {
                provider_is_ok: action.provider_is_ok
            });
        case types.PROVIDER_ACCOUNT:
            return Object.assign({}, state, {
                providerAccount: action.providerAccount
            });
        case types.LIST_AGENTS:
            return Object.assign({}, state, {
                agentList: action.agentList
            });
        case types.LIST_AGENTS_DETAIL:
            return Object.assign({}, state, {
                agentListDetail: action.agentListDetail
            });
        case types.DETAIL_AGENTS:
            return Object.assign({}, state, {
                agentDetail: action.agentDetail
            });
        case types.DETAIL_RANGE_AGENTS:
            return Object.assign({}, state, {
                agentDetailList: action.agentDetailList,
                total_direct: action.total_direct,
                total_bylower: action.total_bylower,
                total_count: action.total_count,
            });
        case types.LIST_AGENTS_SETTING_DAYS:
            return Object.assign({}, state, {
                agentSettings: action.agentSettings,

            });
        case types.AGENT_INDEX_COLLECT_TODAY:
            return Object.assign({}, state, {
                agentIndexCollectToday: action.agentIndexCollectToday,

            });
        ///供应商管理首页
        case types.MANAGE_INDEX_COLLECT_TODAY:
            return Object.assign({}, state, {
                manageIndexCollectToday: action.manageIndexCollectToday,

            });
        case types.AGENT_INDEX_COLLECT_DETAIL:
            return Object.assign({}, state, {
                agentIndexCollectDetail: action.agentIndexCollectDetail,

            });
        //供应商管理首页供应商汇总
        case types.MANAGE_INDEX_COLLECT_DETAIL:
            return Object.assign({}, state, {
                manageIndexCollectDetail: action.manageIndexCollectDetail,

            });
        case types.AGENT_INDEX_COLLECT_ACHIEVE_SETTLE:
            return Object.assign({}, state, {
                agentIndexCollectAchieveSettle: action.agentIndexCollectAchieveSettle,

            });
        //供应商管理首页业绩及汇总结算
        case types.MANAGE_INDEX_COLLECT_ACHIEVE_SETTLE:
            return Object.assign({}, state, {
                manageIndexCollectAchieveSettle: action.manageIndexCollectAchieveSettle,

            });
        //英格玛---供应商管理---待审核供应列表
        case types.PROVIDER_AUDITING_LIST:
            return Object.assign({}, state, {
                auditingList: action.auditing_list
            });
            break;
        //英格玛---供应商管理---结算明细--导入返利加减项--选中数据
        case types.IMPORT_REBATE_ADD_SUBTRACT:
            return Object.assign({}, state, {
                rebateAddSubtractList: action.rebateAddSubtractList
            });
            break;



        case types.BILLINGDETAILS_LIST:
            return Object.assign({}, state, {
                billingdetails_list: action.billingdetails_list
            });
            break;
        case types.LOOKOVER_LIST:
            return Object.assign({}, state, {
                lookover_list: action.lookover_list
            });
            break;
        case types.GETLOOKOVERBROKER_LIST:
            return Object.assign({}, state, {
                getLookOverbroker_list: action.getLookOverbroker_list
            });
            break;
        case types.GETPOSTTION:
            return Object.assign({}, state, {
                getPosttion_list: action.getPosttion_list
            });
            break;
        case types.IMPORT_BROKER:
            return Object.assign({}, state, {
                import_broker: action.import_broker,
                messageAll: action.messageAll,
            });
            break;
        default:
            return state;
    }
}