0
0
Fork 0
This commit is contained in:
Javier Segarra 2024-05-30 06:46:30 +02:00
parent d3b93b710d
commit 79548f5041
6 changed files with 317 additions and 200 deletions

View File

@ -86,6 +86,7 @@ const store = arrayData.store;
onMounted(() => {
if (props.autoLoad) fetch();
store.data = props.data;
});
watch(

View File

@ -10,7 +10,8 @@
font-display: block;
}
[class^="icon-"], [class*=" icon-"] {
[class^='icon-'],
[class*=' icon-'] {
/* use !important to prevent issues with browser extensions that change fonts */
font-family: 'icon' !important;
speak: never;
@ -26,410 +27,410 @@
}
.icon-100:before {
content: "\e901";
content: '\e901';
}
.icon-Client_unpaid:before {
content: "\e98c";
content: '\e98c';
}
.icon-History:before {
content: "\e902";
content: '\e902';
}
.icon-Person:before {
content: "\e903";
content: '\e903';
}
.icon-accessory:before {
content: "\e904";
content: '\e904';
}
.icon-account:before {
content: "\e905";
content: '\e905';
}
.icon-actions:before {
content: "\e907";
content: '\e907';
}
.icon-addperson:before {
content: "\e908";
content: '\e908';
}
.icon-agency:before {
content: "\e92a";
content: '\e92a';
}
.icon-agency-term:before {
content: "\e909";
content: '\e909';
}
.icon-albaran:before {
content: "\e92c";
content: '\e92c';
}
.icon-anonymous:before {
content: "\e90b";
content: '\e90b';
}
.icon-apps:before {
content: "\e90c";
content: '\e90c';
}
.icon-artificial:before {
content: "\e90d";
content: '\e90d';
}
.icon-attach:before {
content: "\e90e";
content: '\e90e';
}
.icon-barcode:before {
content: "\e90f";
content: '\e90f';
}
.icon-basket:before {
content: "\e910";
content: '\e910';
}
.icon-basketadd:before {
content: "\e911";
content: '\e911';
}
.icon-bin:before {
content: "\e913";
content: '\e913';
}
.icon-botanical:before {
content: "\e914";
content: '\e914';
}
.icon-bucket:before {
content: "\e915";
content: '\e915';
}
.icon-buscaman:before {
content: "\e916";
content: '\e916';
}
.icon-buyrequest:before {
content: "\e917";
content: '\e917';
}
.icon-calc_volum .path1:before {
content: "\e918";
content: '\e918';
color: rgb(0, 0, 0);
}
.icon-calc_volum .path2:before {
content: "\e919";
content: '\e919';
margin-left: -1em;
color: rgb(0, 0, 0);
}
.icon-calc_volum .path3:before {
content: "\e91c";
content: '\e91c';
margin-left: -1em;
color: rgb(0, 0, 0);
}
.icon-calc_volum .path4:before {
content: "\e91d";
content: '\e91d';
margin-left: -1em;
color: rgb(0, 0, 0);
}
.icon-calc_volum .path5:before {
content: "\e91e";
content: '\e91e';
margin-left: -1em;
color: rgb(0, 0, 0);
}
.icon-calc_volum .path6:before {
content: "\e91f";
content: '\e91f';
margin-left: -1em;
color: rgb(255, 255, 255);
}
.icon-calendar:before {
content: "\e920";
content: '\e920';
}
.icon-catalog:before {
content: "\e921";
content: '\e921';
}
.icon-claims:before {
content: "\e922";
content: '\e922';
}
.icon-client:before {
content: "\e923";
content: '\e923';
}
.icon-clone:before {
content: "\e924";
content: '\e924';
}
.icon-columnadd:before {
content: "\e925";
content: '\e925';
}
.icon-columndelete:before {
content: "\e926";
content: '\e926';
}
.icon-components:before {
content: "\e927";
content: '\e927';
}
.icon-consignatarios:before {
content: "\e928";
content: '\e928';
}
.icon-control:before {
content: "\e929";
content: '\e929';
}
.icon-credit:before {
content: "\e92b";
content: '\e92b';
}
.icon-deaulter:before {
content: "\e92d";
.icon-defaulter:before {
content: '\e92d';
}
.icon-deletedTicket:before {
content: "\e92e";
content: '\e92e';
}
.icon-deleteline:before {
content: "\e92f";
content: '\e92f';
}
.icon-delivery:before {
content: "\e930";
content: '\e930';
}
.icon-deliveryprices:before {
content: "\e932";
content: '\e932';
}
.icon-details:before {
content: "\e933";
content: '\e933';
}
.icon-dfiscales:before {
content: "\e934";
content: '\e934';
}
.icon-disabled:before {
content: "\e935";
content: '\e935';
}
.icon-doc:before {
content: "\e936";
content: '\e936';
}
.icon-entry:before {
content: "\e937";
content: '\e937';
}
.icon-exit:before {
content: "\e938";
content: '\e938';
}
.icon-eye:before {
content: "\e939";
content: '\e939';
}
.icon-fixedPrice:before {
content: "\e93a";
content: '\e93a';
}
.icon-flower:before {
content: "\e93b";
content: '\e93b';
}
.icon-frozen:before {
content: "\e93c";
content: '\e93c';
}
.icon-fruit:before {
content: "\e93d";
content: '\e93d';
}
.icon-funeral:before {
content: "\e93e";
content: '\e93e';
}
.icon-grafana:before {
content: "\e906";
content: '\e906';
}
.icon-greenery:before {
content: "\e93f";
content: '\e93f';
}
.icon-greuge:before {
content: "\e940";
content: '\e940';
}
.icon-grid:before {
content: "\e941";
content: '\e941';
}
.icon-handmade:before {
content: "\e942";
content: '\e942';
}
.icon-handmadeArtificial:before {
content: "\e943";
content: '\e943';
}
.icon-headercol:before {
content: "\e945";
content: '\e945';
}
.icon-info:before {
content: "\e946";
content: '\e946';
}
.icon-inventory:before {
content: "\e947";
content: '\e947';
}
.icon-invoice:before {
content: "\e968";
content: '\e968';
color: #5f5f5f;
}
.icon-invoice-in:before {
content: "\e949";
content: '\e949';
}
.icon-invoice-in-create:before {
content: "\e94a";
content: '\e94a';
}
.icon-invoice-out:before {
content: "\e94b";
content: '\e94b';
}
.icon-isTooLittle:before {
content: "\e94c";
content: '\e94c';
}
.icon-item:before {
content: "\e94d";
content: '\e94d';
}
.icon-languaje:before {
content: "\e970";
content: '\e970';
}
.icon-lines:before {
content: "\e94e";
content: '\e94e';
}
.icon-linesprepaired:before {
content: "\e94f";
content: '\e94f';
}
.icon-link-to-corrected:before {
content: "\e931";
content: '\e931';
}
.icon-link-to-correcting:before {
content: "\e944";
content: '\e944';
}
.icon-logout:before {
content: "\e973";
content: '\e973';
}
.icon-mana:before {
content: "\e950";
content: '\e950';
}
.icon-mandatory:before {
content: "\e951";
content: '\e951';
}
.icon-net:before {
content: "\e952";
content: '\e952';
}
.icon-newalbaran:before {
content: "\e954";
content: '\e954';
}
.icon-niche:before {
content: "\e955";
content: '\e955';
}
.icon-no036:before {
content: "\e956";
content: '\e956';
}
.icon-noPayMethod:before {
content: "\e958";
content: '\e958';
}
.icon-notes:before {
content: "\e959";
content: '\e959';
}
.icon-noweb:before {
content: "\e95a";
content: '\e95a';
}
.icon-onlinepayment:before {
content: "\e95b";
content: '\e95b';
}
.icon-package:before {
content: "\e95c";
content: '\e95c';
}
.icon-payment:before {
content: "\e95d";
content: '\e95d';
}
.icon-pbx:before {
content: "\e95e";
content: '\e95e';
}
.icon-pets:before {
content: "\e95f";
content: '\e95f';
}
.icon-photo:before {
content: "\e960";
content: '\e960';
}
.icon-plant:before {
content: "\e961";
content: '\e961';
}
.icon-polizon:before {
content: "\e962";
content: '\e962';
}
.icon-preserved:before {
content: "\e963";
content: '\e963';
}
.icon-recovery:before {
content: "\e964";
content: '\e964';
}
.icon-regentry:before {
content: "\e965";
content: '\e965';
}
.icon-reserva:before {
content: "\e966";
content: '\e966';
}
.icon-revision:before {
content: "\e967";
content: '\e967';
}
.icon-risk:before {
content: "\e969";
content: '\e969';
}
.icon-saysimple:before {
content: "\e912";
content: '\e912';
}
.icon-services:before {
content: "\e96a";
content: '\e96a';
}
.icon-settings:before {
content: "\e96b";
content: '\e96b';
}
.icon-shipment:before {
content: "\e96c";
content: '\e96c';
}
.icon-sign:before {
content: "\e90a";
content: '\e90a';
}
.icon-sms:before {
content: "\e96e";
content: '\e96e';
}
.icon-solclaim:before {
content: "\e96f";
content: '\e96f';
}
.icon-solunion:before {
content: "\e971";
content: '\e971';
}
.icon-splitline:before {
content: "\e972";
content: '\e972';
}
.icon-splur:before {
content: "\e974";
content: '\e974';
}
.icon-stowaway:before {
content: "\e975";
content: '\e975';
}
.icon-supplier:before {
content: "\e976";
content: '\e976';
}
.icon-supplierfalse:before {
content: "\e977";
content: '\e977';
}
.icon-tags:before {
content: "\e979";
content: '\e979';
}
.icon-tax:before {
content: "\e97a";
content: '\e97a';
}
.icon-thermometer:before {
content: "\e97b";
content: '\e97b';
}
.icon-ticket:before {
content: "\e97c";
content: '\e97c';
}
.icon-ticketAdd:before {
content: "\e97e";
content: '\e97e';
}
.icon-traceability:before {
content: "\e97f";
content: '\e97f';
}
.icon-transaction:before {
content: "\e91b";
content: '\e91b';
}
.icon-treatments:before {
content: "\e980";
content: '\e980';
}
.icon-trolley:before {
content: "\e900";
content: '\e900';
}
.icon-troncales:before {
content: "\e982";
content: '\e982';
}
.icon-unavailable:before {
content: "\e983";
content: '\e983';
}
.icon-visible_columns_Icono:before {
content: "\e984";
content: '\e984';
}
.icon-volume:before {
content: "\e985";
content: '\e985';
}
.icon-wand:before {
content: "\e986";
content: '\e986';
}
.icon-web:before {
content: "\e987";
content: '\e987';
}
.icon-wiki:before {
content: "\e989";
content: '\e989';
}
.icon-worker:before {
content: "\e98a";
content: '\e98a';
}
.icon-zone:before {
content: "\e98b";
content: '\e98b';
}

View File

@ -1,5 +1,5 @@
<script setup>
import { onMounted, ref } from 'vue';
import { computed, onMounted, ref } from 'vue';
import { useI18n } from 'vue-i18n';
import axios from 'axios';
import { useDialogPluginComponent } from 'quasar';
@ -7,6 +7,8 @@ import VnSelect from 'src/components/common/VnSelect.vue';
import FetchData from 'components/FetchData.vue';
import VnPaginate from 'src/components/ui/VnPaginate.vue';
import VnInputDate from 'src/components/common/VnInputDate.vue';
import VnInput from 'src/components/common/VnInput.vue';
const { t } = useI18n();
const showSplitDialog = ref(false);
const newState = ref(null);
@ -18,6 +20,41 @@ const $props = defineProps({
default: () => [],
},
});
const rowBtnDisable = (row) => !(row?.name && row?.date);
const columns = computed(() => [
{
name: 'ticket',
label: t('negative.split.ticket'),
field: ({ ticket }) => ticket,
sortable: true,
},
{
name: 'newTicket',
label: t('negative.split.newTicket'),
field: ({ newTicket }) => newTicket,
sortable: true,
},
{
name: 'status',
label: t('negative.split.status'),
field: ({ status }) => status,
sortable: true,
},
{
name: 'message',
label: t('negative.split.message'),
field: ({ message }) => message,
sortable: true,
},
{
name: 'actions',
label: t('negative.split.actions'),
style: 'padding-left: 100px',
headerStyle: 'padding-left: 100px',
},
]);
const ticketsSelected = ref([]);
onMounted(() => {
ticketsSelected.value = [...new Set($props.tickets.map(({ ticketFk }) => ticketFk))];
@ -39,6 +76,24 @@ const updateState = async () => {
dialogRef.value.hide({ type: 'refresh', refresh: true });
}
};
function getIcon(value) {
const icons = {
split: {
name: 'check_circle',
color: 'secondary',
},
noSplit: {
name: 'warning',
color: 'primary',
},
error: {
name: 'close',
color: 'negative',
},
};
return icons[value];
}
</script>
<template>
@ -53,16 +108,15 @@ const updateState = async () => {
v-if="icon"
/>
<span class="text-h6 text-grey">{{
t('negative.detail.split.title')
t('negative.detail.modal.split.title')
}}</span>
<QSpace />
<QBtn icon="close" flat round dense v-close-popup />
</QCardSection>
<QCardSection class="row items-center justify-center column items-stretch">
{{ tickets
}}<VnPaginate data-key="splitLack" :data="tickets">
<VnPaginate data-key="splitLack" :data="tickets">
<template #body="{ rows }">
<QTable :rows="rows" :columns="columns">
<QTable :rows="rows" :columns="columns" flat dense hide-bottom>
<template #header="props">
<QTr :props="props">
<QTh
@ -75,7 +129,69 @@ const updateState = async () => {
</QTr>
</template>
<template #body="props">
<QTr :props="props"></QTr
<QTr :props="props">
<QTh
v-for="col in props.cols"
:key="col.name"
:props="props"
:class="{ splitRow: props.row.status == 'split' }"
>
<span
v-if="
![
'status',
'message',
'actions',
].includes(col.name)
"
>
{{ col.value }}
</span>
<span v-if="'status' === col.name">
<QIcon
:name="`${getIcon(col.value).name}`"
size="md"
class="cursor-pointer"
:color="getIcon(col.value).color"
>
</QIcon>
</span>
<span v-if="'message' === col.name">message</span>
<div
v-if="
'actions' === col.name &&
props.row.status == 'split'
"
style="
display: flex;
flex-direction: row;
justify-content: center;
flex-wrap: wrap;
column-gap: 20px;
align-items: center;
"
>
<div>
<VnInputDate
:label="t('Max date')"
v-model="props.row.date"
/>
<VnInput
:label="t('Name')"
v-model="props.row.name"
/>
</div>
<div>
<QBtn
icon="save"
class="q-mt-sm"
size="md"
color="primary"
flat
:disable="rowBtnDisable(props.row)"
/>
</div>
</div> </QTh></QTr
></template> </QTable
></template>
</VnPaginate>
@ -96,6 +212,10 @@ const updateState = async () => {
</template>
<style lang="scss" scoped>
.splitRow {
border: 1px solid #ec8916;
border-width: 1px 0 1px 0;
}
.list {
max-height: 100%;
padding: 15px;

View File

@ -280,23 +280,6 @@ const reload = async () => {
};
defineExpose({ reload });
function getIcon(key, prop) {
const ticket = resultSplit.value.find((val) => val.ticketFk === key);
if (!ticket) return;
const { status } = ticket;
const icons = {
split: {
name: 'check_circle',
color: 'secondary',
},
noSplit: {
name: 'warning',
color: 'primary',
},
};
return icons[status][prop];
}
// Función de comparación
function freeFirst({ alertLevel: a }, { alertLevel: b }) {
const DEFAULT = 0;
@ -315,9 +298,15 @@ const handleRows = (rows) => {
if (showFree.value) return rows.filter(({ alertLevel }) => alertLevel === 0);
return rows.sort(freeFirst);
};
const split = async (data = selectedRows.value) => {
await axios.post(`Tickets/split`, data);
resultSplit.value = data;
const split = async () => {
const body = selectedRows.value;
// const {data} = await axios.post(`Tickets/split`, body);
// resultSplit.value = data;
resultSplit.value = [
{ ticket: 32, newTicket: 1000005, status: 'split' },
{ ticket: 32, newTicket: 1000005, status: 'noSplit' },
{ ticket: 32, newTicket: 1000005, status: 'error' },
];
};
</script>
@ -366,9 +355,9 @@ const split = async (data = selectedRows.value) => {
color="primary"
@click="
openConfirmationModal(
t('negative.detail.split.title'),
t('negative.detail.split.subTitle'),
() => split,
t('negative.detail.modal.split.title'),
t('negative.detail.modal.split.subTitle'),
split,
() => (showSplitDialog = true)
)
"
@ -512,7 +501,7 @@ const split = async (data = selectedRows.value) => {
ref="splitDialogRef"
@hide="onDialogHide"
v-model="showSplitDialog"
:tickets="selectedRows"
:tickets="resultSplit"
></HandleSplited>
<ItemProposal
ref="proposalDialogRef"

View File

@ -94,7 +94,7 @@ const vnPaginateRef = ref();
const ticketDetailRef = ref();
onBeforeMount(() => {
stateStore.rightDrawer = true;
stateStore.$state.rightDrawer = true;
});
const handleWarehouses = async (data) => {

View File

@ -53,5 +53,11 @@ negative:
title: Update tickets quantity
placeholder: New quantity
split:
title: Are you sure you want to split all tickets?
confirmSplitSelected: Confirm split selected
title: Are you sure you want to split selected tickets?
subTitle: Confirm split action
split:
ticket: Old ticket
newTicket: New ticket
status: Result
message: Message
actions: Actions