Browse Source

慢病指标值关联维护

zhangxc 6 years ago
parent
commit
4d134e2aef

+ 1 - 0
src/api/config.js

@@ -184,6 +184,7 @@ export default {
     'cancelIndexConfigAlls':'api/icssman/indexConfig/cancelIndexConfigAlls',  //医学数据-慢病指标值关联维护-删除慢病指标值关联
     'saveIndexConfigLists':'api/icssman/indexConfig/saveIndexConfigLists',  //医学数据-慢病指标值关联维护-添加关联
     'updateIndexConfigList':'api/icssman/indexConfig/updateIndexConfigList',  //医学数据-慢病指标值关联维护-修改关联
+    'queryIndexConfigDiseaseNames':'api/icssman/indexConfig/queryIndexConfigDiseaseNames',  //医学数据-慢病指标值关联维护-慢病指标疾病标签查询
     'getDisScaleAllInfo':'api/icssman/disScale/getDisScaleAllInfo',  //医学数据-诊断量表关联维护-列表
     'addDisScaleInfo':'api/icssman/disScale/addDisScaleInfo',  //医学数据-诊断量表关联维护-添加和修改
     'getDisScaleByDisId':'api/icssman/disScale/getDisScaleByDisId',  //医学数据-诊断量表关联维护-根据诊断id获取诊断量表关联信息(修改回读用)

+ 3 - 0
src/api/icss.js

@@ -329,6 +329,9 @@ export default {
     updateIndexConfigList(param) {
         return axios.post(urls.updateIndexConfigList, param)    //医学数据-慢病指标值关联维护-修改关联
     },
+    queryIndexConfigDiseaseNames(param) {
+        return axios.post(urls.queryIndexConfigDiseaseNames, param)    //医学数据-慢病指标值关联维护-慢病指标疾病标签查询
+    },
     getDisScaleAllInfo(param) {
         return axios.post(urls.getDisScaleAllInfo, param)    //医学数据-诊断量表关联维护-列表
     },

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

@@ -340,7 +340,7 @@ export default {
         display: none;
         background: #fff;
         width: 162px;
-        height: 80px;
+        max-height: 80px;
         border: 1px solid gray;
         left: 150px;
         top: 35px;

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

@@ -0,0 +1,363 @@
+<!-- 添加常见科室症状  -->
+<template>
+    <div class="AddChronicAndIndexRelationWrapper">
+        <!-- <div class="groupTitle"><i
+            class="el-icon-back"
+            @click="back"
+        ></i> 量表管理维护--{{titleText}}</div> -->
+        <crumbs
+          :title="'慢病指标值关联维护-'+titleText"
+          class="topBack"
+          linkTo="/admin/LT-YXSJWH-MBZBZGLWH"
+        ></crumbs>
+        <el-form :model="form" ref="ruleForm"  class="addDepartForm">
+            <el-form-item  v-if="!isEdit" 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.diseaseName"
+                    @click="selectDiag(item)"
+                    :key="item.diseaseId">
+                    {{item.diseaseName}}
+                    </li>
+                </ul>
+            </el-form-item>
+             <el-form-item class="isRequired" label="已选择诊断:" prop="type">
+                {{form.diseaseName}}
+            </el-form-item>
+        </el-form>
+        <div class="symptomList">
+            <table>
+                <tr>
+                    <td>已选择内容</td>
+                    <td>已选内容分组(只可输入数字,相同数字归为一组展示)</td>
+                    <td>操作</td>
+                </tr>
+            </table>
+        </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: {
+                diseaseId: '',  //诊断id
+                diseaseName:''  //诊断名称
+            },
+            titleText: '添加关联',
+            diagList: [],
+            searchDiagVal: '',
+            searchTagVal: '',
+            isEdit: false,
+            leftTagsList:[],
+            rightTagsList:[],
+            selectLeftTagsList: [],
+            selectRightTagIndex: -1,
+            styles:{
+                background:'#eae7e7'
+            },
+        }
+    },
+    created(){
+        const { isEdit, data } = this.$route.params;
+        if(isEdit) {
+            if(isEdit) {
+                this.titleText = '修改关联'
+            } 
+            data.data.map((item) => {
+                item.id = item.scaleId
+                item.tagName = item.scaleName
+                return item
+            })
+            this.isEdit = isEdit
+            this.rightTagsList = data.data
+            this.form.diseaseId =data.diseaseId
+            this.form.diseaseName =data.diseaseName
+            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 = {
+                "diseaseName": this.searchDiagVal,
+            }
+            api.queryIndexConfigDiseaseNames(param).then((res)=>{
+               if(res.data.code === '0') {
+                   console.log('res.data.data', res.data.data)
+                   this.diagList = res.data.data
+                   this.$refs['diagList'].style.display='block'
+                }
+            })
+        },
+        selectDiag(item) {
+            this.form.diseaseId = item.id
+            this.form.diseaseName = item.diseaseName
+            this.$refs['diagList'].style.display='none'
+            this.searchDiagVal = ''
+            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
+        },
+       
+        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.diseaseId) {
+                this.warning('请选择诊断')
+                return
+            }
+            if(this.rightTagsList.length === 0) {
+                this.warning('请选择量表')
+                return
+            }
+            this.showDelDialog()
+        },
+        showDelDialog() {
+            const scaleId = this.selectedTags()
+            const param ={
+                "diseaseId": this.form.diseaseId,
+                "scaleId": scaleId
+            }
+            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';
+    .AddChronicAndIndexRelationWrapper {
+        .topBack {
+            top: 0;
+        }
+        .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;
+        }
+        .isRequired .el-form-item__label::before {
+            content: '*';
+            color: red;
+        }
+        .searchName {
+            border-left: none;
+        }
+        .itemList {
+            position: absolute;
+            display: none;
+            background: #fff;
+            width: 162px;
+            max-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: 70px 20px 0px 20px;
+            border-bottom: 1px solid #c0c4cc;
+        }
+        .symptomList {
+            background-color: #fff;
+             padding: 20px;
+             margin: 0px 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>

+ 7 - 3
src/components/icss/AddDisAndScaleRelation.vue

@@ -25,7 +25,7 @@
                     </li>
                 </ul>
             </el-form-item>
-             <el-form-item label="已选择诊断:" prop="type">
+             <el-form-item class="isRequired" label="已选择诊断:" prop="type">
                 {{form.disName}}
             </el-form-item>
         </el-form>
@@ -167,6 +167,7 @@
             this.form.disId = item.id
             this.form.disName = item.tagName
             this.$refs['diagList'].style.display='none'
+            this.searchDiagVal = ''
             this.diagList=[]
         },
         focuInput() {
@@ -328,7 +329,10 @@
             margin: 0px 0 0 0;
             padding: 0 5px;
         }
-
+        .isRequired .el-form-item__label::before {
+            content: '*';
+            color: red;
+        }
         .searchName {
             border-left: none;
         }
@@ -337,7 +341,7 @@
             display: none;
             background: #fff;
             width: 162px;
-            height: 80px;
+            max-height: 80px;
             border: 1px solid gray;
             left: 110px;
             top: 35px;

+ 4 - 4
src/components/icss/ChronicAndIndexRelation.vue

@@ -111,12 +111,12 @@ export default {
             this.getDataList();
         },
         addRelation() {
-            // this.$router.push({name:'AddChemicalAndCommonMapping'})
+            this.$router.push({name:'AddChronicAndIndexRelation'})
         },
         modifyRelation(row) {
-            console.log(row,'row')
-            const item = Object.assign({},row);
-            this.$router.push({name:'AddChemicalAndCommonMapping',params:{isEdit:true,data:item}});
+            // console.log(row,'row')
+            // const item = Object.assign({},row);
+            // this.$router.push({name:'AddChronicAndIndexRelation',params:{isEdit:true,data:item}});
         },
         currentChange(next) {
             this.currentPage = next;