Prechádzať zdrojové kódy

打印保存判断问题

Luolei 6 rokov pred
rodič
commit
a643a04284

+ 11 - 24
src/components/PrintPreview/index.jsx

@@ -78,31 +78,18 @@ class PrintPreview extends Component {
         this.props.onClose()
     }
     surePrint(jsonData,jsonStr,whichSign){
-        if(whichSign == 0){
-            if(jsonData.chief.length < 1){
-                Notify.info('主诉不能为空');
-                return;
-            }else if(jsonData.diag.length < 1){
-                Notify.info('诊断不能为空');
-                return;
-            }else{
-                this.onPrint();
-                this.props.save(true)
-            }
+        if(JSON.parse(jsonStr.chief).length == 1 && JSON.parse(jsonStr.chief)[0].trim() ==''){
+          Notify.info('主诉不能为空');
+            return false;
+        }else if(jsonStr.chief && JSON.parse(jsonStr.chief).length < 1){
+            Notify.info('主诉不能为空');
+            return false;
+        }else if(!jsonStr.diag || jsonStr.diag.trim().length < 1){
+            Notify.info('诊断不能为空');
+            return false;
         }else{
-            if(JSON.parse(jsonStr.chief).length == 1 && JSON.parse(jsonStr.chief)[0] ==''){
-                Notify.info('主诉不能为空');
-                return;
-            }else if(JSON.parse(jsonStr.chief).length < 1){
-                Notify.info('主诉不能为空');
-                return;
-            }else if(jsonStr.diag.trim().length < 1){
-                Notify.info('诊断不能为空');
-                return;
-            }else{
-                this.onPrint();
-                this.props.save(true)
-            }
+            this.onPrint();
+            this.props.save(true)
         }
     }
     render() {

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

@@ -20,7 +20,7 @@ function getCurrentDate() {
     let date = year+'-'+(mon<10?'0'+mon:mon)+'-'+(day<10?'0'+day:day);
     return date;
 }
-export default (state = initSearchList, action) => {
+export default (state = initSearchList, action) => { 
     if (action.type == GET_ASSIST_SEARCH_LIST) {
         const newState = Object.assign({}, state);
         newState.list = action.list

+ 1 - 1
src/store/reducers/currentIll.js

@@ -16,7 +16,7 @@ const initState = {
   emptyData:[],
   symptomIds:[] //搜索去重
 };
-export default function(state=initState,action){
+export default function(state=initState,action){    
   const res = Object.assign({},state);
   switch (action.type){
     case SET_CURRENT://需要处理截取的模板

+ 1 - 1
src/store/reducers/mainSuit.js

@@ -22,7 +22,7 @@ const initState = {
   editClear:true,
 }
 
-export default function(state=initState,action){
+export default function(state=initState,action){console.log(state)
   const res = Object.assign({},state);
   switch (action.type){
     case SET_MAINSUIT://主诉模板