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

View File

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

View File

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