employee.js 8.7 KB
import * as types from '../constants/ActionTypes';

const initialState = {
    employeeList  :{},
    employeeDetail:{},
    formDefind    :[],
    errorMeg      :'',
    is_fail_emp   :'',
    housingFund   :{},
    socialinsurance:{},
    empTemplate   :{},
    employeeNum   :{},
    entryTemplateDetail: null,
    templatesOptions: null,
    getServiceContracts:[],
    DimissionScheduleList:[],
    getResignationParticulars:[],
    getStaffServiceManagementList:[],
    getStaffServiceManagementDetails:{},
    empoyeeRecordList: {},
    empoyeeFailRecordList: {},
    getTemplateDetails:{},
    getTemplateDetailsFields:[],
    getContractsDetail:[],
    getPactList:[],
    getPactListDetails:{},
    getPactListDetailsFields:[],
    ManualQuestionsData:[],
    ManualQuestionsDetail:{},
    tmpDetailFields: [],
    tmpDetail: {},
    columnSettingsList: {},
    fieldValues: {},
};

export default function environment(state = initialState,action) {
    switch(action.type) {
      case types.LOAD_EMP_DEFIND:
          return Object.assign({}, state, {
              formDefind: action.formDefind
          });
        case types.GET_EMPLOYEE:
            return Object.assign({}, state, {
                employeeList: action.employeeList
            });
        case types.GET_EMPLOYEE_DETAIL:
            return Object.assign({}, state, {
                employeeDetail: action.employeeDetail
            });
        case types.GET_LEAVE_LIST:
            return Object.assign({}, state, {
                employeeList: action.employeeList
            });
        case types.GET_LEAVE_DET:
            return Object.assign({}, state, {
                employeeDetail: action.employeeDetail
            });
        case types.IS_FAIL_EMP:
            return Object.assign({}, state, {
                errorMeg:action.errorMeg,
                is_fail_emp: action.is_fail_emp
            });
        case types.LOAD_HOUSING_FUND:
                return Object.assign({}, state, {
                    housingFund: action.housingFund
                });
        case types.LOAD_SOCIALINSURANCE:
                return Object.assign({}, state, {
                    socialinsurance: action.socialinsurance
                });
        case types.EMP_TEMPLATE:
              return Object.assign({}, state, {
                  empTemplate: action.empTemplate
              });
        case types.EMP_NUM:
              return Object.assign({}, state, {
                  employeeNum: action.employeeNum
              });
        case types.ENTRY_TEMPLATE_LIST:
              return Object.assign({}, state, {
                  entryTemplateList: action.entryTemplateList
              });
        case types.ENTRY_TEMPLATE_DETAIL:
              return Object.assign({}, state, {
                  entryTemplateDetail: action.entryTemplateDetail,
                  formList: action.formList,
                  paperfileList: action.paperfileList,
                  efileList: action.efileList,
                  esign1List: action.esign1List,
                  esign2List: action.esign2List,
                  noticeList: action.noticeList

              });
        case types.CHEAN_TEMPLATEdETAIL_ACTION:
              return Object.assign({}, state, {
                  entryTemplateDetail: null
              });
        case types.FILTER_CONTRACT_PERIOD:
              return Object.assign({}, state, {
                templatesOptions: action.templatesOptions
              });
        case types.ENTRY_PROCESS_LIST:
              return Object.assign({}, state, {
                  entryProcessList: action.entryProcessList
              });
        case types.ENTRY_TEMPLATE_FORM_LIST:
              return Object.assign({}, state, {
                  myFormsListOption: action.myFormsListOption
              });
        case types.LOAD_MYSELF_FORM_DEFIND:
              return Object.assign({}, state, {
                  myselfFormDefineList: action.myselfFormDefineList
              });
        case types.LOAD_MYSELF_FORM_DETAIL:
              return Object.assign({}, state, {
                  myselfFormDefineDetail: action.myselfFormDefineDetail
              });
        case types.LOAD_JOIN_TASK_LIST:
              return Object.assign({}, state, {
                  joinTaskList: action.joinTaskList
              });
        case types.FILTER_CONTRACT_MODIFY:
              return Object.assign({}, state, {
                  contractsModifyList: action.contractsModifyList
              });
        case types.GETRESIGNATION:
              return Object.assign({}, state, {
                  DimissionScheduleList: action.DimissionScheduleList
              });
        case types.GETSERVICECONTRACTS:
              return Object.assign({}, state, {
                  getServiceContracts: action.getServiceContracts
              });
              
        case types.GET_RESIGNATIONPARTICULARS:
              return Object.assign({}, state, {
                  getResignationParticulars: action.getResignationParticulars
              });
        case types.GET_STAFFSERVICEMANAGEMENTLIST:
              return Object.assign({}, state, {
                  getStaffServiceManagementList: action.getStaffServiceManagementList
              });
        case types.PUT_STAFFSERVICEMANAGEMENTLIST:
              return Object.assign({}, state, {
                  getStaffServiceManagementList: action.getStaffServiceManagementList
              });          
        case types.GET_STAFFSERVICEMANAGEMENTDETAILS:
              return Object.assign({}, state, {
                  getStaffServiceManagementDetails: action.getStaffServiceManagementDetails
              });     
        case types.EMPOYEE_RECORD_LIST:
            return Object.assign({}, state, {
                empoyeeRecordList: action.empoyeeRecordList
            });
        case types.EMPOYEE_FAIL_RECORD_LIST:
            return Object.assign({}, state, {
                empoyeeFailRecordList: action.empoyeeFailRecordList
            });
        case types.GET_TEMPLATEDETAILS:
            return Object.assign({}, state, {
                getTemplateDetails: action.getTemplateDetails,
                getTemplateDetailsFields: action.getTemplateDetailsFields,
            });
        case types.GET_CONTRACTSDETAIL:
            return Object.assign({}, state, {
                getContractsDetail: action.getContractsDetail,
            });    
        case types.GET_PACTLIST:
            return Object.assign({}, state, {
                getPactList: action.getPactList,
            });    
        case types.GET_PACTLISTDETAILS:
            return Object.assign({}, state, {
                getPactListDetails: action.getPactListDetails,
                getPactListDetailsFields: action.getPactListDetailsFields,
            });    




        case types.EMP_NOTICE_LIST:
            return Object.assign({}, state, {
                empNoticeList: action.empNoticeList
            });
        case types.EMP_NOTICE_DETAIL:
             return Object.assign({}, state, {
                 empNoticeDetail: action.empNoticeDetail
        });
        case types.EMP_NOTICE_LIST_READ_RECEIPT:
             return Object.assign({}, state, {
                 empNoticeListReadReceipt: action.empNoticeListReadReceipt
        });
        case types.LOAD_EMP_FORM_LIST:
             return Object.assign({}, state, {
                 formBasicList: action.formBasicList
        });
        case types.MULTIPLE_TEMPLATE_LIST:
             return Object.assign({}, state, {
                 multipleTemplateList: action.multipleTemplateList
        });
        case types.MULTIPLE_TEMPLATE_DETAIL:
             return Object.assign({}, state, {
                 tmpDetail: action.tmpDetail
        });
        case types.GETMANUALQUESTIONS:
             return Object.assign({}, state, {
                 ManualQuestionsData: action.ManualQuestionsData
        });
        case types.MANUALQUESTIONSDETAIL:
             return Object.assign({}, state, {
                 ManualQuestionsDetail: action.ManualQuestionsDetail
        });
        case types.EMPLOYEE_TMP_TOOBARS:
            return Object.assign({}, state, {
                tmpDetailFields: action.tmpDetailFields,
            })
            break
        case types.EMPLOYEE_TMP_DETAIL:
            return Object.assign({}, state, {
              tmpDetail: action.tmpDetail,
              tmpDetailFields: action.tmpDetailFields
            })
            break
        case types.LIST_COLUMN_SETTING_DETAILE:
            return Object.assign({}, state, {
                columnSettingsList: action.columnSettingsList,
            })
            break
        case types.APPLICATION_FILEDS_VALUES:
            return Object.assign({}, state, {
                fieldValues: action.fieldValues,
            })
            break
        default:
            return state;
    }
}