Browse Source

merge from 'testDiagBase'

zhangxc 5 năm trước cách đây
mục cha
commit
1c83c5e0b2

+ 1 - 0
src/api/config.js

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

+ 3 - 0
src/api/diagBase.js

@@ -53,5 +53,8 @@ export default {
     },
     diagBaseVerifyData(param){ //诊断依据--校验数据
         return axios.post(urls.diagBaseVerifyData, param)
+    },
+    getUniqueNameWithList(param) { //诊断依据--获取公表项
+        return axios.post(urls.getUniqueNameWithList, param)
     }
 }

+ 385 - 90
src/components/diagBase/AddDiagBase.vue

@@ -36,6 +36,7 @@
                     <td class="FeatureNumber require">序号</td>
                     <td class="FeatureStand require">标准词</td>
                     <td class="FeatureRelate">关联词</td>
+                     <td class="FeatureuniqueName">化验公表项</td>
                     <td class="FeatureResult">结果</td>
                     <td class="FeatureOpera"></td>
                 </tr>
@@ -74,7 +75,7 @@
                     </td>
                     <td class="FeatureRelate">
                         <el-tooltip :disabled="!item.verifyRelation&&!item.relationNull"  class="item" effect="dark" :content="item.verifyRelation||item.relationNull" placement="top">
-                            <el-input class="groupTextarea"  
+                            <el-input class="groupTextarea" 
                                 type="textarea"
                                 :autosize="{ minRows: 1}"
                                 :class="{borderRed:item.verifyRelation|| item.relationNull}" 
@@ -84,6 +85,27 @@
                                 @focus="clickItem(index,'FeatureRelate')">
                             </el-input>
                         </el-tooltip> 
+                    </td>
+                     <td class="FeatureuniqueName">
+                        <el-tooltip :disabled="!item.verifyUnique"  class="item" effect="dark" :content="item.verifyUnique" placement="top">
+                            <!-- <el-input class="groupTextarea inpDisabled"  
+                                ref="textarea"
+                                type="textarea"
+                                :readonly = true
+                                :autosize="{ minRows: 1}"
+                                :class="{borderRed:item.uniqueName===null ||item.verifyUnique}" 
+                                :title="item.uniqueName" 
+                                v-model.trim="item.uniqueName" 
+                                >
+                            </el-input> -->
+                            <!-- <div class="disableDiv" :class="{borderRed:item.uniqueName===null ||item.verifyUnique}" :title="item.uniqueName" >{{item.uniqueName}}</div>  -->
+                            <Textarea 
+                                :value = "item.uniqueName"
+                                :readonly = false
+                                :borderRed = "item.uniqueName===null ||item.verifyUnique"
+                            ></Textarea>
+                        </el-tooltip> 
+                        <!-- <div>{{item.uniqueName}}</div> -->
                     </td>
                     <td class="FeatureResult">
                         <el-tooltip :disabled="!item.verifyResult"  class="item" effect="dark" :content="item.verifyResult" placement="top">
@@ -92,11 +114,17 @@
                                 :autosize="{ minRows: 1}"
                                 :readonly="item.type!=3"  
                                 :class="{borderRed:item.verifyResult, inpDisabled:item.type!=3}"  
-                                :title="item.result" 
-                                v-model.trim="item.result" 
+                                :title="item.midResult" 
+                                v-model.trim="item.midResult" 
                                 @input="handleInp(index,$event,'FeatureResult')"
                                 @focus="clickItem(index,'FeatureResult')">
                             </el-input>
+                            <!-- <Textarea 
+                                :value = "item.midResult"
+                                :readonly = "item.type==3"
+                                :borderRed = 'item.verifyResult'
+                                @handleInp="handleInp(index,$event,'FeatureResult')"
+                            ></Textarea> -->
                         </el-tooltip> 
                     </td>
                     <td class="FeatureOpera">
@@ -106,7 +134,7 @@
                 </tr>
             </table>
             <p class="moduleTitle">诊断公式:</p>
