270 lines
14 KiB
PHP
270 lines
14 KiB
PHP
@extends('layouts.app')
|
||
@section('title', '常時表示インフォメーション')
|
||
|
||
@section('content')
|
||
<div class="container-fluid">
|
||
<div class="d-flex justify-content-between align-items-center mb-2">
|
||
<div class="col-lg-6">
|
||
<h3 class="m-0 text-dark">{{__('常時表示インフォメーション')}}</h3>
|
||
</div>
|
||
<nav aria-label="breadcrumb" class="mb-0" style="background: transparent;">
|
||
<ol class="breadcrumb px-2 py-2 mb-0" style="background: transparent;">
|
||
<li class="breadcrumb-item"><a href="{{ route('home') }}">ホーム</a></li>
|
||
<li class="breadcrumb-item active" aria-current="page">常時表示インフォメーション</li>
|
||
</ol>
|
||
</nav>
|
||
</div>
|
||
|
||
<!-- 絞り込み -->
|
||
<div class="card mb-3">
|
||
<div class="card-body">
|
||
<h5 class="mb-3">絞り込み</h5>
|
||
<!-- 表示期間 -->
|
||
<div class="row mb-2">
|
||
<div class="col-md-12 font-weight-bold mb-1">表示期間フィルター</div>
|
||
<div class="col-md-12">
|
||
<div class="row">
|
||
<div class="col-md-3 mb-2">
|
||
<a href="{{ request()->fullUrlWithQuery(['period'=>'month']) }}"
|
||
class="btn btn-sm {{ (request('period',$period)=='month')?'btn-warning':'btn-outline-secondary' }}"
|
||
style="width:120px;height:32px;">最新1ヵ月</a>
|
||
</div>
|
||
<div class="col-md-3 mb-2"></div>
|
||
<div class="col-md-3 mb-2"></div>
|
||
<div class="col-md-3 mb-2">
|
||
<a href="{{ request()->fullUrlWithQuery(['period'=>'all']) }}"
|
||
class="btn btn-sm {{ (request('period',$period)=='all')?'btn-warning':'btn-outline-secondary' }}"
|
||
style="width:120px;height:32px;">全期間表示</a>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- 種別 -->
|
||
<div class="row mb-2">
|
||
<div class="col-md-12 font-weight-bold mb-1">種別フィルター</div>
|
||
<div class="col-md-12">
|
||
<div class="row">
|
||
<div class="col-md-3 mb-2">
|
||
<a href="{{ request()->fullUrlWithQuery(['type'=>'task']) }}"
|
||
class="btn btn-sm {{ (request('type',$type)=='task')?'btn-warning':'btn-outline-secondary' }}"
|
||
style="width:120px;height:32px;">タスク</a>
|
||
</div>
|
||
<div class="col-md-3 mb-2">
|
||
<a href="{{ request()->fullUrlWithQuery(['type'=>'hard']) }}"
|
||
class="btn btn-sm {{ (request('type',$type)=='hard')?'btn-warning':'btn-outline-secondary' }}"
|
||
style="width:120px;height:32px;">ハード異常</a>
|
||
</div>
|
||
<div class="col-md-3 mb-2"></div>
|
||
<div class="col-md-3 mb-2">
|
||
<a href="{{ request()->fullUrlWithQuery(['type'=>'all']) }}"
|
||
class="btn btn-sm {{ (request('type',$type)=='all')?'btn-warning':'btn-outline-secondary' }}"
|
||
style="width:120px;height:32px;">全種別表示</a>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- ステータス -->
|
||
<div class="row mb-2">
|
||
<div class="col-md-12 font-weight-bold mb-1">ステータスフィルター</div>
|
||
<div class="col-md-12">
|
||
<div class="row">
|
||
<div class="col-md-3 mb-2">
|
||
<a href="{{ request()->fullUrlWithQuery(['status'=>'untreated']) }}"
|
||
class="btn btn-sm {{ (request('status',$status)=='untreated')?'btn-warning':'btn-outline-secondary' }}"
|
||
style="width:120px;height:32px;">未対応表示</a>
|
||
</div>
|
||
<div class="col-md-3 mb-2">
|
||
<a href="{{ request()->fullUrlWithQuery(['status'=>'inprogress']) }}"
|
||
class="btn btn-sm {{ (request('status',$status)=='inprogress')?'btn-warning':'btn-outline-secondary' }}"
|
||
style="width:120px;height:32px;">着手を表示</a>
|
||
</div>
|
||
<div class="col-md-3 mb-2">
|
||
<a href="{{ request()->fullUrlWithQuery(['status'=>'done']) }}"
|
||
class="btn btn-sm {{ (request('status',$status)=='done')?'btn-warning':'btn-outline-secondary' }}"
|
||
style="width:120px;height:32px;">対応完了を表示</a>
|
||
</div>
|
||
<div class="col-md-3 mb-2">
|
||
<a href="{{ request()->fullUrlWithQuery(['status'=>'all']) }}"
|
||
class="btn btn-sm {{ (request('status',$status)=='all')?'btn-warning':'btn-outline-secondary' }}"
|
||
style="width:120px;height:32px;">全ステータス表示</a>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- ステータス変更(POST) -->
|
||
<div class="row mb-2">
|
||
<div class="col-md-12 font-weight-bold mb-1">ステータス変更</div>
|
||
<div class="col-md-12">
|
||
<div class="row">
|
||
<div class="col-md-3 mb-2">
|
||
<button type="button" class="btn btn-sm btn-outline-secondary"
|
||
style="width:120px;height:32px;"
|
||
onclick="submitStatus('inprogress')">着手</button>
|
||
</div>
|
||
<div class="col-md-3 mb-2">
|
||
<button type="button" class="btn btn-sm btn-outline-secondary"
|
||
style="width:120px;height:32px;"
|
||
onclick="submitStatus('done')">対応完了</button>
|
||
</div>
|
||
<div class="col-md-3 mb-2"></div>
|
||
<div class="col-md-3 mb-2"></div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- データテーブル(チェック付き) -->
|
||
<form id="status-form" action="{{ route('information.status') }}" method="POST">
|
||
@csrf
|
||
<input type="hidden" name="action" id="status-action" value="">
|
||
<div class="table-responsive">
|
||
@php
|
||
// キュー種別/ステータスの表示名マップ
|
||
$queueTypeMap = [
|
||
1=>'本人確認(社会人)', 2=>'本人確認(学生)', 3=>'タグ発送',
|
||
4=>'予約告知通知', 5=>'定期更新通知', 6=>'返金処理',
|
||
7=>'再発行リミット超過', 8=>'支払い催促', 9=>'シール発行催促',
|
||
101=>'サーバーエラー', 102=>'プリンタエラー', 103=>'スキャナーエラー', 104=>'プリンタ用紙残少警告',
|
||
];
|
||
$statusMap = [1=>'キュー発生', 2=>'キュー作業中', 3=>'キュー作業済', 4=>'返金済'];
|
||
// 対応画面への遷移リンク(存在する画面のみ)
|
||
$queueLinkMap = [
|
||
1 => route('personal'), // 本人確認(社会人)
|
||
2 => route('personal'), // 本人確認(学生)
|
||
3 => route('tagissue'), // タグ発送
|
||
4 => route('reservation'), // 予約告知通知
|
||
5 => route('update_candidate'), // 定期更新通知
|
||
6 => route('settlement_transactions'),// 返金処理(関連一覧に遷移)
|
||
7 => route('tagissue'), // 再発行関連
|
||
8 => route('settlement_transactions'),// 支払い催促(関連一覧)
|
||
9 => route('seals'), // シール発行催促(履歴)
|
||
];
|
||
@endphp
|
||
<table class="table table-bordered table-hover table-sm">
|
||
<thead class="thead-light">
|
||
<tr>
|
||
<th style="width:30px;"><input type="checkbox" id="select-all"></th>
|
||
<th>キューID</th>
|
||
<th>キュー種別</th>
|
||
<th>利用者</th>
|
||
<th>定期契約ID</th>
|
||
<th>駐輪場</th>
|
||
<th>キューコメント</th>
|
||
<th>キューステータス</th>
|
||
<th>コメント</th>
|
||
<th>登録日時</th>
|
||
<th>更新日時</th>
|
||
<th>更新オペレータ</th>
|
||
<th>リンク</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
@foreach($jobs as $job)
|
||
<tr>
|
||
<td style="background-color:#faebd7;">
|
||
<input type="checkbox" name="ids[]" value="{{ $job->que_id }}">
|
||
</td>
|
||
<td>{{ $job->que_id }}</td>
|
||
<td>{{ $queueTypeMap[$job->que_class] ?? $job->que_class }}</td>
|
||
<td>{{ $job->user_name ?? $job->user_id }}</td>
|
||
<td>{{ $job->contract_id }}</td>
|
||
<td>{{ $job->park_name ?? $job->park_id }}</td>
|
||
<td>{{ $job->que_comment }}</td>
|
||
<td>{{ $statusMap[$job->que_status] ?? $job->que_status }}</td>
|
||
<td>
|
||
{{ $job->que_status_comment }}
|
||
@if(!empty($job->work_instructions))
|
||
<br><small class="text-muted">{{ $job->work_instructions }}</small>
|
||
@endif
|
||
</td>
|
||
<td>{{ $job->created_at }}</td>
|
||
<td>{{ $job->updated_at }}</td>
|
||
<td>{{ $job->operator_name ?? $job->operator_id ?? '-' }}</td>
|
||
<td>
|
||
@if(isset($queueLinkMap[$job->que_class]))
|
||
<a href="{{ $queueLinkMap[$job->que_class] }}">対応画面へ</a>
|
||
@else
|
||
-
|
||
@endif
|
||
</td>
|
||
</tr>
|
||
@endforeach
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
|
||
<!-- ページネーション -->
|
||
@php
|
||
$paginator = $jobs;
|
||
$current = $paginator->currentPage();
|
||
$last = $paginator->lastPage();
|
||
$query = request()->except('page');
|
||
$pages = [];
|
||
if($last <= 20){
|
||
$pages = range(1,$last);
|
||
}else{
|
||
$pages[] = 1;
|
||
if($current > 4) $pages[] = '...L';
|
||
$windowStart = max(2, $current - 2);
|
||
$windowEnd = min($last-1, $current + 2);
|
||
for($i=$windowStart; $i<=$windowEnd; $i++){
|
||
$pages[] = $i;
|
||
}
|
||
if($current < $last - 3) $pages[] = '...R';
|
||
$pages[] = $last;
|
||
}
|
||
function pageUrl($page,$query){
|
||
return url()->current() . '?' . http_build_query(array_merge($query,['page'=>$page]));
|
||
}
|
||
@endphp
|
||
@if($last > 1)
|
||
<div class="mt-2 d-flex justify-content-start">
|
||
<nav aria-label="ページネーション" class="custom-pagination">
|
||
<ul class="pagination pagination-sm mb-0">
|
||
<li class="page-item {{ $current==1?'disabled':'' }}">
|
||
<a class="page-link" href="{{ $current==1?'#':pageUrl(1,$query) }}">‹‹</a>
|
||
</li>
|
||
<li class="page-item {{ $current==1?'disabled':'' }}">
|
||
<a class="page-link" href="{{ $current==1?'#':pageUrl($current-1,$query) }}">‹</a>
|
||
</li>
|
||
@foreach($pages as $p)
|
||
@if(is_string($p) && str_starts_with($p,'...'))
|
||
<li class="page-item disabled"><span class="page-link">…</span></li>
|
||
@else
|
||
<li class="page-item {{ $p==$current?'active':'' }}">
|
||
<a class="page-link" href="{{ $p==$current?'#':pageUrl($p,$query) }}">{{ $p }}</a>
|
||
</li>
|
||
@endif
|
||
@endforeach
|
||
<li class="page-item {{ $current==$last?'disabled':'' }}">
|
||
<a class="page-link" href="{{ $current==$last?'#':pageUrl($current+1,$query) }}">›</a>
|
||
</li>
|
||
<li class="page-item {{ $current==$last?'disabled':'' }}">
|
||
<a class="page-link" href="{{ $current==$last?'#':pageUrl($last,$query) }}">››</a>
|
||
</li>
|
||
</ul>
|
||
</nav>
|
||
</div>
|
||
@endif
|
||
</form>
|
||
</div>
|
||
|
||
@push('scripts')
|
||
<script>
|
||
function submitStatus(action){
|
||
const checked = document.querySelectorAll('input[name="ids[]"]:checked');
|
||
if(checked.length === 0){ alert('対象を選択してください。'); return; }
|
||
document.getElementById('status-action').value = action;
|
||
document.getElementById('status-form').submit();
|
||
}
|
||
// 全選択
|
||
document.getElementById('select-all')?.addEventListener('change', function(){
|
||
document.querySelectorAll('input[name="ids[]"]').forEach(cb => cb.checked = this.checked);
|
||
});
|
||
</script>
|
||
@endpush
|
||
@endsection |