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

This commit is contained in:
PAU ROVIRA ROSALENY 2024-12-24 10:59:36 +00:00
commit 4f60544a1e
6 changed files with 50 additions and 37 deletions

View File

@ -30,7 +30,7 @@ defineExpose({ states });
<span>{{ formatFn(tag.value) }}</span> <span>{{ formatFn(tag.value) }}</span>
</div> </div>
</template> </template>
<template #body="{ params, searchFn }"> <template #body="{ params }">
<div class="q-pa-sm q-gutter-y-sm"> <div class="q-pa-sm q-gutter-y-sm">
<VnInput <VnInput
:label="t('claim.customerId')" :label="t('claim.customerId')"
@ -49,12 +49,9 @@ defineExpose({ states });
<VnSelect <VnSelect
:label="t('Salesperson')" :label="t('Salesperson')"
v-model="params.salesPersonFk" v-model="params.salesPersonFk"
@update:model-value="searchFn()"
url="Workers/activeWithInheritedRole" url="Workers/activeWithInheritedRole"
:filter="{ where: { role: 'salesPerson' } }" :filter="{ where: { role: 'salesPerson' } }"
:use-like="false" :use-like="false"
option-value="id"
option-label="name"
option-filter="firstName" option-filter="firstName"
dense dense
outlined outlined
@ -63,12 +60,9 @@ defineExpose({ states });
<VnSelect <VnSelect
:label="t('claim.attendedBy')" :label="t('claim.attendedBy')"
v-model="params.attenderFk" v-model="params.attenderFk"
@update:model-value="searchFn()"
url="Workers/activeWithInheritedRole" url="Workers/activeWithInheritedRole"
:filter="{ where: { role: 'salesPerson' } }" :filter="{ where: { role: 'salesPerson' } }"
:use-like="false" :use-like="false"
option-value="id"
option-label="name"
option-filter="firstName" option-filter="firstName"
dense dense
outlined outlined
@ -77,9 +71,7 @@ defineExpose({ states });
<VnSelect <VnSelect
:label="t('claim.state')" :label="t('claim.state')"
v-model="params.claimStateFk" v-model="params.claimStateFk"
@update:model-value="searchFn()"
:options="states" :options="states"
option-value="id"
option-label="description" option-label="description"
dense dense
outlined outlined
@ -87,7 +79,6 @@ defineExpose({ states });
/> />
<VnInputDate <VnInputDate
v-model="params.created" v-model="params.created"
@update:model-value="searchFn()"
:label="t('claim.created')" :label="t('claim.created')"
outlined outlined
rounded rounded
@ -96,10 +87,7 @@ defineExpose({ states });
<VnSelect <VnSelect
:label="t('Item')" :label="t('Item')"
v-model="params.itemFk" v-model="params.itemFk"
@update:model-value="searchFn()"
url="Items/withName" url="Items/withName"
option-value="id"
option-label="name"
:use-like="false" :use-like="false"
sort-by="id DESC" sort-by="id DESC"
outlined outlined
@ -118,21 +106,26 @@ defineExpose({ states });
<VnSelect <VnSelect
:label="t('claim.responsible')" :label="t('claim.responsible')"
v-model="params.claimResponsibleFk" v-model="params.claimResponsibleFk"
@update:model-value="searchFn()"
url="Workers/activeWithInheritedRole" url="Workers/activeWithInheritedRole"
:filter="{ where: { role: 'salesPerson' } }" :filter="{ where: { role: 'salesPerson' } }"
:use-like="false" :use-like="false"
option-value="id"
option-label="name"
option-filter="firstName" option-filter="firstName"
dense dense
outlined outlined
rounded rounded
/> />
<VnSelect
:label="t('claim.zone')"
v-model="params.zoneFk"
url="Zones"
:use-like="false"
outlined
rounded
dense
/>
<QCheckbox <QCheckbox
v-model="params.myTeam" v-model="params.myTeam"
:label="t('params.myTeam')" :label="t('params.myTeam')"
@update:model-value="searchFn()"
toggle-indeterminate toggle-indeterminate
/> />
</div> </div>
@ -153,6 +146,7 @@ en:
created: Created created: Created
myTeam: My team myTeam: My team
itemFk: Item itemFk: Item
zoneFk: Zone
es: es:
params: params:
search: Contiene search: Contiene
@ -165,6 +159,7 @@ es:
created: Creada created: Creada
myTeam: Mi equipo myTeam: Mi equipo
itemFk: Artículo itemFk: Artículo
zoneFk: Zona
Client Name: Nombre del cliente Client Name: Nombre del cliente
Salesperson: Comercial Salesperson: Comercial
Item: Artículo Item: Artículo

