preIcss.js 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. import {json} from '@utils/ajax';
  2. import store from '@store';
  3. import {getUrlArgObject} from '@utils/tools';
  4. import { GET_PREC_LIST,SET_PREC_SHOW } from "../types/preIcss";
  5. import config from '@config/index';
  6. export const getPreMsg = () => {
  7. // return (dispatch) => {
  8. // let baseList = getState();
  9. // let state = baseList.patInfo.message;
  10. const inCode = config.preIcss.recordIdVal===-1?getUrlArgObject("recordId"):config.preIcss.recordIdVal;
  11. json('/api/prec/inquiryInfo/hisInquirys', {
  12. "hospitalCode": getUrlArgObject('hospitalId'),
  13. "inquiryCode":inCode,
  14. "isHaveDetail":1,
  15. "patientCode": getUrlArgObject("patientNo"),
  16. "dayLimit":config.preIcss.deadline===-1?undefined:config.preIcss.deadline
  17. },true).then((res) => {
  18. const data = res.data;
  19. if (data.code == 0) {
  20. let result = data.data;
  21. if(result.length > 0){
  22. store.dispatch({type:SET_PREC_SHOW})
  23. }
  24. store.dispatch({type:GET_PREC_LIST,preData:result});
  25. } else {
  26. // console.log(res)
  27. }
  28. })
  29. // }
  30. }