diff --git a/beike/Admin/Http/Controllers/CustomerController.php b/beike/Admin/Http/Controllers/CustomerController.php index 1f80fa33..2bd543cc 100644 --- a/beike/Admin/Http/Controllers/CustomerController.php +++ b/beike/Admin/Http/Controllers/CustomerController.php @@ -32,6 +32,7 @@ class CustomerController extends Controller 'customers' => $customers, 'customers_format' => CustomerResource::collection($customers)->jsonSerialize(), 'customer_groups' => CustomerGroupDetail::collection(CustomerGroupRepo::list())->jsonSerialize(), + 'type' => 'customer', ]; if ($request->expectsJson()) { @@ -49,13 +50,14 @@ class CustomerController extends Controller 'customers' => $customers, 'customers_format' => CustomerResource::collection($customers)->jsonSerialize(), 'customer_groups' => CustomerGroupDetail::collection(CustomerGroupRepo::list())->jsonSerialize(), + 'type' => 'trashed', ]; if ($request->expectsJson()) { return json_success(trans('success'), $data); } - return view('admin::pages.customers.trashed', $data); + return view('admin::pages.customers.index', $data); } public function store(CustomerRequest $request) diff --git a/beike/Admin/View/Components/Sidebar.php b/beike/Admin/View/Components/Sidebar.php index caecde02..692f606a 100644 --- a/beike/Admin/View/Components/Sidebar.php +++ b/beike/Admin/View/Components/Sidebar.php @@ -140,6 +140,7 @@ class Sidebar extends Component $routes = [ ['route' => 'customers.index', 'icon' => 'fa fa-tachometer-alt'], ['route' => 'customer_groups.index', 'icon' => 'fa fa-tachometer-alt'], + ['route' => 'customers.trashed', 'icon' => 'fa fa-tachometer-alt'], ]; return hook_filter('sidebar.customer_routes', $routes); } diff --git a/resources/beike/admin/views/pages/customers/index.blade.php b/resources/beike/admin/views/pages/customers/index.blade.php index 284f4534..0b24b166 100644 --- a/resources/beike/admin/views/pages/customers/index.blade.php +++ b/resources/beike/admin/views/pages/customers/index.blade.php @@ -41,7 +41,11 @@
- + @if ($type != 'trashed') + + @else + + @endif
@@ -75,8 +79,14 @@ @@ -199,6 +209,40 @@ this.dialogCustomers.show = true }, + deleteTrashedCustomer(id) { + this.$confirm('{{ __('common.confirm_delete') }}', '{{ __('common.text_hint') }}', { + confirmButtonText: '{{ __('common.confirm') }}', + cancelButtonText: '{{ __('common.cancel') }}', + type: 'warning' + }).then(() => { + $http.delete('customers/' + id + '/force').then((res) => { + this.$message.success(res.message); + window.location.reload(); + }) + }).catch(()=>{}) + }, + + // 清空回收站 + checkedCustomerSclearRestore() { + this.$confirm('{{ __('admin/product.confirm_delete_restore') }}', '{{ __('common.text_hint') }}', { + confirmButtonText: '{{ __('common.confirm') }}', + cancelButtonText: '{{ __('common.cancel') }}', + type: 'warning' + }).then(() => { + $http.post('{{ admin_route('customers.force_delete_all') }}').then((res) => { + this.$message.success(res.message); + window.location.reload(); + }) + }).catch(()=>{}) + }, + + restore(id, index) { + $http.delete('customers/' + id + '/restore').then((res) => { + this.$message.success(res.message); + window.location.reload(); + }) + }, + addCustomersFormSubmit(form) { const self = this; diff --git a/resources/beike/admin/views/pages/customers/trashed.blade.php b/resources/beike/admin/views/pages/customers/trashed.blade.php deleted file mode 100644 index 284f4534..00000000 --- a/resources/beike/admin/views/pages/customers/trashed.blade.php +++ /dev/null @@ -1,250 +0,0 @@ -@extends('admin::layouts.master') - -@section('title', __('admin/common.customer')) - -@section('content') -
-
-
- -
- - - - - - - - - - - - - - - - - - - -
-
- -
- -
- - -
-
-
- -
- -
-
-
@{{ customer.created_at }} - {{ __('common.edit') }} - + @if ($type != 'trashed') + {{ __('common.edit') }} + + @else + {{ __('common.restore') }} + + @endif
- - - - - - - - - - - - - - - - - - - - - - - - - -
{{ __('common.id') }}{{ __('customer.email') }}{{ __('customer.name') }}{{ __('customer.from') }}{{ __('customer.customer_group') }}{{ __('common.status') }}{{ __('common.created_at') }}{{ __('common.action') }}
@{{ customer.id }}@{{ customer.email }} -
- {{-- --}} -
@{{ customer.name }}
-
-
@{{ customer.from }}@{{ customer.customer_group_name }} - {{ __('common.enable') }} - {{ __('common.disable') }} - @{{ customer.created_at }} - {{ __('common.edit') }} - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - {{ __('common.save') }} - {{ __('common.cancel') }} - - - - -@endsection - -@push('footer') - -@endpush diff --git a/resources/lang/de/admin/common.php b/resources/lang/de/admin/common.php index 62ccb43d..7bc3e431 100644 --- a/resources/lang/de/admin/common.php +++ b/resources/lang/de/admin/common.php @@ -62,6 +62,7 @@ return [ 'categories_index' => 'Produktkategorie', 'products_index' => 'Produktverwaltung', 'products_trashed' => 'Papierkorb', + 'customers_trashed' => 'Papierkorb', 'brands_index' => 'Produktmarke', 'orders_index' => 'Bestellliste', 'rmas_index' => 'Kundendienstverwaltung', diff --git a/resources/lang/en/admin/common.php b/resources/lang/en/admin/common.php index 7c427b42..9a1a3df0 100644 --- a/resources/lang/en/admin/common.php +++ b/resources/lang/en/admin/common.php @@ -64,6 +64,7 @@ return [ 'categories_index' => 'Categories', 'products_index' => 'Products', 'products_trashed' => 'Trashed', + 'customers_trashed' => 'Trashed', 'brands_index' => 'Brands', 'orders_index' => 'Orders', 'rmas_index' => 'RMA', diff --git a/resources/lang/es/admin/common.php b/resources/lang/es/admin/common.php index 08196f42..33cde4c4 100644 --- a/resources/lang/es/admin/common.php +++ b/resources/lang/es/admin/common.php @@ -62,6 +62,7 @@ return [ 'categories_index' => 'Categorías', 'products_index' => 'gestión de mercancías', 'products_trashed' => 'papelera de reciclaje', + 'customers_trashed' => 'papelera de reciclaje', 'brands_index' => 'producto de marca', 'orders_index' => 'Lista de orden', 'rmas_index' => 'Gestión postventa', diff --git a/resources/lang/fr/admin/common.php b/resources/lang/fr/admin/common.php index 6f31aa27..1b94d3ca 100644 --- a/resources/lang/fr/admin/common.php +++ b/resources/lang/fr/admin/common.php @@ -62,6 +62,7 @@ return [ 'categories_index' => 'catégorie de produit', 'products_index' => 'gestion des produits', 'products_trashed' => 'corbeille', + 'customers_trashed' => 'corbeille', 'brands_index' => 'marque du produit', 'orders_index' => 'liste de commandes', 'rmas_index' => 'gestion après-vente', diff --git a/resources/lang/it/admin/common.php b/resources/lang/it/admin/common.php index 8a00a935..86523298 100644 --- a/resources/lang/it/admin/common.php +++ b/resources/lang/it/admin/common.php @@ -62,6 +62,7 @@ return [ 'categories_index' => 'Categorie', 'products_index' => 'gestione delle merci', 'products_trashed' => 'cestino', + 'customers_trashed' => 'cestino', 'brands_index' => 'marchio del prodotto', 'orders_index' => 'Lista degli ordini', 'rmas_index' => 'Gestione post vendita', diff --git a/resources/lang/ja/admin/common.php b/resources/lang/ja/admin/common.php index b65d28b9..3017494d 100644 --- a/resources/lang/ja/admin/common.php +++ b/resources/lang/ja/admin/common.php @@ -62,6 +62,7 @@ return [ 'categories_index' => '製品カテゴリ', 'products_index' => '製品管理', 'products_trashed' => 'ごみ箱', + 'customers_trashed' => 'ごみ箱', 'brands_index' => '製品ブランド', 'orders_index' => '注文リスト', 'rmas_index' => 'アフター管理', diff --git a/resources/lang/ru/admin/common.php b/resources/lang/ru/admin/common.php index acd6536c..5bca8511 100644 --- a/resources/lang/ru/admin/common.php +++ b/resources/lang/ru/admin/common.php @@ -62,6 +62,7 @@ return [ 'categories_index' => 'категория товара', 'products_index' => 'товарный менеджмент', 'products_trashed' => 'корзина', + 'customers_trashed' => 'корзина', 'brands_index' => 'бренд продукта', 'orders_index' => 'Список заказа', 'rmas_index' => 'Послепродажное управление', diff --git a/resources/lang/zh_cn/admin/common.php b/resources/lang/zh_cn/admin/common.php index 1796f464..a0245abf 100644 --- a/resources/lang/zh_cn/admin/common.php +++ b/resources/lang/zh_cn/admin/common.php @@ -64,6 +64,7 @@ return [ 'categories_index' => '商品分类', 'products_index' => '商品管理', 'products_trashed' => '回收站', + 'customers_trashed' => '回收站', 'brands_index' => '商品品牌', 'orders_index' => '订单列表', 'rmas_index' => '售后管理', diff --git a/resources/lang/zh_hk/admin/common.php b/resources/lang/zh_hk/admin/common.php index 656265fd..7c917d4c 100644 --- a/resources/lang/zh_hk/admin/common.php +++ b/resources/lang/zh_hk/admin/common.php @@ -62,6 +62,7 @@ return [ 'categories_index' => '商品分類', 'products_index' => '商品管理', 'products_trashed' => '回收站', + 'customers_trashed' => '回收站', 'brands_index' => '商品品牌', 'orders_index' => '訂單列表', 'rmas_index' => '售後管理',