浏览代码

诊断依据维护(未完成)

zhangxc 6 年之前
父节点
当前提交
e84902c5d9
共有 3 个文件被更改,包括 663 次插入0 次删除
  1. 357 0
      src/components/diagBase/AddDiagBase.vue
  2. 301 0
      src/components/diagBase/DiagBase.vue
  3. 5 0
      src/routes.js

+ 357 - 0
src/components/diagBase/AddDiagBase.vue

@@ -0,0 +1,357 @@
+<!-- 添加常见科室症状  -->
+<template>
+    <div class="AddDiagBaseWrapper" @click="close">
+        <!-- <div class="groupTitle"><i
+            class="el-icon-back"
+            @click="back"
+        ></i> 量表管理维护--{{titleText}}</div> -->
+        <crumbs
+          :title="'诊断依据数据维护-'+titleText"
+          class="topBack"
+          :param="$route.params"
+          linkTo="DiagBase"
+        ></crumbs>
+        <el-form :model="form" ref="ruleForm"  class="addDepartForm">
+            <el-form-item  class="addDiagName"  v-if="!isEdit" label="选择添加疾病名称:" >
+                <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.name"
+                    @click="selectDiag(item)"
+                    :key="item.conceptId">
+                    {{item.name}}
+                    </li>
+                </ul>
+            </el-form-item>
+             <el-form-item class="isRequired" label="已选添加疾病名称:">
+                {{form.name}}
+            </el-form-item>
+        </el-form>
+        <div class="symptomList">
+            <p>疾病特征:</p>
+            <table class="indexTab">
+                <tr class="tableTitle">
+                    <td class="FeatureSort">排序</td>
+                    <td class="FeatureType">类型</td>
+                    <td class="FeatureNumber">序号</td>
+                    <td class="FeatureStand">标准词</td>
+                    <td class="FeatureELATE">关联词</td>
+                    <td class="FeatureResult">结果</td>
+                </tr>
+                <tr v-for="(item, index) in selectedIndexList" :key="item.indexUnique"> 
+                    <td class="FeatureType">{{index +1}}</td>
+                    <td class="FeatureNumber">序号</td>
+                    <td class="FeatureStand">标准词</td>
+                    <td class="FeatureELATE">关联词</td>
+                    <td class="FeatureResult">结果</td>
+                </tr>
+            </table>
+            <p>诊断公式:</p>
+            <table class="indexTab">
+                <tr class="tableTitle">
+                    <td class="FeatureSort">排序</td>
+                    <td class="FeatureType">类型</td>
+                    <td class="FeatureNumber">序号</td>
+                    <td class="FeatureStand">标准词</td>
+                    <td class="FeatureELATE">关联词</td>
+                    <td class="FeatureResult">结果</td>
+                </tr>
+                <tr v-for="(item, index) in selectedIndexList" :key="item.indexUnique"> 
+                    <td class="FeatureType">{{index +1}}</td>
+                    <td class="FeatureNumber">序号</td>
+                    <td class="FeatureStand">标准词</td>
+                    <td class="FeatureELATE">关联词</td>
+                    <td class="FeatureResult">结果</td>
+                    <!-- <td class="selectedContent ">{{item.indexUnique}}</td>
+                    <td class="selectedContentGroup"><input class="groupInput" type="text" v-model="item.indexDesc" @input="handleInp(index,$event)"></td>
+                    <td class="selectedContentOpera"><el-button type="text" size="small" class="delete" @click="delSelectedIndex(item, index)">删除</el-button></td> -->
+                </tr>
+            </table>
+        </div>
+        <div class="btn">
+            <el-button
+            type="primary"
+            :disabled = 'saveDisable'
+            @click="submitForm('ruleForm')"
+            >确 定</el-button>
+        </div>
+    </div>
+    
+</template>
+
+<script>
+  import api from '@api/diagBase.js';
+  export default {
+    name: 'AddChronicAndIndexRelation',
+    data() {
+        return{
+            
+            form: {
+                diseaseId: '',  //诊断id
+                diseaseName:''  //诊断名称
+            },
+            titleText: '添加关联',
+            diagList: [],
+            selectedIndexMap: [],   //已经选择过的指标
+            selectedIndexList: [],  //选择的指标列表
+            searchDiagVal: '',
+            isEdit: false,
+            saveDisable: false 
+        }
+    },
+    created(){
+        const { isEdit, data } = this.$route.params;
+        if(isEdit) {
+            if(isEdit) {
+                this.isEdit = isEdit;
+                this.titleText = '修改关联';
+                this.form.diseaseId = data.diseaseId
+                this.form.diseaseName = data.diseaseName
+                this.selectedIndexList = data.data
+                for (let i = 0; i < this.selectedIndexList.length; i++) {
+                    this.selectedIndexMap.push(this.selectedIndexList[i].indexUnique)
+                }
+            } 
+        } else {
+            
+        }
+    },
+    watch: {
+        // searchTagVal(newVal, preVal) {
+        //     if(newVal.trim() == ''){
+        //         this.getTagList()
+        //     }else if(newVal.trim() != preVal.trim()){
+        //         this.getTagList()
+        //     }
+        // }
+    },
+    methods: {
+        close() {
+            this.diagList = [];
+            if(this.diagList.length>0){this.$refs['diagList'].style.display = 'none';}
+        },
+        back(){
+            this.$router.go(-1);
+        },
+        searchDiag() {
+            if(!this.searchDiagVal) {
+                return
+            }
+            const param = {
+                "name": this.searchDiagVal,
+            }
+            
+            api.diagBaseIndex(param).then((res)=>{
+               if(res.data.code === '0') {
+                   this.diagList = res.data.data
+                   if(this.diagList.length>0) {this.$refs['diagList'].style.display = 'block'}
+                }
+            })
+        },
+        selectDiag(item) {
+            this.form.conceptId = item.conceptId
+            this.form.name = item.name
+            this.$refs['diagList'].style.display='none'
+            this.searchDiagVal = ''
+            this.diagList=[]
+        },
+        focuInput() {
+            this.$refs['diagList'].style.display='none'
+            
+        },
+        delSelectedIndex(selectedItem, index) {
+            this.selectedIndexMap = this.selectedIndexMap.filter((item) => {return item != selectedItem.indexUnique})
+            this.selectedIndexList.splice(index, 1)
+        },
+        submitForm(formName) {
+            if(!this.form.diseaseId) {
+                this.warning('请选择诊断')
+                return
+            }
+            if(this.selectedIndexList.length === 0) {
+                this.warning('请选择指标')
+                return
+            }
+            for (let i = 0; i < this.selectedIndexList.length; i++) {
+                if(!this.selectedIndexList[i].indexDesc) {
+                    this.warning('请填写内容分组')
+                    return
+                }
+            }
+            this.showDelDialog()
+        },
+        showDelDialog() {
+            this.selectedIndexList.map((item) => {
+                item.diseaseId = this.form.diseaseId
+                return item
+            })
+            const param ={
+                "diseaseId": this.form.diseaseId,
+                "indexConfigData": this.selectedIndexList
+            }
+            this.showConfirmDialog('是否建立该关联?', () => {
+                const  url = this.isEdit ?api.updateIndexConfigList(param) : api.saveIndexConfigLists(param) 
+                this.saveDisable = true  //提交保存按钮不可点击,返回结果时才可点击,防止频繁发送请求
+                url.then((res) => {
+                if (res.data.code  === '0') {
+                    this.warning(res.data.msg || '关联成功', 'success','1000')
+                    setTimeout(() => {
+                      //返回带搜索条件的首页
+                    this.$router.push({
+                        path:'ChronicAndIndexRelation',
+                      params: Object.assign({}, this.$route.params, {currentPage: 1})
+                    })
+                    }, 1000);
+                } else {
+                    this.warning(res.data.msg)
+                }
+                this.saveDisable = false
+                }).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'
+            })
+        },
+        handleInp(index,e){ //分组不能输入负数
+            const value =  e.target.value;
+            const item = this.selectedIndexList[index].indexDesc;
+            e.target.value = value.replace(/[^\d]/g,'');
+            this.selectedIndexList[index].indexDesc = item.replace(/[^\d]/g,'');
+        }
+    }
+  }
+</script>
+
+<style lang="less">
+    @import '../../less/common.less';
+    .AddDiagBaseWrapper {
+        color: #606266;
+        .topBack {
+            top: 0;
+        }
+        .groupTitle {
+            background-color: #fff;
+            height: 40px;
+            line-height: 40px;
+            padding-left: 20px;
+        }
+        
+        .searchInput, .searchName {
+            display: inline-block;
+            height: 32px;
+            line-height: 32px;
+            border: 1px solid #a9a9a9;
+            margin: 0px 0 0 0;
+            padding: 0 5px;
+            float: left;
+            margin-top: 4px;
+        }
+        .isRequired .el-form-item__label::before {
+            content: '*';
+            color: red;
+        }
+        .searchName {
+            border-left: none;
+            cursor: pointer;
+            font-size: 16px;
+            padding: 0 14px;
+        }
+        .itemList {
+            position: absolute;
+            display: none;
+            background: #fff;
+            width: 162px;
+            max-height: 150px;
+            border: 1px solid #a9a9a9;
+            left: 138px;
+            top: 37px;
+            z-index: 2;
+            overflow-y: auto;
+        }
+        .diagItem {
+            padding: 0 5px;
+            height: 30px;
+            line-height: 30px;
+            font-size: 14px;
+            cursor: pointer;
+        }
+        .diagItem:hover {
+            background: #f5f7fa;
+        }
+        .addDepartForm {
+            position: relative;
+            background-color: #fff;
+            padding: 20px;
+            margin: 70px 20px 0px 20px;
+        }
+        .addDiagName {
+            position: relative;
+        }
+        .symptomList {
+            background-color: #fff;
+             padding: 20px;
+             margin: 0px 20px 0px 20px;
+             min-height: 400px;
+        }
+        
+        .indexTab {
+            width: 100%;
+            border-collapse: collapse;
+            tr {
+                td {
+                    padding: 5px 10px;
+                    border: 1px solid #a9a9a9;
+                    text-align: center;
+                }
+            }
+            .selectedContent {
+                width: 25%;
+            }
+            .selectedContentGroup {
+                width: 55%;
+            }
+            .selectedContentOpera {
+                width: 20%;
+            }
+        }
+        .groupInput {
+            text-align: center;
+            height: 28px;
+            color: #606266;
+            width: 60%;
+        }
+        .btn {
+            position: relative;
+            background-color: #fff;
+            margin: 0px 20px;
+            height: 40px;
+            padding: 20px;
+            .el-button {
+                position: absolute;
+                right: 20px;
+            }
+        }
+        .tableTitle{
+            background: rgba(239,243,249,1);
+        }
+    }
+    
+</style>

