fix(account): 출금 계좌 종류 — 카드는 지출일 때만 노출
Deploy / deploy (push) Failing after 15m27s

수입·이체·상환은 카드/대출에서 나가지 않으므로 카드 제외(대출은 이미 제외).
구분 변경 시 허용 안 되는 계좌 종류면 초기화. AccountView·RecurringView 동일 적용.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
sb
2026-07-06 23:16:03 +09:00
parent 810a5d9380
commit 1b2d6a2c02
2 changed files with 27 additions and 5 deletions
+12 -2
View File
@@ -61,6 +61,10 @@ const WALLET_KINDS = [
]
const walletsOfKind = computed(() => wallets.value.filter((w) => w.type === form.walletKind))
const toWalletsOfKind = computed(() => wallets.value.filter((w) => w.type === form.toWalletKind))
// 출금 계좌 종류: 카드는 '지출'(카드결제)일 때만. 수입·이체는 카드에서 나가지 않음
const fromWalletKinds = computed(() =>
WALLET_KINDS.filter((k) => k.value !== 'CARD' || form.type === 'EXPENSE'),
)
// 계좌 선택 칩 옵션
function walletOpts(list) {
return list.map((w) => ({ value: w.id, label: `${w.name}${w.issuer ? ` (${w.issuer})` : ''}` }))
@@ -73,7 +77,13 @@ function walletKindOf(id) {
}
function onWalletKindChange() { form.walletId = '' }
function onToWalletKindChange() { form.toWalletId = '' }
function onTypeChange() { form.category = '' }
function onTypeChange() {
form.category = ''
if (!fromWalletKinds.value.some((k) => k.value === form.walletKind)) {
form.walletKind = ''
form.walletId = ''
}
}
function won(n) { return (n ?? 0).toLocaleString('ko-KR') }
function typeLabel(t) {
@@ -295,7 +305,7 @@ onMounted(load)
<span class="field-label">{{ form.type === 'TRANSFER' ? '출금 계좌' : '계좌/카드' }}</span>
<div class="wallet-chips">
<button
v-for="k in WALLET_KINDS" :key="k.value"
v-for="k in fromWalletKinds" :key="k.value"
type="button" class="chip" :class="{ active: form.walletKind === k.value }"
:disabled="submitting"
@click="form.walletKind = k.value; onWalletKindChange()"