From 3bb822d785c7205d19635653cbad011bcf95c5da Mon Sep 17 00:00:00 2001 From: jgallego Date: Thu, 9 Jan 2025 08:43:47 +0100 Subject: [PATCH 01/38] feat: refs #7937 add import claim button to ClaimAction component --- src/pages/Claim/Card/ClaimAction.vue | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/pages/Claim/Card/ClaimAction.vue b/src/pages/Claim/Card/ClaimAction.vue index 2e890dba89..3348051409 100644 --- a/src/pages/Claim/Card/ClaimAction.vue +++ b/src/pages/Claim/Card/ClaimAction.vue @@ -368,6 +368,17 @@ async function post(query, params) { From 5474129a184abf02281cb769b6d726d5c647573d Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Mon, 10 Feb 2025 14:47:58 +0100 Subject: [PATCH 02/38] fix: add mapper before Save --- src/components/FormModel.vue | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/components/FormModel.vue b/src/components/FormModel.vue index 59141d374c..9b7614fc9d 100644 --- a/src/components/FormModel.vue +++ b/src/components/FormModel.vue @@ -12,6 +12,7 @@ import SkeletonForm from 'components/ui/SkeletonForm.vue'; import VnConfirm from './ui/VnConfirm.vue'; import { tMobile } from 'src/composables/tMobile'; import { useArrayData } from 'src/composables/useArrayData'; +import { getDifferences, getUpdatedValues } from 'src/filters'; const { push } = useRouter(); const quasar = useQuasar(); @@ -278,7 +279,12 @@ function trimData(data) { } return data; } - +function onBeforeSave(formData, originalData) { + return getUpdatedValues( + Object.keys(getDifferences(formData, originalData)), + formData, + ); +} defineExpose({ save, isLoading, @@ -299,6 +305,7 @@ defineExpose({ :style="maxWidth ? 'max-width: ' + maxWidth : ''" id="formModel" :prevent-submit="$attrs['prevent-submit']" + :mapper="onBeforeSave" > Date: Tue, 18 Feb 2025 16:23:05 +0100 Subject: [PATCH 03/38] feat: refs #7937 add shelving selection to claim actions with data fetching --- src/pages/Claim/Card/ClaimAction.vue | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/src/pages/Claim/Card/ClaimAction.vue b/src/pages/Claim/Card/ClaimAction.vue index 404e42fc8c..baa36710ca 100644 --- a/src/pages/Claim/Card/ClaimAction.vue +++ b/src/pages/Claim/Card/ClaimAction.vue @@ -27,6 +27,7 @@ const claimActionsForm = ref(); const rows = ref([]); const selectedRows = ref([]); const destinationTypes = ref([]); +const shelvings = ref([]); const totalClaimed = ref(null); const DEFAULT_MAX_RESPONSABILITY = 5; const DEFAULT_MIN_RESPONSABILITY = 1; @@ -56,6 +57,12 @@ const columns = computed(() => [ field: (row) => row.claimDestinationFk, align: 'left', }, + { + name: 'shelving', + label: t('shelvings.shelving'), + field: (row) => row.shelvingFk, + align: 'left', + }, { name: 'Landed', label: t('Landed'), @@ -125,6 +132,10 @@ async function updateDestination(claimDestinationFk, row, options = {}) { options.reload && claimActionsForm.value.reload(); } } +async function updateShelving(shelvingFk, row) { + await axios.patch(`ClaimEnds/${row.id}`, { shelvingFk }); + claimActionsForm.value.reload(); +} async function regularizeClaim() { await post(`Claims/${claimId}/regularizeClaim`); @@ -200,6 +211,7 @@ async function post(query, params) { auto-load @on-fetch="(data) => (destinationTypes = data)" /> + + + diff --git a/src/pages/Worker/Card/WorkerDescriptor.vue b/src/pages/Worker/Card/WorkerDescriptor.vue index de3f634e2c..0e946f1ddc 100644 --- a/src/pages/Worker/Card/WorkerDescriptor.vue +++ b/src/pages/Worker/Card/WorkerDescriptor.vue @@ -111,6 +111,7 @@ const handlePhotoUpdated = (evt = false) => { diff --git a/src/components/ItemsFilterPanel.vue b/src/components/ItemsFilterPanel.vue index f73753a6bc..36123b8345 100644 --- a/src/components/ItemsFilterPanel.vue +++ b/src/components/ItemsFilterPanel.vue @@ -281,7 +281,7 @@ const setCategoryList = (data) => { { return locale.includes(normalizedSearch); }); }); + const filteredPinnedModules = computed(() => { if (!search.value) return pinnedModules.value; const normalizedSearch = search.value @@ -71,7 +72,7 @@ watch( items.value = []; getRoutes(); }, - { deep: true }, + { deep: true } ); function findMatches(search, item) { @@ -103,40 +104,33 @@ function addChildren(module, route, parent) { } function getRoutes() { - const handleRoutes = { - main: getMainRoutes, - card: getCardRoutes, - }; - try { - handleRoutes[props.source](); - } catch (error) { - throw new Error(`Method is not defined`); - } -} -function getMainRoutes() { - const modules = Object.assign([], navigation.getModules().value); + if (props.source === 'main') { + const modules = Object.assign([], navigation.getModules().value); - for (const item of modules) { - const moduleDef = routes.find( - (route) => toLowerCamel(route.name) === item.module, + for (const item of modules) { + const moduleDef = routes.find( + (route) => toLowerCamel(route.name) === item.module + ); + if (!moduleDef) continue; + item.children = []; + + addChildren(item.module, moduleDef, item.children); + } + + items.value = modules; + } + + if (props.source === 'card') { + const currentRoute = route.matched[1]; + const currentModule = toLowerCamel(currentRoute.name); + let moduleDef = routes.find( + (route) => toLowerCamel(route.name) === currentModule ); - if (!moduleDef) continue; - item.children = []; - addChildren(item.module, moduleDef, item.children); + if (!moduleDef) return; + if (!moduleDef?.menus) moduleDef = betaGetRoutes(); + addChildren(currentModule, moduleDef, items.value); } - - items.value = modules; -} - -function getCardRoutes() { - const currentRoute = route.matched[1]; - const currentModule = toLowerCamel(currentRoute.name); - let moduleDef = routes.find((route) => toLowerCamel(route.name) === currentModule); - - if (!moduleDef) return; - if (!moduleDef?.menus) moduleDef = betaGetRoutes(); - addChildren(currentModule, moduleDef, items.value); } function betaGetRoutes() { @@ -229,16 +223,9 @@ const searchModule = () => {