From f2006663b732bf70908254362624e4e08078fce1 Mon Sep 17 00:00:00 2001 From: carlossa Date: Wed, 10 Jan 2024 14:29:01 +0100 Subject: [PATCH 1/7] refs #6664 popup --- src/components/ui/VnConfirm.vue | 13 ++++++++++--- src/pages/Claim/Card/ClaimAction.vue | 16 +++++++++++----- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/src/components/ui/VnConfirm.vue b/src/components/ui/VnConfirm.vue index f8715f685..c6650a28f 100644 --- a/src/components/ui/VnConfirm.vue +++ b/src/components/ui/VnConfirm.vue @@ -2,6 +2,7 @@ import { ref } from 'vue'; import { useDialogPluginComponent } from 'quasar'; import { useI18n } from 'vue-i18n'; +import { onMounted } from 'vue'; const { t } = useI18n(); @@ -28,6 +29,7 @@ const props = defineProps({ required: false, default: null, }, + callbackFn: Function, }); defineEmits(['confirm', ...useDialogPluginComponent.emits]); @@ -37,12 +39,17 @@ const { dialogRef, onDialogOK } = useDialogPluginComponent(); const title = props.title || t('Confirm'); const message = props.message || t('Are you sure you want to continue?'); const isLoading = ref(false); - +onMounted(() => { + if (props.callbackFn) props.callbackFn(); +}); async function confirm() { + let html = null; + html = document.getElementById(props.data.inputId); isLoading.value = true; if (props.promise) { try { - await props.promise(props.data); + if (html) await props.promise({ ...props.data, return: html.value }); + else await props.promise(props.data); } finally { isLoading.value = false; } @@ -66,7 +73,7 @@ async function confirm() { - + [ { @@ -140,22 +141,27 @@ async function regularizeClaim() { component: VnConfirm, componentProps: { title: t('confirmGreuges'), - message: t('confirmGreugesMessage'), + message: ` + + `, + data: { inputId: 'multiplicatorValue' }, + promise: onUpdateGreugeAccept, }, }) .onOk(async () => await onUpdateGreugeAccept()); } } -async function onUpdateGreugeAccept() { +async function onUpdateGreugeAccept({ return: multiplicatorValue }) { const greugeTypeFreightId = ( await axios.get(`GreugeTypes/findOne`, { 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; + console.log(freightPickUpPrice); await axios.post(`Greuges`, { clientFk: claim.value.clientFk, description: `${t('ClaimGreugeDescription')} ${claimId}`.toUpperCase(), From b36cdbf7214376bfc6d3d99e1b96c1f89723ec65 Mon Sep 17 00:00:00 2001 From: carlossa Date: Thu, 11 Jan 2024 08:33:57 +0100 Subject: [PATCH 2/7] refs #6664 scss --- src/components/ui/VnConfirm.vue | 2 +- src/pages/Claim/Card/ClaimAction.vue | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/ui/VnConfirm.vue b/src/components/ui/VnConfirm.vue index c6650a28f..0ce18cadb 100644 --- a/src/components/ui/VnConfirm.vue +++ b/src/components/ui/VnConfirm.vue @@ -72,7 +72,7 @@ async function confirm() { - + diff --git a/src/pages/Claim/Card/ClaimAction.vue b/src/pages/Claim/Card/ClaimAction.vue index f3dd0b952..76f76903c 100644 --- a/src/pages/Claim/Card/ClaimAction.vue +++ b/src/pages/Claim/Card/ClaimAction.vue @@ -142,7 +142,7 @@ async function regularizeClaim() { componentProps: { title: t('confirmGreuges'), message: ` - + `, data: { inputId: 'multiplicatorValue' }, promise: onUpdateGreugeAccept, From e47561df868d9da935d9b69975948e7017212399 Mon Sep 17 00:00:00 2001 From: carlossa Date: Wed, 24 Jan 2024 13:50:04 +0100 Subject: [PATCH 3/7] refs #6664 disable --- src/pages/Claim/Card/ClaimAction.vue | 37 ++++++++++++++++++++++------ 1 file changed, 29 insertions(+), 8 deletions(-) diff --git a/src/pages/Claim/Card/ClaimAction.vue b/src/pages/Claim/Card/ClaimAction.vue index 76f76903c..b2c99bcb6 100644 --- a/src/pages/Claim/Card/ClaimAction.vue +++ b/src/pages/Claim/Card/ClaimAction.vue @@ -232,10 +232,10 @@ async function importToNewRefundTicket() { show-if-above v-if="claim" > - + {{ `${t('Total claimed')}: ${toCurrency(totalClaimed)}` }} - +