+ 301 - 0
src/components/diagBase/DiagBase.vue

@@ -0,0 +1,301 @@
+<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.disName" placeholder="诊断名称" clearable></el-input>
+                </el-form-item>
+                 <el-form-item label="操作人:">
+                    <el-input size="mini" v-model="filter.modifier" placeholder="操作人" clearable></el-input>
+                </el-form-item>
+                <el-form-item label="校验数据:">
+                    <el-select size="mini" v-model="filter.hasQuestion" placeholder="标签类型" clearable>
+                        <el-option v-for="item in dataTypeList" :label="item.name" :value="item.val" :key="item.id"></el-option>
+                    </el-select>
+                </el-form-item>
+                <el-form-item>
+                    <el-button size="mini" @click="filterDatas">确认</el-button>
+                     <el-button size="mini" @click="verifyAllData" >校验全部数据</el-button>
+                    <el-button size="mini" type="warning" @click="addDiagBase">添加诊断依据</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="诊断名称">
+                </el-table-column>
+                <el-table-column
+                    :resizable = "false"
+                    label="校验数据">
+                    <template slot-scope="scope" >
+                        <span :class="scope.row.hasQuestion == '0' ? '': 'hsaQuestion'">
+                            {{scope.row.hasQuestion == '0' ? "无问题词" : "有问题词"}}
+                        </span>
+                    </template>
+                </el-table-column>
+                <el-table-column
+                    :resizable = "false"
+                    prop="neoUpdate"
+                    label="最后更新图谱时间">
+                </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="modifyDiagBase(scope.row, 'modify')" type="text" size="small">修改</el-button>
+                        <span style="margin:0 3px;">|</span>
+                        <el-button @click="showDelDialog(scope.row.id,scope.row.type)" 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/diagBase.js';
+
+export default {
+    name: 'diagBase',
+    data: function() {
+        return {
+            list: [],
+            dataTypeList: [
+                {
+                    id: 0,
+                    val: '0',
+                    name: '无问题词'
+                },
+                {
+                    id: 1,
+                    val: '1',
+                    name: '有问题词'
+                }
+            ],
+            searched: false,
+            filter: {
+                disName: '', //诊断名称
+                modifier: '', //操作人
+                hasQuestion: '', //有无问题词
+            },
+            currentPage: 1,
+            pageSize: 10,
+            total: 0,
+        }
+    },
+    created() {
+        this.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: {
+        getDataList() {
+            const param = this.getFilterItems();
+          this.searched = true;
+            api.diagBasePage(param).then((res) => {
+                this.list = res.data.data.records
+                this.total = res.data.data.total;
+            })
+        },
+        filterDatas() {
+            this.currentPage = 1;
+            this.getDataList();
+        },
+        addDiagBase() {
+          const pam = this.searched ? {
+            currentPage: this.currentPage,
+            filter: this.filter
+          } : {currentPage: this.currentPage};
+          this.$router.push({name: 'AddDiagBase', params: pam});
+        },
+        verifyAllData() {
+          const loading = this.$loading({
+            lock: true,
+            text: 'Loading',
+            spinner: 'el-icon-loading',
+            background: 'rgba(0, 0, 0, 0.7)'
+          });
+          api.diagBaseVerifyAllData({}).then((res) => {
+            loading.close();
+            const {code,data,msg} = res.data;
+            if(code === '0') {
+            } else {
+                this.warning(msg)
+            }
+          })
+        },
+        modifyDiagBase(row, type) {
+            api.diagBaseGetDetail({id:row.id}).then((res)=>{
+                const {code,data,msg} = res.data;
+                if(code=='0'){
+                    const item = Object.assign({},row,data);
+                  const pam = this.searched ? {
+                    currentPage: this.currentPage,
+                    filter: this.filter
+                  } : {currentPage: this.currentPage};
+                  console.log('data', data)
+                    // if(type == 'modify') {
+                    //   this.$router.push({
+                    //     name: 'AddDiagBase',
+                    //     params: Object.assign(pam, {isEdit: true, data: item})
+                    //   });
+                    // } else if( type == 'copy') {
+                    //   this.$router.push({
+                    //     name: 'AddDiagBase',
+                    //     params: Object.assign(pam, {isCopy: true, data: item})
+                    //   });
+                    // } else {
+                    //     return
+                    // }
+                }else{
+                    this.$message({
+                    message: msg,
+                    type: 'warning'
+                    });
+                }
+            });
+        },
+        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,
+                modifier: this.filter.modifier, //操作人
+                hasQuestion: this.filter.hasQuestion, //有无问题词
+            };
+            return param;
+        },
+        indexMethod(index) {
+            return ((this.currentPage - 1) * this.pageSize) + index + 1;
+        },
+        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,type){
+          this.showConfirmDialog('是否删除该诊断依据?',()=>{
+            api.deleteTagGroup({ids:id,type:type}).then((res)=>{
+              if(res.data.code=='0'){
+                if(!this.searched){
+                  //未点确认时清空搜索条件
+                  this.filter={
+                      disName: '', //诊断名称
+                      modifier: '', //操作人
+                      hasQuestion: '', //有无问题词
+                  };
+                }
+                if(this.list.length==1){
+                  //当前在最后一页且只有一条数据时,删除后跳到前一页
+                  this.currentPage = this.currentPage===1?1:this.currentPage-1;
+                }
+                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;
+    }
+    .hsaQuestion {
+        color: red;
+    }
+</style>

+ 5 - 0
src/routes.js

@@ -92,6 +92,9 @@ import AddSimpleQuestion from '@components/preTreat/AddSimpleQuestion.vue';
 import AddCombinQuestion from '@components/preTreat/AddCombinQuestion.vue';
 import QuestionModules from '@components/preTreat/QuestionModules.vue';
 import AddQuestionModules from '@components/preTreat/AddQuestionModules.vue';
+//诊断依据
+import DiagBase from '@components/diagBase/DiagBase.vue';  //诊断依据--诊断依据数据维护
+import AddDiagBase from '@components/diagBase/AddDiagBase.vue';  //诊断依据--诊断依据数据维护
 
 export default [
   {
@@ -254,6 +257,8 @@ export default [
       {path:'LT-YWZSJWH-MBWH',component:QuestionModules,name:'QuestionModules'},  //预问诊-模板维护
       {path:'LT-YWZSJWH-TJMBWH',component:AddQuestionModules,name:'AddQuestionModules'},  //预问诊-添加模板
 
+      {path:'LT-ZDYJWH-ZDYJSJWH',component:DiagBase,name:'DiagBase'},  //诊断依据-诊断依据维护
+      {path:'LT-ZDYJWH-TJZDYJSJ',component:AddDiagBase,name:'AddDiagBase'},  //诊断依据-添加诊断依据
 
     ]
   }