Merged in feature/PMCORE-3871 (pull request #8485)

PMCORE-3871

Approved-by: Rodrigo Quelca
Approved-by: Paula Quispe
Approved-by: Julio Cesar Laura Avendaño
This commit is contained in:
Henry Jonathan Quispe Quispe
2022-07-05 20:20:01 +00:00
committed by Julio Cesar Laura Avendaño
4 changed files with 36 additions and 3 deletions

View File

@@ -80,6 +80,7 @@
ref="modal-comments"
@postNotes="onPostNotes"
></ModalComments>
<ModalClaimCase ref="modal-claim-case" @claimCatch="claimCatch"></ModalClaimCase>
</div>
</template>
@@ -87,6 +88,7 @@
import HeaderCounter from "../../components/home/HeaderCounter.vue";
import ButtonFleft from "../../components/home/ButtonFleft.vue";
import ModalNewRequest from "../ModalNewRequest.vue";
import ModalClaimCase from "../modal/ModalClaimCase.vue";
import MyCasesFilter from "../../components/search/MyCasesFilter";
import ModalComments from "../modal/ModalComments.vue";
import GroupedCell from "../../components/vuetable/GroupedCell.vue";
@@ -106,6 +108,7 @@ export default {
ModalNewRequest,
GroupedCell,
ModalComments,
ModalClaimCase,
ThreadTitleCell,
},
props: ["defaultOption", "settings"],
@@ -293,6 +296,11 @@ export default {
refresh: false,
});
this.$emit("cleanDefaultOption");
api.cases.pendingtask({APP_NUMBER:params.openapplicationuid}).then((response) => {
if (response.data && response.data[0] && response.data[0]['USR_ID'] == 0) {
this.claimCase(response.data[0]);
}
});
}
}
},
@@ -758,6 +766,26 @@ export default {
id: this.id
});
}
},
/**
* Claim case
*
* @param {object} item
*/
claimCase(item) {
let that = this;
api.cases.open(_.extend({ ACTION: "unassigned" }, item)).then(() => {
api.cases.cases_open(_.extend({ ACTION: "todo" }, item)).then(() => {
that.$refs["modal-claim-case"].data = item;
that.$refs["modal-claim-case"].show();
});
});
},
/**
* Claim catch error handler message
*/
claimCatch(message) {
this.showAlert(message, "danger");
}
},
};

View File

@@ -411,7 +411,7 @@ export default {
},
mounted() {
let that = this;
// force to open case
// force to open case paused
this.openDefaultCase();
Event.$on('vue-tables.paused.sorted', function (data) {
that.$emit("updateSettings", {
@@ -475,7 +475,7 @@ export default {
if(this.defaultOption) {
params = utils.getAllUrlParams(this.defaultOption);
if (params && params.app_uid && params.del_index) {
this.openCase({
this.showModalUnpauseCase({
APP_UID: params.app_uid,
DEL_INDEX: params.del_index
});

View File

@@ -458,6 +458,11 @@ export default {
refresh: true
};
this.$emit("cleanDefaultOption");
api.cases.pendingtask({APP_NUMBER:params.openapplicationuid}).then((response) => {
if (response.data && response.data.length == 1 && response.data[0] && response.data[0]['USR_ID'] == 0) {
this.claimCase(response.data[0]);
}
});
this.onUpdateFilters(filter);
}
}

View File

@@ -2551,7 +2551,7 @@ class Cases
// Filter specific case
$query->case($caseNumber);
// Filter specific index
if (is_int($index)) {
if ($index > 0) {
$query->index($index);
}
$results = $query->get();