import axios from '@utils/ajax';
import store from '@store';

import { getHospitalInspectList,getHospitalInspectDetailList } from '../actions/wrapModalBody';
export const getImportList = (data) => {
  const state = store.getState();
  const patientInfo = state.patInfo.message;
    let param = {
      "endTime": data.endTime,
      "startTime": data.startTime,
      "hospitalCode": patientInfo.hospitalCode,
      "inquiryCode": patientInfo.recordId,
      "patientId": patientInfo.patientId,
    }
    return (dispatch) => {
        axios.json('/dockingImport/lisDockingImports',param)
        .then((res)=>{
            const data = res.data.data;
            dispatch(getHospitalInspectList(data.lisRetrieveData))
        })
    }
};
export const getSonDetailLists = (name,time) => {
    return (dispatch) => {
        axios.json('/dockingImport/getByGroupNameLisData',{groupName:name})
        .then((res)=>{
            const data = res.data.data;
            dispatch(getHospitalInspectDetailList(data,name,time))
        })
    }
};
