Merge branch 'master' of https://gitea.verdnatura.es/verdnatura/salix-front into hotfix_negative_available
gitea/salix-front/pipeline/pr-master This commit is unstable Details

This commit is contained in:
Javier Segarra 2025-04-11 10:06:21 +02:00
commit 37bc464a98
16 changed files with 92 additions and 78 deletions

View File

@ -1,6 +1,6 @@
<script setup> <script setup>
import { watch } from 'vue'; import { watch } from 'vue';
import { toDateString } from 'src/filters'; import { toDateHourMinSec } from 'src/filters';
const props = defineProps({ const props = defineProps({
value: { type: [String, Number, Boolean, Object], default: undefined }, value: { type: [String, Number, Boolean, Object], default: undefined },
@ -40,7 +40,7 @@ const updateValue = () => {
break; break;
case 'object': case 'object':
if (props.value instanceof Date) { if (props.value instanceof Date) {
t = toDateString(props.value); t = toDateHourMinSec(props.value);
} else { } else {
t = props.value.toString(); t = props.value.toString();
} }

View File

@ -68,7 +68,6 @@ const filter = {
}, },
}, },
], ],
where: { and: [{ originFk: route.params.id }] },
}; };
const paginate = ref(); const paginate = ref();
@ -267,13 +266,6 @@ onMounted(() => {
onUnmounted(() => { onUnmounted(() => {
stateStore.rightDrawer = false; stateStore.rightDrawer = false;
}); });
watch(
() => router.currentRoute.value.params.id,
() => {
applyFilter();
},
);
</script> </script>
<template> <template>
<VnPaginate <VnPaginate
@ -281,6 +273,7 @@ watch(
:data-key :data-key
:url="dataKey + 's'" :url="dataKey + 's'"
:user-filter="filter" :user-filter="filter"
:filter="{ where: { and: [{ originFk: route.params.id }] } }"
:skeleton="false" :skeleton="false"
auto-load auto-load
@on-fetch="setLogTree" @on-fetch="setLogTree"

View File

@ -39,7 +39,7 @@ const checkboxOptions = ref([
{ name: 'select', label: 'Accesses', selected: false }, { name: 'select', label: 'Accesses', selected: false },
]); ]);
const columns = computed(() => [ const columns = computed(() => [
{ name: 'changedModelValue' }, { name: 'changedModelValue', orderBy: 'id' },
{ name: 'changedModel' }, { name: 'changedModel' },
{ name: 'userType', orderBy: false }, { name: 'userType', orderBy: false },
{ name: 'userFk' }, { name: 'userFk' },

View File

@ -65,7 +65,7 @@ describe('VnJsonValue', () => {
const date = new Date('2023-01-01'); const date = new Date('2023-01-01');
const wrapper = buildComponent({ value: date }); const wrapper = buildComponent({ value: date });
const span = wrapper.find('span'); const span = wrapper.find('span');
expect(span.text()).toBe('2023-01-01'); expect(span.text()).toBe('01/01/2023, 01:00:00');
expect(span.classes()).toContain('json-object'); expect(span.classes()).toContain('json-object');
}); });

View File

@ -6,6 +6,7 @@ import { computed } from 'vue';
const $props = defineProps({ const $props = defineProps({
label: { type: String, default: null }, label: { type: String, default: null },
tooltip: { type: String, default: null },
value: { value: {
type: [String, Boolean, Number], type: [String, Boolean, Number],
default: null, default: null,
@ -40,7 +41,10 @@ const val = computed(() => $props.value);
<template v-else> <template v-else>
<div v-if="label || $slots.label" class="label"> <div v-if="label || $slots.label" class="label">
<slot name="label"> <slot name="label">
<span style="color: var(--vn-label-color)">{{ label }}</span> <QTooltip v-if="tooltip">{{ tooltip }}</QTooltip>
<span style="color: var(--vn-label-color)">
{{ label }}
</span>
</slot> </slot>
</div> </div>
<div class="value" v-if="value || $slots.value"> <div class="value" v-if="value || $slots.value">

View File

@ -131,6 +131,7 @@ const columns = computed(() => [
name: 'isConciliate', name: 'isConciliate',
label: t('Conciliated'), label: t('Conciliated'),
cardVisible: true, cardVisible: true,
component: 'checkbox',
}, },
{ {
align: 'left', align: 'left',

View File

@ -208,7 +208,8 @@ const sumRisk = ({ clientRisks }) => {
:text="t('customer.summary.consignee')" :text="t('customer.summary.consignee')"
/> />
<VnLv <VnLv
:label="t('customer.summary.addressName')" :tooltip="t('customer.summary.addressName')"
:label="t('customer.summary.addressNameAbbr')"
:value="entity.defaultAddress.nickname" :value="entity.defaultAddress.nickname"
/> />
<VnLv <VnLv
@ -252,7 +253,8 @@ const sumRisk = ({ clientRisks }) => {
/> />
<VnLv <VnLv
v-if="entity.claimsRatio" v-if="entity.claimsRatio"
:label="t('customer.summary.priceIncreasingRate')" :tooltip="t('customer.summary.priceIncreasingRate')"
:label="t('customer.summary.priceIncreasingRateAbbr')"
:value="toPercentage(priceIncreasingRate)" :value="toPercentage(priceIncreasingRate)"
/> />
<VnLv <VnLv
@ -261,7 +263,8 @@ const sumRisk = ({ clientRisks }) => {
/> />
<VnLv <VnLv
v-if="entity.claimsRatio" v-if="entity.claimsRatio"
:label="t('customer.summary.claimRate')" :label="t('customer.summary.claimRateAbbr')"
:tooltip="t('customer.summary.claimRate')"
:value="toPercentage(claimRate)" :value="toPercentage(claimRate)"
/> />
</QCard> </QCard>
@ -318,8 +321,9 @@ const sumRisk = ({ clientRisks }) => {
/> />
<VnLv <VnLv
:label="t('customer.summary.recommendCredit')" :label="t('customer.summary.recommendCreditAbbr')"
:value="entity.recommendedCredit" :tooltip="t('customer.summary.recommendCredit')"
:value="toCurrency(entity.recommendedCredit)"
/> />
</QCard> </QCard>
<QCard class="vn-max"> <QCard class="vn-max">

View File

@ -111,14 +111,11 @@ const columns = computed(() => [
component: 'number', component: 'number',
}, },
columnField: { columnField: {
component: null, component: markRaw(VnLinkPhone),
after: { attrs: ({ model }) => {
component: markRaw(VnLinkPhone), return {
attrs: ({ model }) => { 'phone-number': model,
return { };
'phone-number': model,
};
},
}, },
}, },
}, },

View File

@ -42,14 +42,17 @@ customer:
hasCoreVnl: Has core VNL hasCoreVnl: Has core VNL
hasB2BVnl: Has B2B VNL hasB2BVnl: Has B2B VNL
addressName: Address name addressName: Address name
addressNameAbbr: A. Name
addressCity: City addressCity: City
username: Username username: Username
webAccess: Web access webAccess: Web access
totalGreuge: Total greuge totalGreuge: Total greuge
mana: Mana mana: Mana
priceIncreasingRate: Price increasing rate priceIncreasingRate: Price increasing rate
priceIncreasingRateAbbr: Price inc. rate
averageInvoiced: Average invoiced averageInvoiced: Average invoiced
claimRate: Claming rate claimRate: Claming rate
claimRateAbbr: Claim. rate
payMethodFk: Billing data payMethodFk: Billing data
risk: Risk risk: Risk
maximumRisk: Solunion's maximum risk maximumRisk: Solunion's maximum risk
@ -68,6 +71,7 @@ customer:
descriptorInfo: Invoices minus payments plus orders not yet descriptorInfo: Invoices minus payments plus orders not yet
rating: Rating rating: Rating
recommendCredit: Recommended credit recommendCredit: Recommended credit
recommendCreditAbbr: Rec. credit
goToLines: Go to lines goToLines: Go to lines
basicData: basicData:
socialName: Fiscal name socialName: Fiscal name

View File

@ -42,14 +42,17 @@ customer:
hasCoreVnl: Recibido core VNL hasCoreVnl: Recibido core VNL
hasB2BVnl: Recibido B2B VNL hasB2BVnl: Recibido B2B VNL
addressName: Nombre de la dirección addressName: Nombre de la dirección
addressNameAbbr: N. Dirección
addressCity: Ciudad addressCity: Ciudad
username: Usuario username: Usuario
webAccess: Acceso web webAccess: Acceso web
totalGreuge: Greuge total totalGreuge: Greuge total
mana: Maná mana: Maná
priceIncreasingRate: Ratio de incremento de precio priceIncreasingRate: Ratio de incremento de precio
priceIncreasingRateAbbr: R. Inc. Precio
averageInvoiced: Facturación media averageInvoiced: Facturación media
claimRate: Ratio de reclamaciones claimRate: Ratio de reclamaciones
claimRateAbbr: R. Reclamaciones
maximumRisk: Riesgo máximo asumido por Solunion maximumRisk: Riesgo máximo asumido por Solunion
payMethodFk: Forma de pago payMethodFk: Forma de pago
risk: Riesgo risk: Riesgo
@ -68,6 +71,7 @@ customer:
descriptorInfo: Facturas menos recibos mas pedidos sin facturar descriptorInfo: Facturas menos recibos mas pedidos sin facturar
rating: Clasificación rating: Clasificación
recommendCredit: Crédito recomendado recommendCredit: Crédito recomendado
recommendCreditAbbr: Cr. Recomendado
goToLines: Ir a líneas goToLines: Ir a líneas
basicData: basicData:
socialName: Nombre fiscal socialName: Nombre fiscal

View File

@ -38,7 +38,9 @@ function handleDelete(row) {
ticketNotesCrudRef.value.remove([row]); ticketNotesCrudRef.value.remove([row]);
} }
async function handleSave() { async function handleSave(e) {
if (e.shiftKey && e.key === 'Enter') return;
e.preventDefault();
if (!isSaving.value) { if (!isSaving.value) {
isSaving.value = true; isSaving.value = true;
await ticketNotesCrudRef.value?.saveChanges(); await ticketNotesCrudRef.value?.saveChanges();
@ -70,7 +72,7 @@ async function handleSave() {
<div <div
v-for="(row, index) in rows" v-for="(row, index) in rows"
:key="index" :key="index"
class="q-mb-md row items-center q-gutter-x-md" class="q-mb-md row q-gutter-x-md"
> >
<VnSelect <VnSelect
:label="t('ticketNotes.observationType')" :label="t('ticketNotes.observationType')"
@ -86,7 +88,8 @@ async function handleSave() {
:label="t('basicData.description')" :label="t('basicData.description')"
v-model="row.description" v-model="row.description"
class="col" class="col"
@keyup.enter="handleSave" @keydown.enter.stop="handleSave"
autogrow
data-cy="ticketNotesDescription" data-cy="ticketNotesDescription"
/> />
<QIcon <QIcon

View File

@ -241,6 +241,7 @@ onMounted(async () => {
:value="`${entity.address?.nickname} #${entity.address?.id}`" :value="`${entity.address?.nickname} #${entity.address?.id}`"
/> />
<VnLv <VnLv
class="white-space-normal"
:label="t('ticket.summary.consigneeStreet')" :label="t('ticket.summary.consigneeStreet')"
:value="formattedAddress" :value="formattedAddress"
/> />
@ -524,4 +525,7 @@ onMounted(async () => {
.grafana { .grafana {
color: $primary-light; color: $primary-light;
} }
.white-space-normal :deep(.value span) {
white-space: normal;
}
</style> </style>

View File

@ -273,6 +273,7 @@ en:
orderFk: Order orderFk: Order
from: From from: From
shipped: Shipped shipped: Shipped
shippedDate: Shipped date
to: To to: To
stateFk: State stateFk: State
groupedStates: Grouped State groupedStates: Grouped State
@ -300,6 +301,7 @@ es:
orderFk: Pedido orderFk: Pedido
from: Desde from: Desde
shipped: F. envío shipped: F. envío
shippedDate: F. envío
to: Hasta to: Hasta
stateFk: Estado stateFk: Estado
groupedStates: Estado agrupado groupedStates: Estado agrupado

View File

@ -113,13 +113,13 @@ const columns = computed(() => [
}, },
{ {
align: 'left', align: 'left',
name: 'shippedDate', name: 'shipped',
cardVisible: true, cardVisible: true,
label: t('ticketList.shipped'), label: t('ticketList.shipped'),
columnFilter: { columnFilter: {
component: 'date', component: 'date',
}, },
format: ({ shippedDate }) => toDate(shippedDate), format: ({ shipped }) => toDate(shipped),
}, },
{ {
align: 'left', align: 'left',
@ -477,7 +477,7 @@ function setReference(data) {
prefix="card" prefix="card"
:array-data-props="{ :array-data-props="{
url: 'Tickets/filter', url: 'Tickets/filter',
order: ['shippedDate DESC', 'shippedHour ASC', 'zoneLanding ASC', 'id'], order: ['shipped DESC', 'shippedHour ASC', 'zoneLanding ASC', 'id'],
exprBuilder, exprBuilder,
}" }"
> >
@ -515,10 +515,10 @@ function setReference(data) {
<DepartmentDescriptorProxy :id="row.departmentFk" /> <DepartmentDescriptorProxy :id="row.departmentFk" />
</span> </span>
</template> </template>
<template #column-shippedDate="{ row }"> <template #column-shipped="{ row }">
<span v-if="getDateColor(row.shipped)"> <span v-if="getDateColor(row.shipped)">
<QChip :class="getDateColor(row.shipped)" dense square> <QChip :class="getDateColor(row.shipped)" dense square>
{{ toDate(row.shippedDate) }} {{ toDate(row.shipped) }}
</QChip> </QChip>
</span> </span>
</template> </template>

View File

@ -166,50 +166,44 @@ const yearList = ref(generateYears());
}} }}
</QCardSection> </QCardSection>
</div> </div>
<QList dense class="list q-gutter-y-sm q-my-lg"> <div dense class="column q-gutter-y-sm q-px-md">
<QItem> <VnSelect
<QItemSection> :label="t('Year')"
<VnSelect v-model="selectedYear"
:label="t('Year')" :options="yearList"
v-model="selectedYear" dense
:options="yearList" filled
dense use-input
filled :is-clearable="false"
use-input />
:is-clearable="false" <VnSelect
/> :label="t('Contract')"
</QItemSection> v-model="selectedBusinessFk"
<QItemSection> :options="contractList"
<VnSelect option-value="businessFk"
:label="t('Contract')" option-label="businessFk"
v-model="selectedBusinessFk" dense
:options="contractList" filled
option-value="businessFk" use-input
option-label="businessFk" :is-clearable="false"
dense >
filled <template #option="scope">
use-input <QItem v-bind="scope.itemProps">
:is-clearable="false" <QItemSection>
> <QItemLabel># {{ scope.opt?.businessFk }}</QItemLabel>
<template #option="scope"> <QItemLabel caption>
<QItem v-bind="scope.itemProps"> {{ toDateFormat(scope.opt?.started) }} -
<QItemSection> {{
<QItemLabel># {{ scope.opt?.businessFk }}</QItemLabel> scope.opt?.ended
<QItemLabel caption> ? toDateFormat(scope.opt?.ended)
{{ toDateFormat(scope.opt?.started) }} - : 'Indef.'
{{ }}
scope.opt?.ended </QItemLabel>
? toDateFormat(scope.opt?.ended) </QItemSection>
: 'Indef.' </QItem>
}} </template>
</QItemLabel> </VnSelect>
</QItemSection> </div>
</QItem>
</template>
</VnSelect>
</QItemSection>
</QItem>
</QList>
<QList dense class="list q-gutter-y-xs q-my-md"> <QList dense class="list q-gutter-y-xs q-my-md">
<QItem v-for="type in absenceTypeList" :key="type.id"> <QItem v-for="type in absenceTypeList" :key="type.id">
<WorkerEventLabel <WorkerEventLabel

View File

@ -20,6 +20,7 @@ const { notify } = useNotify();
const loadingDocuware = ref(true); const loadingDocuware = ref(true);
const tableRef = ref(); const tableRef = ref();
const dialog = ref(); const dialog = ref();
const getAvailablePdaRef = ref();
const route = useRoute(); const route = useRoute();
const { openConfirmationModal } = useVnConfirm(); const { openConfirmationModal } = useVnConfirm();
const routeId = computed(() => route.params.id); const routeId = computed(() => route.params.id);
@ -84,6 +85,7 @@ function reloadData() {
initialData.value.deviceProductionFk = null; initialData.value.deviceProductionFk = null;
initialData.value.simFk = null; initialData.value.simFk = null;
tableRef.value.reload(); tableRef.value.reload();
getAvailablePdaRef.value.fetch();
} }
async function fetchDocuware() { async function fetchDocuware() {
@ -135,6 +137,7 @@ async function deallocatePDA(deviceProductionFk) {
); );
delete tableRef.value.CrudModelRef.formData[index]; delete tableRef.value.CrudModelRef.formData[index];
notify(t('PDA deallocated'), 'positive'); notify(t('PDA deallocated'), 'positive');
await getAvailablePdaRef.value.fetch();
} }
function isSigned(row) { function isSigned(row) {
@ -144,6 +147,7 @@ function isSigned(row) {
<template> <template>
<FetchData <FetchData
ref="getAvailablePdaRef"
url="workers/getAvailablePda" url="workers/getAvailablePda"
@on-fetch="(data) => (deviceProductions = data)" @on-fetch="(data) => (deviceProductions = data)"
auto-load auto-load