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

This commit is contained in:
PAU ROVIRA ROSALENY 2025-01-13 09:04:18 +00:00
commit 4b7b689a6c
12 changed files with 206 additions and 218 deletions

View File

@ -198,6 +198,7 @@ async function fetch() {
} catch (e) { } catch (e) {
state.set(modelValue, {}); state.set(modelValue, {});
originalData.value = {}; originalData.value = {};
throw e;
} }
} }

View File

@ -1,21 +1,13 @@
<script setup> <script setup>
import VnCard from 'components/common/VnCard.vue'; import VnCardBeta from 'components/common/VnCardBeta.vue';
import ClaimDescriptor from './ClaimDescriptor.vue'; import ClaimDescriptor from './ClaimDescriptor.vue';
import ClaimFilter from '../ClaimFilter.vue';
import filter from './ClaimFilter.js'; import filter from './ClaimFilter.js';
</script> </script>
<template> <template>
<VnCard <VnCardBeta
data-key="Claim" data-key="Claim"
base-url="Claims" base-url="Claims"
:descriptor="ClaimDescriptor" :descriptor="ClaimDescriptor"
:filter-panel="ClaimFilter"
search-data-key="ClaimList"
:filter="filter" :filter="filter"
:searchbar-props="{
url: 'Claims/filter',
label: 'Search claim',
info: 'You can search by claim id or customer name',
}"
/> />
</template> </template>

View File

@ -2,18 +2,18 @@
import { ref, computed } from 'vue'; import { ref, computed } from 'vue';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { toDate } from 'filters/index'; import { toDate } from 'filters/index';
import VnSearchbar from 'components/ui/VnSearchbar.vue';
import ClaimFilter from './ClaimFilter.vue'; import ClaimFilter from './ClaimFilter.vue';
import CustomerDescriptorProxy from 'src/pages/Customer/Card/CustomerDescriptorProxy.vue'; import CustomerDescriptorProxy from 'src/pages/Customer/Card/CustomerDescriptorProxy.vue';
import VnUserLink from 'src/components/ui/VnUserLink.vue'; import VnUserLink from 'src/components/ui/VnUserLink.vue';
import ClaimSummary from './Card/ClaimSummary.vue'; 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 VnTable from 'src/components/VnTable/VnTable.vue'; import VnTable from 'src/components/VnTable/VnTable.vue';
import ZoneDescriptorProxy from '../Zone/Card/ZoneDescriptorProxy.vue'; import ZoneDescriptorProxy from '../Zone/Card/ZoneDescriptorProxy.vue';
import VnSection from 'src/components/common/VnSection.vue';
const { t } = useI18n(); const { t } = useI18n();
const { viewSummary } = useSummaryDialog(); const { viewSummary } = useSummaryDialog();
const dataKey = 'ClaimList';
const claimFilterRef = ref(); const claimFilterRef = ref();
const columns = computed(() => [ const columns = computed(() => [
@ -125,23 +125,25 @@ const STATE_COLOR = {
</script> </script>
<template> <template>
<VnSearchbar <VnSection
data-key="ClaimList" :data-key="dataKey"
:label="t('Search claim')" :columns="columns"
:info="t('You can search by claim id or customer name')" prefix="claim"
/> :array-data-props="{
<RightMenu> url: 'Claims/filter',
<template #right-panel> order: ['cs.priority ASC', 'created ASC'],
}"
>
<template #rightMenu>
<ClaimFilter data-key="ClaimList" ref="claimFilterRef" /> <ClaimFilter data-key="ClaimList" ref="claimFilterRef" />
</template> </template>
</RightMenu> <template #body>
<VnTable <VnTable
data-key="ClaimList" :data-key="dataKey"
url="Claims/filter"
:order="['cs.priority ASC', 'created ASC']"
:columns="columns" :columns="columns"
redirect="claim" redirect="claim"
:right-search="false" :right-search="false"
auto-load
> >
<template #column-clientFk="{ row }"> <template #column-clientFk="{ row }">
<span class="link" @click.stop> <span class="link" @click.stop>
@ -162,11 +164,11 @@ const STATE_COLOR = {
</template> </template>
</VnTable> </VnTable>
</template> </template>
</VnSection>
</template>
<i18n> <i18n>
es: es:
Search claim: Buscar reclamación
You can search by claim id or customer name: Puedes buscar por id de la reclamación o nombre del cliente
params: params:
stateCode: Estado stateCode: Estado
en: en:

View File

@ -44,3 +44,5 @@ claim:
fileDescription: 'Claim id {claimId} from client {clientName} id {clientId}' fileDescription: 'Claim id {claimId} from client {clientName} id {clientId}'
noData: 'There are no images/videos, click here or drag and drop the file' noData: 'There are no images/videos, click here or drag and drop the file'
dragDrop: Drag and drop it here dragDrop: Drag and drop it here
search: Search claims
searchInfo: You can search by claim id or customer name

View File

@ -1,5 +1,3 @@
Search claim: Buscar reclamación
You can search by claim id or customer name: Puedes buscar por id de la reclamación o nombre del cliente
claim: claim:
customer: Cliente customer: Cliente
code: Código code: Código
@ -46,3 +44,5 @@ claim:
fileDescription: 'ID de reclamación {claimId} del cliente {clientName} con ID {clientId}' fileDescription: 'ID de reclamación {claimId} del cliente {clientName} con ID {clientId}'
noData: 'No hay imágenes/videos, haz clic aquí o arrastra y suelta el archivo' noData: 'No hay imágenes/videos, haz clic aquí o arrastra y suelta el archivo'
dragDrop: Arrastra y suelta aquí dragDrop: Arrastra y suelta aquí
search: Buscar reclamación
searchInfo: Puedes buscar por ID de la reclamación o nombre del cliente

View File

@ -44,7 +44,10 @@ InvoiceIn:
country: Country country: Country
params: params:
search: Id or supplier name search: Id or supplier name
account: Ledger account
correctingFk: Rectificative
correctedFk: Corrected correctedFk: Corrected
isBooked: Is booked isBooked: Is booked
invoicein:
params:
account: Ledger account
correctingFk: Rectificative

View File

@ -42,6 +42,9 @@ InvoiceIn:
country: País country: País
params: params:
search: Id o nombre proveedor search: Id o nombre proveedor
correctedFk: Rectificada
invoicein:
params:
account: Cuenta contable account: Cuenta contable
correctingFk: Rectificativa correctingFk: Rectificativa
correctedFk: Rectificada

View File

@ -1,68 +1,28 @@
src/pages/Worker/Card/WorkerPBX.vue
<script setup> <script setup>
import { watch, ref } from 'vue';
import { useI18n } from 'vue-i18n';
import { useRoute } from 'vue-router';
import { useState } from 'src/composables/useState';
import FormModel from 'src/components/FormModel.vue'; import FormModel from 'src/components/FormModel.vue';
import VnRow from 'components/ui/VnRow.vue';
import VnInput from 'src/components/common/VnInput.vue'; import VnInput from 'src/components/common/VnInput.vue';
const { t } = useI18n();
const state = useState();
const route = useRoute();
const workerPBXForm = ref();
const extension = ref(null);
const filter = {
include: [
{
relation: 'sip',
},
],
};
watch(
() => route.params.id,
() => state.set('extension', null)
);
const onFetch = (data) => {
state.set('extension', data?.sip?.extension);
extension.value = state.get('extension');
};
const updateModelValue = (data) => {
state.set('extension', data);
workerPBXForm.value.hasChanges = true;
};
</script> </script>
<template> <template>
<FormModel <FormModel
ref="workerPBXForm" model="WorkerPbx"
:filter="filter" :url="`Workers/${$route.params.id}/sip`"
:url="`Workers/${route.params.id}`"
url-update="Sips" url-update="Sips"
auto-load
:mapper=" :mapper="
() => ({ ({ userFk, extension }) => ({
userFk: +route.params.id, userFk,
extension, extension,
}) })
" "
model="DeviceProductionUser" auto-load
@on-fetch="onFetch"
> >
<template #form="{}"> <template #form="{ data }">
<VnRow>
<VnInput <VnInput
:label="t('worker.summary.sipExtension')" :label="$t('worker.summary.sipExtension')"
v-model="extension" v-model="data.extension"
@update:model-value="updateModelValue"
/> />
</VnRow>
</template> </template>
</FormModel> </FormModel>
</template> </template>

View File

@ -100,6 +100,16 @@ const agencyOptions = ref([]);
required="true" required="true"
clearable clearable
/> />
<VnInput
v-model="data.priceOptimum"
:label="t('Price optimum')"
type="number"
min="0"
required="true"
clearable
/>
</VnRow>
<VnRow>
<VnInput <VnInput
v-model="data.bonus" v-model="data.bonus"
:label="t('Bonus')" :label="t('Bonus')"
@ -107,8 +117,6 @@ const agencyOptions = ref([]);
min="0" min="0"
clearable clearable
/> />
</VnRow>
<VnRow>
<VnSelect <VnSelect
:label="t('Distribution point')" :label="t('Distribution point')"
v-model="data.addressFk" v-model="data.addressFk"
@ -152,6 +160,7 @@ es:
Traveling days: Dias de viaje Traveling days: Dias de viaje
Closing: Cierre Closing: Cierre
Price: Precio Price: Precio
Price optimum: Precio óptimo
Bonus: Bonificación Bonus: Bonificación
Inflation: Inflación Inflation: Inflación
Volumetric: Volumétrico Volumetric: Volumétrico

View File

@ -182,13 +182,19 @@ onMounted(() => {
min="0" min="0"
/> />
<VnInput <VnInput
v-model="eventInclusionFormData.bonus" v-model="eventInclusionFormData.priceOptimum"
:label="t('zone.bonus')" :label="t('list.priceOptimum')"
type="number" type="number"
min="0" min="0"
/> />
</VnRow> </VnRow>
<VnRow> <VnRow>
<VnInput
v-model="eventInclusionFormData.bonus"
:label="t('zone.bonus')"
type="number"
min="0"
/>
<VnInput <VnInput
v-model="eventInclusionFormData.m3Max" v-model="eventInclusionFormData.m3Max"
:label="t('zone.m3Max')" :label="t('zone.m3Max')"

View File

@ -22,6 +22,7 @@ list:
agency: Agencia agency: Agencia
close: Cierre close: Cierre
price: Precio price: Precio
priceOptimum: Precio óptimo
create: Crear zona create: Crear zona
openSummary: Detalles openSummary: Detalles
searchZone: Buscar zonas searchZone: Buscar zonas

View File

@ -1,19 +1,12 @@
import { RouterView } from 'vue-router'; import { RouterView } from 'vue-router';
export default { const claimCard = {
name: 'Claim', name: 'ClaimCard',
path: '/claim', path: ':id',
component: () => import('src/pages/Claim/Card/ClaimCard.vue'),
redirect: { name: 'ClaimSummary' },
meta: { meta: {
title: 'claims', menu: [
icon: 'vn:claims',
moduleName: 'Claim',
keyBinding: 'r',
},
component: RouterView,
redirect: { name: 'ClaimMain' },
menus: {
main: ['ClaimList'],
card: [
'ClaimBasicData', 'ClaimBasicData',
'ClaimLines', 'ClaimLines',
'ClaimPhotos', 'ClaimPhotos',
@ -25,31 +18,8 @@ export default {
}, },
children: [ children: [
{ {
name: 'ClaimMain',
path: '',
component: () => import('src/components/common/VnModule.vue'),
redirect: { name: 'ClaimList' },
children: [
{
name: 'ClaimList',
path: 'list',
meta: {
title: 'list',
icon: 'view_list',
},
component: () => import('src/pages/Claim/ClaimList.vue'),
},
],
},
{
name: 'ClaimCard',
path: ':id',
component: () => import('src/pages/Claim/Card/ClaimCard.vue'),
redirect: { name: 'ClaimSummary' },
children: [
{
name: 'ClaimSummary',
path: 'summary', path: 'summary',
name: 'ClaimSummary',
meta: { meta: {
title: 'summary', title: 'summary',
icon: 'launch', icon: 'launch',
@ -57,8 +27,8 @@ export default {
component: () => import('src/pages/Claim/Card/ClaimSummary.vue'), component: () => import('src/pages/Claim/Card/ClaimSummary.vue'),
}, },
{ {
name: 'ClaimBasicData',
path: 'basic-data', path: 'basic-data',
name: 'ClaimBasicData',
meta: { meta: {
title: 'basicData', title: 'basicData',
icon: 'vn:settings', icon: 'vn:settings',
@ -67,8 +37,8 @@ export default {
component: () => import('src/pages/Claim/Card/ClaimBasicData.vue'), component: () => import('src/pages/Claim/Card/ClaimBasicData.vue'),
}, },
{ {
name: 'ClaimLines',
path: 'lines', path: 'lines',
name: 'ClaimLines',
meta: { meta: {
title: 'lines', title: 'lines',
icon: 'vn:details', icon: 'vn:details',
@ -76,8 +46,8 @@ export default {
component: () => import('src/pages/Claim/Card/ClaimLines.vue'), component: () => import('src/pages/Claim/Card/ClaimLines.vue'),
}, },
{ {
name: 'ClaimPhotos',
path: 'photos', path: 'photos',
name: 'ClaimPhotos',
meta: { meta: {
title: 'photos', title: 'photos',
icon: 'image', icon: 'image',
@ -85,8 +55,8 @@ export default {
component: () => import('src/pages/Claim/Card/ClaimPhoto.vue'), component: () => import('src/pages/Claim/Card/ClaimPhoto.vue'),
}, },
{ {
name: 'ClaimNotes',
path: 'notes', path: 'notes',
name: 'ClaimNotes',
meta: { meta: {
title: 'notes', title: 'notes',
icon: 'draft', icon: 'draft',
@ -94,8 +64,8 @@ export default {
component: () => import('src/pages/Claim/Card/ClaimNotes.vue'), component: () => import('src/pages/Claim/Card/ClaimNotes.vue'),
}, },
{ {
name: 'ClaimDevelopment',
path: 'development', path: 'development',
name: 'ClaimDevelopment',
meta: { meta: {
title: 'development', title: 'development',
icon: 'vn:traceability', icon: 'vn:traceability',
@ -110,8 +80,8 @@ export default {
component: () => import('src/pages/Claim/Card/ClaimDevelopment.vue'), component: () => import('src/pages/Claim/Card/ClaimDevelopment.vue'),
}, },
{ {
name: 'ClaimAction',
path: 'action', path: 'action',
name: 'ClaimAction',
meta: { meta: {
title: 'action', title: 'action',
icon: 'vn:actions', icon: 'vn:actions',
@ -119,8 +89,8 @@ export default {
component: () => import('src/pages/Claim/Card/ClaimAction.vue'), component: () => import('src/pages/Claim/Card/ClaimAction.vue'),
}, },
{ {
name: 'ClaimLog',
path: 'log', path: 'log',
name: 'ClaimLog',
meta: { meta: {
title: 'log', title: 'log',
icon: 'history', icon: 'history',
@ -128,6 +98,45 @@ export default {
component: () => import('src/pages/Claim/Card/ClaimLog.vue'), component: () => import('src/pages/Claim/Card/ClaimLog.vue'),
}, },
], ],
}
export default {
name: 'Claim',
path: '/claim',
meta: {
title: 'claims',
icon: 'vn:claims',
moduleName: 'Claim',
keyBinding: 'r',
menu: ['ClaimList'],
},
component: RouterView,
redirect: { name: 'ClaimMain' },
children: [
{
name: 'ClaimMain',
path: '',
component: () => import('src/components/common/VnModule.vue'),
redirect: { name: 'ClaimIndexMain' },
children: [
{
path: '',
name: 'ClaimIndexMain',
redirect: { name: 'ClaimList' },
component: () => import('src/pages/Claim/ClaimList.vue'),
children: [
{
name: 'ClaimList',
path: 'list',
meta: {
title: 'list',
icon: 'view_list',
},
},
claimCard,
],
},
],
}, },
], ],
}; };