Merge branch 'test' of https://gitea.verdnatura.es/verdnatura/salix-front into dev
gitea/salix-front/pipeline/head This commit looks good Details

This commit is contained in:
Alex Moreno 2025-01-21 07:33:09 +01:00
commit 824b60df57
17 changed files with 55 additions and 25 deletions

View File

@ -105,6 +105,7 @@ const manageDate = (date) => {
:rules="mixinRules" :rules="mixinRules"
:clearable="false" :clearable="false"
@click="isPopupOpen = !isPopupOpen" @click="isPopupOpen = !isPopupOpen"
@keydown="isPopupOpen = false"
hide-bottom-space hide-bottom-space
> >
<template #append> <template #append>

View File

@ -79,6 +79,7 @@ function dateToTime(newDate) {
style="min-width: 100px" style="min-width: 100px"
:rules="mixinRules" :rules="mixinRules"
@click="isPopupOpen = !isPopupOpen" @click="isPopupOpen = !isPopupOpen"
@keydown="isPopupOpen = false"
type="time" type="time"
hide-bottom-space hide-bottom-space
> >

View File

@ -294,7 +294,7 @@ async function onScroll({ to, direction, from, index }) {
} }
} }
defineExpose({ opts: myOptions }); defineExpose({ opts: myOptions, vnSelectRef });
function handleKeyDown(event) { function handleKeyDown(event) {
if (event.key === 'Tab' && !event.shiftKey) { if (event.key === 'Tab' && !event.shiftKey) {

View File

@ -1,5 +1,5 @@
<script setup> <script setup>
import { computed } from 'vue'; import { ref, computed } from 'vue';
import { useRole } from 'src/composables/useRole'; import { useRole } from 'src/composables/useRole';
import { useAcl } from 'src/composables/useAcl'; import { useAcl } from 'src/composables/useAcl';
@ -7,6 +7,7 @@ import VnSelect from 'src/components/common/VnSelect.vue';
const emit = defineEmits(['update:modelValue']); const emit = defineEmits(['update:modelValue']);
const value = defineModel({ type: [String, Number, Object] }); const value = defineModel({ type: [String, Number, Object] });
const select = ref(null);
const $props = defineProps({ const $props = defineProps({
rolesAllowedToCreate: { rolesAllowedToCreate: {
type: Array, type: Array,
@ -33,10 +34,13 @@ const isAllowedToCreate = computed(() => {
if ($props.acls.length) return acl.hasAny($props.acls); if ($props.acls.length) return acl.hasAny($props.acls);
return role.hasAny($props.rolesAllowedToCreate); return role.hasAny($props.rolesAllowedToCreate);
}); });
defineExpose({ vnSelectDialogRef: select });
</script> </script>
<template> <template>
<VnSelect <VnSelect
ref="select"
v-model="value" v-model="value"
v-bind="$attrs" v-bind="$attrs"
@update:model-value="(...args) => emit('update:modelValue', ...args)" @update:model-value="(...args) => emit('update:modelValue', ...args)"

View File

@ -310,6 +310,14 @@ input::-webkit-inner-spin-button {
.no-visible { .no-visible {
visibility: hidden; visibility: hidden;
} }
.q-item > .q-item__section:has(.q-checkbox) {
max-width: min-content;
}
.row > .column:has(.q-checkbox) {
max-width: min-content;
}
.q-field__inner { .q-field__inner {
.q-field__control { .q-field__control {
min-height: auto !important; min-height: auto !important;

View File

@ -704,6 +704,7 @@ travel:
totalEntries: Total entries totalEntries: Total entries
totalEntriesTooltip: Total entries totalEntriesTooltip: Total entries
daysOnward: Landed days onwards daysOnward: Landed days onwards
awb: AWB
summary: summary:
entryId: Entry Id entryId: Entry Id
freight: Freight freight: Freight

View File

@ -700,6 +700,7 @@ travel:
totalEntries: totalEntries:
totalEntriesTooltip: Entradas totales totalEntriesTooltip: Entradas totales
daysOnward: Días de llegada en adelante daysOnward: Días de llegada en adelante
awb: AWB
summary: summary:
entryId: Id entrada entryId: Id entrada
freight: Porte freight: Porte

View File

@ -38,7 +38,7 @@ const getBankEntities = (data, formData) => {
hide-selected hide-selected
option-label="name" option-label="name"
option-value="id" option-value="id"
v-model="data.payMethod" v-model="data.payMethodFk"
/> />
<VnInput :label="t('Due day')" clearable v-model="data.dueDay" /> <VnInput :label="t('Due day')" clearable v-model="data.dueDay" />
</VnRow> </VnRow>

View File

@ -59,6 +59,7 @@ const columns = computed(() => [
</script> </script>
<template> <template>
<VnTable <VnTable
:user-filter="{ include: filter.include }"
ref="tableRef" ref="tableRef"
data-key="ClientCredit" data-key="ClientCredit"
url="ClientCredits" url="ClientCredits"

View File

@ -84,6 +84,7 @@ const columns = computed(() => [
component: 'number', component: 'number',
autofocus: true, autofocus: true,
required: true, required: true,
positive: false,
}, },
format: ({ amount }) => toCurrency(amount), format: ({ amount }) => toCurrency(amount),
create: true, create: true,

View File

@ -25,6 +25,7 @@ const sageTaxTypes = ref([]);
const sageTransactionTypes = ref([]); const sageTransactionTypes = ref([]);
const rowsSelected = ref([]); const rowsSelected = ref([]);
const invoiceInFormRef = ref(); const invoiceInFormRef = ref();
const expenseRef = ref();
defineProps({ defineProps({
actionIcon: { actionIcon: {
@ -128,7 +129,7 @@ function autocompleteExpense(evt, row, col) {
({ id }) => id == useAccountShortToStandard(param) ({ id }) => id == useAccountShortToStandard(param)
); );
if (lookup) row[col.model] = lookup; expenseRef.value.vnSelectDialogRef.vnSelectRef.toggleOption(lookup);
} }
</script> </script>
<template> <template>
@ -167,6 +168,7 @@ function autocompleteExpense(evt, row, col) {
<template #body-cell-expense="{ row, col }"> <template #body-cell-expense="{ row, col }">
<QTd> <QTd>
<VnSelectDialog <VnSelectDialog
ref="expenseRef"
v-model="row[col.model]" v-model="row[col.model]"
:options="col.options" :options="col.options"
:option-value="col.optionValue" :option-value="col.optionValue"

View File

@ -68,6 +68,8 @@ function handleLocation(data, location) {
'supplierActivityFk', 'supplierActivityFk',
'healthRegister', 'healthRegister',
'street', 'street',
'isVies',
'isTrucker',
], ],
include: [ include: [
{ {

View File

@ -54,7 +54,6 @@ const transfer = ref({
}); });
const tableRef = ref([]); const tableRef = ref([]);
const canProceed = ref(); const canProceed = ref();
const isLoading = ref(false);
watch( watch(
() => route.params.id, () => route.params.id,
@ -197,6 +196,7 @@ const changeQuantity = async (sale) => {
try { try {
if (!rowToUpdate.value) return; if (!rowToUpdate.value) return;
rowToUpdate.value = null; rowToUpdate.value = null;
sale.isNew = false;
await updateQuantity(sale); await updateQuantity(sale);
} catch (e) { } catch (e) {
const { quantity } = tableRef.value.CrudModelRef.originalData.find( const { quantity } = tableRef.value.CrudModelRef.originalData.find(
@ -214,9 +214,6 @@ const updateQuantity = async ({ quantity, id }) => {
}; };
const addSale = async (sale) => { const addSale = async (sale) => {
if (isLoading.value) return;
isLoading.value = true;
const params = { const params = {
barcode: sale.itemFk, barcode: sale.itemFk,
quantity: sale.quantity, quantity: sale.quantity,
@ -237,6 +234,7 @@ const addSale = async (sale) => {
sale.item = newSale.item; sale.item = newSale.item;
notify('globals.dataSaved', 'positive'); notify('globals.dataSaved', 'positive');
sale.isNew = false;
arrayData.fetch({}); arrayData.fetch({});
}; };
@ -754,6 +752,7 @@ watch(
option-label="name" option-label="name"
option-value="id" option-value="id"
v-model="row.itemFk" v-model="row.itemFk"
:use-like="false"
@update:model-value="updateItem(row)" @update:model-value="updateItem(row)"
> >
<template #option="scope"> <template #option="scope">

View File

@ -166,6 +166,7 @@ async function handleSave() {
v-model="row.ticketServiceTypeFk" v-model="row.ticketServiceTypeFk"
:options="ticketServiceOptions" :options="ticketServiceOptions"
option-label="name" option-label="name"
:roles-allowed-to-create="['administrative']"
option-value="id" option-value="id"
hide-selected hide-selected
> >

View File

@ -79,6 +79,13 @@ const columns = computed(() => [
cardVisible: true, cardVisible: true,
create: true, create: true,
}, },
{
align: 'left',
name: 'awb',
label: t('travel.travelList.tableVisibleColumns.awb'),
columnFilter: false,
format: (row) => row.awbCode,
},
{ {
align: 'left', align: 'left',
name: 'warehouseInFk', name: 'warehouseInFk',

View File

@ -27,7 +27,7 @@ const initialData = computed(() => {
return { return {
userFk: routeId.value, userFk: routeId.value,
deviceProductionFk: null, deviceProductionFk: null,
simSerialNumber: null, simFk: null,
}; };
}); });
@ -42,7 +42,7 @@ const deallocatePDA = async (deviceProductionFk) => {
function reloadData() { function reloadData() {
initialData.value.deviceProductionFk = null; initialData.value.deviceProductionFk = null;
initialData.value.simSerialNumber = null; initialData.value.simFk = null;
paginate.value.fetch(); paginate.value.fetch();
} }
</script> </script>
@ -89,7 +89,7 @@ function reloadData() {
/> />
<VnInput <VnInput
:label="t('Current SIM')" :label="t('Current SIM')"
:model-value="row?.simSerialNumber" :model-value="row?.simFk"
disable disable
/> />
<QBtn <QBtn
@ -150,7 +150,7 @@ function reloadData() {
</template> </template>
</VnSelect> </VnSelect>
<VnInput <VnInput
v-model="data.simSerialNumber" v-model="data.simFk"
:label="t('SIM serial number')" :label="t('SIM serial number')"
id="simSerialNumber" id="simSerialNumber"
use-input use-input

View File

@ -283,21 +283,22 @@ const fetchWeekData = async () => {
year: selectedDateYear.value, year: selectedDateYear.value,
week: selectedWeekNumber.value, week: selectedWeekNumber.value,
}; };
const mail = ( try {
await axiosNoError.get(`Workers/${route.params.id}/mail`, { const [{ data: mailData }, { data: countData }] = await Promise.all([
params: { filter: { where } }, axiosNoError.get(`Workers/${route.params.id}/mail`, {
}) params: { filter: { where } },
).data[0]; }),
axiosNoError.get('WorkerTimeControlMails/count', { params: { where } }),
]);
if (!mail) state.value = null; const mail = mailData[0];
else {
state.value = mail.state; state.value = mail?.state;
reason.value = mail.reason; reason.value = mail?.reason;
canResend.value = !!countData.count;
} catch {
state.value = null;
} }
canResend.value = !!(
await axiosNoError.get('WorkerTimeControlMails/count', { params: { where } })
).data.count;
}; };
const setHours = (data) => { const setHours = (data) => {