瀏覽代碼

1.ie8自动转换中文为unicode导致判断有误
2.阴影改为边框
3.主诉现病史删除得到数组里有空元素处理

Luolei 6 年之前
父節點
當前提交
23f6f91a57

+ 4 - 4
src/common/less/variables.less

@@ -57,8 +57,8 @@
   top:30px;
   background: #fff;
   box-shadow: 0 10px 20px 0 #989DA3;
-  filter:progid:DXImageTransform.Microsoft.Shadow(color='#989DA3',Direction=125,Strength=6);
-  border: 1px solid #f3f0f0;
+  // filter:progid:DXImageTransform.Microsoft.Shadow(color='#989DA3',Direction=125,Strength=6);
+  border: 1px solid #dedede;
   z-index: 203;
   padding: 20px;
   white-space: nowrap;
@@ -159,6 +159,6 @@
 
 .llStyle{
   box-shadow: 0 10px 20px 0 #989DA3;
-  filter:progid:DXImageTransform.Microsoft.Shadow(color='#989DA3',Direction=125,Strength=6);
-  border: 1px solid #f3f0f0;
+  // filter:progid:DXImageTransform.Microsoft.Shadow(color='#989DA3',Direction=125,Strength=6);
+  border: 1px solid #dedede;
 }

+ 3 - 1
src/components/DiagResultSearch/index.less

@@ -4,10 +4,12 @@
     width: 316px;
     margin: 0 10px 10px;
     padding: 0 8px;
-    box-shadow: 0 6px 20px 0 #989DA3;
+    // box-shadow: 0 6px 20px 0 #989DA3;
     background: #fff;
     z-index: 99;
     margin-bottom: 80px;
