Update router list
This commit is contained in:
parent
ecea050b77
commit
8f47a0bc2b
|
@ -208,28 +208,29 @@ const markAsServed = () => {
|
||||||
/>
|
/>
|
||||||
<FetchData url="AgencyModes" @on-fetch="(data) => (agencyList = data)" auto-load />
|
<FetchData url="AgencyModes" @on-fetch="(data) => (agencyList = data)" auto-load />
|
||||||
<FetchData url="Vehicles" @on-fetch="(data) => (vehicleList = data)" auto-load />
|
<FetchData url="Vehicles" @on-fetch="(data) => (vehicleList = data)" auto-load />
|
||||||
<QPage class="column items-center q-pa-md">
|
<QPage class="column items-center">
|
||||||
<QToolbar
|
<QToolbar class="bg-vn-dark justify-end">
|
||||||
:class="[
|
<div id="st-actions" class="q-pa-sm">
|
||||||
'q-pa-none q-mb-sm',
|
|
||||||
selectedRows?.length ? 'justify-between' : 'justify-end',
|
|
||||||
]"
|
|
||||||
>
|
|
||||||
<div v-if="selectedRows?.length">
|
|
||||||
<QBtn
|
<QBtn
|
||||||
icon="vn:clone"
|
icon="vn:clone"
|
||||||
color="primary"
|
color="primary"
|
||||||
class="q-mr-sm"
|
class="q-mr-sm"
|
||||||
|
:disable="!selectedRows?.length"
|
||||||
@click="confirmationDialog = true"
|
@click="confirmationDialog = true"
|
||||||
>
|
>
|
||||||
<QTooltip>{{ t('Clone Selected Routes') }}</QTooltip>
|
<QTooltip>{{ t('Clone Selected Routes') }}</QTooltip>
|
||||||
</QBtn>
|
</QBtn>
|
||||||
|
|
||||||
<QBtn icon="check" color="primary" class="q-mr-sm" @click="markAsServed">
|
<QBtn
|
||||||
|
icon="check"
|
||||||
|
color="primary"
|
||||||
|
class="q-mr-sm"
|
||||||
|
:disable="!selectedRows?.length"
|
||||||
|
@click="markAsServed"
|
||||||
|
>
|
||||||
<QTooltip>{{ t('Mark as served') }}</QTooltip>
|
<QTooltip>{{ t('Mark as served') }}</QTooltip>
|
||||||
</QBtn>
|
</QBtn>
|
||||||
</div>
|
</div>
|
||||||
<QBtn icon="refresh" color="primary" class="q-mr-sm" @click="refreshKey++" />
|
|
||||||
</QToolbar>
|
</QToolbar>
|
||||||
<VnPaginate
|
<VnPaginate
|
||||||
:key="refreshKey"
|
:key="refreshKey"
|
||||||
|
@ -240,198 +241,202 @@ const markAsServed = () => {
|
||||||
auto-load
|
auto-load
|
||||||
>
|
>
|
||||||
<template #body="{ rows }">
|
<template #body="{ rows }">
|
||||||
<QTable
|
<div class="q-pa-md">
|
||||||
v-model:selected="selectedRows"
|
<QTable
|
||||||
:columns="columns"
|
v-model:selected="selectedRows"
|
||||||
:rows="rows"
|
:columns="columns"
|
||||||
flat
|
:rows="rows"
|
||||||
row-key="id"
|
flat
|
||||||
selection="multiple"
|
row-key="id"
|
||||||
:rows-per-page-options="[0]"
|
selection="multiple"
|
||||||
>
|
:rows-per-page-options="[0]"
|
||||||
<template #body-cell-worker="props">
|
>
|
||||||
<QTd :props="props">
|
<template #body-cell-worker="props">
|
||||||
{{ props.row?.workerUserName }}
|
<QTd :props="props">
|
||||||
<QPopupEdit
|
{{ props.row?.workerUserName }}
|
||||||
:model-value="props.row.workerFk"
|
<QPopupEdit
|
||||||
v-slot="scope"
|
:model-value="props.row.workerFk"
|
||||||
buttons
|
v-slot="scope"
|
||||||
@update:model-value="
|
buttons
|
||||||
(worker) => updateWorker(props.row, worker)
|
@update:model-value="
|
||||||
"
|
(worker) => updateWorker(props.row, worker)
|
||||||
>
|
"
|
||||||
<VnSelectFilter
|
|
||||||
:label="t('Worker')"
|
|
||||||
v-model="scope.value"
|
|
||||||
:options="workers"
|
|
||||||
option-value="id"
|
|
||||||
option-label="name"
|
|
||||||
hide-selected
|
|
||||||
autofocus
|
|
||||||
:emit-value="false"
|
|
||||||
:rules="validate('Route.workerFk')"
|
|
||||||
:is-clearable="false"
|
|
||||||
@keyup.enter="scope.set"
|
|
||||||
@focus="($event) => $event.target.select()"
|
|
||||||
>
|
>
|
||||||
<template #option="{ opt, itemProps }">
|
<VnSelectFilter
|
||||||
<QItem
|
:label="t('Worker')"
|
||||||
v-bind="itemProps"
|
v-model="scope.value"
|
||||||
class="q-pa-xs row items-center"
|
:options="workers"
|
||||||
>
|
option-value="id"
|
||||||
<QItemSection class="col-9 justify-center">
|
option-label="name"
|
||||||
<span>{{ opt.name }}</span>
|
hide-selected
|
||||||
<span class="text-grey">{{
|
autofocus
|
||||||
opt.nickname
|
:emit-value="false"
|
||||||
}}</span>
|
:rules="validate('Route.workerFk')"
|
||||||
</QItemSection>
|
:is-clearable="false"
|
||||||
</QItem>
|
@keyup.enter="scope.set"
|
||||||
</template>
|
@focus="($event) => $event.target.select()"
|
||||||
</VnSelectFilter>
|
>
|
||||||
</QPopupEdit>
|
<template #option="{ opt, itemProps }">
|
||||||
</QTd>
|
<QItem
|
||||||
</template>
|
v-bind="itemProps"
|
||||||
<template #body-cell-agency="props">
|
class="q-pa-xs row items-center"
|
||||||
<QTd :props="props">
|
>
|
||||||
{{ props.row?.agencyName }}
|
<QItemSection
|
||||||
<QPopupEdit
|
class="col-9 justify-center"
|
||||||
:model-value="props.row.agencyModeFk"
|
>
|
||||||
v-slot="scope"
|
<span>{{ opt.name }}</span>
|
||||||
buttons
|
<span class="text-grey">{{
|
||||||
@update:model-value="
|
opt.nickname
|
||||||
(agency) => updateAgency(props.row, agency)
|
}}</span>
|
||||||
"
|
</QItemSection>
|
||||||
>
|
</QItem>
|
||||||
<VnSelectFilter
|
</template>
|
||||||
:label="t('Agency')"
|
</VnSelectFilter>
|
||||||
v-model="scope.value"
|
</QPopupEdit>
|
||||||
:options="agencyList"
|
</QTd>
|
||||||
option-value="id"
|
</template>
|
||||||
option-label="name"
|
<template #body-cell-agency="props">
|
||||||
hide-selected
|
<QTd :props="props">
|
||||||
autofocus
|
{{ props.row?.agencyName }}
|
||||||
:emit-value="false"
|
<QPopupEdit
|
||||||
:rules="validate('route.agencyFk')"
|
:model-value="props.row.agencyModeFk"
|
||||||
:is-clearable="false"
|
v-slot="scope"
|
||||||
@keyup.enter="scope.set"
|
buttons
|
||||||
@focus="($event) => $event.target.select()"
|
@update:model-value="
|
||||||
/>
|
(agency) => updateAgency(props.row, agency)
|
||||||
</QPopupEdit>
|
"
|
||||||
</QTd>
|
>
|
||||||
</template>
|
<VnSelectFilter
|
||||||
<template #body-cell-vehicle="props">
|
:label="t('Agency')"
|
||||||
<QTd :props="props">
|
v-model="scope.value"
|
||||||
{{ props.row?.vehiclePlateNumber }}
|
:options="agencyList"
|
||||||
<QPopupEdit
|
option-value="id"
|
||||||
:model-value="props.row.vehicleFk"
|
option-label="name"
|
||||||
v-slot="scope"
|
hide-selected
|
||||||
buttons
|
autofocus
|
||||||
@update:model-value="
|
:emit-value="false"
|
||||||
(vehicle) => updateVehicle(props.row, vehicle)
|
:rules="validate('route.agencyFk')"
|
||||||
"
|
:is-clearable="false"
|
||||||
>
|
@keyup.enter="scope.set"
|
||||||
<VnSelectFilter
|
@focus="($event) => $event.target.select()"
|
||||||
:label="t('Vehicle')"
|
/>
|
||||||
v-model="scope.value"
|
</QPopupEdit>
|
||||||
:options="vehicleList"
|
</QTd>
|
||||||
option-value="id"
|
</template>
|
||||||
option-label="numberPlate"
|
<template #body-cell-vehicle="props">
|
||||||
hide-selected
|
<QTd :props="props">
|
||||||
autofocus
|
{{ props.row?.vehiclePlateNumber }}
|
||||||
:emit-value="false"
|
<QPopupEdit
|
||||||
:rules="validate('route.vehicleFk')"
|
:model-value="props.row.vehicleFk"
|
||||||
:is-clearable="false"
|
v-slot="scope"
|
||||||
@keyup.enter="scope.set"
|
buttons
|
||||||
@focus="($event) => $event.target.select()"
|
@update:model-value="
|
||||||
/>
|
(vehicle) => updateVehicle(props.row, vehicle)
|
||||||
</QPopupEdit>
|
"
|
||||||
</QTd>
|
>
|
||||||
</template>
|
<VnSelectFilter
|
||||||
<template #body-cell-date="props">
|
:label="t('Vehicle')"
|
||||||
<QTd :props="props">
|
v-model="scope.value"
|
||||||
{{ toDate(props.row?.created) }}
|
:options="vehicleList"
|
||||||
<QPopupEdit
|
option-value="id"
|
||||||
v-model="props.row.created"
|
option-label="numberPlate"
|
||||||
v-slot="scope"
|
hide-selected
|
||||||
@update:model-value="updateRoute(props.row)"
|
autofocus
|
||||||
buttons
|
:emit-value="false"
|
||||||
>
|
:rules="validate('route.vehicleFk')"
|
||||||
<VnInputDate
|
:is-clearable="false"
|
||||||
v-model="scope.value"
|
@keyup.enter="scope.set"
|
||||||
autofocus
|
@focus="($event) => $event.target.select()"
|
||||||
:label="t('Date')"
|
/>
|
||||||
:rules="validate('route.created')"
|
</QPopupEdit>
|
||||||
:is-clearable="false"
|
</QTd>
|
||||||
@keyup.enter="scope.set"
|
</template>
|
||||||
@focus="($event) => $event.target.select()"
|
<template #body-cell-date="props">
|
||||||
/>
|
<QTd :props="props">
|
||||||
</QPopupEdit>
|
{{ toDate(props.row?.created) }}
|
||||||
</QTd>
|
<QPopupEdit
|
||||||
</template>
|
v-model="props.row.created"
|
||||||
<template #body-cell-description="props">
|
v-slot="scope"
|
||||||
<QTd :props="props">
|
@update:model-value="updateRoute(props.row)"
|
||||||
{{ props.row?.description }}
|
buttons
|
||||||
<QPopupEdit
|
>
|
||||||
v-model="props.row.description"
|
<VnInputDate
|
||||||
v-slot="scope"
|
v-model="scope.value"
|
||||||
@update:model-value="updateRoute(props.row)"
|
autofocus
|
||||||
buttons
|
:label="t('Date')"
|
||||||
>
|
:rules="validate('route.created')"
|
||||||
<VnInput
|
:is-clearable="false"
|
||||||
v-model="scope.value"
|
@keyup.enter="scope.set"
|
||||||
autofocus
|
@focus="($event) => $event.target.select()"
|
||||||
:label="t('Description')"
|
/>
|
||||||
:rules="validate('route.description')"
|
</QPopupEdit>
|
||||||
:is-clearable="false"
|
</QTd>
|
||||||
@keyup.enter="scope.set"
|
</template>
|
||||||
@focus="($event) => $event.target.select()"
|
<template #body-cell-description="props">
|
||||||
/>
|
<QTd :props="props">
|
||||||
</QPopupEdit>
|
{{ props.row?.description }}
|
||||||
</QTd>
|
<QPopupEdit
|
||||||
</template>
|
v-model="props.row.description"
|
||||||
<template #body-cell-started="props">
|
v-slot="scope"
|
||||||
<QTd :props="props">
|
@update:model-value="updateRoute(props.row)"
|
||||||
{{ toHour(props.row.started) }}
|
buttons
|
||||||
<QPopupEdit
|
>
|
||||||
v-model="props.row.started"
|
<VnInput
|
||||||
v-slot="scope"
|
v-model="scope.value"
|
||||||
buttons
|
autofocus
|
||||||
@update:model-value="updateRoute(props.row)"
|
:label="t('Description')"
|
||||||
>
|
:rules="validate('route.description')"
|
||||||
<VnInputTime
|
:is-clearable="false"
|
||||||
v-model="scope.value"
|
@keyup.enter="scope.set"
|
||||||
autofocus
|
@focus="($event) => $event.target.select()"
|
||||||
:label="t('Hour started')"
|
/>
|
||||||
:rules="validate('route.started')"
|
</QPopupEdit>
|
||||||
:is-clearable="false"
|
</QTd>
|
||||||
@keyup.enter="scope.set"
|
</template>
|
||||||
@focus="($event) => $event.target.select()"
|
<template #body-cell-started="props">
|
||||||
/>
|
<QTd :props="props">
|
||||||
</QPopupEdit>
|
{{ toHour(props.row.started) }}
|
||||||
</QTd>
|
<QPopupEdit
|
||||||
</template>
|
v-model="props.row.started"
|
||||||
<template #body-cell-finished="props">
|
v-slot="scope"
|
||||||
<QTd :props="props">
|
buttons
|
||||||
{{ toHour(props.row.finished) }}
|
@update:model-value="updateRoute(props.row)"
|
||||||
<QPopupEdit
|
>
|
||||||
v-model="props.row.finished"
|
<VnInputTime
|
||||||
v-slot="scope"
|
v-model="scope.value"
|
||||||
buttons
|
autofocus
|
||||||
@update:model-value="updateRoute(props.row)"
|
:label="t('Hour started')"
|
||||||
>
|
:rules="validate('route.started')"
|
||||||
<VnInputTime
|
:is-clearable="false"
|
||||||
v-model="scope.value"
|
@keyup.enter="scope.set"
|
||||||
autofocus
|
@focus="($event) => $event.target.select()"
|
||||||
:label="t('Hour finished')"
|
/>
|
||||||
:rules="validate('route.finished')"
|
</QPopupEdit>
|
||||||
:is-clearable="false"
|
</QTd>
|
||||||
@keyup.enter="scope.set"
|
</template>
|
||||||
@focus="($event) => $event.target.select()"
|
<template #body-cell-finished="props">
|
||||||
/>
|
<QTd :props="props">
|
||||||
</QPopupEdit>
|
{{ toHour(props.row.finished) }}
|
||||||
</QTd>
|
<QPopupEdit
|
||||||
</template>
|
v-model="props.row.finished"
|
||||||
</QTable>
|
v-slot="scope"
|
||||||
|
buttons
|
||||||
|
@update:model-value="updateRoute(props.row)"
|
||||||
|
>
|
||||||
|
<VnInputTime
|
||||||
|
v-model="scope.value"
|
||||||
|
autofocus
|
||||||
|
:label="t('Hour finished')"
|
||||||
|
:rules="validate('route.finished')"
|
||||||
|
:is-clearable="false"
|
||||||
|
@keyup.enter="scope.set"
|
||||||
|
@focus="($event) => $event.target.select()"
|
||||||
|
/>
|
||||||
|
</QPopupEdit>
|
||||||
|
</QTd>
|
||||||
|
</template>
|
||||||
|
</QTable>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</VnPaginate>
|
</VnPaginate>
|
||||||
<QPageSticky :offset="[20, 20]">
|
<QPageSticky :offset="[20, 20]">
|
||||||
|
|
Loading…
Reference in New Issue