Parcourir la source

清空指标数据已填数据

zhouna il y a 6 ans
Parent
commit
ca47ecba83

+ 2 - 0
src/store/actions/pushMessage.js

@@ -260,6 +260,8 @@ export const clearAllPushMessage = (state, action) => {
 	res.assay = [];
 	res.check = [];
 	res.chronicPushItems = [];//量表
+	res.formulaResult = {};   //量表计算结果
+	res.scaleInfo = {};			//量表选中项
 	res.drugList = []; //开单药品列表
 	return res;
 }

+ 9 - 1
src/store/reducers/assessResult.js

@@ -1,5 +1,5 @@
 import {SET_ASSESS_DATA,SET_INDEX_DATA,SET_SAVE_ASSESS_DATA,SET_INDEX_SUB_TYPE,ADD_ASSESS_ITEMS,
-  REMOVE_ASSESS_ITEMS,CLEAR_INDEX_DATA,SET_CHRONIC_CALCU_RESULT,ADD_WHOLE_SCALE_ITEMS,SET_CALCU_VALUES} from '@types/assessResult';
+  REMOVE_ASSESS_ITEMS,CLEAR_INDEX_DATA,SET_CHRONIC_CALCU_RESULT,ADD_WHOLE_SCALE_ITEMS,SET_CALCU_VALUES,CLEAR_ASSESS_RESULT_VALUE} from '@types/assessResult';
 import config from "@config";
 
 const init = {
@@ -46,6 +46,14 @@ export default (state=init,action)=>{
       res.indexData = {};
       res.indexTimeTypes = {};
       return res;
+    case CLEAR_ASSESS_RESULT_VALUE:
+      res.addedScaleIds = [];
+      res.calcuResult = {};
+      res.calcuValues = {};
+      res.wholeAssess = [];
+      res.wholeIndexs = {};
+      res.wholeResults = {};
+      return res;
     case SET_INDEX_SUB_TYPE:
       if(!index){
         return res;

+ 2 - 1
src/store/types/assessResult.js

@@ -7,4 +7,5 @@ export const REMOVE_ASSESS_ITEMS = 'REMOVE_ASSESS_ITEMS';  //整体评估删除
 export const CLEAR_INDEX_DATA = 'CLEAR_INDEX_DATA';     //删除图表数据
 export const SET_CHRONIC_CALCU_RESULT = 'SET_CHRONIC_CALCU_RESULT';   //保存评估中计算结果
 export const ADD_WHOLE_SCALE_ITEMS  = 'ADD_WHOLE_SCALE_ITEMS';    //从全部量表中添加的整体评估
-export const SET_CALCU_VALUES = 'SET_CALCU_VALUES';  //保存计算公式数据
+export const SET_CALCU_VALUES = 'SET_CALCU_VALUES';  //保存计算公式数据
+export const CLEAR_ASSESS_RESULT_VALUE = 'CLEAR_ASSESS_RESULT_VALUE';       //清空加入病例及指标推送的数据

+ 6 - 2
src/utils/tools.js

@@ -10,8 +10,8 @@ import {CLEAR_ALL_PUSH_MESSAGE, SET_TIPS} from '@store/types/pushMessage';
 import {ISREAD, SETREADDITEMS} from "../store/types/homePage";
 import {CLEAR_FIRST_MAIN_DIAG, CLEAR_ALL_TREAT} from "../store/types/treat";
 import {tabChange} from '@store/actions/tabTemplate';
+import {CLEAR_ASSESS_RESULT_VALUE} from '@types/assessResult';
 import config from '@config/index.js';
-import $ from 'jquery';
 import up from '@images/up.png';
 import down from '@images/down.png';
 
@@ -259,7 +259,11 @@ const pushAllDataList =(whichSign,action,reData,type) =>{           //回读清
         });
         store.dispatch({
           type: CLEAR_ALL_TREAT,
-        })
+        });
+        //清空已选的指标推送数据及填的值
+        store.dispatch({
+          type: CLEAR_ASSESS_RESULT_VALUE,
+        });
         storageLocal.remove('emrParam');
        // Notify.success('页面已清空')
     }else{