feat: refs #6321 clean ticket lack list

This commit is contained in:
Javier Segarra 2025-01-25 09:41:19 +01:00
parent 266c3d26ad
commit 21ea6a278d
6 changed files with 13 additions and 243 deletions

View File

@ -143,6 +143,7 @@ globals:
workCenters: Work centers
modes: Modes
zones: Zones
negative: Negative
zonesList: List
deliveryDays: Delivery days
upcomingDeliveries: Upcoming deliveries
@ -150,6 +151,7 @@ globals:
alias: Alias
aliasUsers: Users
subRoles: Subroles
myAccount: Mi cuenta
inheritedRoles: Inherited Roles
customers: Customers
list: List

View File

@ -8,7 +8,6 @@ globals:
preview: Vista previa
user: Usuario
details: Detalles
preview: Vista previa
collapseMenu: Contraer menú lateral
advancedMenu: Menú avanzado
backToDashboard: Volver al tablón

View File

@ -2,21 +2,21 @@
import { computed, ref, reactive } from 'vue';
import { useI18n } from 'vue-i18n';
import { useStateStore } from 'stores/useStateStore';
import NegativeOriginDialog from 'pages/Ticket/Negative/components/NegativeOriginDialog.vue';
import VnTable from 'components/VnTable/VnTable.vue';
import { onBeforeMount } from 'vue';
import { dashIfEmpty, toDate, toHour } from 'src/filters';
import { useRouter } from 'vue-router';
import { useState } from 'src/composables/useState';
import { useRole } from 'src/composables/useRole';
import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue';
import RightMenu from 'src/components/common/RightMenu.vue';
const router = useRouter();
import VnImg from 'src/components/ui/VnImg.vue';
import TicketLackFilter from './TicketLackFilter.vue';
import { markRaw } from 'vue';
const stateStore = useStateStore();
const { t } = useI18n();
const selectedRows = ref([]);
const showNegativeOriginDialog = ref(false);
const negativeParams = reactive({
days: useRole().likeAny('buyer') ? 2 : 0,
@ -25,7 +25,6 @@ const negativeParams = reactive({
const redirectToCreateView = ({ itemFk }) => {
router.push({ name: 'NegativeDetail', params: { id: itemFk } });
};
const originDialogRef = ref();
const columns = computed(() => [
{
name: 'date',
@ -145,25 +144,6 @@ onBeforeMount(() => {
</script>
<template>
<VnSubToolbar class="bg-vn-dark justify-end">
<template #st-actions>
<QBtn
color="primary"
:disable="!selectedRows?.length"
@click="showNegativeOriginDialog = true"
:label="t('negative.negativeAction')"
>
<QPopupProxy ref="popupProxyRef" style="max-width: none">
<QCard>
<NegativeOriginDialog
ref="originDialogRef"
:selected-rows="selectedRows"
/> </QCard
></QPopupProxy>
<QTooltip>{{ t('negative.negativeAction') }}</QTooltip>
</QBtn>
</template>
</VnSubToolbar>
<RightMenu>
<template #right-panel>
<TicketLackFilter data-key="NegativeList" />
@ -222,7 +202,9 @@ onBeforeMount(() => {
}
.grid-style-transition {
transition: transform 0.28s, background-color 0.28s;
transition:
transform 0.28s,
background-color 0.28s;
}
#true {

View File

@ -1,97 +0,0 @@
<script setup>
import { ref } from 'vue';
import { useI18n } from 'vue-i18n';
import axios from 'axios';
import { useDialogPluginComponent } from 'quasar';
const { t } = useI18n();
const showNegativeOriginDialog = ref(false);
const reason = ref(null);
const { dialogRef } = useDialogPluginComponent();
const $props = defineProps({
selectedRows: {
type: Array,
default: () => [],
},
});
const update = async () => {
showNegativeOriginDialog.value = true;
const negativeOrigins = $props.selectedRows.map(({ itemFk, lack }) => ({
itemFk,
negativeType: reason.value,
lack,
}));
try {
await axios.post(`Tickets/itemLackOrigin`, negativeOrigins);
dialogRef.value.hide();
} catch (err) {
return err;
}
};
</script>
<template>
<QCard class="q-pa-sm">
<QCardSection class="row items-center q-pb-none">
<QAvatar
:icon="icon"
color="primary"
text-color="white"
size="xl"
v-if="icon"
/>
<span class="text-h6 text-grey">{{ t('negative.modalOrigin.title') }}</span>
<QSpace />
<QBtn icon="close" flat round dense v-close-popup />
</QCardSection>
<QCardSection class="row items-center justify-center column items-stretch">
<span>{{ t('negative.modalOrigin.question') }}</span>
<QSelect
:label="t('globals.reason')"
v-model="reason"
:options="[
'FALTAS',
'CONTENEDOR',
'ENTRADAS',
'OVERBOOKING',
'SUSTITUCION',
]"
/>
</QCardSection>
<QCardActions align="right">
<QBtn :label="t('globals.cancel')" color="primary" flat v-close-popup />
<QBtn
:label="t('globals.confirm')"
color="primary"
:disable="!reason"
@click="update()"
unelevated
autofocus
/> </QCardActions
></QCard>
</template>
<style lang="scss" scoped>
.list {
max-height: 100%;
padding: 15px;
width: 100%;
}
.grid-style-transition {
transition: transform 0.28s, background-color 0.28s;
}
#true {
background-color: $positive;
}
#false {
background-color: $negative;
}
div.q-dialog__inner > div {
max-width: fit-content !important;
}
</style>

View File

@ -1,116 +0,0 @@
<script setup>
import { computed, ref } from 'vue';
import { useI18n } from 'vue-i18n';
import VnPaginate from 'components/ui/VnPaginate.vue';
const { t } = useI18n();
const selectedRows = ref([]);
const showTotalNegativeOriginDialog = ref(false);
const columns = computed(() => [
{
name: 'id',
label: t('negative.id'),
field: ({ id }) => id,
sortable: true,
},
{
name: 'itemFk',
label: t('negative.detail.itemFk'),
field: ({ itemFk }) => itemFk,
sortable: true,
},
{
name: 'type',
label: t('negative.type'),
field: ({ type }) => type,
sortable: true,
},
{
name: 'dated',
label: t('negative.detail.shipped'),
field: ({ dated }) => dated,
sortable: true,
},
{
name: 'quantity',
label: t('negative.detail.quantity'),
field: ({ quantity }) => quantity,
sortable: true,
},
]);
</script>
<template>
<QDialog
ref="dialogRef"
@hide="onDialogHide"
v-model="showTotalNegativeOriginDialog"
full-width
>
<QCard class="q-pa-lg">
<QCardSection class="row items-center q-pb-none">
<span class="text-h6 text-grey">{{ t('negative.totalNegative') }}</span>
<QSpace />
<QBtn icon="close" flat round dense v-close-popup />
</QCardSection>
<QCardSection class="row items-center justify-center column items-stretch">
<VnPaginate
data-key="NegativeOriginList"
:url="`Tickets/negativeOrigin`"
auto-load
>
<template #body="{ rows }">
<QTable
:columns="columns"
:rows="rows"
:dense="$q.screen.lt.md"
flat
row-key="itemFk"
selection="multiple"
v-model:selected="selectedRows"
:grid="$q.screen.lt.md"
auto-load
:rows-per-page-options="[0]"
hide-pagination
:pagination="{ rowsPerPage: null }"
:no-data-label="t('globals.noResults')"
>
<template #top>
<div style="width: 100%; display: table">
<div style="float: right; color: lightgray">
{{ `${rows.length} ${t('globals.results')}` }}
</div>
</div>
</template>
</QTable>
</template>
</VnPaginate>
</QCardSection>
</QCard>
</QDialog>
</template>
<style lang="scss" scoped>
.list {
max-height: 100%;
padding: 15px;
width: 100%;
}
.grid-style-transition {
transition: transform 0.28s, background-color 0.28s;
}
#true {
background-color: $positive;
}
#false {
background-color: $negative;
}
div.q-dialog__inner > div {
max-width: fit-content !important;
}
</style>

View File

@ -5,13 +5,13 @@ describe('Ticket Lack list', () => {
cy.visit(`/#/ticket/negative`);
});
describe('Origin', () => {
it('check as origin reason', () => {});
});
describe('Filters', () => {});
describe('Table actions', () => {
it('Open record', () => {});
it('Open record', () => {
cy.get('.q-virtual-scroll__content > :nth-child(1) > .sticky').click();
cy.location('href').should('contain', '#/ticket/negative/5');
});
});
});