From 43be1d5ba7a20aad0c89b7a844e3d9e1d8176572 Mon Sep 17 00:00:00 2001 From: "kin.rinzen" Date: Thu, 22 Jan 2026 13:12:49 +0900 Subject: [PATCH] =?UTF-8?q?=E5=88=A9=E7=94=A8=E8=80=85=E5=88=86=E9=A1=9E?= =?UTF-8?q?=E3=83=9E=E3=82=B9=E3=82=BF=E7=94=BB=E9=9D=A2=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/Admin/UsertypeController.php | 200 +-- app/Utils.php | 3 +- public/js/app.js | 85 +- .../admin/regularcontracts/list.blade.php | 1153 +++++++++-------- .../views/admin/usertypes/_form.blade.php | 372 +++--- resources/views/admin/usertypes/add.blade.php | 79 +- .../views/admin/usertypes/delete.blade.php | 55 - .../views/admin/usertypes/edit.blade.php | 110 +- .../views/admin/usertypes/info.blade.php | 122 -- .../views/admin/usertypes/list.blade.php | 575 ++++---- 10 files changed, 1303 insertions(+), 1451 deletions(-) delete mode 100644 resources/views/admin/usertypes/delete.blade.php delete mode 100644 resources/views/admin/usertypes/info.blade.php diff --git a/app/Http/Controllers/Admin/UsertypeController.php b/app/Http/Controllers/Admin/UsertypeController.php index 1ce9a6e..f075eff 100644 --- a/app/Http/Controllers/Admin/UsertypeController.php +++ b/app/Http/Controllers/Admin/UsertypeController.php @@ -27,29 +27,48 @@ class UsertypeController extends Controller if (!in_array($sort, $allowSort, true)) { $sort = 'user_categoryid'; } + $sortType = strtolower($request->input('sort_type', 'asc')); if (!in_array($sortType, ['asc', 'desc'], true)) { $sortType = 'asc'; } + + $action = $request->input('action'); + if ($action === 'unlink') { + $request->merge([ + 'filter_sort_order' => '', + 'filter_usertype_subject1' => '', + 'filter_usertype_subject2' => '', + 'filter_usertype_subject3' => '', + 'page' => 1, + ]); + } + $inputs = [ 'isMethodPost' => $request->isMethod('post') ? 1 : 0, - 'isExport' => 0, - 'sort' => $sort, - 'sort_type' => $sortType, - 'page' => (int) $request->get('page', 1), + 'isExport' => 0, + 'sort' => $sort, + 'sort_type' => $sortType, + 'page' => (int) $request->get('page', 1), + 'action' => $action, ]; + $filters = [ - 'filter_sort_order' => $request->input('filter_sort_order', ''), - 'filter_usertype_subject1' => $request->input('filter_usertype_subject1', ''), - 'filter_usertype_subject2' => $request->input('filter_usertype_subject2', ''), - 'filter_usertype_subject3' => $request->input('filter_usertype_subject3', ''), + 'filter_sort_order' => $request->input('filter_sort_order', ''), + 'filter_usertype_subject1'=> $request->input('filter_usertype_subject1', ''), + 'filter_usertype_subject2'=> $request->input('filter_usertype_subject2', ''), + 'filter_usertype_subject3'=> $request->input('filter_usertype_subject3', ''), ]; + $searchParams = array_merge($inputs, $filters); + $viewData = $searchParams; $viewData['list'] = Usertype::search($searchParams); + if ($viewData['list']->total() > 0 && $viewData['page'] > $viewData['list']->lastPage()) { return redirect()->route('usertypes'); } + return view('admin.usertypes.list', $viewData); } @@ -82,17 +101,24 @@ class UsertypeController extends Controller // バリデーションルール(最小限) $rules = [ - 'sort_order' => 'nullable|integer', - 'usertype_subject1' => 'nullable|string|max:255', - 'usertype_subject2' => 'nullable|string|max:255', - 'usertype_subject3' => 'nullable|string|max:255', - 'print_name' => 'required|string|max:255', - 'usertype_money' => 'nullable|string|max:255', - 'usertype_remarks' => 'nullable|string|max:255', + 'sort_order' => 'required|integer', + 'usertype_subject1' => 'required|string|max:10', + 'usertype_subject2' => 'required|string|max:10', + 'usertype_subject3' => 'nullable|string|max:10', + 'print_name' => 'nullable|string|max:20', + 'usertype_money' => 'nullable|string|max:10', + 'usertype_remarks' => 'nullable|string|max:85', ]; + + $messages = [ - 'print_name.required' => '印字名は必須です。', - 'sort_order.integer' => 'ソートオーダーは数値で入力してください。', + 'sort_order.required' => 'ソートオーダーは必須です。', + 'sort_order.integer' => 'ソートオーダーは数値で入力してください。', + + 'usertype_subject1.required' => '分類名1は必須です。', + 'usertype_subject2.required' => '分類名2は必須です。', + + // 'print_name.required' => '印字名は必須です。', ]; $validator = Validator::make($inputs, $rules, $messages); @@ -110,7 +136,7 @@ class UsertypeController extends Controller }); if ($ok) { - return redirect()->route('usertypes')->with('success', '登録しました。'); + return redirect()->route('usertypes')->with('success', '登録が完了しました。'); } return back()->with('error', '登録に失敗しました。')->withInput(); } @@ -122,65 +148,66 @@ class UsertypeController extends Controller public function edit(Request $request, $id) { - $usertype = Usertype::findOrFail($id); + $record = Usertype::findOrFail($id); + + $data = [ + 'record' => $record, + 'isEdit' => true, + 'isInfo' => false, + ]; - // 画面に渡す初期データ(既存の構成に合わせて attributes を使う) - $data = $usertype->getAttributes(); if (method_exists($this, 'getDataDropList')) { - $dataList = $this->getDataDropList(); - $data = array_merge($data, $dataList); + $data = array_merge($data, $this->getDataDropList()); } + // POST:更新処理 if ($request->isMethod('POST')) { - $type = false; - // ▼ 内蔵バリデーション(FormRequest を使わない) $rules = [ - 'sort_order' => 'nullable|integer', - 'usertype_subject1' => 'nullable|string|max:255', - 'usertype_subject2' => 'nullable|string|max:255', - 'usertype_subject3' => 'nullable|string|max:255', - 'print_name' => 'required|string|max:255', - 'usertype_money' => 'nullable|string|max:255', - 'usertype_remarks' => 'nullable|string|max:255', + 'sort_order' => 'required|integer', + 'usertype_subject1' => 'required|string|max:10', + 'usertype_subject2' => 'required|string|max:10', + 'usertype_subject3' => 'nullable|string|max:10', + 'print_name' => 'nullable|string|max:20', + 'usertype_money' => 'nullable|string|max:10', + 'usertype_remarks' => 'nullable|string|max:85', ]; + + $messages = [ - 'print_name.required' => '印字名は必須です。', - 'sort_order.integer' => 'ソートオーダーは数値で入力してください。', + 'sort_order.required' => 'ソートオーダーは必須です。', + 'sort_order.integer' => 'ソートオーダーは数値で入力してください。', + + 'usertype_subject1.required' => '分類名1は必須です。', + 'usertype_subject2.required' => '分類名2は必須です。', + 'usertype_subject3.required' => '分類名3は必須です。', + ]; + $validator = Validator::make($request->all(), $rules, $messages); - // 入力値を $data にマージ(既存ロジック踏襲) - $requestAll = $request->all(); - $data = array_merge($data, $requestAll); - if ($validator->fails()) { return back()->withErrors($validator)->withInput(); } - \DB::transaction(function () use ($data, &$type, $usertype) { - // fill するフィールドだけを明示したい場合は only(...) で絞ってもOK - $usertype->fill([ - 'sort_order' => $data['sort_order'] ?? null, - 'usertype_subject1' => $data['usertype_subject1'] ?? null, - 'usertype_subject2' => $data['usertype_subject2'] ?? null, - 'usertype_subject3' => $data['usertype_subject3'] ?? null, - 'print_name' => $data['print_name'] ?? null, - 'usertype_money' => $data['usertype_money'] ?? null, - 'usertype_remarks' => $data['usertype_remarks'] ?? null, + \DB::transaction(function () use ($request, $record) { + $record->fill([ + 'sort_order' => $request->sort_order, + 'usertype_subject1' => $request->usertype_subject1, + 'usertype_subject2' => $request->usertype_subject2, + 'usertype_subject3' => $request->usertype_subject3, + 'print_name' => $request->print_name, + 'usertype_money' => $request->usertype_money, + 'usertype_remarks' => $request->usertype_remarks, ]); - $usertype->save(); - $type = true; + $record->save(); }); - if ($type) { - return redirect()->route('usertypes')->with('success', '更新しました。'); - } - return back()->with('error', '更新に失敗しました。')->withInput(); + return redirect()->route('usertypes')->with('success', '更新が完了しました。'); } - // GET: 画面表示(既存のビューに合わせて返す) + // GET:画面表示 return view('admin.usertypes.edit', $data); } @@ -196,7 +223,7 @@ class UsertypeController extends Controller $arr_pk = [$arr_pk]; } if (empty($arr_pk)) { - return redirect()->route('usertypes')->with('error', '削除するユーザーを選択してください。'); + return redirect()->route('usertypes')->with('error', '削除対象を1件以上選択してください。'); } if (Usertype::deleteByPk($arr_pk)) { @@ -219,16 +246,10 @@ class UsertypeController extends Controller public function export(Request $request) { - $timestamp = now()->format('YmdHis'); - $filename = "利用者分類マスタ{$timestamp}.csv"; - $filePath = storage_path("app/{$filename}"); - $headers = [ - 'Content-Type' => 'text/csv; charset=UTF-8', - 'Content-Encoding' => 'UTF-8', - 'Pragma' => 'no-cache', - 'Cache-Control' => 'must-revalidate, post-check=0, pre-check=0', - 'Expires' => '0', - ]; + // ファイル名 + $filename = '利用者分類マスタ_' . now()->format('YmdHis') . '.csv'; + + // 検索条件(一覧と同じ) $inputs = [ 'isMethodPost' => 0, 'isExport' => 1, @@ -241,29 +262,34 @@ class UsertypeController extends Controller ]; $dataExport = Usertype::search($inputs); - $columns = array( - __('利用者分類ID'),// 0 - __('分類名'),// 1 - __('適用料率'),// 2 - __('備考'),// 3 - ); - $file = fopen($filePath, 'w+'); - fputcsv($file, $columns); - foreach ($dataExport as $items) { - fputcsv( - $file, - array( - $items->user_categoryid, - $items->print_name, - $items->usertype_money, - $items->usertype_remarks, // 3 - ) - ); - } - fclose($file); - return Response::download($filePath, $filename, $headers)->deleteFileAfterSend(true); + + return response()->streamDownload(function () use ($dataExport) { + + // Excel用 UTF-8 BOM + echo "\xEF\xBB\xBF"; + + // ヘッダー行 + echo "利用者分類ID,ソートオーダー,分類名1,分類名2,分類名3,適用料率,備考\n"; + + // データ行 + foreach ($dataExport as $item) { + echo implode(',', [ + $item->user_categoryid, + $item->sort_order, + $item->usertype_subject1, + $item->usertype_subject2, + $item->usertype_subject3, + $item->usertype_money, + $item->usertype_remarks, + ]) . "\n"; + } + + }, $filename, [ + 'Content-Type' => 'text/csv; charset=UTF-8', + ]); } + public function import(Request $request) { $file = $request->file('file'); diff --git a/app/Utils.php b/app/Utils.php index a576cd5..aa251f4 100644 --- a/app/Utils.php +++ b/app/Utils.php @@ -20,8 +20,7 @@ use Illuminate\Support\Facades\Hash; class Utils { // ページあたりのアイテム数(旧システムから継承) - // const item_per_page = 50; - const item_per_page = 20; + const item_per_page = 50; // 画像保存パス(旧システムから継承) const image_path = 'storage/images/'; diff --git a/public/js/app.js b/public/js/app.js index d4a7d41..1453a76 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -142,34 +142,72 @@ $('#import_csv').on('click', function () { } }); }); +/** * CSV出力確認ダイアログ 以前のバージョン */ + +// $('#export_csv').on('click', function () { +// var _action = $(this).attr('action'), +// user_id = $('#user_id').length ? $('#user_id').val() : '', +// member_id = $('#member_id').length ? $('#member_id').val() : '', +// user_tag_serial = $('#user_tag_serial').length ? $('#user_tag_serial').val() : '', +// user_phonetic = $('#user_phonetic').length ? $('#user_phonetic').val() : '', +// phone = $('#phone').length ? $('#phone').val() : '', +// crime = $('#crime').length ? $('#crime').val() : '', +// sort = $('#sort').length ? $('#sort').val() : '', +// sort_type = $('#sort_type').length ? $('#sort_type').val() : ''; + +// $.confirm({ +// title: '確認ダイアログ。', +// content: '!CSVファイルを出力します。よろしいですか?はい/いいえ', +// buttons: { +// ok: { +// text: "はい", +// btnClass: 'btn-primary', +// keys: ['enter'], +// action: function action() { +// window.location.href = _action + '?user_id=' + user_id + '&member_id=' + member_id + '&user_tag_serial=' + user_tag_serial + '&user_phonetic=' + user_phonetic + '&phone=' + phone + '&crime=' + crime + '&sort=' + sort + '&sort_type=' + sort_type + '&isExport=1'; +// } +// }, +// いいえ: function _() {} +// } +// }); +// }); + +$(document).on('click', '#export_csv, [data-export-csv="1"]', function () { + var action = $(this).attr('action') || $(this).data('action'); + var formSelector = $(this).data('form') || '#list-form'; + + if (!action) return; + + + var query = ''; + if (formSelector && $(formSelector).length) { + query = $(formSelector).serialize(); + query = query + .split('&') + .filter(function (p) { return p && p.indexOf('_token=') !== 0; }) + .join('&'); + } -$('#export_csv').on('click', function () { - var _action = $(this).attr('action'), - user_id = $('#user_id').val(), - member_id = $('#member_id').val(), - user_tag_serial = $('#user_tag_serial').val(), - user_phonetic = $('#user_phonetic').val(), - phone = $('#phone').val(), - crime = $('#crime').val(), - sort = $('#sort').val(), - sort_type = $('#sort_type').val(); $.confirm({ title: '確認ダイアログ。', - content: '!CSVファイルを出力します。よろしいですか?はい/いいえ', + content: 'CSVファイルを出力します。よろしいですか?はい/いいえ', buttons: { ok: { - text: "はい", + text: 'はい', btnClass: 'btn-primary', keys: ['enter'], - action: function action() { - window.location.href = _action + '?user_id=' + user_id + '&member_id=' + member_id + '&user_tag_serial=' + user_tag_serial + '&user_phonetic=' + user_phonetic + '&phone=' + phone + '&crime=' + crime + '&sort=' + sort + '&sort_type=' + sort_type + '&isExport=1'; + action: function () { + var url = action + (query ? ('?' + query + '&isExport=1') : '?isExport=1'); + window.location.href = url; } }, - いいえ: function _() {} + いいえ: function () {} } }); }); + + // for sorting $('.table thead th.sorting').on('click', function (e) { var sort = $(this).attr('sort'); @@ -1612,6 +1650,23 @@ $('#delete_edit').on('click', function (e) { }); }); +// 共通 戻るボタン +$(document).on('click', '#btn_back', function (e) { + e.preventDefault(); + + // data-back-url があれば優先 + var backUrl = $(this).data('back-url'); + if (backUrl) { + window.location.href = backUrl; + return; + } + + // fallback:直前の画面 + window.history.back(); +}); + + + $(function () { // ▼ 「アップロード」ボタンを押すと、ファイル選択ダイアログを開く $(document).on('click', '.upload-file', function () { diff --git a/resources/views/admin/regularcontracts/list.blade.php b/resources/views/admin/regularcontracts/list.blade.php index fc45c92..5c70b1b 100644 --- a/resources/views/admin/regularcontracts/list.blade.php +++ b/resources/views/admin/regularcontracts/list.blade.php @@ -2,533 +2,666 @@ @section('title', '定期契約マスタ') @section('content') - - -
-
-
+ +
+
-

