Reviewed-on: #825 Reviewed-by: Alex Moreno <alexm@verdnatura.es>
This commit is contained in:
commit
0537213a58
|
@ -7,7 +7,6 @@ import FetchData from 'components/FetchData.vue';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const tableRef = ref();
|
const tableRef = ref();
|
||||||
const workerOptions = ref([]);
|
|
||||||
const ItemCategoriesOptions = ref([]);
|
const ItemCategoriesOptions = ref([]);
|
||||||
|
|
||||||
const columns = computed(() => [
|
const columns = computed(() => [
|
||||||
|
@ -40,12 +39,12 @@ const columns = computed(() => [
|
||||||
create: true,
|
create: true,
|
||||||
component: 'select',
|
component: 'select',
|
||||||
attrs: {
|
attrs: {
|
||||||
options: workerOptions.value,
|
url: 'Workers/search',
|
||||||
optionLabel: 'firstName',
|
optionLabel: 'nickname',
|
||||||
optionValue: 'id',
|
optionValue: 'id',
|
||||||
},
|
},
|
||||||
cardVisible: false,
|
cardVisible: true,
|
||||||
visible: false,
|
visible: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
@ -78,12 +77,6 @@ const columns = computed(() => [
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<FetchData
|
|
||||||
url="Workers"
|
|
||||||
:filter="{ fields: ['id', 'firstName'], order: ['firstName ASC'] }"
|
|
||||||
@on-fetch="(data) => (workerOptions = data)"
|
|
||||||
auto-load
|
|
||||||
/>
|
|
||||||
<FetchData
|
<FetchData
|
||||||
url="ItemCategories"
|
url="ItemCategories"
|
||||||
:filter="{ fields: ['id', 'name'], order: ['name ASC'] }"
|
:filter="{ fields: ['id', 'name'], order: ['name ASC'] }"
|
||||||
|
|
|
@ -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}`"
|
||||||
|
@ -46,11 +58,18 @@ const temperaturesOptions = ref([]);
|
||||||
:label="t('shared.worker')"
|
:label="t('shared.worker')"
|
||||||
sort-by="nickname ASC"
|
sort-by="nickname ASC"
|
||||||
:fields="['id', 'nickname']"
|
:fields="['id', 'nickname']"
|
||||||
:params="{ departmentCodes: ['shopping'] }"
|
|
||||||
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>
|
||||||
|
@ -80,6 +99,21 @@ const temperaturesOptions = ref([]);
|
||||||
option-label="name"
|
option-label="name"
|
||||||
hide-selected
|
hide-selected
|
||||||
/>
|
/>
|
||||||
|
<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>
|
</VnRow>
|
||||||
</template>
|
</template>
|
||||||
</FormModel>
|
</FormModel>
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
<script setup>
|
||||||
|
import VnLog from 'src/components/common/VnLog.vue';
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<VnLog model="ItemType" url="/ItemTypeLogs"></VnLog>
|
||||||
|
</template>
|
|
@ -4,6 +4,10 @@ shared:
|
||||||
worker: Worker
|
worker: Worker
|
||||||
category: Category
|
category: Category
|
||||||
temperature: Temperature
|
temperature: Temperature
|
||||||
|
life: Life
|
||||||
|
itemPackingType: Item packing type
|
||||||
|
maxRefs: Maximum references
|
||||||
|
fragile: Fragile
|
||||||
summary:
|
summary:
|
||||||
id: id
|
id: id
|
||||||
life: Life
|
life: Life
|
||||||
|
|
|
@ -4,6 +4,10 @@ shared:
|
||||||
worker: Trabajador
|
worker: Trabajador
|
||||||
category: Reino
|
category: Reino
|
||||||
temperature: Temperatura
|
temperature: Temperatura
|
||||||
|
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
|
||||||
|
|
|
@ -12,7 +12,7 @@ export default {
|
||||||
redirect: { name: 'ItemTypeList' },
|
redirect: { name: 'ItemTypeList' },
|
||||||
menus: {
|
menus: {
|
||||||
main: [],
|
main: [],
|
||||||
card: ['ItemTypeBasicData'],
|
card: ['ItemTypeBasicData', 'ItemTypeLog'],
|
||||||
},
|
},
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
|
@ -40,6 +40,15 @@ export default {
|
||||||
component: () =>
|
component: () =>
|
||||||
import('src/pages/ItemType/Card/ItemTypeBasicData.vue'),
|
import('src/pages/ItemType/Card/ItemTypeBasicData.vue'),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: 'log',
|
||||||
|
name: 'ItemTypeLog',
|
||||||
|
meta: {
|
||||||
|
title: 'log',
|
||||||
|
icon: 'vn:History',
|
||||||
|
},
|
||||||
|
component: () => import('src/pages/ItemType/Card/ItemTypeLog.vue'),
|
||||||
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|
Loading…
Reference in New Issue