feat: add date range search functionality to quotation management
This commit is contained in:
parent
36cef7ceb6
commit
7897103a1b
2 changed files with 19 additions and 4 deletions
|
|
@ -49,6 +49,7 @@ import { Quotation } from 'src/stores/quotations/types';
|
||||||
import TableQuotation from 'src/components/05_quotation/TableQuotation.vue';
|
import TableQuotation from 'src/components/05_quotation/TableQuotation.vue';
|
||||||
import PaginationPageSize from 'src/components/PaginationPageSize.vue';
|
import PaginationPageSize from 'src/components/PaginationPageSize.vue';
|
||||||
import { DialogContainer, DialogHeader } from 'src/components/dialog';
|
import { DialogContainer, DialogHeader } from 'src/components/dialog';
|
||||||
|
import AdvanceSearch from 'src/components/shared/AdvanceSearch.vue';
|
||||||
|
|
||||||
const { t, locale } = useI18n();
|
const { t, locale } = useI18n();
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
|
|
@ -109,6 +110,7 @@ const pageState = reactive({
|
||||||
quotationModal: false,
|
quotationModal: false,
|
||||||
employeeModal: false,
|
employeeModal: false,
|
||||||
receiptModal: false,
|
receiptModal: false,
|
||||||
|
searchDate: [],
|
||||||
});
|
});
|
||||||
|
|
||||||
pageState.fieldSelected = [...columnQuotation.map((v) => v.name)];
|
pageState.fieldSelected = [...columnQuotation.map((v) => v.name)];
|
||||||
|
|
@ -327,6 +329,8 @@ async function fetchQuotationList(mobileFetch?: boolean) {
|
||||||
: 'Issued',
|
: 'Issued',
|
||||||
query: pageState.inputSearch,
|
query: pageState.inputSearch,
|
||||||
urgentFirst: true,
|
urgentFirst: true,
|
||||||
|
startDate: pageState.searchDate[0],
|
||||||
|
endDate: pageState.searchDate[1],
|
||||||
});
|
});
|
||||||
|
|
||||||
if (ret) {
|
if (ret) {
|
||||||
|
|
@ -350,7 +354,12 @@ async function fetchQuotationList(mobileFetch?: boolean) {
|
||||||
}
|
}
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
[() => pageState.currentTab, () => pageState.inputSearch, quotationPageSize],
|
[
|
||||||
|
() => pageState.currentTab,
|
||||||
|
() => pageState.inputSearch,
|
||||||
|
() => pageState.searchDate,
|
||||||
|
quotationPageSize,
|
||||||
|
],
|
||||||
() => {
|
() => {
|
||||||
quotationPage.value = 1;
|
quotationPage.value = 1;
|
||||||
quotationData.value = [];
|
quotationData.value = [];
|
||||||
|
|
@ -517,6 +526,10 @@ async function storeDataLocal(id: string) {
|
||||||
<template #prepend>
|
<template #prepend>
|
||||||
<q-icon name="mdi-magnify" />
|
<q-icon name="mdi-magnify" />
|
||||||
</template>
|
</template>
|
||||||
|
<template v-slot:append>
|
||||||
|
<q-separator vertical inset class="q-mr-xs" />
|
||||||
|
<AdvanceSearch v-model="pageState.searchDate" />
|
||||||
|
</template>
|
||||||
</q-input>
|
</q-input>
|
||||||
|
|
||||||
<div class="row col-md-5 justify-end" style="white-space: nowrap">
|
<div class="row col-md-5 justify-end" style="white-space: nowrap">
|
||||||
|
|
@ -1126,13 +1139,13 @@ async function storeDataLocal(id: string) {
|
||||||
id="form-basic-info-customer"
|
id="form-basic-info-customer"
|
||||||
:onCreate="customerFormState.dialogType === 'create'"
|
:onCreate="customerFormState.dialogType === 'create'"
|
||||||
@edit="
|
@edit="
|
||||||
(customerFormState.dialogType = 'edit'),
|
((customerFormState.dialogType = 'edit'),
|
||||||
(customerFormState.readonly = false)
|
(customerFormState.readonly = false))
|
||||||
"
|
"
|
||||||
@cancel="() => customerFormUndo(false)"
|
@cancel="() => customerFormUndo(false)"
|
||||||
@delete="
|
@delete="
|
||||||
customerFormState.editCustomerId &&
|
customerFormState.editCustomerId &&
|
||||||
deleteCustomerById(customerFormState.editCustomerId)
|
deleteCustomerById(customerFormState.editCustomerId)
|
||||||
"
|
"
|
||||||
:customer-type="customerFormData.customerType"
|
:customer-type="customerFormData.customerType"
|
||||||
v-model:registered-branch-id="customerFormData.registeredBranchId"
|
v-model:registered-branch-id="customerFormData.registeredBranchId"
|
||||||
|
|
|
||||||
|
|
@ -76,6 +76,8 @@ export const useQuotationStore = defineStore('quotation-store', () => {
|
||||||
includeRegisteredBranch?: boolean;
|
includeRegisteredBranch?: boolean;
|
||||||
forDebitNote?: boolean;
|
forDebitNote?: boolean;
|
||||||
cancelIncludeDebitNote?: boolean;
|
cancelIncludeDebitNote?: boolean;
|
||||||
|
startDate?: string;
|
||||||
|
endDate?: string;
|
||||||
}) {
|
}) {
|
||||||
const res = await api.get<PaginationResult<Quotation>>('/quotation', {
|
const res = await api.get<PaginationResult<Quotation>>('/quotation', {
|
||||||
params,
|
params,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue