删除与批量删除接口增加判断是否全选,全选删除后返回前一个页面

dev_2022-03-03
e 3 years ago
parent c8644c99b8
commit 726898532d
  1. 7
      src/views/course/Curriculum.vue
  2. 4
      src/views/customer/AddCustomer.vue
  3. 4
      src/views/customer/customer.vue
  4. 7
      src/views/data/Framework.vue
  5. 7
      src/views/data/Product.vue
  6. 6
      src/views/order/Order.vue
  7. 8
      src/views/serve/projectList.vue
  8. 11
      src/views/user/User.vue

@ -270,6 +270,13 @@ export default {
}).then(() => { }).then(() => {
let ids = this.multipleSelection.map(i => i.cid); let ids = this.multipleSelection.map(i => i.cid);
this.$post(`${this.api.delCourse}?cids=${ids.toString()}`).then(res => { this.$post(`${this.api.delCourse}?cids=${ids.toString()}`).then(res => {
if(ids.length == this.courseData.length){
if(this.pageNo > 1){
this.pageNo = this.pageNo-1
}
}else{
}
this.getData(); this.getData();
this.$message.success("删除成功"); this.$message.success("删除成功");
}).catch(err => { }).catch(err => {

@ -97,14 +97,14 @@
</el-table-column> </el-table-column>
<el-table-column prop="courseName" label="课程名称" align="center"> <el-table-column prop="courseName" label="课程名称" align="center">
</el-table-column> </el-table-column>
<el-table-column prop="periodOfUse" label="使用期限" align="center"> <el-table-column prop="periodOfUse" label="使用期限(月)" align="center">
</el-table-column> </el-table-column>
<el-table-column label="起止日期" align="center"> <el-table-column label="起止日期" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{scope.row.startTime}}~{{scope.row.endTime}} {{scope.row.startTime}}~{{scope.row.endTime}}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="remainingPeriod" label="剩余期限" align="center"> <el-table-column prop="remainingPeriod" label="剩余期限(天)" align="center">
</el-table-column> </el-table-column>
<el-table-column label="端口地址" align="center"> <el-table-column label="端口地址" align="center">
<template slot-scope="scope"> <template slot-scope="scope">

@ -225,11 +225,11 @@ export default {
this.$post(this.api.delCustomers,delList).then(res => { this.$post(this.api.delCustomers,delList).then(res => {
this.multipleSelection = []; this.multipleSelection = [];
if(delList.length == this.listData.length){ if(delList.length == this.listData.length){
}else{
if(this.page > 1){ if(this.page > 1){
this.page = this.page-1 this.page = this.page-1
} }
}else{
} }
this.$message.success('删除成功') this.$message.success('删除成功')
this.getData() this.getData()

@ -441,6 +441,13 @@ export default {
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.$post(`${this.api.deleteTable}?${delList.join('&')}`).then(res => { this.$post(`${this.api.deleteTable}?${delList.join('&')}`).then(res => {
if(delList.length == this.listData.length){
if(this.page > 1){
this.page = this.page-1
}
}else{
}
this.$refs.table.clearSelection() this.$refs.table.clearSelection()
this.$message.success('删除成功') this.$message.success('删除成功')
this.getData() this.getData()

@ -449,6 +449,13 @@ export default {
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.$post(`${this.api.deleteProduct}?ids=${result.join(',')}`).then(res => { this.$post(`${this.api.deleteProduct}?ids=${result.join(',')}`).then(res => {
if(result.length == this.listData.length){
if(this.page > 1){
this.page = this.page-1
}
}else{
}
this.$refs.table.clearSelection() this.$refs.table.clearSelection()
this.$message.success('删除成功') this.$message.success('删除成功')
this.getData() this.getData()

@ -294,14 +294,14 @@ export default {
type: "warning" type: "warning"
}).then(() => { }).then(() => {
this.$post(this.api.orderDelete, { ids: this.multipleSelection }).then(res => { this.$post(this.api.orderDelete, { ids: this.multipleSelection }).then(res => {
this.multipleSelection = [];
this.$message.success("删除成功"); this.$message.success("删除成功");
if(this.multipleSelection.length == this.orderData.length){ if(this.multipleSelection.length == this.orderData.length){
}else{
if(this.pageNo > 1){ if(this.pageNo > 1){
this.pageNo = this.pageNo-1 this.pageNo = this.pageNo-1
} }
this.multipleSelection = [];
}else{
this.multipleSelection = [];
} }
this.getData(); this.getData();
}).catch(err => { }).catch(err => {

@ -279,6 +279,14 @@ export default {
}).then(() => { }).then(() => {
this.$post(`${this.api.deleteProjectManage}?projectIds=${ids}&platformId=${this.queryData.platformId}`).then(res => { this.$post(`${this.api.deleteProjectManage}?projectIds=${ids}&platformId=${this.queryData.platformId}`).then(res => {
if (res.status === 200) { if (res.status === 200) {
let delList = ids.split(',')
if(delList.length == this.listData.length){
if(this.page > 1){
this.page = this.page-1
}
}else{
}
this.$message.success("删除成功"); this.$message.success("删除成功");
this.getData(); this.getData();
} else { } else {

@ -385,15 +385,22 @@ export default {
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.$post(this.api.delUserAccounts,delList).then(res => { this.$post(this.api.delUserAccounts,delList).then(res => {
}).catch(res => {
if(res.code == '200') { if(res.code == '200') {
this.multipleSelection = []; this.multipleSelection = [];
if(delList.length == this.userData.length){
if(this.page > 1){
this.page = this.page-1
}
}else{
}
this.$message.success('删除成功') this.$message.success('删除成功')
this.getData() this.getData()
}else{ }else{
this.$message.success(res.message) this.$message.success(res.message)
} }
}).catch(res => {
}) })
}).catch(() => {}) }).catch(() => {})
}else{ }else{

Loading…
Cancel
Save