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

View File

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

View File

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

View File

@ -65,7 +65,7 @@ describe('VnJsonValue', () => {
const date = new Date('2023-01-01');
const wrapper = buildComponent({ value: date });
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');
});

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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