diff --git a/src/components/03_customer-management/CustomerInfoComponent.vue b/src/components/03_customer-management/CustomerInfoComponent.vue index 646602d3..d9118c73 100644 --- a/src/components/03_customer-management/CustomerInfoComponent.vue +++ b/src/components/03_customer-management/CustomerInfoComponent.vue @@ -11,6 +11,7 @@ import { CustomerBranch, CustomerType } from 'src/stores/customer/types'; import BranchCardCustomer from 'components/03_customer-management/BranchCardCustomer.vue'; import PaginationComponent from 'src/components/PaginationComponent.vue'; import NoData from 'components/NoData.vue'; +import { QTableProps } from 'quasar'; const flowStore = useFlowStore(); @@ -29,6 +30,7 @@ const currentCustomerUrlImage = defineModel( const currentStatus = ref('All'); const totalBranch = ref(0); +const modeView = ref(false); const currentPageBranch = ref(1); const maxPageBranch = ref(1); const pageSizeBranch = ref(30); @@ -55,6 +57,57 @@ onMounted(async () => { await fetchList(); }); +const columns = [ + { + name: 'branchLabelName', + align: 'left', + label: 'office', + field: 'name', + sortable: true, + }, + { + name: 'branchLabelAddress', + align: 'left', + label: 'address', + field: 'address', + sortable: true, + }, + { + name: 'branchLabelTel', + align: 'left', + label: 'formDialogInputTelephone', + field: 'telephoneNo', + }, +] satisfies QTableProps['columns']; + +const fieldDisplay = ref< + ( + | 'branchName' + | 'customerBranchFormTab' + | 'address' + | 'telephone' + | 'businessTypePure' + | 'totalEmployee' + )[] +>([ + 'branchName', + 'customerBranchFormTab', + 'address', + 'telephone', + 'businessTypePure', + 'totalEmployee', +]); +const branchFieldSelected = ref< + ( + | 'customerBranchFormTab' + | 'branchName' + | 'address' + | 'telephone' + | 'businessTypePure' + | 'totalEmployee' + )[] +>(fieldDisplay.value); + async function fetchList() { const result = await fetchListCustomeBranch({ customerId: prop.customerId, @@ -76,180 +129,343 @@ async function fetchList() { } } -watch(inputSearch, async () => { - await fetchList(); -}); - -watch(currentStatus, async () => { +watch([inputSearch, currentStatus], async () => { await fetchList(); }); diff --git a/src/pages/03_customer-management/MainPage.vue b/src/pages/03_customer-management/MainPage.vue index 40bb731b..232c0e07 100644 --- a/src/pages/03_customer-management/MainPage.vue +++ b/src/pages/03_customer-management/MainPage.vue @@ -2908,7 +2908,7 @@ watch(isMainPage, () => { -
+