-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #194 from abes-esr/develop
merge dev to test
- Loading branch information
Showing
11 changed files
with
208 additions
and
256 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<template> | ||
<v-tooltip v-if="canArchive(demande)" text="Archiver"> | ||
<template v-slot:activator="{ props }"> | ||
<v-btn v-bind="props" | ||
variant="text" | ||
icon="mdi-archive" | ||
color="primary" | ||
@click="archiverDemande(demande)" | ||
aria-label="Archiver"></v-btn> | ||
</template> | ||
</v-tooltip> | ||
</template> | ||
<script setup> | ||
import itemService from '@/service/ItemService'; | ||
const emits = defineEmits(['clicked', 'onError']); | ||
const props = defineProps({ | ||
demande: { | ||
required: true | ||
} | ||
}); | ||
//Action d'archivage ou suppression selon état de la demande dans le TDB | ||
function canArchive(item) { | ||
return item.etatDemande === 'Terminé'; | ||
} | ||
//Archivage d'une demande | ||
function archiverDemande(item) { | ||
itemService.archiverDemande(item.type, item.id) | ||
.then(() => { | ||
emits('clicked'); | ||
}) | ||
.catch(error => { | ||
emits('onError', error); | ||
}); | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<template> | ||
<v-tooltip v-if="demande.etatDemande === 'Archivé'" text="Restaurer"> | ||
<template v-slot:activator="{ props }"> | ||
<v-btn v-bind="props" | ||
variant="text" | ||
color="green" | ||
icon="mdi-package-up" | ||
@click="restaurerDemande(demande)"></v-btn> | ||
</template> | ||
</v-tooltip> | ||
</template> | ||
<script setup> | ||
import itemService from '@/service/ItemService'; | ||
const emits = defineEmits(['clicked', 'onError']); | ||
const props = defineProps({ | ||
demande: { | ||
required: true | ||
} | ||
}); | ||
function restaurerDemande(item) { | ||
itemService.restaurerDemande(item.id, item.type) | ||
.then(() => { | ||
emits('clicked'); | ||
}) | ||
.catch(error => { | ||
emits('onError', error); | ||
}); | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<template> | ||
<v-tooltip v-if="canStop(demande)" text="Annuler"> | ||
<template v-slot:activator="{ props }"> | ||
<v-btn v-bind="props" | ||
icon="mdi-stop" | ||
variant="text" | ||
color="red" | ||
@click="dialog = true"> | ||
</v-btn> | ||
</template> | ||
</v-tooltip> | ||
<dialog-confirmation-stop v-model="dialog" :id="demande.id" @clicked="emits('clicked')" @on-error="throwError"> | ||
</dialog-confirmation-stop> | ||
</template> | ||
<script setup> | ||
import DialogConfirmationStop from '@/components/Dialog/DialogConfirmationStop.vue'; | ||
import { ref } from 'vue'; | ||
const emits = defineEmits(['clicked', 'onError']); | ||
const props = defineProps({ | ||
demande: { | ||
required: true | ||
} | ||
}); | ||
const dialog = ref(false); | ||
function canStop(item) { | ||
return item.etatDemande === 'En cours de traitement' || item.etatDemande === 'En attente'; | ||
} | ||
function throwError(error) { | ||
emits('onError', error); | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<template> | ||
<v-tooltip v-if="canCancel(demande)" text="Supprimer"> | ||
<template v-slot:activator="{ props }"> | ||
<v-btn v-bind="props" | ||
icon="mdi-delete" | ||
variant="text" | ||
@click="dialog = true"> | ||
</v-btn> | ||
</template> | ||
</v-tooltip> | ||
<dialog-suppression v-model="dialog" :demande="demande" @supp="emits('clicked')" @on-error="throwError"> | ||
</dialog-suppression> | ||
</template> | ||
<script setup> | ||
import { ref } from 'vue'; | ||
import DialogSuppression from '@/components/Dialog/DialogSuppression.vue'; | ||
const emits = defineEmits(['clicked', 'onError']); | ||
const props = defineProps({ | ||
demande: { | ||
required: true, | ||
} | ||
}); | ||
const dialog = ref(false); | ||
function canCancel(item) { | ||
return item.etatDemande !== 'Terminé' && item.etatDemande !== 'En cours de traitement' && item.etatDemande !== 'En attente'; | ||
} | ||
function throwError(error) { | ||
emits('onError', error); | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.