This commit is contained in:
yanran200730
2022-12-01 09:36:12 +08:00
parent 5030e55f84
commit 0314be9515
2 changed files with 79 additions and 8 deletions

View File

@@ -59,8 +59,8 @@
<el-table-column slot="options" width="160px" fixed="right" label="操作" align="center">
<template slot-scope="{ row }">
<div class="table-options">
<el-button type="text" @click="operation(row.id, row.status)" v-if="row.status === '0' || row.status === '2'">下架</el-button>
<el-button type="text" @click="operation(row.id, row.status)" v-if="row.status === '1'">上架</el-button>
<el-button type="text" @click="operation(row.id, 0)" v-if="row.status === '0' || row.status === '2'">下架</el-button>
<el-button type="text" @click="operation(row.id, 1)" v-if="row.status === '1'">上架</el-button>
<el-button type="text" @click="toAdd(row.id)">编辑</el-button>
<el-button type="text" @click="remove(row.id)">删除</el-button>
</div>
@@ -175,7 +175,7 @@
operation (id, status) {
this.$confirm(status === '1' ? '确定上架该商品?' : '确定下架该商品?').then(() => {
this.instance.post(`/app/appintegralmerchandise/takeOnOffById?id=${id}&opType=${status === '0' ? 0 : 1}`).then(res => {
this.instance.post(`/app/appintegralmerchandise/takeOnOffById?id=${id}&opType=${status}`).then(res => {
if (res.code == 0) {
this.$message.success(status === '1' ? '上架成功' : '下架成功')
this.getList()