refactor: use new select product group

#151
This commit is contained in:
Thanaphon Frappet 2024-12-23 14:08:19 +07:00
parent 9f29ce7887
commit 3d89ce5a88
2 changed files with 135 additions and 35 deletions

View file

@ -7,6 +7,7 @@ import DialogForm from 'src/components/DialogForm.vue';
import TreeView from 'src/components/shared/TreeView.vue';
import SelectZone from 'src/components/shared/SelectZone.vue';
import SelectInput from 'src/components/shared/SelectInput.vue';
import SelectProductGroup from 'src/components/shared/select/SelectProductGroup.vue';
import TotalProductCardComponent from 'src/components/04_product-service/TotalProductCardComponent.vue';
import DeleteButton from 'src/components/button/DeleteButton.vue';
import { isRoleInclude } from 'src/stores/utils';
@ -839,8 +840,13 @@ watch(
<template #top>
<div class="row items-center app-text-muted">
{{ $t('productService.group.title') }}
<SelectInput
<SelectProductGroup
class="q-pl-sm col-5"
id="product-group-select"
style="min-height: 50px"
clearable
v-model:value="selectedProductGroup"
:placeholder="
!selectedProductGroup
? $t('general.select', {
@ -848,40 +854,10 @@ watch(
})
: ''
"
v-model="selectedProductGroup"
clearable
optionLabel="name"
optionValue="id"
class="q-pl-sm col-5"
:fillInput="false"
:hide-selected="false"
:option="productGroup"
style="min-height: 50px"
>
<template #option="{ scope }">
<q-item
v-if="scope.opt"
v-bind="scope.itemProps"
class="row items-center"
>
<q-item-section>
{{ scope.opt.name }}
<span class="app-text-muted text-caption">
{{ scope.opt.code }}
</span>
</q-item-section>
</q-item>
</template>
<template #selected-item="{ scope }">
<q-item-section v-if="scope.opt">
{{ scope.opt.name }}
<span class="app-text-muted text-caption">
{{ scope.opt.code }}
</span>
</q-item-section>
</template>
</SelectInput>
:params="{
activeOnly: true,
}"
/>
</div>
</template>