+    .llStyle;
+    
 }
 .search {
     width: 100%;

+ 37 - 39
src/components/Operation/index.jsx

@@ -6,7 +6,7 @@ import saveHistory from '@common/images/saveHistory.png';
 import PrintPreviewContainer from '@containers/PrintPreviewContainer';
 import PreviewContainer from '@containers/PreviewContainer';
 import { ConfirmModal, Notify } from '@commonComp';
-import {getAllDataList,getAllDataStringList} from '@utils/tools';
+import {getAllDataList,getAllDataStringList,isAllClear} from '@utils/tools';
 import store from '@store';
 
 
@@ -94,7 +94,10 @@ class Operation extends Component {
     }
   }
   clearAll(type) {
-    let flg = this.isClear();
+    let baseList = store.getState();
+    let jsonData = getAllDataList(baseList);
+    let jsonStr = getAllDataStringList(baseList);
+    let flg = isAllClear(jsonData,jsonStr);
     if(flg){
       this.setState({
         type: type,
@@ -106,6 +109,8 @@ class Operation extends Component {
       })
       
       this.props.diagShowTmp(true)
+    }else{
+      Notify.info('当前页面数据已清空');
     }
   }
   isClear(){
@@ -180,51 +185,44 @@ class Operation extends Component {
     let jsonStr = getAllDataStringList(baseList);
     let whichSign = baseList.typeConfig.typeConfig;
     let tmpLis = baseList.tabTemplate.items;
+    // console.log(jsonStr.present,'2222')
     for(let i = 0;i <tmpLis.length;i++){
       let dataStr = tmpLis[i].preview;
       let jsStr = tmpLis[i].dataJson;
-      // console.log(JSON.stringify(JSON.parse(dataStr)))
-      // console.log(JSON.stringify(jsonStr))
-      if(JSON.stringify(JSON.parse(dataStr)) == JSON.stringify(jsonStr) && jsStr == JSON.stringify(jsonData)){
+      // console.log(JSON.stringify(eval('('+JSON.parse(dataStr).chief+')')),111)
+      // if(JSON.stringify(eval('('+JSON.stringify(JSON.parse(dataStr))+')')) == JSON.stringify(jsonStr) && jsStr == JSON.stringify(jsonData)){
+      //   Notify.info('该模板已保存');
+      //   return false;
+      // }
+      if(
+        jsonStr.chief == JSON.stringify(eval('('+JSON.parse(dataStr).chief+')')) && 
+        jsonStr.present == JSON.stringify(eval('('+JSON.parse(dataStr).present+')')) && 
+        jsonStr.other == JSON.stringify(eval('('+JSON.parse(dataStr).other+')')) && 
+        jsonStr.vital == JSON.stringify(eval('('+JSON.parse(dataStr).vital+')'))  &&
+        JSON.stringify(jsonData.chief) == JSON.stringify(JSON.parse(jsStr).chief) &&    
+        JSON.stringify(jsonData.present) == JSON.stringify(JSON.parse(jsStr).present) &&    
+        JSON.stringify(jsonData.other) == JSON.stringify(JSON.parse(jsStr).other) &&      
+        JSON.stringify(jsonData.vital) == JSON.stringify(JSON.parse(jsStr).vital) &&   
+        JSON.stringify(jsonData.lis) == JSON.stringify(JSON.parse(jsStr).lis) &&  
+        JSON.stringify(jsonData.pacs) == JSON.stringify(JSON.parse(jsStr).pacs) &&     
+        JSON.stringify(jsonData.diag) == JSON.stringify(JSON.parse(jsStr).diag) &&    
+        JSON.stringify(jsonData.advice) == JSON.stringify(JSON.parse(jsStr).advice) &&      
+        JSON.stringify(jsonData.mainSuitSelecteds) == JSON.stringify(JSON.parse(jsStr).mainSuitSelecteds) &&      
+        JSON.stringify(jsonData.currentIllSelecteds) == JSON.stringify(JSON.parse(jsStr).currentIllSelecteds) &&     
+        JSON.stringify(jsonData.otherHistorySelecteds) == JSON.stringify(JSON.parse(jsStr).otherHistorySelecteds) && 
+        JSON.stringify(jsonData.checkBodySelecteds) == JSON.stringify(JSON.parse(jsStr).checkBodySelecteds) &&     
+        JSON.stringify(jsonData.addItems) == JSON.stringify(JSON.parse(jsStr).addItems)    
+      ){
         Notify.info('该模板已保存');
         return false;
       }
     }
-    if (whichSign == 0) {
-      if (
-        JSON.stringify(jsonData.advice) == '{}' &&
-        (jsonData.chief.length < 1 && jsonStr.chief == '[]') &&
-        jsonData.diag.length < 1 &&
-        jsonData.vital.length < 1 &&
-        jsonData.other.length < 1 &&
-        jsonData.pacs.length < 1 &&
-        jsonData.present.length < 1 &&
-        jsonData.lis.labelList.length < 1 &&
-        jsonData.lis.getExcelDataList.length < 1
-      ) {
-        Notify.info('模板数据不能为空');
-        return false;
-      }else{
-        return true;
-      }
-    } else if(whichSign == 1) {
-      if (JSON.stringify(jsonData.advice) == '{}' && 
-          jsonStr.chief == '[]' && 
-          jsonStr.present == '[]' && 
-          jsonStr.other == '[]' && 
-          jsonData.vital.length < 1 && 
-          jsonData.diag.length < 1 && 
-          jsonData.pacs.length < 1 && 
-          jsonData.lis.labelList.length < 1 && 
-          jsonData.lis.getExcelDataList.length < 1
-        ) {
-        Notify.info('模板数据不能为空');
-        return false;
-      }else{
-        return true;
-      }
+    let flg = isAllClear(jsonData,jsonStr)
+    if(!flg){
+      Notify.info('模板数据不能为空')
+      return false
     }else{
-      return true;
+      return true
     }
   }
   changeTitle() {

+ 1 - 1
src/containers/CurrentIll.js

@@ -12,7 +12,7 @@ import {getModule} from '@store/async-actions/fetchModules.js';
 import {didPushParamChange} from '@utils/tools.js';
 
 
-function mapStateToProps(state) { 
+function mapStateToProps(state) {
   const {homePage} = state;
     return {
         data:state.currentIll.data,//主诉模板

+ 0 - 1
src/store/actions/print.js

@@ -30,7 +30,6 @@ export const saveMessage=(state,action)=>{
 
 export const diagShow=(state,action)=>{
   const res=Object.assign({},state);
-  console.log(action)
   res.diagShow = action.data
   return res;
 };

+ 3 - 3
src/store/async-actions/patInfo.js

@@ -95,8 +95,8 @@ export const getPatientMessage = (dispatch, getState) => {
         confirmType:data1.modeValue
       });
       dispatch(getInitModules);     //确保病人信息获取以后再获取模板等数据,否则参数为空
-      if(state.tabTemplate.items.length == 0){
-        dispatch(initItemList(data1.modeValue));        //模板列表没有就获取模板列表用于保存时做数据对比是否保存过
-      }
+      // if(state.tabTemplate.items.length == 0){
+      //   dispatch(initItemList(data1.modeValue));        //模板列表没有就获取模板列表用于保存时做数据对比是否保存过
+      // }
     })
 };

+ 4 - 4
src/store/reducers/assistCheck.js

@@ -39,7 +39,7 @@ export default (state = initSearchList, action) => {
             }
         }
         for (let j = 0; j < tempArrs.length; j++) {
-            tmpString += (tempArrs[j].name+(tempArrs[j].value?(':'+tempArrs[j].value):'')+(tempArrs[j].time?'报告日期:'+tempArrs[j].time:'')+';')
+            tmpString += (tempArrs[j].name+(tempArrs[j].value?(':'+tempArrs[j].value):'')+(tempArrs[j].time?', 报告日期:'+tempArrs[j].time:'')+';')
         }
         newState.dataString = tmpString
         return newState;
@@ -54,7 +54,7 @@ export default (state = initSearchList, action) => {
             return
         }
         for (let i = 0; i < tempArr.length; i++) {
-            tmpString += (tempArr[i].name+(tempArr[i].value?(':'+tempArr[i].value):'')+(tempArr[i].time?'报告日期:'+tempArr[i].time:'')+';')
+            tmpString += (tempArr[i].name+(tempArr[i].value?(':'+tempArr[i].value):'')+(tempArr[i].time?', 报告日期:'+tempArr[i].time:'')+';')
         }
         newState.assistLabel = [...tempArr]
         newState.dataString = tmpString
@@ -69,7 +69,7 @@ export default (state = initSearchList, action) => {
                 tempArr[i].value = action.val
                 newState.assistLabel = [...tempArr]
             }
-            tmpString += (tempArr[i].name+(tempArr[i].value?(':'+tempArr[i].value):'')+(tempArr[i].time?'报告日期:'+tempArr[i].time:'')+';')
+            tmpString += (tempArr[i].name+(tempArr[i].value?(':'+tempArr[i].value):'')+(tempArr[i].time?', 报告日期:'+tempArr[i].time:'')+';')
         }
         newState.dataString = tmpString
         return newState;
@@ -83,7 +83,7 @@ export default (state = initSearchList, action) => {
                 tempArr[i].time = action.date
                 newState.assistLabel = [...tempArr]
             }
-            tmpString += (tempArr[i].name+(tempArr[i].value?(':'+tempArr[i].value):'')+(tempArr[i].time?'报告日期:'+tempArr[i].time:'')+';')
+            tmpString += (tempArr[i].name+(tempArr[i].value?(':'+tempArr[i].value):'')+(tempArr[i].time?', 报告日期:'+tempArr[i].time:'')+';')
         }
         newState.dataString = tmpString
         return newState;

+ 30 - 2
src/utils/tools.js

@@ -218,7 +218,7 @@ const getAllDataStringList =(baseList) =>{           //获取所有模块文本
       'diag' : baseList.diagnosticList.diagnosticStr,
       'advice' : baseList.pushMessage.AdviceStr
     }
-    console.log(jsonDataString,'文本模式数据获取')
+    // console.log(jsonDataString,'文本模式数据获取')
     return jsonDataString;
 }
 /**
@@ -572,6 +572,33 @@ function didPushParamChange(){
   }
   return true;
 }
+//判断页面所有数据是否为空
+function isAllClear(jsonData,jsonStr){    
+  if (      //结构化和文本数据都为空
+    JSON.stringify(jsonData.advice) == '{}' &&
+    jsonData.chief.length < 1 &&
+    jsonData.present.length < 1 &&
+    jsonData.other.length < 1 &&
+    jsonData.vital.length < 1 &&
+    jsonData.diag.length < 1 &&
+    jsonData.pacs.length < 1 &&
+    jsonData.lis.labelList.length < 1 &&
+    jsonData.lis.getExcelDataList.length < 1 &&
+    JSON.stringify(jsonData.advice) == '{}' && 
+    filterArr(JSON.parse(jsonStr.chief)) == '' && 
+    filterArr(JSON.parse(jsonStr.present)) == '' && 
+    filterArr(JSON.parse(jsonStr.other)) == '' && 
+    filterArr(JSON.parse(jsonStr.vital)) == '' && 
+    jsonData.diag.length < 1 && 
+    jsonData.pacs.length < 1 && 
+    jsonData.lis.labelList.length < 1 && 
+    jsonData.lis.getExcelDataList.length < 1
+  ) {
+    return false;
+  }else{
+    return true;
+  }
+}
 
 module.exports = {
     checkType: Type.checkType,
@@ -594,5 +621,6 @@ module.exports = {
     handleEnter,
     didPushParamChange,
     getEMRParams,
-    windowEventHandler
+    windowEventHandler,
+    isAllClear
 };