refs #6321 remove comments
gitea/salix-front/pipeline/pr-dev This commit looks good Details

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 {
max-width: fit-content !important;
// background-color: red !important;
}
</style>

View File

@ -12,7 +12,6 @@ import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue';
import { toDate, toHour } from 'src/filters';
import { useVnConfirm } from 'composables/useVnConfirm';
const { openConfirmationModal } = useVnConfirm();
import VnConfirm from 'components/ui/VnConfirm.vue';
import { useDialogPluginComponent } from 'quasar';
const { t } = useI18n();
@ -20,8 +19,6 @@ const URL_KEY = 'Tickets/ItemLack';
const editableStates = ref([]);
const selectedRows = ref([]);
// const entryBuysPaginateRef = ref(null);
// const packagingsOptions = ref(null);
const originalRowDataCopy = ref(null);
const $props = defineProps({
id: {
@ -42,36 +39,10 @@ const saveChange = async (field, { rowIndex, row }) => {
try {
switch (field) {
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]);
break;
case 'code':
// Call ticketChangeState(ticketFk, stateFk)
await axios.post(`Tickets/state`, {
ticketFk: row.ticketFk,
code: row[field],
@ -79,42 +50,18 @@ const saveChange = async (field, { rowIndex, row }) => {
break;
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;
default:
console.error(field, { rowIndex, row });
break;
}
// if (originalRowDataCopy.value[rowIndex][field] == row[field]) return;
// await axios.patch(`Buys/${row.id}`, row);
// originalRowDataCopy.value[rowIndex][field] = row[field];
} catch (err) {
console.error('Error saving changes', err);
}
};
const entityId = computed(() => $props.id);
function isComponentVn(col) {
// return (
// !tableColumnComponents?.value[col.name]?.component?.__name?.startsWith('Vn') ??
// true
// );
return tableColumnComponents?.value[col.name]?.component === 'span' ?? false;
}
const tableColumnComponents = computed(() => ({
@ -123,11 +70,6 @@ const tableColumnComponents = computed(() => ({
props: { color: 'blue', flat: true },
event: () => ({}),
},
// code: {
// component: 'span',
// props: {},
// event: () => ({}),
// },
shipped: {
component: 'span',
props: {},
@ -170,11 +112,6 @@ const tableColumnComponents = computed(() => ({
props: {},
event: () => ({}),
},
// name: {
// component: 'span',
// props: {},
// event: () => ({}),
// },
quantity: {
component: VnInput,
props: {
@ -221,11 +158,6 @@ const tableColumnComponents = computed(() => ({
},
event: getInputEvents,
},
// actions: {
// component: QBtn,
// props: {},
// event: getInputEvents,
// },
}));
const columns = computed(() => [
@ -235,12 +167,6 @@ const columns = computed(() => [
field: 'ticketFk',
align: 'left',
},
// {
// name: 'code',
// label: t('ticket.negative.detail.code'),
// field: 'code',
// align: 'left',
// },
{
name: 'shipped',
label: t('ticket.negative.detail.shipped'),
@ -279,13 +205,6 @@ const columns = computed(() => [
field: 'nickname',
align: 'left',
},
// {
// name: 'name',
// label: t('ticket.negative.detail.name'),
// field: 'name',
// align: 'left',
// },
{
name: 'quantity',
label: t('ticket.negative.detail.quantity'),
@ -316,18 +235,13 @@ const columns = computed(() => [
field: 'peticionCompra',
align: 'center',
},
// {
// name: 'actions',
// label: t('claim.summary.actions'),
// align: 'center',
// },
]);
const emit = defineEmits([...useDialogPluginComponent.emits, 'selection']);
function rowsHasSelected({ keys }) {
emit('selection', keys);
}
// const confirmationModal = ref(false);
const resultSplit = ref([]);
const split = async ({ simple }, data = []) => {
openConfirmationModal(
@ -336,35 +250,13 @@ const split = async ({ simple }, data = []) => {
null,
() => {
const body = simple ? data : selectedRows.value;
// axios.post(`Tickets/split`, body).then((data) => {
// resultSplit.value = data;
// });
resultSplit.value = [{ ticketFk: 14, message: 'split' }];
axios.post(`Tickets/split`, body).then((data) => {
resultSplit.value = data;
});
}
);
// confirmationModal.value = true;
// let body = [];
// if (options.simple) {
// }
// if (options.all) {
// body = $props.rows;
// }
};
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) {
const ticket = resultSplit.value.find((val) => val.ticketFk === key);
@ -390,12 +282,6 @@ function getIcon(key, prop) {
@on-fetch="(data) => (editableStates = data)"
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
:data-key="URL_KEY"
:url="`${URL_KEY}/${entityId}/detail`"
@ -425,36 +311,9 @@ function getIcon(key, prop) {
size="xs"
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" />
</QTd>
<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">
<component
:is="tableColumnComponents[col.name].component"
@ -487,5 +346,3 @@ function getIcon(key, prop) {
</template>
</VnPaginate>
</template>
<style lang="scss"></style>

View File

@ -25,47 +25,9 @@ const { dialogRef, onDialogHide } = useDialogPluginComponent();
const viewSummary = (value) => {
showTicketDialog.value = true;
currentRow.value = value;
// quasar.dialog({
// component: VnConfirm,
// componentProps: {
// id: value,
// },
// });
};
const originDialogRef = 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(() => [
{
name: 'minTimed',
@ -120,51 +82,12 @@ const columns = computed(() => [
sortable: true,
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',
align: 'center',
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>
<template>
@ -254,8 +177,6 @@ const updateNegativeOrigin = async () => {
<QTooltip>
{{ t('Preview') }}
</QTooltip>
<!-- <TicketDescriptorProxy :id="value" /> -->
</QIcon>
</QTd>
</template>
@ -281,105 +202,6 @@ const updateNegativeOrigin = async () => {
:selected-rows="selectedRows"
>
</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>
<QScrollArea class="fit text-grey-8">
<TicketLackFilter data-key="NegativeList" />
@ -409,6 +231,5 @@ const updateNegativeOrigin = async () => {
div.q-dialog__inner > div {
max-width: fit-content !important;
// background-color: red !important;
}
</style>

View File

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