浏览代码

显示已关联问题3266

zhouna 5 年之前
父节点
当前提交
98a703ba34
共有 4 个文件被更改,包括 61 次插入2 次删除
  1. 1 0
      src/api/config.js
  2. 1 1
      src/api/index.js
  3. 3 0
      src/api/preTreat.js
  4. 56 1
      src/components/preTreat/PubSelect.vue

+ 1 - 0
src/api/config.js

@@ -248,6 +248,7 @@ export default {
     'moduleDetail':'/api/precman/moduleInfo_prec/getModuleInfoOne',    //模板详情
     'deptList':testUrl+'/api/precman/moduleInfo_prec/getAllDeptAndDisInfo',    //模板-科室列表
     'getPrecModuleType':testUrl+'/api/precman/moduleInfo_prec/getModuleType',     //获取未创建的模板类型
+    'getByIds':'/api/prec/questionInfo/getByIds',// 获取多个问题
      /*********诊断依据*********/
      'exportDiagnosticAll': '/api/knowledgeman/diagnose/exportDiagnosticAll', //诊断依据--导出诊断依据
      'exportDiagnosticBasis': '/api/knowledgeman/diagnose/exportDiagnosticBasis', //诊断依据--导出诊断依据问题

+ 1 - 1
src/api/index.js

@@ -3,7 +3,7 @@ import config from './config.js';
 
 axios.default.timeout = 5000;
 axios.defaults.headers.post['Content-Type'] = "application/json;charset=utf-8";
-//axios.defaults.baseURL = 'http://192.168.2.236:88';
+axios.defaults.baseURL = 'http://192.168.2.236:88';
 
 const urls = config.urls;
 export default {

+ 3 - 0
src/api/preTreat.js

@@ -3,6 +3,9 @@ import config from '@api/config.js';
 
 const urls = config.urls;
 export default {
+  getByIds(param){
+    return axios.post(urls.getByIds,param)
+  },
   getQuestionList(param){
     return axios.post(urls.questionList,param);
   },

+ 56 - 1
src/components/preTreat/PubSelect.vue

@@ -51,7 +51,7 @@
             ></el-input>
           </div>
           <el-tag v-if="it.exclusion" type="info" size="mini">互斥项</el-tag>
-          <el-tag v-if="it.exclusionCon" type="info" size="mini">已关联</el-tag>
+          <span :class="tagActive===i?'tag-active el-tag--mini el-tag el-tag--info':'el-tag--mini el-tag el-tag--info'" v-if="it.exclusionCon" @click="getConnectedQas(it.subQuestion,i)">已关联</span>
         </el-col>
         <el-button @click="addRow">+</el-button>
         <div class="bottomPartMid bottomPartMidss">
@@ -62,6 +62,10 @@
             <span class="el-icon-arrow-down" @click="orderUpDown(1)"></span>
           </p>
         </div>
+        <div class="connected-qas" v-if="showQas.length>0">
+          <p style="margin-bottom: 10px;">关联的问题:</p>
+          <p v-for="(qa,i) in showQas">{{i+1}}. {{qa.name}}</p>
+        </div>
       </div>
       <div class="main-area sigle-row" v-if="type==3">
         <el-col v-for="(it,i) in rows" :key="i">
@@ -123,8 +127,21 @@
 </template>
 <style lang="less">
 @import "../../less/common.less";
+.tag-active{
+  background: #ccc;
+}
 .main-area {
   position: relative;
+  .connected-qas{
+    width:190px;
+    height:200px;
+    background: #fff;
+    position: absolute;
+    top:29px;
+    right: -150px;
+    border:1px #ccc solid;
+    padding:5px;
+  }
   .bottomPartMid {
     position: absolute;
     top: 29px;
@@ -252,6 +269,9 @@ export default {
       searchVal: "",
       leftTagsList: [],
       selectLeftTagsList:[],
+      tagActive:-1,
+      connectedQas:{},
+      showQas:[],
       styles: {
         background: "#eae7e7"
       },
@@ -296,6 +316,41 @@ export default {
     }
   },
   methods: {
+    getConnectedQas(ids,n){
+      if(this.tagActive===n){
+        this.tagActive=-1;
+        this.showQas=[];
+        return;
+      }
+      this.tagActive=n;
+      const idArr=ids.split(",");
+      let idsA = [],qa={};
+      this.showQas=[];
+      idArr.map((it)=>{
+        qa=this.connectedQas[it];
+        if(!qa){
+          idsA.push(it);
+        }else{
+          this.showQas.push(qa);
+        }
+      });
+      if(idsA.length===0){
+        return;
+      }
+      const param = {
+        age:'',
+        ids:idsA,
+        sexType:this.sexType
+      };
+      api.getByIds(param).then((res)=>{
+        if(res.data.code=='0'){
+          this.connectedQas=Object.assign({},this.connectedQas,res.data.data);
+          idsA.map((q)=>{
+            this.showQas.push(this.connectedQas[q]);
+          });
+        }
+      });
+    },
     selectLeftTag(tag) {
       const hasTag = this.isHasTag(tag, this.selectLeftTagsList);
       if (hasTag) {