From 959270a7246c1757e7a2051ce3bc70f8bf63af24 Mon Sep 17 00:00:00 2001 From: fanfan Date: Wed, 26 Jun 2024 14:02:11 +0800 Subject: [PATCH] =?UTF-8?q?=E5=95=86=E5=9F=8E=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/store.js | 12 +++++++++++- src/views/dataCenter/goods/Index.vue | 9 ++++++++- src/views/store/index.vue | 29 +++++++++++++++++++++++++--- 3 files changed, 45 insertions(+), 5 deletions(-) diff --git a/src/api/store.js b/src/api/store.js index 649f3e0..3ed8b0a 100644 --- a/src/api/store.js +++ b/src/api/store.js @@ -188,7 +188,17 @@ export function recovery (data) { data: data }) } - +/** + * 移入回收站 + * @param {*} data + */ +export function deleteGoods (data) { + return axios({ + url: 'store/deleteGoods', + method: 'post', + data: data + }) +} /** * 删除记录 * @param {*} data diff --git a/src/views/dataCenter/goods/Index.vue b/src/views/dataCenter/goods/Index.vue index 8be24cc..20077e0 100644 --- a/src/views/dataCenter/goods/Index.vue +++ b/src/views/dataCenter/goods/Index.vue @@ -433,11 +433,18 @@ const columns = [ }, { title: '加价率', - width: '80px', + width: '95px', dataIndex: 'markup_rate', sorter: true, scopedSlots: { customRender: 'markup_rate' }, }, + { + title: '开单价', + width: '95px', + dataIndex: 'after_markup_price', + scopedSlots: { customRender: 'after_markup_price' }, + sorter: true, + }, { title: '库存', width: '80px', diff --git a/src/views/store/index.vue b/src/views/store/index.vue index 092a17d..f1db521 100644 --- a/src/views/store/index.vue +++ b/src/views/store/index.vue @@ -24,6 +24,7 @@ 删除 功能模块 编辑 + 删除商品 @@ -99,7 +100,7 @@ export default { { title: '操作', dataIndex: 'action', - width: '300px', + width: '340px', scopedSlots: { customRender: 'action' } } ], @@ -169,7 +170,20 @@ export default { } }) }, - + /** + * 删除商品 + */ + handleDeleteGoods (item) { + const app = this + app.$confirm({ + title: '您确定要删除该商品吗?', + // okType: 'danger', + onOk () { + // 确认删除 + return app.onSubmitDeleteGoods(item) + } + }) + }, /** * 确认删除 */ @@ -180,7 +194,16 @@ export default { this.handleRefresh() }) }, - + /** + * 确认删除商品 + */ + onSubmitDeleteGoods (item) { + return Api.deleteGoods({ storeId: item['store_id'] }) + .then(result => { + this.$message.success(result.message) + this.handleRefresh() + }) + }, // 分配功能模块 handleModule (item) { // 显示对话框