mirror of
https://github.com/frappe/books.git
synced 2025-02-03 04:28:32 +00:00
fix(ux): add save button to CoA
This commit is contained in:
parent
1be67fd560
commit
7480763744
@ -96,16 +96,27 @@
|
|||||||
:ref="account.name"
|
:ref="account.name"
|
||||||
@keydown.esc="cancelAddingAccount(account)"
|
@keydown.esc="cancelAddingAccount(account)"
|
||||||
@keydown.enter="
|
@keydown.enter="
|
||||||
(e) =>
|
(e) => createNewAccount(account, account.addingGroupAccount)
|
||||||
createNewAccount(
|
|
||||||
e.target.value,
|
|
||||||
account,
|
|
||||||
account.addingGroupAccount
|
|
||||||
)
|
|
||||||
"
|
"
|
||||||
type="text"
|
type="text"
|
||||||
|
v-model="newAccountName"
|
||||||
:disabled="insertingAccount"
|
:disabled="insertingAccount"
|
||||||
|
|
||||||
/>
|
/>
|
||||||
|
<button
|
||||||
|
v-if="!insertingAccount"
|
||||||
|
class="
|
||||||
|
ml-4
|
||||||
|
text-xs text-gray-800
|
||||||
|
hover:text-gray-900
|
||||||
|
focus:outline-none
|
||||||
|
"
|
||||||
|
@click="
|
||||||
|
(e) => createNewAccount(account, account.addingGroupAccount)
|
||||||
|
"
|
||||||
|
>
|
||||||
|
{{ t`Save` }}
|
||||||
|
</button>
|
||||||
<button
|
<button
|
||||||
v-if="!insertingAccount"
|
v-if="!insertingAccount"
|
||||||
class="
|
class="
|
||||||
@ -143,6 +154,7 @@ export default {
|
|||||||
root: null,
|
root: null,
|
||||||
accounts: [],
|
accounts: [],
|
||||||
schemaName: 'Account',
|
schemaName: 'Account',
|
||||||
|
newAccountName: '',
|
||||||
insertingAccount: false,
|
insertingAccount: false,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@ -233,12 +245,13 @@ export default {
|
|||||||
cancelAddingAccount(parentAccount) {
|
cancelAddingAccount(parentAccount) {
|
||||||
parentAccount.addingAccount = 0;
|
parentAccount.addingAccount = 0;
|
||||||
parentAccount.addingGroupAccount = 0;
|
parentAccount.addingGroupAccount = 0;
|
||||||
|
this.newAccountName = '';
|
||||||
},
|
},
|
||||||
async createNewAccount(accountName, parentAccount, isGroup) {
|
async createNewAccount(parentAccount, isGroup) {
|
||||||
// freeze input
|
// freeze input
|
||||||
this.insertingAccount = true;
|
this.insertingAccount = true;
|
||||||
|
|
||||||
accountName = accountName.trim();
|
const accountName = this.newAccountName.trim();
|
||||||
let account = await fyo.doc.getNewDoc('Account');
|
let account = await fyo.doc.getNewDoc('Account');
|
||||||
try {
|
try {
|
||||||
let { name, rootType, accountType } = parentAccount;
|
let { name, rootType, accountType } = parentAccount;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user