Browse Source

辅检多层关联维护

zhangxc 5 years ago
parent
commit
a2f61337ca

+ 4 - 0
src/api/config.js

@@ -218,6 +218,10 @@ export default {
     'addMultRelation': 'api/knowledgeman/multContact/addRelation', //知识库标准化-医学术语多层关联维护-添加或者编辑
     'reloadLib': 'api/knowledgeman/reload/createFile', //术语命名-加载词库
     'getDeptList': '/api/knowledgeman/concept/getConceptListByType', //术语命名-诊断-科室
+    'assisCheckMultContactList': '/api/knowledgeman/pacsMultContact/multContactList',   //医学术语维护-辅检层级维护列表
+    'assisCheckAddMultRelation': '/api/knowledgeman/pacsMultContact/addRelation',   //医学术语维护-辅检层级维护-添加关联
+    'assisCheckMultRelationDetail': '/api/knowledgeman/pacsMultContact/relationContactDetail',   //医学术语维护-辅检层级维护-详情
+    'assisCheckRemoveMultRelation': '/api/knowledgeman/pacsMultContact/removeRelationContact',   //医学术语维护-辅检层级维护-删除或恢复
 	  /*********预问诊相关接口**********/
 	  'questionList':'/api/precman/questionInfo_prec/page',     //预问诊-填写单列表
     'questionAdd':'/api/precman/questionInfo_prec/saveOrUpdate',      //预问诊-填写单添加

+ 18 - 0
src/api/medicalTerm.js

@@ -0,0 +1,18 @@
+import axios from 'axios';
+import config from './config.js';
+const urls = config.urls;
+
+export default {
+    assisCheckMultContactList(param) {   //医学术语维护-辅检层级维护列表
+        return axios.post(urls.assisCheckMultContactList, param)
+    },
+    assisCheckAddMultRelation(param) {   //医学术语维护-辅检层级维护-添加关联
+        return axios.post(urls.assisCheckAddMultRelation, param)
+    },
+    assisCheckMultRelationDetail(param) {   //医学术语维护-辅检层级维护-详情
+        return axios.post(urls.assisCheckMultRelationDetail, param)
+    },
+    assisCheckRemoveMultRelation(param) {   //医学术语维护-辅检层级维护-删除或恢复
+        return axios.post(urls.assisCheckRemoveMultRelation, param)
+    },
+}

+ 397 - 0
src/components/medicalTerm/AddAssistCheckMultRelation.vue

@@ -0,0 +1,397 @@
+<template>
+  <div class="addMedicalMultRelationWrapper">
+    <crumbs :title="minTitle" :param="$route.params" linkTo="AssistCheckMultRelation"></crumbs>
+    <div class="contents">
+      <div class="content">
+        <div class="addBtn" v-if="list.length == 0">
+          <el-button
+            @click="addConcept"
+          >+ 新 增</el-button>
+        </div>
+
+        <div class="conceptSearch" ref="conceptSearch" v-show="showSearch">
+          <h4  class="conceptTitle">术语(概念ID)搜索</h4>
+          <img class="closeSearch" src="../../images/close-icon.png" @click="closeSearch" alt="">
+          <input v-model="conceptText" type="text" ref="conceptInput" class="searchText" placeholder="请输入关键词搜索">
+          <!-- <span class="searchName" @click="searchConcept">搜索</span> -->
+          <ul class="conceptList" ref="conceptList">
+            <li 
+              v-for="item in conceptList" 
+              class="conceptItem ellipsis"
+              :title="item.conceptNameType"
+              @click="selectConcept(item)"
+              :key="item.conceptId">
+              {{item.conceptNameType}}
+            </li>
+          </ul>
+        </div>
+        <div class="tree">
+          <el-tree
+            :data="list"
+            :props="defaultProps"
+            node-key="conceptId"
+            default-expand-all
+            draggable
+            :allow-drag="allowDrag"
+            :allow-drop="allowDrop"
+            :expand-on-click-node="false">
+            <span class="custom-tree-node" slot-scope="{ node, data }">
+                <span class="custom-tree-node-name ellipsis" :class="{colorGray: data.isDeletedConcept == 'Y'}" :title="node.label">{{ node.label }}</span>
+                <span class="btn-box">
+                  <el-button
+                      class="btn-add fl"
+                      v-if="data.level < 3"
+                      type="text"
+                      size="mini"
+                      @click="(e) => append(data, e)">
+                      + 增加
+                  </el-button>
+                  <el-button
+                      class="btn-del fr"
+                      v-if="!isEdit|| isEdit&&data.level != 0"
+                      type="text"
+                      size="mini"
+                      @click="() => remove(node, data)">
+                      删除
+                  </el-button>
+                </span>
+            </span>
+          </el-tree>
+        </div>
+        
+        <div class="btn">
+          <el-button
+            type="primary"
+            :disabled = 'saveDisable'
+            @click="confirm"
+          >确 定</el-button>
+        </div>
+      </div>
+    </div>
+  </div>
+</template>
+<script type="text/javascript">
+import api from '@api/icss.js';
+import apis from '@api/medicalTerm.js';
+  export default {
+    name:'AddAssistCheckMultRelation',
+    data(){
+      const data = [
+        // {
+        //   id: 1,
+        //   label: '一级 1',
+        //   children: [{
+        //     id: 4,
+        //     label: '二级 1-1',
+        //     children: [{
+        //       id: 9,
+        //       label: '三级 1-1-1'
+        //     }, {
+        //       id: 10,
+        //       label: '三级 1-1-2'
+        //     }]
+        //   }]
+        // }, 
+        // {
+        //   id: 2,
+        //   label: '一级 2',
+        //   children: [{
+        //     id: 5,
+        //     label: '二级 2-1'
+        //   }, {
+        //     id: 6,
+        //     label: '二级 2-2'
+        //   }]
+        // }, 
+        // {
+        //   id: 3,
+        //   label: '一级 3',
+        //   children: [{
+        //     id: 7,
+        //     label: '二级 3-1'
+        //   }, {
+        //     id: 8,
+        //     label: '二级 3-2'
+        //   }]
+        // }
+      ];
+
+      return{
+        minTitle:'辅检层级关联维护-添加',
+        list: JSON.parse(JSON.stringify(data)),
+        defaultProps: {
+          children: 'nodeList',
+          label: 'conceptNameType'
+        },
+        conceptText: '',
+        conceptList: [], //概念列表
+        addLevel: 0,  //添加级别
+        excludedConceptIds:[],
+        operaList: [],
+        isEdit: false,  //是否为修改
+        relationConceptId: '', //关联父类ID
+        level: 0, //层级(修改时只能显示三级)
+        saveDisable: false,  //保存按钮禁止点击
+        showSearch: false
+      }
+    },
+    created(){
+      const { isEdit, data } = this.$route.params
+      if(isEdit) {
+          // console.log('dataa', data)
+          this.isEdit = isEdit
+          this.minTitle = '辅检层级关联维护-修改'
+          const item = JSON.parse(JSON.stringify(data))
+          item.level = 0
+          item.nodeList = this.IteraNodeList(item.nodeList, [], 1)
+          this.list[0] = item
+      }
+    },
+    watch:{
+      conceptText(nextVal, prevVal) {
+        if(!nextVal.trim()) {
+          this.conceptList = []
+        }
+        if(nextVal.trim() &&nextVal != prevVal) {
+          this.searchConcept()
+        }
+      }
+    },
+    methods:{
+       allowDrop(draggingNode, dropNode, type) {
+        if(draggingNode.data.parentConceptName !== dropNode.data.parentConceptName){
+          return false
+        }else{
+          return type !== 'inner'
+        }
+      },
+      allowDrag(draggingNode) {
+        return draggingNode.data.level != 0;//一级不可拖动
+      },
+      addConcept(e) {
+        this.addLevel = 0;
+        this.openSearch(e);
+      },
+      confirm() { 
+        if(!this.list[0] || this.list[0].nodeList.length == 0) {
+          this.message('请输入数据信息');
+          return
+        }
+        const param = {
+          conceptId: this.list[0].conceptId,
+          sonRelationId: 17,
+          isOrderBy: 1
+        }
+        const nodeListResult = []
+        this.IteraNodeList(this.list[0].nodeList, nodeListResult, 0)
+        param.nodeList = nodeListResult
+        this.saveDisable = true  //提交保存按钮不可点击,返回结果时才可点击,防止频繁发送请求
+        apis.assisCheckAddMultRelation(param).then((res) => {
+          const { data } = res
+          if(data.code == '0') {
+            this.message(res.data.msg||'术语建立成功','success');
+            setTimeout(() => {
+              //返回带搜索条件的首页
+              this.$router.push({name:'AssistCheckMultRelation',params:Object.assign({},this.$route.params,{currentPage:1})});
+            }, 2000);
+          } else {
+            this.message(data.msg);
+          }
+          this.saveDisable = false;
+        })
+      },
+      IteraNodeList(nodeList,  nodeListResult, type, level = 1) {
+        this.level= level + 1
+        for(let i = 0; i <nodeList.length; i++) {
+          let newChild;
+          if(type == '0') { //添加的时候保存所有的id列表
+            newChild = {conceptId: nodeList[i].conceptId, relationId: 17,nodeList:[],sonRelationId: 17}
+          } else if(type == '1') {  //修改的时候添加层级
+            const item = JSON.parse(JSON.stringify(nodeList[i]))
+            newChild = Object.assign(item, {level:  level, nodeList: [],sonRelationId: 17})
+          } else if(type == '2') { //移除节点的时候同时移除节点(搜索时排除的id列表)
+            newChild = nodeList[i].conceptId
+          }
+          
+          if(nodeList[i].nodeList &&nodeList[i].nodeList.length > 0&&level < 3) {
+            if(type == '0' || type =='1') {
+              this.IteraNodeList(nodeList[i].nodeList,  newChild.nodeList, type, level+1)
+            } else if(type == '2') {
+              this.IteraNodeList(nodeList[i].nodeList,  nodeListResult, type, level+1)
+            }
+            
+          }
+          nodeListResult.push(newChild)
+        }
+        return nodeListResult
+      },
+      searchConcept() {
+        let  excludedConceptIds = [];
+        if(this.list[0]) {
+          excludedConceptIds.push(this.list[0].conceptId)
+          this.excludedConceptIds = this.IteraNodeList(this.list[0].nodeList,excludedConceptIds, 2)
+        }
+        
+        const param = {
+          "name": this.conceptText,
+          "excludedConceptIds": this.excludedConceptIds,
+          "relationId": 17,
+          "relationPosition": 1,
+          "typeId": this.addLevel === 0 ? 71 : 16
+        }
+        if(this.addLevel > 0) {
+          param.relationPosition = 2
+          param.relationConceptId = this.relationConceptId
+        }
+        
+        api.getConceptInfoAssay(param).then((res) => {
+          const { data } = res
+          if(data.code == '0') {
+            this.conceptList = data.data
+          }
+        })
+      },
+      selectConcept(item) {
+        if(this.addLevel == 0) {
+          this.list.push(Object.assign({}, item,  {nodeList: [], level: 0, conceptId: item.conceptId, conceptNameType: item.conceptNameType, sonRelationId: 17}))
+          this.list = JSON.parse(JSON.stringify(this.list))
+        }else {
+          const data = this.operaList
+          const newChild = Object.assign({}, item,  {nodeList: [], level: data.level+1, conceptId: item.conceptId, conceptNameType: item.conceptNameType, relationId: 17,sonRelationId: 17});
+          // const newChild = { id: id++, label: 'nodeList', level: data.level+1, children: [] };
+          if (!data.nodeList) {
+          this.$set(data, 'nodeList', []);
+          }
+          data.nodeList.push(newChild);
+        }
+        this.conceptList = [];
+        this.closeSearch();
+      },
+      openSearch(e) {
+        this.showSearch = true
+        this.$refs['conceptSearch'].style.top=  e.pageY - 120 + 'px';
+        this.$refs['conceptInput'].focus();
+      },
+      closeSearch() {
+        this.conceptText = ''
+        this.showSearch = false
+      },
+      append(data, e) {
+          this.addLevel = data.level+1;
+          this.relationConceptId = data.conceptId
+          this.operaList = data;
+          this.openSearch(e);
+
+          // const newChild = { id: id++, label: 'testtest', level: data.level+1, nodeList: [] };
+          // if (!data.nodeList) {
+          // this.$set(data, 'nodeList', []);
+          // }
+          // data.nodeList.push(newChild);
+      },
+
+      remove(node, data) {
+          const parent = node.parent;
+          const nodeList = parent.data.nodeList || parent.data;
+          const index = nodeList.findIndex(d => d.conceptId === data.conceptId);
+          nodeList.splice(index, 1);
+      },
+      message(msg,type){
+        this.$message({
+          showClose: true,
+          message:msg,
+          type:type||'warning'
+        })
+      },
+      
+    }
+  }
+</script>
+<style lang="less" scoped>
+@import "../../less/admin.less";
+.addMedicalMultRelationWrapper {
+  height: calc(100% - 70px);
+}
+.tree {
+  margin-bottom: 230px;
+}
+.contents {
+  height: 100%;
+}
+.btn-box {
+  position: absolute;
+  left: 350px;
+}
+.btn-del {
+  color: #8F8F8F;
+}
+.addBtn {
+  width: 66px;
+  order: 1px solid #21CBC7;
+  border-radius: 2px;
+}
+.conceptSearch {
+  position: absolute;
+  left: 560px;
+  width: 301px;
+  height: 300px;
+  background: #fff;
+  border: 1px solid #ccc;
+  text-align: center;
+  z-index: 2;
+}
+.conceptTitle {
+  width: 100%;
+  text-align: center;
+  padding: 20px 0;
+}
+.searchText {
+  padding: 0 15px;
+  width: 191px;
+  height: 34px;
+}
+.conceptList {
+  width: 221px;
+  height: 170px;
+  margin: -2px auto 0;
+  border: 2px solid #E1DFDF;
+  overflow: hidden;
+  overflow-y: auto;
+}
+.conceptItem {
+  height: 34px;
+  line-height: 34px;
+  text-align: left;
+  padding: 0 15px;
+  cursor: pointer;
+}
+.conceptItem:hover {
+  background: #f5f7fa;
+}
+.closeSearch {
+  position: absolute;
+  width: 30px;
+  right: 0;
+  top: 0;
+}
+.delete {
+  cursor: pointer;
+}
+.content{
+  background: #fff;
+  padding: 20px 20px 30px;
+  color: #545455;
+ 
+}
+
+.btn {
+  text-align: right;
+  margin-top: 20px;
+}
+.custom-tree-node-name {
+  display: inline-block;
+  width: 270px;
+}
+.colorGray {
+  color: #c1c1c1;
+} 
+</style>

+ 262 - 0
src/components/medicalTerm/AssistCheckMultRelation.vue

@@ -0,0 +1,262 @@
+<template>
+    <div>
+        <crumbs title="辅检层级关联维护" minWidth="995px">
+            <el-form :inline="true" class="demo-form-inline">
+                <el-form-item label="医学标准术语:">
+                    <el-input size="mini" v-model="filter.term" placeholder="输入术语"></el-input>
+                </el-form-item>
+                <el-form-item>
+                    <el-button size="mini" @click="filterDatas">确认</el-button>
+                    <el-button size="mini" type="warning" style="margin:0 10px"  @click="addMedicalMultR">添加</el-button>
+                </el-form-item>
+            </el-form>
+        </crumbs>
+        <div class="contents">
+            <el-table :data="list"
+                      border
+                      style="width: 100%">
+                <el-table-column
+                        type="index"
+                        :index="indexMethod"
+                        label="编号"
+                        width="60">
+                </el-table-column>
+                <el-table-column
+                        prop="operTime"
+                        label="操作时间"
+                        :show-overflow-tooltip="true">
+                </el-table-column>
+                <el-table-column
+                        prop="libNameType"
+                        label="医学标准术语"
+                        show-overflow-tooltip>
+                </el-table-column>
+                <el-table-column
+                        prop="otherNames"
+                        label="一级关联标准术语"
+                        show-overflow-tooltip>
+                </el-table-column>
+                <!-- <el-table-column
+                        label="状态">
+                        <template slot-scope="scope">
+                          <span :class="scope.row.isDeleted == 'N'?'':'delete'">
+                            {{scope.row.isDeleted == 'N'?'启用中':'已删除'}}
+                          </span>
+                        </template>
+                </el-table-column> -->
+                <el-table-column
+                        prop="operName"
+                        label="操作人">
+                </el-table-column>
+                
+                <el-table-column
+                        label="操作" width="160">
+                    <template slot-scope="scope">
+                        <el-button type="text" size="small" @click="toEditProduct(scope.row)">修改</el-button>
+                        <span style="margin:0 3px;">|</span>
+                        <el-button type="text" size="small" :class="scope.row.isDeleted == 'N'?'delete':'review'" @click="showDelDialog(scope.row)">{{scope.row.isDeleted == 'N'?'删除':'恢复'}}</el-button>
+                    </template>
+                </el-table-column>
+            </el-table>
+            <el-pagination v-if="total>pageSize"
+                           :current-page.sync="currentPage"
+                           @current-change="currentChange"
+                           background
+                           :page-size="pageSize"
+                           layout="total,prev, pager, next, jumper"
+                           :total="total">
+            </el-pagination>
+        </div>
+
+    </div>
+</template>
+
+<script>
+  import api from '@api/medicalTerm.js';
+  export default {
+    name: 'AssistCheckMultRelation',
+    data: function () {
+      return {
+        list: [],
+        stateSelect:[
+          {id:'N',name:'启用中'},
+          {id:'Y',name:'已删除'},
+        ],
+        isState:'',
+        cacheData: {},
+        currentPage: 1,
+        pageSize: 10,
+        total: 0,
+        searched: false,
+        filter: {
+          term:'',
+        },
+      }
+    },
+    created() {
+      const that = this;
+      //返回时避免参数未赋值就获取列表
+      setTimeout(function(){
+        that.getDataList();
+      });
+    },
+    watch: {
+      'filter': {
+        handler: function () {
+          this.searched = false;
+        },
+        deep: true
+      }
+    },
+    beforeRouteEnter(to, from, next){
+      next(vm => {
+        //const pm = to.param;
+        Object.assign(vm,to.params);
+      })
+    },
+    methods: {
+      addMedicalMultR(){
+        const pam = this.searched ? {
+          currentPage: this.currentPage,
+          filter: this.filter
+        } : {currentPage: this.currentPage};
+        this.$router.push({name:'AddAssistCheckMultRelation',
+          params:pam});
+      },
+      toEditProduct(row){
+        const param = {
+          conceptId: row.conceptId,
+          relationIds: [17,17,17],
+          typeIds: [16,16,16]
+        };
+        const pam = this.searched ? {
+          currentPage: this.currentPage,
+          filter: this.filter
+        } : {currentPage: this.currentPage};
+        api.assisCheckMultRelationDetail(param).then((res) => {
+          const {code,data,msg} = res.data;
+          if(code=='0'){
+              const item = Object.assign({},row,data);
+              this.$router.push({name:'AddAssistCheckMultRelation',params:Object.assign(pam, {isEdit: true, data: item})});
+          }else{
+              this.$message({
+              message: msg,
+              type: 'warning'
+              });
+          }
+        })
+      },
+      filterDatas(){
+        this.currentPage = 1;
+        this.getDataList();
+      },
+      getDataList(isTurnPage) {
+        const param = this.getFilterItems(isTurnPage);
+        this.searched = true;
+        api.assisCheckMultContactList(param).then((res) => {
+          if (res.data.code == '0') {
+            const data = res.data.data;
+            this.list = data.records;
+            this.cacheData[param.current] = data.records;
+            this.total = data.total;
+          }
+        }).catch((error) => {
+          console.log(error);
+        });
+      },
+      getFilterItems(isTurnPage) {
+        //翻页时筛选条件没点确定则清空
+        if(isTurnPage&&!this.searched){
+          this.clearFilter();
+        };
+        const param = {
+          name: this.filter.term,
+          current: this.currentPage,
+          size: this.pageSize,
+          relationId: 17,
+          startTypeIds: [71]
+        };
+        return param;
+      },
+      indexMethod(index) {
+        return ((this.currentPage - 1) * this.pageSize) + index + 1;
+      },
+      currentChange(next) {
+        this.currentPage = next;
+        if (this.cacheData[next]) {       //如果已请求过该页数据,则使用缓存不重复请求
+          this.list = this.cacheData[next];
+        } else {
+          this.getDataList(true);
+        }
+      },
+      warning(msg,type){
+        this.$message({
+          showClose: true,
+          message:msg,
+          type:type||'warning'
+        })
+      },
+      showConfirmDialog(msg,resolve){
+        this.$alert(msg, '提示', {
+          confirmButtonText: '确定',
+          type: 'warning'
+        }).then(() => {
+          resolve();
+        }).catch(() => {});
+      },
+      showDelDialog(item){
+        /*const param = {
+          term:item.term,
+          type:item.type,
+          id:item.id
+        }*/
+        const param = {
+          conceptId:item.conceptId,
+          // isDeleted:item.isDeleted === 'N'?'Y':'N',
+          relationIds: [17,17],
+          typeIds: [3,1]
+        }
+        let waringTxt = '是否删除该关系,可能对现有系统造成影响'
+        this.showConfirmDialog(waringTxt,()=>{
+          api.removeRelationContact(param).then((res)=>{
+            if(res.data.code=='0'){
+              if(!this.searched){
+                //未点确认时清空搜索条件
+                this.clearFilter();
+              }
+              if(this.list.length==1){
+                //当前在最后一页且只有一条数据时,删除后跳到前一页
+                this.currentPage = this.currentPage===1?1:this.currentPage-1;
+              }
+              this.warning(res.data.msg||'操作成功','success');
+              this.getDataList();
+            }else{
+              this.warning(res.data.msg);
+            }
+          }).catch((error)=>{
+            this.warning(error);
+          })
+        });
+      },
+      clearFilter(){
+        this.filter={
+          term:'',
+        };
+      },
+    }
+  }
+</script>
+
+<style lang="less" scoped>
+    @import "../../less/admin.less";
+    .delete{
+        color: red;
+    }
+    .review{
+      color: #22ccc8;
+    }
+    .el-table .cell{
+      overflow: hidden;
+      white-space: nowrap;
+    }
+</style>

+ 6 - 0
src/routes.js

@@ -101,6 +101,10 @@ import QuestionWords from '@components/diagBase/QuestionWords.vue';
 //医学数据统计
 import MedicalStatistics from '@components/medicalStatistics/MedicalStatistics.vue';
 
+//医学术语库维护
+import AssistCheckMultRelation from '@components/medicalTerm/AssistCheckMultRelation.vue';
+import AddAssistCheckMultRelation from '@components/medicalTerm/AddAssistCheckMultRelation.vue';
+
 export default [
   {
     path: '/',
@@ -254,6 +258,8 @@ export default [
 
       {path:'LT-YXSYKWH-YXSYDCGLWH',component:MedicalMultRelation,name:'MedicalMultRelation'},   //医学术语--医学术语多层关联维护
       {path:'LT-YXSYKWH-TJYXSYDCGL',component:AddMedicalMultRelation,name:'AddMedicalMultRelation'},   //医学术语--添加医学术语多层关联
+      {path:'LT-YXSYKWH-FJCJGLWH',component:AssistCheckMultRelation,name:'AssistCheckMultRelation'},   //医学术语--辅检层级关联维护
+      {path:'LT-YXSYKWH-TJFJCJGL',component:AddAssistCheckMultRelation,name:'AddAssistCheckMultRelation'},   //医学术语--添加辅检层级关联
 
       {path:'LT-YWZSJWH-DLTXDWH',component:SimpleQuestion,name:'SimpleQuestion'},  //预问诊-独立填写单
       {path:'LT-YWZSJWH-ZHTXDWH',component:CombinQuestion,name:'CombinQuestion'},  //预问诊-组合填写单

+ 2 - 2
vue.config.js

@@ -1,7 +1,7 @@
 const path = require('path');
 // const proxy_path = 'http://192.168.2.236:80';
-const proxy_path = 'http://192.168.2.241:88';
-// const proxy_path = 'http://192.168.2.236:88';
+// const proxy_path = 'http://192.168.2.241:88';
+const proxy_path = 'http://192.168.2.236:88';
 // const proxy_path = 'http://192.168.3.101:5050';
 // const proxy_path = 'http://192.168.3.117:5050';//周铁刚
 // const proxy_path = 'http://192.168.3.115:5050';