瀏覽代碼

疾病相关

luolei 4 年之前
父節點
當前提交
fc47d31cfc

+ 1 - 0
src/api/config.js

@@ -537,6 +537,7 @@ export default {
     'diseaseDelete':'/api/cdssman/klDisease/delete',
     'getBaseDetail':'/api/cdssman/klDisease/getDetail',
     'searchConcept':'/api/cdssman/klDisease/searchConcept',
+    'diseaseBaseSave':'/api/cdssman/klDisease/save',
     //静态知识术语
     'staticBaseKnowledge':'/api/cdssman/kl/conceptInfo/getPage',
     'changeBaseStatus':'/api/cdssman/kl/conceptInfo/changeStatus',

+ 3 - 0
src/api/knowledgeTree.js

@@ -76,4 +76,7 @@ export default {
   searchConcept(param) {//查询疾病
     return axios.post(urls.searchConcept, param);
   },
+  diseaseBaseSave(param) {//保存疾病
+    return axios.post(urls.diseaseBaseSave, param);
+  },
 };

+ 2 - 2
src/components/basicKnow/AddTerm.vue

@@ -802,7 +802,7 @@ export default {
           libName: this.data.name,
           remark: this.data.remark,
           spell: this.data.spell,
-          status: this.data.status,
+          status: this.data.status||1,
           libType: this.data.typeId,
           synonymName: this.data.synonymName,
           isHasCommon: this.data.isHasCommon,
@@ -821,7 +821,7 @@ export default {
           spell: this.data.spell,
           libType: this.data.typeId||this.data.type,
           libId: this.data.libId||-1*Math.random(),
-          status: this.data.status,
+          status: this.data.status||1,
           isHasCommon: this.data.isHasCommon||0,
           synonymName: this.data.synonymName,
           klConceptSub: [],

+ 0 - 1
src/components/knowledgeExtra/AboutDisease.vue

@@ -139,7 +139,6 @@
           pageSize:this.pageSize};
         api.getBaseDetail(param).then((res) => {
           const {code,data,msg} = res.data;
-          console.log(code)
           if(code=='0'){
               const item = Object.assign({},row,data);
               this.$router.push({name:'DiseaseTree',params:Object.assign(pam, {isEdit: true, data: item})});

+ 95 - 18
src/components/knowledgeExtra/DiseaseTree.vue

@@ -4,9 +4,9 @@
     <div class="contents">
       <div class="content">
         <div class="addBtn" v-if="list.length == 0">
-          <!-- <el-button
+          <el-button
             @click="addConcept"
-          >+ 新 增</el-button> -->
+          >+ 新 增</el-button>
         </div>
 
         <div class="tree">
@@ -57,7 +57,7 @@
     </div>
     <SearchList 
       v-if="showSearch" 
-      :conceptList="conceptList" 
+      :conceptList="conceptList||[]" 
       :addLevel="addLevel"
       @closeSearch="closeSearch" 
       @selectConcept="selectConcept" 
@@ -85,6 +85,77 @@ export default {
           {name:'实验室检查类别',id:'6'},
           {name:'辅助检查类别',id:'7'},
         ],
+        template:{
+          "conceptId": null,
+          "conceptName": "",
+          "nodeList": [{
+            "conceptId": 501,
+            "conceptName": "疾病相关主症状",
+            "nodeList": [],
+            "libType": [103],
+            "level": 1,
+            "sonRelationId": 17,
+            "isExpanded": false
+          }, {
+            "conceptId": 502,
+            "conceptName": "疾病相关次症状",
+            "nodeList": [],
+            "libType": [103],
+            "level": 1,
+            "sonRelationId": 17,
+            "isExpanded": false
+          }, {
+            "conceptId": 503,
+            "conceptName": "疾病相关体格检查结果",
+            "nodeList": [],
+            "libType": [104],
+            "level": 1,
+            "sonRelationId": 17,
+            "isExpanded": false
+          }, {
+            "conceptId": 504,
+            "conceptName": "疾病相关实验室检查套餐",
+            "nodeList": [],
+            "libType": [107],
+            "level": 1,
+            "sonRelationId": 17,
+            "isExpanded": false
+          }, {
+            "conceptId": 505,
+            "conceptName": "疾病相关辅助检查项目",
+            "nodeList": [],
+            "libType": [109, 110],
+            "level": 1,
+            "sonRelationId": 17,
+            "isExpanded": false
+          }, {
+            "conceptId": 506,
+            "conceptName": "疾病相关药物治疗",
+            "nodeList": [],
+            "libType": [101],
+            "level": 1,
+            "sonRelationId": 17,
+            "isExpanded": false
+          }, {
+            "conceptId": 507,
+            "conceptName": "疾病相关手术治疗",
+            "nodeList": [],
+            "libType": [106],
+            "level": 1,
+            "sonRelationId": 17,
+            "isExpanded": false
+          }, {
+            "conceptId": 508,
+            "conceptName": "疾病相关鉴别诊断",
+            "nodeList": [],
+            "libType": [100],
+            "level": 1,
+            "sonRelationId": 17,
+            "isExpanded": false
+          }],
+          "level": 0,
+          "isExpanded": false
+        },
         curId:'1',
         list: [],
         defaultProps: {
@@ -107,8 +178,11 @@ export default {
       this.getTreeList(1)
     },
     methods:{
+      addConcept(e) {
+        this.addLevel = 0;
+        this.openSearch(e);
+      },
       getTreeList(id){
-
       const { isEdit, data } = this.$route.params
       if(isEdit) {
           this.isEdit = isEdit
@@ -117,7 +191,7 @@ export default {
           let result = paramData.diseaseDetailDTO||{}
           // this.relationTypes = paramData.types[0]||[]
           const itemStr = JSON.stringify(result)
-          let tmp = itemStr.replace(/disName/g,'conceptName').replace(/rname/g,'conceptName').replace(/datas/g,'nodeList').replace(/details/g,'nodeList').replace(/id/g,'conceptId').replace(/libName/g,'conceptName')
+          let tmp = itemStr.replace(/disName/g,'conceptName').replace(/rname/g,'conceptName').replace(/datas/g,'nodeList').replace(/details/g,'nodeList').replace(/id/g,'conceptId').replace(/sconceptId/g,'conceptId').replace(/rconceptId/g,'conceptId').replace(/libName/g,'conceptName')
           let item = JSON.parse(tmp)
           item.level = 0
           item.isExpanded = false
@@ -162,7 +236,7 @@ export default {
         this.IteraNodeList(this.list[0].nodeList, nodeListResult, 0)
         param.nodeList = nodeListResult
         this.saveDisable = true  //提交保存按钮不可点击,返回结果时才可点击,防止频繁发送请求
-        api.addTreeRelation(this.reparams(param)).then((res) => {
+        api.diseaseBaseSave(this.reparams(param)).then((res) => {
           const { data } = res
           if(data.code == '0') {
             this.message(res.data.msg||'术语关系建立成功','success');
@@ -177,7 +251,7 @@ export default {
         for(let i = 0; i <nodeList.length; i++) {
           let newChild;
           if(type == '0') { //添加的时候保存所有的id列表
-            newChild = {conceptId: nodeList[i].conceptId, relationId: 17,nodeList:[],sonRelationId: 17, isExpanded:false}
+            newChild = {conceptId: nodeList[i].conceptId,libType:nodeList[i].libType, relationId: 17,nodeList:[],sonRelationId: 17, isExpanded:false}
           } else if(type == '1') {  //修改的时候添加层级
             const item = JSON.parse(JSON.stringify(nodeList[i]))
             newChild = Object.assign(item, {level:  level, nodeList: [],sonRelationId: 17, isExpanded:false})
@@ -197,14 +271,15 @@ export default {
       },
       searchConcept(txt) {
         let  excludedConceptIds = [];
-        if(this.list[0]) {
+        if(this.list.length>0) {
           this.excludedConceptIds = this.IteraNodeList(this.list[0].nodeList,excludedConceptIds, 2)
         }
         const {libType} = this.operaList
+
         const params = {
           "name": txt,
-          "excludedConceptIds": this.excludedConceptIds,
-          "libType": libType[0],
+          "excludedConceptIds": this.excludedConceptIds||[],
+          "libType": this.addLevel == 0?100:libType&&libType[0]||''
         }
         api.searchConcept(params).then((res) => {
           const { data } = res
@@ -215,14 +290,16 @@ export default {
       },
       selectConcept(item) {
         if(this.addLevel == 0) {
-          this.list.push(Object.assign({}, item,  {nodeList: [], level: 0, conceptId: item.conceptId, sonRelationId: 17}))
-          this.list = JSON.parse(JSON.stringify(this.list))
+          let temp = JSON.parse(JSON.stringify(this.template))
+          temp.conceptId = item.conceptId
+          temp.conceptName = item.conceptName
+          this.list = [temp]
         }else {
           const data = this.operaList
-          const newChild = Object.assign({}, item,  {nodeList: [], level: data.level+1, conceptId: item.conceptId, relationId: 17,sonRelationId: 17});
+          const newChild = Object.assign({}, item,  {nodeList: [],libType:data.libType, level: data.level+1, conceptId: item.conceptId, relationId: 17,sonRelationId: 17});
           // const newChild = { id: id++, label: 'nodeList', level: data.level+1, children: [] };
           if (!data.nodeList) {
-          this.$set(data, 'nodeList', []);
+            this.$set(data, 'nodeList', []);
           }
           data.nodeList.push(newChild);
         }
@@ -267,11 +344,11 @@ export default {
             }
           }
           let obj = {
-            "eid": item.conceptId,
-            "eids": sonIds,
-            "rid": this.relationTypes[1],
             "sid": param.conceptId,
-            "srid": this.relationTypes[3]
+            "rid": item.conceptId,
+            "eids": sonIds,
+            // "eid": item.libType[0],
+            // "srid": 0
           }
           params.push(obj)
         }

+ 1 - 0
src/components/knowledgeExtra/StaticInfo.vue

@@ -33,6 +33,7 @@
                 </el-table-column>
                 <el-table-column
                         prop="name"
+                        width="150"
                         label="医学标准术语">
                 </el-table-column>
                 <el-table-column