駐輪場所、料金マスタの編集画面修正
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,17 +2,18 @@
@section('title', '[東京都|〇〇駐輪場] 駐輪場所、料金マスタ') @section('title', '[東京都|〇〇駐輪場] 駐輪場所、料金マスタ')
@section('content') @section('content')
{{-- コンテンツヘッダー(パンくず) --}} {{-- コンテンツヘッダー(パンくず) --}}
<div class="content-header"> <div class="content-header">
<div class="container-fluid"> <div class="container-fluid">
<div class="row mb-2"> <div class="row mb-2">
<div class="col-lg-6"> <div class="col-lg-6">
<h1 class="m-0 text-dark">{{__('駐輪場所、料金マスタ')}}</h1> <h1 class="m-0 text-dark">{{ __('駐輪場所、料金マスタ') }}</h1>
</div> </div>
<div class="col-lg-6"> <div class="col-lg-6">
<ol class="breadcrumb float-sm-right text-sm"> <ol class="breadcrumb float-sm-right text-sm">
<li class="breadcrumb-item"><a href="{{route('home')}}">ホーム</a></li> <li class="breadcrumb-item"><a href="{{ route('home') }}">ホーム</a></li>
<li class="breadcrumb-item active">{{__('駐輪場所、料金マスタ')}}</li> <li class="breadcrumb-item active">{{ __('駐輪場所、料金マスタ') }}</li>
</ol> </ol>
</div> </div>
</div> </div>
@ -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,20 +35,30 @@
<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"
action="{{route('prices_export')}}">CSV出力</button> <button type="submit" class="btn btn-sm btn-default mr10"
<button type="submit" class="btn btn-sm btn-default mr10" name="import_csv" id="import_csv" name="export_csv" id="export_csv"
action="{{route('prices_import')}}">インポート</button> action="{{ route('prices_export') }}">CSV出力</button>
<button type="submit" class="btn btn-sm btn-default mr10"
name="import_csv" id="import_csv"
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"> {{-- ページネーション --}}
{{ $list->appends(['sort' => $sort ?? '', 'sort_type' => $sort_type ?? ''])->links('pagination') }} <div class="container-fluid">
<div class="d-flex justify-content-end mb-3">
{{ $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">
@if(Session::has('success')) @if(Session::has('success'))
@ -57,93 +69,96 @@
@elseif(Session::has('error')) @elseif(Session::has('error'))
<div class="alert alert-danger alert-dismissible"> <div class="alert alert-danger alert-dismissible">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button> <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
<h4><i class="icon fa fa-ban"></i> {{__('誤差')}}:</h4> <h4><i class="icon fa fa-ban"></i> {{ __('誤差') }}:</h4>
{!! Session::get('error') !!} {!! Session::get('error') !!}
</div> </div>
@elseif(isset($errorMsg)) @elseif(isset($errorMsg))
<div class="alert alert-danger alert-dismissible"> <div class="alert alert-danger alert-dismissible">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button> <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
<h4><i class="icon fa fa-ban"></i> {{__('誤差')}}:</h4> <h4><i class="icon fa fa-ban"></i> {{ __('誤差') }}:</h4>
{!! $errorMsg !!} {!! $errorMsg !!}
</div> </div>
@endif @endif
</div> </div>
{{-- 一覧市区マスタ準拠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"> <table class="table table-bordered dataTable text-nowrap">
@csrf <thead class="thead-light">
<table class="table table-bordered dataTable text-nowrap"> <tr>
<thead class="thead-light"> {{-- チェック + 編集 用の1列 --}}
<th style="width:140px; border-left:1px solid #dcdcdc;" class="text-left">
<input type="checkbox" onclick="$('input[name*=\'pk\']').prop('checked', this.checked);">
</th>
{{-- ソート対象列 --}}
<th class="sorting {{ ($sort=='price_parkplaceid') ? ($sort_type=='asc'?'sorting_asc':'sorting_desc') : '' }}"
sort="price_parkplaceid">
<span>駐輪場所ID</span>
</th>
<th class="sorting {{ ($sort=='park_id') ? ($sort_type=='asc'?'sorting_asc':'sorting_desc') : '' }}"
sort="park_id">
<span>駐輪場ID</span>
</th>
{{-- ソート不要 --}}
<th><span>商品名</span></th>
<th><span>期間</span></th>
<th><span>利用者分類ID</span></th>
<th><span>駐輪料金(税込)</span></th>
{{-- ソート対象列 --}}
<th class="sorting {{ ($sort=='psection_id') ? ($sort_type=='asc'?'sorting_asc':'sorting_desc') : '' }}"
sort="psection_id">
<span>車種区分ID</span>
</th>
<th class="sorting {{ ($sort=='price_ptypeid') ? ($sort_type=='asc'?'sorting_asc':'sorting_desc') : '' }}"
sort="price_ptypeid">
<span>駐輪分類</span>
</th>
<th class="sorting {{ ($sort=='pplace_id') ? ($sort_type=='asc'?'sorting_asc':'sorting_desc') : '' }}"
sort="pplace_id">
<span>駐車車室ID</span>
</th>
</tr>
</thead>
<tbody class="bg-white">
@foreach($list as $item)
<tr> <tr>
{{-- チェック + 編集 用の1列 --}} {{-- 同じセル内に チェック + 編集ボタン --}}
<th style="width:140px;" class="text-left"> <td class="align-middle" style="background-color:#faebd7; border-left:1px solid #dcdcdc;">
<input type="checkbox" onclick="$('input[name*=\'pk\']').prop('checked', this.checked);"> <div class="d-flex align-items-center">
</th> <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>
</div>
</td>
{{-- ソート対象列 --}} {{-- データ列 --}}
<th class="sorting {{ ($sort=='price_parkplaceid') ? ($sort_type=='asc'?'sorting_asc':'sorting_desc') : '' }}" sort="price_parkplaceid"> <td class="sm-item text-left align-middle">{{ $item->price_parkplaceid }}</td>
<span>駐輪場所ID</span> <td class="sm-item text-left align-middle">{{ $item->park_id }}</td>
</th> <td class="sm-item text-left align-middle">{{ $item->prine_name }}</td>
<th class="sorting {{ ($sort=='park_id') ? ($sort_type=='asc'?'sorting_asc':'sorting_desc') : '' }}" sort="park_id"> <td class="sm-item text-left align-middle">{{ $item->price_month }}</td>
<span>駐輪場ID</span> <td class="sm-item text-left align-middle">{{ $item->user_categoryid }}</td>
</th> <td class="sm-item text-left align-middle">{{ $item->price }}</td>
<td class="sm-item text-left align-middle">{{ $item->psection_id }}</td>
{{-- ソート不要 --}} <td class="sm-item text-left align-middle">{{ $item->price_ptypeid }}</td>
<th><span>商品名</span></th> <td class="sm-item text-left align-middle">{{ $item->pplace_id }}</td>
<th><span>期間</span></th>
<th><span>利用者分類ID</span></th>
<th><span>駐輪料金(税込)</span></th>
{{-- ソート対象列 --}}
<th class="sorting {{ ($sort=='psection_id') ? ($sort_type=='asc'?'sorting_asc':'sorting_desc') : '' }}" sort="psection_id">
<span>車種区分ID</span>
</th>
<th class="sorting {{ ($sort=='price_ptypeid') ? ($sort_type=='asc'?'sorting_asc':'sorting_desc') : '' }}" sort="price_ptypeid">
<span>駐輪分類</span>
</th>
<th class="sorting {{ ($sort=='pplace_id') ? ($sort_type=='asc'?'sorting_asc':'sorting_desc') : '' }}" sort="pplace_id">
<span>駐車車室ID</span>
</th>
</tr> </tr>
</thead> @endforeach
</tbody>
<tbody class="bg-white"> </table>
@foreach($list as $item)
<tr>
{{-- 同じセル内に チェック + 編集ボタン --}}
<td class="align-middle" style="background-color:#faebd7;">
<div class="d-flex align-items-center">
<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>
</div>
</td>
{{-- データ列 --}}
<td class="sm-item text-left align-middle">{{ $item->price_parkplaceid }}</td>
<td class="sm-item text-left align-middle">{{ $item->park_id }}</td>
<td class="sm-item text-left align-middle">{{ $item->prine_name }}</td>
<td class="sm-item text-left align-middle">{{ $item->price_month }}</td>
<td class="sm-item text-left align-middle">{{ $item->user_categoryid }}</td>
<td class="sm-item text-left align-middle">{{ $item->price }}</td>
<td class="sm-item text-left align-middle">{{ $item->psection_id }}</td>
<td class="sm-item text-left align-middle">{{ $item->price_ptypeid }}</td>
<td class="sm-item text-left align-middle">{{ $item->pplace_id }}</td>
</tr>
@endforeach
</tbody>
</table>
</form>
</div> </div>
</div> </div>
<!-- 単一テーブル構成ここまで ----------------------------------------- --> <!-- 単一テーブル構成ここまで ----------------------------------------- -->
</form> </form>
</div> </div>
</section> </section>
@ -175,4 +190,4 @@ $(function(){
}); });
}); });
</script> </script>
@endsection @endsection