refactor: replace select component with VnSelectWorker in RouteList.vue
gitea/salix-front/pipeline/pr-master There was a failure building this commit
Details
gitea/salix-front/pipeline/pr-master There was a failure building this commit
Details
This commit is contained in:
parent
0225dcc736
commit
1c568227c2
|
@ -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,
|
||||
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 }}
|
||||
</span>
|
||||
</template>
|
||||
<template #column-vehicleFk="{ row }">
|
||||
<span>
|
||||
{{ row?.vehiclePlateNumber }}
|
||||
</span>
|
||||
</template>
|
||||
</VnTable>
|
||||
</template>
|
||||
</VnSection>
|
||||
</template>
|
||||
</template>
|
||||
|
|
Loading…
Reference in New Issue