mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-20 17:54:30 +08:00
show "data is up to date" when the data is not updated in reconciliation statement page / dialog
This commit is contained in:
@@ -6,7 +6,7 @@
|
|||||||
<div class="d-flex w-100 align-center justify-center">
|
<div class="d-flex w-100 align-center justify-center">
|
||||||
<h4 class="text-h4">{{ tt('Reconciliation Statement') }}</h4>
|
<h4 class="text-h4">{{ tt('Reconciliation Statement') }}</h4>
|
||||||
<v-btn density="compact" color="default" variant="text" size="24"
|
<v-btn density="compact" color="default" variant="text" size="24"
|
||||||
class="ml-2" :icon="true" :loading="loading" @click="reload()">
|
class="ml-2" :icon="true" :loading="loading" @click="reload(true)">
|
||||||
<template #loader>
|
<template #loader>
|
||||||
<v-progress-circular indeterminate size="20"/>
|
<v-progress-circular indeterminate size="20"/>
|
||||||
</template>
|
</template>
|
||||||
@@ -226,6 +226,7 @@ import { TransactionType } from '@/core/transaction.ts';
|
|||||||
import { KnownFileType } from '@/core/file.ts';
|
import { KnownFileType } from '@/core/file.ts';
|
||||||
import { Transaction, type TransactionReconciliationStatementResponseItem } from '@/models/transaction.ts';
|
import { Transaction, type TransactionReconciliationStatementResponseItem } from '@/models/transaction.ts';
|
||||||
|
|
||||||
|
import { isEquals } from '@/lib/common.ts';
|
||||||
import { getCurrentUnixTime } from '@/lib/datetime.ts';
|
import { getCurrentUnixTime } from '@/lib/datetime.ts';
|
||||||
import { startDownloadFile } from '@/lib/ui/common.ts';
|
import { startDownloadFile } from '@/lib/ui/common.ts';
|
||||||
|
|
||||||
@@ -388,7 +389,7 @@ function open(options: { accountId: string, startTime: number, endTime: number }
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function reload(): void {
|
function reload(force: boolean): void {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
|
|
||||||
transactionsStore.getReconciliationStatements({
|
transactionsStore.getReconciliationStatements({
|
||||||
@@ -396,6 +397,14 @@ function reload(): void {
|
|||||||
startTime: startTime.value,
|
startTime: startTime.value,
|
||||||
endTime: endTime.value
|
endTime: endTime.value
|
||||||
}).then(result => {
|
}).then(result => {
|
||||||
|
if (force) {
|
||||||
|
if (isEquals(reconciliationStatements.value, result)) {
|
||||||
|
snackbar.value?.showMessage('Data is up to date');
|
||||||
|
} else {
|
||||||
|
snackbar.value?.showMessage('Data has been updated');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
reconciliationStatements.value = result;
|
reconciliationStatements.value = result;
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
@@ -415,7 +424,7 @@ function addTransaction(): void {
|
|||||||
snackbar.value?.showMessage(result.message);
|
snackbar.value?.showMessage(result.message);
|
||||||
}
|
}
|
||||||
|
|
||||||
reload();
|
reload(false);
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
if (error) {
|
if (error) {
|
||||||
snackbar.value?.showError(error);
|
snackbar.value?.showError(error);
|
||||||
@@ -469,7 +478,7 @@ function updateClosingBalance(): void {
|
|||||||
snackbar.value?.showMessage(result.message);
|
snackbar.value?.showMessage(result.message);
|
||||||
}
|
}
|
||||||
|
|
||||||
reload();
|
reload(false);
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
if (error) {
|
if (error) {
|
||||||
snackbar.value?.showError(error);
|
snackbar.value?.showError(error);
|
||||||
@@ -500,7 +509,7 @@ function showTransaction(transaction: TransactionReconciliationStatementResponse
|
|||||||
snackbar.value?.showMessage(result.message);
|
snackbar.value?.showMessage(result.message);
|
||||||
}
|
}
|
||||||
|
|
||||||
reload();
|
reload(false);
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
if (error) {
|
if (error) {
|
||||||
snackbar.value?.showError(error);
|
snackbar.value?.showError(error);
|
||||||
|
|||||||
@@ -292,7 +292,7 @@ import { TransactionType } from '@/core/transaction.ts';
|
|||||||
import { TRANSACTION_MIN_AMOUNT, TRANSACTION_MAX_AMOUNT } from '@/consts/transaction.ts';
|
import { TRANSACTION_MIN_AMOUNT, TRANSACTION_MAX_AMOUNT } from '@/consts/transaction.ts';
|
||||||
import { type TransactionReconciliationStatementResponseItem } from '@/models/transaction.ts';
|
import { type TransactionReconciliationStatementResponseItem } from '@/models/transaction.ts';
|
||||||
|
|
||||||
import { isDefined } from '@/lib/common.ts';
|
import { isDefined, isEquals } from '@/lib/common.ts';
|
||||||
import {
|
import {
|
||||||
getCurrentUnixTime,
|
getCurrentUnixTime,
|
||||||
getDateTypeByDateRange,
|
getDateTypeByDateRange,
|
||||||
@@ -481,7 +481,11 @@ function reload(force: boolean): void {
|
|||||||
endTime: endTime.value
|
endTime: endTime.value
|
||||||
}).then(result => {
|
}).then(result => {
|
||||||
if (force) {
|
if (force) {
|
||||||
showToast('Data has been updated');
|
if (isEquals(reconciliationStatements.value, result)) {
|
||||||
|
showToast('Data is up to date');
|
||||||
|
} else {
|
||||||
|
showToast('Data has been updated');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user