Commit 8852c1f5 authored by zhanglw's avatar zhanglw

产品上架

parent cc36a3fb
...@@ -160,6 +160,16 @@ export const HttpReq = { ...@@ -160,6 +160,16 @@ export const HttpReq = {
return res return res
}) })
}, },
// 批量上下架产品
batchReleaseAndRecovery: function(data) {
return request({
url: '/api/bsw/product/batchReleaseAndRecovery',
method: 'put',
data: data
}).then((res) => {
return res
})
},
xxx: null xxx: null
} }
} }
......
...@@ -125,7 +125,7 @@ export default { ...@@ -125,7 +125,7 @@ export default {
}).then((res) => { }).then((res) => {
this.$notify({ this.$notify({
title: res.msg, title: res.msg,
type: 'success', type: res.code === 200 ? 'success' : 'error',
duration: 2500 duration: 2500
}) })
if (res.code === 200) { if (res.code === 200) {
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
<div class="toolbar"> <div class="toolbar">
<div /> <div />
<div style="text-align: right"> <div style="text-align: right">
<el-button type="danger" icon="el-icon-finished" :disabled="!multipleSelection.length" @click="batchOperate(1)">批量处理</el-button> <el-button type="success" icon="el-icon-finished" :disabled="!multipleSelection.length" @click="batchOperate(1)">批量处理</el-button>
</div> </div>
</div> </div>
<!-- 表格 --> <!-- 表格 -->
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
<el-table-column prop="xxx" label="处理日期" align="center" width="100" /> <el-table-column prop="xxx" label="处理日期" align="center" width="100" />
<el-table-column prop="xxx" label="操作" align="right" width="140"> <el-table-column prop="xxx" label="操作" align="right" width="140">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tooltip v-show="scope.row.status==3" content="处理"><el-button round plain type="danger" icon="el-icon-finished" @click="toEdit(scope.row)" /></el-tooltip> <el-tooltip v-show="scope.row.status==3" content="处理"><el-button round plain type="success" icon="el-icon-finished" @click="toEdit(scope.row)" /></el-tooltip>
<el-tooltip content="查看"><el-button round plain icon="el-icon-view" @click="toEdit(scope.row)" /></el-tooltip> <el-tooltip content="查看"><el-button round plain icon="el-icon-view" @click="toEdit(scope.row)" /></el-tooltip>
</template> </template>
</el-table-column> </el-table-column>
......
...@@ -19,8 +19,8 @@ ...@@ -19,8 +19,8 @@
<el-button type="primary" icon="el-icon-circle-plus-outline" @click="toAdd">新增产品</el-button> <el-button type="primary" icon="el-icon-circle-plus-outline" @click="toAdd">新增产品</el-button>
</div> </div>
<div style="text-align: right"> <div style="text-align: right">
<el-button type="success" icon="el-icon-finished" :disabled="!multipleSelection.length" @click="batchOperate(1)">批量发布</el-button> <el-button type="success" icon="el-icon-finished" :disabled="!multipleSelection.length" @click="batchOperate(1, null)">批量发布</el-button>
<el-button type="danger" icon="el-icon-download" :disabled="!multipleSelection.length" @click="batchOperate(0)">批量下架</el-button> <el-button type="danger" icon="el-icon-download" :disabled="!multipleSelection.length" @click="batchOperate(0, null)">批量下架</el-button>
</div> </div>
</div> </div>
<!-- 表格 --> <!-- 表格 -->
...@@ -40,8 +40,8 @@ ...@@ -40,8 +40,8 @@
<el-table-column label="操作" align="right" width="200"> <el-table-column label="操作" align="right" width="200">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tooltip v-show="scope.row.status==3" content="审核"><el-button round plain type="warning" icon="el-icon-s-check" @click="toView(scope.row, true)" /></el-tooltip> <el-tooltip v-show="scope.row.status==3" content="审核"><el-button round plain type="warning" icon="el-icon-s-check" @click="toView(scope.row, true)" /></el-tooltip>
<el-tooltip v-show="scope.row.status==4" content="发布"><el-button round plain type="success" icon="el-icon-finished" @click="toEdit(scope.row)" /></el-tooltip> <el-tooltip v-show="scope.row.status==4" content="发布"><el-button round plain type="success" icon="el-icon-finished" @click="batchOperate(1, scope.row)" /></el-tooltip>
<el-tooltip v-show="scope.row.status==5" content="下架"><el-button round plain type="danger" icon="el-icon-download" @click="toEdit(scope.row)" /></el-tooltip> <el-tooltip v-show="scope.row.status==5" content="下架"><el-button round plain type="danger" icon="el-icon-download" @click="batchOperate(0, scope.row)" /></el-tooltip>
<el-tooltip v-show="scope.row.status>=4" content="编辑"><el-button round plain type="primary" icon="el-icon-edit-outline" @click="toEdit(scope.row)" /></el-tooltip> <el-tooltip v-show="scope.row.status>=4" content="编辑"><el-button round plain type="primary" icon="el-icon-edit-outline" @click="toEdit(scope.row)" /></el-tooltip>
<el-tooltip content="查看"><el-button round plain icon="el-icon-view" @click="toView(scope.row)" /></el-tooltip> <el-tooltip content="查看"><el-button round plain icon="el-icon-view" @click="toView(scope.row)" /></el-tooltip>
</template> </template>
...@@ -106,18 +106,26 @@ export default { ...@@ -106,18 +106,26 @@ export default {
this.total = res.data.total this.total = res.data.total
}) })
}, },
batchOperate(opt) { batchOperate(type, row) {
if (!this.multipleSelection.length) { if (!row && !this.multipleSelection.length) {
return this.$message({ return this.$message({
message: '未选取数据', message: '未选取数据',
type: 'info' type: 'info'
}) })
} }
if (opt) { HttpReq.backstageApi.batchReleaseAndRecovery({
console.log('启用', this.multipleSelection) ids: row ? [row.productId] : this.multipleSelection.map(item => { return item.productId }),
} else { type: type
console.log('启用', this.multipleSelection) }).then((res) => {
} this.$notify({
title: res.msg,
type: res.code === 200 ? 'success' : 'error',
duration: 2500
})
if (res.code === 200) {
this.loadData()
}
})
}, },
toAdd() { toAdd() {
this.$refs.addPage.loadData() this.$refs.addPage.loadData()
......
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