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