12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- import axios from '@utils/ajax';
- import store from '@store';
- import { searchList,resetLabel,getHospitalInspectList,getHospitalInspectDetailList } from '../actions/inspect';
- import { SET_TIPS } from '../types/pushMessage';
- import { Notify} from '@commonComp';
- export const getSearchList = (val) => {
- if(val.trim() == ''){
- const data = [];
- return (dispatch) => dispatch(searchList(data,''));
- }
- let baseList = store.getState();
- let sex = baseList.patInfo.message.patientSex;
- return (dispatch) => {
- axios.json('/retrieval/getTagInfos',{
- type:'5',
- age:baseList.patInfo.message.patientAge,
- inputStr:val,
- sexType:sex == '男'?'1' : sex == '女'?'2':'3'
- })
- .then((res)=>{
- const data = res.data.data;
- dispatch(searchList(data,val.trim()));
- })
- }
- };
- export const getSublableList = (id,idx) => {
- let baseList = store.getState();
- let sex = baseList.patInfo.message.patientSex;
- return (dispatch) => {
- axios.json('/questionInfo/getById',{
- age:baseList.patInfo.message.patientAge,
- sexType:sex == '男'?'1' : sex == '女'?'2':'3',
- id: id
- })
- .then((res)=>{
- const data = res.data.data;
- if (data.controlType == 0) {
- dispatch(resetLabel(data.questionMapping,data.uniqueName||''));
- }else if(data.controlType == 1){
- let arr = [];
- arr[0] = data;
- dispatch(resetLabel(arr));
- }else if(data.controlType == 6) {
- let arr =[];
- arr[0] = data;
- dispatch(resetLabel(arr));
- }
- })
- }
- };
- 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 getSonDetailList = (name) => {
- return (dispatch) => {
- axios.json('/dockingImport/getByGroupNameLisData',{groupName:name})
- .then((res)=>{
- const data = res.data.data;
- dispatch(getHospitalInspectDetailList(data,name))
- })
- }
- };
|