-
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.
Ajout Popup suppression dans tout les composants
Ajout route dans popup lancertraitement
- Loading branch information
1 parent
27073dc
commit 1761346
Showing
8 changed files
with
156 additions
and
88 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
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,63 @@ | ||
<template> | ||
<v-dialog v-model="dialog" width="500"> | ||
<v-skeleton-loader | ||
:loading="isLoading" | ||
class="mx-auto" | ||
elevation="12" | ||
width="500" | ||
type="table-heading, list-item-two-line, table-tfoot" | ||
> | ||
<v-card> | ||
<v-card-title>Suppression</v-card-title> | ||
<v-divider></v-divider> | ||
<v-card-text>Êtes-vous certain de vouloir supprimer définitivement cette demande ?</v-card-text> | ||
<v-card-actions> | ||
|
||
<v-container class="d-flex justify-space-between"> | ||
<v-btn @click="cancel()">Annuler</v-btn> | ||
<v-btn @click="confirm()">Confirmer</v-btn> | ||
</v-container> | ||
</v-card-actions> | ||
</v-card> | ||
</v-skeleton-loader> | ||
</v-dialog> | ||
</template> | ||
<script setup> | ||
import demandesService from '@/service/DemandesService'; | ||
import router from '@/router'; | ||
import { ref } from 'vue'; | ||
const dialog = defineModel(); | ||
const emits = defineEmits(['supp']) | ||
const props = defineProps({ | ||
returnToAccueil: { | ||
required: false, | ||
type: Boolean, | ||
}, | ||
demande: { | ||
required: true, | ||
type: Object | ||
} | ||
}) | ||
const isLoading = ref(false); | ||
function confirm() { | ||
isLoading.value = true; | ||
demandesService.deleteDemande(props.demande.id, props.demande.type) | ||
.then(()=>{ | ||
if(props.returnToAccueil){ | ||
router.push('/accueil'); | ||
} | ||
emits('supp'); | ||
}).finally(() => { | ||
isLoading.value = false; | ||
dialog.value = false; | ||
}) | ||
} | ||
function cancel() { | ||
dialog.value = false; | ||
} | ||
</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 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
Oops, something went wrong.