Skip to content

Commit

Permalink
Merge pull request #198 from abes-esr/develop
Browse files Browse the repository at this point in the history
develop to main
  • Loading branch information
jvk88511334 authored Jan 8, 2025
2 parents 9e97cb2 + dff078d commit 9edd645
Show file tree
Hide file tree
Showing 6 changed files with 96 additions and 10 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Item",
"version": "3.3.0",
"version": "3.3.1-SNAPSHOT",
"scripts": {
"dev": "vite",
"build": "vite build",
Expand Down
8 changes: 7 additions & 1 deletion src/components/Structure/Navbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,13 @@ const authStore = useAuthStore()
const emit = defineEmits(['close'])
function navigateTo(routeName) {
router.push({ name: routeName }).catch(err => {})
if ((routeName === 'suppression') || (routeName === "recouvrement") || (routeName === "exemplarisation") || (routeName === "modification")) {
let newRouteName = "/" + routeName + "/empty"
router.replace(newRouteName).catch(err => {});
router.currentRoute.value.fullPath = "/suppression/empty";
} else {
router.push({ name: routeName }).catch(err => {})
}
fixNavBarModel.value ? '' : emit('close')
}
Expand Down
28 changes: 26 additions & 2 deletions src/views/Exemplarisation/ExempSteps.vue
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@

<script setup>
import { onMounted, ref } from 'vue';
import { onMounted, ref, watch } from 'vue';
import itemService from '@/service/ItemService';
import router from '@/router';
import SelectFile from '@/components/SelectFile.vue';
Expand All @@ -138,8 +138,17 @@ const isLoading = ref(false);
const dialog = ref(false);
const suppDialog = ref(false);
watch(router.currentRoute, (newValue) => {
if (newValue.fullPath.includes("empty")) {
cleanPath()
raz();
currentStep.value = 1;
prev();
}
})
onMounted(() => {
if (props.id) {
if ((props.id !== 'empty') && (props.id != null)) {
itemService.getDemande(props.id, 'EXEMP')
.then(response => {
demande.value = response.data;
Expand Down Expand Up @@ -169,9 +178,18 @@ onMounted(() => {
.catch(() => {
router.replace('/exemplarisation');
});
} else {
cleanPath();
}
});
function cleanPath() {
if (router.currentRoute.value.fullPath.includes("empty")) {
router.replace('/exemplarisation');
router.currentRoute.value.fullPath = "/exemplarisation";
}
}
function createDemande() {
if (demande.value && (rcrSelected.value === demande.value.rcr)) {
next();
Expand Down Expand Up @@ -270,6 +288,12 @@ function prev() {
changeEtat();
}
function raz() {
isLoading.value = false;
alertMessage.value = '';
alertType.value = 'success';
}
function changeEtat() {
if ((currentStep.value + 1) === 1) {
itemService.choixEtape(demande.value.id, 2, 'EXEMP')
Expand Down
19 changes: 18 additions & 1 deletion src/views/Modification/ModifSteps.vue
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
</template>

<script setup>
import { onMounted, ref } from 'vue';
import { onMounted, ref, watch } from 'vue';
import router from '@/router';
import itemService from '@/service/ItemService';
import Rcr from '@/components/Rcr.vue';
Expand Down Expand Up @@ -188,6 +188,14 @@ const typeTraitementSelected = ref();
const emits = defineEmits(['backendError']);
const props = defineProps({ id: { type: String } });
watch(router.currentRoute, (newValue) => {
if (newValue.fullPath.includes("empty")) {
cleanPath()
currentStep.value = 1;
prev();
}
})
onMounted(() => {
if (props.id) {
itemService.getDemande(props.id, 'MODIF')
Expand Down Expand Up @@ -227,9 +235,18 @@ onMounted(() => {
.catch(() => {
router.replace('/modification');
});
} else {
cleanPath();
}
});
function cleanPath() {
if (router.currentRoute.value.fullPath.includes("empty")) {
router.replace('/modification');
router.currentRoute.value.fullPath = "/modification";
}
}
function createDemande() {
if (demande.value && (rcrSelected.value === demande.value.rcr)) {
next();
Expand Down
28 changes: 25 additions & 3 deletions src/views/Recouvrement/RecouvSteps.vue
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
<script setup>
import Rcr from '@/components/Rcr.vue';
import SelectFile from '@/components/SelectFile.vue';
import { onMounted, ref } from 'vue';
import {onMounted, ref, watch} from 'vue'
import itemService from '@/service/ItemService';
import router from '@/router';
import DialogSuppression from '@/components/Dialog/DialogSuppression.vue';
Expand All @@ -99,10 +99,17 @@ const isLoading = ref(false);
const dialog = ref(false);
const suppDialog = ref(false);
watch(router.currentRoute, (newValue) => {
if (newValue.fullPath.includes("empty")) {
cleanPath()
raz();
currentStep.value = 1;
prev();
}
})
onMounted(() => {
if(props.id){
if((props.id !== 'empty') && (props.id != null)){
itemService.getDemande(props.id, "RECOUV")
.then(response => {
demande.value = response.data;
Expand All @@ -113,9 +120,18 @@ onMounted(() => {
}).catch(() => {
router.replace("/recouvrement");
})
} else {
cleanPath();
}
})
function cleanPath() {
if (router.currentRoute.value.fullPath.includes("empty")) {
router.replace('/recouvrement');
router.currentRoute.value.fullPath = "/recouvrement";
}
}
function createDemande() {
if (demande.value && (rcrSelected.value === demande.value.rcr)) {
next();
Expand Down Expand Up @@ -168,4 +184,10 @@ function next() {
function prev() {
currentStep.value--;
}
function raz() {
isLoading.value = false;
alertMessage.value = '';
alertType.value = 'success';
}
</script>
21 changes: 19 additions & 2 deletions src/views/Suppression/SuppSteps.vue
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@
</template>

<script setup>
import { onMounted, ref } from 'vue';
import { onMounted, ref, watch } from 'vue';
import TypeFile from '@/components/Supp/TypeFile.vue';
import SelectFile from '@/components/SelectFile.vue';
import itemService from '@/service/ItemService';
Expand Down Expand Up @@ -192,8 +192,16 @@ const alertType = ref('success');
const dialog = ref(false);
const suppDialog = ref(false);
watch(router.currentRoute, (newValue) => {
if (newValue.fullPath.includes("empty")) {
cleanPath()
currentStep.value = 1;
prev();
}
})
onMounted(() => {
if (props.id) {
if ((props.id !== 'empty') && (props.id != null)) {
itemService.getDemande(props.id, 'SUPP')
.then(response => {
demande.value = response.data;
Expand Down Expand Up @@ -228,9 +236,18 @@ onMounted(() => {
.catch(() => {
router.replace('/suppression');
});
} else {
cleanPath();
}
});
function cleanPath() {
if (router.currentRoute.value.fullPath.includes("empty")) {
router.replace('/suppression');
router.currentRoute.value.fullPath = "/suppression";
}
}
function createDemande() {
if (demande.value && (rcrSelected.value === demande.value.rcr)) {
next();
Expand Down

0 comments on commit 9edd645

Please sign in to comment.