fix: refs: #8625 fixed agency and vehicle Fk and add select fields on create form #1503
|
@ -1,5 +1,5 @@
|
|||
<script setup>
|
||||
import { computed, ref } from 'vue';
|
||||
import { computed, ref, markRaw } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
||||
import { toHour } from 'src/filters';
|
||||
|
@ -8,6 +8,7 @@ import RouteFilter from 'pages/Route/Card/RouteFilter.vue';
|
|||
import VnTable from 'components/VnTable/VnTable.vue';
|
||||
import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
|
||||
import VnSection from 'src/components/common/VnSection.vue';
|
||||
import VnSelectWorker from 'src/components/common/VnSelectWorker.vue';
|
||||
|
||||
const { t } = useI18n();
|
||||
const { viewSummary } = useSummaryDialog();
|
||||
|
@ -38,17 +39,7 @@ const columns = computed(() => [
|
|||
align: 'left',
|
||||
name: 'workerFk',
|
||||
label: t('route.Worker'),
|
||||
component: 'select',
|
||||
attrs: {
|
||||
url: 'Workers/activeWithInheritedRole',
|
||||
fields: ['id', 'name'],
|
||||
useLike: false,
|
||||
optionFilter: 'firstName',
|
||||
find: {
|
||||
value: 'workerFk',
|
||||
label: 'workerUserName',
|
||||
},
|
||||
},
|
||||
component: markRaw(VnSelectWorker),
|
||||
create: true,
|
||||
jtubau marked this conversation as resolved
Outdated
|
||||
cardVisible: true,
|
||||
format: (row, dashIfEmpty) => dashIfEmpty(row.travelRef),
|
||||
|
@ -58,7 +49,6 @@ const columns = computed(() => [
|
|||
align: 'left',
|
||||
name: 'agencyModeFk',
|
||||
label: t('route.Agency'),
|
||||
format: (row) => row?.agencyName,
|
||||
cardVisible: true,
|
||||
component: 'select',
|
||||
attrs: {
|
||||
|
@ -77,7 +67,6 @@ const columns = computed(() => [
|
|||
align: 'left',
|
||||
name: 'vehicleFk',
|
||||
label: t('route.Vehicle'),
|
||||
format: (row) => row?.vehiclePlateNumber,
|
||||
cardVisible: true,
|
||||
component: 'select',
|
||||
attrs: {
|
||||
|
@ -157,8 +146,8 @@ const columns = computed(() => [
|
|||
<template #body>
|
||||
<VnTable
|
||||
:data-key
|
||||
ref="tableRef"
|
||||
:columns="columns"
|
||||
ref="tableRef"
|
||||
:right-search="false"
|
||||
redirect="route"
|
||||
:create="{
|
||||
|
@ -175,7 +164,17 @@ const columns = computed(() => [
|
|||
<WorkerDescriptorProxy :id="row?.workerFk" v-if="row?.workerFk" />
|
||||
</span>
|
||||
</template>
|
||||
<template #column-agencyModeFk="{ row }">
|
||||
<span>
|
||||
{{ row?.agencyName }}
|
||||
alexm
commented
En el objeto columns, le puedes poner format: (row) => row?.agencyName En el objeto columns, le puedes poner format: (row) => row?.agencyName
Y te evitas crear el template
Aun se hace asi? @pablone pq me suena que habia q poner column[algo]: null pero no veo ya ese `component-prop` en VnTable
jtubau
commented
Si, lo arregle en otra rama que hace el test y necesitaba tenerlo arreglado para que funcionara. Me comento lo mismo Segarra y ya esta cambiado allí, ahora lo actualizo aquí. Si, lo arregle en otra rama que hace el test y necesitaba tenerlo arreglado para que funcionara. Me comento lo mismo Segarra y ya esta cambiado allí, ahora lo actualizo aquí.
|
||||
</span>
|
||||
</template>
|
||||
<template #column-vehicleFk="{ row }">
|
||||
<span>
|
||||
{{ row?.vehiclePlateNumber }}
|
||||
jtubau marked this conversation as resolved
Outdated
alexm
commented
Pasa lo mismo aqui Pasa lo mismo aqui
|
||||
</span>
|
||||
</template>
|
||||
</VnTable>
|
||||
</template>
|
||||
</VnSection>
|
||||
</template>
|
||||
</template>
|
||||
|
|
Loading…
Reference in New Issue
Me suena que hay componente VnSelectWorker creo, para no tener que repitr este codigo