-            <p class="inpTips">可输入数字(0~9);可输入规定汉字:任、一、二、三、四、五、六、七、八、九、十,其余汉字不可输入可输入的符号:“.”、“/”、“()”  “+”;确诊还可输入“拟、诊”二字;鉴别诊断的序号不可输入公式中,数据放入后该条件无效;</p>
+            <p class="inpTips">可输入数字(0~9);可输入规定汉字:任、一、二、三、四、五、六、七、八、九、十,其余汉字不可输入可输入的符号:“.”、“/”、“()”  “+”;确诊还可输入“拟、诊”二字;鉴别诊断的序号不可输入公式中,数据放入后该条件无效;</p>
             <table class="diagTable">
                 <tr class="tableTitle"> 
                     <td class="FormulaSort">排序</td> 
@@ -124,6 +152,7 @@
                     <td class="FormulaNumber">
                         <el-tooltip :disabled="!item.verifyFormula"  class="item" effect="dark" :content="item.verifyFormula" placement="top">
                             <el-input class="groupTextarea"
+                                ref="textarea"
                                 type="textarea"  
                                 :readonly="!item.type"
                                 :autosize="{ minRows: 1}"
@@ -175,6 +204,7 @@
   import api from '@api/diagBase.js';
   import utils from '@api/utils.js';
   import apis from '@api/icss.js';
+  import Textarea from './Textarea'
 
   export default {
     name: 'AddChronicAndIndexRelation',
@@ -194,8 +224,10 @@
                     code:'',
                     standard:'',
                     relation:'',
+                    midResult:'',
+                    formula:'',
                     result:'',
-                    formula:''
+                    uniqueName:''
                 }
             ],  //疾病特征列表
             disFeatureListResult:[], //疾病特征列表(保存用)
@@ -205,8 +237,10 @@
                     code:'',
                     standard:'',
                     relation:'',
+                    midResult:'',
                     result:'',
-                    formula:''
+                    formula:'',
+                    uniqueName:''
                 }
             ],
             disFormulaListResult:[], //诊断公式列表(保存用)
@@ -215,6 +249,7 @@
             saveDisable: false ,
             hasQuestion: 1, //是否有问题词
             disNameExist: true, //诊断名称是否存在
+            hasNoUniqueName: false, //是否存在没有公表项的化验
             isReady:false,
             showDiagList: false
         }
@@ -238,12 +273,12 @@
                     this.disFormulaList = data.disformula
                 } 
                 this.hasQuestion = data.hasQuestion
-
             } 
         } else {
             
         }
     },
+   
     watch: {
         // searchTagVal(newVal, preVal) {
         //     if(newVal.trim() == ''){
@@ -299,7 +334,9 @@
                     code:'',
                     standard:'',
                     relation:'',
+                    midResult:'',
                     result:'',
+                    uniqueName:''
                 }
                 this.disFeatureList.splice(index+1, 0, item)
             }else if(type == 2) {
@@ -308,7 +345,9 @@
                     code:'',
                     standard:'',
                     relation:'',
+                    midResult:'',
                     result:'',
+                    uniqueName:''
                 }
                 this.disFormulaList.splice(index+1, 0, item)
             }
@@ -320,6 +359,94 @@
                 this.disFormulaList.splice(index, 1)
             }
         },
