refactor: add params for debit note

This commit is contained in:
Thanaphon Frappet 2025-01-30 16:40:35 +07:00
parent c6b6f402a2
commit 790c45e532
4 changed files with 9 additions and 1 deletions

View file

@ -32,6 +32,9 @@ const quotationId = defineModel<string>('quotationId', {
class="col"
v-model:value="quotationId"
:label="$t('general.select', { msg: $t('quotation.title') })"
:params="{
hasCancel: true,
}"
/>
</section>
</div>

View file

@ -32,6 +32,9 @@ const quotationId = defineModel<string>('quotationId', {
class="col"
v-model:value="quotationId"
:label="$t('general.select', { msg: $t('quotation.title') })"
:params="{
forDebitNote: true,
}"
/>
</section>
</div>

View file

@ -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 }}
</q-badge>
@ -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 }}
</q-badge>

View file

@ -71,6 +71,7 @@ export const useQuotationStore = defineStore('quotation-store', () => {
query?: string;
hasCancel?: boolean;
includeRegisteredBranch?: boolean;
forDebitNote?: boolean;
}) {
const res = await api.get<PaginationResult<Quotation>>('/quotation', {
params,