Compare commits

...

31 Commits

Author SHA1 Message Date
Robert Ferrús 6e164cda14 Merge branch 'dev' into 7731-clientViesCode
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-10-21 07:56:06 +00:00
Jorge Penadés 55f8b78eba Merge pull request 'fix: refs #7353 load on scroll end' (!841) from 7353-fixLoadOnScroll into dev
gitea/salix-front/pipeline/pr-4774-traducciones This commit looks good Details
gitea/salix-front/pipeline/head This commit looks good Details
gitea/salix-front/pipeline/pr-dev This commit looks good Details
Reviewed-on: #841
Reviewed-by: Alex Moreno <alexm@verdnatura.es>
2024-10-18 08:16:21 +00:00
Jorge Penadés 2aaba93c3c Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 7353-fixLoadOnScroll
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-10-18 10:11:11 +02:00
Jorge Penadés 0c2d9e6ec6 fix: refs #7353 load on scroll end 80% zoom
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-10-18 10:08:46 +02:00
Jon Elias 5c5393db6d Merge pull request '#7010 added packing type field' (!762) from 7010-AddPackingField into dev
gitea/salix-front/pipeline/pr-4774-traducciones This commit looks good Details
gitea/salix-front/pipeline/head This commit looks good Details
Reviewed-on: #762
Reviewed-by: Javier Segarra <jsegarra@verdnatura.es>
2024-10-18 07:40:37 +00:00
Jon Elias 7d78ce7781 Merge branch 'dev' into 7010-AddPackingField
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-10-18 07:29:17 +00:00
Carlos Satorres da3364b424 Merge pull request '7986-workerMoto' (!830) from 7986-workerMoto into dev
gitea/salix-front/pipeline/pr-4774-traducciones This commit looks good Details
gitea/salix-front/pipeline/head This commit looks good Details
Reviewed-on: #830
Reviewed-by: Alex Moreno <alexm@verdnatura.es>
2024-10-18 07:25:06 +00:00
Carlos Satorres 8bc06593c5 Merge branch '7986-workerMoto' of https://gitea.verdnatura.es/verdnatura/salix-front into 7986-workerMoto
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-10-18 08:44:31 +02:00
Carlos Satorres 1f4b681b5b fix: refs #7986 clean code 2024-10-18 08:44:27 +02:00
Jorge Penadés c42c811444 fix: refs #7353 load on scroll end
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-10-17 17:39:49 +02:00
Carlos Satorres 3cdba5dafa Merge branch 'dev' into 7986-workerMoto
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-10-16 12:10:22 +00:00
Carlos Satorres e06ce4f8a4 fix: refs #7986 clean code
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-10-15 14:56:32 +02:00
Carlos Satorres cad3fddc3e fix: refs #7986 descriptor fix
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-10-15 14:52:52 +02:00
Carlos Satorres a30915f99e fix: refs #7986 fix operator, fix crudmodel update
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-10-15 14:42:26 +02:00
Carlos Satorres b4245d05fb fix: refs #7986 crudModel
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-10-15 13:00:01 +02:00
Carlos Satorres af830591b3 fix: refs #7986 front fixed
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-10-15 09:44:55 +02:00
Carlos Satorres dfceb9403c fix: refs #7986 fix front
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-10-15 07:54:52 +02:00
Carlos Satorres 1a2c5c96fa Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 7986-workerMoto
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-10-14 13:52:31 +02:00
Carlos Satorres 855032e4a6 refs #7986 fix front 2024-10-08 15:36:57 +02:00
Carlos Satorres 73e5039ec3 refs #7986 create front 2024-10-08 08:35:24 +02:00
Jon Elias b93375f5a4 Merge branch 'dev' into 7010-AddPackingField
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-10-03 06:41:50 +00:00
Jon Elias 6a1bb6d41f Merge branch '7010-AddPackingField' of https://gitea.verdnatura.es/verdnatura/salix-front into 7010-AddPackingField
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-10-03 08:38:58 +02:00
Jon Elias 8ee4edc5d5 perf: refs #7010 customer summary packaging type field 2024-10-03 08:38:56 +02:00
Jon Elias be53b466b9 Merge branch 'dev' into 7010-AddPackingField
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-10-02 09:53:22 +00:00
Jon Elias 0b76d0d556 refactor: refs #7010 added function to get item packaging type
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-10-02 11:52:16 +02:00
Jon Elias 0650380b7b Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 7010-AddPackingField 2024-10-02 11:29:54 +02:00
Jon Elias 9386d648d0 Merge branch '7010-AddPackingField' of https://gitea.verdnatura.es/verdnatura/salix-front into 7010-AddPackingField
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-09-26 14:13:00 +02:00
Jon Elias 1c99c01d1d refactor: refs #7010 modified front 2024-09-26 14:12:59 +02:00
Jon Elias 51aae0f726 Merge branch 'dev' into 7010-AddPackingField
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-09-26 08:22:02 +00:00
Jon Elias 6d5a8cba6f refactor: refs #7010 modified customer summary table
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-09-26 10:20:50 +02:00
Jon Elias 56af4d3736 feat: refs #7010 added packing type field in customer summary and ticket list
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-09-25 14:18:34 +02:00
7 changed files with 293 additions and 20 deletions

