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

Loading…
Cancel
Save