From 790c45e532823393e97c7b1410c3853c844127b4 Mon Sep 17 00:00:00 2001 From: Thanaphon Frappet Date: Thu, 30 Jan 2025 16:40:35 +0700 Subject: [PATCH] refactor: add params for debit note --- src/components/11_credit-note/FormCredit.vue | 3 +++ src/components/12_debit-note/FormDebit.vue | 3 +++ src/components/shared/select/SelectQuotation.vue | 3 ++- src/stores/quotations/index.ts | 1 + 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/components/11_credit-note/FormCredit.vue b/src/components/11_credit-note/FormCredit.vue index 68bb7ab2..d08c96dc 100644 --- a/src/components/11_credit-note/FormCredit.vue +++ b/src/components/11_credit-note/FormCredit.vue @@ -32,6 +32,9 @@ const quotationId = defineModel('quotationId', { class="col" v-model:value="quotationId" :label="$t('general.select', { msg: $t('quotation.title') })" + :params="{ + hasCancel: true, + }" /> diff --git a/src/components/12_debit-note/FormDebit.vue b/src/components/12_debit-note/FormDebit.vue index 1aa8e421..60bf596f 100644 --- a/src/components/12_debit-note/FormDebit.vue +++ b/src/components/12_debit-note/FormDebit.vue @@ -32,6 +32,9 @@ const quotationId = defineModel('quotationId', { class="col" v-model:value="quotationId" :label="$t('general.select', { msg: $t('quotation.title') })" + :params="{ + forDebitNote: true, + }" /> diff --git a/src/components/shared/select/SelectQuotation.vue b/src/components/shared/select/SelectQuotation.vue index 049e043e..15dfb89c 100644 --- a/src/components/shared/select/SelectQuotation.vue +++ b/src/components/shared/select/SelectQuotation.vue @@ -47,7 +47,6 @@ const { getOptions, setFirstValue, getSelectedOption, filter } = query, ...props.params, pageSize: 30, - hasCancel: true, includeRegisteredBranch: true, }); if (ret) return ret.result; @@ -151,6 +150,7 @@ function setDefaultValue() { class="surface-3 q-ml-sm" rounded style="color: var(--foreground)" + v-if="props.params?.hasCancel" > {{ scope.opt._count.canceledWork || 0 }} @@ -191,6 +191,7 @@ function setDefaultValue() { class="surface-3 q-ml-xs" rounded style="color: var(--foreground)" + v-if="props.params?.hasCancel" > {{ scope.opt._count.canceledWork || 0 }} diff --git a/src/stores/quotations/index.ts b/src/stores/quotations/index.ts index 775dc7ac..cb32cb6a 100644 --- a/src/stores/quotations/index.ts +++ b/src/stores/quotations/index.ts @@ -71,6 +71,7 @@ export const useQuotationStore = defineStore('quotation-store', () => { query?: string; hasCancel?: boolean; includeRegisteredBranch?: boolean; + forDebitNote?: boolean; }) { const res = await api.get>('/quotation', { params,