support setting the time of the initial balance when creating a new account

This commit is contained in:
MaysWind
2024-11-11 01:27:44 +08:00
parent 06b4960984
commit bff6ca7e9d
10 changed files with 130 additions and 10 deletions
@@ -126,7 +126,8 @@
</template>
</v-autocomplete>
</v-col>
<v-col cols="12" md="12" v-if="account.type === allAccountTypes.SingleAccount || currentAccountIndex >= 0">
<v-col cols="12" :md="!editAccountId && selectedAccount.balance ? 6 : 12"
v-if="account.type === allAccountTypes.SingleAccount || currentAccountIndex >= 0">
<amount-input :disabled="loading || submitting || !!editAccountId"
:persistent-placeholder="true"
:currency="selectedAccount.currency"
@@ -134,6 +135,14 @@
:placeholder="currentAccountIndex < 0 ? $t('Account Balance') : $t('Sub-account Balance')"
v-model="selectedAccount.balance"/>
</v-col>
<v-col cols="12" md="6" v-show="selectedAccount.balance"
v-if="!editAccountId && (account.type === allAccountTypes.SingleAccount || currentAccountIndex >= 0)">
<date-time-select
:disabled="loading || submitting"
:label="$t('Balance Time')"
v-model="selectedAccount.balanceTime"
@error="showDateTimeError" />
</v-col>
<v-col cols="12" md="12">
<v-textarea
type="text"
@@ -452,6 +461,9 @@ export default {
this.subAccounts.push(subAccount);
}
}
},
showDateTimeError(error) {
this.$refs.snackbar.showError(error);
}
}
}