駐輪場所、料金マスタの編集画面修正
All checks were successful
Deploy main / deploy (push) Successful in 25s

This commit is contained in:
kin.rinzen 2025-09-10 15:36:32 +09:00
parent 39b2f21e4d
commit 464755b870
2 changed files with 105 additions and 84 deletions

View File

@ -99,7 +99,10 @@
<select name="price_ptypeid" class="form-control form-control-lg"> <select name="price_ptypeid" class="form-control form-control-lg">
<option value="">{{ __('駐輪分類名') }}</option> <option value="">{{ __('駐輪分類名') }}</option>
@foreach($ptypes as $key => $item) @foreach($ptypes as $key => $item)
<option value="{{ $key }}" @if($key == $price_ptypeid) selected @endif>{{ $item }}</option> <option value="{{ $key }}"
@if(isset($price_ptypeid) && $key == $price_ptypeid) selected @endif>
{{ $item }}
</option>
@endforeach @endforeach
</select> </select>
</div> </div>
@ -130,22 +133,24 @@
class="form-control form-control-lg" /> class="form-control form-control-lg" />
</div> </div>
</div> </div>
</div>
<!-- 駐輪料金(税込) --> <!-- 駐輪料金(税込) -->
<div class="form-group row"> <div class="col-3">
<label class="col-3 col-form-label required">{{ __('駐輪料金(税込)') }}</label> <label class="required">{{ __('駐輪料金(税込)') }}</label>
<div class="col-9"> </div>
<div class="form-group col-9">
<div class="input-group">
<input type="text" value="{{ $price }}" name="price" <input type="text" value="{{ $price }}" name="price"
class="form-control form-control-lg" /> class="form-control form-control-lg" />
</div> </div>
</div> </div>
{{-- 下部ボタン --}} {{-- 下部ボタン --}}
@if($isEdit) @if($isEdit)
{{-- 編集画面 --}} {{-- 編集画面 --}}
<button type="submit" class="btn btn-lg btn-success">{{ __('登録') }}</button> <button type="submit" class="btn btn-lg btn-success mr-2">{{ __('登録') }}</button>
<form method="POST" action="{{ route('prices_delete', ['id' => $price_parkplaceid]) }}" class="d-inline"> <form method="POST" action="{{ route('prices_delete', ['id' => $price_parkplaceid]) }}" class="d-inline">
@csrf @csrf
@ -156,5 +161,6 @@
{{-- 新規画面 --}} {{-- 新規画面 --}}
<button type="submit" class="btn btn-lg btn-success">{{ __('登録') }}</button> <button type="submit" class="btn btn-lg btn-success">{{ __('登録') }}</button>
@endif @endif
</div> </div>
<!-- /.card-body --> <!-- /.card-body -->

View File

