salary.js 12.7 KB
import * as types from '../constants/ActionTypes';

const initialState = { 
    addSalaryPlan:'init',
    planData     :{},
    salaryList  :{},
    salaryDetail:{},
    customTem   :{},
    errorMessage:'init',
    salaryCyles :{},
    cylesRecord :{},
    personRecord:{},
    payrollTaxList     :{},
    payrollTaxDetail   :{},
    pendingPayrollTaxDetail:{},
    payrollPersonDetail:{},
    payrollPersonRecord:{},
    salaryCylesDet     :{},
    payrollTaxStaticDet:{},
    slipRecord         :{},
    mappingColumn      :{},
    mappings           :[],
    customerTaxList      : [],
    customerTaxListCount : 0,
    salaryDetailList     : [],
    salaryDetailListCount: 0,
    salary_is_import:'init',
    tax_is_import   :'init',
    abnormalList    :{},
    taxIndexStatic  :{},
    salaryIndexStatic :{},
    taxRecordDetail   :{},
    salaryRecordDetail:{},
    setBankInfo       :{},
    legalEntityList   :{},
    integral_list:[],
    drawMoney_list:[],
    payTaxList:{},
    payTaxStatistics:{},
    payTaxDetail:[],
    payTaxDetailStatistics:{},
    salarySettingState:{},
    legalEntityListData:{},
    programData        :{},
    smartTaxUpdate     :{},
    historySalaryStatistics     :{},
    SimulationTaxlist: [],
    SimulationTaxStatis:{},
    SimulationTaxDifference:[],
    InitializeSimulatedTaxList:{},
    taxImportRecord:{},
};

