From 6d01a6515df2bb51d3b886710d28ef2774121ba1 Mon Sep 17 00:00:00 2001 From: pushuo <229102104@qq.com> Date: Tue, 23 Aug 2022 15:04:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=90=8E=E5=8F=B0=E5=95=86?= =?UTF-8?q?=E5=93=81=E5=88=97=E8=A1=A8=E9=A1=B5=20=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/pages/products/index.blade.php | 30 +++++++++++++++---- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/resources/beike/admin/views/pages/products/index.blade.php b/resources/beike/admin/views/pages/products/index.blade.php index be52f30c..5d8e814a 100644 --- a/resources/beike/admin/views/pages/products/index.blade.php +++ b/resources/beike/admin/views/pages/products/index.blade.php @@ -61,10 +61,10 @@
- - - - + + + + {{-- --}}
@@ -206,6 +206,26 @@ }) }, + batchDelete() { + this.$confirm('确认要批量删除选中的商品吗?', '删除商品', { + type: 'warning' + }).then(() => { + $http.delete('products/delete', {ids: this.selected}).then((res) => { + location.reload(); + }) + }); + }, + + batchActive (type) { + this.$confirm('确认要批量修改选中的商品的状态吗?', '修改状态', { + type: 'warning' + }).then(() => { + $http.post('products/status', {ids: this.selected, status: type}).then((res) => { + location.reload(); + }) + }); + }, + search: function() { this.page = 1; this.loadData(); @@ -219,7 +239,7 @@ deleteProduct: function(index) { const product = this.product.data[index]; - this.$confirm('确认要删除选中的商品吗?', '删除商品', { + this.$confirm('确认要删除商品吗?', '删除商品', { type: 'warning' }).then(() => { $http.delete('products/' + product.id).then((res) => {