@ -2,6 +2,7 @@
@section('title', '[東京都|〇〇駐輪場] 駐輪場所、料金マスタ') @section('title', '[東京都|〇〇駐輪場] 駐輪場所、料金マスタ')
@section('content') @section('content')
{{-- コンテンツヘッダー(パンくず) --}} {{-- コンテンツヘッダー(パンくず) --}}
<div class="content-header"> <div class="content-header">
<div class="container-fluid"> <div class="container-fluid">
@ -22,7 +23,8 @@
{{-- メインコンテンツ --}} {{-- メインコンテンツ --}}
<section class="content"> <section class="content">
<div class="container-fluid"> <div class="container-fluid">
{{-- 並び替え用 hidden --}}
{{-- 並び替え用 hidden --}}
<form action="{{ route('prices') }}" method="POST" id="list-form"> <form action="{{ route('prices') }}" method="POST" id="list-form">
@csrf @csrf
<input type="hidden" name="sort" value="{{ $sort ?? '' }}"> <input type="hidden" name="sort" value="{{ $sort ?? '' }}">
@ -33,19 +35,29 @@
<div class="container-fluid mb20"> <div class="container-fluid mb20">
<button type="button" class="btn btn-sm btn-default mr10" <button type="button" class="btn btn-sm btn-default mr10"
onclick="location.href='{{ route('price_add') }}'">新規</button> onclick="location.href='{{ route('price_add') }}'">新規</button>
<button type="submit" class="btn btn-sm btn-default mr10" form="form_delete" name="delete" id="delete"
<button type="submit" class="btn btn-sm btn-default mr10"
form="form_delete" name="delete" id="delete"
onclick="return confirm('選択した項目を削除しますか?');">削除</button> onclick="return confirm('選択した項目を削除しますか?');">削除</button>
<button type="submit" class="btn btn-sm btn-default mr10" name="export_csv" id="export_csv"
<button type="submit" class="btn btn-sm btn-default mr10"
name="export_csv" id="export_csv"
action="{{ route('prices_export') }}">CSV出力</button> action="{{ route('prices_export') }}">CSV出力</button>
<button type="submit" class="btn btn-sm btn-default mr10" name="import_csv" id="import_csv"
<button type="submit" class="btn btn-sm btn-default mr10"
name="import_csv" id="import_csv"
action="{{ route('prices_import') }}">インポート</button> action="{{ route('prices_import') }}">インポート</button>
<button type="button" class="btn btn-sm btn-default mr10" <button type="button" class="btn btn-sm btn-default mr10"
onclick="location.href='{{ route('prices_export') }}'">エクスポート</button> onclick="location.href='{{ route('prices_export') }}'">エクスポート</button>
</div> </div>
<div class="d-flex justify-content-end"> {{-- ページネーション --}}
<div class="container-fluid">
<div class="d-flex justify-content-end mb-3">
{{ $list->appends(['sort' => $sort ?? '', 'sort_type' => $sort_type ?? ''])->links('pagination') }} {{ $list->appends(['sort' => $sort ?? '', 'sort_type' => $sort_type ?? ''])->links('pagination') }}
</div> </div>
</div>
{{-- フラッシュメッセージ --}} {{-- フラッシュメッセージ --}}
<div class="form col-lg-12"> <div class="form col-lg-12">
@ -72,24 +84,25 @@
{{-- 一覧市区マスタ準拠1枚テーブル先頭が「チェック編集」統合列 --}} {{-- 一覧市区マスタ準拠1枚テーブル先頭が「チェック編集」統合列 --}}
<form action="{{ route('prices_delete') }}" method="post" id="form_delete"> <form action="{{ route('prices_delete') }}" method="post" id="form_delete">
@csrf @csrf
<!-- ここから単一テーブル構成 ----------------------------------------- --> <!-- ここから単一テーブル構成 ----------------------------------------- -->
<div class="col-lg-12 mb20"> <div class="col-lg-12 mb20">
<div class="table-responsive"> <div class="table-responsive">
<form action="{{ route('prices_delete') }}" method="POST" id="form_delete">
@csrf
<table class="table table-bordered dataTable text-nowrap"> <table class="table table-bordered dataTable text-nowrap">
<thead class="thead-light"> <thead class="thead-light">
<tr> <tr>
{{-- チェック + 編集 用の1列 --}} {{-- チェック + 編集 用の1列 --}}
<th style="width:140px;" class="text-left"> <th style="width:140px; border-left:1px solid #dcdcdc;" class="text-left">
<input type="checkbox" onclick="$('input[name*=\'pk\']').prop('checked', this.checked);"> <input type="checkbox" onclick="$('input[name*=\'pk\']').prop('checked', this.checked);">
</th> </th>
{{-- ソート対象列 --}} {{-- ソート対象列 --}}
<th class="sorting {{ ($sort=='price_parkplaceid') ? ($sort_type=='asc'?'sorting_asc':'sorting_desc') : '' }}" sort="price_parkplaceid"> <th class="sorting {{ ($sort=='price_parkplaceid') ? ($sort_type=='asc'?'sorting_asc':'sorting_desc') : '' }}"
sort="price_parkplaceid">
<span>駐輪場所ID</span> <span>駐輪場所ID</span>
</th> </th>
<th class="sorting {{ ($sort=='park_id') ? ($sort_type=='asc'?'sorting_asc':'sorting_desc') : '' }}" sort="park_id"> <th class="sorting {{ ($sort=='park_id') ? ($sort_type=='asc'?'sorting_asc':'sorting_desc') : '' }}"
sort="park_id">
<span>駐輪場ID</span> <span>駐輪場ID</span>
</th> </th>
@ -100,13 +113,16 @@
<th><span>駐輪料金(税込)</span></th> <th><span>駐輪料金(税込)</span></th>
{{-- ソート対象列 --}} {{-- ソート対象列 --}}
<th class="sorting {{ ($sort=='psection_id') ? ($sort_type=='asc'?'sorting_asc':'sorting_desc') : '' }}" sort="psection_id"> <th class="sorting {{ ($sort=='psection_id') ? ($sort_type=='asc'?'sorting_asc':'sorting_desc') : '' }}"
sort="psection_id">
<span>車種区分ID</span> <span>車種区分ID</span>
</th> </th>
<th class="sorting {{ ($sort=='price_ptypeid') ? ($sort_type=='asc'?'sorting_asc':'sorting_desc') : '' }}" sort="price_ptypeid"> <th class="sorting {{ ($sort=='price_ptypeid') ? ($sort_type=='asc'?'sorting_asc':'sorting_desc') : '' }}"
sort="price_ptypeid">
<span>駐輪分類</span> <span>駐輪分類</span>
</th> </th>
<th class="sorting {{ ($sort=='pplace_id') ? ($sort_type=='asc'?'sorting_asc':'sorting_desc') : '' }}" sort="pplace_id"> <th class="sorting {{ ($sort=='pplace_id') ? ($sort_type=='asc'?'sorting_asc':'sorting_desc') : '' }}"
sort="pplace_id">
<span>駐車車室ID</span> <span>駐車車室ID</span>
</th> </th>
</tr> </tr>
@ -116,10 +132,11 @@
@foreach($list as $item) @foreach($list as $item)
<tr> <tr>
{{-- 同じセル内に チェック + 編集ボタン --}} {{-- 同じセル内に チェック + 編集ボタン --}}
<td class="align-middle" style="background-color:#faebd7;"> <td class="align-middle" style="background-color:#faebd7; border-left:1px solid #dcdcdc;">
<div class="d-flex align-items-center"> <div class="d-flex align-items-center">
<input type="checkbox" class="m-0 checkbox" name="pk[]" value="{{ $item->price_parkplaceid }}"> <input type="checkbox" class="m-0 checkbox" name="pk[]" value="{{ $item->price_parkplaceid }}">
<a href="{{ route('price_edit', ['id' => $item->price_parkplaceid]) }}" class="btn btn-sm btn-default ml10">編集</a> <a href="{{ route('price_edit', ['id' => $item->price_parkplaceid]) }}"
class="btn btn-sm btn-default ml10">編集</a>
</div> </div>
</td> </td>
@ -137,13 +154,11 @@
@endforeach @endforeach
</tbody> </tbody>
</table> </table>
</form>
</div> </div>
</div> </div>
<!-- 単一テーブル構成ここまで ----------------------------------------- --> <!-- 単一テーブル構成ここまで ----------------------------------------- -->
</form> </form>
</div> </div>
</section> </section>