- 예산: 예상 수입을 해당 월별로 조회/저장(월 이동 시 갱신) - 계좌 관리: SortableJS 드래그 정렬(터치 지원), 타입별 순서 저장 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -86,17 +86,18 @@ const expectedIncome = ref(null)
|
||||
const incomeDraft = ref('')
|
||||
async function loadIncome() {
|
||||
try {
|
||||
const r = await accountApi.expectedIncome()
|
||||
const r = await accountApi.expectedIncome({ year: year.value, month: month.value })
|
||||
expectedIncome.value = r.expectedIncome
|
||||
incomeDraft.value = r.expectedIncome ?? ''
|
||||
} catch {
|
||||
expectedIncome.value = null
|
||||
incomeDraft.value = ''
|
||||
}
|
||||
}
|
||||
async function saveIncome() {
|
||||
try {
|
||||
const v = incomeDraft.value === '' || incomeDraft.value == null ? 0 : Number(incomeDraft.value)
|
||||
const r = await accountApi.setExpectedIncome(v)
|
||||
const r = await accountApi.setExpectedIncome({ year: year.value, month: month.value, expectedIncome: v })
|
||||
expectedIncome.value = r.expectedIncome
|
||||
} catch (e) {
|
||||
alert(e.response?.data?.message || '저장에 실패했습니다.')
|
||||
@@ -128,6 +129,7 @@ function prevMonth() {
|
||||
year.value -= 1
|
||||
} else month.value -= 1
|
||||
load()
|
||||
loadIncome()
|
||||
}
|
||||
function nextMonth() {
|
||||
if (month.value === 12) {
|
||||
@@ -135,6 +137,7 @@ function nextMonth() {
|
||||
year.value += 1
|
||||
} else month.value += 1
|
||||
load()
|
||||
loadIncome()
|
||||
}
|
||||
|
||||
function openCreate() {
|
||||
|
||||
Reference in New Issue
Block a user