定期契約マスタ

-
- -
+
+

定期契約マスタ

+
+
+ +
-

※この画面のデータは通常変更する必要はありません。

-
+
-
-
- - {{-- ▼ 絞り込みフィルター(2カラム) --}} -
-

絞り込みフィルター

-
-
- @csrf - - - -
- {{-- 左カラム --}} -
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
- - {{-- 右カラム --}} -
-
-
- -
-
-
-
- - - -
-
-
-
- - - -
-
-
-
- - - -
-
-
-
- - - -
-
-
-
- -
-
-
-
- -
-
-
-
-
-
-
-
-
-
- -
-
-
-
- - {{-- フィルターボタン --}} -
- - 解除 -
-
-
+ +
+
+
+ + ※この画面のデータは通常変更する必要はありません。 +
- {{-- ▼ ツールバー(左:ボタン群/右:ページャ) --}} -
-
- 新規 - - - - - -
-
- {{ $list->appends(request()->except('page'))->links('pagination') }} -
-
+ +
+
+
+

絞り込みフィルター

+
- +
+
+ @csrf + + - {{-- ▼ 一覧テーブル(freeze-table でヘッダ&左2列固定) --}} - - @csrf - -
-
- - @php - $currentSort = $sort ?? 'contract_id'; - $currentDir = strtolower($sort_type ?? 'asc'); - if (!in_array($currentDir, ['asc','desc'], true)) $currentDir = 'asc'; - $sortClass = function(string $key) use($currentSort,$currentDir){ - $base = 'sorting'; - return $currentSort === $key ? $base.' '.($currentDir==='asc'?'sorting_asc':'sorting_desc') : $base; - }; - $renderSortIcon = static function(string $key){ - return ''; - }; - @endphp - - - - {{-- 操作列(チェック+編集)幅120px ※左固定のため列幅は固定推奨 --}} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @php - $formatYmd = static function($v){ if(empty($v)) return ''; try{return \Illuminate\Support\Carbon::parse($v)->format('Y-m-d');}catch(\Throwable $e){return mb_substr((string)$v,0,10);} }; - $formatYmdHi = static function($v){ if(empty($v)) return ''; try{return \Illuminate\Support\Carbon::parse($v)->format('Y-m-d H:i');}catch(\Throwable $e){return mb_substr((string)$v,0,16);} }; - @endphp - - @foreach($list as $item) - - {{-- No(左固定) --}} - - - {{-- 操作列(左固定) --}} - - {{-- 以降データ列 --}} - - - - - - @php - $userCategoryLabel = collect([$item->usertype_subject1 ?? '',$item->usertype_subject2 ?? '',$item->usertype_subject3 ?? '']) - ->filter(fn($v)=>$v!=='')->implode('/'); - @endphp - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @endforeach - -
No -
- -
-
契約ID {!! $renderSortIcon('contract_id') !!}定期契約ID {!! $renderSortIcon('contract_qr_id') !!}旧定期契約番号 {!! $renderSortIcon('old_contract_id') !!}車室番号 {!! $renderSortIcon('pplace_no') !!}利用者ID {!! $renderSortIcon('user_id') !!}利用者分類ID {!! $renderSortIcon('user_categoryid') !!}タグ・QR {!! $renderSortIcon('tag_qr_flag') !!}駐輪場ID {!! $renderSortIcon('park_id') !!}予約日時 {!! $renderSortIcon('reserve_date') !!}有効期間S {!! $renderSortIcon('contract_periods') !!}有効期間E {!! $renderSortIcon('contract_periode') !!}駐輪場所ID {!! $renderSortIcon('price_parkplaceid') !!}防犯登録番号 {!! $renderSortIcon('user_securitynum') !!}契約日時 {!! $renderSortIcon('contract_created_at') !!}更新可能日 {!! $renderSortIcon('contract_updated_at') !!}解約日時 {!! $renderSortIcon('contract_cancelday') !!}減免措置 {!! $renderSortIcon('contract_reduction') !!}定期有効月数 {!! $renderSortIcon('enable_months') !!}シール印刷可能日 {!! $renderSortIcon('printable_date') !!}請求金額 {!! $renderSortIcon('billing_amount') !!}車室割り当てフラグ {!! $renderSortIcon('pplace_allocation_flag') !!}授受日時 {!! $renderSortIcon('contract_payment_day') !!}授受金額 {!! $renderSortIcon('contract_money') !!}授受フラグ {!! $renderSortIcon('contract_flag') !!}決済トランザクションID {!! $renderSortIcon('settlement_transaction_id') !!}シール発行数 {!! $renderSortIcon('contract_seal_issue') !!}収納企業コード {!! $renderSortIcon('storage_company_code') !!}共有先収納企業コード {!! $renderSortIcon('share_storage_company_code') !!}受付番号 {!! $renderSortIcon('accept_number') !!}(更新元)契約更新済フラグ {!! $renderSortIcon('update_flag') !!}車種区分ID {!! $renderSortIcon('vehicle_type_id') !!}チェック用_フリガナ {!! $renderSortIcon('user_phonetic') !!}チェック用_居住所郵便番号 {!! $renderSortIcon('user_regident_zip') !!}チェック用_携帯電話番号 {!! $renderSortIcon('user_mobile') !!}チェック用_自宅電話番号 {!! $renderSortIcon('user_homephone') !!}チェック用_旧会員番号 {!! $renderSortIcon('old_member_number') !!}
{{ $loop->iteration }} -
- - 編集 + {{-- 1行目:利用者ID / 駐輪場 --}} +
+
+
+
利用者ID
+
+ +
+
+
+
+
+
駐輪場
+
+ +
+
+
-
{{ $item->contract_id }}{{ $item->contract_qr_id }}{{ $item->old_contract_id ?? '' }}{{ $item->pplace_no ?? '' }} - @if(!empty($item->user_seq)) - - {{ trim(($item->user_id ?? '') . ' ' . ($item->user_name ?? '')) }} - - @else - {{ $item->user_id ?? '' }} - @if(!empty($item->user_name)) -
{{ $item->user_name }}
- @endif - @endif -
{{ $userCategoryLabel ?: $item->user_categoryid }}{{ $item->tag_qr_flag ? 'QR' : 'タグ' }}{{ $item->park_id }}{{ $formatYmdHi($item->reserve_date ?? '') }}{{ $formatYmd($item->contract_periods ?? '') }}{{ $formatYmd($item->contract_periode ?? '') }}{{ $item->price_parkplaceid ?? '' }}{{ $item->user_securitynum ?? '' }}{{ $formatYmd($item->contract_created_at ?? '') }}{{ $formatYmd($item->contract_updated_at ?? '') }}{{ $formatYmd($item->contract_cancelday ?? '') }}{{ $item->contract_reduction ?? '' }}{{ $item->enable_months ?? '' }}{{ $formatYmd($item->printable_date ?? '') }}{{ isset($item->billing_amount) ? number_format($item->billing_amount) : '' }}{{ ($item->pplace_allocation_flag ?? null) === null ? '' : ($item->pplace_allocation_flag ? '割当済' : '未割当') }}{{ $formatYmd($item->contract_payment_day ?? '') }}{{ $item->contract_money ?? '' }}{{ ($item->contract_flag ?? null) === null ? '' : ($item->contract_flag ? '済' : '未') }}{{ $item->settlement_transaction_id ?? '' }}{{ $item->contract_seal_issue ?? '' }}{{ $item->storage_company_code ?? '' }}{{ $item->share_storage_company_code ?? '' }}{{ $item->accept_number ?? '' }}{{ ($item->update_flag ?? 0) ? '更新済' : '未更新' }}{{ $item->vehicle_type_id ?? '' }}{{ $item->chk_user_phonetic ?? $item->user_phonetic ?? '' }}{{ $item->user_regident_zip ?? '' }}{{ $item->user_mobile ?? '' }}{{ $item->user_homephone ?? '' }}{{ $item->old_member_number ?? '' }}
+ {{-- 2行目:利用者分類 / 予約日時(~) --}} +
+
+
+
利用者分類
+
+ +
+
+
+ +
+
+
予約日時
+
+ + + +
+
+
+
+ + {{-- 3行目:タグシリアル / 契約日時(~) --}} +
+
+
+
タグシリアル
+
+ +
+
+
+ +
+
+
契約日時
+
+ + + +
+
+
+
+ + {{-- 4行目:フリガナ / 解約日時(~) --}} +
+
+
+
フリガナ
+
+ {{-- 利用者フリガナ(u.user_phonetic) --}} + +
+
+
+ +
+
+
解約日時
+
+ + + +
+
+
+
+ + {{-- 5行目:電話番号 / 授受日時(~) --}} +
+
+
+
電話番号
+
+ +
+
+
+ +
+
+
授受日時
+
+ + + +
+
+
+
+ + {{-- 6行目:メールアドレス / 定期有効月数(全て) --}} +
+
+
+
メールアドレス
+
+ +
+
+
+ +
+
+
定期有効月数
+
+ {{-- controllerは contract_valid_months を見ています --}} + +
+
+
+
+ + {{-- 7行目:ワークコード / 定期契約継続 --}} +
+
+
+
ワークコード
+
+ +
+
+
+ +
+
+
定期契約継続
+
+ +
+
+
+
+ + {{-- 8行目:定期契約ID / 名寄フリガナ --}} +
+
+
+
定期契約ID
+
+ +
+
+
+ +
+
+
名寄フリガナ
+
+ {{-- controllerは merge_phonetic を見て rc.chk_user_phonetic を検索 --}} + +
+
+
+
+ + {{-- 9行目:検索 / ゾーン名検索 --}} +
+
+
+
検索
+
+ +
+
+
+ +
+
+
ゾーン名検索
+
+ +
+
+
+
+ + {{-- 10行目:関連住所入力あり / タグ・QR --}} +
+
+
+
関連住所入力あり
+
+
+ +
+
+
+
+ +
+
+
タグ・QR
+
+ +
+
+
+
+ + {{-- ボタン(図2の左下) --}} +
+ + +
+ + +
-
- -
-
-
- - {{-- ▼ インポート用モーダル --}} -
-
-
- @csrf -
-
- -
- @include('admin.usertypes._form',['isEdit'=>0,'isInfo'=>0]) -
-
+
+ +
+ @csrf + + @include('admin.usertypes._form', [ + 'isEdit' => false, + 'isInfo' => false + ]) + +
+ +
+
- @endsection - -@push('scripts') - -@endpush diff --git a/resources/views/admin/usertypes/delete.blade.php b/resources/views/admin/usertypes/delete.blade.php deleted file mode 100644 index e36674a..0000000 --- a/resources/views/admin/usertypes/delete.blade.php +++ /dev/null @@ -1,55 +0,0 @@ -@extends('layouts.app') -@section('title', '削除確認 | 利用者分類マスタ') - -@section('content') -
-
-
-
-

