From c6e9ae2c5f8d7140f3faca0ed7a6499d4964fcd1 Mon Sep 17 00:00:00 2001 From: jorgep Date: Mon, 19 Feb 2024 10:56:47 +0100 Subject: [PATCH] fix: refs #6317 validation % fix e2e --- src/components/common/VnCurrency.vue | 11 +++-------- src/composables/useValidNumber.js | 3 --- src/pages/InvoiceIn/Card/InvoiceInDueDay.vue | 5 +++-- .../integration/invoiceIn/invoiceInList.spec.js | 2 ++ 4 files changed, 8 insertions(+), 13 deletions(-) delete mode 100644 src/composables/useValidNumber.js diff --git a/src/components/common/VnCurrency.vue b/src/components/common/VnCurrency.vue index a97eb196a..0466f7e3a 100644 --- a/src/components/common/VnCurrency.vue +++ b/src/components/common/VnCurrency.vue @@ -2,7 +2,6 @@ import { computed } from 'vue'; import { useI18n } from 'vue-i18n'; import { useCapitalize } from 'src/composables/useCapitalize'; -import { useValidNumber } from 'src/composables/useValidNumber'; import VnInput from 'src/components/common/VnInput.vue'; const props = defineProps({ @@ -19,15 +18,16 @@ const amount = computed({ return props.modelValue; }, set(val) { - emit('update:modelValue', val.replaceAll(',', '.')); + emit('update:modelValue', val); }, }); - es: amount: importe diff --git a/src/composables/useValidNumber.js b/src/composables/useValidNumber.js deleted file mode 100644 index 32b1aba04..000000000 --- a/src/composables/useValidNumber.js +++ /dev/null @@ -1,3 +0,0 @@ -export function useValidNumber(value) { - return /^(\d|\d+(\.)?\d+)$/.test(value); -} diff --git a/src/pages/InvoiceIn/Card/InvoiceInDueDay.vue b/src/pages/InvoiceIn/Card/InvoiceInDueDay.vue index 48c166191..edfd93a2e 100644 --- a/src/pages/InvoiceIn/Card/InvoiceInDueDay.vue +++ b/src/pages/InvoiceIn/Card/InvoiceInDueDay.vue @@ -8,6 +8,7 @@ import { useArrayData } from 'src/composables/useArrayData'; import CrudModel from 'src/components/CrudModel.vue'; import FetchData from 'src/components/FetchData.vue'; import VnSelectFilter from 'src/components/common/VnSelectFilter.vue'; +import VnCurrency from 'src/components/common/VnCurrency.vue'; const route = useRoute(); const { t } = useI18n(); @@ -158,9 +159,9 @@ async function insert() {