PMCORE-4006

This commit is contained in:
Luciana Nuñez
2022-11-03 15:04:29 -04:00
parent 305ce67bbc
commit 920c610e25
8 changed files with 435 additions and 23 deletions

View File

@@ -7,7 +7,7 @@
>
<template v-slot:modal-title>
{{ $t('ID_REASSIGN_CASE') }}
<i class="fas fa-undo"></i>
<i :class="icon"></i>
</template>
<b-alert
:show="dataAlert.dismissCountDown"
@@ -78,7 +78,7 @@ import api from "./../../api/index";
import utils from "../../utils/utils";
export default {
name: "ModalPauseCase",
name: "ModalReassignCase",
components: {},
props: {},
mounted() {},
@@ -95,7 +95,8 @@ export default {
users: [],
reasonReassign: null,
userSelected: null,
notifyUser: false
notifyUser: false,
icon: "fas fa-undo"
};
},
methods: {
@@ -106,8 +107,12 @@ export default {
* Show modal
*/
show() {
this.users = [];
this.getUsersReassign();
this.$refs["modal-reassign-case"].show();
if (this.data.FLAG){
this.icon = "fas fa-exchange-alt";
}
},
/**
* Button cancel
@@ -120,7 +125,7 @@ export default {
*/
getUsersReassign() {
let that = this;
api.cases.getUserReassign(this.data).then((response) => {
api.cases.getUserToReassign(this.data).then((response) => {
var users = response.data.data,
i;
if (response.statusText == "OK" || response.status === 200) {
@@ -146,25 +151,47 @@ export default {
this.data.userSelected = this.userSelected;
this.data.reasonReassign = this.reasonReassign;
this.notifyUser = this.notifyUser;
api.cases.reassingCase(this.data).then((response) => {
if (response.statusText == "OK" || response.status === 200) {
that.$refs["modal-reassign-case"].hide();
if (that.$parent.$refs["vueTable"] !== undefined) {
that.$parent.$refs["vueTable"].getData();
if (!this.data.FLAG){
api.cases.reassingCase(this.data).then((response) => {
if (response.statusText == "OK" || response.status === 200) {
that.$refs["modal-reassign-case"].hide();
if (that.$parent.$refs["vueTable"] !== undefined) {
that.$parent.$refs["vueTable"].getData();
}
if (that.$parent.$refs["vueListView"] !== undefined) {
that.$parent.$refs["vueListView"].getData();
}
if (that.$parent.$refs["vueCardView"] !== undefined) {
that.$parent.$refs["vueCardView"].getData();
}
}
if (that.$parent.$refs["vueListView"] !== undefined) {
that.$parent.$refs["vueListView"].getData();
})
.catch((e) => {
if(e.response.data && e.response.data.error){
that.showAlert(e.response.data.error.message, "danger");
}
if (that.$parent.$refs["vueCardView"] !== undefined) {
that.$parent.$refs["vueCardView"].getData();
});
} else {
api.cases.reassingCaseSupervisor(this.data).then((response) => {
if (response.statusText == "OK" || response.status === 200) {
that.$refs["modal-reassign-case"].hide();
if (that.$parent.$refs["vueTable"] !== undefined) {
that.$parent.$refs["vueTable"].getData();
}
if (that.$parent.$refs["vueListView"] !== undefined) {
that.$parent.$refs["vueListView"].getData();
}
if (that.$parent.$refs["vueCardView"] !== undefined) {
that.$parent.$refs["vueCardView"].getData();
}
}
}
})
.catch((e) => {
if(e.response.data && e.response.data.error){
that.showAlert(e.response.data.error.message, "danger");
}
});
})
.catch((e) => {
if(e.response.data && e.response.data.error){
that.showAlert(e.response.data.error.message, "danger");
}
});
}
},
/**
* Show the alert message