refactor: edit createBranch
This commit is contained in:
parent
a3f923d857
commit
0794bd4448
1 changed files with 4 additions and 8 deletions
|
|
@ -650,8 +650,6 @@ async function triggerDelete(id: string) {
|
|||
action: async () => {
|
||||
const res = await branchStore.deleteById(id);
|
||||
|
||||
console.log(res);
|
||||
|
||||
if (res) {
|
||||
await fetchList({ tree: true, pageSize: 99999 });
|
||||
modalDrawer.value = false;
|
||||
|
|
@ -785,11 +783,6 @@ async function onSubmit(submitSelectedItem?: boolean) {
|
|||
}
|
||||
|
||||
if (formType.value === 'create') {
|
||||
if (formData.value.headOfficeId !== undefined) {
|
||||
formData.value.code = formData.value?.code?.slice(0, -5);
|
||||
formData.value.codeHeadOffice = formData.value?.codeHeadOffice?.slice(-5);
|
||||
}
|
||||
|
||||
const createBranch = async () => {
|
||||
const res = await branchStore.create(
|
||||
{
|
||||
|
|
@ -816,7 +809,10 @@ async function onSubmit(submitSelectedItem?: boolean) {
|
|||
await fetchList({ tree: true, pageSize: 99999 });
|
||||
};
|
||||
|
||||
if (formTypeBranch.value === 'subBranch') {
|
||||
if (
|
||||
formTypeBranch.value === 'subBranch' ||
|
||||
formTypeBranch.value === 'branchVirtual'
|
||||
) {
|
||||
const currentRecord = branchData.value.result.find(
|
||||
(x) => x.id === formData.value.headOfficeId,
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue