Commit c2caee8a by damodmg

删除之后当前页没数据返回到上一页

parent 52ea07c5
<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><link rel=stylesheet type=text/css href=./static/css/iconfont.css><link rel=stylesheet type=text/css href=./static/css/common.css><link rel="shortcut icon" type=image/x-icon href=./static/img/favicon.ico><title>积分商城</title><link href=./static/css/app.b8646e7973fa9d3b97725a9f3eef30dc.css rel=stylesheet></head><body><div id=app></div><script src=//web-1251519181.file.myqcloud.com/lib/vue/2.5.2/vue.min.js></script><script src=//web-1251519181.file.myqcloud.com/lib/vue-router/3.0.2/vue-router.min.js></script><script src=//web-1251519181.file.myqcloud.com/lib/vuex/3.1.0/vuex.min.js></script><script src=//web-1251519181.file.myqcloud.com/lib/elementUI/index.2.5.4.js></script><script src=//web-1251519181.file.myqcloud.com/components/header.2.0.20.js></script><script src=//web-1251519181.file.myqcloud.com/components/aside-menu.2.0.05.js></script><script src=//web-1251519181.file.myqcloud.com/components/footer.2.0.02.js></script><script src=//web-1251519181.file.myqcloud.com/components/store-linkage.2.0.01.js></script><script src=//web-1251519181.file.myqcloud.com/components/store-new.2.0.11.js></script><script src=//web-1251519181.file.myqcloud.com/components/card.2.0.03.js></script><script src=//web-1251519181.file.myqcloud.com/components/export-excel.2.0.04.js></script><script type=text/javascript src=./static/js/manifest.3ad1d5771e9b13dbdad2.js></script><script type=text/javascript src=./static/js/vendor.bf93010d9b9b1322a27b.js></script><script type=text/javascript src=./static/js/app.3520fc8e30f2ef0a7a10.js></script></body></html>
\ No newline at end of file
<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><link rel=stylesheet type=text/css href=./static/css/iconfont.css><link rel=stylesheet type=text/css href=./static/css/common.css><link rel="shortcut icon" type=image/x-icon href=./static/img/favicon.ico><title>积分商城</title><link href=./static/css/app.d84017519d6d6e1766ab252f9298ff9c.css rel=stylesheet></head><body><div id=app></div><script src=//web-1251519181.file.myqcloud.com/lib/vue/2.5.2/vue.min.js></script><script src=//web-1251519181.file.myqcloud.com/lib/vue-router/3.0.2/vue-router.min.js></script><script src=//web-1251519181.file.myqcloud.com/lib/vuex/3.1.0/vuex.min.js></script><script src=//web-1251519181.file.myqcloud.com/lib/elementUI/index.2.5.4.js></script><script src=//web-1251519181.file.myqcloud.com/components/header.2.0.20.js></script><script src=//web-1251519181.file.myqcloud.com/components/aside-menu.2.0.05.js></script><script src=//web-1251519181.file.myqcloud.com/components/footer.2.0.02.js></script><script src=//web-1251519181.file.myqcloud.com/components/store-linkage.2.0.01.js></script><script src=//web-1251519181.file.myqcloud.com/components/store-new.2.0.11.js></script><script src=//web-1251519181.file.myqcloud.com/components/card.2.0.03.js></script><script src=//web-1251519181.file.myqcloud.com/components/export-excel.2.0.04.js></script><script type=text/javascript src=./static/js/manifest.3ad1d5771e9b13dbdad2.js></script><script type=text/javascript src=./static/js/vendor.bf93010d9b9b1322a27b.js></script><script type=text/javascript src=./static/js/app.65c84f791b6e1496dd54.js></script></body></html>
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -99,7 +99,7 @@
<p style="line-height:1.5;padding: 10px 10px 20px;">确定删除该商品吗?</p>
<div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="scope.row.visible2 = false">取消</el-button>
<el-button type="primary" size="mini" @click="deleteList(scope.row, 0)">确定</el-button>
<el-button type="primary" size="mini" @click="deleteList(scope.row, 0, scope.$index)">确定</el-button>
</div>
<el-button slot="reference" type="text">删除</el-button>
</el-popover>
......@@ -269,7 +269,7 @@ export default {
});
},
// 删除操作
deleteList(item, type) {
deleteList(item, type, index) {
let params = {
proId: item.integralMallProId,
type: Number(type)
......@@ -278,6 +278,14 @@ export default {
if (res.data.errorCode === 0) {
let text = Number(type) === 0 ? '删除成功' : Number(type) === 1 ? '下架成功' : '上架成功';
this.$message.success(text);
if (Number(type) === 0) {
this.tableDate.splice(index, 1);
if (this.tableDate.length === 0) {
if (this.currentPage > 1) {
this.currentPage = this.currentPage - 1;
}
}
}
this.getList(); //拉取列表
} else {
this.$message.error(res.data.message);
......
......@@ -110,7 +110,7 @@
<p style="line-height:1.5;padding: 10px 10px 20px;">确定删除该商品吗?</p>
<div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="scope.row.visible2 = false">取消</el-button>
<el-button type="primary" size="mini" @click="deleteList(scope.row, 0)">确定</el-button>
<el-button type="primary" size="mini" @click="deleteList(scope.row, 0, scope.$index)">确定</el-button>
</div>
<el-button slot="reference" type="text">删除</el-button>
</el-popover>
......@@ -370,7 +370,7 @@ export default {
});
},
// 删除操作
deleteList(item, type) {
deleteList(item, type, index) {
let params = {
proId: item.integralMallProId,
type: Number(type)
......@@ -379,6 +379,14 @@ export default {
if (res.data.errorCode === 0) {
let text = Number(type) === 0 ? '删除成功' : Number(type) === 1 ? '下架成功' : '上架成功';
this.$message.success(text);
if (Number(type) === 0) {
this.tableDate.splice(index, 1);
if (this.tableDate.length === 0) {
if (this.currentPage > 1) {
this.currentPage = this.currentPage - 1;
}
}
}
this.getList(); //拉取列表
} else {
this.$message.error(res.data.message);
......
......@@ -47,7 +47,7 @@
<p style="line-height:1.5;padding: 10px 10px 20px;">确定删除该自提点吗?</p>
<div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="scope.row.visible2 = false">取消</el-button>
<el-button type="primary" size="mini" @click="deletePoint(scope.row)">确定</el-button>
<el-button type="primary" size="mini" @click="deletePoint(scope.row, scope.$index)">确定</el-button>
</div>
<el-button slot="reference" type="text">删除</el-button>
</el-popover>
......@@ -171,12 +171,18 @@ export default {
});
},
//删除自提点
deletePoint(item) {
deletePoint(item, index) {
let params = {
integralMallPickUpPointId: item.integralMallPickUpPointId
};
request.get('/api-integral-mall/delete-pick-up-point', { params }).then(res => {
if (res.data.errorCode === 0) {
this.tableDate.splice(index, 1);
if (this.tableDate.length === 0) {
if (this.currentPage > 1) {
this.currentPage = this.currentPage - 1;
}
}
this.getList();
} else {
this.$message.error(res.data.message);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment