feat: #7079 created VnLocation front test #1126

Merged
provira merged 6 commits from 7079-testVnLocation into dev 2024-12-24 13:08:11 +00:00
6 changed files with 50 additions and 37 deletions
Showing only changes of commit 4f60544a1e - Show all commits

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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