diff --git a/src/components/common/VnSelectFilter.vue b/src/components/common/VnSelectFilter.vue index 9ccb94e33..53bd8deb2 100644 --- a/src/components/common/VnSelectFilter.vue +++ b/src/components/common/VnSelectFilter.vue @@ -4,7 +4,7 @@ const emit = defineEmits(['update:modelValue', 'update:options']); const $props = defineProps({ modelValue: { - type: [String, Number], + type: [String, Number, Object], default: null, }, options: { diff --git a/src/components/ui/CardDescriptor.vue b/src/components/ui/CardDescriptor.vue index f63b75de6..2dd531f20 100644 --- a/src/components/ui/CardDescriptor.vue +++ b/src/components/ui/CardDescriptor.vue @@ -2,6 +2,7 @@ import { onMounted, useSlots, ref, watch } from 'vue'; import { useI18n } from 'vue-i18n'; import axios from 'axios'; +import { useArrayData } from 'src/composables/useArrayData'; import SkeletonDescriptor from 'components/ui/SkeletonDescriptor.vue'; const $props = defineProps({ @@ -26,18 +27,21 @@ const $props = defineProps({ default: 0, }, }); - +const arrayData = useArrayData('claimData'); +const store = arrayData.store; +console.log('eee', store.data); const slots = useSlots(); const { t } = useI18n(); -const entity = ref(); +const entity = ref(null); +let lastUrl = ref(null); onMounted(async () => { - await fetch(); + entity.value = await store.data; }); const emit = defineEmits(['onFetch']); - async function fetch() { + lastUrl.value = $props.url; const params = {}; if ($props.filter) params.filter = JSON.stringify($props.filter); @@ -49,6 +53,7 @@ async function fetch() { } watch($props, async () => { + if (lastUrl.value == $props.url) return; entity.value = null; await fetch(); }); diff --git a/src/i18n/en/index.js b/src/i18n/en/index.js index cfd20716b..e6d071c73 100644 --- a/src/i18n/en/index.js +++ b/src/i18n/en/index.js @@ -269,6 +269,7 @@ export default { development: 'Development', log: 'Audit logs', notes: 'Notes', + action: 'Action', }, list: { customer: 'Customer', diff --git a/src/i18n/es/index.js b/src/i18n/es/index.js index 532c1bb3b..ec8346fda 100644 --- a/src/i18n/es/index.js +++ b/src/i18n/es/index.js @@ -268,6 +268,7 @@ export default { photos: 'Fotos', log: 'Registros de auditoría', notes: 'Notas', + action: 'Acción', }, list: { customer: 'Cliente', diff --git a/src/pages/Claim/Card/ClaimAction.vue b/src/pages/Claim/Card/ClaimAction.vue new file mode 100644 index 000000000..0f936f17e --- /dev/null +++ b/src/pages/Claim/Card/ClaimAction.vue @@ -0,0 +1,397 @@ + + + (destinationTypes = data)" + /> + (resolvedStateId = data)" + /> + + + + {{ `${t('Total claimed')}: ${toCurrency(totalClaimed)}` }} + + + + + + + + {{ t('claim.summary.actions') }} + + + + + + {{ t('mana') }} + + + + + (rows = data)" + auto-load + > + + + + + + {{ value }} + + + + + + + updateDestination(value, rows[rowIndex]) + " + /> + + + + + {{ toCurrency(value) }} + + + + + {{ toCurrency(value) }} + + + + + + + {{ t('Remove line') }} + + + + + + + + + + + + + + + + + + {{ column.label }} + + + + + {{ column.value.description }} + + + {{ column.value }} + + + + + + + + + + + + + + + + + + + + + + + {{ t('dialog title') }} + + + + + + + + + + + + + + + + + + +en: + mana: Is paid with mana + dialog title: Change destination to all selected rows +es: + mana: Cargado al maná + Delivered: Descripción + Quantity: Cantidad + Claimed: Rec + Description: Description + Price: Precio + Discount: Dto. + Destination: Destino + Landed: F.entrega + Remove line: Eliminar línea + Total claimed: Total reclamado + Regularize: Regularizar + Change destination: Cambiar destino + Import claim: Importar reclamación + dialog title: Cambiar destino en todas las filas seleccionadas + Remove: Eliminar + diff --git a/src/pages/Claim/Card/ClaimCard.vue b/src/pages/Claim/Card/ClaimCard.vue index 03b9889f0..40a3bcd7a 100644 --- a/src/pages/Claim/Card/ClaimCard.vue +++ b/src/pages/Claim/Card/ClaimCard.vue @@ -1,17 +1,58 @@ diff --git a/src/router/modules/claim.js b/src/router/modules/claim.js index 9df1dd64e..1dfd75cff 100644 --- a/src/router/modules/claim.js +++ b/src/router/modules/claim.js @@ -19,6 +19,7 @@ export default { 'ClaimLog', 'ClaimNotes', 'ClaimDevelopment', + 'ClaimAction', ], }, children: [ @@ -130,6 +131,15 @@ export default { }, component: () => import('src/pages/Claim/Card/ClaimNotes.vue'), }, + { + name: 'ClaimAction', + path: 'action', + meta: { + title: 'action', + icon: 'vn:actions', + }, + component: () => import('src/pages/Claim/Card/ClaimAction.vue'), + }, ], }, ],
+ {{ t('claim.summary.actions') }} +