削除確認

-
-
- -
-
-
-
- -
-
-
- 本当にこの利用者分類を削除しますか? -
-
-
-
- @csrf -
- -
{{ $user_categoryid }}
-
-
- -
{{ $print_name ?? '' }}
-
-
- -
{{ $usertype_money ?? '' }}
-
-
- -
{{ $usertype_remarks ?? '' }}
-
- - キャンセル -
-
-
-
-
-@endsection \ No newline at end of file diff --git a/resources/views/admin/usertypes/edit.blade.php b/resources/views/admin/usertypes/edit.blade.php index 11ea0d2..80fd8cf 100644 --- a/resources/views/admin/usertypes/edit.blade.php +++ b/resources/views/admin/usertypes/edit.blade.php @@ -1,8 +1,8 @@ @extends('layouts.app') -@section('title', '編集 | 利用者分類マスタ') +@section('title', '編集') @section('content') - +
@@ -12,91 +12,53 @@
+
- {{-- カード本体 --}} -
-
- @csrf - @include('admin.usertypes._form', ['isEdit' => 1, 'isInfo' => 0]) -
-
- @csrf - -
+
+
+
+ + {{-- 編集フォーム --}} +
+ @csrf + + @include('admin.usertypes._form', [ + 'isEdit' => true, + 'record' => $record + ]) +
+ + + {{-- 削除フォーム(非表示) --}} + + +
+
-
+ @endsection - -@push('scripts') - -@endpush \ No newline at end of file diff --git a/resources/views/admin/usertypes/info.blade.php b/resources/views/admin/usertypes/info.blade.php deleted file mode 100644 index 450ff8e..0000000 --- a/resources/views/admin/usertypes/info.blade.php +++ /dev/null @@ -1,122 +0,0 @@ -@extends('layouts.app') -@section('title', '[東京都|〇〇駐輪場] 利用者分類マスタ') -@section('content') -
-
-
-
-

