mfmf 3 anni fa
parent
commit
0fb5c31123

+ 1 - 1
src/api/index.js

@@ -1,7 +1,7 @@
 import api from './request';
 import { Modal } from 'antd';
 const axios=require('axios');
-// axios.defaults.baseURL = 'http://192.168.2.237:8871';//'http://192.168.2.237:8871/';
+axios.defaults.baseURL = 'http://192.168.2.237:8871';//'http://192.168.2.237:8871/';
 const CancelToken = axios.CancelToken;
 const source = CancelToken.source();
 const post=(url,data)=>{

+ 22 - 2
src/components/AHeader/index.js

@@ -13,7 +13,7 @@ import down from '@images/down.png';
 import './index.less'
 import { message } from "antd/lib/index";
 import { add, active } from '@reducers/tabPanes'
-import { setUnReadNum, setRegularNum, setRulerNum, setProblemNum, setLossNum } from '@reducers/userInfo.js';
+import { setUnReadNum, setRegularNum, setRulerNum, setProblemNum, setLossNum, setDiagNum, setDocNum, setDrugNum, setDutyNum, setSurgeryNum } from '@reducers/userInfo.js';
 import apiObj from '@api/index';
 
 const { post, api, xPost } = apiObj;
@@ -38,7 +38,7 @@ function AHeader({ history, hideName }) {
     const hospitalId = localStorage.getItem("hospitalId");
     const softwareArr = JSON.parse(localStorage.getItem("software"));
 
-    const { user, unReadNum, regularNum, rulerNum, problemNum, lossNum } = useSelector((state) => {
+    const { user, unReadNum, regularNum, rulerNum, problemNum, lossNum, diagNum, docNum, drugNum, dutyNum, surgeryNum } = useSelector((state) => {
         return state.userInfo;
     });
     //退出
@@ -69,6 +69,26 @@ function AHeader({ history, hideName }) {
             count = lossNum
             count++
             dispatch(setLossNum(count));
+        } else if (activeTab.split('&')[0] == "JCSJ-ZDXXWH") {
+            count = diagNum
+            count++
+            dispatch(setDiagNum(count));
+        } else if (activeTab.split('&')[0] == "JCSJ-WSMBWH") {
+            count = docNum
+            count++
+            dispatch(setDocNum(count));
+        } else if (activeTab.split('&')[0] == "JCSJ-YPXXWH") {
+            count = drugNum
+            count++
+            dispatch(setDrugNum(count));
+        } else if (activeTab.split('&')[0] == "JCSJ-ZWZCBGJL") {
+            count = dutyNum
+            count++
+            dispatch(setDutyNum(count));
+        } else if (activeTab.split('&')[0] == "JCSJ-SSXXWH") {
+            count = surgeryNum
+            count++
+            dispatch(setSurgeryNum(count));
         }
     }
     //获取未读消息数量

+ 8 - 3
src/components/DiagManager/index.js

@@ -1,6 +1,7 @@
 import React, { useState, useEffect } from 'react';
 import { Empty,ConfigProvider,Spin,Form, Input, Button, Table, Select, Space, Modal, message, Row, Col } from 'antd';
 import { PlusOutlined } from '@ant-design/icons';
+import { useSelector } from 'react-redux';
 import AddDiag from './addDiag'
 import '@common/common.less';
 import apiObj from '@api/index';
@@ -9,9 +10,13 @@ const { post, api } = apiObj;
 const { Option } = Select;
 //获取列表
 function DiagManager() {
-  useEffect(() => {
-    getDiseasePage();
-  }, []);
+  	const { diagNum } = useSelector((state) => {
+  		return state.userInfo;
+  	});
+  	useEffect(() => {
+  	    form.resetFields();
+  	    getDiseasePage();
+  	}, [diagNum]);
   const [DiagList, setDiagList] = useState([]);//当前页列表数据
   const [Diagid, setDiagid] = useState([]);//当前操作行id
   const [title, setTitle] = useState("");//新增/修改的弹窗标题

+ 7 - 2
src/components/DocTemplate/index.js

@@ -1,13 +1,18 @@
 import React, { useState, useEffect } from 'react';
 import { Form, Input, Button, Table, Modal, Row, Col,message } from 'antd';
 import '@common/common.less';
+import { useSelector } from 'react-redux';
 import apiObj from '@api/index';
 import "moment/locale/zh-cn"
 const { post, api } = apiObj;
 function DocTemplate() {
+  const { docNum } = useSelector((state) => {
+  	return state.userInfo;
+  });
   useEffect(() => {
-	getDocTemplate();
-  }, []);
+      form.resetFields();
+      getDocTemplate();
+  }, [docNum]);
   const [logList, setLogList] = useState([]);
   const [total, setTotal] = useState(0);
   const [size, setSize] = useState(15);

+ 7 - 2
src/components/DrugManager/index.js

@@ -2,6 +2,7 @@ import React, { useState, useEffect } from 'react';
 import { Empty,ConfigProvider,Spin,Form, Input, Button, Table, Select, Space, Modal, message, Row, Col } from 'antd';
 import { PlusOutlined } from '@ant-design/icons';
 import AddTerm from '../DiagManager/addDiag'
+import { useSelector } from 'react-redux';
 import '@common/common.less';
 import apiObj from '@api/index';
 
@@ -9,9 +10,13 @@ const { post, api } = apiObj;
 const { Option } = Select;
 //获取列表
 function DrugManager() {
+  const { drugNum } = useSelector((state) => {
+  	return state.userInfo;
+  });
   useEffect(() => {
-	getDrugeryPage();
-  }, []);
+      form.resetFields();
+      getDrugeryPage();
+  }, [drugNum]);
   const [DrugList, setDrugList] = useState([]);//当前页列表数据
   const [Drugid, setDrugid] = useState([]);//当前操作行id
   const [title, setTitle] = useState("");//新增/修改的弹窗标题

+ 7 - 2
src/components/DutyRecord/index.js

@@ -1,5 +1,6 @@
 import React, { useState, useEffect, useRef } from 'react';
 import { Form, Input, Button, Table, Pagination, Row, Col, Select, Modal, DatePicker } from 'antd';
+import { useSelector } from 'react-redux';
 import '@common/common.less';
 import apiObj from '@api/index';
 import moment from "moment";
@@ -10,9 +11,13 @@ const { post, api, xPost } = apiObj;
 const { RangePicker } = DatePicker;
 const { Option } = Select;
 function DutyRecord() {
+	const { dutyNum } = useSelector((state) => {
+		return state.userInfo;
+	});
 	useEffect(() => {
-		getDutyRecord();
-	}, []);
+	    form.resetFields();
+	    getDutyRecord();
+	}, [dutyNum]);
 	let today = getNowFormatDate()
 	let lastmonthday= getlastmonthday()
 	const [logList, setLogList] = useState([]);

+ 8 - 3
src/components/SurgeryManager/index.js

@@ -1,5 +1,6 @@
 import React, { useState, useEffect } from 'react';
-import { Empty,ConfigProvider,Spin,Form, Input, Button, Table, Select, Space, Modal, message, Row, Col } from 'antd';
+import { useSelector } from 'react-redux';
+import { Empty,ConfigProvider,Form, Input, Button, Table, Select, Space, Modal, message, Row, Col } from 'antd';
 import { PlusOutlined } from '@ant-design/icons';
 import AddTerm from '../DiagManager/addDiag'
 import '@common/common.less';
@@ -9,9 +10,13 @@ const { post, api } = apiObj;
 const { Option } = Select;
 //获取列表
 function SurgManager() {
+  const { surgeryNum } = useSelector((state) => {
+  	return state.userInfo;
+  });
   useEffect(() => {
-	getSurgeryPage();
-  }, []);
+      form.resetFields();
+      getSurgeryPage();
+  }, [surgeryNum]);
   const [SurgList, setSurgList] = useState([]);//当前页列表数据
   const [Surgid, setSurgid] = useState([]);//当前操作行id
   const [title, setTitle] = useState("");//新增/修改的弹窗标题

