diff --git a/src/components/CreateNewPostcodeForm.vue b/src/components/CreateNewPostcodeForm.vue index ccffb2ec2..47836c05b 100644 --- a/src/components/CreateNewPostcodeForm.vue +++ b/src/components/CreateNewPostcodeForm.vue @@ -8,7 +8,7 @@ import VnSelectFilter from 'src/components/common/VnSelectFilter.vue'; import VnInput from 'src/components/common/VnInput.vue'; import CreateNewCityForm from './CreateNewCityForm.vue'; import CreateNewProvinceForm from './CreateNewProvinceForm.vue'; -import VnSelectCreate from 'components/common/VnSelectCreate.vue'; +import VnSelectDialog from 'components/common/VnSelectDialog.vue'; import FormModelPopup from './FormModelPopup.vue'; const emit = defineEmits(['onDataSaved']); @@ -85,7 +85,7 @@ const onProvinceCreated = async ({ name }, formData) => { />
- { @on-data-saved="onCityCreated($event, data)" /> - +
- { @on-data-saved="onProvinceCreated($event, data)" /> - +
+import { ref, reactive } from 'vue'; +import { useI18n } from 'vue-i18n'; + +import VnSelectFilter from 'src/components/common/VnSelectFilter.vue'; +import VnInput from 'src/components/common/VnInput.vue'; + +import axios from 'axios'; +import useNotify from 'src/composables/useNotify.js'; + +const emit = defineEmits(['onDataSaved']); + +const $props = defineProps({ + rows: { + type: Array, + default: () => [], + }, + fieldsOptions: { + type: Array, + default: () => [], + }, + editUrl: { + type: String, + default: '', + }, +}); + +const { t } = useI18n(); +const { notify } = useNotify(); + +const formData = reactive({ + field: null, + newValue: null, +}); + +const closeButton = ref(null); +const isLoading = ref(false); + +const onDataSaved = () => { + notify('globals.dataSaved', 'positive'); + emit('onDataSaved'); + closeForm(); +}; + +const submitData = async () => { + try { + isLoading.value = true; + const rowsToEdit = $props.rows.map((row) => ({ id: row.id, itemFk: row.itemFk })); + const payload = { + field: formData.field, + newValue: formData.newValue, + lines: rowsToEdit, + }; + + await axios.post($props.editUrl, payload); + onDataSaved(); + isLoading.value = false; + } catch (err) { + console.error('Error submitting table cell edit'); + } +}; + +const closeForm = () => { + if (closeButton.value) closeButton.value.click(); +}; + + + + + + + + en: + editBuyTitle: Edit {buysAmount} buy(s) + es: + editBuyTitle: Editar {buysAmount} compra(s) + Field to edit: Campo a editar + Value: Valor + diff --git a/src/components/FilterItemForm.vue b/src/components/FilterItemForm.vue new file mode 100644 index 000000000..4c329a8e8 --- /dev/null +++ b/src/components/FilterItemForm.vue @@ -0,0 +1,242 @@ + + + + + +es: + Filter item: Filtrar artículo + Enter a new search: Introduce una nueva búsqueda + + + diff --git a/src/components/FilterTravelForm.vue b/src/components/FilterTravelForm.vue new file mode 100644 index 000000000..499d5bc4e --- /dev/null +++ b/src/components/FilterTravelForm.vue @@ -0,0 +1,240 @@ + + + + + +es: + Filter travels: Filtro envíos + Enter a new search: Introduce una nueva búsqueda + + + diff --git a/src/components/FormModel.vue b/src/components/FormModel.vue index 594780220..9fd16088c 100644 --- a/src/components/FormModel.vue +++ b/src/components/FormModel.vue @@ -1,6 +1,6 @@