master
fanfan 3 months ago
parent 7354b2d035
commit d457a25767
  1. 15
      src/views/store/index.vue

@ -18,7 +18,8 @@
<a @click="handleDelete(item)">删除</a>
<a @click="handleModule(item)">功能模块</a>
<a @click="handleEdit(item)">编辑</a>
<a @click="handleDeleteGoods(item)">删除商品</a>
<a @click="handleDeleteGoods(item, 1)">删除商品</a>
<a @click="handleDeleteGoods(item, 2)">删除分类</a>
</span>
</s-table>
<create-form ref="createModal" @handleSubmit="handleRefresh" />
@ -100,7 +101,7 @@ export default {
{
title: '操作',
dataIndex: 'action',
width: '340px',
width: '400px',
scopedSlots: { customRender: 'action' },
},
],
@ -178,14 +179,14 @@ export default {
/**
* 删除商品
*/
handleDeleteGoods(item) {
handleDeleteGoods(item, type) {
const app = this
app.$confirm({
title: '您确定要删除该商品吗?',
title: type == 1 ? '您确定要删除该商品吗?' : '您确定要删除该分类吗?',
// okType: 'danger',
onOk() {
//
return app.onSubmitDeleteGoods(item)
return app.onSubmitDeleteGoods(item, type)
},
})
},
@ -201,8 +202,8 @@ export default {
/**
* 确认删除商品
*/
onSubmitDeleteGoods(item) {
return Api.deleteGoods({ storeId: item['store_id'] }).then((result) => {
onSubmitDeleteGoods(item,type) {
return Api.deleteGoods({ storeId: item['store_id'], type: type == 1 ? 'goods' : 'cate' }).then((result) => {
this.$message.success(result.message)
this.handleRefresh()
})

Loading…
Cancel
Save