Compare commits

...

9 Commits

Author SHA1 Message Date
Robert Ferrús b31010aa2b Merge branch 'dev' into 8077-sumDefaulterFront
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-10-24 06:09:37 +00:00
Alex Moreno 32b4636706 Merge branch 'test' of https://gitea.verdnatura.es/verdnatura/salix-front into dev
gitea/salix-front/pipeline/head This commit looks good Details
2024-10-24 07:49:10 +02:00
Alex Moreno f26976b744 Merge branch 'master' of https://gitea.verdnatura.es/verdnatura/salix-front into test
gitea/salix-front/pipeline/head This commit looks good Details
2024-10-24 07:49:01 +02:00
Javi Gallego a0a37a68a0 Merge pull request '#8083 hotfix-insertRecord' (!859) from 8083-hotfix-insertRecord into master
gitea/salix-front/pipeline/head This commit looks good Details
Reviewed-on: #859
Reviewed-by: Javi Gallego <jgallego@verdnatura.es>
2024-10-23 14:25:00 +00:00
Jorge Penadés 1bfede4a55 fix: refs #8083 drop useless code
gitea/salix-front/pipeline/pr-master This commit looks good Details
2024-10-23 16:13:32 +02:00
Jorge Penadés 4e31566ddd fix: refs #8083 drop useless code
gitea/salix-front/pipeline/pr-master This commit looks good Details
2024-10-23 16:13:04 +02:00
Jorge Penadés 33ee1ea01b fix: refs #8083 drop useless code
gitea/salix-front/pipeline/pr-master This commit looks good Details
2024-10-23 16:11:58 +02:00
Jorge Penadés 126bb3f039 feat: refs #8083 insert
gitea/salix-front/pipeline/pr-master This commit looks good Details
2024-10-23 16:10:14 +02:00
Jorge Penadés 9673f7be1e fix: refs #8083 update rightly 2024-10-23 15:17:06 +02:00
1 changed files with 12 additions and 22 deletions

View File

@ -190,17 +190,11 @@ const getExpeditionState = async (expedition) => {
const { data: expeditionStates } = await axios.get(`ExpeditionStates/filter`, { const { data: expeditionStates } = await axios.get(`ExpeditionStates/filter`, {
params: { filter: JSON.stringify(filter) }, params: { filter: JSON.stringify(filter) },
}); });
const { data: scannedStates } = await axios.get(`ExpeditionStates`, {
params: { filter: JSON.stringify(filter), fields: ['id', 'isScanned'] },
});
expeditionsLogsData.value = expeditionStates.map((state) => { expeditionsLogsData.value = expeditionStates.map((state) => ({
const scannedState = scannedStates.find((s) => s.id === state.id);
return {
...state, ...state,
isScanned: scannedState ? scannedState.isScanned : false, isScanned: !!state.isScanned,
}; }));
});
} catch (error) { } catch (error) {
console.error(error); console.error(error);
} }
@ -231,16 +225,17 @@ onUnmounted(() => (stateStore.rightDrawer = false));
:select-props="{ :select-props="{
options: expeditionStateTypes, options: expeditionStateTypes,
optionLabel: 'description', optionLabel: 'description',
optionValue: 'code',
}" }"
:promise=" :promise="
async (stateTypeFk) => { async (stateCode) => {
await vnTableRef.CrudModelRef.saveChanges({ await axios.post('ExpeditionStates/addExpeditionState', {
updates: selectedRows.map(({ id }) => ({ expeditions: selectedRows.map(({ id }) => {
data: { stateTypeFk }, return { expeditionFk: id, stateCode };
where: { id }, }),
})),
}); });
vnTableRef.tableRef.clearSelection(); vnTableRef.tableRef.clearSelection();
vnTableRef.reload();
} }
" "
/> />
@ -309,7 +304,6 @@ onUnmounted(() => (stateStore.rightDrawer = false));
'row-key': 'id', 'row-key': 'id',
selection: 'multiple', selection: 'multiple',
}" }"
save-url="Expeditions/crud"
auto-load auto-load
:expr-builder=" :expr-builder="
(param, value) => { (param, value) => {
@ -355,11 +349,7 @@ onUnmounted(() => (stateStore.rightDrawer = false));
</template> </template>
<template #body-cell-isScanned="{ row }"> <template #body-cell-isScanned="{ row }">
<QTd style="text-align: center"> <QTd style="text-align: center">
<QCheckbox disable v-model="row.isScanned"> <QCheckbox disable v-model="row.isScanned" />
{{
row.isScanned === 1 ? t('expedition.yes') : t('expedition.no')
}}
</QCheckbox>
</QTd> </QTd>
</template> </template>
</QTable> </QTable>