export default function environment(state = initialState, action) {
    switch (action.type) { 
        case types.ADD_SALARY_PLAN:
          return Object.assign({}, state, {
              addSalaryPlan: action.addSalaryPlan,
              planData     : action.planData
          });
          break;
        case types.GET_SALARY_LIST:
            return Object.assign({}, state, {
                salaryList: action.salaryList
            });
            break;
        case types.GET_SALARY_PLAN_DETAIL:
            return Object.assign({}, state, {
                salaryDetail: action.salaryDetail
            });
            break;
        case types.CUSTOM_TEM:
            return Object.assign({}, state, {
                customTem    : action.customTem,
                errorMessage : action.errorMessage,
                mappingColumn: action.customTem
            });
            break;
        case types.GET_SALARY_CYLES:
            return Object.assign({}, state, {
                salaryCyles: action.salaryCyles
              });
              break;
        case types.SEND_BATCH:
            return Object.assign({}, state, {
                buildBatch: action.buildBatch
            });
            break;
        case types.CYLES_RECORD:
            return Object.assign({}, state, {
                cylesRecord: action.cylesRecord
            });
            break;
        case types.PERSON_RECORD:
            return Object.assign({}, state, {
                personRecord: action.personRecord
            });
            break;
        case types.PAYROLL_TAX_LIST:
            return Object.assign({}, state, {
                payrollTaxList: action.payrollTaxList
            });
            break;
        case types.PAYROLL_TAX_DETAIL:
            return Object.assign({}, state, {
                payrollTaxDetail: action.payrollTaxDetail
            });
            break;
        case types.PENDING_PAYROLL_TAX_DETAIL:
            return Object.assign({}, state, {
                pendingPayrollTaxDetail: action.pendingPayrollTaxDetail
            });
            break;
        case types.PAYROLL_PERSON_DETAIL:
            return Object.assign({}, state, {
                payrollPersonDetail: action.payrollPersonDetail
            });
            break;
        case types.PAYROLL_PERSON_RECORD:
            return Object.assign({}, state, {
                payrollPersonRecord: action.payrollPersonRecord
            });
            break;
        case types.SALARY_CYLES_DET:
            return Object.assign({}, state, {
                salaryCylesDet: action.salaryCylesDet
            });
            break;
        case types.PAYROLL_TAX_STATIC_DET:
            return Object.assign({}, state, {
                payrollTaxStaticDet: action.payrollTaxStaticDet
            });
            break;
        case types.SLIP_RECORD:
            return Object.assign({}, state, {
                slipRecord: action.slipRecord
             });
            break; 
        case types.GET_CUTOMER_SALARY_LIST:
            return Object.assign({}, state, {
                customerSalaryList: action.customerSalaryList,
                customerSalaryListCount: action.customerSalaryListCount
            });
            break;
        case types.GET_SALARY_DETAIL:
            return Object.assign({}, state, {
                salaryDetailList: action.salaryDetailList,
                salaryDetailListCount: action.salaryDetailListCount
            });
            break;
        case types.GET_SALARY_PLAN_DETAIL:
            return Object.assign({}, state, {
                salaryDetail: action.salaryDetail
            });
            break;
        case types.IMPORT_SALARY_CYLES:
            return Object.assign({}, state, {
                salary_is_import: action.salary_is_import
            });
            break;
        case types.MAPPING_COLUMN:
            return Object.assign({}, state, {
                mappingColumn: action.mappingColumn,
                mappings:action.mappings
             });
            break;
        case types.IMPORT_TAX_CYLES:
            return Object.assign({}, state, {
                tax_is_import: action.tax_is_import
            });
            break;
        case types.ABNORMSL_LIST:
            return Object.assign({}, state, {
                abnormalList: action.abnormalList
            });
            break;
        case types.TAX_INDEX_STATICS:
            return Object.assign({}, state, {
                taxIndexStatic: action.taxIndexStatic
            });
            break;
        case types.SALARY_INDEX_STATICS:
            return Object.assign({}, state, {
                salaryIndexStatic: action.salaryIndexStatic
            });
            break;
        case types.TAX_RECORD_DETAIL:
            return Object.assign({}, state, {
                taxRecordDetail: action.taxRecordDetail
            });
            break;
        case types.SALARY_RECORD_DETAIL:
            return Object.assign({}, state, {
                salaryRecordDetail: action.salaryRecordDetail
            });
            break;
        case types.SET_BANK_INFO:
            return Object.assign({}, state, {
                setBankInfo: action.setBankInfo
            });
            break;
        case types.LEGAL_ENTITY_LIST:
            return Object.assign({}, state, {
                legalEntityList: action.legalEntityList
            });
            break;
            //财务  ——积分管理
        case types.INTEGRAL_LIST:
            return Object.assign({}, state, {
                integral_list: action.integral_list
            });
            break; 
        case types.DRAWMONEY_LIST:
            return Object.assign({}, state, {
                drawMoney_list: action.drawMoney_list
            });
            break;
        case types.PAYSAlARY_TEM:
            return Object.assign({}, state, {
                paySalaryTem: action.paySalaryTem
            });
            break;
        case types.GET_SALARY_BILL:
            return Object.assign({}, state, {
                salaryBill: action.salaryBill
            });
            break;
        case types.GET_SALARY_USER_LIST:
            return Object.assign({}, state, {
                salaryUserList: action.salaryUserList
            });
            break;
        case types.USER_SALARY_BILL_DET:
            return Object.assign({}, state, {
                userSalaryBillDet: action.userSalaryBillDet
            });
            break;
        case types.SALARY_SEND_DETAIL_IN_CUSTOMER_LIST:
            return Object.assign({}, state, {
                salary_send_detail_in_customer_list: action.salary_send_detail_in_customer_list
            });
            break;
        case types.SENDSIMPLE_LIST:
            return Object.assign({}, state, {
                send_simple_list: action.send_simple_list
            });
            break;
        case types.SENDPERSONALSENDBATCH_LIST:
            return Object.assign({}, state, {
                sendPersonalSendBatch_list: action.sendPersonalSendBatch_list
            });
            break;
        case types.SALARY_RECORD_COUNT_BOTH:
            return Object.assign({}, state, {
                salaryRecordCountBoth: action.salaryRecordCountBoth
            });
            break;
        case types.WAIT_SEND_NATURAL_SIMPLE_LIST:
            return Object.assign({}, state, {
                waitSendNaturalSimpleList: action.waitSendNaturalSimpleList
            });
            break;
        case types.WAIT_SPECIAL_DEUCTION_SIMPLE_LIST:
            return Object.assign({}, state, {
                waitSpecialDeuctionSimpleList: action.waitSpecialDeuctionSimpleList
            });
            break;
        case types.TAX_ASSISTANCE_URL:
            return Object.assign({}, state, {
                taxAssistanceUrl: action.taxAssistanceUrl
            });
            break;
        case types.ERROR_IN_CACULATE_LIST:
            return Object.assign({}, state, {
                errorInCaculateList: action.errorInCaculateList
            });
            break;
        case types.GET_HAIXIA_ABSTRACT_LIST:
            return Object.assign({}, state, {
                haiXiaAbstractList: action.haiXiaAbstractList
            });
            return;
        case types.PAYTAXLIST:
            return Object.assign({}, state, {
                payTaxList: action.payTaxList
            });
            break;
        case types.PAYTAXSTATISTICS:
            return Object.assign({}, state, {
                payTaxStatistics: action.payTaxStatistics
            });
            break;
        case types.PAYTAXDETAIL:
            return Object.assign({}, state, {
                payTaxDetail: action.payTaxDetail
            });
            break;
        case types.PAYTAXDETAILSTATISTICS:
            return Object.assign({}, state, {
                payTaxDetailStatistics: action.payTaxDetailStatistics
            });
            break;
        case types.CONSOLIDATEDDATA:
            return Object.assign({}, state, {
                consolidatedData: action.consolidatedData
            });
            break;
        case types.SALARY_SETTING_STATE:
            return Object.assign({}, state, {
                salarySettingState: action.salarySettingState
            });
            break;
        case types.LEGALENTITIESACTION:
            return Object.assign({}, state, {
                legalEntityListData: action.legalEntityListData
            });
            break;
        case types.PROGRAMDATA:
            return Object.assign({}, state, {
                programData: action.programData
            });
            break;
        case types.SMARTTAXUPDATE:
            return Object.assign({}, state, {
                smartTaxUpdate: action.smartTaxUpdate
            });
            break;
        case types.HISTORYSALARYSTATISTICS:
            return Object.assign({}, state, {
                historySalaryStatistics: action.historySalaryStatistics
            });
            break;
        case types.SIMULATIONTAXLIST:
            return Object.assign({}, state, {
                SimulationTaxlist: action.SimulationTaxlist
            });
            break;
        case types.SIMULATIONTAXSTATIS:
            return Object.assign({}, state, {
                SimulationTaxStatis: action.SimulationTaxStatis
            });
            break;
        case types.SIMULATIONTAXDIFFERENCE:
            return Object.assign({}, state, {
                SimulationTaxDifference: action.SimulationTaxDifference
            });
            break;
        case types.CONSOLIDATED_DATA:
            return Object.assign({}, state, {
                consolidatedData: action.consolidatedData
            });
            break;
        case types.GET_SALARY_LIST_POWER:
            return Object.assign({}, state, {
                salaryList_power: action.salaryList_power
            });
            break;
        case types.INITIALIZE_SIMULATED_SAX_SIST:
            return Object.assign({}, state, {
                InitializeSimulatedTaxList: action.InitializeSimulatedTaxList
            });
            break;
        case types.TAX_IMPORT_RECORD:
            return Object.assign({}, state, {
                taxImportRecord: action.taxImportRecord
            });
            break;
        case types.GET_WALFARE_RECORDS_DETAIL:
            return Object.assign({}, state, {
                welfareRecordsDetail: action.welfareRecordsDetail
            });
            break;
        default:
            return state;
    }
}