serviceInOut.js 3.8 KB
import * as types from '../constants/ActionTypes';


const initialState = {
    backProcessStatisticsList     : [],//后道
    backProcessStatisticsListCount: 0,
    backProcessList               : [],
    backProcessListCount          : 0,
    backProcessAll                : {},
    backProcessStatistics         : {
        increase: 0,
        decrease: 0,
        payback : 0
    },
    backProcessCheckList     : [],
    backProcessCheckListCount: 0,
    outCheckStatistics       : 0,
    backProcessDetail        : {},
    backImportError : '',
    frontList       : {},
    frontDetail     : {},
    frontStatistics : {},
    serviceData     : {},
    orderData       : {},
    processData     : {},
    datumData       : {},
    datumCheck      : {}
};


export default function environment(state = initialState, action) {
    switch (action.type) {
        case types.BACK_PROCESS_STATISTICS_LIST://后道首页列表
            return Object.assign({}, state, {
                backProcessStatisticsList: action.backProcessStatisticsList,
                backProcessStatisticsListCount: action.backProcessStatisticsListCount
            });
            break;
        case types.BACK_PROCESS_STATISTICS://后道首页统计数字
            return Object.assign({}, state, {
                backProcessStatistics: action.backProcessStatistics
            });
            break;
        case types.BACK_PROCESS_LIST://后道
            return Object.assign({}, state, {
                backProcessList     : action.backProcessList,
                backProcessListCount: action.backProcessListCount,
                backProcessAll      : action.backProcessAll
            });
            break;
        case types.BACK_PROCESS_CHECK_LIST://后道
            return Object.assign({}, state, {
                backProcessCheckList: action.backProcessCheckList,
                backProcessCheckListCount: action.backProcessCheckListCount
            });
            break;
        case types.OUT_CHECK_STATISTICS://后道
            return Object.assign({}, state, {
                outCheckStatistics: action.outCheckStatistics
            });
            break;
        case types.BACK_PROCESS_DETAIL://后道
            return Object.assign({}, state, {
                backProcessDetail     : action.backProcessDetail,
            });
            break;
        case types.BACK_PROCESS_IMPORT_ERROR://后道
            return Object.assign({}, state, {
                backImportError: action.backImportError
            });
            break;
        case types.FRONT_LIST:
            return Object.assign({}, state, {
                frontList: action.frontList
            });
            break;
        case types.FRONT_DETAIL:
            return Object.assign({}, state, {
                frontDetail: action.frontDetail
            });
            break;
        case types.FRONT_STATISTICS:
            return Object.assign({}, state, {
                frontStatistics: action.frontStatistics
            });
            break;
        case types.SERVICE_STATISTICS:
            return Object.assign({}, state, {
                serviceData: action.serviceData
            });
            break;
        case types.ORDER_STATISTICS:
            return Object.assign({}, state, {
                orderData: action.orderData
            });
            break;
        case types.PROCESS_STATISTICS:
            return Object.assign({}, state, {
                processData: action.processData
            });
            break;
        case types.DATUMDATA_STATISTICS:
            return Object.assign({}, state, {
                datumData: action.datumData
            });
            break;
        case types.DATUMDATA_CHECK:
            return Object.assign({}, state, {
                datumCheck: action.datumCheck
            });
            break;
        default:
            return state;
    }
}