refactor(01): dialog before submit (abbreviation alert) & i18n
This commit is contained in:
parent
10a54647af
commit
e38c76e7d3
6 changed files with 53 additions and 20 deletions
|
|
@ -491,7 +491,8 @@ async function triggerChangeStatus(
|
|||
return await new Promise((resolve) => {
|
||||
dialog({
|
||||
color: status !== 'INACTIVE' ? 'warning' : 'info',
|
||||
icon: status !== 'INACTIVE' ? 'mdi-alert' : 'mdi-comment-alert',
|
||||
icon:
|
||||
status !== 'INACTIVE' ? 'mdi-alert' : 'mdi-message-processing-outline',
|
||||
title: t('confirmChangeStatusTitle'),
|
||||
actionText:
|
||||
status !== 'INACTIVE' ? t('switchOffLabel') : t('switchOnLabel'),
|
||||
|
|
@ -532,27 +533,41 @@ async function onSubmit() {
|
|||
}
|
||||
|
||||
if (formType.value === 'create') {
|
||||
if (formTypeBranch.value === 'subBranch') {
|
||||
const currentRecord = branchData.value.result.find(
|
||||
(x) => x.id === formData.value.headOfficeId,
|
||||
);
|
||||
dialog({
|
||||
color: 'info',
|
||||
icon: 'mdi-message-processing-outline',
|
||||
message: t('form.info.cantChange', {
|
||||
field: t('formDialogHqAbbreviation'),
|
||||
name: formData.value.code,
|
||||
}),
|
||||
actionText: t('agree'),
|
||||
persistent: true,
|
||||
title: t('form.warning.title'),
|
||||
cancel: () => {},
|
||||
action: async () => {
|
||||
if (formTypeBranch.value === 'subBranch') {
|
||||
const currentRecord = branchData.value.result.find(
|
||||
(x) => x.id === formData.value.headOfficeId,
|
||||
);
|
||||
|
||||
formData.value.headOfficeId = currentRecord?.id;
|
||||
formData.value.code = formData.value.code?.slice(0, -6);
|
||||
delete formData.value['codeHeadOffice'];
|
||||
}
|
||||
formData.value.headOfficeId = currentRecord?.id;
|
||||
formData.value.code = formData.value.code?.slice(0, -6);
|
||||
delete formData.value['codeHeadOffice'];
|
||||
}
|
||||
|
||||
await branchStore.create(
|
||||
{
|
||||
...formData.value,
|
||||
qrCodeImage: profileFile.value,
|
||||
imageUrl: profileFileImg.value,
|
||||
await branchStore.create(
|
||||
{
|
||||
...formData.value,
|
||||
qrCodeImage: profileFile.value,
|
||||
imageUrl: profileFileImg.value,
|
||||
},
|
||||
formBankBook.value,
|
||||
);
|
||||
|
||||
await branchStore.fetchList({ pageSize: 99999 });
|
||||
modal.value = false;
|
||||
},
|
||||
formBankBook.value,
|
||||
);
|
||||
|
||||
await branchStore.fetchList({ pageSize: 99999 });
|
||||
modal.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
const _stats = await branchStore.stats();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue