Ticket packages #528
|
@ -557,6 +557,7 @@ ticket:
|
|||
tracking: Tracking
|
||||
components: Components
|
||||
pictures: Pictures
|
||||
packages: Packages
|
||||
list:
|
||||
nickname: Nickname
|
||||
state: State
|
||||
|
|
|
@ -239,6 +239,13 @@ globals:
|
|||
mailForwarding: Reenvío de correo
|
||||
mailAlias: Alias de correo
|
||||
privileges: Privilegios
|
||||
observation: Notas
|
||||
expedition: Expedición
|
||||
services: Servicios
|
||||
tracking: Estados
|
||||
components: Componentes
|
||||
pictures: Fotos
|
||||
packages: Bultos
|
||||
created: Fecha creación
|
||||
worker: Trabajador
|
||||
now: Ahora
|
||||
|
@ -555,6 +562,7 @@ ticket:
|
|||
tracking: Estados
|
||||
components: Componentes
|
||||
pictures: Fotos
|
||||
packages: Bultos
|
||||
list:
|
||||
nickname: Alias
|
||||
state: Estado
|
||||
|
|
|
@ -0,0 +1,132 @@
|
|||
<script setup>
|
||||
import { ref, watch, computed, reactive } from 'vue';
|
||||
import { useRoute } from 'vue-router';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
import CrudModel from 'components/CrudModel.vue';
|
||||
import VnInput from 'src/components/common/VnInput.vue';
|
||||
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||
import FetchData from 'components/FetchData.vue';
|
||||
import VnInputDate from 'src/components/common/VnInputDate.vue';
|
||||
|
||||
import { useArrayData } from 'src/composables/useArrayData';
|
||||
|
||||
const route = useRoute();
|
||||
const { t } = useI18n();
|
||||
const ticketPackagingsCrudRef = ref(null);
|
||||
const listPackagingsOptions = ref([]);
|
||||
const arrayData = useArrayData('TicketPackagings');
|
||||
const { store } = arrayData;
|
||||
|
||||
const crudModelFilter = reactive({
|
||||
fields: ['id', 'ticketFk', 'packagingFk', 'quantity', 'created'],
|
||||
where: { ticketFk: route.params.id },
|
||||
});
|
||||
|
||||
const crudModelRequiredData = computed(() => ({
|
||||
packagingFk: null,
|
||||
quantity: 0,
|
||||
created: Date.vnNew(),
|
||||
ticketFk: route.params.id,
|
||||
}));
|
||||
|
||||
const handleInputQuantityClear = (row) => {
|
||||
if (row.quantity === null || row.quantity === undefined) row.quantity = 0;
|
||||
};
|
||||
|
||||
watch(
|
||||
() => route.params.id,
|
||||
async () => {
|
||||
crudModelFilter.where.ticketFk = route.params.id;
|
||||
store.filter = crudModelFilter;
|
||||
await ticketPackagingsCrudRef.value.reload();
|
||||
}
|
||||
);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<FetchData
|
||||
@on-fetch="(data) => (listPackagingsOptions = data)"
|
||||
auto-load
|
||||
:filter="{ fields: ['packagingFk', 'name'], order: 'name ASC', limit: 30 }"
|
||||
jsegarra marked this conversation as resolved
|
||||
url="Packagings/listPackaging"
|
||||
/>
|
||||
<div class="flex justify-center">
|
||||
<CrudModel
|
||||
ref="ticketPackagingsCrudRef"
|
||||
data-key="TicketPackagings"
|
||||
url="TicketPackagings"
|
||||
model="TicketPackagings"
|
||||
:filter="crudModelFilter"
|
||||
:data-required="crudModelRequiredData"
|
||||
:default-remove="false"
|
||||
auto-load
|
||||
style="max-width: 800px"
|
||||
>
|
||||
<template #body="{ rows, validate }">
|
||||
<QCard class="q-px-lg q-py-md">
|
||||
<div
|
||||
v-for="(row, index) in rows"
|
||||
:key="index"
|
||||
class="q-mb-md row items-center q-gutter-x-md"
|
||||
>
|
||||
<VnSelect
|
||||
:label="t('package.package')"
|
||||
:options="listPackagingsOptions"
|
||||
hide-selected
|
||||
option-label="name"
|
||||
option-value="packagingFk"
|
||||
v-model="row.packagingFk"
|
||||
>
|
||||
<template #option="scope">
|
||||
<QItem v-bind="scope.itemProps">
|
||||
<QItemSection>
|
||||
<QItemLabel>
|
||||
{{ scope.opt?.name }}
|
||||
</QItemLabel>
|
||||
<QItemLabel caption>
|
||||
#{{ scope.opt?.itemFk }}
|
||||
jsegarra marked this conversation as resolved
jsegarra
commented
Permite introducir un texto Permite introducir un texto
wbuezas
commented
Corrregido. Commit: Corrregido.
Commit: https://gitea.verdnatura.es/verdnatura/salix-front/commit/3490ba1a8c929942cf6099eb8bc29ce3babfa1ab
|
||||
</QItemLabel>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
</template>
|
||||
</VnSelect>
|
||||
<VnInput
|
||||
:label="t('package.quantity')"
|
||||
v-model.number="row.quantity"
|
||||
class="col"
|
||||
type="number"
|
||||
min="1"
|
||||
:required="true"
|
||||
@update:model-value="handleInputQuantityClear(row)"
|
||||
:rules="validate('TicketPackaging.quantity')"
|
||||
/>
|
||||
<VnInputDate :label="t('package.added')" v-model="row.created" />
|
||||
<QIcon
|
||||
name="delete"
|
||||
size="sm"
|
||||
class="cursor-pointer"
|
||||
color="primary"
|
||||
@click="ticketPackagingsCrudRef.remove([row])"
|
||||
>
|
||||
<QTooltip>
|
||||
{{ t('package.removePackage') }}
|
||||
</QTooltip>
|
||||
</QIcon>
|
||||
</div>
|
||||
<QIcon
|
||||
name="add_circle"
|
||||
class="fill-icon-on-hover q-ml-md"
|
||||
size="sm"
|
||||
color="primary"
|
||||
@click="ticketPackagingsCrudRef.insert()"
|
||||
>
|
||||
<QTooltip>
|
||||
{{ t('package.addPackage') }}
|
||||
</QTooltip>
|
||||
</QIcon>
|
||||
</QCard>
|
||||
</template>
|
||||
</CrudModel>
|
||||
</div>
|
||||
</template>
|
|
@ -201,3 +201,9 @@ tracking:
|
|||
worker: Worker
|
||||
created: Created
|
||||
addState: Add state
|
||||
package:
|
||||
package: Package
|
||||
quantity: Quantity
|
||||
added: Added
|
||||
addPackage: Add package
|
||||
removePackage: Remove package
|
||||
|
|
|
@ -201,6 +201,12 @@ expedition:
|
|||
removeExpeditionSubtitle: ¿Está seguro de eliminar esta expedición?
|
||||
worker: Trabajador
|
||||
move: Mover
|
||||
package:
|
||||
package: Embalaje
|
||||
quantity: Cantidad
|
||||
added: Añadido
|
||||
addPackage: Añadir embalaje
|
||||
removePackage: Quitar embalaje
|
||||
Search ticket: Buscar tickets
|
||||
You can search by ticket id or alias: Puedes buscar por id o alias del ticket
|
||||
Select lines to see the options: Selecciona líneas para ver las opciones
|
||||
|
|
|
@ -26,6 +26,7 @@ export default {
|
|||
'TicketSms',
|
||||
'TicketPicture',
|
||||
'TicketComponents',
|
||||
'TicketPackage',
|
||||
],
|
||||
},
|
||||
children: [
|
||||
|
@ -145,24 +146,6 @@ export default {
|
|||
},
|
||||
component: () => import('src/pages/Ticket/Card/TicketLog.vue'),
|
||||
},
|
||||
{
|
||||
path: 'picture',
|
||||
name: 'TicketPicture',
|
||||
meta: {
|
||||
title: 'pictures',
|
||||
icon: 'vn:photo',
|
||||
},
|
||||
component: () => import('src/pages/Ticket/Card/TicketPicture.vue'),
|
||||
},
|
||||
{
|
||||
path: 'picture',
|
||||
name: 'TicketPicture',
|
||||
meta: {
|
||||
title: 'pictures',
|
||||
icon: 'vn:photo',
|
||||
},
|
||||
component: () => import('src/pages/Ticket/Card/TicketPicture.vue'),
|
||||
},
|
||||
{
|
||||
path: 'observation',
|
||||
name: 'TicketNotes',
|
||||
|
@ -172,6 +155,15 @@ export default {
|
|||
},
|
||||
component: () => import('src/pages/Ticket/Card/TicketNotes.vue'),
|
||||
},
|
||||
{
|
||||
path: 'picture',
|
||||
name: 'TicketPicture',
|
||||
meta: {
|
||||
title: 'pictures',
|
||||
icon: 'vn:photo',
|
||||
},
|
||||
component: () => import('src/pages/Ticket/Card/TicketPicture.vue'),
|
||||
},
|
||||
{
|
||||
path: 'volume',
|
||||
name: 'TicketVolume',
|
||||
|
@ -181,15 +173,7 @@ export default {
|
|||
},
|
||||
component: () => import('src/pages/Ticket/Card/TicketVolume.vue'),
|
||||
},
|
||||
{
|
||||
path: 'components',
|
||||
name: 'TicketComponents',
|
||||
meta: {
|
||||
title: 'components',
|
||||
icon: 'vn:components',
|
||||
},
|
||||
component: () => import('src/pages/Ticket/Card/TicketComponents.vue'),
|
||||
},
|
||||
|
||||
{
|
||||
path: 'expedition',
|
||||
name: 'TicketExpedition',
|
||||
|
@ -208,6 +192,24 @@ export default {
|
|||
},
|
||||
component: () => import('src/pages/Ticket/Card/TicketService.vue'),
|
||||
},
|
||||
{
|
||||
path: 'package',
|
||||
name: 'TicketPackage',
|
||||
meta: {
|
||||
title: 'packages',
|
||||
icon: 'vn:bucket',
|
||||
},
|
||||
component: () => import('src/pages/Ticket/Card/TicketPackage.vue'),
|
||||
},
|
||||
{
|
||||
path: 'components',
|
||||
name: 'TicketComponents',
|
||||
meta: {
|
||||
title: 'components',
|
||||
icon: 'vn:components',
|
||||
},
|
||||
component: () => import('src/pages/Ticket/Card/TicketComponents.vue'),
|
||||
},
|
||||
{
|
||||
path: 'boxing',
|
||||
name: 'TicketBoxing',
|
||||
|
|
|
@ -1,20 +1,20 @@
|
|||
// describe('WagonTypeCreate', () => {
|
||||
// beforeEach(() => {
|
||||
// cy.viewport(1920, 1080);
|
||||
// cy.login('customer');
|
||||
// cy.visit(`/#/entry/my`, {
|
||||
// onBeforeLoad(win) {
|
||||
// cy.stub(win, 'open');
|
||||
// },
|
||||
// });
|
||||
// cy.waitForElement('.q-page', 6000);
|
||||
// });
|
||||
describe('My entry when is supplier', () => {
|
||||
beforeEach(() => {
|
||||
cy.viewport(1920, 1080);
|
||||
cy.login('supplier');
|
||||
cy.visit(`/#/entry/my`, {
|
||||
onBeforeLoad(win) {
|
||||
cy.stub(win, 'open');
|
||||
},
|
||||
});
|
||||
cy.waitForElement('.q-page', 6000);
|
||||
});
|
||||
|
||||
// it('should create edit and remove new dms', () => {
|
||||
// cy.get(
|
||||
// '[to="/null/2"] > .q-card > .column > .q-btn > .q-btn__content > .q-icon'
|
||||
// ).click();
|
||||
// cy.get('.q-card__actions > .q-btn').click();
|
||||
// cy.window().its('open').should('be.called');
|
||||
// });
|
||||
// });
|
||||
it('should open buyLabel when is supplier', () => {
|
||||
cy.get(
|
||||
'[to="/null/2"] > .q-card > .column > .q-btn > .q-btn__content > .q-icon'
|
||||
).click();
|
||||
cy.get('.q-card__actions > .q-btn').click();
|
||||
cy.window().its('open').should('be.called');
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue
Al darle al botón de guardar SIN embalaje ✅
Al darle al botón de guardar CON embalaje y SIN cantidad te deja guardar, mientras que en Salix te marca un error y no guarda. Debería ejecutar una validación en el campo cantidad de cada linea, será lo mejor
Corregido.
Commit:
b87e88ae7f
Sigue dejando guardar sin poner cantidad
Es verdad que se ejecuta la validacion pero cuando haces click sobre el input y luego fuera de este
ahora si xd