diff --git a/src/views/customer/customer.vue b/src/views/customer/customer.vue index fb964cc..33d7f0b 100644 --- a/src/views/customer/customer.vue +++ b/src/views/customer/customer.vue @@ -199,6 +199,13 @@ export default { }).then(() => { this.$post(this.api.delCustomers,[row.customerId]).then(res => { this.$message.success('删除成功') + if(this.listData.length == 2){ + + }else{ + if(this.page > 1){ + this.page = this.page-1 + } + } this.getData() }).catch(res => {}) }).catch(() => {}) @@ -217,6 +224,13 @@ export default { }).then(() => { this.$post(this.api.delCustomers,delList).then(res => { this.multipleSelection = []; + if(delList.length == this.listData.length){ + + }else{ + if(this.page > 1){ + this.page = this.page-1 + } + } this.$message.success('删除成功') this.getData() }).catch(res => {}) diff --git a/src/views/order/Order.vue b/src/views/order/Order.vue index f32cbe1..51a85f8 100644 --- a/src/views/order/Order.vue +++ b/src/views/order/Order.vue @@ -260,6 +260,13 @@ export default { arr.push(row.orderId); this.$post(this.api.orderDelete, { ids: arr }).then(res => { this.$message.success("删除成功"); + if(this.orderData.length == 2){ + + }else{ + if(this.pageNo > 1){ + this.pageNo = this.pageNo-1 + } + } this.getData(); }).catch(res => { }); @@ -289,6 +296,13 @@ export default { this.$post(this.api.orderDelete, { ids: this.multipleSelection }).then(res => { this.multipleSelection = []; this.$message.success("删除成功"); + if(this.multipleSelection.length == this.orderData.length){ + + }else{ + if(this.pageNo > 1){ + this.pageNo = this.pageNo-1 + } + } this.getData(); }).catch(err => { });