{{__('利用者分類マスタ')}}

-
-
- -
-
-
-
- - -
-
-
-
- - - -
- -
- @if(Session::has('success')) - - @elseif(Session::has('error')) -
- -

{{__('誤差')}}:

- {!! Session::get('error') !!} -
- @elseif(isset($errorMsg)) -
- -

{{__('誤差')}}:

- {!! $errorMsg !!} -
- @endif -
-
-
-
- - - - - - - - - @foreach($list as $item) - - - - @endforeach - -
- -
- -
- {{--詳細--}} - {{__('編集')}} -
-
-
-
-
-
- - - - - - - - - - - @foreach($list as $item) - - - - - - - @endforeach - -
- {{__('validation.attributes.user_categoryid')}} - {{__('validation.attributes.print_name')}} - - {{__('validation.attributes.usertype_money')}} - - {{__('validation.attributes.usertype_remarks')}} -
- {{mb_substr($item->user_categoryid, 0, 10)}} - {{mb_substr($item->print_name, 0, 10)}} - {{mb_substr($item->usertype_money, 0, 10)}} - {{mb_substr($item->usertype_remarks, 0, 20)}}
-
-
-
-
-
-
-@endsection diff --git a/resources/views/admin/usertypes/list.blade.php b/resources/views/admin/usertypes/list.blade.php index 73c41fa..565e4bb 100644 --- a/resources/views/admin/usertypes/list.blade.php +++ b/resources/views/admin/usertypes/list.blade.php @@ -1,360 +1,259 @@ @extends('layouts.app') @section('title', '利用者分類マスタ') + @section('content') -
-
-
-
-

