Browse Source

Merge remote-tracking branch 'origin/testedMerge'

zhouna 5 years ago
parent
commit
993cb7e411

+ 1 - 1
src/api/config.js

@@ -299,7 +299,7 @@ export default {
       'getQCTempDetail':'/api/mrman/qc/qcModuleInfo/getById', //获取模板详情
       'getQCName':'/api/mrman/qc/qcQuestionInfo/index', //获取字段名称
       'getQcFlawList':'/api/mrman/qcCasesEntry/indexCaseEntry',   //获取缺陷列表
-      'getModuleTypeList':'/api/mrman/med/RecordModule/getAll', //获取模块类型列表
+      'getModuleTypeList':'/api/mrman/qc/qcModuleInfo/index', //获取模块类型列表
       'getRecordInpList':'/api/mrman/qcInputcases/getAllInputcases',//获取全部病历录入
       'removeRecordInpById':'/api/mrman/qcInputcases/cancelById',//删除病历录入
       'addRecordInp':'/api/mrman/qcInputcases/saveOrUpdata', //保存和修改全部病历录入 

+ 46 - 78
src/components/qualityControl/AddQualityControlTemp.vue

@@ -11,22 +11,18 @@
                         </el-select>
                     </el-form-item>
                     <el-form-item label="所属模块:" prop="moduleName" class="formItem">
-                        <el-select  v-model="form.moduleName" placeholder="请选择所属模块"  :disabled="isEdit||isCopy" class="selectModule" @change="changeHsopital">
+                        <el-select  v-model="form.moduleName" placeholder="请选择所属模块"  :disabled="isEdit||isCopy" class="selectModule" @change="changeModule">
                             <el-option v-for="item in moduleList" :key="item.id" :label="item.name" :value="item.val"></el-option>
                         </el-select>
                     </el-form-item>
-                    <el-form-item label="模块类型:" prop="moduleType" class="formItem widthLarge">
-                        <el-select  v-model="form.moduleType" :disabled="form.hospital==='' || form.moduleName===''" placeholder="请选择模块类型"   @change="changeModuleType" class="selectModule">
-                            <el-option v-for="item in moduleTypeList" :key="item.id" :label="item.recTypeDetail" :value="item.id"></el-option>
-                        </el-select>
-                    </el-form-item>
                     <el-form-item label="模板名称:" prop="tempName" class="formItem widthLarge">
-                        <el-input v-model="form.tempName"  placeholder="请输入模板名称" disabled></el-input>
+                        <el-input v-model="form.tempName"  placeholder="请输入模板名称"></el-input>
                     </el-form-item>
-                     <el-form-item label="示例:" v-if="form.moduleType !==''" prop="example" class="formItem formExam">
-                         <span class="exampleTxt">{{form.example}}</span>
-                        <!-- <el-input v-model="form.example"  disabled placeholder="示例"></el-input> -->
+                    <el-form-item label="模块类型:" prop="moduleTypes" class="formItem widthLarge">
                     </el-form-item>
+                    <QCTypePour :hospital="form.hospital"
+                                :moduleName="form.moduleName"
+                                @changeActionData="moduleTypeChange" :selectedTag="form.recordAnalyzeList"></QCTypePour>
                     <el-form-item label="模块内容:" prop="moduleInfo" class="formItem addCon">
                         <div class="moduleInfoItem" v-for="(item,index) in moduleInfoList">
                             <div class="orderBox">
@@ -77,6 +73,7 @@
 </template>
 <script>
 import api from '@api/qualityControl.js';
+import QCTypePour from './QCTypePour.vue';
 export default {
     name:"AddQualityControlTemp",
     data: function(){
@@ -89,46 +86,27 @@ export default {
                 tempName: "",
                 hospital:"",
                 moduleName:"",
-                moduleType:"",
+                moduleTypes:[],
+                recordAnalyzeList:[],
                 nameType:""
             },
             rules:{
                 tempName:{ required: true, message: '请输入模块名称', trigger: ['blur', 'change']},
                 hospital:{ required: true, message: '请选择医院', trigger: ['blur', 'change']},
                 moduleName:{ required: true, message: '请选择所属模块', trigger: ['blur', 'change']},
-                moduleType:{ required: true, message: '请选择模块类型   ', trigger: ['blur', 'change']},
+                moduleTypes:{ required: true, message: '请选择模块类型   ', trigger: ['blur', 'change']},
                 /*name:[{ required: true, message: '请输入显示名称',trigger: ['blur', 'change'] }],*/
             },
             searchIndex: -1,
             
             hospitalList:[],
             moduleList:[ ],
-            moduleTypeList:[], //模块类型列表
-            moduleInfoList:[
-                // {   
-                //     searchName:"",
-                //     activeIndex: -1,
-                //     searchResult:[
-                //         // {
-                //         //     name: "4姓名"
-                //         // },
-                //         // {
-                //         //     name: "5职业"
-                //         // },
-                //         // {
-                //         //     name: "6年龄"
-                //         // }
-                //     ],
-                //     selectFiled:[
-                        
-                //     ]
-                // }
-            ]
+            moduleInfoList:[]
         }
     },
     created(){
         this.getAllTypes();
-        const {isCopy, isEdit, data } = this.$route.params
+        const {isCopy, isEdit, data } = this.$route.params;
         if(isEdit || isCopy) {
             this.form.hospital = ''+data.hospitalId
             this.form.moduleName = ''+data.modeId
@@ -136,11 +114,8 @@ export default {
                 this.isEdit = isEdit;
                 this.id = data.id
                 this.title ="模板维护-修改"
-               this.form.tempName = data.name
-               this.getModuleTypeList().then(res =>{
-                   this.form.moduleType = data.recordModuleId
-                   this.form.example = this.moduleTypeList.find(item => item.id == this.form.moduleType).behospitalCodes
-                })
+                this.form.tempName = data.name;
+                this.form.recordAnalyzeList = data.recordAnalyzeList;
             }
             if(isCopy){
                 this.isEdit = isEdit;
@@ -148,9 +123,8 @@ export default {
                 this.id = ""
                 this.title ="模板维护-复制"
                 this.form.tempName = ""
-                 this.form.moduleType=""
-                 this.form.example=""
-                 this.getModuleTypeList()
+                this.form.moduleTypes=[];
+                 //this.form.example=""
             }
             const moduleDetail = data.moduleDetail
             const keysList = Object.keys(moduleDetail)
@@ -175,6 +149,9 @@ export default {
        
     },
     methods:{
+        moduleTypeChange(list){
+          this.form.moduleTypes=[...list];
+        },
         closeSearch(){
             if(this.searchIndex > -1){
                 this.moduleInfoList[this.searchIndex].searchName = ""
@@ -210,40 +187,28 @@ export default {
             // e.stopPropagation()
         },
         changeHsopital(){
-            this.form.moduleType = ""
-            this.getModuleTypeList()
+            this.form.moduleTypes = []
         },
         changeModule(){
-             this.form.moduleType = ""
-            this.getModuleTypeList()
-        },
-        changeModuleType(){
-            this.form.example = this.moduleTypeList.find(item => item.id == this.form.moduleType).behospitalCodes
-            this.form.tempName = this.moduleTypeList.find(item => item.id == this.form.moduleType).recTypeDetail
-        },
-        getModuleTypeList(){
-            this.moduleTypeList = []
-            if(this.form.hospital === "" || this.form.moduleName===""){
-                return
-            }
-            return api.getModuleTypeList({hospitalId: this.form.hospital, modeId: this.form.moduleName}).then((res) =>{
-                if(res.data.code==="0"){
-                    const data = res.data.data;
-                    this.moduleTypeList = data
-                }else{
-                    this.moduleTypeList=[]
-                    this.warning("获取模块类型失败");
-                }
-            })
+             this.form.moduleTypes = []
         },
         addUnit(){
-            if(!this.form.hospital){
+          const {hospital,moduleName,tempName,moduleTypes}=this.form;
+            if(!hospital){
                 this.warning("请先选择所属医院")
                 return
             }
-            if(!this.form.tempName){
-                this.warning("请先选择模块")
-                return
+            if(!moduleName){
+              this.warning("请选择所属模块");
+              return
+            }
+            if(!tempName.trim()){
+              this.warning("请输入模块名称");
+              return
+            }
+            if(!moduleTypes.length){
+              this.warning("请先选择模块类型");
+              return
             }
             this.moduleInfoList.push({   
                         searchName:"",
@@ -338,8 +303,8 @@ export default {
         confirm(form){
             // this.$refs[form].validate((valid) => {
             //     if (valid) {
-                    const {tempName,hospital,moduleName,moduleType} = this.form
-                    let moduleDetail = [], moduleInfoList = this.moduleInfoList
+                    const {tempName,hospital,moduleName,moduleTypes} = this.form;
+                    let moduleDetail = [], moduleInfoList = this.moduleInfoList;
                     for(let i = 0; i < moduleInfoList.length; i++){
                        for(let j = 0; j < moduleInfoList[i].selectFiled.length; j++){
                             let item ={
@@ -358,12 +323,12 @@ export default {
                         this.warning("请选择所属模块");
                         return
                     }
-                    if(!moduleType){
-                        this.warning("请选择模块类型");
-                        return
-                    }
                     if(!tempName){
-                        this.warning("请输入模块名称");
+                      this.warning("请输入模块名称");
+                      return
+                    }
+                    if(!moduleTypes.length){
+                        this.warning("请选择模块类型");
                         return
                     }
                    
@@ -378,8 +343,8 @@ export default {
                         hospitalId: hospital,
                         moduleDetail: moduleDetail,
                         remark:'',
-                        recordModuleId:moduleType
-                     }
+                        recordIdList:moduleTypes
+                     };
                      if(this.isEdit){
                          param = Object.assign({}, param, {id: this.id})
                      }
@@ -436,6 +401,9 @@ export default {
                 duration:time || '3000'
             })
         },
+    },
+    components:{
+      QCTypePour
     }
 
 }

+ 61 - 0
src/components/qualityControl/QCTipPop.vue

@@ -0,0 +1,61 @@
+<template>
+    <div class="pop" :style="getStyle()">
+        <p class="close"><a href="javascript:void(0);" @click="closePop">×</a></p>
+        <div class="info">
+            <p>模块类型:{{name}}</p>
+            <p>示例:{{example}}</p>
+        </div>
+
+    </div>
+</template>
+
+<script>
+  export default {
+    name: "QCTipPop",
+    props: ['name','example','top','left','show'],
+    data() {
+      return {
+        getStyle(){
+            return {
+                top:(this.top-340)+"px",
+                left:(this.left-310)+"px",
+                display:this.show?"block":"none"
+            }
+        }
+      }
+    },
+    methods:{
+      closePop(){
+        this.$emit("close");
+      }
+    }
+  }
+</script>
+<style lang="less" scoped>
+    .pop{
+        position: absolute;
+        border: 1px solid #c0c4cc;
+        padding: 5px 10px;
+        border-radius: 5px;
+        background: #fff;
+        font-size: 12px;
+        line-height: 22px;
+        z-index: 99;
+        width: 300px;
+        .info{
+            max-height: 270px;
+            word-break: break-all;
+            overflow: auto;
+        }
+        .close{
+            text-align:right;
+            a{
+                display: inline-block;
+                font-size: 18px;
+                color: #909090;
+            }
+
+        }
+
+    }
+</style>

+ 435 - 0
src/components/qualityControl/QCTypePour.vue

@@ -0,0 +1,435 @@
+<template>
+    <div class="qcTypeWrapper commomSymptom clearfix">
+        <QCTipPop :name="curName" :example="curEmp" :show="showPop" :top="popTop" :left="popLeft" @close="closePop"></QCTipPop>
+        <div class="bottomPartLeft">
+            <p style="height: 26px;"> </p>
+          <div class="pool">
+            <ul class="tagList tagPool">
+                <li v-for="(item, index) in leftTagsList"
+                    class = "tagItem"
+                    :key='item.id'
+                    :style="getStyle(item)?styles:null"
+                    @click='selectLeftTag(item, index, $event)'
+                >
+                    <p class="ellipsis" @click="closePop">
+                        <span class="tagName">{{item.name}}</span>
+                        <span :class="activeId==item.id?'tip-icon active':'tip-icon'" @click.stop="showTipPop(item,$event)"></span>
+                    </p>
+                </li>
+            </ul>
+          </div>
+        </div>
+        <div class="bottomPartMid fl">
+            <p><span class="el-icon-arrow-right" @click="toRightList"></span></p>
+            <p><span class="el-icon-arrow-left" @click="toLeftList"></span></p>
+        </div>
+        <div class="bottomPartRight ">
+          <p class="poolTitle">已选模块类型:</p>
+          <ul class="tagList operationPool operationPools">
+                <li class = "tagItem"
+                    v-for="(item) in rightTagsList"
+                    :key='item.id'
+                    :style="getStyle2(item)?styles:null"
+                    @click='selectRightTag(item)'
+                >
+                    <p class="ellipsis" @click="closePop">
+                        <span class="tagName">{{item.name}}</span>
+                        <span :class="activeId==item.id?'tip-icon active':'tip-icon'" @click.stop="showTipPop(item,$event)"></span>
+                    </p>
+                </li>
+            </ul>
+        </div>
+    <!--<div class="buttonBox" :class="(qaType==2)?'rightMore':''">
+        <div class="bottomPartMid bottomPartMidss fl bottomPartMids" >
+            <p><span class="el-icon-arrow-up" @click="toggleTopDownList(1)"></span></p>
+            <p><span class="el-icon-arrow-down" @click="toggleTopDownList(2)"></span></p>
+        </div>
+    </div>-->
+  </div>
+</template>
+<script>
+import api from '@api/qualityControl.js';
+import QCTipPop from './QCTipPop.vue';
+
+export default {
+    name: "QCTypePour",
+    props: ['hospital','moduleName','selectedTag'],
+    data() {
+        return {
+            checkedExc:false,
+            leftTagsList: [],
+            selectLeftTagsList: [],
+            rightTagsList: [],
+            selectRightTagsList: [],
+            showPop:false,
+            activeId:'',
+            curName:"",
+            curEmp:"",
+            popTop:'',
+            popLeft:'',
+            styles:{
+                background:'#eae7e7'
+            },
+        }
+    },
+    mounted() {
+      //编辑
+        if(this.hospital&&this.moduleName){
+          const that = this;
+          setTimeout(function(){            //等watch执行后赋值tags,否则这里先执行,会被watch里清空
+            that.rightTagsList = [...that.selectedTag];
+            that.getModuleTypeList();
+            that.$emit('changeActionData',that.getModuleTypeIds());
+          },100);
+        }
+    },
+    watch: {
+      hospital(){
+          this.getModuleTypeList();
+        },
+      moduleName(){
+          this.getModuleTypeList();
+        },
+      /*'selectRightTagsList':{
+          handler:function(newVal){
+          },
+          deep:true
+        }*/
+    },
+    methods: {
+        closePop(){
+          this.activeId = '';
+          this.curName = '';
+          this.curEmp = '';
+          this.popTop = 0;
+          this.popLeft=0;
+          this.showPop=false;
+        },
+        showTipPop(item,e){
+          if(this.showPop&&this.activeId===item.id){
+            this.closePop();
+            return;
+          }
+          this.activeId = item.id;
+          this.curName = item.name;
+          this.curEmp = item.behospitalCodes;
+          this.popTop = e.clientY;
+          this.popLeft=e.clientX;
+          this.showPop = true;
+        },
+        handleExclu(){
+            if(!this.selectRightTagsList||this.selectRightTagsList.length==0){
+              this.$message({
+                showClose: true,
+                message: '请先选择要操作的标签',
+                type: 'warning'
+              });
+              return ;
+            }
+            const arr = this.rightTagsList.map((it)=>{
+              if(it.id==this.selectRightTagsList[0].id){
+                if(it.exclusionType===1){
+                  it.exclusionType = 0
+                }else{
+                  it.exclusionType=1;
+                }
+              }else{
+                it.exclusionType=0;
+              }
+              return it;
+            });
+            this.rightTagsList=arr;
+            this.$emit('changeActionData',this.getModuleTypeIds());
+        },
+        transOptions(opt){
+          return opt&&opt.map((it)=>{
+            return Object.assign({},it,{id:it.questionId||it.id});      //模板是questionId,组合是id
+          });
+        },
+        ifReflashTagList(newVal='', preVal=''){
+          if(newVal.trim() == ''){
+            this.searchVal = '';
+            this.rightTagsList=[];
+            this.getModuleTypeList();
+          }else if(newVal.trim() != preVal.trim()){
+            this.searchVal = '';
+            this.rightTagsList=[];
+            this.getModuleTypeList();
+          }
+        },
+        selectLeftTag(tag) {
+            const hasTag = this.isHasTag(tag, this.selectLeftTagsList);
+            if (hasTag) {
+                this.selectLeftTagsList = this.selectLeftTagsList.filter(item => item.id !== tag.id)
+            } else {
+                this.selectLeftTagsList.push(tag);
+            }
+        },
+        selectRightTag(tag) {
+            let tmpArr = [];
+            tmpArr.push(tag);
+            if (this.selectRightTagsList.length > 0 && tag.id == this.selectRightTagsList[0].id) {
+              this.selectRightTagsList = this.selectRightTagsList.filter(item => item.id !== tag.id)
+            }else{
+              this.selectRightTagsList = tmpArr;
+            }
+        },
+        isHasTag(item, arr) {
+            for ( let i = 0; i <arr.length; i++) {
+                if(arr[i].id === item.id) {
+                    return true;
+                }
+            }
+            return false;
+        },
+        getStyle(item){       //左侧选中状态
+            return this.isHasTag(item, this.selectLeftTagsList)
+        },
+        getStyle2(item) {
+            return this.isHasTag(item, this.selectRightTagsList);
+        },
+        toggleTopDownList(type){
+          if(this.selectRightTagsList.length == 0 || this.rightTagsList.length == 0){
+            return;
+          }
+          const tmpRightSelect = JSON.parse(JSON.stringify(this.selectRightTagsList));
+          const tmpRightLis = JSON.parse(JSON.stringify(this.rightTagsList));
+          const numLen = tmpRightLis.length;
+          const numId = tmpRightSelect[0].id;
+          if(type == 1){
+            for(let i = 0;i < tmpRightLis.length;i++){
+              if(numId === tmpRightLis[i].id){//选中的是第几个
+                if(i == 0){//第一个不能往上移动
+                  return;
+                }else{//先把这个元素和后面的输入框从数组中删除,再添加到数组里
+                  let tmp1 = tmpRightLis[i];
+                  tmpRightLis.splice(i,1);
+                  tmpRightLis.splice(i-1,0,tmp1);
+                  this.rightTagsList = [...tmpRightLis];
+                  this.$emit('changeActionData',this.getModuleTypeIds(), false);
+                  return
+                }
+              }
+            }
+          }else if(type == 2){
+            for(let i = 0;i < tmpRightLis.length;i++){
+              if(numId === tmpRightLis[i].id){
+                if(i == numLen-1){
+                  return;
+                }else{
+                  let tmp1 = tmpRightLis[i];
+                  tmpRightLis.splice(i,1);
+                  tmpRightLis.splice(i+1,0,tmp1);
+                  this.rightTagsList = [...tmpRightLis];
+                  this.$emit('changeActionData',this.getModuleTypeIds(), false);
+                  return;
+                }
+              }
+            }
+          }
+        },
+        toLeftList() {console.log(this.rightTagsList)
+            this.leftTagsList.push(...this.selectRightTagsList);
+            for (let i = 0; i < this.selectRightTagsList.length; i++) {
+                this.rightTagsList = this.rightTagsList.filter(item => item.id !== this.selectRightTagsList[i].id);
+            }
+            for (let i = 0; i < this.selectRightTagsList.length; i++) {
+                for (let j = 0; j < this.rightTagsList.length; j++) {
+                    if(this.selectRightTagsList[i].id === this.rightTagsList[j].id) {
+                        if(this.rightTagsList.length === 1) {
+                            this.rightTagsList = [];
+                        } else {
+                            this.rightTagsList.splice(j, 1);
+                        }
+                    }
+                }
+            }
+            this.selectLeftTagsList = [];
+            this.selectRightTagsList = [];
+            //this.getModuleTypeList();
+            this.$emit('changeActionData',this.getModuleTypeIds(), false);
+        },
+        toRightList() {
+            this.rightTagsList.push(...this.selectLeftTagsList);
+            for (let i = 0; i < this.rightTagsList.length; i++) {
+                this.leftTagsList = this.leftTagsList.filter(item => item.id !== this.rightTagsList[i].id)
+            }
+            this.selectLeftTagsList = [];
+            this.selectRightTagsList = [];
+            //this.getModuleTypeList();
+            this.$emit('changeActionData',this.getModuleTypeIds(), false);
+        },
+        getModuleTypeList() {
+          this.leftTagsList = []
+          if(this.hospital === "" || this.moduleName===""){
+            return
+          }
+          return api.getModuleTypeList({hospitalId: this.hospital, modeId: this.moduleName,notIdList:this.getModuleTypeIds()||[]}).then((res) =>{
+            if(res.data.code==="0"){
+              const data = res.data.data;
+              this.leftTagsList = data;
+              this.selectLeftTagsList = [];
+              this.selectRightTagsList = [];
+            }else{
+              this.leftTagsList=[];
+              this.selectLeftTagsList = [];
+              this.selectRightTagsList = [];
+              this.warning("获取模块类型失败");
+            }
+          })
+        },
+      getModuleTypeIds(){
+          const list=this.rightTagsList;
+          return list.map((it)=>it.id);
+      }
+    },
+    components:{
+      QCTipPop
+    }
+}
+</script>
+
+<style lang="less" scoped>
+@import '../../less/common.less';
+.operation-row{
+    text-align: right;
+}
+.exclu{
+    position: absolute;
+    right: -54px;
+    top: 5px;
+}
+.rightMore{
+    margin-left: 48px;
+}
+.commomSymptom {
+  .tagList.operationPools {
+    width: 100%;
+  }
+  div.bottomPartMids {
+    margin-left: 20px;
+  }
+  div.bottomPartMidss {
+    margin-top: 30px;
+  }
+}
+.qcTypeWrapper {
+    padding-left: 60px;
+    margin:-20px 0 20px;
+    position: relative;
+    .bottomPartLeft {
+        width: 40%;
+        box-sizing: border-box;
+        float: left;
+    }
+    .poolTitle {
+        // border-bottom: 1px solid @icssBorder;
+        box-sizing: border-box;
+        margin-bottom: 10px;
+        font-size: 12px;
+    }
+    .pool {
+        // border:1px solid @icssBorder;
+    
+    }
+    .search {
+        width: 100%;
+        border-bottom: 1px solid @icssBorder;
+        box-sizing: border-box;
+        height: 30px;
+    }
+    .tagList {
+        border: 1px solid @icssBorder;
+    }
+    .ellipsis{
+        .tip-icon{
+            display:inline-block;
+            width:16px;
+            height: 16px;
+            vertical-align: middle;
+            background-image:url("../../images/tip.png");
+            background-size:16px;
+            background-repeat:no-repeat;
+            &:hover,&.active{
+                 background-image:url("../../images/tip1.png");
+            }
+        }
+
+    }
+    /*.pop{
+        display: none;
+        position: absolute;
+        top:-30px;
+        right: -10px;
+        padding: 5px 10px;
+        background: #fff;
+        border:1px #ccc solid;
+        border-radius: 3px;
+        line-height: 20px;
+        font-size: 12px;
+        width: 300px;
+        word-break: break-all;
+        z-index: 1;
+    }*/
+    .tagPool {
+        height: 320px;
+        overflow-y: auto;
+
+    }
+    .tagItem {
+        position: relative;
+        line-height: 30px;
+        cursor: pointer;
+        padding: 0 10px;
+        /*z-index:0;*/
+    }
+    .operationPool {
+        position: relative;
+        width: 60%;
+        min-height: 300px;
+        padding: 10px 0;
+    }
+    .tagName{
+        margin-right: 10px;
+        font-size: 14px;
+        vertical-align: middle;
+    }
+    .bottomPartMid {
+        width: 8%;
+        margin-top: 60px;
+        p {
+        width: 100%;
+        text-align: center;
+        span {
+            cursor: pointer;
+            display: inline-block;
+            width: 30px;
+            height: 40px;
+            line-height: 40px;
+            margin: 0 auto;
+            border: 1px solid @icssBorder;
+            margin-bottom: 15px;
+            font-size: 18px;
+        }
+        }
+    }
+    .bottomPartRight {
+        float: left;
+        width: 40%;
+    }
+    .buttonBox {
+        width: 10%;
+        float: left;
+        margin-top: 30px;
+    }
+    .inputBox {
+        width: 120px;
+        .el-input {
+            .el-input__inner {
+                height: 30px;
+                background: rgb(234, 231, 231);
+            }
+        }
+    }
+}
+</style>

+ 12 - 2
src/components/qualityControl/QualityControlTemp.vue

@@ -48,12 +48,14 @@
                 <el-table-column
                         :resizable = "false"
                         prop="modeId"
+                        :formatter="moduleFormatter"
                         label="所属模块">
                 </el-table-column>
                 
                 <el-table-column
                         :resizable = "false"
                         prop="hospitalId"
+                        :formatter="hisFormatter"
                         label="所属医院">
                 </el-table-column>
                 <el-table-column
@@ -130,6 +132,14 @@
       })
     },
     methods: {
+      moduleFormatter(row, column, cellValue){
+        const it = this.moduleList.find(item => item.val == cellValue);
+        return it?it.name:'';
+      },
+      hisFormatter(row, column, cellValue){
+        const it = this.hospitalList.find(item => item.val == cellValue);
+        return it?it.name:'';
+      },
       getAllTypes(){
           if(localStorage.getItem("qcModuleTypes")){
               this.hospitalList = JSON.parse(localStorage.getItem("qcHospitalTypes"));
@@ -172,10 +182,10 @@
         api.getQCTemplist(param).then((res) => {
           loading.close()
           let list = res.data.data.records
-          for(let i = 0; i < list.length; i++){
+          /*for(let i = 0; i < list.length; i++){
             list[i].hospitalId = this.hospitalList.find(item => item.val == list[i].hospitalId).name
             list[i].modeId  = this.moduleList.find(item => item.val == list[i].modeId).name
-          }
+          }*/
           this.list = list;
           this.total = res.data.data.total;
           if(this.inCurrentPage!==undefined){

BIN
src/images/tip.png


BIN
src/images/tip1.png