Browse Source

诊断关联量表维护

zhangxc 6 years ago
parent
commit
a3b7d71f38

+ 4 - 0
src/api/config.js

@@ -183,6 +183,10 @@ export default {
     'cancelIndexConfigAlls':'api/icssman/indexConfig/cancelIndexConfigAlls',  //医学数据-慢病指标值关联维护-删除慢病指标值关联
     'saveIndexConfigLists':'api/icssman/indexConfig/saveIndexConfigLists',  //医学数据-慢病指标值关联维护-添加关联
     'updateIndexConfigList':'api/icssman/indexConfig/updateIndexConfigList',  //医学数据-慢病指标值关联维护-修改关联
+    'getDisScaleAllInfo':'api/icssman/disScale/getDisScaleAllInfo',  //医学数据-诊断量表关联维护-列表
+    'addDisScaleInfo':'api/icssman/disScale/addDisScaleInfo',  //医学数据-诊断量表关联维护-添加和修改
+    'getDisScaleByDisId':'api/icssman/disScale/getDisScaleByDisId',  //医学数据-诊断量表关联维护-根据诊断id获取诊断量表关联信息(修改回读用)
+    'delDisScaleInfo':'api/icssman/disScale/delDisScaleInfo',  //医学数据-诊断量表关联维护-删除
     
 	},
 	menuIconList: { //菜单对应图标

+ 13 - 0
src/api/icss.js

@@ -322,4 +322,17 @@ export default {
     updateIndexConfigList(param) {
         return axios.post(urls.updateIndexConfigList, param)    //医学数据-慢病指标值关联维护-修改关联
     },
+    getDisScaleAllInfo(param) {
+        return axios.post(urls.getDisScaleAllInfo, param)    //医学数据-诊断量表关联维护-列表
+    },
+    addDisScaleInfo(param) {
+        return axios.post(urls.addDisScaleInfo, param)    //医学数据-诊断量表关联维护-添加和修改
+    },
+    getDisScaleByDisId(param) {
+        return axios.post(urls.getDisScaleByDisId, param)    //医学数据-诊断量表关联维护-根据诊断id获取诊断量表关联信息(修改回读用)
+    },
+    delDisScaleInfo(param) {
+        return axios.post(urls.delDisScaleInfo, param)    //医学数据-诊断量表关联维护-删除
+    },
+  
 }

+ 1 - 1
src/components/icss/AddChemicalAndCommonMapping.vue

@@ -3,7 +3,7 @@
         <div class="groupTitle"><i
                 class="el-icon-back"
                 @click="back"
-        ></i>化验大小项与公表项对应维护--添加关联</div>
+        ></i> 化验大小项与公表项对应维护--添加关联</div>
         <div class="AddChemicalAndCommonMappingBox clearfix">
             <div class="titleBox clearfix">
                 <h3 class="title">关联公表项</h3>

+ 0 - 0
src/components/icss/AddChronicAndIndexRelation.vue


+ 439 - 0
src/components/icss/AddDisAndScaleRelation.vue

@@ -0,0 +1,439 @@
+<!-- 添加常见科室症状  -->
+<template>
+    <div class="addDisAndScaleRelationWrapper">
+        <div class="groupTitle"><i
+            class="el-icon-back"
+            @click="back"
+        ></i> 量表管理维护--{{titleText}}</div>
+        <el-form :model="form" ref="ruleForm"  class="addDepartForm">
+            <el-form-item label="选择诊断标签:" prop="department">
+                <input class="searchInput"  @focus="focuInput" type="text" v-model = "searchDiagVal"> 
+                <span class="searchName" @click="searchDiag">搜索</span>
+                <ul class="itemList diagList" ref="diagList">
+                    <li 
+                    v-for="item in diagList" 
+                    class="diagItem ellipsis"
+                    :title="item.tagName"
+                    @click="selectDiag(item)"
+                    :key="item.id">
+                    {{item.tagName}}
+                    </li>
+                </ul>
+            </el-form-item>
+             <el-form-item label="已选择诊断:" prop="type">
+                {{form.disName}}
+            </el-form-item>
+        </el-form>
+        <div class="symptomList">
+            <div class="bottomPartLeft fl" v-if="!isDetail">
+                
+                <p class="symptomPoolTitle">标签池</p>
+                <div class="symptomPool">
+                    <el-input
+                    placeholder="请输入搜索内容"
+                    v-model="searchTagVal"
+                    >
+                        <i
+                            slot="prefix"
+                            class="el-input__icon el-icon-search"
+                        ></i>
+                    </el-input>
+                    <ul class="tagList tagPool">
+                        <li v-for="(item, index) in leftTagsList"
+                            class = "tagItem"
+                            :key='item.id'
+                            :title="'[ '+item.tagName+' ]'"
+                            :style="getStyle(item)?styles:null"
+                            @click='selectLeftTag(item, index)'
+                        >
+                            <p class="tagName ellipsis" >{{item.tagName}} </p>
+                        </li>
+                    </ul>
+                </div>
+
+            </div>
+            <div class="bottomPartMid fl" v-if="!isDetail">
+                <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 fl">
+                <p class="symptomPoolTitle">已选内容:</p>
+                <ul class="tagList operationPool">
+                        <li class = "tagItem"
+                            v-for="(item,index) in rightTagsList" 
+                            :key='item.id'
+                            :style="index === selectRightTagIndex?styles:null"
+                            @click='isDetail ? "":selectRightTag(index)'
+                        >   
+                            <p v-if="item.tagName" class="tagName  ellipsis" :title="'[ '+item.tagName+' ]'">{{item.tagName}} </p>
+                        </li>
+                    </ul>
+
+            </div>
+            <div class="bottomPartMid fl" v-if="!isDetail">
+                <p><span class="el-icon-arrow-up" @click="toUp"></span></p>
+                <p><span class="el-icon-arrow-down" @click="toDown"></span></p>
+            </div>
+            
+        </div>
+        <div class="btn">
+            <el-button
+            type="primary"
+            @click="submitForm('ruleForm')"
+            >确 定</el-button>
+        </div>
+    </div>
+    
+</template>
+
+<script>
+  import api from '@api/icss.js';
+  export default {
+    name: 'AddDisAndScaleRelationWrapper',
+    data() {
+        return{
+            
+            form: {
+                disId: '',  //诊断id
+                disName:''  //诊断名称
+            },
+            titleText: '添加量表关联',
+            diagList: [],
+            searchDiagVal: '',
+            searchTagVal: '',
+            isEdit: false,
+            isDetail: false,
+            leftTagsList:[],
+            rightTagsList:[],
+            selectLeftTagsList: [],
+            selectRightTagIndex: -1,
+            styles:{
+                background:'#eae7e7'
+            },
+        }
+    },
+    created(){
+        const { isEdit, isDetail, data } = this.$route.params;
+        if(isEdit) {
+            if(isEdit) {
+                this.titleText = '修改量表关联'
+            } 
+            this.isEdit = isEdit
+            this.isDetail = isDetail
+            this.rightTagsList = data.data
+            this.departList.push({name: data.name, id: data.id})
+            this.typeList.push({typeName: data.typeName, type: data.type})
+            this.form.department =data.id
+            this.form.type =data.type
+            this.getTagList()
+            
+        } else {
+            this.getTagList()
+            
+        }
+    },
+    watch: {
+        searchTagVal(newVal, preVal) {
+            if(newVal.trim() == ''){
+                this.getTagList()
+            }else if(newVal.trim() != preVal.trim()){
+                this.getTagList()
+            }
+        }
+    },
+    methods: {
+        back(){
+            this.$router.go(-1);
+        },
+        searchDiag() {
+             const param = {
+                "tagName": this.searchDiagVal,
+                "type": '7',
+            }
+            api.searchTagList(param).then((res)=>{
+               if(res.data.code === '0') {
+                   this.diagList = res.data.data
+                   this.$refs['diagList'].style.display='block'
+                }
+            })
+        },
+        selectDiag(item) {
+            this.form.disId = item.id
+            this.form.disName = item.tagName
+            this.$refs['diagList'].style.display='none'
+            this.diagList=[]
+        },
+        focuInput() {
+            this.$refs['diagList'].style.display='none'
+        },
+        getTagList() {
+            const notIds = this.selectedTags()
+            const param = {
+                "tagName": this.searchTagVal,
+                "type": '21',
+                "notIds": notIds,
+                "sexType": this.sexType,
+            }
+            api.searchTagList(param).then((res)=>{
+               if(res.data.code === '0') {
+                   this.leftTagsList = res.data.data
+                }
+            })
+        },
+        selectedTags() {
+            let selectedTags = []
+            for (let i =0; i < this.rightTagsList.length; i++) {
+                selectedTags.push(this.rightTagsList[i].id)
+            }
+            return selectedTags
+        },
+        selectLeftTag(tag, index, e) {
+            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(index) {
+            this.selectRightTagIndex = this.selectRightTagIndex === index ? -1 : index
+        },
+        toRightList(){
+            this.rightTagsList.push(...this.selectLeftTagsList);
+            this.selectLeftTagsList = [];
+            this.selectRightTagIndex = -1;
+            this.getTagList()
+        },
+        toLeftList(){
+            if(this.selectRightTagIndex == -1) {
+                return
+            }
+            this.rightTagsList.splice(this.selectRightTagIndex, 1)
+            this.selectLeftTagsList = [];
+            this.selectRightTagIndex -= 1;
+            this.getTagList()
+
+        },
+        toUp(){
+            if(this.selectRightTagIndex === 0 || this.selectRightTagIndex === -1) {
+                return
+            }
+            const tempItem = this.rightTagsList[this.selectRightTagIndex]
+            this.rightTagsList.splice(this.selectRightTagIndex, 1)
+            this.rightTagsList.splice(this.selectRightTagIndex-1, 0,tempItem)
+            this.selectRightTagIndex -= 1
+        },
+        toDown(){
+             if(this.selectRightTagIndex === this.rightTagsList.length-1 || this.selectRightTagIndex === -1) {
+                return
+            }
+            const tempItem = this.rightTagsList[this.selectRightTagIndex]
+            this.rightTagsList.splice(this.selectRightTagIndex, 1)
+            this.rightTagsList.splice(this.selectRightTagIndex+1, 0,tempItem)
+            this.selectRightTagIndex += 1
+
+        },
+
+        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)
+        },
+        submitForm(formName) {
+            if(!this.form.disId) {
+                this.warning('请选择诊断')
+                return
+            }
+            if(this.rightTagsList.length === 0) {
+                this.warning('请选择常见量表')
+                return
+            }
+            this.showDelDialog()
+        },
+        showDelDialog() {
+            const scaleId = this.selectedTags()
+            const param ={
+                "disId": this.form.disId,
+                "scaleId": scaleId
+            }
+            console.log('param', param)
+            this.showConfirmDialog('是否建立该关联?', () => {
+                api.addDisScaleInfo(param).then((res) => {
+                if (res.data.code  === '0') {
+                    this.warning(res.data.msg || '关联成功', 'success','1000')
+                    setTimeout(() => {
+                    this.$router.push({
+                        path:'/admin/LT-YXSJWH-LBGLWH'
+                    })
+                    }, 1000);
+                } else {
+                    this.warning(res.data.msg)
+                }
+                }).catch((err) => {
+                    this.warning(err);
+                })
+            });
+        },
+        showConfirmDialog(msg, resolve) {
+            this.$alert(msg, '提示', {
+                confirmButtonText: '确定',
+                type: 'warning'
+            }).then(() => {
+                resolve();
+            }).catch(() => {});
+        },
+        warning(msg, type,time) {
+            this.$message({
+                showClose: true,
+                message: msg,
+                type: type || 'warning',
+                duration:time || '3000'
+            })
+        },
+    }
+  }
+</script>
+
+<style lang="less">
+    @import '../../less/common.less';
+    .addDisAndScaleRelationWrapper {
+        .groupTitle {
+            background-color: #fff;
+            height: 40px;
+            line-height: 40px;
+            padding-left: 20px;
+        }
+        .searchInput, .searchName {
+            display: inline-block;
+            height: 30px;
+            line-height: 30px;
+            border: 1px solid gray;
+            margin: 0px 0 0 0;
+            padding: 0 5px;
+        }
+
+        .searchName {
+            border-left: none;
+        }
+        .itemList {
+            position: absolute;
+            display: none;
+            background: #fff;
+            width: 162px;
+            height: 80px;
+            border: 1px solid gray;
+            left: 110px;
+            top: 35px;
+            z-index: 2;
+            overflow-y: auto;
+        }
+        .diagItem {
+            height: 20px;
+            line-height: 20px;
+            font-size: 14px;
+        }
+        .diagItem:hover {
+            border: 1px solid #22ccc8;
+        }
+        .addDepartForm {
+            background-color: #fff;
+            padding: 20px;
+            margin: 20px 20px 0px 20px;
+        }
+        .symptomList {
+            background-color: #fff;
+             padding: 20px;
+             margin: 20px 20px 0px 20px;
+             height: 500px;
+        }
+        .bottomPartLeft {
+            width: 32%;
+        }
+        .symptomPoolTitle {
+            height: 40px;
+            line-height: 40px;
+        }
+        .symptomPool {
+            width: 100%;
+        }
+        .tagList {
+            width: 100%;
+            height: 300px;
+            border: 1px solid @icssBorder;
+            box-sizing: border-box;
+        }
+        .tagList {
+            border: 1px solid @icssBorder;
+        }
+        .tagPool {
+            height: 300px;
+            overflow-y: auto;
+
+        }
+        .tagItem {
+            position: relative;
+            line-height: 30px;
+            cursor: pointer;
+            padding: 0 10px;
+        }
+        .tagName:before {
+            content: '['
+        }
+        .tagName::after {
+            content: ']'
+        }
+        .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 {
+            width: 32%;
+        }
+        .operationPool {
+            position: relative;
+            width: 100%;
+            height: 340px;
+            padding: 10px 0;
+            overflow-y: auto;
+        }
+        .btn {
+            position: relative;
+            background-color: #fff;
+            margin: 0px 20px;
+            padding: 20px;
+            .el-button {
+                position: absolute;
+                right: 20px;
+                top: -20px;
+            }
+        }
+        .selectDepart {
+            
+        }
+    }
+    
+</style>

