diff --git a/src/pages/Ticket/Negative/NegativeOriginDialog.vue b/src/pages/Ticket/Negative/NegativeOriginDialog.vue index 64c8215cc..bc1fe03a2 100644 --- a/src/pages/Ticket/Negative/NegativeOriginDialog.vue +++ b/src/pages/Ticket/Negative/NegativeOriginDialog.vue @@ -91,6 +91,5 @@ const updateNegativeOrigin = async () => { div.q-dialog__inner > div { max-width: fit-content !important; - // background-color: red !important; } diff --git a/src/pages/Ticket/Negative/TicketLackDialog.vue b/src/pages/Ticket/Negative/TicketLackDialog.vue index d40c6ee99..65f2d80db 100644 --- a/src/pages/Ticket/Negative/TicketLackDialog.vue +++ b/src/pages/Ticket/Negative/TicketLackDialog.vue @@ -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 /> - - - - - - diff --git a/src/pages/Ticket/Negative/TicketLackList.vue b/src/pages/Ticket/Negative/TicketLackList.vue index 486209dd3..2d8c3a893 100644 --- a/src/pages/Ticket/Negative/TicketLackList.vue +++ b/src/pages/Ticket/Negative/TicketLackList.vue @@ -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; - } -}; @@ -281,105 +202,6 @@ const updateNegativeOrigin = async () => { :selected-rows="selectedRows" > - - - - @@ -409,6 +231,5 @@ const updateNegativeOrigin = async () => { div.q-dialog__inner > div { max-width: fit-content !important; - // background-color: red !important; } diff --git a/src/pages/Ticket/Negative/TotalNegativeOriginDialog.vue b/src/pages/Ticket/Negative/TotalNegativeOriginDialog.vue index 263534c74..324b5e1c1 100644 --- a/src/pages/Ticket/Negative/TotalNegativeOriginDialog.vue +++ b/src/pages/Ticket/Negative/TotalNegativeOriginDialog.vue @@ -111,6 +111,5 @@ const columns = computed(() => [ div.q-dialog__inner > div { max-width: fit-content !important; - // background-color: red !important; }