View File

@ -10,6 +10,7 @@ import ClaimSummary from './Card/ClaimSummary.vue';
import { useSummaryDialog } from 'src/composables/useSummaryDialog'; import { useSummaryDialog } from 'src/composables/useSummaryDialog';
import RightMenu from 'src/components/common/RightMenu.vue'; import RightMenu from 'src/components/common/RightMenu.vue';
import VnTable from 'src/components/VnTable/VnTable.vue'; import VnTable from 'src/components/VnTable/VnTable.vue';
import ZoneDescriptorProxy from '../Zone/Card/ZoneDescriptorProxy.vue';
const { t } = useI18n(); const { t } = useI18n();
const { viewSummary } = useSummaryDialog(); const { viewSummary } = useSummaryDialog();
@ -95,7 +96,12 @@ const columns = computed(() => [
optionLabel: 'description', optionLabel: 'description',
}, },
}, },
orderBy: 'priority', orderBy: 'cs.priority',
},
{
align: 'left',
label: t('claim.zone'),
name: 'zoneFk',
}, },
{ {
align: 'right', align: 'right',
@ -132,7 +138,7 @@ const STATE_COLOR = {
<VnTable <VnTable
data-key="ClaimList" data-key="ClaimList"
url="Claims/filter" url="Claims/filter"
:order="['priority ASC', 'created ASC']" :order="['cs.priority ASC', 'created ASC']"
:columns="columns" :columns="columns"
redirect="claim" redirect="claim"
:right-search="false" :right-search="false"
@ -148,6 +154,12 @@ const STATE_COLOR = {
<VnUserLink :name="row.workerName" :worker-id="row.workerFk" /> <VnUserLink :name="row.workerName" :worker-id="row.workerFk" />
</span> </span>
</template> </template>
<template #column-zoneFk="{ row }">
<span class="link" @click.stop>
{{ row.zoneName }}
<ZoneDescriptorProxy :id="row.zoneId" />
</span>
</template>
</VnTable> </VnTable>
</template> </template>

View File

@ -16,14 +16,17 @@ const { t } = useI18n();
const businessTypes = ref([]); const businessTypes = ref([]);
const contactChannels = ref([]); const contactChannels = ref([]);
const handleSalesModelValue = (val) => ({ const handleSalesModelValue = (val) => {
or: [ if (!val) val = '';
{ id: val }, return {
{ name: val }, or: [
{ nickname: { like: '%' + val + '%' } }, { id: val },
{ code: { like: `${val}%` } }, { name: val },
], { nickname: { like: '%' + val + '%' } },
}); { code: { like: `${val}%` } },
],
};
};
const exprBuilder = (param, value) => { const exprBuilder = (param, value) => {
return { return {

View File

@ -12,14 +12,17 @@ defineProps({
required: true, required: true,
}, },
}); });
const handleSalesModelValue = (val) => ({ const handleSalesModelValue = (val) => {
or: [ if (!val) val = '';
{ id: val }, return {
{ name: val }, or: [
{ nickname: { like: '%' + val + '%' } }, { id: val },
{ code: { like: `${val}%` } }, { name: val },
], { nickname: { like: '%' + val + '%' } },
}); { code: { like: `${val}%` } },
],
};
};
const exprBuilder = (param, value) => { const exprBuilder = (param, value) => {
return { return {

View File

@ -107,7 +107,7 @@ const setParams = (params) => {
const getPreview = async () => { const getPreview = async () => {
const params = { const params = {
recipientId: entityId, recipientId: entityId.value,
}; };
const validationMessage = validateMessage(); const validationMessage = validateMessage();
if (validationMessage) return notify(t(validationMessage), 'negative'); if (validationMessage) return notify(t(validationMessage), 'negative');

View File

@ -381,7 +381,7 @@ const isUnsatisfied = async (reason) => {
const resendEmail = async () => { const resendEmail = async () => {
const params = { const params = {
recipient: worker.value?.user?.email, recipient: worker.value[0]?.user?.emailUser?.email,
week: selectedWeekNumber.value, week: selectedWeekNumber.value,
year: selectedDate.value.getFullYear(), year: selectedDate.value.getFullYear(),
workerId: Number(route.params.id), workerId: Number(route.params.id),