assistCheck.js 826 B

1234567891011121314151617181920212223242526
  1. import axios from '@utils/ajax';
  2. import store from '@store';
  3. import { searchList } from '../actions/assistCheck';
  4. import { SET_TIPS } from '../types/pushMessage';
  5. import { Notify} from '@commonComp';
  6. export const getSearchList = (val) => {
  7. if(val.trim() == ''){
  8. const data = [];
  9. return (dispatch) => dispatch(searchList(data,''));
  10. }
  11. let baseList = store.getState();
  12. let sex = baseList.patInfo.message.patientSex;
  13. return (dispatch) => {
  14. axios.json('/retrieval/getTagInfos',{
  15. type:'6',
  16. age:baseList.patInfo.message.patientAge,
  17. inputStr:val,
  18. sexType: sex == '男'?'1' : sex == '女'?'2':'3'
  19. })
  20. .then((res)=>{
  21. const data = res.data.data;
  22. dispatch(searchList(data,val.trim()));
  23. })
  24. }
  25. };