forked from verdnatura/salix-front
fix: refs #7283 itemtype fix
This commit is contained in:
parent
56ef811584
commit
671d9fd6fb
|
@ -1,14 +1,14 @@
|
|||
<script setup>
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useRoute } from 'vue-router';
|
||||
import { ref, computed } from 'vue';
|
||||
import ItemTypeSearchbar from '../ItemType/ItemTypeSearchbar.vue';
|
||||
import VnTable from 'components/VnTable/VnTable.vue';
|
||||
import FetchData from 'components/FetchData.vue';
|
||||
|
||||
const route = useRoute();
|
||||
const { t } = useI18n();
|
||||
const tableRef = ref();
|
||||
const entityId = computed(() => route.params.id);
|
||||
const workerOptions = ref([]);
|
||||
const ItemCategoriesOptions = ref([]);
|
||||
|
||||
const columns = computed(() => [
|
||||
{
|
||||
|
@ -40,7 +40,7 @@ const columns = computed(() => [
|
|||
create: true,
|
||||
component: 'select',
|
||||
attrs: {
|
||||
url: 'Workers',
|
||||
options: workerOptions.value,
|
||||
optionLabel: 'firstName',
|
||||
optionValue: 'id',
|
||||
},
|
||||
|
@ -54,8 +54,9 @@ const columns = computed(() => [
|
|||
create: true,
|
||||
component: 'select',
|
||||
attrs: {
|
||||
url: 'ItemCategories',
|
||||
options: ItemCategoriesOptions.value,
|
||||
fields: ['id', 'name'],
|
||||
order: 'name ASC',
|
||||
},
|
||||
cardVisible: false,
|
||||
visible: false,
|
||||
|
@ -77,6 +78,18 @@ const columns = computed(() => [
|
|||
</script>
|
||||
|
||||
<template>
|
||||
<FetchData
|
||||
url="Workers"
|
||||
:filter="{ fields: ['id', 'firstName'], order: ['firstName ASC'] }"
|
||||
@on-fetch="(data) => (workerOptions = data)"
|
||||
auto-load
|
||||
/>
|
||||
<FetchData
|
||||
url="ItemCategories"
|
||||
:filter="{ fields: ['id', 'name'], order: ['name ASC'] }"
|
||||
@on-fetch="(data) => (ItemCategoriesOptions = data)"
|
||||
auto-load
|
||||
/>
|
||||
<ItemTypeSearchbar />
|
||||
<VnTable
|
||||
ref="tableRef"
|
||||
|
@ -102,8 +115,8 @@ const columns = computed(() => [
|
|||
id: Id
|
||||
code: Código
|
||||
name: Nombre
|
||||
worker: Encargado
|
||||
ItemCategory: Categoría
|
||||
worker: Trabajador
|
||||
ItemCategory: Reino
|
||||
Temperature: Temperatura
|
||||
Create ItemTypes: Crear familia
|
||||
en:
|
||||
|
|
Loading…
Reference in New Issue