feat:문서양식 목록에 연결 품목 컬럼 추가

- DocumentTemplateApiController: 연결 품목 ID로 품목명 조회
- table.blade.php: 연결 품목 컬럼 추가 (최대 3개 표시 + 더보기)
- index.blade.php: 카테고리 필터 code/name 구조 적용
- preview-modal.blade.php: 기본필드 테이블 비율 조정 (15:35:15:35)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-02-05 21:58:46 +09:00
parent fffaf205db
commit d910643558
4 changed files with 42 additions and 9 deletions

View File

@@ -61,7 +61,16 @@ public function index(Request $request): View
$templates = $query->orderBy('updated_at', 'desc')
->paginate($request->input('per_page', 10));
return view('document-templates.partials.table', compact('templates', 'showTrashed'));
// 연결된 품목 ID 수집 및 품목명 조회
$allItemIds = $templates->pluck('linked_item_ids')->flatten()->filter()->unique()->values()->toArray();
$itemNames = [];
if (! empty($allItemIds)) {
$itemNames = \App\Models\Items\Item::whereIn('id', $allItemIds)
->pluck('name', 'id')
->toArray();
}
return view('document-templates.partials.table', compact('templates', 'showTrashed', 'itemNames'));
}
/**