From ddf21992ffe3c0232b0b44ee88b7c45de534eaaf Mon Sep 17 00:00:00 2001 From: Methapon Metanipat Date: Wed, 25 Sep 2024 14:13:40 +0700 Subject: [PATCH 1/8] fix: get list with head --- src/pages/01_branch-management/MainPage.vue | 15 ++++++++------- src/stores/branch/index.ts | 1 + 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/pages/01_branch-management/MainPage.vue b/src/pages/01_branch-management/MainPage.vue index 04257224..52979cef 100644 --- a/src/pages/01_branch-management/MainPage.vue +++ b/src/pages/01_branch-management/MainPage.vue @@ -263,7 +263,7 @@ onMounted(async () => { // object, we are effectively unselecting any HQ branch. ]; - await fetchList({ pageSize: 99999, tree: true }); + await fetchList({ pageSize: 99999, tree: true, withHead: true }); await calculateStats(); modeView.value = $q.screen.lt.md ? true : false; @@ -641,7 +641,7 @@ async function triggerDelete(id: string) { const res = await branchStore.deleteById(id); if (res) { - await fetchList({ tree: true, pageSize: 99999 }); + await fetchList({ tree: true, pageSize: 99999, withHead: true }); modalDrawer.value = false; modal.value = false; await calculateStats(); @@ -705,13 +705,14 @@ async function fetchList(opts: { zipCode?: string; query?: string; tree?: boolean; + withHead?: boolean; filter?: 'head' | 'sub'; }) { await branchStore.fetchList(opts); } watch(inputSearch, () => { - fetchList({ tree: true, query: inputSearch.value }); + fetchList({ tree: true, query: inputSearch.value, withHead: true }); currentSubBranch.value = undefined; }); @@ -737,7 +738,7 @@ async function triggerChangeStatus( }); if (res) resolve(res); - await fetchList({ tree: true, pageSize: 99999 }); + await fetchList({ tree: true, pageSize: 99999, withHead: true }); }, cancel: () => {}, }); @@ -767,7 +768,7 @@ async function onSubmit(submitSelectedItem?: boolean) { formData.value.codeHeadOffice = formData.value.code = res.code; imageUrl.value = `${baseUrl}/branch/${res.id}/image/${res.selectedImage}`; - await fetchList({ tree: true, pageSize: 99999 }); + await fetchList({ tree: true, pageSize: 99999, withHead: true }); if (!imageDialog.value) modalDrawer.value = submitSelectedItem || false; } @@ -797,7 +798,7 @@ async function onSubmit(submitSelectedItem?: boolean) { formType.value = 'view'; } - await fetchList({ tree: true, pageSize: 99999 }); + await fetchList({ tree: true, pageSize: 99999, withHead: true }); }; if ( @@ -2069,7 +2070,7 @@ watch(currentHq, () => { formType = 'view'; } - await fetchList({ tree: true, pageSize: 99999 }); + await fetchList({ tree: true, pageSize: 99999, withHead: true }); } " :menu="formMenuIcon" diff --git a/src/stores/branch/index.ts b/src/stores/branch/index.ts index 20dcfc8a..1fb1e33c 100644 --- a/src/stores/branch/index.ts +++ b/src/stores/branch/index.ts @@ -35,6 +35,7 @@ const useBranchStore = defineStore('api-branch', () => { query?: string; tree?: boolean; filter?: 'head' | 'sub'; + withHead?: boolean; }, Data extends Pagination, >(opts?: Options): Promise { From f6df90021f6fafc69d4b4b6a8470e27a4909c04a Mon Sep 17 00:00:00 2001 From: Net Date: Wed, 25 Sep 2024 14:21:39 +0700 Subject: [PATCH 2/8] fix: Information is out of date --- src/pages/03_customer-management/MainPage.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/03_customer-management/MainPage.vue b/src/pages/03_customer-management/MainPage.vue index 0dfb37d4..32faead4 100644 --- a/src/pages/03_customer-management/MainPage.vue +++ b/src/pages/03_customer-management/MainPage.vue @@ -2221,7 +2221,7 @@ const emptyCreateDialog = ref(false); customerFormState.editCustomerId, ); - await fetchListCustomer(); + await fetchListCustomer(true); customerFormStore.resetForm(); } " From 613d233e8dabcf16b41eb2c0b180aef801bfe626 Mon Sep 17 00:00:00 2001 From: Methapon Metanipat Date: Wed, 25 Sep 2024 14:33:05 +0700 Subject: [PATCH 3/8] fix: error no branch created --- src/stores/user/index.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/stores/user/index.ts b/src/stores/user/index.ts index 9098808a..12c61ded 100644 --- a/src/stores/user/index.ts +++ b/src/stores/user/index.ts @@ -44,6 +44,7 @@ const useUserStore = defineStore('api-user', () => { const res = await branchStore.fetchList({ pageSize: 999, filter: 'head', + withHead: true, }); if (res) { res.result.map((item) => { From 133ede6a607e4341c5d1e0e0fa71f5a9f1186504 Mon Sep 17 00:00:00 2001 From: puriphatt Date: Wed, 25 Sep 2024 14:46:00 +0700 Subject: [PATCH 4/8] fix: comma & customer form --- .../components/employer/EmployerFormAbout.vue | 70 +++++++++---------- .../employer/EmployerFormBusiness.vue | 19 +++-- 2 files changed, 48 insertions(+), 41 deletions(-) diff --git a/src/pages/03_customer-management/components/employer/EmployerFormAbout.vue b/src/pages/03_customer-management/components/employer/EmployerFormAbout.vue index 0134a8e8..f74a5025 100644 --- a/src/pages/03_customer-management/components/employer/EmployerFormAbout.vue +++ b/src/pages/03_customer-management/components/employer/EmployerFormAbout.vue @@ -1,7 +1,7 @@