View File

@ -134,6 +134,7 @@ const splittedColumns = ref({ columns: [] });
const columnsVisibilitySkipped = ref(); const columnsVisibilitySkipped = ref();
const createForm = ref(); const createForm = ref();
const tableFilterRef = ref([]); const tableFilterRef = ref([]);
const tableRef = ref();
const tableModes = [ const tableModes = [
{ {
@ -321,6 +322,13 @@ function handleOnDataSaved(_) {
if (_.onDataSaved) _.onDataSaved({ CrudModelRef: CrudModelRef.value }); if (_.onDataSaved) _.onDataSaved({ CrudModelRef: CrudModelRef.value });
else $props.create.onDataSaved(_); else $props.create.onDataSaved(_);
} }
function handleScroll() {
const tMiddle = tableRef.value.$el.querySelector('.q-table__middle');
const { scrollHeight, scrollTop, clientHeight } = tMiddle;
const isAtBottom = Math.abs(scrollHeight - scrollTop - clientHeight) <= 40;
if (isAtBottom) CrudModelRef.value.vnPaginateRef.paginate();
}
</script> </script>
<template> <template>
<QDrawer <QDrawer
@ -405,6 +413,7 @@ function handleOnDataSaved(_) {
</template> </template>
<template #body="{ rows }"> <template #body="{ rows }">
<QTable <QTable
ref="tableRef"
v-bind="table" v-bind="table"
class="vnTable" class="vnTable"
:columns="splittedColumns.columns" :columns="splittedColumns.columns"
@ -416,12 +425,7 @@ function handleOnDataSaved(_) {
flat flat
:style="isTableMode && `max-height: ${tableHeight}`" :style="isTableMode && `max-height: ${tableHeight}`"
:virtual-scroll="isTableMode" :virtual-scroll="isTableMode"
@virtual-scroll=" @virtual-scroll="handleScroll"
(event) =>
event.index > rows.length - 2 &&
($props.crudModel?.paginate ?? true) &&
CrudModelRef.vnPaginateRef.paginate()
"
@row-click="(_, row) => rowClickFunction && rowClickFunction(row)" @row-click="(_, row) => rowClickFunction && rowClickFunction(row)"
@update:selected="emit('update:selected', $event)" @update:selected="emit('update:selected', $event)"
> >

View File

@ -277,6 +277,7 @@ globals:
medical: Mutual medical: Mutual
RouteExtendedList: Router RouteExtendedList: Router
wasteRecalc: Waste recaclulate wasteRecalc: Waste recaclulate
operator: Operator
supplier: Supplier supplier: Supplier
created: Created created: Created
worker: Worker worker: Worker
@ -743,6 +744,7 @@ worker:
locker: Locker locker: Locker
balance: Balance balance: Balance
medical: Medical medical: Medical
operator: Operator
list: list:
name: Name name: Name
email: Email email: Email
@ -840,6 +842,18 @@ worker:
debit: Debt debit: Debt
credit: Have credit: Have
concept: Concept concept: Concept
operator:
numberOfWagons: Number of wagons
train: Train
itemPackingType: Item packing type
warehouse: Warehouse
sector: Sector
labeler: Printer
linesLimit: Lines limit
volumeLimit: Volume limit
sizeLimit: Size limit
isOnReservationMode: Reservation mode
machine: Machine
wagon: wagon:
pageTitles: pageTitles:
wagons: Wagons wagons: Wagons

View File

@ -281,6 +281,7 @@ globals:
serial: Facturas por serie serial: Facturas por serie
medical: Mutua medical: Mutua
wasteRecalc: Recalcular mermas wasteRecalc: Recalcular mermas
operator: Operario
supplier: Proveedor supplier: Proveedor
created: Fecha creación created: Fecha creación
worker: Trabajador worker: Trabajador
@ -750,6 +751,7 @@ worker:
balance: Balance balance: Balance
formation: Formación formation: Formación
medical: Mutua medical: Mutua
operator: Operario
list: list:
name: Nombre name: Nombre
email: Email email: Email
@ -838,6 +840,19 @@ worker:
debit: Debe debit: Debe
credit: Haber credit: Haber
concept: Concepto concept: Concepto
operator:
numberOfWagons: Número de vagones
train: tren
itemPackingType: Tipo de embalaje
warehouse: Almacén
sector: Sector
labeler: Impresora
linesLimit: Líneas límite
volumeLimit: Volumen límite
sizeLimit: Tamaño límite
isOnReservationMode: Modo de reserva
machine: Máquina
wagon: wagon:
pageTitles: pageTitles:
wagons: Vagones wagons: Vagones

View File

@ -6,7 +6,7 @@ import { useRoute, useRouter } from 'vue-router';
import { date } from 'quasar'; import { date } from 'quasar';
import { toDateFormat } from 'src/filters/date.js'; import { toDateFormat } from 'src/filters/date.js';
import { toCurrency } from 'src/filters'; import { dashIfEmpty, toCurrency } from 'src/filters';
import { useSummaryDialog } from 'src/composables/useSummaryDialog'; import { useSummaryDialog } from 'src/composables/useSummaryDialog';
import TicketSummary from 'src/pages/Ticket/Card/TicketSummary.vue'; import TicketSummary from 'src/pages/Ticket/Card/TicketSummary.vue';
@ -32,6 +32,16 @@ const filter = {
}, },
{ relation: 'invoiceOut', scope: { fields: ['id'] } }, { relation: 'invoiceOut', scope: { fields: ['id'] } },
{ relation: 'agencyMode', scope: { fields: ['name'] } }, { relation: 'agencyMode', scope: { fields: ['name'] } },
{
relation: 'ticketSales',
scope: {
fields: ['id', 'concept', 'itemFk'],
include: { relation: 'item' },
scope: {
fields: ['id', 'name', 'itemPackingTypeFk'],
},
},
},
], ],
where: { clientFk: route.params.id }, where: { clientFk: route.params.id },
order: ['shipped DESC', 'id'], order: ['shipped DESC', 'id'],
@ -87,7 +97,12 @@ const columns = computed(() => [
label: t('Total'), label: t('Total'),
name: 'total', name: 'total',
}, },
{
align: 'left',
name: 'itemPackingTypeFk',
label: t('ticketSale.packaging'),
format: (row) => getItemPackagingType(row),
},
{ {
align: 'right', align: 'right',
label: '', label: '',
@ -135,6 +150,15 @@ const setShippedColor = (date) => {
if (difference == 0) return 'warning'; if (difference == 0) return 'warning';
if (difference < 0) return 'success'; if (difference < 0) return 'success';
}; };
const getItemPackagingType = (row) => {
const packagingType = row?.ticketSales
.map((sale) => sale.item?.itemPackingTypeFk || '-')
.filter((value) => value !== '-')
.join(', ');
return dashIfEmpty(packagingType);
};
</script> </script>
<template> <template>

View File

@ -95,6 +95,7 @@ const columns = computed(() => [
columnField: { columnField: {
component: null, component: null,
}, },
columnClass: 'expand',
format: (row, dashIfEmpty) => dashIfEmpty(row.salesPerson), format: (row, dashIfEmpty) => dashIfEmpty(row.salesPerson),
}, },
{ {
@ -153,11 +154,6 @@ const columns = computed(() => [
}, },
columnClass: 'expand', columnClass: 'expand',
}, },
{
align: 'left',
name: 'refFk',
label: t('ticketList.ref'),
},
{ {
align: 'left', align: 'left',
name: 'zoneFk', name: 'zoneFk',
@ -191,6 +187,12 @@ const columns = computed(() => [
}, },
format: (row) => toCurrency(row.totalWithVat), format: (row) => toCurrency(row.totalWithVat),
}, },
{
align: 'left',
name: 'packing',
label: t('ticketSale.packaging'),
format: (row, dashIfEmpty) => dashIfEmpty(row.packing),
},
{ {
align: 'right', align: 'right',
name: 'tableActions', name: 'tableActions',
@ -548,7 +550,7 @@ function setReference(data) {
</template> </template>
<template #column-salesPersonFk="{ row }"> <template #column-salesPersonFk="{ row }">
<span class="link" @click.stop> <span class="link" @click.stop>
{{ row.salesPerson }} {{ dashIfEmpty(row.salesPerson) }}
<CustomerDescriptorProxy :id="row.salesPersonFk" /> <CustomerDescriptorProxy :id="row.salesPersonFk" />
</span> </span>
</template> </template>
@ -577,16 +579,16 @@ function setReference(data) {
{{ row.state }} {{ row.state }}
</QChip> </QChip>
</span> </span>
<span v-else-if="row.state === 'Entregado'">
<span class="link" @click.stop>
{{ row.refFk }}
<InvoiceOutDescriptorProxy :id="row.invoiceOutId" />
</span>
</span>
<span v-else> <span v-else>
{{ row.state }} {{ row.state }}
</span> </span>
</template> </template>
<template #column-refFk="{ row }">
<span class="link" @click.stop>
{{ dashIfEmpty(row.refFk) }}
<InvoiceOutDescriptorProxy :id="row.invoiceOutId" />
</span>
</template>
<template #column-zoneFk="{ row }"> <template #column-zoneFk="{ row }">
<span class="link" @click.stop> <span class="link" @click.stop>
{{ dashIfEmpty(row.zoneName) }} {{ dashIfEmpty(row.zoneName) }}

View File

@ -0,0 +1,204 @@
<script setup>
import { useI18n } from 'vue-i18n';
import { useRoute } from 'vue-router';
import { ref, computed } from 'vue';
import FetchData from 'components/FetchData.vue';
import VnRow from 'components/ui/VnRow.vue';
import VnSelect from 'src/components/common/VnSelect.vue';
import VnInput from 'src/components/common/VnInput.vue';
import CrudModel from 'components/CrudModel.vue';
import axios from 'axios';
const { t } = useI18n();
const crudModelRef = ref();
const warehousesData = ref([]);
const itemPackingTypesData = ref([]);
const sectorsData = ref([]);
const trainsData = ref([]);
const machinesData = ref([]);
const route = useRoute();
const routeId = computed(() => route.params.id);
const initialData = computed(() => {
return {
workerFk: routeId.value,
numberOfWagons: 2,
trainFk: 1,
itemPackingTypeFk: 'H',
warehouseFk: 60,
sectorFk: null,
labelerFk: null,
linesLimit: 20,
volumenLimit: 0.5,
sizeLimit: null,
isOnReservationMode: 0,
machineFk: null,
};
});
async function insert() {
await axios.post('Operators', initialData.value);
crudModelRef.value.reload();
}
</script>
<template>
<QPage class="column items-center q-pa-md centerCard">
<FetchData url="Trains" @on-fetch="(data) => (trainsData = data)" auto-load />
<FetchData
url="ItemPackingTypes"
@on-fetch="(data) => (itemPackingTypesData = data)"
auto-load
/>
<FetchData
url="Warehouses"
@on-fetch="(data) => (warehousesData = data)"
auto-load
/>
<FetchData url="Printers" @on-fetch="(data) => (PrintersData = data)" auto-load />
<FetchData url="Sectors" @on-fetch="(data) => (sectorsData = data)" auto-load />
<FetchData url="Machines" @on-fetch="(data) => (machinesData = data)" auto-load />
<CrudModel
data-key="workerOperator"
url="Operators"
primary-key="workerFk"
:filter="{ where: { workerFk: route.params.id } }"
:data-required="{ workerFk: route.params.id }"
ref="crudModelRef"
search-url="operator"
auto-load
>
<template #body="{ rows }">
<div v-if="rows.length">
<QCard
flat
bordered
:key="row.$index"
v-for="row of rows"
class="card q-px-md q-mb-sm container"
>
<VnRow>
<VnInput
:label="t('worker.operator.numberOfWagons')"
v-model="row.numberOfWagons"
/>
<VnSelect
:label="t('worker.operator.train')"
:options="trainsData"
hide-selected
v-model="row.trainFk"
/>
</VnRow>
<VnRow>
<VnSelect
:label="t('worker.operator.itemPackingType')"
:options="itemPackingTypesData"
hide-selected
option-label="code"
option-value="code"
v-model="row.itemPackingTypeFk"
/>
<VnSelect
:label="t('worker.operator.warehouse')"
:options="warehousesData"
hide-selected
v-model="row.warehouseFk"
/>
</VnRow>
<VnRow>
<VnSelect
:label="t('worker.operator.sector')"
:options="sectorsData"
hide-selected
option-label="description"
v-model="row.sectorFk"
/>
<VnSelect
:label="t('worker.operator.labeler')"
:options="PrintersData"
hide-selected
option-label="name"
v-model="row.labelerFk"
>
<template #option="scope">
<QItem v-bind="scope.itemProps">
<QItemSection>
<QItemLabel
>ID: {{ scope.opt?.id }}</QItemLabel
>
<QItemLabel caption>
{{ scope.opt?.id }},
{{ scope.opt?.name }}
</QItemLabel>
</QItemSection>
</QItem>
</template>
</VnSelect>
</VnRow>
<VnRow>
<VnInput
:label="t('worker.operator.linesLimit')"
v-model="row.linesLimit"
lazy-rules
/>
<VnInput
:label="t('worker.operator.volumeLimit')"
v-model="row.volumeLimit"
lazy-rules
/>
</VnRow>
<VnRow>
<VnInput
:label="t('worker.operator.sizeLimit')"
v-model="row.sizeLimit"
lazy-rules
/>
<VnInput
:label="t('worker.operator.isOnReservationMode')"
v-model="row.isOnReservationMode"
lazy-rules
/>
</VnRow>
<VnRow>
<VnSelect
:label="t('worker.operator.machine')"
:options="machinesData"
hide-selected
option-label="plate"
v-model="row.machineFk"
/>
</VnRow>
</QCard>
</div>
</template>
</CrudModel>
<QPageSticky position="bottom-right" :offset="[25, 25]">
<QBtn
fab
color="primary"
icon="add"
@click="insert()"
v-if="!crudModelRef?.formData?.length"
/>
</QPageSticky>
</QPage>
</template>
<style lang="scss" scoped>
.btn-delete {
max-width: 4%;
margin-top: 30px;
}
</style>
<i18n>
es:
Model: Modelo
Serial number: Número de serie
Current SIM: SIM actual
Add new device: Añadir nuevo dispositivo
PDA deallocated: PDA desasignada
Remove PDA: Eliminar PDA
Do you want to remove this PDA?: ¿Desea eliminar este PDA?
You can only have one PDA: Solo puedes tener un PDA si no eres autonomo
This PDA is already assigned to another user: Este PDA ya está asignado a otro usuario
</i18n>

View File

@ -27,6 +27,7 @@ export default {
'WorkerBalance', 'WorkerBalance',
'WorkerFormation', 'WorkerFormation',
'WorkerMedical', 'WorkerMedical',
'WorkerOperator',
], ],
}, },
children: [ children: [
@ -208,6 +209,15 @@ export default {
}, },
component: () => import('src/pages/Worker/Card/WorkerMedical.vue'), component: () => import('src/pages/Worker/Card/WorkerMedical.vue'),
}, },
{
name: 'WorkerOperator',
path: 'operator',
meta: {
title: 'operator',
icon: 'person',
},
component: () => import('src/pages/Worker/Card/WorkerOperator.vue'),
},
], ],
}, },
], ],