From 42e545dd661ceb51036407f9e9cf01d3819301b0 Mon Sep 17 00:00:00 2001 From: Thanaphon Frappet Date: Thu, 14 Aug 2025 11:07:01 +0700 Subject: [PATCH 1/6] fix: value option no set --- src/components/shared/select/select.ts | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/components/shared/select/select.ts b/src/components/shared/select/select.ts index 08fd88b2..cf1555cb 100644 --- a/src/components/shared/select/select.ts +++ b/src/components/shared/select/select.ts @@ -35,7 +35,13 @@ export const createSelect = >( let previousSearch = ''; watch(value, (v) => { - if (!v || (cache && cache.find((opt) => opt[valueField] === v))) return; + if (!v) return; + + if (cache && cache.find((opt) => opt[valueField] === v)) { + valueOption.value = cache.find((opt) => opt[valueField] === v); + return; + } + getSelectedOption(); }); @@ -63,7 +69,15 @@ export const createSelect = >( const currentValue = value.value; if (!currentValue) return; - if (selectOptions.value.find((v) => v[valueField] === currentValue)) return; + + const option = selectOptions.value.find( + (v) => v[valueField] === currentValue, + ); + + if (option) { + valueOption.value = option; + return; + } if (valueOption.value && valueOption.value[valueField] === currentValue) { return selectOptions.value.unshift(valueOption.value); } From b21949712bac4b17c7f13bccd521bff905912a2a Mon Sep 17 00:00:00 2001 From: Thanaphon Frappet Date: Thu, 14 Aug 2025 11:07:25 +0700 Subject: [PATCH 2/6] fix: handle show group name --- .../05_quotation/QuotationFormProductSelect.vue | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/pages/05_quotation/QuotationFormProductSelect.vue b/src/pages/05_quotation/QuotationFormProductSelect.vue index 39be19e7..b2e92761 100644 --- a/src/pages/05_quotation/QuotationFormProductSelect.vue +++ b/src/pages/05_quotation/QuotationFormProductSelect.vue @@ -51,6 +51,8 @@ const emit = defineEmits<{ const selectedProductGroup = defineModel('selectedProductGroup', { default: '', }); + +const selectedProductGroupOption = ref(); const model = defineModel(); const inputSearch = defineModel('inputSearch'); const productGroup = defineModel('productGroup', { @@ -569,14 +571,18 @@ watch( {{ productGroup.find( (g) => g.id === selectedProductGroup, - )?.name || '-' + )?.name || + selectedProductGroupOption?.name || + '-' }} {{ productGroup.find( (g) => g.id === selectedProductGroup, - )?.code || '-' + )?.code || + selectedProductGroupOption?.code || + '-' }} @@ -862,13 +868,13 @@ watch( {{ $t('productService.group.title') }} - From 473e272328aeab1b237899f214b22a29bf7692ba Mon Sep 17 00:00:00 2001 From: Methapon2001 <61303214+Methapon2001@users.noreply.github.com> Date: Tue, 19 Aug 2025 11:45:24 +0700 Subject: [PATCH 5/6] fix: error undefined --- src/pages/08_request-list/TableRequestList.vue | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pages/08_request-list/TableRequestList.vue b/src/pages/08_request-list/TableRequestList.vue index c147be95..631496d2 100644 --- a/src/pages/08_request-list/TableRequestList.vue +++ b/src/pages/08_request-list/TableRequestList.vue @@ -314,7 +314,7 @@ function handleCheckAll() { /> --> From b86891c8c2f09c1da2b7c50a04c90ac0c32e72cb Mon Sep 17 00:00:00 2001 From: Thanaphon Frappet Date: Wed, 20 Aug 2025 15:43:55 +0700 Subject: [PATCH 6/6] refactor: remove btn --- .../FormBranchInformation.vue | 36 ------------------- 1 file changed, 36 deletions(-) diff --git a/src/components/01_branch-management/FormBranchInformation.vue b/src/components/01_branch-management/FormBranchInformation.vue index 5a90d3f7..a4041333 100644 --- a/src/components/01_branch-management/FormBranchInformation.vue +++ b/src/components/01_branch-management/FormBranchInformation.vue @@ -159,42 +159,6 @@ function formatCode(input: string | undefined, type: 'code' | 'number') { ]" for="input-name-en" /> - - - -