inspect.js 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. import axios from '@utils/ajax';
  2. import store from '@store';
  3. import { searchList,resetLabel,getHospitalInspectList,getHospitalInspectDetailList } from '../actions/inspect';
  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:'5',
  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. };
  26. export const getSublableList = (id,idx) => {
  27. let baseList = store.getState();
  28. let sex = baseList.patInfo.message.patientSex;
  29. return (dispatch) => {
  30. axios.json('/questionInfo/getById',{
  31. age:baseList.patInfo.message.patientAge,
  32. sexType:sex == '男'?'1' : sex == '女'?'2':'3',
  33. id: id
  34. })
  35. .then((res)=>{
  36. const data = res.data.data;
  37. if (data.controlType == 0) {
  38. dispatch(resetLabel(data.questionMapping,data.uniqueName||''));
  39. }else if(data.controlType == 1){
  40. let arr = [];
  41. arr[0] = data;
  42. dispatch(resetLabel(arr));
  43. }else if(data.controlType == 6) {
  44. let arr =[];
  45. arr[0] = data;
  46. dispatch(resetLabel(arr));
  47. }
  48. })
  49. }
  50. };
  51. export const getImportList = (data) => {
  52. const state = store.getState();
  53. const patientInfo = state.patInfo.message;
  54. let param = {
  55. "endTime": data.endTime,
  56. "startTime": data.startTime,
  57. "hospitalCode": patientInfo.hospitalCode,
  58. "inquiryCode": patientInfo.recordId,
  59. "patientId": patientInfo.patientId,
  60. }
  61. return (dispatch) => {
  62. axios.json('/dockingImport/lisDockingImports',param)
  63. .then((res)=>{
  64. const data = res.data.data;
  65. dispatch(getHospitalInspectList(data.lisRetrieveData))
  66. })
  67. }
  68. };
  69. export const getSonDetailList = (name) => {
  70. return (dispatch) => {
  71. axios.json('/dockingImport/getByGroupNameLisData',{groupName:name})
  72. .then((res)=>{
  73. const data = res.data.data;
  74. dispatch(getHospitalInspectDetailList(data,name))
  75. })
  76. }
  77. };