@@ -256,13 +256,31 @@ async function importToNewRefundTicket() { - - + + + {{ t('mana') }} + + + + - {{ t('mana') }} - + en: From 8ae7756e9abf61a5b96a8d0f131dd86d2f300526 Mon Sep 17 00:00:00 2001 From: carlossa Date: Wed, 24 Jan 2024 14:58:33 +0100 Subject: [PATCH 4/7] refs #6664 btn --- src/pages/Claim/Card/ClaimAction.vue | 40 +++++++++++++++------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/src/pages/Claim/Card/ClaimAction.vue b/src/pages/Claim/Card/ClaimAction.vue index b2c99bcb6..85a30600c 100644 --- a/src/pages/Claim/Card/ClaimAction.vue +++ b/src/pages/Claim/Card/ClaimAction.vue @@ -135,21 +135,21 @@ 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: ` - - `, - data: { inputId: 'multiplicatorValue' }, - promise: onUpdateGreugeAccept, - }, - }) - .onOk(async () => await onUpdateGreugeAccept()); - } + // if (claim.value.responsibility >= Math.ceil(DEFAULT_MAX_RESPONSABILITY) / 2) { + // quasar + // .dialog({ + // component: VnConfirm, + // componentProps: { + // title: t('confirmGreuges'), + // message: ` + // + // `, + // data: { inputId: 'multiplicatorValue' }, + // promise: onUpdateGreugeAccept, + // }, + // }) + // .onOk(async () => await onUpdateGreugeAccept()); + // } } async function onUpdateGreugeAccept({ return: multiplicatorValue }) { @@ -275,11 +275,12 @@ async function importToNewRefundTicket() { name="multiplicatorValue" min="0" max="50" - disable=" - claim.value.responsibility >= - Math.ceil(DEFAULT_MAX_RESPONSABILITY) / 2 - " + v-model="multiplicatorValue" /> + @@ -521,4 +522,5 @@ es: Id item: Id artículo confirmGreuges: ¿Desea insertar greuges? confirmGreugesMessage: Insertar greuges en la ficha del cliente + Apply Greuges: Aplicar Greuges From 35aa0ba20a769006396747d6a58ef10f41d480ec Mon Sep 17 00:00:00 2001 From: carlossa Date: Thu, 25 Jan 2024 13:48:42 +0100 Subject: [PATCH 5/7] refs #6664 claimPortes --- src/pages/Claim/Card/ClaimAction.vue | 29 +++++-------------- .../integration/claim/claimAction.spec.js | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/pages/Claim/Card/ClaimAction.vue b/src/pages/Claim/Card/ClaimAction.vue index 85a30600c..371cb015f 100644 --- a/src/pages/Claim/Card/ClaimAction.vue +++ b/src/pages/Claim/Card/ClaimAction.vue @@ -37,7 +37,7 @@ const marker_labels = [ { value: DEFAULT_MIN_RESPONSABILITY, label: t('claim.summary.company') }, { value: DEFAULT_MAX_RESPONSABILITY, label: t('claim.summary.person') }, ]; -const portesMultiplicator = ref(); +const multiplicatorValue = ref(); const columns = computed(() => [ { @@ -135,24 +135,10 @@ 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: ` - // - // `, - // data: { inputId: 'multiplicatorValue' }, - // promise: onUpdateGreugeAccept, - // }, - // }) - // .onOk(async () => await onUpdateGreugeAccept()); - // } + await onUpdateGreugeAccept(); } -async function onUpdateGreugeAccept({ return: multiplicatorValue }) { +async function onUpdateGreugeAccept() { const greugeTypeFreightId = ( await axios.get(`GreugeTypes/findOne`, { filter: { where: { code: 'freightPickUp' } }, @@ -160,7 +146,7 @@ async function onUpdateGreugeAccept({ return: multiplicatorValue }) { ).data.id; const freightPickUpPrice = (await axios.get(`GreugeConfigs/findOne`)).data.freightPickUpPrice * - +multiplicatorValue; + +multiplicatorValue.value; console.log(freightPickUpPrice); await axios.post(`Greuges`, { clientFk: claim.value.clientFk, @@ -267,6 +253,9 @@ async function importToNewRefundTicket() { - diff --git a/test/cypress/integration/claim/claimAction.spec.js b/test/cypress/integration/claim/claimAction.spec.js index f181722fa..685e120ce 100644 --- a/test/cypress/integration/claim/claimAction.spec.js +++ b/test/cypress/integration/claim/claimAction.spec.js @@ -31,7 +31,6 @@ describe('ClaimAction', () => { it('should regularize', () => { cy.get('[title="Regularize"]').click(); - cy.clickConfirm(); }); it('should remove the line', () => { From 67d95f9ad0d296b9704ccaa63a0ef7989da0af22 Mon Sep 17 00:00:00 2001 From: carlossa Date: Thu, 25 Jan 2024 14:44:41 +0100 Subject: [PATCH 6/7] refs #6664 vnConfirm og --- src/components/ui/VnConfirm.vue | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/src/components/ui/VnConfirm.vue b/src/components/ui/VnConfirm.vue index 0ce18cadb..f8715f685 100644 --- a/src/components/ui/VnConfirm.vue +++ b/src/components/ui/VnConfirm.vue @@ -2,7 +2,6 @@ import { ref } from 'vue'; import { useDialogPluginComponent } from 'quasar'; import { useI18n } from 'vue-i18n'; -import { onMounted } from 'vue'; const { t } = useI18n(); @@ -29,7 +28,6 @@ const props = defineProps({ required: false, default: null, }, - callbackFn: Function, }); defineEmits(['confirm', ...useDialogPluginComponent.emits]); @@ -39,17 +37,12 @@ const { dialogRef, onDialogOK } = useDialogPluginComponent(); const title = props.title || t('Confirm'); const message = props.message || t('Are you sure you want to continue?'); const isLoading = ref(false); -onMounted(() => { - if (props.callbackFn) props.callbackFn(); -}); + async function confirm() { - let html = null; - html = document.getElementById(props.data.inputId); isLoading.value = true; if (props.promise) { try { - if (html) await props.promise({ ...props.data, return: html.value }); - else await props.promise(props.data); + await props.promise(props.data); } finally { isLoading.value = false; } @@ -72,8 +65,8 @@ async function confirm() { - - + + Date: Mon, 29 Jan 2024 11:48:18 +0100 Subject: [PATCH 7/7] refs #6664 claimfix --- src/pages/Claim/Card/ClaimAction.vue | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/pages/Claim/Card/ClaimAction.vue b/src/pages/Claim/Card/ClaimAction.vue index 371cb015f..59409e432 100644 --- a/src/pages/Claim/Card/ClaimAction.vue +++ b/src/pages/Claim/Card/ClaimAction.vue @@ -146,8 +146,7 @@ async function onUpdateGreugeAccept() { ).data.id; const freightPickUpPrice = (await axios.get(`GreugeConfigs/findOne`)).data.freightPickUpPrice * - +multiplicatorValue.value; - console.log(freightPickUpPrice); + multiplicatorValue.value; await axios.post(`Greuges`, { clientFk: claim.value.clientFk, description: `${t('ClaimGreugeDescription')} ${claimId}`.toUpperCase(), @@ -474,9 +473,6 @@ async function importToNewRefundTicket() { .mana { float: inline-start; } -.vn-card { - background-color: blue($color: #000000); -} en: