Merge branch 'dev' into 7010-AddPackingField
gitea/salix-front/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Jon Elias 2024-10-02 09:53:22 +00:00
commit be53b466b9
5 changed files with 191 additions and 4 deletions

View File

@ -108,6 +108,7 @@ async function search() {
...Object.fromEntries(staticParams),
search: searchText.value,
},
...{ filter: props.filter },
};
if (props.whereFilter) {

View File

@ -9,7 +9,9 @@ import { useSummaryDialog } from 'src/composables/useSummaryDialog';
const { t } = useI18n();
const { viewSummary } = useSummaryDialog();
const tableRef = ref();
const filter = {
include: { relation: 'role', scope: { fields: ['id', 'name'] } },
};
const columns = computed(() => [
{
align: 'left',
@ -29,7 +31,22 @@ const columns = computed(() => [
},
{
align: 'left',
name: 'username',
name: 'roleFk',
label: t('role'),
columnFilter: {
component: 'select',
name: 'roleFk',
attrs: {
url: 'VnRoles',
optionValue: 'id',
optionLabel: 'name',
},
},
format: ({ role }, dashIfEmpty) => dashIfEmpty(role?.name),
},
{
align: 'left',
name: 'nickname',
label: t('Nickname'),
isTitle: true,
component: 'input',
@ -104,12 +121,13 @@ const exprBuilder = (param, value) => {
:expr-builder="exprBuilder"
:label="t('account.search')"
:info="t('account.searchInfo')"
:filter="filter"
/>
<VnTable
ref="tableRef"
data-key="AccountUsers"
url="VnUsers/preview"
:filter="filter"
order="id DESC"
:columns="columns"
default-mode="table"

View File

@ -11,6 +11,9 @@ const { t } = useI18n();
data-key="Account"
:descriptor="AccountDescriptor"
search-data-key="AccountUsers"
:filter="{
include: { relation: 'role', scope: { fields: ['id', 'name'] } },
}"
:searchbar-props="{
url: 'VnUsers/preview',
label: t('account.search'),

View File

@ -0,0 +1,157 @@
<script setup>
import { ref } from 'vue';
import { useI18n } from 'vue-i18n';
import FetchData from 'components/FetchData.vue';
import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue';
import VnSelect from 'components/common/VnSelect.vue';
import VnInput from 'src/components/common/VnInput.vue';
import VnInputDate from 'components/common/VnInputDate.vue';
import VnInputTime from 'src/components/common/VnInputTime.vue';
const { t } = useI18n();
const props = defineProps({
dataKey: {
type: String,
required: true,
},
});
const states = ref([]);
defineExpose({ states });
</script>
<template>
<FetchData url="warehouses" @on-fetch="(data) => (states = data)" auto-load />
<VnFilterPanel :data-key="props.dataKey" :search-button="true" search-url="table">
<template #tags="{ tag, formatFn }">
<div class="q-gutter-x-xs">
<strong>{{ t(`params.${tag.label}`) }}: </strong>
<span>{{ formatFn(tag.value) }}</span>
</div>
</template>
<template #body="{ params, searchFn }">
<div class="q-pa-sm q-gutter-y-sm">
<VnInput
:label="t('travel.Id')"
v-model="params.id"
lazy-rules
is-outlined
>
<template #prepend> <QIcon name="badge" size="xs" /></template>
</VnInput>
<VnInput
:label="t('travel.ref')"
v-model="params.ref"
lazy-rules
is-outlined
/>
<VnSelect
:label="t('travel.agency')"
v-model="params.agencyModeFk"
@update:model-value="searchFn()"
url="agencyModes"
:use-like="false"
option-value="id"
option-label="name"
option-filter="name"
dense
outlined
rounded
/>
<VnSelect
:label="t('travel.warehouseInFk')"
v-model="params.warehouseInFk"
@update:model-value="searchFn()"
url="warehouses"
:use-like="false"
option-value="id"
option-label="name"
option-filter="name"
dense
outlined
rounded
/>
<VnInputDate
:label="t('travel.shipped')"
v-model="params.shipped"
@update:model-value="searchFn()"
dense
outlined
rounded
/>
<VnInputTime
v-model="params.shipmentHour"
@update:model-value="searchFn()"
:label="t('travel.shipmentHour')"
outlined
rounded
dense
/>
<VnSelect
:label="t('travel.warehouseOut')"
v-model="params.warehouseOut"
@update:model-value="searchFn()"
url="warehouses"
:use-like="false"
option-value="id"
option-label="name"
option-filter="name"
dense
outlined
rounded
/>
<VnInputDate
:label="t('travel.landed')"
v-model="params.landed"
@update:model-value="searchFn()"
dense
outlined
rounded
/>
<VnInputTime
v-model="params.landingHour"
@update:model-value="searchFn()"
:label="t('travel.landingHour')"
outlined
rounded
dense
/>
<VnInput
:label="t('travel.totalEntries')"
v-model="params.totalEntries"
lazy-rules
is-outlined
/>
</div>
</template>
</VnFilterPanel>
</template>
<i18n>
en:
travel:
Id: Contains
ref: Reference
agency: Agency
warehouseInFk: W. In
shipped: Shipped
shipmentHour: Shipment Hour
warehouseOut: W. Out
landed: Landed
landingHour: Landing Hour
totalEntries: Σ
es:
travel:
Id: Id
ref: Referencia
agency: Agencia
warehouseInFk: Alm.Salida
shipped: F.Envío
shipmentHour: Hora de envío
warehouseOut: Alm.Entrada
landed: F.Entrega
landingHour: Hora de entrega
totalEntries: Σ
</i18n>

View File

@ -9,6 +9,8 @@ import TravelSummary from './Card/TravelSummary.vue';
import VnSearchbar from 'components/ui/VnSearchbar.vue';
import { toDate } from 'src/filters';
import { getDateQBadgeColor } from 'src/composables/getDateQBadgeColor.js';
import RightMenu from 'src/components/common/RightMenu.vue';
import TravelFilter from './TravelFilter.vue';
const { viewSummary } = useSummaryDialog();
const router = useRouter();
@ -24,6 +26,7 @@ const $props = defineProps({
});
const entityId = computed(() => $props.id || route.params.id);
const travelFilterRef = ref();
onMounted(async () => {
stateStore.rightDrawer = true;
});
@ -201,6 +204,11 @@ const columns = computed(() => [
:label="t('Search travel')"
data-key="TravelList"
/>
<RightMenu>
<template #right-panel>
<TravelFilter data-key="TravelList" ref="travelFilterRef" />
</template>
</RightMenu>
<VnTable
ref="tableRef"
data-key="TravelList"
@ -213,6 +221,7 @@ const columns = computed(() => [
editorFk: entityId,
},
}"
:right-search="false"
:user-params="{ daysOnward: 7 }"
order="landed DESC"
:columns="columns"
@ -220,7 +229,6 @@ const columns = computed(() => [
redirect="travel"
:is-editable="false"
:use-model="true"
chip-locale="travel.travelList.tableVisibleColumns"
>
<template #column-shipped="{ row }">
<QBadge