forked from verdnatura/salix-front
Reviewed-on: verdnatura/salix-front#859 Reviewed-by: Javi Gallego <jgallego@verdnatura.es>
This commit is contained in:
commit
a0a37a68a0
|
@ -190,17 +190,11 @@ const getExpeditionState = async (expedition) => {
|
|||
const { data: expeditionStates } = await axios.get(`ExpeditionStates/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) => {
|
||||
const scannedState = scannedStates.find((s) => s.id === state.id);
|
||||
return {
|
||||
...state,
|
||||
isScanned: scannedState ? scannedState.isScanned : false,
|
||||
};
|
||||
});
|
||||
expeditionsLogsData.value = expeditionStates.map((state) => ({
|
||||
...state,
|
||||
isScanned: !!state.isScanned,
|
||||
}));
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
|
@ -231,16 +225,17 @@ onUnmounted(() => (stateStore.rightDrawer = false));
|
|||
:select-props="{
|
||||
options: expeditionStateTypes,
|
||||
optionLabel: 'description',
|
||||
optionValue: 'code',
|
||||
}"
|
||||
:promise="
|
||||
async (stateTypeFk) => {
|
||||
await vnTableRef.CrudModelRef.saveChanges({
|
||||
updates: selectedRows.map(({ id }) => ({
|
||||
data: { stateTypeFk },
|
||||
where: { id },
|
||||
})),
|
||||
async (stateCode) => {
|
||||
await axios.post('ExpeditionStates/addExpeditionState', {
|
||||
expeditions: selectedRows.map(({ id }) => {
|
||||
return { expeditionFk: id, stateCode };
|
||||
}),
|
||||
});
|
||||
vnTableRef.tableRef.clearSelection();
|
||||
vnTableRef.reload();
|
||||
}
|
||||
"
|
||||
/>
|
||||
|
@ -309,7 +304,6 @@ onUnmounted(() => (stateStore.rightDrawer = false));
|
|||
'row-key': 'id',
|
||||
selection: 'multiple',
|
||||
}"
|
||||
save-url="Expeditions/crud"
|
||||
auto-load
|
||||
:expr-builder="
|
||||
(param, value) => {
|
||||
|
@ -355,11 +349,7 @@ onUnmounted(() => (stateStore.rightDrawer = false));
|
|||
</template>
|
||||
<template #body-cell-isScanned="{ row }">
|
||||
<QTd style="text-align: center">
|
||||
<QCheckbox disable v-model="row.isScanned">
|
||||
{{
|
||||
row.isScanned === 1 ? t('expedition.yes') : t('expedition.no')
|
||||
}}
|
||||
</QCheckbox>
|
||||
<QCheckbox disable v-model="row.isScanned" />
|
||||
</QTd>
|
||||
</template>
|
||||
</QTable>
|
||||
|
|
|
@ -118,6 +118,7 @@ expedition:
|
|||
removeExpeditionSubtitle: Are you sure you want to delete this expedition?
|
||||
worker: Worker
|
||||
move: Move
|
||||
isScanned: Scanned
|
||||
basicData:
|
||||
next: Next
|
||||
back: Back
|
||||
|
|
|
@ -207,6 +207,7 @@ expedition:
|
|||
removeExpeditionSubtitle: ¿Está seguro de eliminar esta expedición?
|
||||
worker: Trabajador
|
||||
move: Mover
|
||||
isScanned: Escaneado
|
||||
package:
|
||||
package: Embalaje
|
||||
quantity: Cantidad
|
||||
|
|
Loading…
Reference in New Issue