feature/EntriesCorrections #177
|
@ -15,23 +15,19 @@ const $props = defineProps({
|
|||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
fieldsOptions: {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
editUrl: {
|
||||
type: String,
|
||||
jsegarra marked this conversation as resolved
Outdated
|
||||
default: '',
|
||||
},
|
||||
});
|
||||
|
||||
const { t } = useI18n();
|
||||
const { notify } = useNotify();
|
||||
|
||||
const fieldsOptions = [
|
||||
{ field: 'packing', label: t('entry.latestBuys.packing') },
|
||||
{ field: 'grouping', label: t('entry.latestBuys.grouping') },
|
||||
{ field: 'packageValue', label: t('entry.latestBuys.packageValue') },
|
||||
{ field: 'weight', label: t('entry.latestBuys.weight') },
|
||||
{ field: 'description', label: t('entry.latestBuys.description') },
|
||||
{ field: 'size', label: t('entry.latestBuys.size') },
|
||||
{ field: 'weightByPiece', label: t('entry.latestBuys.weightByPiece') },
|
||||
{ field: 'packingOut', label: t('entry.latestBuys.packingOut') },
|
||||
{ field: 'landing', label: t('entry.latestBuys.landing') },
|
||||
];
|
||||
|
||||
const formData = reactive({
|
||||
field: null,
|
||||
newValue: null,
|
||||
|
@ -56,7 +52,7 @@ const submitData = async () => {
|
|||
lines: rowsToEdit,
|
||||
};
|
||||
|
||||
await axios.post('Buys/editLatestBuys', payload);
|
||||
await axios.post($props.editUrl, payload);
|
||||
onDataSaved();
|
||||
isLoading.value = false;
|
||||
} catch (err) {
|
||||
|
|
|
@ -209,6 +209,18 @@ const columns = computed(() => [
|
|||
},
|
||||
]);
|
||||
|
||||
const editTableCellFormFieldsOptions = [
|
||||
{ field: 'packing', label: t('entry.latestBuys.packing') },
|
||||
{ field: 'grouping', label: t('entry.latestBuys.grouping') },
|
||||
{ field: 'packageValue', label: t('entry.latestBuys.packageValue') },
|
||||
{ field: 'weight', label: t('entry.latestBuys.weight') },
|
||||
{ field: 'description', label: t('entry.latestBuys.description') },
|
||||
{ field: 'size', label: t('entry.latestBuys.size') },
|
||||
{ field: 'weightByPiece', label: t('entry.latestBuys.weightByPiece') },
|
||||
{ field: 'packingOut', label: t('entry.latestBuys.packingOut') },
|
||||
{ field: 'landing', label: t('entry.latestBuys.landing') },
|
||||
];
|
||||
|
||||
const openEditTableCellDialog = () => {
|
||||
editTableCellDialogRef.value.show();
|
||||
};
|
||||
|
@ -321,7 +333,9 @@ onMounted(async () => {
|
|||
</QPageSticky>
|
||||
<QDialog ref="editTableCellDialogRef">
|
||||
<EditTableCellValueForm
|
||||
edit-url="Buys/editLatestBuys"
|
||||
:rows="rowsSelected"
|
||||
:fields-options="editTableCellFormFieldsOptions"
|
||||
@on-data-saved="onEditCellDataSaved()"
|
||||
/>
|
||||
</QDialog>
|
||||
|
|
Loading…
Reference in New Issue
@alexm Diría que en un componente genérico no definimos valores para un modulo en concreto, puedes confirmar.
Esto se pasaría por parámetro del componente no?
Exacto usar directamente t(...)
Se pasó la data clave a props para poder reutilizar en un futuro.
Commit:
ddcbc5d8d7