소스 검색

诊断依据添加暂存数据

zhangxc 5 년 전
부모
커밋
cd47f61f1b
4개의 변경된 파일196개의 추가작업 그리고 20개의 파일을 삭제
  1. 3 2
      src/api/config.js
  2. 6 0
      src/api/diagBase.js
  3. 186 17
      src/components/diagBase/AddDiagBase.vue
  4. 1 1
      src/components/diagBase/DiagBase.vue

+ 3 - 2
src/api/config.js

@@ -149,7 +149,7 @@ export default {
     'getVersionDetlInfo': 'api/knowledgeman/versionDetail/getDetailById', //版本信息-版本说明列表获取
     'promptServer':'/api/knowledgeman/file/uploadImage',    //静态知识富文本图片上传
     /**************医学术语维护****************/
-    'getKnowledgeEnums':'api/knowledgeman/getKlmEnumsData', //术语库枚举
+    'getKnowledgeEnums':'/api/knowledgeman/getKlmEnumsData', //术语库枚举
 	  'saveConceptInfo':'/api/knowledgeman/conceptDetail/insertOrUpdate',   //保存术语静态知识
     'delConceptInfo':'/api/knowledgeman/conceptDetail/delete',   //删除术语静态知识
     'knowledgeName': 'api/knowledgeman/concept/getAllInformation', //医学术语-命名维护
@@ -245,8 +245,9 @@ export default {
      'diagBaseUpdateNeo': '/api/knowledgeman/diagnose/updateNeo', //诊断依据--更新图谱
      'diagBaseVerifyAllData': '/api/knowledgeman/diagnose/verifyAllData', //诊断依据--校验所有数据
      'diagBaseVerifyData': '/api/knowledgeman/diagnose/verifyData', //诊断依据--校验数据
+     'tempSaveOrUpate':'/api/knowledgeman/diagnose/tempSaveOrUpate', //诊断依据-临时保存
+     'diagBaseSearch':'/api/knowledgeman/diagnose/search', //诊断依据-搜索标准词或者关联词
      'getUniqueNameWithList': '/api/knowledgeman/lisMapping/getUniqueNameWithList', //医学数据-查找化验公表名
-
   },
 	menuIconList: { //菜单对应图标
 		'YH-KZT': 'el-icon-menu',

+ 6 - 0
src/api/diagBase.js

@@ -56,5 +56,11 @@ export default {
     },
     getUniqueNameWithList(param) { //诊断依据--获取公表项
         return axios.post(urls.getUniqueNameWithList, param)
+    },
+    tempSaveOrUpate(param) { //诊断依据-临时保存
+        return axios.post(urls.tempSaveOrUpate, param)
+    },
+    diagBaseSearch(param) { //诊断依据-临时保存
+        return axios.post(urls.diagBaseSearch, param)
     }
 }

+ 186 - 17
src/components/diagBase/AddDiagBase.vue

@@ -43,7 +43,7 @@
                 <tr v-for="(item, index) in disFeatureList" :key="item.index"> 
                     <td class="FeatureSort" >{{index+1}}</td>
                     <td class="FeatureType" >
-                        <el-select size="mini" :class="{selectType: item.typeNull}" v-model.trim="item.type" placeholder="标签类型" @change="clickItem(index,'FeatureType')" clearable>
+                        <el-select size="mini" :class="{selectType: item.typeNull}" v-model.trim="item.type" placeholder="标签类型" @change="clickItem(index,'FeatureType')">
                             <el-option v-for="item in featureTypeList" :label="item.name" :value="item.key" :key="item.key"></el-option>
                         </el-select>
                     </td>
@@ -68,10 +68,27 @@
                                 :class="{borderRed:item.verifyStandard||item.standardNull}" 
                                 :title="item.standard" 
                                 v-model.trim="item.standard" 
-                                @input="handleInp(index,$event,'FeatureStand')"   
+                                @input="handleInp(index,$event,'FeatureStand',item.type)"   
                                 @focus="clickItem(index,'FeatureStand')">
                             </el-input>
-                        </el-tooltip>                    
+                        </el-tooltip>    
+                        <div  class="searchItemBox">
+                            <ul 
+                                class="searchItemList"
+                                v-if="showDiagList&&index === searchIndex && searchFiled ==='FeatureStand' && searchResultList.length > 0"
+                            >
+                                <li v-for="(item, ind) in searchResultList" 
+                                    class="diagItem ellipsis"
+                                    :key="ind"
+                                    :title="item"
+                                    @click="selectSearchItem(index,item,'FeatureStand')"
+                                > 
+                                    {{item}}
+                                </li>
+
+                            </ul>  
+                        </div> 
+                          
                     </td>
                     <td class="FeatureRelate">
                         <el-tooltip :disabled="!item.verifyRelation&&!item.relationNull"  class="item" effect="dark" :content="item.verifyRelation||item.relationNull" placement="top">
@@ -84,7 +101,25 @@
                                 @input="handleInp(index,$event,'FeatureRelate',item.type)"  
                                 @focus="clickItem(index,'FeatureRelate')">
                             </el-input>
+                           
                         </el-tooltip> 
+                        <div class="searchItemBox">
+                             <ul 
+                                class="searchItemList"
+                                v-if="showDiagList&&index === searchIndex && searchFiled ==='FeatureRelate' && searchResultList.length > 0"
+                            >  
+                                <li v-for="(item, ind) in searchResultList" 
+                                    class="diagItem ellipsis"  
+                                    :key="ind"
+                                    :title="item"
+                                    @click="selectSearchItem(index,item,'FeatureRelate')"
+                                > 
+                                    {{item}}
+                                </li>
+
+                            </ul>
+                        </div>
+                        
                     </td>
                      <td class="FeatureuniqueName">
                         <el-tooltip :disabled="!item.verifyUnique"  class="item" effect="dark" :content="item.verifyUnique" placement="top">
@@ -145,7 +180,7 @@
                 <tr v-for="(item, index) in disFormulaList"  :key="item.index"> 
                     <td class="FormulaSort">{{index +1}}</td>
                     <td class="FormulaType">
-                        <el-select size="mini" :class="{selectType: item.verifyType}" v-model.trim="item.type" placeholder="标签类型"  @change="clickItem(index,'FormulaType')" clearable>
+                        <el-select size="mini" :class="{selectType: item.verifyType}" v-model.trim="item.type" placeholder="标签类型"  @change="clickItem(index,'FormulaType')">
                             <el-option v-for="item in formulaTypeList" :label="item.name" :value="item.key" :key="item.key"></el-option>
                         </el-select>
                     </td>
@@ -176,6 +211,11 @@
             </table>
              <div class="btn clearfix">
                      <div class="btnBox">
+                          <el-button
+                                type="primary"
+                                :disabled = "isReady"
+                                @click="saveTemp"
+                                >临时保存</el-button>
                          <el-button
                                 type="primary"
                                 :disabled = "isReady"
@@ -183,12 +223,12 @@
                                 >校验并保存数据</el-button>
                             <el-button
                                 type="primary"
-                                :disabled = "hasQuestion == 1"
+                                :disabled = "hasQuestion != 0"
                                 @click="exportDiagnosticAll"
                                 >导出诊断依据</el-button>
                             <el-button
                                 type="primary"
-                                :disabled = "hasQuestion == 1"
+                                :disabled = "hasQuestion != 0"
                                 @click="updateNeo"
                                 >更新图谱</el-button>
                      </div>
@@ -220,7 +260,7 @@
             formulaTypeList: [],
             disFeatureList: [
                 {
-                    type:'',
+                    type:1,
                     code:'',
                     standard:'',
                     relation:'',
@@ -233,7 +273,7 @@
             disFeatureListResult:[], //疾病特征列表(保存用)
             disFormulaList:[
                 {
-                    type:'',
+                    type:92,
                     code:'',
                     standard:'',
                     relation:'',
@@ -251,7 +291,10 @@
             disNameExist: true, //诊断名称是否存在
             hasNoUniqueName: false, //是否存在没有公表项的化验
             isReady:false,
-            showDiagList: false
+            showDiagList: false,
+            searchIndex: -1,
+            searchFiled: '',
+            searchResultList: []
         }
     },
     created(){
@@ -288,6 +331,12 @@
         //     }
         // }
     },
+    beforeRouteLeave(to, from, next) {
+        this.showConfirmDialog('是否离开当前页面?(如果未校验并保存数据/暂存数据时请先保存)',()=>{
+            next()
+        })
+       
+    },
     methods: {
         getDropList() {
           return apis.getKnowledgeEnums().then((res) =>{
@@ -324,13 +373,57 @@
             this.searchDiagVal = ''
             this.diagList=[]
         },
+        selectSearchItem(index, item, searchType){
+            if(searchType === 'FeatureStand') {
+                const SelectResult =  this.getSelectResult(this.disFeatureList[index].standard, item)
+                this.disFeatureList[index].standard = SelectResult
+                this.disFeatureList = JSON.parse(JSON.stringify(this.disFeatureList))
+                this.searchResultList = []
+            } else if(searchType === 'FeatureRelate') {
+                const SelectResult =  this.getSelectResult(this.disFeatureList[index].relation, item)
+                this.disFeatureList[index].relation = SelectResult
+                this.disFeatureList = JSON.parse(JSON.stringify(this.disFeatureList))
+                this.searchResultList = []
+            }
+        },
+        getSelectResult(val,item) {
+            const index = val.lastIndexOf('、')
+            if(index < 0) {
+                return item
+            } else {
+                return val.slice(0,index+1)+item
+            }
+        },
         focuInput() {
             this.showDiagList = false            
         },
+        getSearchVal(val) {
+          const index = val.lastIndexOf('、')
+          if(index < 0) {
+            return val
+          } else {
+            return val.slice(index+1)
+          }
+        },
+        diagBaseSearch(field, name, type) {
+            this.showDiagList = true
+            const param = {
+                field,
+                name,
+                type
+            }
+            api.diagBaseSearch(param).then((res)=>{
+                if(res.data.code == '0') {
+                    this.searchResultList = res.data.data
+                } else {
+                     this.searchResultList = []
+                }
+            })
+        },
         addItem(index, type) {
             if(type == 1) {
                 const item = {
-                    type:'',
+                    type:1,
                     code:'',
                     standard:'',
                     relation:'',
@@ -341,7 +434,7 @@
                 this.disFeatureList.splice(index+1, 0, item)
             }else if(type == 2) {
                  const item = {
-                    type:'',
+                    type:92,
                     code:'',
                     standard:'',
                     relation:'',
@@ -488,6 +581,32 @@
             })
            
         },
+        saveTemp(){
+             if(!this.disName) {
+                this.warning('请选择诊断');
+                return
+            }
+            const loading = this.$loading({
+                lock: true,
+                text: 'Loading',
+                spinner: 'el-icon-loading',
+                background: 'rgba(0, 0, 0, 0.7)'
+            });
+            this.hasQuestion= 1
+            const param = {
+                disFeature: this.disFeatureList,
+                disName: this.disName,
+                disformula: this.disFormulaList,
+                id: this.id,
+                modifier: this.modifier
+            }
+            api.tempSaveOrUpate(param).then((res)=>{
+                loading.close()
+                if(res.data.code === '0') {
+                   this.warning('临时保存成功','success')
+                }
+            })
+        },
         submitForm(type) {
             if(!this.disName) {
                 this.warning('请选择诊断');
@@ -560,7 +679,7 @@
         },
         errorDataVerify(loading) {
             for(let i = 0; i < this.disFormulaList.length; i++) { //如果有任意一项有值,就检测,所有项都没值,则删掉这条数据
-                if(this.disFormulaList[i].type || this.disFormulaList[i].formula ) {
+                if( this.disFormulaList[i].formula ) {
                     this.disFormulaListResult.push(this.disFormulaList[i])
                 }
             }
@@ -805,7 +924,7 @@
                     }else {
                         this.disFormulaList = [
                             {
-                                type:'',
+                                type:92,
                                 code:'',
                                 standard:'',
                                 relation:'',
@@ -845,7 +964,21 @@
                 })
             } else if(type==='FeatureStand') {  //标准词不能输入顿号
                  this.$nextTick(() => {
-                    this.disFeatureList[index].standard = value.replace(/、/g,'')
+                    const resultVal = value.replace(/、/g,'').replace(' ','')
+                    this.disFeatureList[index].standard = resultVal
+                    if(resultVal) {
+                        const searchVal = this.getSearchVal(resultVal)
+                        if(searchVal) {
+                             this.searchIndex = index
+                            this.searchFiled = 'FeatureStand'
+                            this.diagBaseSearch(2,searchVal,itemType)
+                        } else {
+                            this.searchResultList = []
+                        }
+                    } else {
+                        this.searchResultList = []
+                    }
+                    
                 })
                 // this.disFeatureList[index].standard = value.replace(/、/g,'')
             } else if ( type === 'FormulaNumber') {
@@ -864,17 +997,37 @@
                 
             
             } else if ( type === 'FeatureRelate') {
+                let resultVal;
+
                 if(itemType == 3) {
-                     this.$nextTick(() => {
-                        this.disFeatureList[index].relation = value.replace(/、/g,'')
-                    })
+                     resultVal = value.replace(/、/g,'').replace(' ','')
+                } else {
+                     resultVal = value.replace(' ','')
                 }
+                this.$nextTick(() => {
+                    this.disFeatureList[index].relation = resultVal
+                })
+               if(resultVal) {
+                    const searchVal = this.getSearchVal(resultVal)
+                    if(searchVal) {
+                        this.searchIndex = index
+                        this.searchFiled = 'FeatureRelate'
+                        this.diagBaseSearch(3,searchVal,itemType)
+                    } else [
+                        this.searchResultList = []
+                    ]
+
+                } else {
+                    this.searchResultList = []
+                }
+
             }
             // const item = this.selectedIndexList[index].indexDesc;
             // e.target.value = value.replace(/[^\d]/g,'');
             // this.selectedIndexList[index].indexDesc = item.replace(/[^\d]/g,'');
         },
         clickItem(index, type) {
+            this.showDiagList = false
             switch(type) {
                 case 'FeatureType':
                     this.disFeatureList[index].typeNull = ''
@@ -1187,6 +1340,22 @@
             padding: 5px 0;
             min-height: 30px;
         }
+        .searchItemBox{
+            position: relative;
+            bottom: 0px;
+        }
+        .searchItemList {
+            position: absolute;
+            border: 1px solid #a9a9a9;
+            box-sizing: border-box;
+            top: 4px;
+            z-index: 2;
+            width: 100%;
+            max-height: 150px;
+            overflow: auto; 
+            background: #fff;
+            margin: 0 0 20px 0;
+        }   
     }
     
 </style>

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

@@ -48,7 +48,7 @@
                     label="校验数据">
                     <template slot-scope="scope" >
                         <span :class="scope.row.hasQuestion == '0' ? '': 'hsaQuestion'">
-                            {{scope.row.hasQuestion == '0' ? "无问题词" : "有问题词"}}
+                            {{scope.row.hasQuestion == "0" ? "无问题词" : scope.row.hasQuestion == "1"? "有问题词":scope.row.hasQuestion == "2"?"暂存数据":""}}
                         </span>
                     </template>
                 </el-table-column>