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" class="col"
v-model:value="quotationId" v-model:value="quotationId"
:label="$t('general.select', { msg: $t('quotation.title') })" :label="$t('general.select', { msg: $t('quotation.title') })"
:params="{
hasCancel: true,
}"
/> />
</section> </section>
</div> </div>

View file

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

View file

@ -47,7 +47,6 @@ const { getOptions, setFirstValue, getSelectedOption, filter } =
query, query,
...props.params, ...props.params,
pageSize: 30, pageSize: 30,
hasCancel: true,
includeRegisteredBranch: true, includeRegisteredBranch: true,
}); });
if (ret) return ret.result; if (ret) return ret.result;
@ -151,6 +150,7 @@ function setDefaultValue() {
class="surface-3 q-ml-sm" class="surface-3 q-ml-sm"
rounded rounded
style="color: var(--foreground)" style="color: var(--foreground)"
v-if="props.params?.hasCancel"
> >
{{ scope.opt._count.canceledWork || 0 }} {{ scope.opt._count.canceledWork || 0 }}
</q-badge> </q-badge>
@ -191,6 +191,7 @@ function setDefaultValue() {
class="surface-3 q-ml-xs" class="surface-3 q-ml-xs"
rounded rounded
style="color: var(--foreground)" style="color: var(--foreground)"
v-if="props.params?.hasCancel"
> >
{{ scope.opt._count.canceledWork || 0 }} {{ scope.opt._count.canceledWork || 0 }}
</q-badge> </q-badge>

View file

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