+        //导入
+        // uploadClick() {
+        //     let inp = document.getElementById("upFile");
+        //     inp.click();
+        // },
+        // uploadFile(e){
+        //     let fileInfo = e.target.files[0];
+        //     e.preventDefault();
+        //     let formData = new FormData();
+        //     formData.append('uploadfile', fileInfo);
+        //     const header = {
+        //         headers:{
+        //         'Content-Type': 'multipart/form-data'
+        //         }
+        //     }
+        //     api.importDiagnosticBasis(formData,header).then((res)=>{
+        //        
+        //         if(res.data.code==0){
+        //             const data = res.data.data
+        //             this.warning('上传成功','success')
+        //             let feature = data.feature
+        //             let equation = data.equation
+        //             const featureList = []
+        //             const formulaList = []
+
+        //             if(feature&&feature.length > 0) {
+        //                for(let i = 1; i <feature.length; i++) {
+        //                    const item = {}
+        //                    item.type = '';
+        //                    for (let j = 0; j < this.featureTypeList.length; j++) {
+        //                        if(feature[i].type.indexOf(this.featureTypeList[j].name) > -1) {
+        //                            item.type = this.featureTypeList[j].key
+        //                            break;
+        //                        }
+        //                    }
+                           
+        //                    item.code = feature[i].code
+        //                    item.standard = feature[i].standard
+        //                    item.relation = feature[i].associated
+        //                    if(item.type === 4) {
+        //                        item.midResult = ''
+        //                    } else {
+        //                         item.midResult = feature[i].midResult
+        //                    }
+        //                    featureList.push(item)
+        //                }
+        //             }
+        //             if(equation&&equation.length > 0) {
+        //                for(let i = 1; i <equation.length; i++) {
+        //                    const item = {}
+        //                    item.type = '';
+        //                    for (let j = 0; j < this.formulaTypeList.length; j++) {
+        //                        if(equation[i].type.indexOf(this.formulaTypeList[j].name) > -1) {
+        //                            item.type = this.formulaTypeList[j].key
+        //                            break;
+        //                        }
+        //                    }
+        //                    item.formula = equation[i].associated
+                           
+        //                    formulaList.push(item)
+        //                }
+        //             }
+        //             this.disFeatureList = featureList
+        //             this.disFormulaList = formulaList
+        //            
+        //         }else{
+        //         /*this.$message({
+        //             dangerouslyUseHTMLString: true,
+        //             message:res.data.msg,
+        //             type:'warning'
+        //         });*/
+        //         this.$alert(res.data.msg,'错误信息',{
+        //             dangerouslyUseHTMLString: true,
+        //             confirmButtonText: '确定',
+        //             callback: action => {
+        //             /*this.$message({
+        //                 type: 'info',
+        //                 message: `action: ${ action }`
+        //             });*/
+        //             }
+        //         });
+        //         }
+        //     })
+            
+        //     //解决上传相同文件不触发change
+        //     let inp = document.getElementById("upFile");
+        //     inp.value = "";   
+        // },
         updateNeo() {
             this.submitForm('updateNeo').then(() => {
                 if(this.hasQuestion == 0) {
@@ -344,17 +471,18 @@
             // })
         },
         exportDiagnosticAll(){
-            
             this.submitForm('export').then(() => {
                 if(this.hasQuestion == 0) {
-                        const param = {
+                    const param = {
                         diagnoseId: this.id
                     }
                     api.exportDiagnosticAll(param).then((res) => {
                         utils.downloadExportedData(res.data,'诊断依据.xls');
                     })
                 }else {
-                    this.warning('导出失败');
+                    if(!this.hasNoUniqueName) {
+                        this.warning('导出失败');
+                    }
                 }
                 
             })
@@ -367,17 +495,13 @@
             }
             this.disFeatureListResult = []
             this.disFormulaListResult = []
-            let errStrList = [];
-            for(let i = 0; i < this.disFeatureList.length; i++) {
-                if(this.disFeatureList[i].type || this.disFeatureList[i].code || this.disFeatureList[i].standard || this.disFeatureList[i].relation || this.disFeatureList[i].result) {
+         
+            for(let i = 0; i < this.disFeatureList.length; i++) {  //如果有任意一项有值,就检测,所有项都没值,则删掉这条数据
+                if(this.disFeatureList[i].type || this.disFeatureList[i].code || this.disFeatureList[i].standard || this.disFeatureList[i].relation || this.disFeatureList[i].midResult) {
                     this.disFeatureListResult.push(this.disFeatureList[i])
                 }
             }
-            for(let i = 0; i < this.disFormulaList.length; i++) {
-                if(this.disFormulaList[i].type || this.disFormulaList[i].formula ) {
-                    this.disFormulaListResult.push(this.disFormulaList[i])
-                }
-            }
+            
             let disFeatureList;
             if(this.disFeatureListResult.length) {
                disFeatureList = this.disFeatureListResult;
@@ -388,13 +512,63 @@
                         code:'',
                         standard:'',
                         relation:'',
+                        midResult:'',
                         result:'',
-                        formula:''
+                        formula:'',
+                        uniqueName:''
                     }
                 ];
             }
+            this.disFeatureList = disFeatureList
+            // this.showDelDialog()
+            return this.diagBaseVerifyData(type)
+           
+        },
+        diagBaseVerifyData(type) {
+            //判断诊断依据先判断化验有没有公表项
+             const labArr= []
+            for (let i = 0; i < this.disFeatureList.length; i++) {
+                if(+this.disFeatureList[i].type === 3) {
+                    labArr.push({index: i, mealName: this.disFeatureList[i].standard, itemName: this.disFeatureList[i].relation, uniqueName:''})
+                } 
+            }
+
+            const loading = this.$loading({
+                lock: true,
+                text: 'Loading',
+                spinner: 'el-icon-loading',
+                background: 'rgba(0, 0, 0, 0.7)'
+            });
+           
+           
+            if(type == 'save'){
+                this.isReady = true
+            }
+            if(labArr.length > 0) {
+                return this.labVerifyData(labArr, loading,type).then(() =>{
+                    if(this.hasNoUniqueName) {
+                        loading.close()
+                        return      
+                       
+                    }else {
+                        this.verifyDiagBase(loading,type)
+                    }
+                })
+            } else {
+                this.verifyDiagBase(loading,type)
+            }
+        },
+        errorDataVerify(loading) {
+            for(let i = 0; i < this.disFormulaList.length; i++) { //如果有任意一项有值,就检测,所有项都没值,则删掉这条数据
+                if(this.disFormulaList[i].type || this.disFormulaList[i].formula ) {
+                    this.disFormulaListResult.push(this.disFormulaList[i])
+                }
+            }
+            const disFeatureList = this.disFeatureList;
             const disFormulaList = this.disFormulaListResult;
             let codeErrorNum = 0;
+            let errStrList = [];
+            //必填项是否填写
             for(let i=0; i < disFeatureList.length; i++) {
                 if(!disFeatureList[i].type) {
                      disFeatureList[i].typeNull = "未选择类型"
@@ -425,14 +599,32 @@
 
                     }
                 }
-                if(disFeatureList[i].type == '3' && disFeatureList[i].result && !disFeatureList[i].relation) {
+
+                //化验项有结果则必须有关联词
+                if(disFeatureList[i].type == '3' && disFeatureList[i].midResult && !disFeatureList[i].relation) {
                      disFeatureList[i].relationNull = "未填写关联词"
                      const errStr = "第" + (i+ 1) +"行化验项数据填写不完整"
                     errStrList.push(errStr)
                 }
                
-                if(disFeatureList[i].type == '3' && !disFeatureList[i].result ) { //化验项下面诊断公式如果有用到,判断是否填写结果项
-                    const regex2 = new RegExp(`(?<=\\D|\\s?)${disFeatureList[i].code}(?=\\D|\\s?)`)
+                //导入后判断
+                // let regexPause = new RegExp(`、`)      //判断标准词是否有顿号
+                //  if(disFeatureList[i].standard &&regexPause.test(disFeatureList[i].standard)) {
+                //     disFeatureList[i].verifyStandard ='数据异常'
+                //     const errStr = "疾病特征第" + (i+ 1) +"行标准词数据异常"
+                //     errStrList.push(errStr)
+                // }
+
+                // if(disFeatureList[i].type == '3'&&regexPause.test(disFeatureList[i].relation)) {
+                //     disFeatureList[i].verifyRelation ='数据异常'
+                //     const errStr = "疾病特征第" + (i+ 1) +"行化验关联词数据异常"
+                //     errStrList.push(errStr)
+                // }
+                //导入后判断
+
+
+                if(disFeatureList[i].type == '3' && !disFeatureList[i].midResult ) { //化验项下面诊断公式如果有用到,判断是否填写结果项
+                    const regex2 = new RegExp(`(?<=\\D|\\s?)${disFeatureList[i].code.replace('.','\\.')}(?=\\D|\\s?)`)
                     //  const regex2 = new RegExp(`、\\s*、{1,}`) 
                     //  const regex2 = new RegExp(`([^0-9]|\\s{0,1})${disFeatureList[i].code}([^0-9]|\\s{0,1})`)
                     let hasError = disFormulaList.find(item => {return regex2.test(item.formula)})
@@ -446,9 +638,8 @@
                     }
                 }
                  if(disFeatureList[i].type == '4' && !disFeatureList[i].relation ) { //辅检项下面诊断公式如果有用到,判断是否填写结果项(辅检结果是填在关联词列)
-                    const regex2 = new RegExp(`(?<=\\D|\\s?)${disFeatureList[i].code}(?=\\D|\\s?)`)
+                    const regex2 = new RegExp(`(?<=\\D|\\s?)${disFeatureList[i].code.replace('.','\\.')}(?=\\D|\\s?)`)
                     let hasError = disFormulaList.find(item => {return regex2.test(item.formula)})
-                  
                     if(hasError) {
                         disFeatureList[i].verifyRelation = "数据异常"
                         const errStr = "第" + (i+ 1) +"行辅捡项数据异常"
@@ -461,13 +652,12 @@
                     const errStr = "疾病特征第" + (i+ 1) +"行数据异常"
                     errStrList.push(errStr)
                 }
-                if(disFeatureList[i].result &&regex1.test(disFeatureList[i].result)) {
+                if(disFeatureList[i].midResult &&regex1.test(disFeatureList[i].midResult)) {
                     disFeatureList[i].verifyResult ='数据异常'
                     const errStr = "疾病特征第" + (i+ 1) +"行数据异常"
                     errStrList.push(errStr)
                 }
                 
-                
             }
             this.disFeatureList = JSON.parse(JSON.stringify(disFeatureList))
             let formulaListErrNum = 0
@@ -483,6 +673,28 @@
                         errStrList.push(errStr)
                         formulaListErrNum++;
                    }
+                    
+                    //导入后判断
+                    // if(disFormulaList[i].type == 91) { //确诊中有没有包含其他不可输入内容
+                    //     let regexDisFormula = /[^\u4EFB\u4E00\u4E8C\u4E09\u56DB\u4E94\u516D\u4E03\u516B\u4E5D\u5341\u62df\u8bca0-9\/\.+\(\)\(\)]/g
+                    //     if(regexDisFormula.test(disFormulaList[i].formula)) {
+                    //          disFormulaList[i].verifyFormula = "公式格式错误"
+                    //          const errStr = "诊断公式第" + (i+ 1) +"行公式格式错误,"
+                    //         errStrList.push(errStr)
+                    //         formulaListErrNum++;
+                    //     }
+                    // } else {   //其他诊断中有没有包含其他不可输入内容
+                    // //计算公式只能输入以下内容: 任、一、二、三、四、五、六、七、八、九、十、0-9、/、.、(、)、(、)
+                    //     let regexDisFormula = /[^\u4EFB\u4E00\u4E8C\u4E09\u56DB\u4E94\u516D\u4E03\u516B\u4E5D\u53410-9\/\.+\(\)\(\)]/g
+                    //     if(regexDisFormula.test(disFormulaList[i].formula)) {
+                    //          disFormulaList[i].verifyFormula = "公式格式错误"
+                    //          const errStr = "诊断公式第" + (i+ 1) +"行公式格式错误"
+                    //         errStrList.push(errStr)
+                    //         formulaListErrNum++;
+                    //     }
+                    // }
+                    //导入后判断
+
                    if(disFormulaList[i].type == 91 && disFormulaList[i].formula.indexOf("拟诊") > -1) { //确诊项如果有拟诊这两个字,判断公式列表中有没有拟诊这项
                        const noError = disFormulaList.filter(item => item.type == 92).length > 0
                        if(!noError) {
@@ -504,66 +716,116 @@
             }
            
             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.disFeatureList = JSON.parse(JSON.stringify(disFeatureList))
+                this.errorTips(errorStr)
+                loading.close()
+                this.isReady=false
+                return  false
             }
-            // this.showDelDialog()
-            return this.diagBaseVerifyData(type)
-           
+            return true
         },
-        diagBaseVerifyData(type) {
-             const param = {
+        labVerifyData(labArr, loading,type) {
+            const labArrParam = {
+                lisMappingSearchList : labArr
+            }
+            return api.getUniqueNameWithList(labArrParam).then((res) => {
+                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=""
+                        }
+                        this.disFeatureListResult[data[i].index].uniqueName = data[i].uniqueName
+                        if(data[i].uniqueName) { //有公表项和结果,则将公表项和结果拼接起来,结果用、分隔
+                            if(this.disFeatureListResult[data[i].index].midResult) {
+                                let midResult = this.disFeatureListResult[data[i].index].midResult.replace(' ', '').split('、')
+                                for (let j = 0; j < midResult.length; j++) {
+                                    if(midResult[j]) {
+                                        midResult[j] = data[i].uniqueName+midResult[j]
+                                    }
+                                }
+                                this.disFeatureListResult[data[i].index].result = midResult.join('、')
+                            }
+                           
+                        }
+                    }
+                    if(errorStr) {
+                       return this.errorTips(errorStr);
+                        
+                    }
+                    this.disFeatureList = JSON.parse(JSON.stringify(this.disFeatureListResult))
+                    this.disFeatureListResult = JSON.parse(JSON.stringify(this.disFeatureListResult))
+                    
+                } else {
+                    
+                    this.warning(res.msg)
+                    loading.close()
+                    return
+                }
+            }).catch(()=>{ this.isReady=false;loading.close()})
+        },
+        verifyDiagBase(loading,type) {
+            
+            const param = {
                 disFeature: this.disFeatureListResult,
                 disName: this.disName,
                 disformula: this.disFormulaListResult,
                 id: this.id,
                 modifier: this.modifier
             }
-            if(type == 'save'){
-                this.isReady = true
+            const hasErrorData =  this.errorDataVerify(loading)
+            if(!hasErrorData) {
+                return
             }
             return api.diagBaseVerifyData(param).then((res) => {
-                const data = res.data.data
-                this.isReady=false
-                if(type =='save') {
-                    if(data.hasQuestion) {
-                        this.warning('校验完成请先调整错误数据,该数据已保存')
-                    } else {
-                        this.warning('校验成功', 'success')
+                if(+res.data.code === 0) {
+                    const data = res.data.data
+                    this.isReady=false
+                    if(type =='save') {
+                        if(data.hasQuestion) {
+                            this.warning('校验完成请先调整错误数据,该数据已保存')
+                        } else {
+                            this.warning('校验成功', 'success')
+                        }
                     }
+                    
+                    this.id = data.id
+                    this.disNameExist = data.disNameExist
+                    this.disFeatureList = data.disFeature
+                    if(data.disformula.length) {
+                        this.disFormulaList = data.disformula
+                    }else {
+                        this.disFormulaList = [
+                            {
+                                type:'',
+                                code:'',
+                                standard:'',
+                                relation:'',
+                                result:'',
+                                midResult:'',
+                                formula:'',
+                                uniqueName:''
+                            }
+                        ]
+                    }  
+                    this.hasQuestion = data.hasQuestion
+                } else {
+                    this.hasQuestion = 1
+                    this.warning(res.msg)
                 }
                 
-                this.id = data.id
-                this.disNameExist = data.disNameExist
-                this.disFeatureList = data.disFeature
-                if(data.disformula.length) {
-                    this.disFormulaList = data.disformula
-                }else {
-                    this.disFormulaList = [
-                        {
-                            type:'',
-                            code:'',
-                            standard:'',
-                            relation:'',
-                            result:'',
-                            formula:''
-                        }
-                    ]
-                }  
-                this.hasQuestion = data.hasQuestion
+                loading.close()
                 
-            }).catch(()=>{this.isReady=false})
+            }).catch(()=>{ this.hasQuestion = false; this.isReady=false; loading.close()})
         },
-        
         showConfirmDialog(msg, resolve) {
             this.$alert(msg, '提示', {
                 confirmButtonText: '确定',
@@ -572,16 +834,11 @@
                 resolve();
             }).catch(() => {});
         },
-        warning(msg, type,time) {
-            this.$message({
-                showClose: true,
-                message: msg,
-                type: type || 'warning',
-                duration:time || '3000'
-            })
-        },
+       
+        // handleInp(index,e,type,itemType){ //分组不能输入负数
         handleInp(index,e,type,itemType){ //分组不能输入负数
-            const value = e;
+
+            const value = e
             if(type === 'FeatureNumber') { //序号只能输入数字和.
                 this.$nextTick(() => {
                     this.disFeatureList[index].code = value.replace(/[^\d.]/g,'')
@@ -624,8 +881,10 @@
                     this.disFeatureList[index].code = ''
                     this.disFeatureList[index].standard = ''
                     this.disFeatureList[index].relation = ''
+                    this.disFeatureList[index].midResult = ''
                     this.disFeatureList[index].result = ''
                     this.disFeatureList[index].formula = ''
+                    this.disFeatureList[index].uniqueName = ''
                     return this.disFeatureList = JSON.parse(JSON.stringify(this.disFeatureList))
                 case 'FeatureNumber': 
                     this.disFeatureList[index].codeNull = ''
@@ -654,19 +913,40 @@
                     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
         }
+    },
+    components: {
+        Textarea
     }
   }
 </script>
 <style lang="less">
     @import '../../less/common.less';
     .AddDiagBaseWrapper {
+        font-size: 14px;
+        table,tr,td {
+            list-style: none;
+        }
         color: #606266;
         .topBack {
             top: 0;
@@ -730,7 +1010,7 @@
         .symptomList {
             position: relative;
             background-color: #fff;
-             padding: 20px 20px 100px 20px;
+             padding: 0px 20px 100px 20px;
              margin: 0px 20px 40px 20px;
              min-height: 400px;
         }
@@ -741,6 +1021,7 @@
             margin-bottom: 20px;
             tr {
                 td {
+                    position: relative;
                     border: 1px solid #a9a9a9;
                     text-align: center;
                 }
@@ -799,6 +1080,7 @@
         }
         .tableTitle{
             background: rgba(239,243,249,1);
+            height: 40px;
         }
         .require::after{
             content:"*";
@@ -822,13 +1104,16 @@
             width: 8%;
         }
         .FeatureStand {
-            width: 25%;
+            width: 20%;
         }
         .FeatureRelate {
-            width: 25%;
+            width: 30%;
+        }
+        .FeatureuniqueName {
+            width: 10%;
         }
         .FeatureResult {
-            width: 20%;
+            width: 10%;
         } 
         .FeatureOpera{
             width: 10%;
@@ -873,6 +1158,7 @@
         }
         .moduleTitle {
             margin: 0 0 10px 0;
+            font-weight: 600;
         }
         .inpDisabled{
             textarea {
@@ -892,6 +1178,15 @@
         #upFile{
             display: none
         }
+        .disableDiv {
+            background: rgb(236, 236, 236);
+            box-sizing: border-box;
+            cursor: not-allowed;
+            font-size: 14px;
+            line-height: 20px;
+            padding: 5px 0;
+            min-height: 30px;
+        }
     }
     
 </style>

+ 1 - 0
src/components/diagBase/DiagBase.vue

@@ -186,6 +186,7 @@ export default {
             loading.close();
             const {code,data,msg} = res.data;
             if(code === '0') {
+              this.warning('校验完成','success')
               this.currentPage = 1;
                this.pageSize = 10,
                this.filter.disName = '',

+ 52 - 0
src/components/diagBase/Textarea.vue

@@ -0,0 +1,52 @@
+<template>
+    <div 
+        :contenteditable="readonly"
+        :title="value"
+        class="textarea"
+        :class="{borderRed: borderRed, disableDiv:!readonly}"
+        @input="handInput"
+        @blur="handleBlur"
+    >   
+        {{value}}
+    </div>
+</template>
+<script>
+export default {
+    name: 'Textarea',
+    props: ['readonly','value','borderRed'],
+    data() {
+        return {
+
+        }
+    },
+    methods: {
+        handInput(e) {
+           this.$emit("handleInp",e.target.innerText.replace(/\s+/g,""))
+        },
+        handleFocus() {
+
+        },
+        handleBlur() {
+            console.log('blur')
+        }
+    }
+}
+</script>
+<style scoped lang='less'>
+    .textarea{
+        outline: none;
+    }
+    .borderRed {
+        border: 3px solid red ;
+        box-sizing: border-box;
+    }
+    .disableDiv {
+        background: rgb(236, 236, 236);
+        box-sizing: border-box;
+        cursor: not-allowed;
+        font-size: 14px;
+        line-height: 20px;
+        padding: 5px 0;
+        min-height: 30px;
+    }
+</style>