Browse Source

诊断依据没有化验公表项提示

zhangxc 5 years atrás
parent
commit
7d5d9591ad
2 changed files with 41 additions and 30 deletions
  1. 2 2
      src/api/config.js
  2. 39 28
      src/components/diagBase/AddDiagBase.vue

+ 2 - 2
src/api/config.js

@@ -244,8 +244,8 @@ export default {
      'diagBasePage': '/api/knowledgeman/diagnose/page', //诊断依据--分页
      'diagBaseUpdateNeo': '/api/knowledgeman/diagnose/updateNeo', //诊断依据--更新图谱
      'diagBaseVerifyAllData': '/api/knowledgeman/diagnose/verifyAllData', //诊断依据--校验所有数据
-     'diagBaseVerifyData': 'http://192.168.3.117:5050/api/knowledgeman/diagnose/verifyData', //诊断依据--校验数据
-     'getUniqueNameWithList': 'http://192.168.3.117:5050/api/knowledgeman/lisMapping/getUniqueNameWithList', //医学数据-查找化验公表名
+     'diagBaseVerifyData': '/api/knowledgeman/diagnose/verifyData', //诊断依据--校验数据
+     'getUniqueNameWithList': '/api/knowledgeman/lisMapping/getUniqueNameWithList', //医学数据-查找化验公表名
 
   },
 	menuIconList: { //菜单对应图标

+ 39 - 28
src/components/diagBase/AddDiagBase.vue

@@ -237,6 +237,7 @@
             saveDisable: false ,
             hasQuestion: 1, //是否有问题词
             disNameExist: true, //诊断名称是否存在
+            hasNoUniqueName: false, //是否存在没有公表项的化验
             isReady:false,
             showDiagList: false
         }
@@ -661,17 +662,7 @@
             }
            
             if(errStrList.length >0 ||codeErrorNum > 0 ||formulaListErrNum > 0) {
-                 this.$alert(errorStr,'错误信息',{
-                    dangerouslyUseHTMLString: true,
-                    confirmButtonText: '确定',
-                    callback: action => {
-                        /*this.$message({
-                        type: 'info',
-                        message: `action: ${ action }`
-                        });*/
-                    }
-                });
-                return
+                this.errorTips(errorStr)
             }
             // this.showDelDialog()
             return this.diagBaseVerifyData(type)
@@ -699,7 +690,12 @@
             }
             if(labArr.length > 0) {
                 this.labVerifyData(labArr, loading).then(() =>{
-                    this.verifyDiagBase(loading)
+                    if(this.hasNoUniqueName) {
+                        loading.close()
+                        return
+                    }else {
+                        this.verifyDiagBase(loading)
+                    }
                 })
             } else {
                 this.verifyDiagBase(loading)
@@ -713,8 +709,13 @@
                 this.isReady=false
                 if(res.data.code === '0') {
                     const data = res.data.data
+                    let errorStr = ''
                     for (let i = 0; i < data.length; i++ ) {
                         if(!data[i].uniqueName) { //判断是否存在公表项
+                            if(!this.hasNoUniqueName) {
+                                this.hasNoUniqueName = true
+                            }
+                            errorStr +=`<p>第${+data[i].index+1}行化验公表项不存在</p>`
                             this.disFeatureListResult[data[i].index].verifyUnique="公表项不存在"
                         } else {
                             this.disFeatureListResult[data[i].index].verifyUnique=""
@@ -733,15 +734,18 @@
                            
                         }
                     }
-                 
+                    console.log('errorStr', errorStr)
+                    if(errorStr) {
+                        this.errorTips(errorStr)
+                    }
                     this.disFeatureList = JSON.parse(JSON.stringify(this.disFeatureListResult))
                     this.disFeatureListResult = JSON.parse(JSON.stringify(this.disFeatureListResult))
-                       console.log('this.disFeatureListResult', this.disFeatureList)
                     
                 } else {
                     
                     this.warning(res.msg)
                     loading.close()
+                    return
                 }
             }).catch(()=>{ this.isReady=false;loading.close()})
         },
@@ -803,14 +807,7 @@
                 resolve();
             }).catch(() => {});
         },
-        warning(msg, type,time) {
-            this.$message({
-                showClose: true,
-                message: msg,
-                type: type || 'warning',
-                duration:time || '3000'
-            })
-        },
+       
         handleInp(index,e,type,itemType){ //分组不能输入负数
             const value = e;
             if(type === 'FeatureNumber') { //序号只能输入数字和.
@@ -887,12 +884,26 @@
                     return this.disFormulaList = JSON.parse(JSON.stringify(this.disFormulaList))
             }
         },
-        warning(msg,type){
-          this.$message({
-            showClose: true,
-            message:msg,
-            type:type||'warning'
-          })
+         warning(msg, type,time) {
+            this.$message({
+                showClose: true,
+                message: msg,
+                type: type || 'warning',
+                duration:time || '3000'
+            })
+        },
+        errorTips(errorStr) {
+            this.$alert(errorStr,'错误信息',{
+                dangerouslyUseHTMLString: true,
+                confirmButtonText: '确定',
+                callback: action => {
+                    /*this.$message({
+                    type: 'info',
+                    message: `action: ${ action }`
+                    });*/
+                }
+            });
+            return
         }
     }
   }