fix(01): remove sub branch submit abbreviation dialog
This commit is contained in:
parent
ab0abac873
commit
a53fad7aeb
1 changed files with 43 additions and 40 deletions
|
|
@ -534,41 +534,46 @@ async function onSubmit() {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (formType.value === 'create') {
|
if (formType.value === 'create') {
|
||||||
dialog({
|
const createBranch = async () => {
|
||||||
color: 'info',
|
await branchStore.create(
|
||||||
icon: 'mdi-message-processing-outline',
|
{
|
||||||
message: t('form.info.cantChange', {
|
...formData.value,
|
||||||
field: t('formDialogHqAbbreviation'),
|
qrCodeImage: profileFile.value,
|
||||||
name: formData.value.code,
|
imageUrl: profileFileImg.value,
|
||||||
}),
|
},
|
||||||
actionText: t('agree'),
|
formBankBook.value,
|
||||||
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;
|
await branchStore.fetchList({ pageSize: 99999 });
|
||||||
formData.value.code = formData.value.code?.slice(0, -6);
|
modal.value = false;
|
||||||
delete formData.value['codeHeadOffice'];
|
};
|
||||||
}
|
|
||||||
|
|
||||||
await branchStore.create(
|
if (formTypeBranch.value === 'subBranch') {
|
||||||
{
|
const currentRecord = branchData.value.result.find(
|
||||||
...formData.value,
|
(x) => x.id === formData.value.headOfficeId,
|
||||||
qrCodeImage: profileFile.value,
|
);
|
||||||
imageUrl: profileFileImg.value,
|
|
||||||
},
|
|
||||||
formBankBook.value,
|
|
||||||
);
|
|
||||||
|
|
||||||
await branchStore.fetchList({ pageSize: 99999 });
|
formData.value.headOfficeId = currentRecord?.id;
|
||||||
modal.value = false;
|
formData.value.code = formData.value.code?.slice(0, -6);
|
||||||
},
|
delete formData.value['codeHeadOffice'];
|
||||||
});
|
await createBranch();
|
||||||
|
} else {
|
||||||
|
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 () => {
|
||||||
|
await createBranch();
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const _stats = await branchStore.stats();
|
const _stats = await branchStore.stats();
|
||||||
|
|
@ -852,10 +857,11 @@ watch(currentHq, () => {
|
||||||
@edit="
|
@edit="
|
||||||
(v) => {
|
(v) => {
|
||||||
if (v.isHeadOffice) {
|
if (v.isHeadOffice) {
|
||||||
triggerEdit('form', v.id, 'headOffice', v.code);
|
triggerEdit('drawer', v.id, 'headOffice', v.code);
|
||||||
} else {
|
} else {
|
||||||
triggerEdit('form', v.id, 'subBranch');
|
triggerEdit('drawer', v.id, 'subBranch');
|
||||||
}
|
}
|
||||||
|
formType = 'edit';
|
||||||
}
|
}
|
||||||
"
|
"
|
||||||
@delete="
|
@delete="
|
||||||
|
|
@ -1237,15 +1243,14 @@ watch(currentHq, () => {
|
||||||
'headOffice',
|
'headOffice',
|
||||||
props.row.code,
|
props.row.code,
|
||||||
);
|
);
|
||||||
formType = 'edit';
|
|
||||||
} else {
|
} else {
|
||||||
await triggerEdit(
|
await triggerEdit(
|
||||||
'drawer',
|
'drawer',
|
||||||
props.row.id,
|
props.row.id,
|
||||||
'subBranch',
|
'subBranch',
|
||||||
);
|
);
|
||||||
formType = 'edit';
|
|
||||||
}
|
}
|
||||||
|
formType = 'edit';
|
||||||
}
|
}
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
|
|
@ -1449,15 +1454,14 @@ watch(currentHq, () => {
|
||||||
'headOffice',
|
'headOffice',
|
||||||
props.row.code,
|
props.row.code,
|
||||||
);
|
);
|
||||||
formType = 'edit';
|
|
||||||
} else {
|
} else {
|
||||||
await triggerEdit(
|
await triggerEdit(
|
||||||
'drawer',
|
'drawer',
|
||||||
props.row.id,
|
props.row.id,
|
||||||
'subBranch',
|
'subBranch',
|
||||||
);
|
);
|
||||||
formType = 'edit';
|
|
||||||
}
|
}
|
||||||
|
formType = 'edit';
|
||||||
}
|
}
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
|
|
@ -1999,12 +2003,11 @@ watch(currentHq, () => {
|
||||||
'headOffice',
|
'headOffice',
|
||||||
currentNode.code,
|
currentNode.code,
|
||||||
);
|
);
|
||||||
formType = 'edit';
|
|
||||||
} else {
|
} else {
|
||||||
currentNode &&
|
currentNode &&
|
||||||
triggerEdit('drawer', currentNode.id, 'subBranch');
|
triggerEdit('drawer', currentNode.id, 'subBranch');
|
||||||
formType = 'edit';
|
|
||||||
}
|
}
|
||||||
|
formType = 'edit';
|
||||||
}
|
}
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue