diff --git a/src/i18n/es/index.js b/src/i18n/es/index.js index 6bdd03e04..92b09b8ab 100644 --- a/src/i18n/es/index.js +++ b/src/i18n/es/index.js @@ -462,6 +462,10 @@ export default { inkFk: 'Color', timed: 'timed', minTimed: 'Hora', + modalOrigin:{ + title: 'Actualizar negativos', + question: 'Seleccione un estado para guardar' + }, detail:{ itemFk:'Articulo', ticketFk:'Id_Ticket', diff --git a/src/pages/Ticket/Negative/TicketLackList.vue b/src/pages/Ticket/Negative/TicketLackList.vue index 35ecf48ff..200b75c43 100644 --- a/src/pages/Ticket/Negative/TicketLackList.vue +++ b/src/pages/Ticket/Negative/TicketLackList.vue @@ -5,9 +5,16 @@ import { useStateStore } from 'stores/useStateStore'; import VnPaginate from 'components/ui/VnPaginate.vue'; import { useSession } from 'src/composables/useSession'; import TicketLackFilter from 'pages/Ticket/Negative/TicketLackFilter.vue'; -import CustomerDescriptorProxy from 'pages/Customer/Card/CustomerDescriptorProxy.vue'; import TicketDescriptorDialog from 'pages/Ticket/Negative/TicketLackDescriptorDialog.vue'; import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue'; +import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue'; +import axios from 'axios'; +import VnConfirm from 'components/ui/VnConfirm.vue'; +import VnInput from 'components/common/VnInput.vue'; +import VnSelectFilter from 'components/common/VnSelectFilter.vue'; +import VnSelectDialog from 'components/common/VnSelectDialog.vue'; +import VnLv from 'src/components/ui/VnLv.vue'; +import { useDialogPluginComponent } from 'quasar'; const session = useSession(); @@ -15,9 +22,12 @@ const token = session.getToken(); const stateStore = useStateStore(); const { t } = useI18n(); -const selected = ref([]); +const selectedRows = ref([]); const showTicketDialog = ref(false); +const showNegativeOriginDialog = ref(false); +const reasonegativeOriginDialog = ref(null); const currentRow = ref(null); +const { dialogRef, onDialogHide } = useDialogPluginComponent(); const viewSummary = (value) => { showTicketDialog.value = true; @@ -29,6 +39,8 @@ const viewSummary = (value) => { // }, // }); }; +const originDialogRef = ref(); + const columns = computed(() => [ { name: 'minTimed', @@ -113,10 +125,39 @@ const columns = computed(() => [ 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; + } +};