{{__('利用者分類マスタ')}}

-
-
- -
+ +
+
+
+
+

利用者分類マスタ

+
+
+
- -
-
-
-
- @csrf - - -
-
- {{ __('絞り込み') }} -
-
-
-
- - -
-
- - -
-
- - -
-
-
-
- - -
-
-
- - -
-
-
-
-
- @csrf - - - - - - -
-
-
- {{ __('新規') }} - - -
-
- {{ $list->appends([ - 'sort' => $sort, - 'sort_type' => $sort_type, - 'filter_sort_order' => $filter_sort_order ?? '', - 'filter_usertype_subject1' => $filter_usertype_subject1 ?? '', - 'filter_usertype_subject2' => $filter_usertype_subject2 ?? '', - 'filter_usertype_subject3' => $filter_usertype_subject3 ?? '', - ])->links('pagination') }} -
+
+ +
+
+ +
+
+
+

絞り込みフィルター

-
- @if(Session::has('success')) - - @elseif(Session::has('error')) -
- -

{{__('誤差')}}:

- {!! Session::get('error') !!} -
- @elseif(isset($errorMsg)) -
- -

{{__('誤差')}}:

- {!! $errorMsg !!} -
- @endif -
-
-
+ +
+ @csrf -
- @php - $currentSort = $sort ?? ''; - $currentDir = strtolower($sort_type ?? 'asc'); - if (!in_array($currentDir, ['asc', 'desc'], true)) { - $currentDir = 'asc'; - } + + - $sortClass = static function (string $key) use ($currentSort, $currentDir): string { - return $currentSort === $key - ? 'sortable sorting_' . $currentDir - : 'sortable sorting'; - }; + {{-- 1行目:ソートオーダー / 分類名1 / 分類名2(ラベル上・入力下) --}} +
+
+
ソートオーダー
+ +
- $arrowState = static function (string $key) use ($currentSort, $currentDir): array { - $state = ['up' => '', 'down' => '']; - if ($currentSort === $key) { - if ($currentDir === 'asc') { - $state['up'] = 'is-active'; - } elseif ($currentDir === 'desc') { - $state['down'] = 'is-active'; - } - } - return $state; - }; +
+
分類名1
+ +
- $renderSortIcon = static function (array $state): string { - $up = $state['up'] ?? ''; - $down = $state['down'] ?? ''; - return ''; - }; - $queryParams = [ - 'filter_sort_order' => $filter_sort_order ?? null, - 'filter_usertype_subject1' => $filter_usertype_subject1 ?? null, - 'filter_usertype_subject2' => $filter_usertype_subject2 ?? null, - 'filter_usertype_subject3' => $filter_usertype_subject3 ?? null, - ]; - $queryParams = array_filter($queryParams, static function ($value) { - return !is_null($value) && $value !== ''; - }); - $buildSortUrl = static function (string $column, string $currentSort, string $currentDir, array $baseParams): string { - $nextDir = ($currentSort === $column && $currentDir === 'asc') ? 'desc' : 'asc'; - return route('usertypes', array_merge($baseParams, [ - 'sort' => $column, - 'sort_type' => $nextDir, - 'page' => 1, - ])); - }; - @endphp - - - - - @php $state = $arrowState('user_categoryid'); @endphp - - @php $state = $arrowState('sort_order'); @endphp - - @php $state = $arrowState('usertype_subject1'); @endphp - - @php $state = $arrowState('usertype_subject2'); @endphp - - @php $state = $arrowState('usertype_subject3'); @endphp - - @php $state = $arrowState('print_name'); @endphp - - - - - - - @forelse($list as $item) - - - - - - - - - - - - @empty - - - - @endforelse - -
- - - - - {{ __('利用者分類ID') }} - {!! $renderSortIcon($state) !!} - - - - {{ __('ソートオーダー') }} - {!! $renderSortIcon($state) !!} - - - - {{ __('分類名1') }} - {!! $renderSortIcon($state) !!} - - - - {{ __('分類名2') }} - {!! $renderSortIcon($state) !!} - - - - {{ __('分類名3') }} - {!! $renderSortIcon($state) !!} - - - - {{ __('印字名') }} - {!! $renderSortIcon($state) !!} - - - {{__('適用料率')}} - - {{__('備考')}} -
- - {{ $item->user_categoryid }}{{ $item->sort_order }}{{ $item->usertype_subject1 }}{{ $item->usertype_subject2 }}{{ $item->usertype_subject3 }}{{ $item->print_name }}{{ $item->usertype_money }}{{ $item->usertype_remarks }}
{{ __('データが存在しません。') }}
+
+
分類名2
+ +
+ + {{-- 2行目:分類名3(左寄せ、幅は1/3) --}} +
+
+
分類名3
+ +
+
+ + {{-- ボタン --}} +
+ + +
+
-
+ - + + + + + +
+ + {{-- ▼ ページネーション --}} +
+
+ {{-- 件数表示(上) --}} +
+ @if ($list->total() > 0) + 全 {{ $list->total() }} 件中 {{ $list->firstItem() }}〜{{ $list->lastItem() }} 件を表示 + @else + 全0件 + @endif +
+ + {{-- ページネーション(下) --}} +
+ {{ $list->appends([ + 'sort' => $sort ?? '', + 'sort_type' => $sort_type ?? '' + ])->links('pagination') }} +
+
+
+ {{-- ▲ ページネーション --}} -@endsection \ No newline at end of file + + {{-- ▼ フラッシュメッセージ --}} +
+ @if(Session::has('success')) +
+ + {{ Session::get('success') }} +
+ @elseif(Session::has('error')) +
+ + {!! Session::get('error') !!} +
+ @elseif(isset($errorMsg)) +
+ + {!! $errorMsg !!} +
+ @endif +
+ + {{-- ▼ テーブル --}} +
+
+
+ @csrf + + + + {{-- チェック + 編集 --}} + + + + + + + + + + + + + + + + + + + + + @foreach($list as $item) + + + + + + + + + + + + + @endforeach + + + +
+ + + 利用者分類ID + + ソートオーダー + + 分類名1 + + 分類名2 + + 分類名3 + + 印字名 + 適用料率備考
+ + {{ $item->user_categoryid }}{{ $item->sort_order }}{{ $item->usertype_subject1 }}{{ $item->usertype_subject2 }}{{ $item->usertype_subject3 }}{{ $item->print_name }}{{ $item->usertype_money }}{{ $item->usertype_remarks }}
+
+
+
+ +
+
+ +{{-- CSV --}} +
+ @csrf +
+ +@endsection