mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-19 01:04:25 +08:00
optimize user experience
This commit is contained in:
@@ -237,13 +237,22 @@
|
||||
export default {
|
||||
data() {
|
||||
const self = this;
|
||||
const query = self.$f7route.query;
|
||||
const now = new Date();
|
||||
|
||||
let defaultType = self.$constants.transaction.allTransactionTypes.Expense;
|
||||
|
||||
if (query.type === self.$constants.transaction.allTransactionTypes.Income.toString()) {
|
||||
defaultType = self.$constants.transaction.allTransactionTypes.Income;
|
||||
} else if (query.type === self.$constants.transaction.allTransactionTypes.Transfer.toString()) {
|
||||
defaultType = self.$constants.transaction.allTransactionTypes.Transfer;
|
||||
}
|
||||
|
||||
return {
|
||||
mode: 'add',
|
||||
editTransactionId: null,
|
||||
transaction: {
|
||||
type: self.$constants.transaction.allTransactionTypes.Expense,
|
||||
type: defaultType,
|
||||
unixTime: self.$utilities.getUnixTime(now),
|
||||
time: self.$utilities.formatDate(now, 'YYYY-MM-DDTHH:mm'),
|
||||
expenseCategory: '',
|
||||
|
||||
Reference in New Issue
Block a user