@php($assist = App\Services\Logic\Assist::class) @php($receiptTypeEnums = App\Enums\PaymentReceiptType::getReceiptSectionTypes()) @php($isShow = ($mode ?? 'create') === 'show')
{{-- セクションヘッダー --}}

入金情報

@if(!$isShow) @endif
{{-- 入金情報テーブル --}} @if(!$isShow) {{-- アクション --}} @endif {{-- No --}} {{-- 入金区分 --}} {{-- 金額 --}} {{-- 銀行名 --}} {{-- 支店名 --}} {{-- 1行目ヘッダ --}} @if(!$isShow) @endif {{-- 2行目ヘッダ --}} @foreach($this->receiptTypes as $index => $row) @php($receiptTypeValue = (int)($row['receipt_type'] ?? 1)) @php($receiptType = App\Enums\PaymentReceiptType::tryFrom($receiptTypeValue)) @php($isBankVisible = $receiptType && $receiptType->requiresBankName()) @php($isBillDateVisible = in_array($receiptTypeValue, [4, 5])) {{-- 行のキー。 uniqid()を毎回採番すると描画のたびにキーが変わり、Livewireのmorphが 行DOMを作り直して入力中のフォーカスを失う。 一方で「常に同じキー」にもできない。この行のDOMは ・wire:model="receiptTypes.{index}.xxx"(インデックス埋め込み) ・x-data="{ receiptType: N }"(要素生成時にしか評価されない初期値) を持つため、インデックスや入金区分が変わった行は作り直す必要がある。 =「そのノードを再利用してよい条件」を3つともキーに含める。 --}} @php($rowKey = ($row['_wire_key'] ?? 'idx') . '-' . $index . '-' . $receiptTypeValue) {{-- 上段 --}} {{-- アクション --}} @if(!$isShow) @endif {{-- No --}} {{-- 入金区分 --}} {{-- 金額 --}} {{-- 銀行名 --}} {{-- 支店名 --}} {{-- 下段 --}} {{-- 手形期日 --}} {{-- 摘要 --}} @endforeach @if(!$isShow) @endif
No 入金区分 金額 銀行名 支店名
手形期日 摘要
@if(count($this->receiptTypes) > 1) @endif {{ $index + 1 }} @if($isShow) @else @endif @if($isShow) @else @endif
@if($isShow) @else @endif
-
@if($isShow) @else @endif
-
@if($isShow) @else @endif
-
@if($isShow) @else @endif
入金合計 {{ num_format($this->receiptTotal) }} @if(!$isShow) @endif