0
0
Fork 0

refs #6321 feat updateQuantity

This commit is contained in:
Javier Segarra 2024-04-03 09:58:04 +02:00
parent 85fa394be0
commit 2951e69a6a
1 changed files with 7 additions and 0 deletions

View File

@ -11,12 +11,15 @@ import VnInput from 'src/components/common/VnInput.vue';
import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue'; 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';
import useNotify from 'src/composables/useNotify.js';
const { openConfirmationModal } = useVnConfirm(); const { openConfirmationModal } = useVnConfirm();
import { useDialogPluginComponent } from 'quasar'; import { useDialogPluginComponent } from 'quasar';
const { t } = useI18n(); const { t } = useI18n();
const URL_KEY = 'Tickets/ItemLack'; const URL_KEY = 'Tickets/ItemLack';
const editableStates = ref([]); const editableStates = ref([]);
const { notify } = useNotify();
const selectedRows = ref([]); const selectedRows = ref([]);
const originalRowDataCopy = ref(null); const originalRowDataCopy = ref(null);
@ -49,12 +52,16 @@ const saveChange = async (field, { rowIndex, row }) => {
break; break;
case 'quantity': case 'quantity':
await axios.post(`Sales/${row.saleFk}/updateQuantity`, {
quantity: +row.quantity,
});
break; break;
default: default:
console.error(field, { rowIndex, row }); console.error(field, { rowIndex, row });
break; break;
} }
notify('globals.dataSaved', 'positive');
} catch (err) { } catch (err) {
console.error('Error saving changes', err); console.error('Error saving changes', err);
} }