Browse Source

状态筛选下删除最后一页一条数据跳到上一页2055

zhouna 6 years ago
parent
commit
0e1b22a961

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

@@ -204,7 +204,7 @@
               diseaseId:row.diseaseId,
               state:row.state === 'N'?'Y':'N',
           }
-          let warntTxt = row.state === 'N' ? '是否删除该关联?': '是否恢复该关联?'
+          let warntTxt = row.state === 'N' ? '是否删除该关联?': '是否恢复该关联?';
           this.showConfirmDialog(warntTxt,()=>{
             api.cancelIndexConfigAlls(param).then((res)=>{
               if(res.data.code=='0'){

+ 5 - 0
src/components/icss/ChronicDiseaseStructureList.vue

@@ -240,6 +240,11 @@
               }
               if(item.isDeleted !== 'N'){       //恢复成功后跳转到筛选条件的首页
                 this.currentPage = 1;
+              } else {
+                if (this.filter.isState!==''&&this.list.length === 1){
+                  //有启用状态筛选条件且当前页只有最后一条数据删除时,删除成功后跳转到前一页
+                  this.currentPage = this.currentPage===1?1:this.currentPage-1;
+                }
               }
               this.warning(res.data.msg||'操作成功','success');
               this.getDataList();

+ 12 - 6
src/components/icss/MedicalName.vue

@@ -262,18 +262,24 @@
         let waringTxt = (item.isDeleted === 'N'?'是否删除该标准术语?':'是否重新启用该条数据?')
         this.showConfirmDialog(waringTxt,()=>{
           api.deletMedicalName(param).then((res)=>{
-            if(res.data.code=='0'){
-              if(!this.searched){
+            if(res.data.code=='0') {
+              if (!this.searched) {
                 //未点确认时清空搜索条件
-                this.filter={
+                this.filter = {
                   term:'',
                   type:'',
-                  libName:''
+                  libName:'',
+                  isState:'',
                 };
               }
-              if(item.isDeleted !== 'N'){       //恢复成功后跳转到筛选条件的首页
+              if (item.isDeleted !== 'N') {       //恢复成功后跳转到筛选条件的首页
                 this.currentPage = 1;
-              }
+              } else {
+                if (this.filter.isState!==''&&this.list.length === 1){
+                  //有启用状态筛选条件且当前页只有最后一条数据删除时,删除成功后跳转到前一页
+                  this.currentPage = this.currentPage===1?1:this.currentPage-1;
+                  }
+                }
               this.warning(res.data.msg||'操作成功','success');
               this.getDataList();
             }else{

+ 5 - 0
src/components/icss/MedicalRelation.vue

@@ -277,6 +277,11 @@
               }
               if(item.isDeleted !== 'N'){       //恢复成功后跳转到筛选条件的首页
                 this.currentPage = 1;
+              } else {
+                if (this.filter.isState!==''&&this.list.length === 1){
+                  //有启用状态筛选条件且当前页只有最后一条数据删除时,删除成功后跳转到前一页
+                  this.currentPage = this.currentPage===1?1:this.currentPage-1;
+                }
               }
               this.warning(res.data.msg||'操作成功','success');
               this.getDataList();