feat: refs #7006 itemType basic data new inputs
gitea/salix-front/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Guillermo Bonet 2024-10-25 13:46:36 +02:00
parent 57a3504a7f
commit 8edba36a74
3 changed files with 41 additions and 1 deletions

View File

@ -8,12 +8,14 @@ import FormModel from 'components/FormModel.vue';
import VnRow from 'components/ui/VnRow.vue';
import VnInput from 'src/components/common/VnInput.vue';
import VnSelect from 'src/components/common/VnSelect.vue';
import VnAvatar from 'src/components/ui/VnAvatar.vue';
const route = useRoute();
const { t } = useI18n();
const categoriesOptions = ref([]);
const temperaturesOptions = ref([]);
const itemPackingTypesOptions = ref([]);
</script>
<template>
<FetchData
@ -28,6 +30,16 @@ const temperaturesOptions = ref([]);
:filter="{ order: 'name ASC', fields: ['code', 'name'] }"
auto-load
/>
<FetchData
url="ItemPackingTypes"
@on-fetch="(data) => (itemPackingTypesOptions = data)"
:filter="{
where: { isActive: true },
order: 'description ASC',
fields: ['code', 'description'],
}"
auto-load
/>
<FormModel
:url="`ItemTypes/${route.params.id}`"
:url-update="`ItemTypes/${route.params.id}`"
@ -50,7 +62,15 @@ const temperaturesOptions = ref([]);
option-label="nickname"
option-value="id"
hide-selected
><template #option="scope">
>
<template #prepend>
<VnAvatar
:worker-id="data.workerFk"
color="primary"
:title="title"
/>
</template>
<template #option="scope">
<QItem v-bind="scope.itemProps">
<QItemSection>
<QItemLabel>{{ scope.opt?.name }}</QItemLabel>
@ -82,6 +102,20 @@ const temperaturesOptions = ref([]);
/>
<VnInput v-model="data.life" :label="t('shared.life')" />
</VnRow>
<VnRow>
<VnSelect
v-model="data.itemPackingTypeFk"
:label="t('shared.itemPackingType')"
:options="itemPackingTypesOptions"
option-value="code"
option-label="description"
hide-selected
/>
<VnInput v-model="data.maxRefs" :label="t('shared.maxRefs')" />
</VnRow>
<VnRow>
<QCheckbox v-model="data.isFragile" :label="t('shared.fragile')" />
</VnRow>
</template>
</FormModel>
</template>

View File

@ -5,6 +5,9 @@ shared:
category: Category
temperature: Temperature
life: Life
itemPackingType: Item packing type
maxRefs: Maximum references
fragile: Fragile
summary:
id: id
life: Life

View File

@ -5,6 +5,9 @@ shared:
category: Reino
temperature: Temperatura
life: Vida
itemPackingType: Tipo de embalaje
maxRefs: Referencias máximas
fragile: Frágil
summary:
id: id
code: Código