diff --git a/.eslintrc.js b/.eslintrc.js index c8bdecb1a..1d09a896f 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -58,7 +58,7 @@ module.exports = { rules: { 'prefer-promise-reject-errors': 'off', 'no-unused-vars': 'warn', - + "vue/no-multiple-template-root": "off" , // allow debugger during development only 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off', }, diff --git a/src/components/common/VnLocation.vue b/src/components/common/VnLocation.vue new file mode 100644 index 000000000..0b30faaa7 --- /dev/null +++ b/src/components/common/VnLocation.vue @@ -0,0 +1,135 @@ + + + + + +es: + Location: Ubicación + Search by postalcode, town, province or country: Buscar por código postal, ciudad o país + diff --git a/src/components/common/VnSelectFilter.vue b/src/components/common/VnSelectFilter.vue index 244fb50bb..7f10f5efe 100644 --- a/src/components/common/VnSelectFilter.vue +++ b/src/components/common/VnSelectFilter.vue @@ -12,11 +12,11 @@ const $props = defineProps({ default: () => [], }, optionLabel: { - type: String, + type: [String], default: '', }, filterOptions: { - type: Array, + type: [Array], default: () => [], }, isClearable: { @@ -47,6 +47,7 @@ function setOptions(data) { myOptions.value = JSON.parse(JSON.stringify(data)); myOptionsOriginal.value = JSON.parse(JSON.stringify(data)); } + setOptions(options.value); const filter = (val, options) => { const search = val.toString().toLowerCase(); diff --git a/src/pages/Claim/Card/ClaimAction.vue b/src/pages/Claim/Card/ClaimAction.vue index e92e65fc7..59409e432 100644 --- a/src/pages/Claim/Card/ClaimAction.vue +++ b/src/pages/Claim/Card/ClaimAction.vue @@ -37,6 +37,7 @@ const marker_labels = [ { value: DEFAULT_MIN_RESPONSABILITY, label: t('claim.summary.company') }, { value: DEFAULT_MAX_RESPONSABILITY, label: t('claim.summary.person') }, ]; +const multiplicatorValue = ref(); const columns = computed(() => [ { @@ -134,17 +135,7 @@ async function regularizeClaim() { message: t('globals.dataSaved'), type: 'positive', }); - if (claim.value.responsibility >= Math.ceil(DEFAULT_MAX_RESPONSABILITY) / 2) { - quasar - .dialog({ - component: VnConfirm, - componentProps: { - title: t('confirmGreuges'), - message: t('confirmGreugesMessage'), - }, - }) - .onOk(async () => await onUpdateGreugeAccept()); - } + await onUpdateGreugeAccept(); } async function onUpdateGreugeAccept() { @@ -153,9 +144,9 @@ async function onUpdateGreugeAccept() { filter: { where: { code: 'freightPickUp' } }, }) ).data.id; - const freightPickUpPrice = (await axios.get(`GreugeConfigs/findOne`)).data - .freightPickUpPrice; - + const freightPickUpPrice = + (await axios.get(`GreugeConfigs/findOne`)).data.freightPickUpPrice * + multiplicatorValue.value; await axios.post(`Greuges`, { clientFk: claim.value.clientFk, description: `${t('ClaimGreugeDescription')} ${claimId}`.toUpperCase(), @@ -226,10 +217,10 @@ async function importToNewRefundTicket() { show-if-above v-if="claim" > - + {{ `${t('Total claimed')}: ${toCurrency(totalClaimed)}` }} - +

@@ -250,13 +241,31 @@ async function importToNewRefundTicket() { - - + + + {{ t('mana') }} + + + + - {{ t('mana') }} - + diff --git a/src/pages/Customer/CustomerCreate.vue b/src/pages/Customer/CustomerCreate.vue index 310deb71a..63c90c9df 100644 --- a/src/pages/Customer/CustomerCreate.vue +++ b/src/pages/Customer/CustomerCreate.vue @@ -2,12 +2,11 @@ import { reactive, ref } from 'vue'; import { useI18n } from 'vue-i18n'; -import CustomerCreateNewPostcode from 'src/components/CreateNewPostcodeForm.vue'; import FetchData from 'components/FetchData.vue'; import FormModel from 'components/FormModel.vue'; import VnRow from 'components/ui/VnRow.vue'; import VnSelectFilter from 'src/components/common/VnSelectFilter.vue'; -import VnSelectCreate from 'src/components/common/VnSelectCreate.vue'; +import VnLocation from 'src/components/common/VnLocation.vue'; import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue'; const { t } = useI18n(); @@ -29,23 +28,18 @@ const newClientForm = reactive({ isEqualizated: false, }); -const postcodeFetchDataRef = ref(null); -const townsFetchDataRef = ref(null); const workersOptions = ref([]); const businessTypesOptions = ref([]); -const citiesLocationOptions = ref([]); -const provincesLocationOptions = ref([]); -const countriesOptions = ref([]); const postcodesOptions = ref([]); -const onPostcodeCreated = async ({ code, provinceFk, townFk, countryFk }, formData) => { - await postcodeFetchDataRef.value.fetch(); - await townsFetchDataRef.value.fetch(); - formData.postcode = code; - formData.provinceFk = provinceFk; - formData.city = citiesLocationOptions.value.find((town) => town.id === townFk).name; - formData.countryFk = countryFk; -}; + +function handleLocation(data, location ) { + const { town, code, provinceFk, countryFk } = location ?? {} + data.postcode = code; + data.city = town; + data.provinceFk = provinceFk; + data.countryFk = countryFk; +}