Browse Source

医学术语库维护返回

zhouna 6 years ago
parent
commit
83d10fb7d2

+ 4 - 1
src/components/icss/AddAssaySon.vue

@@ -3,6 +3,7 @@
         <crumbs
           :title="'化验子项维护-'+titleText"
           class="topBack"
+          :param="$route.params"
           linkTo="AssaySon"
         ></crumbs>
         <el-form :model="form" ref="ruleForm"  class="addDepartForm">
@@ -192,8 +193,10 @@
               if (res.data.code  === '0') {
                   this.warning(res.data.msg || '关联成功', 'success','1000')
                   setTimeout(() => {
+                    //返回带搜索条件的首页
                   this.$router.push({
-                      path:'/admin/LT-YXSYKWH-HYZXWH'
+                      path:'AssaySon',
+                    params: Object.assign({}, this.$route.params, {currentPage: 1})
                   })
                   }, 1000);
               } else {

+ 4 - 1
src/components/icss/AddChronicAndIndexRelation.vue

@@ -8,6 +8,7 @@
         <crumbs
           :title="'慢病指标值关联维护-'+titleText"
           class="topBack"
+          :param="$route.params"
           linkTo="ChronicAndIndexRelation"
         ></crumbs>
         <el-form :model="form" ref="ruleForm"  class="addDepartForm">
@@ -216,8 +217,10 @@
                 if (res.data.code  === '0') {
                     this.warning(res.data.msg || '关联成功', 'success','1000')
                     setTimeout(() => {
+                      //返回带搜索条件的首页
                     this.$router.push({
-                        path:'/admin/LT-YXSYKWH-MBZBZGLWH'
+                        path:'ChronicAndIndexRelation',
+                      params: Object.assign({}, this.$route.params, {currentPage: 1})
                     })
                     }, 1000);
                 } else {

+ 5 - 2
src/components/icss/AddConceptRelation.vue

@@ -3,6 +3,7 @@
     <crumbs
     :title="'医学术语关联维护-'+titleText"
     class="topBack"
+    :param="$route.params"
     linkTo="ConceptRelation"
     ></crumbs>
     <el-form :model="form" ref="ruleForm"  class="addDepartForm">
@@ -314,13 +315,15 @@ export default {
           "sonRelationId": 17
         }
         this.showConfirmDialog('是否建立该关联?', () => {
-          this.saveDisable = true  //提交保存按钮不可点击,返回结果时才可点击,防止频繁发送请求
+          this.saveDisable = true;  //提交保存按钮不可点击,返回结果时才可点击,防止频繁发送请求
           api.addConceptRelation(param).then((res) => {
             if (res.data.code  === '0') {
               this.warning(res.data.msg || '关联成功', 'success','1000')
               setTimeout(() => {
+                //返回带搜索条件的首页
                 this.$router.push({
-                  path:'/admin/LT-YXSYKWH-YXSYGLWH'
+                  name:'ConceptRelation',
+                  params: Object.assign({}, this.$route.params, {currentPage: 1})
                 })
               }, 1000);
             } else {

+ 4 - 3
src/components/icss/AddDisclInfo.vue

@@ -1,7 +1,8 @@
 <!-- 免责声明修改 By_liucf -->
 <template>
     <div>
-        <crumbs :title="topInfo" linkTo="DisclaimerInformation">
+        <crumbs :title="topInfo"
+                :param="$route.params" linkTo="DisclaimerInformation">
         </crumbs>
         <div class="contents">
             <el-form ref="form" :label-position="labelPosition" :model="form" :rules="rules" label-width="65px" class="add-discl-form">
@@ -143,7 +144,7 @@
               api.modifDiscInformation(param).then((res) => {
                 if (res.data.code == '0') {
                   this.$message({showClose: true,message: this.toast, type: 'success'});
-                  this.$router.push({path: 'LT-YXSJKWH-MZSMWH'});
+                  this.$router.push({name: 'DisclaimerInformation',params: Object.assign({}, this.$route.params, {currentPage: 1})});
                 } else {
                   this.$message({
                     showClose: true,
@@ -169,7 +170,7 @@
               api.addDiscInformation(param).then((res) => {
                 if (res.data.code == '0') {
                   this.$message({showClose: true,message: this.toast, type: 'success'});
-                  this.$router.push({path: 'LT-YXSJKWH-MZSMWH'});
+                  this.$router.push({name: 'DisclaimerInformation',params: Object.assign({}, this.$route.params, {currentPage: 1})});
                 } else {
                   this.$message({
                     showClose: true,

+ 3 - 2
src/components/icss/AddMedicalMultRelation.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="addMedicalMultRelationWrapper">
-    <crumbs :title="minTitle" linkTo="MedicalMultRelation"></crumbs>
+    <crumbs :title="minTitle" :param="$route.params" linkTo="MedicalMultRelation"></crumbs>
     <div class="contents">
       <div class="content">
         <div class="addBtn" v-if="list.length == 0">
@@ -176,7 +176,8 @@ import api from '@api/icss.js';
           if(data.code == '0') {
             this.message(res.data.msg||'术语建立成功','success');
             setTimeout(() => {
-              this.$router.push({name:'MedicalMultRelation'});
+              //返回带搜索条件的首页
+              this.$router.push({name:'MedicalMultRelation',params:Object.assign({},this.$route.params,{currentPage:1})});
             }, 2000);
           } else {
             this.message(data.msg);

+ 5 - 3
src/components/icss/AddMedicalRelation.vue

@@ -1,6 +1,7 @@
 <template>
   <div>
-    <crumbs title="医学术语关系-添加" linkTo="MedicalRelation"></crumbs>
+    <crumbs title="医学术语关系-添加"
+            :param="$route.params" linkTo="MedicalRelation"></crumbs>
     <div class="contents">
       <div class="content" @click="closeSearch">
         <p>明细</p>
@@ -126,8 +127,9 @@
             this.$message({
               type:'success',
               message:result.msg||'添加成功'
-            })
-            this.$router.push({path: 'LT-YXSYKWH-YXSYGXWH'});
+            });
+            //返回带搜索条件的首页
+            this.$router.push({name: 'MedicalRelation',params: Object.assign({}, this.$route.params, {currentPage: 1})});
           }else{
             this.$message({
               type:'warning',

+ 3 - 1
src/components/icss/AddMedicinePrompt.vue

@@ -3,6 +3,7 @@
         <crumbs
           :title=" isEdit? '医学术语静态知识维护-修改':'医学术语静态知识维护-添加'"
           class="topBack"
+          :param="$route.params"
           linkTo="MedicinePrompt"
         ></crumbs>
         <div class="info-container">
@@ -243,7 +244,8 @@
           api.saveTermPrompts(param).then((res) => {
             if (res.data.code === '0') {
               this.warning(res.data.msg || '保存成功', 'success');
-              this.$router.push("/admin/LT-YXSYKWH-YXSYJTZSWH");
+              //返回带搜索条件的首页
+              this.$router.push({name:'MedicinePrompt',params:Object.assign({},this.$route.params,{currentPage:1})});
             } else {
               this.warning(res.data.msg)
             }

+ 37 - 8
src/components/icss/AssaySon.vue

@@ -3,7 +3,7 @@
         <crumbs title="化验子项维护" style="min-width: 980px">
             <el-form :inline="true" class="demo-form-inline">
                 <el-form-item label="标准术语:">
-                    <el-input size="mini" v-model="conceptName" placeholder="术语名称" clearable></el-input>
+                    <el-input size="mini" v-model="filter.conceptName" placeholder="术语名称" clearable></el-input>
                 </el-form-item>
                 <el-form-item>
                     <el-button size="mini" @click="filterDatas">确认</el-button>
@@ -88,22 +88,43 @@ export default {
     data: function() {
         return {
             list: [],
-            conceptName:'',
+            searched: false,
+            filter:{
+              conceptName:'',
+            },
             currentPage: 1,
             pageSize: 10,
             total: 0,
         }
     },
     created() {
-        this.getDataList()
-        
+      const that = this;
+      //返回时避免参数未赋值就获取列表
+      setTimeout(function(){
+        that.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.getAssaySon(param).then((res) => {
                 if(res.data.code == '0') {
-                    this.list = res.data.data.records
+                    this.list = res.data.data.records;
                     this.total = res.data.data.total;
                 }
             })
@@ -113,7 +134,11 @@ export default {
             this.getDataList();
         },
         addRelation() {
-            this.$router.push({name:'AddAssaySon'})
+          const pam = this.searched ? {
+            currentPage: this.currentPage,
+            filter: this.filter
+          } : {currentPage: this.currentPage};
+            this.$router.push({name:'AddAssaySon', params: pam})
         },
         modifyRelation(row) {
             const param = {
@@ -122,9 +147,13 @@ export default {
             }
             api.getAssaySonDetail(param).then((res) => {
                 if(res.data.code == '0') {
+                  const pam = this.searched ? {
+                    currentPage: this.currentPage,
+                    filter: this.filter
+                  } : {currentPage: this.currentPage};
                     // const item = Object.assign({},row,{data: res.data.data});
                     const item = res.data.data;
-                    this.$router.push({name:'AddAssaySon',params:{isEdit:true,data:item}});
+                    this.$router.push({name:'AddAssaySon',params:Object.assign(pam, {isEdit:true,data:item})});
                 }
             })
         },
@@ -136,7 +165,7 @@ export default {
             const param = {
                 current: this.currentPage,
                 size: this.pageSize,
-                name:this.conceptName
+                name:this.filter.conceptName
             };
             return param;
         },

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

@@ -95,6 +95,7 @@ export default {
     data: function() {
         return {
             list: [],
+            searched: false,
             filter: {
                 diseaseName: ''
             },
@@ -107,12 +108,27 @@ export default {
         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.queryIndexConfigPages(param).then((res) => {
                 if(res.data.code == '0') {
-                    this.list = res.data.data.records
+                    this.list = res.data.data.records;
                     this.total = res.data.data.total;
                 }
             })
@@ -122,16 +138,24 @@ export default {
             this.getDataList();
         },
         addRelation() {
-            this.$router.push({name:'AddChronicAndIndexRelation'})
+          const pam = this.searched ? {
+            currentPage: this.currentPage,
+            filter: this.filter
+          } : {currentPage: this.currentPage};
+            this.$router.push({name:'AddChronicAndIndexRelation', params: pam})
         },
         modifyRelation(row) {
             const param = {
                 diseaseId: row.diseaseId
-            }
+            };
             api.getIndexConfigLists(param).then((res) => {
                 if(res.data.code == '0') {
+                    const pam = this.searched ? {
+                        currentPage: this.currentPage,
+                        filter: this.filter
+                      } : {currentPage: this.currentPage};
                     const item = Object.assign({},row,{data: res.data.data});
-                    this.$router.push({name:'AddChronicAndIndexRelation',params:{isEdit:true,data:item}});
+                    this.$router.push({name:'AddChronicAndIndexRelation',params:Object.assign(pam, {isEdit:true,data:item})});
                 }
             })
         },

+ 6 - 4
src/components/icss/ChronicDiseaseAdd.vue

@@ -3,6 +3,7 @@
     <crumbs
       :title="minTitle"
       class="topBack"
+      :param="$route.params"
       linkTo="ChronicDiseaseStructureList"
     ></crumbs>
     <div class="ChronicDiseaseAddWrap" @click="close">
@@ -38,7 +39,7 @@
             ></span></p>
           <p><span
               class="el-icon-arrow-left"
-              @click="toLeftPool" 
+              @click="toLeftPool"
             ></span></p>
         </div>
         <div class="ChronicDiseaseRight">
@@ -239,7 +240,7 @@ export default {
       let tmpPool = JSON.parse(JSON.stringify(this.contentPool))
       for(let i = 0;i < tmpPool.length;i++){
         if(tmpPool[i].val == 0 && !tmpPool[i].content){
-          
+
         }else{
           let tmpObj = {
             "content": "",
@@ -280,13 +281,14 @@ export default {
             this.warning(res.data.msg || '保存成功', 'success');
             setTimeout(() => {
               this.$router.push({
-                path:'/admin/LT-YXSYKWH-LBJGWH'
+                name:'ChronicDiseaseStructureList',
+                params: Object.assign({}, this.$route.params, {currentPage: 1})
               })
             }, 1000);
           }
           this.saveDisable = false
         })
-        
+
       })
     },
     showConfirmDialog(msg, resolve) {

+ 32 - 7
src/components/icss/ChronicDiseaseStructureList.vue

@@ -6,7 +6,7 @@
                     <el-input size="mini" v-model="filter.tagSysName" placeholder="量表名称" clearable></el-input>
                 </el-form-item>
                 <el-form-item label="状态:">
-                <el-select v-model="isState" clearable placeholder="请选择" size="mini">
+                <el-select v-model="filter.isState" clearable placeholder="请选择" size="mini">
                   <el-option
                     v-for="item in stateSelect"
                     :key="item.id"
@@ -95,12 +95,14 @@
           {id:'N',name:'启用中'},
           {id:'Y',name:'已删除'},
         ],
-        isState:'',
+
         tagTypes: [],
         AdscriptionsType:[],
         AdscriptionsOwnTo:[],
         tagTypesList: [],
+        searched: false,
         filter: {
+          isState:'',
           tagType: [], //标签类型
           tagSysName: '', //标签系统名称
         },
@@ -114,10 +116,24 @@
         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: {
       getDropList() {
         let templateType = localStorage.getItem('icssEnumsData') ? JSON.parse(localStorage.getItem('icssEnumsData')).moduleInfoTypeEnum : []
-        this.AdscriptionsType = templateType
+        this.AdscriptionsType = templateType;
         return api.getknowledgeList().then((res) =>{
           if(res.data.code === '0') {
             localStorage.setItem('DiseaseManage',JSON.stringify(res.data.data[1]))
@@ -130,8 +146,9 @@
       },
       getDataList() {
         const param = this.getFilterItems();
+        this.searched = true;
         api.scaleContentStructure(param).then((res) => {
-          const list = res.data.data.records
+          const list = res.data.data.records;
           // for (var i = 0; i < list.length; i++) {
           //   for (var j =  0; j < this.tagTypes.length; j++) {
           //     if(list[i].tagType === this.tagTypes[j].val) {
@@ -148,13 +165,21 @@
         this.getDataList();
       },
       addIndeptTag() {
-        this.$router.push({name:'ChronicDiseaseAdd'})
+        const pam = this.searched ? {
+          currentPage: this.currentPage,
+          filter: this.filter
+        } : {currentPage: this.currentPage};
+        this.$router.push({name:'ChronicDiseaseAdd', params: pam})
       },
       modifyIndeptTag(row) {
         api.rebuildOrUpdate({conceptId:row.conceptId}).then((res)=>{
           const {code,data,msg} = res.data;
             if(code=='0'){
-              this.$router.push({name:'ChronicDiseaseAdd',params:{isEdit:true,data:data,row:row}});
+              const pam = this.searched ? {
+                currentPage: this.currentPage,
+                filter: this.filter
+              } : {currentPage: this.currentPage};
+              this.$router.push({name:'ChronicDiseaseAdd',params:Object.assign(pam, {isEdit:true,data:data,row:row})});
             }else{
               this.$message({
                 message: msg,
@@ -172,7 +197,7 @@
           current: this.currentPage,
           size: this.pageSize,
           name: this.filter.tagSysName,
-          status:this.isState
+          status:this.filter.isState
         };
         return param;
       },

+ 37 - 7
src/components/icss/ConceptRelation.vue

@@ -3,7 +3,7 @@
         <crumbs title="医学术语关联维护" style="min-width: 980px">
             <el-form :inline="true" class="demo-form-inline">
                 <el-form-item label="标准术语名称:">
-                    <el-input size="mini" v-model="conceptName" placeholder="术语名称" clearable></el-input>
+                    <el-input size="mini" v-model="filter.conceptName" placeholder="术语名称" clearable></el-input>
                 </el-form-item>
                 <el-form-item>
                     <el-button size="mini" @click="filterDatas">确认</el-button>
@@ -87,18 +87,40 @@ export default {
     data: function() {
         return {
           list: [],
-          conceptName:'',
+          searched: false,
+          filter:{
+            conceptName:''
+          },
           currentPage: 1,
           pageSize: 10,
           total: 0,
         }
     },
     created() {
-        this.getDataList()    
+      const that = this;
+      //返回时避免参数未赋值就获取列表
+      setTimeout(function(){
+        that.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.getConceptRelation(param).then((res) => {
               if(res.data.code == '0') {
                 this.list = res.data.data.records
@@ -111,17 +133,25 @@ export default {
             this.getDataList();
         },
         addRelation() {
-            this.$router.push({name:'AddConceptRelation'})
+          const pam = this.searched ? {
+            currentPage: this.currentPage,
+            filter: this.filter
+          } : {currentPage: this.currentPage};
+          this.$router.push({name:'AddConceptRelation',params:pam})
         },
         modifyRelation(row) {
             const param = {
               "conceptId": row.conceptId,
               "relationId":17
             }
+          const pam = this.searched ? {
+            currentPage: this.currentPage,
+            filter: this.filter
+          } : {currentPage: this.currentPage};
             api.getConceptRelationDet(param).then((res) => {
               if(res.data.code=='0'){
-                const { data } = res.data
-                this.$router.push({name:'AddConceptRelation',params:{isEdit:true,data:data}});
+                const { data } = res.data;
+                this.$router.push({name:'AddConceptRelation',params:Object.assign(pam, {isEdit: true, data: data})});
               } else {
                 this.warning(res.data.msg);
               }
@@ -138,7 +168,7 @@ export default {
             const param = {
                 current: this.currentPage,
                 size: this.pageSize,
-                name:this.conceptName
+                name:this.filter.conceptName
             };
             return param;
         },

+ 34 - 5
src/components/icss/DisclaimerInformation.vue

@@ -7,9 +7,7 @@
                 </el-form-item>
                 <el-form-item>
                     <el-button size="mini" @click="filterDatas">确认</el-button>
-                    <router-link to="/admin/LT-YXSJWH-TJMZSM" style="margin:0 10px">
-                        <el-button size="mini" type="warning">添加</el-button>
-                    </router-link>
+                    <el-button size="mini" type="warning" @click="addDisclInfo" style="margin:0 10px">添加</el-button>
                 </el-form-item>
             </el-form>
         </crumbs>
@@ -92,19 +90,49 @@
         total: 0,
         linkIn:[],
         pays:[],
+        searched: false,
         filter: {
           title: ''
         }
       }
     },
     created() {
-      this.getDataList();
+      const that = this;
+      //返回时避免参数未赋值就获取列表
+      setTimeout(function(){
+        that.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: {
+      addDisclInfo(){
+        const pam = this.searched ? {
+          currentPage: this.currentPage,
+          filter: this.filter
+        } : {currentPage: this.currentPage};
+        this.$router.push({name: 'AddDisclInfo', params: pam});
+      },
       toEditDiscl(row){
+        const pam = this.searched ? {
+          currentPage: this.currentPage,
+          filter: this.filter
+        } : {currentPage: this.currentPage};
         this.$router.push({
           name:'AddDisclInfo',
-          params: {info:row}
+          params: Object.assign(pam, {info:row})
         })
       },
       filterDatas(){
@@ -113,6 +141,7 @@
       },
       getDataList() {
         const param = this.getFilterItems();
+        this.searched = true;
         api.discInformation(param).then((res) => {
           if (res.data.code == '0') {
             const data = res.data.data;

+ 36 - 6
src/components/icss/MedicalMultRelation.vue

@@ -7,9 +7,7 @@
                 </el-form-item>
                 <el-form-item>
                     <el-button size="mini" @click="filterDatas">确认</el-button>
-                    <router-link to="/admin/LT-YXSYKWH-TJYXSYDCGL" style="margin:0 10px">
-                        <el-button size="mini" type="warning">添加</el-button>
-                    </router-link>
+                    <el-button size="mini" type="warning" style="margin:0 10px"  @click="addMedicalMultR">添加</el-button>
                 </el-form-item>
             </el-form>
         </crumbs>
@@ -89,6 +87,7 @@
         currentPage: 1,
         pageSize: 10,
         total: 0,
+        searched: false,
         filter: {
           term:'',
           type:''
@@ -97,20 +96,50 @@
       }
     },
     created() {
-      this.getDataList();
+      const that = this;
+      //返回时避免参数未赋值就获取列表
+      setTimeout(function(){
+        that.getDataList();
+      });
       this.getTypeList();
     },
+    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: {
+      addMedicalMultR(){
+        const pam = this.searched ? {
+          currentPage: this.currentPage,
+          filter: this.filter
+        } : {currentPage: this.currentPage};
+        this.$router.push({name:'AddMedicalMultRelation',
+          params:pam});
+      },
       toEditProduct(row){
         const param = {
           conceptId: row.conceptId,
           relationId: 17
-        }
+        };
+        const pam = this.searched ? {
+          currentPage: this.currentPage,
+          filter: this.filter
+        } : {currentPage: this.currentPage};
         api.relationContactDetail(param).then((res) => {
           const {code,data,msg} = res.data;
           if(code=='0'){
               const item = Object.assign({},row,data);
-              this.$router.push({name:'AddMedicalMultRelation',params:{isEdit:true,data:item}});
+              this.$router.push({name:'AddMedicalMultRelation',params:Object.assign(pam, {isEdit: true, data: item})});
           }else{
               this.$message({
               message: msg,
@@ -125,6 +154,7 @@
       },
       getDataList() {
         const param = this.getFilterItems();
+        this.searched = true;
         api.multContactList(param).then((res) => {
           if (res.data.code == '0') {
             const data = res.data.data;

+ 43 - 30
src/components/icss/MedicalRelation.vue

@@ -6,7 +6,7 @@
                   <span>{{total}}条</span>
               </el-form-item>
               <el-form-item label="术语关系:">
-                <el-select v-model="type" clearable placeholder="请选择" size="mini">
+                <el-select v-model="filter.type" clearable placeholder="请选择" size="mini">
                   <el-option
                     v-for="item in typeList"
                     :key="item.key"
@@ -16,13 +16,13 @@
                 </el-select>
               </el-form-item>
               <el-form-item label="起始术语:">
-                  <el-input size="mini" v-model="startName" placeholder="输入术语"></el-input>
+                  <el-input size="mini" v-model="filter.startName" placeholder="输入术语"></el-input>
               </el-form-item>
               <el-form-item label="终点术语:">
-                  <el-input size="mini" v-model="endName" placeholder="输入术语"></el-input>
+                  <el-input size="mini" v-model="filter.endName" placeholder="输入术语"></el-input>
               </el-form-item>
               <el-form-item label="状态:">
-                <el-select v-model="isState" clearable placeholder="请选择" size="mini">
+                <el-select v-model="filter.isState" clearable placeholder="请选择" size="mini">
                   <el-option
                     v-for="item in stateSelect"
                     :key="item.id"
@@ -39,9 +39,7 @@
               <el-form-item>
                   <el-button size="mini" @click="uploadClick">导入</el-button>
                   <input type="file" name="uploadfile " id="upFile" @change="uploadFile($event)" accept=".csv, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet">
-                  <router-link to="/admin/LT-YXSYKWH-TJYXSYGX" style="margin:0 10px">
-                      <el-button size="mini" type="warning">添加医学术语关系</el-button>
-                  </router-link>
+                  <el-button size="mini" @click="addMedicalR" type="warning" style="margin:0 10px">添加医学术语关系</el-button>
               </el-form-item>
             </el-form>
         </crumbs>
@@ -130,48 +128,62 @@
           {id:'N',name:'启用中'},
           {id:'Y',name:'已删除'},
         ],
-        isState:'',
+        searched: false,
+        filter:{
+          isState:'',
+          startName:'',
+          endName:'',
+          type:'',
+        },
         cacheData: {},
         currentPage: 1,
         pageSize: 10,
         total: 0,
-        startName:'',
-        endName:'',
-        type:'',
         typeList:[],
         titleWidth:'1070px' //头部最小宽度
       }
     },
     created() {
-      this.getDataList();
       // this.getRelationList();
       const typeList = JSON.parse(localStorage.getItem("knowledgeEnumsData"));
       if(typeList){
         this.typeList = typeList.lexiconRSTypeEnum;
       }
+      const that = this;
+      //返回时避免参数未赋值就获取列表
+      setTimeout(function(){
+        that.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: {
-      toEditProduct(row){
-        // this.$router.push({
-        //   name:'AddSimilarName',
-        //   params: {id:row.questionId,name:row.questionName}
-        // })
+      addMedicalR(){
+        const pam = this.searched ? {
+          currentPage: this.currentPage,
+          filter: this.filter
+        } : {currentPage: this.currentPage};
+        this.$router.push({name: 'AddMedicalRelation', params: pam});
       },
       filterDatas(){
         this.currentPage = 1;
         this.getDataList(1);
       },
       getDataList(flag) {
-        const param = this.getFilterItems();
-        const param1 = {
-          "current": this.currentPage,
-          "endName": this.endName,
-          "relationId": this.type,
-          "size": this.pageSize,
-          "startName": this.startName,
-          "isDeleted":this.isState
-        }
-        const params = this.type?param1:param;
+        const params = this.getFilterItems();
+        this.searched = true;
         api.knowledgeRelation(params).then((res) => {
           if (res.data.code == '0') {
             const data = res.data.data;
@@ -211,9 +223,10 @@
         const param = {
           current: this.currentPage,
           size: this.pageSize,
-          startName: this.startName,
-          endName: this.endName,
-          isDeleted:this.isState
+          relationId: this.filter.type,
+          startName: this.filter.startName,
+          endName: this.filter.endName,
+          isDeleted:this.filter.isState
         };
         return param;
       },

+ 35 - 5
src/components/icss/MedicinePrompt.vue

@@ -7,9 +7,7 @@
                 </el-form-item>
                 <el-form-item>
                     <el-button size="mini" @click="filterDatas">确认</el-button>
-                    <router-link to="/admin/LT-YXSYKWH-TJYXSYJTZS" style="margin:0 10px">
-                        <el-button size="mini" type="warning">添加静态知识</el-button>
-                    </router-link>
+                    <el-button size="mini" type="warning" style="margin:0 10px" @click="addMedicalPrompt">添加静态知识</el-button>
                 </el-form-item>
             </el-form>
         </crumbs>
@@ -90,6 +88,7 @@
         total: 0,
         linkIn:[],
         pays:[],
+        searched: false,
         filter: {
           term: '',
           title:''
@@ -97,13 +96,43 @@
       }
     },
     created() {
-      this.getDataList();
+      const that = this;
+      //返回时避免参数未赋值就获取列表
+      setTimeout(function(){
+        that.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: {
+      addMedicalPrompt(){
+        const pam = this.searched ? {
+          currentPage: this.currentPage,
+          filter: this.filter
+        } : {currentPage: this.currentPage};
+        this.$router.push({name:'AddMedicinePrompt',
+          params:pam});
+      },
       toEditProduct(row){
+        const pam = this.searched ? {
+          currentPage: this.currentPage,
+          filter: this.filter
+        } : {currentPage: this.currentPage};
         this.$router.push({
           name:'AddMedicinePrompt',
-          params: {data:row,isEdit:true}
+          params: Object.assign(pam, {data:row,isEdit:true})
         })
       },
       toCopyProduct(row){
@@ -118,6 +147,7 @@
       },
       getDataList() {
         const param = this.getFilterItems();
+        this.searched = true;
         api.getConceptKnowledgeList(param).then((res) => {
           if (res.data.code == '0') {
             const data = res.data.data;