diff --git a/src/pages/01_branch-management/MainPage.vue b/src/pages/01_branch-management/MainPage.vue index ef4acc82..83ddc3c6 100644 --- a/src/pages/01_branch-management/MainPage.vue +++ b/src/pages/01_branch-management/MainPage.vue @@ -6,7 +6,7 @@ import { Icon } from '@iconify/vue'; import { BranchContact } from 'stores/branch-contact/types'; import { useQuasar } from 'quasar'; import { useI18n } from 'vue-i18n'; -import type { QSelect, QTableProps, QTableSlots } from 'quasar'; +import type { QTableProps, QTableSlots } from 'quasar'; import { resetScrollBar } from 'src/stores/utils'; import useBranchStore from 'stores/branch'; import useFlowStore from 'stores/flow'; @@ -52,6 +52,7 @@ import { UndoButton, } from 'components/button'; import { useNavigator } from 'src/stores/navigator'; +import AdvanceSearch from 'src/components/shared/AdvanceSearch.vue'; const $q = useQuasar(); const { t } = useI18n(); @@ -72,7 +73,6 @@ const typeBranchItem = [ color: 'var(--blue-6-hsl)', }, ]; -const refFilter = ref>(); const holdDialog = ref(false); const isSubCreate = ref(false); const columns = [ @@ -175,6 +175,8 @@ const qrCodeDialog = ref(false); const qrCodeimageUrl = ref(''); const formLastSubBranch = ref(0); +const searchDate = ref([]); + const branchStore = useBranchStore(); const flowStore = useFlowStore(); const { locale } = useI18n(); @@ -715,12 +717,20 @@ async function fetchList(opts: { tree?: boolean; withHead?: boolean; filter?: 'head' | 'sub'; + startDate?: string; + endDate?: string; }) { await branchStore.fetchList(opts); } -watch(inputSearch, () => { - fetchList({ tree: true, query: inputSearch.value, withHead: true }); +watch([inputSearch, searchDate], () => { + fetchList({ + tree: true, + query: inputSearch.value, + withHead: true, + startDate: searchDate.value[0], + endDate: searchDate.value[1], + }); currentSubBranch.value = undefined; }); @@ -1170,26 +1180,49 @@ watch(currentHq, () => { -
{ withHead?: boolean; activeOnly?: boolean; headOfficeId?: string; + startDate?: string; + endDate?: string; }, Data extends Pagination, >(opts?: Options): Promise {