+ 22 - 2
src/store/reducers/userInfo.js

@@ -8,7 +8,12 @@ export const slice = createSlice({
         regularNum: 0,
         rulerNum: 0,
         problemNum: 0,
-        lossNum: 0
+        lossNum: 0,
+		diagNum: 0,
+		docNum: 0,
+		drugNum: 0,
+		dutyNum: 0,
+		surgeryNum: 0
     },
     reducers: {
         add: (state, action) => {        //添加token
@@ -41,9 +46,24 @@ export const slice = createSlice({
         setLossNum(state, action) {
             state.lossNum = action.payload;
         },
+		setDiagNum(state, action) {
+		    state.diagNum = action.payload;
+		},
+		setDocNum(state, action) {
+		    state.docNum = action.payload;
+		},
+		setDrugNum(state, action) {
+		    state.drugNum = action.payload;
+		},
+		setDutyNum(state, action) {
+		    state.dutyNum = action.payload;
+		},
+		setSurgeryNum(state, action) {
+		    state.surgeryNum = action.payload;
+		}
     },
 });
 
-export const { remove, add, setSys, setUser, setUnReadNum, setRegularNum, setRulerNum, setProblemNum, setLossNum } = slice.actions;
+export const { remove, add, setSys, setUser, setUnReadNum, setRegularNum, setRulerNum, setProblemNum, setLossNum, setDiagNum, setDocNum, setDrugNum, setDutyNum, setSurgeryNum } = slice.actions;
 
 export default slice.reducer;