js方法如下
// 删除
deleteGoodsActiveArea(params){
return request({
url: '/goodsActiveArea/deleteGoodsActiveArea',
method: 'post',
data: params
})
},
vue方法如下
// 删除
deleteItem() {
const ids =this.multipleSelection.map(item => item.id)
let params = new URLSearchParams();
params.append('id',ids);
this.$confirm('请确认是否删除!', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$api.goodsActiveApi.deleteGoodsActiveArea(params).then(res => {
if (res.resCode === 1) {
this.$message.success(res.resDesc)
this.getList()
} else {
this.$message.error(res.resDesc)
}
});
})
},
后台方法如下
@PostMapping("/deleteGoodsActiveArea")
@ApiOperation("删除活动商品")
public Response<Void> deleteGoodsActiveArea(Integer[] id) {
goodsActiveAreaService.delete(id);
return Response.ok();
}
|