|
@@ -1,4 +1,4 @@
|
|
-import { SET_DIAG_TO_MAINSUIT } from '@store/types/diagnosticList';
|
|
|
|
|
|
+import { SET_DIAG_TO_MAINSUIT, SET_CHRONIC_MAG_ITEM, SHOW_REFER_RECORD } from '@store/types/diagnosticList';
|
|
import {getAllDataList,getAllDataStringList,isAllClear,filterDataArr} from '@utils/tools';
|
|
import {getAllDataList,getAllDataStringList,isAllClear,filterDataArr} from '@utils/tools';
|
|
import {getChronic} from '@store/async-actions/homePage.js';
|
|
import {getChronic} from '@store/async-actions/homePage.js';
|
|
import {storageLocal} from '@utils/tools'
|
|
import {storageLocal} from '@utils/tools'
|
|
@@ -38,21 +38,42 @@ export const isChronicMag = (item) => {
|
|
let jsonStr = getAllDataStringList(state);
|
|
let jsonStr = getAllDataStringList(state);
|
|
let flg = isAllClear(jsonData,jsonStr,state);
|
|
let flg = isAllClear(jsonData,jsonStr,state);
|
|
if(!flg) {
|
|
if(!flg) {
|
|
- console.log('页面为空');
|
|
|
|
// 从缓存取慢病列表
|
|
// 从缓存取慢病列表
|
|
let chronicList = JSON.parse(storageLocal.get('chronic'));
|
|
let chronicList = JSON.parse(storageLocal.get('chronic'));
|
|
if(!chronicList){
|
|
if(!chronicList){
|
|
- getChronic();
|
|
|
|
- chronicList = JSON.parse(storageLocal.get('chronic'));
|
|
|
|
- }
|
|
|
|
- console.log(999,chronicList)
|
|
|
|
- for(let i=0; i<chronicList.length; i++){
|
|
|
|
- if(chronicList[i].id==item.id&&chronicList[i].name==item.name){
|
|
|
|
- //弹窗提示 “是否引用往期病例”?--往期病例接口、弹窗、引用
|
|
|
|
- // 是--引用 否--走慢病流程
|
|
|
|
- console.log("是慢病1111!")
|
|
|
|
- }
|
|
|
|
|
|
+ getChronic().then(() =>{
|
|
|
|
+ chronicList = JSON.parse(storageLocal.get('chronic'));
|
|
|
|
+ for(let i=0; i<chronicList.length; i++){
|
|
|
|
+ if(chronicList[i].id==item.id&&chronicList[i].name==item.name){
|
|
|
|
+ //弹窗提示 “是否引用往期病例”?--往期病例接口、弹窗、引用
|
|
|
|
+ // 是--引用 否--走慢病流程
|
|
|
|
+ dispatch({
|
|
|
|
+ type: SET_CHRONIC_MAG_ITEM,
|
|
|
|
+ chronicMagItem: item
|
|
|
|
+ })
|
|
|
|
+ dispatch({
|
|
|
|
+ type: SHOW_REFER_RECORD
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ } else {
|
|
|
|
+ console.log(999,chronicList)
|
|
|
|
+ for(let i=0; i<chronicList.length; i++){
|
|
|
|
+ if(chronicList[i].id==item.id&&chronicList[i].name==item.name){
|
|
|
|
+ //弹窗提示 “是否引用往期病例”?--往期病例接口、弹窗、引用
|
|
|
|
+ // 是--引用 否--走慢病流程
|
|
|
|
+ dispatch({
|
|
|
|
+ type: SET_CHRONIC_MAG_ITEM,
|
|
|
|
+ chronicMagItem: item
|
|
|
|
+ })
|
|
|
|
+ dispatch({
|
|
|
|
+ type: SHOW_REFER_RECORD
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|