积分超市
This commit is contained in:
@@ -111,8 +111,8 @@
|
||||
<el-table-column label="操作" slot="options" align="center" width="120" fixed="right">
|
||||
<template v-slot="{ row, $index }">
|
||||
<div class="table-options">
|
||||
<el-button v-if="row.id" type="text" :title="row.status === '0' ? '上架' : '下架'" @click="changeStatus(row)">{{ row.status === '0' ? '上架' : '下架' }}</el-button>
|
||||
<el-button type="text" title="删除" @click="remove(row.id, $index)">删除</el-button>
|
||||
<el-button v-if="row.id" type="text" :title="row.status === '0' ? '上架' : '下架'" @click="changeStatus(row.status, $index)">{{ row.status === '0' ? '上架' : '下架' }}</el-button>
|
||||
<el-button type="text" title="删除" @click="remove($index)">删除</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -270,34 +270,16 @@
|
||||
})
|
||||
},
|
||||
|
||||
changeStatus (row) {
|
||||
this.$confirm(`确定${row.status === '0' ? '上架' : '下架'}该商品?`).then(() => {
|
||||
this.instance.post(`/app/appintegralsupermarketshop/enable?id=${id}`).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.$message.success(`${row.status === '0' ? '上架' : '下架'}成功`)
|
||||
this.getInfo(this.params.id)
|
||||
}
|
||||
})
|
||||
})
|
||||
changeStatus (status, index) {
|
||||
this.$set(this.form.goodsList[index], 'status', status === '0' ? '1' : '0')
|
||||
},
|
||||
|
||||
handleSelectionChange (e) {
|
||||
this.chooseList = e
|
||||
},
|
||||
|
||||
remove (id, index) {
|
||||
this.$confirm('确定删除该商品吗?').then(() => {
|
||||
if (!this.id) {
|
||||
this.form.goodsList.splice(index, 1)
|
||||
} else {
|
||||
this.instance.post(`/app/appintegralsupermarketshop/delete?id=${id}`).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.$message.success('删除成功!')
|
||||
this.getInfo(this.params.id)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
remove (index) {
|
||||
this.form.goodsList.splice(index, 1)
|
||||
},
|
||||
|
||||
showList () {
|
||||
|
||||
Reference in New Issue
Block a user