浏览代码

筛选没点确认返回不带筛选条件

zhouna 6 年之前
父节点
当前提交
97ac14f9e0

+ 16 - 4
src/components/icss/MedicalName.vue

@@ -120,6 +120,7 @@
         currentPage: 1,
         pageSize: 10,
         total: 0,
+        searched:false,
         filter: {
           term:'',
           type:'',
@@ -132,6 +133,14 @@
       this.getDataList();
       this.getTypeList();
     },
+    watch:{
+      'filter':{
+        handler:function(){
+          this.searched = false;
+        },
+        deep:true
+      }
+    },
     beforeRouteEnter(to, from, next){
       next(vm => {
         //const pm = to.param;
@@ -140,16 +149,18 @@
     },
     methods: {
       addMedicalName(){
+        const pam = this.searched?{currentPage:this.currentPage,
+          filter:this.filter}:{currentPage:this.currentPage};
         this.$router.push({name:'AddMedicalName',
-          params:{currentPage:this.currentPage,
-            filter:this.filter}});
+          params:pam});
       },
       toEditProduct(row){
+        const pam = this.searched?{currentPage:this.currentPage,
+          filter:this.filter}:{currentPage:this.currentPage};
         this.$router.push({
           name:'AddMedicalName',
           // params: {info:row}
-          params: {id:row.conceptId,currentPage:this.currentPage,
-            filter:this.filter}
+          params: Object.assign(pam,{id:row.conceptId})
         })
       },
       filterDatas(){
@@ -158,6 +169,7 @@
       },
       getDataList() {
         const param = this.getFilterItems();
+        this.searched = true;
         api.knowledgeName(param).then((res) => {
           if (res.data.code == '0') {
             const data = res.data.data;

+ 16 - 4
src/components/preTreat/CombinQuestion.vue

@@ -96,6 +96,7 @@
         tagTypes: [],
         Adscriptions: [],
         tagTypesList:[],
+        searched:false,
         filter: {
           tagType: [], //标签类型
           tagAdscription: '', //标签归属
@@ -109,6 +110,14 @@
     created() {
       this.getDropList();
     },
+    watch:{
+      'filter':{
+        handler:function(){
+          this.searched = false;
+        },
+        deep:true
+      }
+    },
     beforeRouteEnter(to, from, next){
       next(vm => {
         //const pm = to.param;
@@ -130,6 +139,7 @@
       },
       getDataList() {
         const param = this.getFilterItems();
+        this.searched = true;
         api.getQuestionList(param).then((res) => {
           const list = [...res.data.data.records];
           for (var i = 0; i < list.length; i++) {
@@ -154,17 +164,19 @@
         this.getDataList();
       },
       addIndeptTag() {
+        const pam = this.searched?{currentPage:this.currentPage,
+          filter:this.filter}:{currentPage:this.currentPage};
         this.$router.push({name:'AddCombinQuestion',
-          params:{currentPage:this.currentPage,
-            filter:this.filter}});
+          params:pam});
       },
       modifyIndeptTag(row) {
         api.questionDetail({id:row.id}).then((res)=>{
           const {code,data,msg} = res.data;
           if(code=='0'){
             const infos = Object.assign({},row,data);
-            this.$router.push({name:'AddCombinQuestion',params:{isEdit:true,data:infos,currentPage:this.currentPage,
-                filter:this.filter}});
+            const pam = this.searched?{currentPage:this.currentPage,
+              filter:this.filter}:{currentPage:this.currentPage};
+            this.$router.push({name:'AddCombinQuestion',params:Object.assign(pam,{isEdit:true,data:infos})});
           }else{
             this.$message({
               message: msg,

+ 16 - 4
src/components/preTreat/QuestionModules.vue

@@ -104,6 +104,7 @@
       return {
         list: [],
         tagTypes: [],
+        searched:false,
         Adscriptions: [],
         deptList:[],
         filter: {
@@ -120,6 +121,14 @@
     created() {
       this.getDropList();
     },
+    watch:{
+      'filter':{
+        handler:function(){
+          this.searched = false;
+        },
+        deep:true
+      }
+    },
     beforeRouteEnter(to, from, next){
       next(vm => {
         //const pm = to.param;
@@ -153,6 +162,7 @@
       },
       getDataList() {
         const param = this.getFilterItems();
+        this.searched = true;
         api.getModuleList(param).then((res) => {
           if (res.data.code === '0') {
             const list = res.data.data&&res.data.data.records?[...res.data.data.records]:[];
@@ -185,17 +195,19 @@
         this.getDataList();
       },
       addModule() {
+        const pam = this.searched?{currentPage:this.currentPage,
+          filter:this.filter}:{currentPage:this.currentPage};
         this.$router.push({name:'AddQuestionModules',
-          params:{currentPage:this.currentPage,
-            filter:this.filter}});
+          params:pam});
       },
       modifyModule(row) {
         api.getModuleDetail({moduleId:row.id,type:row.type}).then((res)=>{
           const {code,data,msg} = res.data;
           if(code=='0'){
             const item = Object.assign({},row,data);
-            this.$router.push({name:'AddQuestionModules',params:{isEdit:true,data:item,currentPage:this.currentPage,
-                filter:this.filter}});
+            const pam = this.searched?{currentPage:this.currentPage,
+              filter:this.filter}:{currentPage:this.currentPage};
+            this.$router.push({name:'AddQuestionModules',params:Object.assign(pam,{isEdit:true,data:item})});
           }else{
             this.$message({
               message: msg,

+ 16 - 4
src/components/preTreat/SimpleQuestion.vue

@@ -96,6 +96,7 @@
         tagTypes: [],
         Adscriptions: [],
         tagTypesList:[],
+        searched:false,
         filter: {
           tagType: [], //标签类型
           controlType: [],
@@ -110,6 +111,14 @@
     created() {
       this.getDropList();
     },
+    watch:{
+      'filter':{
+        handler:function(){
+          this.searched = false;
+        },
+        deep:true
+      }
+    },
     beforeRouteEnter(to, from, next){
       next(vm => {
         //const pm = to.param;
@@ -131,6 +140,7 @@
       },
       getDataList() {
         const param = this.getFilterItems();
+        this.searched = true;
         api.getQuestionList(param).then((res) => {
           const list = [...res.data.data.records];
           for (var i = 0; i < list.length; i++) {
@@ -155,17 +165,19 @@
         this.getDataList();
       },
       addIndeptTag() {
+        const pam = this.searched?{currentPage:this.currentPage,
+            filter:this.filter}:{currentPage:this.currentPage};
         this.$router.push({name:'AddSimpleQuestion',
-                            params:{currentPage:this.currentPage,
-                                    filter:this.filter}})
+                            params:pam})
       },
       modifyIndeptTag(row) {
         api.questionDetail({id:row.id}).then((res)=>{
           const {code,data,msg} = res.data;
           if(code=='0'){
             const item = Object.assign({},row,data);
-            this.$router.push({name:'AddSimpleQuestion',params:{currentPage:this.currentPage,
-                filter:this.filter,isEdit:true,data:item}});
+            const pam = this.searched?{currentPage:this.currentPage,
+              filter:this.filter}:{currentPage:this.currentPage};
+            this.$router.push({name:'AddSimpleQuestion',params:Object.assign(pam,{isEdit:true,data:item})});
           }else{
             this.$message({
               message: msg,