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), ...Object.fromEntries(staticParams),
search: searchText.value, search: searchText.value,
}, },
...{ filter: props.filter },
}; };
if (props.whereFilter) { if (props.whereFilter) {

View File

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

View File

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