+ 0 - 3
src/components/icss/ChronicAndIndexRelation.vue

@@ -99,11 +99,8 @@ export default {
     methods: {
         getDataList() {
             const param = this.getFilterItems();
-            console.log('resss1',)
             api.queryIndexConfigPages(param).then((res) => {
-                console.log('resss22', res)
                 if(res.data.code == '0') {
-                    console.log('resss', res)
                     this.list = res.data.data.records
                     this.total = res.data.data.total;
                 }

+ 200 - 0
src/components/icss/DisAndScaleRelation.vue

@@ -0,0 +1,200 @@
+<template>
+    <div>
+        <crumbs title="慢病指标值关联维护" style="min-width: 980px">
+            <el-form :inline="true" class="demo-form-inline">
+                <el-form-item label="量表名称:">
+                    <el-input size="mini" v-model="filter.scaleName" placeholder="量表名称" clearable></el-input>
+                </el-form-item>
+                 <el-form-item label="关联标签:">
+                    <el-input size="mini" v-model="filter.disName" placeholder="关联标签" clearable></el-input>
+                </el-form-item>
+                <el-form-item>
+                    <el-button size="mini" @click="filterDatas">确认</el-button>
+                    <el-button size="mini" type="warning" @click="addRelation">添加关联</el-button>
+                </el-form-item>
+            </el-form>
+        </crumbs>
+        <div class="contents">
+            <el-table
+                :data="list"
+                border
+                style="width: 100%">
+                <el-table-column
+                    :resizable = "false"
+                    type="index"
+                    :index = 'indexMethod'
+                    label="编号"
+                    width="60">
+                </el-table-column>
+                <el-table-column
+                    :resizable = "false"
+                    prop="gmtModified"
+                    label="操作时间"
+                    width="180">
+                </el-table-column>
+                <el-table-column
+                    :resizable = "false"
+                    prop="disName"
+                    label="关联标签"
+                    show-overflow-tooltip>
+                </el-table-column>
+                <el-table-column
+                    :resizable = "false"
+                    prop="scaleName"
+                    label="量表名称"
+                    show-overflow-tooltip>
+                </el-table-column>
+                <el-table-column
+                    :resizable = "false"
+                    prop="modifier"
+                    label="操作人">
+                </el-table-column>
+                <el-table-column
+                    :resizable = "false"
+                    prop="operate"
+                    label="操作">
+                    <template slot-scope="scope">
+                        <el-button  @click="modifyRelation(scope.row)" type="text" size="small">修改</el-button>
+                        <el-button @click="showDelDialog(scope.row.id)" class="delete" type="text" size="small">删除</el-button>
+                    </template>
+                </el-table-column>
+            </el-table>
+        <div class="pagination">
+            <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>
+       <!--  <div class="pagination">
+           <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/icss.js';
+
+export default {
+    name: 'DisAndScaleRelation',   //诊断量表关联维护
+    data: function() {
+        return {
+            list: [],
+            filter: {
+                disName: '',
+                scaleName: '',
+            },
+            currentPage: 1,
+            pageSize: 10,
+            total: 0,
+        }
+    },
+    created() {
+        this.getDataList()
+        
+    },
+    methods: {
+        getDataList() {
+            const param = this.getFilterItems();
+            api.getDisScaleAllInfo(param).then((res) => {
+                if(res.data.code == '0') {
+                    this.list = res.data.data.records
+                    this.total = res.data.data.total;
+                }
+            })
+        },
+        filterDatas() {
+            this.currentPage = 1;
+            this.getDataList();
+        },
+        addRelation() {
+            this.$router.push({name:'AddDisAndScaleRelation'})
+        },
+        modifyRelation(row) {
+            console.log(row,'row')
+            const item = Object.assign({},row);
+            this.$router.push({name:'AddDisAndScaleRelation',params:{isEdit:true,data:item}});
+        },
+        currentChange(next) {
+            this.currentPage = next;
+            this.getDataList();
+            // if (this.cacheData[next]) {       //如果已请求过该页数据,则使用缓存不重复请求
+            //     this.list = this.cacheData[next];
+            // } else {
+            //     this.getDataList();
+            // }
+        },
+        getFilterItems() {
+            const param = {
+                current: this.currentPage,
+                size: this.pageSize,
+                disName:this.filter.disName,
+                scaleName: this.filter.scaleName
+            };
+            return param;
+        },
+        indexMethod(index) {
+            return ((this.currentPage - 1) * this.pageSize) + index + 1;
+        },
+        getTagType(val) {
+            return val
+        },
+        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(id){
+          this.showConfirmDialog('是否删除该关联?',()=>{
+            api.delDisScaleInfo({id:id}).then((res)=>{
+              if(res.data.code=='0'){
+                this.getDataList();
+                this.warning(res.data.msg || '操作成功','success');
+              }else{
+                this.warning(res.data.msg);
+              }
+            }).catch((error)=>{
+              this.warning(error);
+            })
+          });
+        }
+    }
+}
+</script>
+
+
+<style lang="less">
+    @import "../../less/admin.less";
+    .delete{
+       color: red;
+    }
+    .delete:hover {
+        color: red;
+    } 
+    .pagination {
+        min-width: 1010px;
+    }
+</style>

+ 7 - 0
src/routes.js

@@ -66,6 +66,10 @@ import AddMedicalInfo from '@components/icss/AddMedicalInfo.vue'//医学术语
 import ChemicalAndCommonMapping from '@components/icss/ChemicalAndCommonMapping.vue'; //化验大小项与公表维护
 import AddChemicalAndCommonMapping from '@components/icss/AddChemicalAndCommonMapping.vue'  //化验大小项与公表维护--添加关联
 import ChronicAndIndexRelation from '@components/icss/ChronicAndIndexRelation.vue'  //医学数据--慢病指标值关联维护
+import AddChronicAndIndexRelation from '@components/icss/AddChronicAndIndexRelation.vue'  //医学数据--添加慢病指标值关联
+import DisAndScaleRelation from '@components/icss/DisAndScaleRelation.vue'  //医学数据--量表关联维护
+import AddDisAndScaleRelation from '@components/icss/AddDisAndScaleRelation.vue'  //医学数据--添加量表关联
+
 
 
 import MedicalType from '@components/icss/MedicalType.vue'//医学术语维护-类型维护
@@ -202,6 +206,9 @@ export default [
       {path:'LT-YXSJWH-TJHYDXXYGBXDY',component:AddChemicalAndCommonMapping,name:'AddChemicalAndCommonMapping'},  //化验大小项与公表维护--添加关联
       {path:'LT-YXSYKWH-YXSYLXWH',component:MedicalType,name:'MedicalType'},     //医学术语--类型维护
       {path:'LT-YXSJWH-MBZBZGLWH',component:ChronicAndIndexRelation,name:'ChronicAndIndexRelation'},     //医学数据--慢病指标值关联维护
+      {path:'LT-YXSJWH-TJMBZBZGL',component:AddChronicAndIndexRelation,name:'AddChronicAndIndexRelation'},     //医学数据--慢病指标值关联维护
+      {path:'LT-YXSJWH-LBGLWH',component:DisAndScaleRelation,name:'DisAndScaleRelation'},     //医学数据--慢病指标值关联维护
+      {path:'LT-YXSJWH-TJLBGL',component:AddDisAndScaleRelation,name:'AddDisAndScaleRelation'},     //医学数据--慢病指标值关联维护
     ]
   }
 ]