feat: [approvals] 지출결의서 양식 필드 추가
- 지출형식에 '자동이체 출금' 라디오버튼 추가 - 세금계산서 종류에 '없음' 옵션 추가 - 작성일자 옆에 '결재일자' 날짜 입력 필드 추가 - 저장/수정 로직(getFormData)에 신규 필드 반영 - 읽기전용 표시(_expense-show)에도 반영
This commit is contained in:
@@ -67,8 +67,8 @@ class="relative border rounded-lg p-3 cursor-pointer transition-all"
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- 송금 계좌 선택 패널 --}}
|
||||
<div x-show="formData.expense_type === 'transfer'" x-transition:enter="transition ease-out duration-200" x-transition:enter-start="opacity-0 -translate-y-2" x-transition:enter-end="opacity-100 translate-y-0" class="mb-4">
|
||||
{{-- 송금/자동이체 계좌 선택 패널 --}}
|
||||
<div x-show="formData.expense_type === 'transfer' || formData.expense_type === 'auto_transfer'" x-transition:enter="transition ease-out duration-200" x-transition:enter-start="opacity-0 -translate-y-2" x-transition:enter-end="opacity-100 translate-y-0" class="mb-4">
|
||||
<div class="border border-green-200 bg-green-50/50 rounded-lg p-4">
|
||||
<label class="block text-xs font-medium text-gray-600 mb-3">출금 계좌 선택</label>
|
||||
<template x-if="accounts.length === 0">
|
||||
@@ -119,12 +119,17 @@ class="text-blue-600 focus:ring-blue-500">
|
||||
</div>
|
||||
|
||||
{{-- 기본 정보 --}}
|
||||
<div class="grid gap-4 mb-4" style="grid-template-columns: repeat(3, 1fr);">
|
||||
<div class="grid gap-4 mb-4" style="grid-template-columns: repeat(4, 1fr);">
|
||||
<div>
|
||||
<label class="block text-xs font-medium text-gray-600 mb-1">작성일자</label>
|
||||
<input type="date" x-model="formData.write_date"
|
||||
class="w-full px-3 py-2 border border-gray-300 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-blue-500">
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-xs font-medium text-gray-600 mb-1">결재일자</label>
|
||||
<input type="date" x-model="formData.approval_date"
|
||||
class="w-full px-3 py-2 border border-gray-300 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-blue-500">
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-xs font-medium text-gray-600 mb-1">지출부서</label>
|
||||
<input type="text" x-model="formData.department" placeholder="부서명"
|
||||
@@ -189,30 +194,30 @@ class="w-full px-2 py-1.5 border border-gray-200 rounded text-xs focus:outline-n
|
||||
</div>
|
||||
<div x-show="!formData.selected_card" class="px-2 py-1.5 text-xs text-gray-400">카드를 선택하세요</div>
|
||||
</td>
|
||||
{{-- 송금: 선택 계좌 자동표시 / 기타: 수동입력 --}}
|
||||
{{-- 송금/자동이체: 선택 계좌 자동표시 / 기타: 수동입력 --}}
|
||||
<td x-show="formData.expense_type !== 'corporate_card'" class="px-1 py-1">
|
||||
<template x-if="formData.expense_type === 'transfer' && formData.selected_account">
|
||||
<template x-if="(formData.expense_type === 'transfer' || formData.expense_type === 'auto_transfer') && formData.selected_account">
|
||||
<div class="px-2 py-1.5 bg-green-50 border border-green-200 rounded text-xs text-green-700" x-text="formData.selected_account.bank_name"></div>
|
||||
</template>
|
||||
<template x-if="formData.expense_type !== 'transfer' || !formData.selected_account">
|
||||
<template x-if="formData.expense_type !== 'transfer' && formData.expense_type !== 'auto_transfer' || !formData.selected_account">
|
||||
<input type="text" x-model="item.bank" placeholder="은행"
|
||||
class="w-full px-2 py-1.5 border border-gray-200 rounded text-xs focus:outline-none focus:ring-1 focus:ring-blue-500">
|
||||
</template>
|
||||
</td>
|
||||
<td x-show="formData.expense_type !== 'corporate_card'" class="px-1 py-1">
|
||||
<template x-if="formData.expense_type === 'transfer' && formData.selected_account">
|
||||
<template x-if="(formData.expense_type === 'transfer' || formData.expense_type === 'auto_transfer') && formData.selected_account">
|
||||
<div class="px-2 py-1.5 bg-green-50 border border-green-200 rounded text-xs text-green-700 font-mono" x-text="formData.selected_account.account_number"></div>
|
||||
</template>
|
||||
<template x-if="formData.expense_type !== 'transfer' || !formData.selected_account">
|
||||
<template x-if="formData.expense_type !== 'transfer' && formData.expense_type !== 'auto_transfer' || !formData.selected_account">
|
||||
<input type="text" x-model="item.account_no" placeholder="계좌번호"
|
||||
class="w-full px-2 py-1.5 border border-gray-200 rounded text-xs focus:outline-none focus:ring-1 focus:ring-blue-500">
|
||||
</template>
|
||||
</td>
|
||||
<td x-show="formData.expense_type !== 'corporate_card'" class="px-1 py-1">
|
||||
<template x-if="formData.expense_type === 'transfer' && formData.selected_account">
|
||||
<template x-if="(formData.expense_type === 'transfer' || formData.expense_type === 'auto_transfer') && formData.selected_account">
|
||||
<div class="px-2 py-1.5 bg-green-50 border border-green-200 rounded text-xs text-green-700" x-text="formData.selected_account.account_holder"></div>
|
||||
</template>
|
||||
<template x-if="formData.expense_type !== 'transfer' || !formData.selected_account">
|
||||
<template x-if="formData.expense_type !== 'transfer' && formData.expense_type !== 'auto_transfer' || !formData.selected_account">
|
||||
<input type="text" x-model="item.depositor" placeholder="예금주"
|
||||
class="w-full px-2 py-1.5 border border-gray-200 rounded text-xs focus:outline-none focus:ring-1 focus:ring-blue-500">
|
||||
</template>
|
||||
@@ -358,12 +363,14 @@ function makeItem(data) {
|
||||
expenseTypes: [
|
||||
{ value: 'corporate_card', label: '법인카드' },
|
||||
{ value: 'transfer', label: '송금' },
|
||||
{ value: 'auto_transfer', label: '자동이체 출금' },
|
||||
{ value: 'cash_advance', label: '현금/가지급정산' },
|
||||
{ value: 'welfare_card', label: '복지카드' },
|
||||
],
|
||||
taxInvoiceTypes: [
|
||||
{ value: 'normal', label: '일반' },
|
||||
{ value: 'deferred', label: '이월발행' },
|
||||
{ value: 'none', label: '없음' },
|
||||
],
|
||||
cards: cardsData || [],
|
||||
accounts: accountsData || [],
|
||||
@@ -372,6 +379,7 @@ function makeItem(data) {
|
||||
expense_type: initialData?.expense_type || 'corporate_card',
|
||||
tax_invoice: initialData?.tax_invoice || 'normal',
|
||||
write_date: initialData?.write_date || today,
|
||||
approval_date: initialData?.approval_date || '',
|
||||
department: initialData?.department || '본사',
|
||||
writer_name: initialData?.writer_name || authUserName,
|
||||
items: items,
|
||||
@@ -424,7 +432,7 @@ function makeItem(data) {
|
||||
},
|
||||
|
||||
initAutoSelect() {
|
||||
if (this.formData.expense_type === 'transfer' && !this.formData.selected_account && this.accounts.length > 0) {
|
||||
if ((this.formData.expense_type === 'transfer' || this.formData.expense_type === 'auto_transfer') && !this.formData.selected_account && this.accounts.length > 0) {
|
||||
const primary = this.accounts.find(a => a.is_primary);
|
||||
this.selectAccount(primary || this.accounts[0]);
|
||||
}
|
||||
@@ -539,7 +547,7 @@ function makeItem(data) {
|
||||
|
||||
getFormData() {
|
||||
const isCard = this.formData.expense_type === 'corporate_card';
|
||||
const isTransfer = this.formData.expense_type === 'transfer';
|
||||
const isTransfer = this.formData.expense_type === 'transfer' || this.formData.expense_type === 'auto_transfer';
|
||||
const acct = this.formData.selected_account;
|
||||
const card = this.formData.selected_card;
|
||||
|
||||
@@ -547,6 +555,7 @@ function makeItem(data) {
|
||||
expense_type: this.formData.expense_type,
|
||||
tax_invoice: this.formData.tax_invoice,
|
||||
write_date: this.formData.write_date,
|
||||
approval_date: this.formData.approval_date,
|
||||
department: this.formData.department,
|
||||
writer_name: this.formData.writer_name,
|
||||
items: this.formData.items.map(item => ({
|
||||
|
||||
@@ -7,12 +7,14 @@
|
||||
$expenseTypeLabels = [
|
||||
'corporate_card' => '법인카드',
|
||||
'transfer' => '송금',
|
||||
'auto_transfer' => '자동이체 출금',
|
||||
'cash_advance' => '현금/가지급정산',
|
||||
'welfare_card' => '복지카드',
|
||||
];
|
||||
$taxInvoiceLabels = [
|
||||
'normal' => '일반',
|
||||
'deferred' => '이월발행',
|
||||
'none' => '없음',
|
||||
];
|
||||
@endphp
|
||||
|
||||
@@ -31,6 +33,10 @@
|
||||
<span class="text-xs text-gray-500">작성일자</span>
|
||||
<div class="text-sm font-medium mt-0.5">{{ $content['write_date'] ?? '-' }}</div>
|
||||
</div>
|
||||
<div>
|
||||
<span class="text-xs text-gray-500">결재일자</span>
|
||||
<div class="text-sm font-medium mt-0.5">{{ $content['approval_date'] ?? '-' }}</div>
|
||||
</div>
|
||||
<div>
|
||||
<span class="text-xs text-gray-500">지출부서</span>
|
||||
<div class="text-sm font-medium mt-0.5">{{ $content['department'] ?? '-' }}</div>
|
||||
@@ -60,7 +66,7 @@
|
||||
@endif
|
||||
|
||||
{{-- 선택된 출금 계좌 --}}
|
||||
@if(($content['expense_type'] ?? '') === 'transfer' && !empty($content['selected_account']))
|
||||
@if(in_array($content['expense_type'] ?? '', ['transfer', 'auto_transfer']) && !empty($content['selected_account']))
|
||||
@php $account = $content['selected_account']; @endphp
|
||||
<div class="flex items-center gap-3 p-3 bg-green-50 border border-green-200 rounded-lg">
|
||||
<svg class="w-5 h-5 text-green-500 shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
|
||||
Reference in New Issue
Block a user