0
0
Fork 0

refs #6321 remove comments

This commit is contained in:
Javier Segarra 2024-04-02 08:14:11 +02:00
parent c16cc78ce6
commit 130c98ef17
4 changed files with 4 additions and 328 deletions

View File

@ -91,6 +91,5 @@ const updateNegativeOrigin = async () => {
div.q-dialog__inner > div { div.q-dialog__inner > div {
max-width: fit-content !important; max-width: fit-content !important;
// background-color: red !important;
} }
</style> </style>

View File

@ -12,7 +12,6 @@ import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue';
import { toDate, toHour } from 'src/filters'; import { toDate, toHour } from 'src/filters';
import { useVnConfirm } from 'composables/useVnConfirm'; import { useVnConfirm } from 'composables/useVnConfirm';
const { openConfirmationModal } = useVnConfirm(); const { openConfirmationModal } = useVnConfirm();
import VnConfirm from 'components/ui/VnConfirm.vue';
import { useDialogPluginComponent } from 'quasar'; import { useDialogPluginComponent } from 'quasar';
const { t } = useI18n(); const { t } = useI18n();
@ -20,8 +19,6 @@ const URL_KEY = 'Tickets/ItemLack';
const editableStates = ref([]); const editableStates = ref([]);
const selectedRows = ref([]); const selectedRows = ref([]);
// const entryBuysPaginateRef = ref(null);
// const packagingsOptions = ref(null);
const originalRowDataCopy = ref(null); const originalRowDataCopy = ref(null);
const $props = defineProps({ const $props = defineProps({
id: { id: {
@ -42,36 +39,10 @@ const saveChange = async (field, { rowIndex, row }) => {
try { try {
switch (field) { switch (field) {
case 'split': case 'split':
// Dim vSaleCount As Long
// Dim stateCode As String
// vSaleCount = db.getValueV("select count(s.id) from vn.ticket t LEFT JOIN vn.sale s ON s.ticketFk = t.id WHERE t.id= #", Me.Id_Ticket)
// If vSaleCount = 1 Then
// MsgBox ("El siguiente ticket no se ha hecho split, porque tienen solo una linea")
// Exit Sub
// End If
// db.execV "CALL vn.ticket_clone(#, @vNewTicket)", Me.Id_Ticket
// Dim vNewTicketFk As Long
// vNewTicketFk = db.getValue("SELECT @vNewTicket")
// If vNewTicketFk = 0 Then Exit Sub
// db.execV "UPDATE vn.sale SET isPicked = (id = #) WHERE ticketFk = #", Me.Id_Movimiento, Me.Id_Ticket
// Call tour(Me.Id_Ticket, vNewTicketFk)
// Call ticketChangeState(vNewTicketFk, , , "FIXING")
// Buscador_Ticket (vNewTicketFk)
// Call Form_Requery
await split({ simple: true }, [row]); await split({ simple: true }, [row]);
break; break;
case 'code': case 'code':
// Call ticketChangeState(ticketFk, stateFk)
await axios.post(`Tickets/state`, { await axios.post(`Tickets/state`, {
ticketFk: row.ticketFk, ticketFk: row.ticketFk,
code: row[field], code: row[field],
@ -79,42 +50,18 @@ const saveChange = async (field, { rowIndex, row }) => {
break; break;
case 'quantity': case 'quantity':
// Private Function updateQuantity(newQuantity As Integer, saleFk As Long)
// Dim vSalesPerson As Long
// Dim vOldQuantity As Integer
// Dim vTicketFk As Long
// Dim vItemId As Long
// vItemId = DFirst("id_Article", "tblRadar_Negativos_Detalle", "id_Movimiento = " & Me.Id_Movimiento)
// vOldQuantity = db.getValueV("SELECT quantity FROM vn.sale WHERE id = #", saleFk)
// vTicketFk = db.getValueV("SELECT ticketFk FROM vn.sale WHERE id = #", saleFk)
// vSalesPerson = Nz(db.getValueV("SELECT vn.client_getSalesPersonByTicket(#)", vTicketFk), 0)
// db.execV "UPDATE vn.sale SET quantity = #, originalQuantity = # WHERE id = #", newQuantity, newQuantity, saleFk
// app.sendChatCheckingPresence vSalesPerson, "He modificado de " & vOldQuantity & " a " & newQuantity & " " & articod(vItemId) & " del ticket [#" & vTicketFk & "](" & salix.uri & "/#!/ticket/" & vTicketFk & "/sale)"
// End Function
break; break;
default: default:
console.error(field, { rowIndex, row }); console.error(field, { rowIndex, row });
break; break;
} }
// if (originalRowDataCopy.value[rowIndex][field] == row[field]) return;
// await axios.patch(`Buys/${row.id}`, row);
// originalRowDataCopy.value[rowIndex][field] = row[field];
} catch (err) { } catch (err) {
console.error('Error saving changes', err); console.error('Error saving changes', err);
} }
}; };
const entityId = computed(() => $props.id); const entityId = computed(() => $props.id);
function isComponentVn(col) { function isComponentVn(col) {
// return (
// !tableColumnComponents?.value[col.name]?.component?.__name?.startsWith('Vn') ??
// true
// );
return tableColumnComponents?.value[col.name]?.component === 'span' ?? false; return tableColumnComponents?.value[col.name]?.component === 'span' ?? false;
} }
const tableColumnComponents = computed(() => ({ const tableColumnComponents = computed(() => ({
@ -123,11 +70,6 @@ const tableColumnComponents = computed(() => ({
props: { color: 'blue', flat: true }, props: { color: 'blue', flat: true },
event: () => ({}), event: () => ({}),
}, },
// code: {
// component: 'span',
// props: {},
// event: () => ({}),
// },
shipped: { shipped: {
component: 'span', component: 'span',
props: {}, props: {},
@ -170,11 +112,6 @@ const tableColumnComponents = computed(() => ({
props: {}, props: {},
event: () => ({}), event: () => ({}),
}, },
// name: {
// component: 'span',
// props: {},
// event: () => ({}),
// },
quantity: { quantity: {
component: VnInput, component: VnInput,
props: { props: {
@ -221,11 +158,6 @@ const tableColumnComponents = computed(() => ({
}, },
event: getInputEvents, event: getInputEvents,
}, },
// actions: {
// component: QBtn,
// props: {},
// event: getInputEvents,
// },
})); }));
const columns = computed(() => [ const columns = computed(() => [
@ -235,12 +167,6 @@ const columns = computed(() => [
field: 'ticketFk', field: 'ticketFk',
align: 'left', align: 'left',
}, },
// {
// name: 'code',
// label: t('ticket.negative.detail.code'),
// field: 'code',
// align: 'left',
// },
{ {
name: 'shipped', name: 'shipped',
label: t('ticket.negative.detail.shipped'), label: t('ticket.negative.detail.shipped'),
@ -279,13 +205,6 @@ const columns = computed(() => [
field: 'nickname', field: 'nickname',
align: 'left', align: 'left',
}, },
// {
// name: 'name',
// label: t('ticket.negative.detail.name'),
// field: 'name',
// align: 'left',
// },
{ {
name: 'quantity', name: 'quantity',
label: t('ticket.negative.detail.quantity'), label: t('ticket.negative.detail.quantity'),
@ -316,18 +235,13 @@ const columns = computed(() => [
field: 'peticionCompra', field: 'peticionCompra',
align: 'center', align: 'center',
}, },
// {
// name: 'actions',
// label: t('claim.summary.actions'),
// align: 'center',
// },
]); ]);
const emit = defineEmits([...useDialogPluginComponent.emits, 'selection']); const emit = defineEmits([...useDialogPluginComponent.emits, 'selection']);
function rowsHasSelected({ keys }) { function rowsHasSelected({ keys }) {
emit('selection', keys); emit('selection', keys);
} }
// const confirmationModal = ref(false);
const resultSplit = ref([]); const resultSplit = ref([]);
const split = async ({ simple }, data = []) => { const split = async ({ simple }, data = []) => {
openConfirmationModal( openConfirmationModal(
@ -336,35 +250,13 @@ const split = async ({ simple }, data = []) => {
null, null,
() => { () => {
const body = simple ? data : selectedRows.value; const body = simple ? data : selectedRows.value;
// axios.post(`Tickets/split`, body).then((data) => { axios.post(`Tickets/split`, body).then((data) => {
// resultSplit.value = data; resultSplit.value = data;
// }); });
resultSplit.value = [{ ticketFk: 14, message: 'split' }];
} }
); );
// confirmationModal.value = true;
// let body = [];
// if (options.simple) {
// }
// if (options.all) {
// body = $props.rows;
// }
}; };
defineExpose({ split }); defineExpose({ split });
// const { dialogRef, onDialogHide } = useDialogPluginComponent();
// async function changeState(value) {
/* if (!ticket.value.id) return;
const formData = {
ticketFk: ticket.value.id,
code: value,
};
await axios.post(`TicketTrackings/changeState`, formData);*/
// }
function getIcon(key, prop) { function getIcon(key, prop) {
const ticket = resultSplit.value.find((val) => val.ticketFk === key); const ticket = resultSplit.value.find((val) => val.ticketFk === key);
@ -390,12 +282,6 @@ function getIcon(key, prop) {
@on-fetch="(data) => (editableStates = data)" @on-fetch="(data) => (editableStates = data)"
auto-load auto-load
/> />
<!-- <VnConfirm
ref="dialogRef"
v-model="confirmationModal"
:title="t('Confirm splitAll')"
:message="t('Are you sure you want to split all tickets?')"
></VnConfirm> -->
<VnPaginate <VnPaginate
:data-key="URL_KEY" :data-key="URL_KEY"
:url="`${URL_KEY}/${entityId}/detail`" :url="`${URL_KEY}/${entityId}/detail`"
@ -425,36 +311,9 @@ function getIcon(key, prop) {
size="xs" size="xs"
style="font-weight: bold" style="font-weight: bold"
/> />
<!-- <QIcon
name="warning"
color="primary"
class="fill-icon q-mr-sm"
size="xs"
style="font-weight: bold"
/>
<QIcon
name="check_circle"
class="fill-icon q-mr-sm"
size="xs"
color="secondary"
style="font-weight: bold"
/> -->
<QCheckbox v-model="props.selected" /> <QCheckbox v-model="props.selected" />
</QTd> </QTd>
<QTd v-for="col in props.cols" :key="col.name"> <QTd v-for="col in props.cols" :key="col.name">
<!-- <template v-if="col.name == 'actions'">
<QBtn
round
color="primary"
@click="saveChange('split', props)"
>
<QIcon name="call_split"></QIcon>
<QTooltip>
{{ t('globals.split') }}
</QTooltip>
</QBtn>
</template> -->
<template v-if="tableColumnComponents[col.name]?.component"> <template v-if="tableColumnComponents[col.name]?.component">
<component <component
:is="tableColumnComponents[col.name].component" :is="tableColumnComponents[col.name].component"
@ -487,5 +346,3 @@ function getIcon(key, prop) {
</template> </template>
</VnPaginate> </VnPaginate>
</template> </template>
<style lang="scss"></style>

View File

@ -25,47 +25,9 @@ const { dialogRef, onDialogHide } = useDialogPluginComponent();
const viewSummary = (value) => { const viewSummary = (value) => {
showTicketDialog.value = true; showTicketDialog.value = true;
currentRow.value = value; currentRow.value = value;
// quasar.dialog({
// component: VnConfirm,
// componentProps: {
// id: value,
// },
// });
}; };
const originDialogRef = ref(); const originDialogRef = ref();
const totalNegativeDialogRef = ref(); const totalNegativeDialogRef = ref();
const columnsTotalNegativeDialog = computed(() => [
{
name: 'id',
label: t('ticket.negative.id'),
field: ({ id }) => id,
sortable: true,
},
{
name: 'itemFk',
label: t('ticket.negative.detail.itemFk'),
field: ({ itemFk }) => itemFk,
sortable: true,
},
{
name: 'type',
label: t('ticket.negative.type'),
field: ({ type }) => type,
sortable: true,
},
{
name: 'dated',
label: t('ticket.negative.detail.shipped'),
field: ({ dated }) => dated,
sortable: true,
},
{
name: 'quantity',
label: t('ticket.negative.detail.quantity'),
field: ({ quantity }) => quantity,
sortable: true,
},
]);
const columns = computed(() => [ const columns = computed(() => [
{ {
name: 'minTimed', name: 'minTimed',
@ -120,51 +82,12 @@ const columns = computed(() => [
sortable: true, sortable: true,
headerStyle: 'padding-left: 33px', headerStyle: 'padding-left: 33px',
}, },
/*{
name: 'inkFk',
label: t('ticket.negative.inkFk'),
field: ({inkFk}) => inkFk,
align: 'center',
sortable: true,
headerStyle: 'padding-left: 33px',
},
{
name: 'timed',
label: t('ticket.negative.timed'),
field: ({timed}) => timed,
align: 'center',
sortable: true,
headerStyle: 'padding-left: 33px',
},
{
name: 'minTimed',
label: t('ticket.negative.minTimed'),
field: ({minTimed}) => minTimed,
align: 'center',
sortable: true,
headerStyle: 'padding-left: 33px',
},*/
{ {
name: 'icons', name: 'icons',
align: 'center', align: 'center',
field: (row) => row, field: (row) => row,
}, },
]); ]);
const updateNegativeOrigin = async () => {
showNegativeOriginDialog.value = true;
const negativeOrigins = selectedRows.value.map(({ itemFk, lack }) => ({
itemFk,
negativeType: reasonegativeOriginDialog.value,
lack,
}));
try {
await axios.post(`Tickets/itemLack`, negativeOrigins);
originDialogRef.value.hide();
} catch (err) {
return err;
}
};
</script> </script>
<template> <template>
@ -254,8 +177,6 @@ const updateNegativeOrigin = async () => {
<QTooltip> <QTooltip>
{{ t('Preview') }} {{ t('Preview') }}
</QTooltip> </QTooltip>
<!-- <TicketDescriptorProxy :id="value" /> -->
</QIcon> </QIcon>
</QTd> </QTd>
</template> </template>
@ -281,105 +202,6 @@ const updateNegativeOrigin = async () => {
:selected-rows="selectedRows" :selected-rows="selectedRows"
> >
</NegativeOriginDialog> </NegativeOriginDialog>
<!-- <QDialog
ref="totalNegativeDialogRef"
@hide="onDialogHide"
v-model="showTotalNegativeOriginDialog"
>
<QCard class="q-pa-sm">
<QCardSection class="row items-center q-pb-none">
<span class="text-h6 text-grey">{{
t('ticket.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="columnsTotalNegativeDialog"
: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> -->
<!-- <QDialog
ref="originDialogRef"
@hide="onDialogHide"
v-model="showNegativeOriginDialog"
>
<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('ticket.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('ticket.negative.modalOrigin.question') }}</span>
<QSelect
:label="t('globals.reason')"
v-model="reasonegativeOriginDialog"
:options="['FALTAS', 'CONTENEDOR', 'ENTRADAS', 'OVERBOOKING']"
/>
</QCardSection>
<QCardActions align="right">
<QBtn
:label="t('globals.cancel')"
color="primary"
flat
v-close-popup
/>
<QBtn
:label="t('globals.confirm')"
color="primary"
:disable="!reasonegativeOriginDialog"
@click="updateNegativeOrigin()"
unelevated
autofocus
/> </QCardActions
></QCard>
</QDialog> -->
<QDrawer v-model="stateStore.rightDrawer" side="right" :width="256" show-if-above> <QDrawer v-model="stateStore.rightDrawer" side="right" :width="256" show-if-above>
<QScrollArea class="fit text-grey-8"> <QScrollArea class="fit text-grey-8">
<TicketLackFilter data-key="NegativeList" /> <TicketLackFilter data-key="NegativeList" />
@ -409,6 +231,5 @@ const updateNegativeOrigin = async () => {
div.q-dialog__inner > div { div.q-dialog__inner > div {
max-width: fit-content !important; max-width: fit-content !important;
// background-color: red !important;
} }
</style> </style>

View File

@ -111,6 +111,5 @@ const columns = computed(() => [
div.q-dialog__inner > div { div.q-dialog__inner > div {
max-width: fit-content !important; max-width: fit-content !important;
// background-color: red !important;
} }
</style> </style>