2020-12-07 14:33:27 -04:00
|
|
|
<template>
|
2020-12-07 22:51:54 +00:00
|
|
|
<div id="case-detail" ref="case-detail" class="v-container-case-detail">
|
2020-12-07 18:52:12 +00:00
|
|
|
<div>
|
2020-12-16 18:26:40 +00:00
|
|
|
<b-alert
|
|
|
|
|
:show="dataAlert.dismissCountDown"
|
|
|
|
|
dismissible
|
|
|
|
|
:variant="dataAlert.variant"
|
|
|
|
|
@dismissed="dataAlert.dismissCountDown = 0"
|
|
|
|
|
@dismiss-count-down="countDownChanged"
|
|
|
|
|
>
|
|
|
|
|
{{ dataAlert.message }}
|
|
|
|
|
</b-alert>
|
2020-12-11 19:36:41 +00:00
|
|
|
<p class="">
|
|
|
|
|
<b-icon icon="arrow-left"></b-icon>
|
|
|
|
|
<button type="button" class="btn btn-link" @click="$emit('onLastPage')">
|
|
|
|
|
{{ $t("ID_BACK") }}
|
|
|
|
|
</button>
|
|
|
|
|
<button-fleft :data="newCase"></button-fleft>
|
2020-12-07 18:52:12 +00:00
|
|
|
</p>
|
2020-12-11 19:36:41 +00:00
|
|
|
<modal-new-request ref="newRequest"></modal-new-request>
|
2020-12-07 18:52:12 +00:00
|
|
|
</div>
|
|
|
|
|
<div class="row">
|
2020-12-09 16:22:30 +00:00
|
|
|
<div class="col-sm-9">
|
2020-12-07 18:52:12 +00:00
|
|
|
<div id="pending-task" ref="pending-task">
|
|
|
|
|
<v-server-table
|
|
|
|
|
:data="tableData"
|
|
|
|
|
:columns="columns"
|
|
|
|
|
:options="options"
|
2020-12-14 16:19:44 -04:00
|
|
|
v-show="showTable"
|
2020-12-07 18:52:12 +00:00
|
|
|
ref="vueTable"
|
|
|
|
|
>
|
|
|
|
|
<div slot="task" slot-scope="props">
|
2020-12-14 16:19:44 -04:00
|
|
|
<TaskCell :data="props.row.TASK" />
|
2020-12-07 18:52:12 +00:00
|
|
|
</div>
|
2021-08-30 21:16:27 -04:00
|
|
|
<div slot="thread_title" slot-scope="props">
|
|
|
|
|
{{ props.row.THREAD_TITLE }}
|
2020-12-07 18:52:12 +00:00
|
|
|
</div>
|
2021-08-04 11:53:47 -04:00
|
|
|
<div slot="current_user" slot-scope="props">
|
|
|
|
|
<CurrentUserCell :data="props.row.USER_DATA" />
|
2020-12-07 18:52:12 +00:00
|
|
|
</div>
|
|
|
|
|
<div slot="status" slot-scope="props">
|
|
|
|
|
{{ props.row.STATUS }}
|
2020-12-07 14:33:27 -04:00
|
|
|
</div>
|
2020-12-07 18:52:12 +00:00
|
|
|
<div slot="due_date" slot-scope="props">
|
|
|
|
|
{{ props.row.DUE_DATE }}
|
2020-12-07 14:33:27 -04:00
|
|
|
</div>
|
2020-12-18 18:28:10 +00:00
|
|
|
<div slot="actions" slot-scope="props">
|
2021-03-19 15:15:16 -04:00
|
|
|
<b-button
|
|
|
|
|
v-if="props.row.STATUS === 'OPEN'"
|
|
|
|
|
@click="onClick(props)"
|
2021-08-23 15:49:14 +00:00
|
|
|
variant="outline-success"
|
2021-03-19 15:15:16 -04:00
|
|
|
>{{ $t("ID_CONTINUE") }}</b-button
|
|
|
|
|
>
|
2021-08-23 15:49:14 +00:00
|
|
|
<b-button
|
2021-08-24 13:54:06 +00:00
|
|
|
v-if="props.row.STATUS === 'PAUSED'"
|
2021-08-23 15:49:14 +00:00
|
|
|
@click="onClickUnpause(props)"
|
|
|
|
|
variant="outline-primary"
|
2021-08-24 13:54:06 +00:00
|
|
|
>{{ $t("ID_UNPAUSE") }}</b-button
|
2021-08-23 15:49:14 +00:00
|
|
|
>
|
2020-12-07 18:52:12 +00:00
|
|
|
</div>
|
|
|
|
|
</v-server-table>
|
|
|
|
|
</div>
|
2020-12-09 16:22:30 +00:00
|
|
|
<TabsCaseDetail
|
2021-03-19 15:15:16 -04:00
|
|
|
:dataCaseStatus="dataCaseStatusTab"
|
2020-12-09 16:22:30 +00:00
|
|
|
:dataCase="dataCase"
|
|
|
|
|
></TabsCaseDetail>
|
2021-05-13 14:45:40 +00:00
|
|
|
<ModalCancelCase ref="modal-cancel-case" :dataCase="dataCase"></ModalCancelCase>
|
2020-12-07 18:52:12 +00:00
|
|
|
</div>
|
2020-12-09 16:22:30 +00:00
|
|
|
<div class="col-sm-3">
|
2020-12-07 22:51:54 +00:00
|
|
|
<case-summary
|
|
|
|
|
v-if="dataCaseSummary"
|
|
|
|
|
:data="dataCaseSummary"
|
|
|
|
|
></case-summary>
|
|
|
|
|
<io-documents
|
|
|
|
|
v-if="
|
|
|
|
|
dataIoDocuments.inputDocuments.length > 0 ||
|
|
|
|
|
dataIoDocuments.outputDocuments.length > 0
|
|
|
|
|
"
|
|
|
|
|
:data="dataIoDocuments"
|
|
|
|
|
></io-documents>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="row">
|
2020-12-09 16:22:30 +00:00
|
|
|
<div class="col-sm-9">
|
2020-12-08 13:43:33 +00:00
|
|
|
<case-comments
|
2020-12-15 23:56:44 +00:00
|
|
|
ref="case-comments"
|
2020-12-08 13:43:33 +00:00
|
|
|
:data="dataComments"
|
|
|
|
|
:onClick="onClickComment"
|
|
|
|
|
:postComment="postComment"
|
2020-12-15 23:56:44 +00:00
|
|
|
:dropFiles="dropFiles"
|
2020-12-08 13:43:33 +00:00
|
|
|
/>
|
2020-12-07 22:51:54 +00:00
|
|
|
</div>
|
2020-12-09 16:22:30 +00:00
|
|
|
<div class="col-sm-3">
|
2020-12-11 19:36:41 +00:00
|
|
|
<attached-documents
|
2020-12-15 23:56:44 +00:00
|
|
|
v-if="dataAttachedDocuments.items.length > 0 && !attachDocuments"
|
2020-12-11 19:36:41 +00:00
|
|
|
:data="dataAttachedDocuments"
|
|
|
|
|
></attached-documents>
|
2020-12-15 23:56:44 +00:00
|
|
|
<attached-documents-edit
|
|
|
|
|
v-if="dataAttachedDocuments.items.length > 0 && attachDocuments"
|
|
|
|
|
:data="dataAttachedDocuments"
|
|
|
|
|
:onRemove="onRemoveAttachedDocument"
|
|
|
|
|
></attached-documents-edit>
|
2020-12-07 18:52:12 +00:00
|
|
|
</div>
|
2020-12-07 14:33:27 -04:00
|
|
|
</div>
|
2021-03-10 16:34:22 +00:00
|
|
|
<ModalClaimCase ref="modal-claim-case"></ModalClaimCase>
|
2020-12-07 18:52:12 +00:00
|
|
|
</div>
|
2020-12-07 14:33:27 -04:00
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
2020-12-07 18:52:12 +00:00
|
|
|
import IoDocuments from "../components/home/caseDetail/IoDocuments.vue";
|
|
|
|
|
import CaseSummary from "../components/home/caseDetail/CaseSummary.vue";
|
|
|
|
|
import AttachedDocuments from "../components/home/caseDetail/AttachedDocuments.vue";
|
2020-12-15 23:56:44 +00:00
|
|
|
import AttachedDocumentsEdit from "../components/home/caseDetail/AttachedDocumentsEdit.vue";
|
2020-12-07 22:51:54 +00:00
|
|
|
import CaseComment from "../components/home/caseDetail/CaseComment";
|
|
|
|
|
import CaseComments from "../components/home/caseDetail/CaseComments";
|
2020-12-08 19:12:30 +00:00
|
|
|
import TabsCaseDetail from "../home/TabsCaseDetail.vue";
|
2020-12-11 19:36:41 +00:00
|
|
|
import ButtonFleft from "../components/home/ButtonFleft.vue";
|
2020-12-10 15:19:14 +00:00
|
|
|
import ModalCancelCase from "../home/modal/ModalCancelCase.vue";
|
2020-12-11 19:36:41 +00:00
|
|
|
import ModalNewRequest from "./ModalNewRequest.vue";
|
2021-03-10 16:34:22 +00:00
|
|
|
import ModalClaimCase from "./modal/ModalClaimCase.vue";
|
2020-12-14 16:19:44 -04:00
|
|
|
import TaskCell from "../components/vuetable/TaskCell.vue";
|
2021-08-04 11:53:47 -04:00
|
|
|
import CurrentUserCell from "../components/vuetable/CurrentUserCell.vue"
|
2021-01-20 17:01:02 -04:00
|
|
|
import utils from "./../utils/utils";
|
2020-12-07 22:51:54 +00:00
|
|
|
import Api from "../api/index";
|
2021-01-20 17:01:02 -04:00
|
|
|
|
2020-12-07 14:33:27 -04:00
|
|
|
export default {
|
2020-12-07 18:52:12 +00:00
|
|
|
name: "CaseDetail",
|
|
|
|
|
components: {
|
2020-12-08 19:12:30 +00:00
|
|
|
TabsCaseDetail,
|
2020-12-07 18:52:12 +00:00
|
|
|
IoDocuments,
|
|
|
|
|
CaseSummary,
|
|
|
|
|
AttachedDocuments,
|
2020-12-15 23:56:44 +00:00
|
|
|
AttachedDocumentsEdit,
|
2020-12-07 22:51:54 +00:00
|
|
|
CaseComment,
|
|
|
|
|
CaseComments,
|
2020-12-10 15:19:14 +00:00
|
|
|
ModalCancelCase,
|
2020-12-11 19:36:41 +00:00
|
|
|
ButtonFleft,
|
|
|
|
|
ModalNewRequest,
|
2021-03-10 16:34:22 +00:00
|
|
|
ModalClaimCase,
|
2021-08-04 11:53:47 -04:00
|
|
|
TaskCell,
|
|
|
|
|
CurrentUserCell
|
2020-12-07 18:52:12 +00:00
|
|
|
},
|
|
|
|
|
props: {},
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
2020-12-16 18:26:40 +00:00
|
|
|
dataAlert: {
|
|
|
|
|
dismissSecs: 5,
|
|
|
|
|
dismissCountDown: 0,
|
|
|
|
|
message: "",
|
2021-03-31 14:33:21 +00:00
|
|
|
variant: "info"
|
2020-12-16 18:26:40 +00:00
|
|
|
},
|
2020-12-07 22:51:54 +00:00
|
|
|
dataCase: null,
|
2020-12-11 19:36:41 +00:00
|
|
|
newCase: {
|
|
|
|
|
title: this.$i18n.t("ID_NEW_CASE"),
|
|
|
|
|
class: "btn-success",
|
|
|
|
|
onClick: () => {
|
|
|
|
|
this.$refs["newRequest"].show();
|
|
|
|
|
},
|
|
|
|
|
},
|
2020-12-07 18:52:12 +00:00
|
|
|
columns: [
|
|
|
|
|
"task",
|
2021-08-30 21:16:27 -04:00
|
|
|
"thread_title",
|
2021-08-04 11:53:47 -04:00
|
|
|
"current_user",
|
2020-12-07 18:52:12 +00:00
|
|
|
"status",
|
|
|
|
|
"due_date",
|
2021-03-31 14:33:21 +00:00
|
|
|
"actions"
|
2020-12-07 18:52:12 +00:00
|
|
|
],
|
2020-12-14 16:19:44 -04:00
|
|
|
showTable: true,
|
|
|
|
|
tableData: [],
|
2020-12-07 18:52:12 +00:00
|
|
|
options: {
|
|
|
|
|
headings: {
|
|
|
|
|
task: this.$i18n.t("ID_TASK"),
|
2021-08-30 21:16:27 -04:00
|
|
|
thread_title: this.$i18n.t('ID_CASE_THREAD_TITLE'),
|
2021-08-04 11:53:47 -04:00
|
|
|
current_user: this.$i18n.t("ID_CURRENT_USER"),
|
2020-12-07 18:52:12 +00:00
|
|
|
status: this.$i18n.t("ID_STATUS"),
|
|
|
|
|
due_date: this.$i18n.t("ID_DUE_DATE"),
|
2021-03-31 14:33:21 +00:00
|
|
|
actions: this.$i18n.t("ID_ACTIONS")
|
2020-12-07 14:33:27 -04:00
|
|
|
},
|
2021-06-02 14:47:56 +00:00
|
|
|
texts: {
|
|
|
|
|
count:this.$i18n.t("ID_SHOWING_FROM_RECORDS_COUNT"),
|
|
|
|
|
first: this.$i18n.t("ID_FIRST"),
|
|
|
|
|
last: this.$i18n.t("ID_LAST"),
|
|
|
|
|
filter: this.$i18n.t("ID_FILTER") + ":",
|
|
|
|
|
limit: this.$i18n.t("ID_RECORDS") + ":",
|
|
|
|
|
page: this.$i18n.t("ID_PAGE") + ":",
|
|
|
|
|
noResults: this.$i18n.t("ID_NO_MATCHING_RECORDS")
|
|
|
|
|
},
|
2020-12-07 18:52:12 +00:00
|
|
|
selectable: {
|
|
|
|
|
mode: "single", // or 'multiple'
|
|
|
|
|
only: function (row) {
|
|
|
|
|
return true; // any condition
|
|
|
|
|
},
|
|
|
|
|
selectAllMode: "all", // or 'page',
|
|
|
|
|
programmatic: false,
|
2020-12-07 14:33:27 -04:00
|
|
|
},
|
2020-12-07 18:52:12 +00:00
|
|
|
filterable: false,
|
2021-08-31 12:37:12 +00:00
|
|
|
sortable: [],
|
2020-12-14 16:19:44 -04:00
|
|
|
requestFunction() {
|
|
|
|
|
return this.$parent.$parent.getCasesForVueTable();
|
|
|
|
|
},
|
2020-12-07 18:52:12 +00:00
|
|
|
},
|
2020-12-07 22:51:54 +00:00
|
|
|
dataCaseSummary: null,
|
2021-03-19 15:15:16 -04:00
|
|
|
dataCaseStatusTab: null,
|
2020-12-07 18:52:12 +00:00
|
|
|
dataIoDocuments: {
|
2020-12-07 22:51:54 +00:00
|
|
|
titleInput: this.$i18n.t("ID_REQUEST_DOCUMENTS"),
|
|
|
|
|
titleOutput: this.$i18n.t("ID_OUTPUT_DOCUMENTS"),
|
|
|
|
|
inputDocuments: [],
|
2021-03-31 14:33:21 +00:00
|
|
|
outputDocuments: []
|
2020-12-07 18:52:12 +00:00
|
|
|
},
|
|
|
|
|
dataAttachedDocuments: {
|
|
|
|
|
title: "Attached Documents",
|
2021-03-31 14:33:21 +00:00
|
|
|
items: []
|
2020-12-07 18:52:12 +00:00
|
|
|
},
|
2020-12-15 23:56:44 +00:00
|
|
|
attachDocuments: false,
|
2020-12-07 22:51:54 +00:00
|
|
|
dataComments: {
|
|
|
|
|
title: "Comments",
|
2021-03-31 14:33:21 +00:00
|
|
|
items: []
|
|
|
|
|
}
|
2020-12-07 18:52:12 +00:00
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
mounted() {
|
|
|
|
|
let that = this;
|
2020-12-07 22:51:54 +00:00
|
|
|
this.dataCase = this.$parent.dataCase;
|
2020-12-07 18:52:12 +00:00
|
|
|
this.$el.getElementsByClassName("VuePagination__count")[0].remove();
|
|
|
|
|
this.getDataCaseSummary();
|
2020-12-07 22:51:54 +00:00
|
|
|
this.getInputDocuments();
|
|
|
|
|
this.getOutputDocuments();
|
|
|
|
|
this.getCasesNotes();
|
2021-01-19 19:32:26 -04:00
|
|
|
this.requestOpenSummary();
|
2020-12-07 18:52:12 +00:00
|
|
|
},
|
|
|
|
|
methods: {
|
2020-12-15 23:56:44 +00:00
|
|
|
postComment(comment, send, files) {
|
2020-12-08 13:43:33 +00:00
|
|
|
let that = this;
|
|
|
|
|
Api.caseNotes
|
|
|
|
|
.post(
|
|
|
|
|
_.extend({}, this.dataCase, {
|
|
|
|
|
COMMENT: comment,
|
|
|
|
|
SEND_MAIL: send,
|
2021-03-31 14:33:21 +00:00
|
|
|
FILES: files
|
2020-12-08 13:43:33 +00:00
|
|
|
})
|
|
|
|
|
)
|
|
|
|
|
.then((response) => {
|
2021-06-01 19:58:39 +00:00
|
|
|
if (response.status === 200 ) {
|
2020-12-15 23:56:44 +00:00
|
|
|
that.attachDocuments = false;
|
2020-12-16 18:26:40 +00:00
|
|
|
that.dataAttachedDocuments.items = [];
|
2020-12-08 13:43:33 +00:00
|
|
|
that.getCasesNotes();
|
2020-12-16 18:26:40 +00:00
|
|
|
} else {
|
|
|
|
|
that.showAlert(response.data.message, "danger");
|
|
|
|
|
that.dataAttachedDocuments.items = [];
|
2020-12-08 13:43:33 +00:00
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
2020-12-07 22:51:54 +00:00
|
|
|
onClickComment(data) {
|
|
|
|
|
let att = [];
|
|
|
|
|
this.dataAttachedDocuments.items = [];
|
|
|
|
|
_.each(data.data.attachments, (a) => {
|
|
|
|
|
att.push({
|
|
|
|
|
data: a,
|
|
|
|
|
title: a.APP_DOC_FILENAME,
|
|
|
|
|
extension: a.APP_DOC_FILENAME.split(".").pop(),
|
|
|
|
|
onClick: () => {},
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
this.dataAttachedDocuments.items = att;
|
|
|
|
|
},
|
2020-12-07 18:52:12 +00:00
|
|
|
getDataCaseSummary() {
|
2021-01-13 19:25:01 +00:00
|
|
|
let action,
|
2021-03-19 15:15:16 -04:00
|
|
|
option,
|
|
|
|
|
that = this;
|
2020-12-07 22:51:54 +00:00
|
|
|
Api.cases
|
|
|
|
|
.casesummary(this.dataCase)
|
2020-12-07 18:52:12 +00:00
|
|
|
.then((response) => {
|
2021-03-19 15:15:16 -04:00
|
|
|
var data = response.data.summary;
|
|
|
|
|
this.dataCaseStatusTab = [];
|
|
|
|
|
this.dataCaseStatusTab.push({
|
|
|
|
|
title: null,
|
2021-03-31 14:33:21 +00:00
|
|
|
items: response.data.caseProperties
|
2021-03-19 15:15:16 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
_.each(response.data.taskProperties, (o) => {
|
|
|
|
|
this.dataCaseStatusTab.push({
|
|
|
|
|
title: null,
|
2021-03-31 14:33:21 +00:00
|
|
|
items: _.isArray(o) ? o : [o]
|
2021-03-19 15:15:16 -04:00
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
2020-12-07 18:52:12 +00:00
|
|
|
this.dataCaseSummary = {
|
2020-12-10 15:19:14 +00:00
|
|
|
title: this.$i18n.t("ID_SUMMARY"),
|
|
|
|
|
titleActions: this.$i18n.t("ID_ACTIONS"),
|
|
|
|
|
btnLabel: this.$i18n.t("ID_CANCEL_CASE"),
|
2020-12-07 18:52:12 +00:00
|
|
|
btnType: false,
|
2021-01-13 19:25:01 +00:00
|
|
|
onClick: null,
|
2020-12-07 18:52:12 +00:00
|
|
|
label: {
|
2021-03-19 15:15:16 -04:00
|
|
|
process: data[1].label,
|
|
|
|
|
processDescription: data[2].label,
|
|
|
|
|
caseNumber: data[3].label,
|
|
|
|
|
caseTitle: data[4].label,
|
|
|
|
|
status: data[5].label,
|
|
|
|
|
create: data[6].label,
|
|
|
|
|
delegationDate: this.$i18n.t("ID_TASK_DELEGATE_DATE"),
|
2021-03-31 14:33:21 +00:00
|
|
|
duration: this.$i18n.t("ID_DURATION")
|
2020-12-07 18:52:12 +00:00
|
|
|
},
|
|
|
|
|
text: {
|
2021-03-19 15:15:16 -04:00
|
|
|
process: data[1].value,
|
|
|
|
|
processDescription: data[2].value,
|
|
|
|
|
caseNumber: data[3].value,
|
|
|
|
|
caseTitle: data[4].value,
|
|
|
|
|
status: data[5].value,
|
|
|
|
|
create: data[6].value,
|
|
|
|
|
delegationDate: data[7] ? data[7].value : "",
|
2021-03-31 14:33:21 +00:00
|
|
|
duration: data[8] ? data[8].value : ""
|
|
|
|
|
}
|
2020-12-07 18:52:12 +00:00
|
|
|
};
|
2021-01-13 19:25:01 +00:00
|
|
|
// Hack for identify the cancel case button
|
2021-03-19 15:15:16 -04:00
|
|
|
Api.cases.actions(this.dataCase).then((response) => {
|
|
|
|
|
action = _.find(response.data, function (o) {
|
2021-03-31 14:33:21 +00:00
|
|
|
return o.id === "ACTIONS";
|
2021-01-13 19:25:01 +00:00
|
|
|
});
|
2021-03-19 15:15:16 -04:00
|
|
|
if (action) {
|
|
|
|
|
option = _.find(action.options, function (o) {
|
2021-03-31 14:33:21 +00:00
|
|
|
return o.fn === "cancelCase";
|
2021-03-19 15:15:16 -04:00
|
|
|
});
|
|
|
|
|
if (option && !option.hide) {
|
|
|
|
|
that.dataCaseSummary.onClick = () => {
|
|
|
|
|
that.$refs["modal-cancel-case"].show();
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
2020-12-07 18:52:12 +00:00
|
|
|
})
|
|
|
|
|
.catch((err) => {
|
|
|
|
|
throw new Error(err);
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
getInputDocuments() {
|
2020-12-07 22:51:54 +00:00
|
|
|
Api.cases
|
|
|
|
|
.inputdocuments(this.dataCase)
|
2020-12-07 18:52:12 +00:00
|
|
|
.then((response) => {
|
2020-12-07 22:51:54 +00:00
|
|
|
let data = response.data,
|
2020-12-07 18:52:12 +00:00
|
|
|
document = data.data,
|
|
|
|
|
i,
|
|
|
|
|
info;
|
|
|
|
|
|
|
|
|
|
if (data.totalCount > 0 && document !== []) {
|
|
|
|
|
this.dataIoDocuments.inputDocuments = [];
|
|
|
|
|
for (i = 0; i < data.totalCount; i += 1) {
|
|
|
|
|
info = {
|
|
|
|
|
title: document[i].TITLE,
|
|
|
|
|
extension: document[i].TITLE.split(".")[1],
|
2020-12-15 23:56:44 +00:00
|
|
|
onClick: () => {},
|
2021-03-31 14:33:21 +00:00
|
|
|
data: document[i]
|
2020-12-07 18:52:12 +00:00
|
|
|
};
|
|
|
|
|
this.dataIoDocuments.inputDocuments.push(info);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.catch((err) => {
|
|
|
|
|
throw new Error(err);
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
getOutputDocuments() {
|
2020-12-07 22:51:54 +00:00
|
|
|
Api.cases
|
|
|
|
|
.outputdocuments(this.dataCase)
|
2020-12-07 18:52:12 +00:00
|
|
|
.then((response) => {
|
|
|
|
|
var data = response.data,
|
|
|
|
|
document = data.data,
|
|
|
|
|
i,
|
|
|
|
|
info;
|
|
|
|
|
|
|
|
|
|
if (data.totalCount > 0 && document !== []) {
|
|
|
|
|
this.dataIoDocuments.outputDocuments = [];
|
|
|
|
|
for (i = 0; i < data.totalCount; i += 1) {
|
|
|
|
|
info = {
|
|
|
|
|
title: document[i].TITLE,
|
|
|
|
|
extension: document[i].TITLE.split(".")[1],
|
2020-12-15 23:56:44 +00:00
|
|
|
onClick: () => {},
|
2021-03-31 14:33:21 +00:00
|
|
|
data: document[i]
|
2020-12-07 18:52:12 +00:00
|
|
|
};
|
|
|
|
|
this.dataIoDocuments.outputDocuments.push(info);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.catch((err) => {
|
|
|
|
|
throw new Error(err);
|
|
|
|
|
});
|
|
|
|
|
},
|
2020-12-15 23:56:44 +00:00
|
|
|
dropFiles(files) {
|
|
|
|
|
this.attachDocuments = true;
|
|
|
|
|
this.dataAttachedDocuments.items = files;
|
|
|
|
|
},
|
|
|
|
|
onRemoveAttachedDocument(file) {
|
|
|
|
|
this.$refs["case-comments"].removeFile(file);
|
|
|
|
|
},
|
2020-12-07 22:51:54 +00:00
|
|
|
/**
|
|
|
|
|
* Get for user format name configured in Processmaker Environment Settings
|
|
|
|
|
*
|
|
|
|
|
* @param {string} name
|
|
|
|
|
* @param {string} lastName
|
|
|
|
|
* @param {string} userName
|
|
|
|
|
* @return {string} nameFormat
|
|
|
|
|
*/
|
|
|
|
|
nameFormatCases(name, lastName, userName) {
|
|
|
|
|
let nameFormat = "";
|
|
|
|
|
if (/^\s*$/.test(name) && /^\s*$/.test(lastName)) {
|
|
|
|
|
return nameFormat;
|
|
|
|
|
}
|
|
|
|
|
if (this.nameFormat === "@firstName @lastName") {
|
|
|
|
|
nameFormat = name + " " + lastName;
|
|
|
|
|
} else if (this.nameFormat === "@firstName @lastName (@userName)") {
|
|
|
|
|
nameFormat = name + " " + lastName + " (" + userName + ")";
|
|
|
|
|
} else if (this.nameFormat === "@userName") {
|
|
|
|
|
nameFormat = userName;
|
|
|
|
|
} else if (this.nameFormat === "@userName (@firstName @lastName)") {
|
|
|
|
|
nameFormat = userName + " (" + name + " " + lastName + ")";
|
|
|
|
|
} else if (this.nameFormat === "@lastName @firstName") {
|
|
|
|
|
nameFormat = lastName + " " + name;
|
|
|
|
|
} else if (this.nameFormat === "@lastName, @firstName") {
|
|
|
|
|
nameFormat = lastName + ", " + name;
|
|
|
|
|
} else if (this.nameFormat === "@lastName, @firstName (@userName)") {
|
|
|
|
|
nameFormat = lastName + ", " + name + " (" + userName + ")";
|
|
|
|
|
} else {
|
|
|
|
|
nameFormat = name + " " + lastName;
|
|
|
|
|
}
|
|
|
|
|
return nameFormat;
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
getCasesNotes() {
|
|
|
|
|
let that = this;
|
2021-06-01 18:59:33 +00:00
|
|
|
Api.caseNotes
|
|
|
|
|
.get(this.dataCase)
|
2020-12-07 22:51:54 +00:00
|
|
|
.then((response) => {
|
2021-06-01 19:58:39 +00:00
|
|
|
that.formatResponseCaseNotes(response.data.data);
|
2020-12-23 20:04:34 +00:00
|
|
|
that.dataComments.noPerms = response.data.noPerms || 0;
|
2020-12-07 22:51:54 +00:00
|
|
|
})
|
|
|
|
|
.catch((err) => {
|
2021-08-23 15:49:14 +00:00
|
|
|
if (err.response.data) {
|
|
|
|
|
that.showAlert(err.response.data.error.message, "danger");
|
|
|
|
|
}
|
2020-12-07 22:51:54 +00:00
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
formatResponseCaseNotes(notes) {
|
|
|
|
|
let that = this,
|
|
|
|
|
notesArray = [];
|
|
|
|
|
_.each(notes, (n) => {
|
2021-01-13 15:11:21 +00:00
|
|
|
n.id = _.random(1000000);
|
2020-12-07 22:51:54 +00:00
|
|
|
notesArray.push({
|
|
|
|
|
user: that.nameFormatCases(
|
2021-06-01 19:58:39 +00:00
|
|
|
n.usr_firstname,
|
|
|
|
|
n.usr_lastname,
|
|
|
|
|
n.usr_username
|
2020-12-07 22:51:54 +00:00
|
|
|
),
|
2021-06-01 19:58:39 +00:00
|
|
|
date: n.note_date,
|
|
|
|
|
comment: n.note_content,
|
2021-03-31 14:33:21 +00:00
|
|
|
data: n
|
2020-12-07 22:51:54 +00:00
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
this.dataComments.items = notesArray;
|
|
|
|
|
},
|
2021-03-19 15:15:16 -04:00
|
|
|
formatCaseProperties(data) {
|
2020-12-08 19:12:30 +00:00
|
|
|
let index,
|
|
|
|
|
sections = [];
|
2021-03-19 15:15:16 -04:00
|
|
|
this.dataCaseStatusTab = [];
|
2020-12-08 19:12:30 +00:00
|
|
|
_.each(data, (o) => {
|
|
|
|
|
if (
|
|
|
|
|
(index = _.findIndex(sections, (s) => {
|
|
|
|
|
return s.title == o.section;
|
|
|
|
|
})) == -1
|
|
|
|
|
) {
|
|
|
|
|
sections.push({
|
|
|
|
|
title: o.section,
|
2021-03-31 14:33:21 +00:00
|
|
|
items: []
|
2020-12-08 19:12:30 +00:00
|
|
|
});
|
|
|
|
|
index = 0;
|
|
|
|
|
}
|
|
|
|
|
sections[index].items.push(o);
|
|
|
|
|
});
|
|
|
|
|
|
2021-03-19 15:15:16 -04:00
|
|
|
this.dataCaseStatusTab = sections;
|
2020-12-08 19:12:30 +00:00
|
|
|
},
|
2020-12-14 16:19:44 -04:00
|
|
|
getCasesForVueTable() {
|
|
|
|
|
let that = this,
|
|
|
|
|
dt;
|
|
|
|
|
return new Promise((resolutionFunc, rejectionFunc) => {
|
|
|
|
|
Api.cases
|
2020-12-15 23:56:44 +00:00
|
|
|
.pendingtask(that.$parent.dataCase)
|
|
|
|
|
.then((response) => {
|
|
|
|
|
dt = that.formatDataResponse(response.data);
|
|
|
|
|
resolutionFunc({
|
|
|
|
|
data: dt,
|
|
|
|
|
count: response.data.length,
|
|
|
|
|
});
|
|
|
|
|
that.showTable = response.data.length > 0 ? true : false;
|
|
|
|
|
})
|
|
|
|
|
.catch((err) => {
|
|
|
|
|
throw new Error(err);
|
2020-12-14 16:19:44 -04:00
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
formatDataResponse(response) {
|
|
|
|
|
let data = [];
|
|
|
|
|
_.forEach(response, (v) => {
|
|
|
|
|
data.push({
|
2021-03-19 15:15:16 -04:00
|
|
|
TASK: [
|
|
|
|
|
{
|
|
|
|
|
TITLE: v.TAS_TITLE,
|
|
|
|
|
CODE_COLOR: v.TAS_COLOR,
|
2021-03-31 14:33:21 +00:00
|
|
|
COLOR: v.TAS_COLOR_LABEL
|
2021-03-19 15:15:16 -04:00
|
|
|
},
|
|
|
|
|
],
|
2021-08-30 21:16:27 -04:00
|
|
|
THREAD_TITLE: v.DEL_TITLE,
|
2021-08-04 11:53:47 -04:00
|
|
|
USER_DATA: this.formatUser(v.user_tooltip),
|
2020-12-14 16:19:44 -04:00
|
|
|
STATUS: v.DEL_THREAD_STATUS,
|
|
|
|
|
DUE_DATE: v.DEL_TASK_DUE_DATE,
|
2020-12-15 23:56:44 +00:00
|
|
|
TASK_COLOR: v.TAS_COLOR_LABEL,
|
2020-12-18 18:28:10 +00:00
|
|
|
APP_UID: v.APP_UID,
|
|
|
|
|
DEL_INDEX: v.DEL_INDEX,
|
2021-03-19 15:15:16 -04:00
|
|
|
PRO_UID: v.PRO_UID,
|
2021-03-31 14:33:21 +00:00
|
|
|
TAS_UID: v.TAS_UID
|
2020-12-15 23:56:44 +00:00
|
|
|
});
|
2020-12-14 16:19:44 -04:00
|
|
|
});
|
|
|
|
|
return data;
|
2020-12-15 23:56:44 +00:00
|
|
|
},
|
2021-08-04 11:53:47 -04:00
|
|
|
/**
|
|
|
|
|
* Format user information to show
|
|
|
|
|
*/
|
|
|
|
|
formatUser(data) {
|
|
|
|
|
var dataFormat = [],
|
|
|
|
|
userDataFormat;
|
|
|
|
|
userDataFormat = data.usr_id ?
|
|
|
|
|
utils.userNameDisplayFormat({
|
|
|
|
|
userName: data.usr_firstname,
|
|
|
|
|
firstName: data.usr_lastname,
|
|
|
|
|
lastName: data.usr_username,
|
|
|
|
|
format: window.config.FORMATS.format || null
|
|
|
|
|
})
|
|
|
|
|
: this.$i18n.t("ID_UNASSIGNED");
|
|
|
|
|
dataFormat.push({
|
|
|
|
|
USERNAME_DISPLAY_FORMAT: userDataFormat !== "" ? userDataFormat : this.$i18n.t("ID_UNASSIGNED"),
|
|
|
|
|
EMAIL: data.usr_email,
|
|
|
|
|
POSITION: data.usr_position,
|
|
|
|
|
AVATAR: userDataFormat !== this.$i18n.t("ID_UNASSIGNED") ? window.config.SYS_SERVER_AJAX +
|
|
|
|
|
window.config.SYS_URI +
|
|
|
|
|
`users/users_ViewPhotoGrid?pUID=${data.usr_id}` : "",
|
|
|
|
|
UNASSIGNED: userDataFormat !== this.$i18n.t("ID_UNASSIGNED") ? true : false
|
|
|
|
|
});
|
|
|
|
|
return dataFormat;
|
|
|
|
|
},
|
2020-12-16 18:26:40 +00:00
|
|
|
/**
|
|
|
|
|
* Show the alert message
|
|
|
|
|
* @param {string} message - message to be displayen in the body
|
|
|
|
|
* @param {string} type - alert type
|
|
|
|
|
*/
|
|
|
|
|
showAlert(message, type) {
|
|
|
|
|
this.dataAlert.message = message;
|
|
|
|
|
this.dataAlert.variant = type || "info";
|
|
|
|
|
this.dataAlert.dismissCountDown = this.dataAlert.dismissSecs;
|
|
|
|
|
},
|
|
|
|
|
/**
|
|
|
|
|
* Updates the alert dismiss value to update
|
|
|
|
|
* dismissCountDown and decrease
|
|
|
|
|
* @param {mumber}
|
|
|
|
|
*/
|
|
|
|
|
countDownChanged(dismissCountDown) {
|
|
|
|
|
this.dataAlert.dismissCountDown = dismissCountDown;
|
|
|
|
|
},
|
2021-03-10 16:34:22 +00:00
|
|
|
/**
|
|
|
|
|
* Click handler
|
|
|
|
|
*
|
|
|
|
|
* @param {object} data
|
|
|
|
|
*/
|
2020-12-18 18:28:10 +00:00
|
|
|
onClick(data) {
|
2021-03-10 16:34:22 +00:00
|
|
|
if (data.row.ASSIGNEE === "Unassigned") {
|
2021-03-19 15:15:16 -04:00
|
|
|
this.claimCase(data.row);
|
2021-03-10 16:34:22 +00:00
|
|
|
} else {
|
2021-03-19 15:15:16 -04:00
|
|
|
this.$emit("onUpdateDataCase", {
|
|
|
|
|
APP_UID: data.row.APP_UID,
|
|
|
|
|
DEL_INDEX: data.row.DEL_INDEX,
|
|
|
|
|
PRO_UID: data.row.PRO_UID,
|
|
|
|
|
TAS_UID: data.row.TAS_UID,
|
2021-03-31 14:33:21 +00:00
|
|
|
ACTION: this.dataCase.ACTION || "todo"
|
2021-03-19 15:15:16 -04:00
|
|
|
});
|
|
|
|
|
this.$emit("onUpdatePage", "XCase");
|
2021-03-10 16:34:22 +00:00
|
|
|
}
|
|
|
|
|
},
|
2021-08-23 15:49:14 +00:00
|
|
|
/**
|
|
|
|
|
* Unpause click handler
|
|
|
|
|
*
|
|
|
|
|
* @param {object} data
|
|
|
|
|
*/
|
|
|
|
|
onClickUnpause(data) {
|
2021-09-07 14:16:02 -04:00
|
|
|
let that = this;
|
|
|
|
|
Api.cases.unpause(data.row)
|
|
|
|
|
.then((response) => {
|
2021-09-17 08:17:21 -04:00
|
|
|
if (response.statusText === "OK" || response.status === 200) {
|
2021-09-07 14:16:02 -04:00
|
|
|
that.$refs["vueTable"].getData();
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.catch((error) => {
|
|
|
|
|
that.showAlert(error.response.data.error.message, 'danger');
|
|
|
|
|
});
|
2021-08-23 15:49:14 +00:00
|
|
|
},
|
2021-03-10 16:34:22 +00:00
|
|
|
/**
|
|
|
|
|
* 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();
|
|
|
|
|
});
|
2020-12-18 18:28:10 +00:00
|
|
|
});
|
2021-01-19 19:32:26 -04:00
|
|
|
},
|
|
|
|
|
/**
|
|
|
|
|
* Verify if the case has the permission Summary Form
|
|
|
|
|
* to add dynUid in dataCase
|
|
|
|
|
*/
|
|
|
|
|
requestOpenSummary() {
|
|
|
|
|
Api.cases
|
|
|
|
|
.openSummary(this.dataCase)
|
|
|
|
|
.then((response) => {
|
|
|
|
|
var data = response.data;
|
|
|
|
|
if (data.dynUid !== "") {
|
|
|
|
|
this.dataCase.DYN_UID = data.dynUid;
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.catch((e) => {
|
|
|
|
|
console.error(e);
|
|
|
|
|
});
|
|
|
|
|
},
|
2020-12-07 18:52:12 +00:00
|
|
|
},
|
|
|
|
|
};
|
2020-12-07 22:51:54 +00:00
|
|
|
</script>
|
|
|
|
|
<style>
|
|
|
|
|
.v-container-case-detail {
|
|
|
|
|
padding-top: 20px;
|
|
|
|
|
padding-bottom: 20px;
|
|
|
|
|
padding-left: 50px;
|
2020-12-11 19:36:41 +00:00
|
|
|
padding-right: 20px;
|
2020-12-07 22:51:54 +00:00
|
|
|
}
|
|
|
|
|
</style>
|