2020-12-04 20:36:42 +00:00
|
|
|
<template>
|
2020-12-10 17:37:02 +00:00
|
|
|
<div id="v-mycases3" ref="v-mycases2" class="v-container-mycases">
|
2020-12-10 11:19:30 -04:00
|
|
|
<b-alert
|
|
|
|
|
:show="dismissCountDown"
|
|
|
|
|
dismissible
|
|
|
|
|
:variant="variant"
|
|
|
|
|
@dismissed="dismissCountDown = 0"
|
|
|
|
|
@dismiss-count-down="countDownChanged"
|
|
|
|
|
>
|
|
|
|
|
{{ message }}
|
|
|
|
|
</b-alert>
|
2020-12-10 17:37:02 +00:00
|
|
|
<button-fleft :data="newCase"></button-fleft>
|
2020-12-18 12:48:24 +00:00
|
|
|
<h5>{{ $t("ID_ADVANCEDSEARCH") }}</h5>
|
|
|
|
|
|
2020-12-17 17:38:18 +00:00
|
|
|
<AdvancedFilter
|
2020-12-10 17:37:02 +00:00
|
|
|
:id="id"
|
|
|
|
|
:name="name"
|
2020-12-10 11:19:30 -04:00
|
|
|
:filters="filters"
|
2020-12-10 17:37:02 +00:00
|
|
|
@onJumpCase="onJumpCase"
|
|
|
|
|
@onSubmit="onSubmitFilter"
|
|
|
|
|
@onRemoveFilter="onRemoveFilter"
|
|
|
|
|
@onSearch="onSearch"
|
2020-12-10 11:19:30 -04:00
|
|
|
@onUpdateFilters="onUpdateFilters"
|
2020-12-10 17:37:02 +00:00
|
|
|
/>
|
2020-12-04 20:36:42 +00:00
|
|
|
|
2020-12-10 17:37:02 +00:00
|
|
|
<modal-new-request ref="newRequest"></modal-new-request>
|
2021-07-22 19:33:43 +00:00
|
|
|
<settings-popover :options="formatColumnSettings(options.headings)" target="pm-dr-column-settings" @onUpdateColumnSettings="onUpdateColumnSettings" :key="random+1" :selected="formatColumnSelected(columns)"/>
|
2022-12-21 11:10:01 -04:00
|
|
|
<b-overlay :show="showOverlay" rounded="sm">
|
2020-12-10 17:37:02 +00:00
|
|
|
<v-server-table
|
|
|
|
|
:data="tableData"
|
|
|
|
|
:columns="columns"
|
|
|
|
|
:options="options"
|
2020-12-21 11:07:51 +00:00
|
|
|
ref="vueTable"
|
2021-09-24 17:10:33 +00:00
|
|
|
@row-click="configRowClick"
|
2021-07-22 19:33:43 +00:00
|
|
|
:key="random"
|
2020-12-10 17:37:02 +00:00
|
|
|
>
|
|
|
|
|
<div slot="info" slot-scope="props">
|
|
|
|
|
<b-icon
|
|
|
|
|
icon="exclamation-circle-fill"
|
|
|
|
|
variant="primary"
|
|
|
|
|
@click="openCaseDetail(props.row)"
|
|
|
|
|
></b-icon>
|
|
|
|
|
</div>
|
|
|
|
|
<div slot="case_number" slot-scope="props">
|
|
|
|
|
{{ props.row.CASE_NUMBER }}
|
|
|
|
|
</div>
|
2021-08-30 21:16:27 -04:00
|
|
|
<div slot="thread_title" slot-scope="props">
|
|
|
|
|
<ThreadTitleCell :data="props.row.THREAD_TITLE" />
|
2020-12-10 17:37:02 +00:00
|
|
|
</div>
|
2021-04-06 22:29:37 +00:00
|
|
|
<div slot="case_status" slot-scope="props">
|
|
|
|
|
{{ props.row.APP_STATUS }}
|
|
|
|
|
</div>
|
2021-11-19 19:53:07 +00:00
|
|
|
<div slot="process_category" slot-scope="props">
|
|
|
|
|
{{ props.row.PROCESS_CATEGORY }}
|
|
|
|
|
</div>
|
2021-12-13 20:52:21 +00:00
|
|
|
<div slot="process_name" slot-scope="props">
|
|
|
|
|
{{ props.row.PROCESS_NAME }}
|
|
|
|
|
</div>
|
2020-12-10 17:37:02 +00:00
|
|
|
<div slot="task" slot-scope="props">
|
|
|
|
|
<TaskCell :data="props.row.TASK" />
|
|
|
|
|
</div>
|
|
|
|
|
<div slot="status" slot-scope="props">
|
|
|
|
|
{{ props.row.STATUS }}
|
|
|
|
|
</div>
|
|
|
|
|
<div slot="current_user" slot-scope="props">
|
2021-01-20 17:23:39 +00:00
|
|
|
<CurrentUserCell :data="props.row.USER_DATA" />
|
2020-12-10 17:37:02 +00:00
|
|
|
</div>
|
2020-12-18 14:31:16 -04:00
|
|
|
<div slot="start_date" slot-scope="props">
|
|
|
|
|
{{ props.row.START_DATE }}
|
2020-12-10 17:37:02 +00:00
|
|
|
</div>
|
2020-12-18 14:31:16 -04:00
|
|
|
<div slot="finish_date" slot-scope="props">
|
|
|
|
|
{{ props.row.FINISH_DATE }}
|
2020-12-10 17:37:02 +00:00
|
|
|
</div>
|
2020-12-21 11:07:51 +00:00
|
|
|
<div slot="duration" slot-scope="props">
|
2020-12-18 14:31:16 -04:00
|
|
|
{{ props.row.DURATION }}
|
2020-12-10 17:37:02 +00:00
|
|
|
</div>
|
2020-12-21 11:07:51 +00:00
|
|
|
<div slot="actions" slot-scope="props">
|
|
|
|
|
<div class="btn-default" v-bind:style="{ color: props.row.MESSAGE_COLOR}" @click="openComments(props.row)">
|
|
|
|
|
<span class="fas fa-comments"></span>
|
2020-12-10 17:37:02 +00:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</v-server-table>
|
2022-12-21 11:10:01 -04:00
|
|
|
</b-overlay>
|
2021-09-24 17:10:33 +00:00
|
|
|
<vue-simple-context-menu
|
|
|
|
|
:elementId="idContextMenu"
|
|
|
|
|
:options="contextMenuItems"
|
|
|
|
|
:ref="idContextMenu"
|
|
|
|
|
@option-clicked="contextMenuItemClicked"
|
|
|
|
|
/>
|
2020-12-21 11:07:51 +00:00
|
|
|
<ModalComments
|
|
|
|
|
ref="modal-comments"
|
|
|
|
|
@postNotes="onPostNotes"
|
|
|
|
|
></ModalComments>
|
2022-06-14 15:25:37 +00:00
|
|
|
<ModalClaimCase ref="modal-claim-case" @claimCatch="claimCatch"></ModalClaimCase>
|
2020-12-10 17:37:02 +00:00
|
|
|
</div>
|
2020-12-04 20:36:42 +00:00
|
|
|
</template>
|
|
|
|
|
<script>
|
2021-07-22 19:33:43 +00:00
|
|
|
import ButtonFleft from "../../components/home/ButtonFleft.vue";
|
|
|
|
|
import ModalNewRequest from "../ModalNewRequest.vue";
|
|
|
|
|
import AdvancedFilter from "../../components/search/AdvancedFilter";
|
|
|
|
|
import TaskCell from "../../components/vuetable/TaskCell.vue";
|
|
|
|
|
import CurrentUserCell from "../../components/vuetable/CurrentUserCell.vue";
|
|
|
|
|
import ModalComments from "../modal/ModalComments.vue";
|
2021-08-30 21:16:27 -04:00
|
|
|
import ThreadTitleCell from "../../components/vuetable/ThreadTitleCell.vue"
|
2022-06-14 15:25:37 +00:00
|
|
|
import ModalClaimCase from "../modal/ModalClaimCase.vue";
|
2021-07-22 19:33:43 +00:00
|
|
|
import api from "../../api/index";
|
|
|
|
|
import utils from "../../utils/utils";
|
|
|
|
|
import defaultMixin from "./defaultMixins.js";
|
2021-09-24 17:10:33 +00:00
|
|
|
import customMixin from "./customMixins";
|
2021-10-25 17:03:50 -04:00
|
|
|
import { Event } from "vue-tables-2";
|
2020-12-04 20:36:42 +00:00
|
|
|
|
|
|
|
|
export default {
|
2020-12-10 17:37:02 +00:00
|
|
|
name: "AdvancedSearch",
|
2021-09-24 17:10:33 +00:00
|
|
|
mixins: [defaultMixin, customMixin],
|
2020-12-10 17:37:02 +00:00
|
|
|
components: {
|
2020-12-17 17:38:18 +00:00
|
|
|
AdvancedFilter,
|
2020-12-10 17:37:02 +00:00
|
|
|
ButtonFleft,
|
|
|
|
|
ModalNewRequest,
|
2020-12-21 11:07:51 +00:00
|
|
|
TaskCell,
|
2021-01-20 17:23:39 +00:00
|
|
|
CurrentUserCell,
|
2022-06-14 15:25:37 +00:00
|
|
|
ModalClaimCase,
|
2021-08-30 21:16:27 -04:00
|
|
|
ModalComments,
|
|
|
|
|
ThreadTitleCell,
|
2020-12-10 17:37:02 +00:00
|
|
|
},
|
2020-12-10 11:19:30 -04:00
|
|
|
props: ["id", "name", "filters"],
|
2020-12-10 17:37:02 +00:00
|
|
|
data() {
|
2021-07-22 19:33:43 +00:00
|
|
|
let that = this;
|
2020-12-10 17:37:02 +00:00
|
|
|
return {
|
2020-12-10 11:19:30 -04:00
|
|
|
dismissSecs: 5,
|
|
|
|
|
dismissCountDown: 0,
|
|
|
|
|
message: "",
|
|
|
|
|
variant: "info",
|
2020-12-10 17:37:02 +00:00
|
|
|
metrics: [],
|
|
|
|
|
filter: "CASES_INBOX",
|
|
|
|
|
allView: [],
|
2020-12-10 11:19:30 -04:00
|
|
|
filtersModel: {},
|
2020-12-10 17:37:02 +00:00
|
|
|
filterHeader: "STARTED_BY_ME",
|
|
|
|
|
headers: [],
|
2021-09-20 13:24:24 +00:00
|
|
|
columMap: {
|
|
|
|
|
case_number: "APP_NUMBER",
|
2021-09-28 12:19:49 -04:00
|
|
|
thread_title: "DEL_TITLE",
|
2021-09-20 13:24:24 +00:00
|
|
|
process_name: "PRO_TITLE",
|
|
|
|
|
},
|
2020-12-10 17:37:02 +00:00
|
|
|
newCase: {
|
2021-06-02 14:47:56 +00:00
|
|
|
title: this.$i18n.t("ID_NEW_CASE"),
|
2020-12-10 17:37:02 +00:00
|
|
|
class: "btn-success",
|
|
|
|
|
onClick: () => {
|
2024-01-18 19:59:56 +00:00
|
|
|
this.$root.$emit('bv::hide::popover');
|
2020-12-10 17:37:02 +00:00
|
|
|
this.$refs["newRequest"].show();
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
columns: [
|
|
|
|
|
"case_number",
|
2021-11-19 19:53:07 +00:00
|
|
|
"process_category",
|
2021-12-13 20:52:21 +00:00
|
|
|
"process_name",
|
2021-08-30 21:16:27 -04:00
|
|
|
"status",
|
|
|
|
|
"thread_title",
|
2020-12-10 17:37:02 +00:00
|
|
|
"task",
|
|
|
|
|
"current_user",
|
2020-12-18 14:31:16 -04:00
|
|
|
"start_date",
|
|
|
|
|
"finish_date",
|
|
|
|
|
"duration",
|
2020-12-10 17:37:02 +00:00
|
|
|
"actions",
|
|
|
|
|
],
|
|
|
|
|
tableData: [],
|
|
|
|
|
options: {
|
|
|
|
|
filterable: false,
|
2022-06-14 10:13:49 -04:00
|
|
|
perPageValues: [],
|
2022-08-02 16:48:30 +00:00
|
|
|
pagination: {
|
|
|
|
|
chunk: 3,
|
|
|
|
|
nav: 'scroll',
|
|
|
|
|
edge: true
|
|
|
|
|
},
|
2020-12-10 17:37:02 +00:00
|
|
|
headings: {
|
|
|
|
|
case_number: this.$i18n.t("ID_MYCASE_NUMBER"),
|
2021-11-30 17:10:36 +00:00
|
|
|
process_category: this.$i18n.t("ID_CATEGORY_PROCESS"),
|
2021-12-13 20:52:21 +00:00
|
|
|
process_name: this.$i18n.t("ID_PROCESS_NAME"),
|
2021-08-30 21:16:27 -04:00
|
|
|
status: this.$i18n.t("ID_STATUS"),
|
|
|
|
|
thread_title: this.$i18n.t('ID_CASE_THREAD_TITLE'),
|
2020-12-10 17:37:02 +00:00
|
|
|
task: this.$i18n.t("ID_TASK"),
|
|
|
|
|
current_user: this.$i18n.t("ID_CURRENT_USER"),
|
2020-12-18 14:31:16 -04:00
|
|
|
start_date: this.$i18n.t("ID_START_DATE"),
|
|
|
|
|
finish_date: this.$i18n.t("ID_FINISH_DATE"),
|
|
|
|
|
duration: this.$i18n.t("ID_DURATION"),
|
2020-12-10 17:37:02 +00:00
|
|
|
actions: "",
|
|
|
|
|
},
|
2021-06-02 14:47:56 +00:00
|
|
|
texts: {
|
|
|
|
|
count:this.$i18n.t("ID_SHOWING_FROM_RECORDS_COUNT"),
|
2022-08-02 16:48:30 +00:00
|
|
|
first: "<<",
|
|
|
|
|
last: ">>",
|
2021-06-02 14:47:56 +00:00
|
|
|
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-10 17:37:02 +00:00
|
|
|
selectable: {
|
|
|
|
|
mode: "single",
|
|
|
|
|
only: function(row) {
|
|
|
|
|
return true;
|
|
|
|
|
},
|
|
|
|
|
selectAllMode: "page",
|
|
|
|
|
programmatic: false,
|
|
|
|
|
},
|
2021-09-20 13:24:24 +00:00
|
|
|
sortable: ["case_number"],
|
2020-12-10 17:37:02 +00:00
|
|
|
requestFunction(data) {
|
2022-12-21 11:10:01 -04:00
|
|
|
return this.$parent.$parent.$parent.getCasesForVueTable(data);
|
2020-12-10 17:37:02 +00:00
|
|
|
},
|
2021-07-29 20:48:58 +00:00
|
|
|
customFilters: ["myfilter"]
|
2020-12-10 17:37:02 +00:00
|
|
|
},
|
2021-01-12 20:55:14 +00:00
|
|
|
pmDateFormat: window.config.FORMATS.dateFormat,
|
|
|
|
|
clickCount: 0,
|
2021-01-21 19:59:27 +00:00
|
|
|
singleClickTimer: null,
|
|
|
|
|
statusTitle: {
|
|
|
|
|
"ON_TIME": this.$i18n.t("ID_IN_PROGRESS"),
|
|
|
|
|
"OVERDUE": this.$i18n.t("ID_TASK_OVERDUE"),
|
|
|
|
|
"DRAFT": this.$i18n.t("ID_IN_DRAFT"),
|
|
|
|
|
"PAUSED": this.$i18n.t("ID_PAUSED"),
|
|
|
|
|
"UNASSIGNED": this.$i18n.t("ID_UNASSIGNED")
|
2022-12-21 11:10:01 -04:00
|
|
|
},
|
|
|
|
|
showOverlay: false,
|
2020-12-10 17:37:02 +00:00
|
|
|
};
|
|
|
|
|
},
|
2021-10-25 17:03:50 -04:00
|
|
|
mounted() {
|
|
|
|
|
Event.$on('clearSortEvent', this.clearSort);
|
|
|
|
|
},
|
2020-12-10 11:19:30 -04:00
|
|
|
watch: {
|
|
|
|
|
id: function() {
|
2020-12-21 11:07:51 +00:00
|
|
|
this.$refs.vueTable.refresh();
|
2020-12-10 11:19:30 -04:00
|
|
|
},
|
|
|
|
|
},
|
2020-12-10 17:37:02 +00:00
|
|
|
methods: {
|
2021-01-12 20:55:14 +00:00
|
|
|
/**
|
|
|
|
|
* Row click event handler
|
|
|
|
|
* @param {object} event
|
|
|
|
|
*/
|
|
|
|
|
onRowClick(event) {
|
|
|
|
|
let self = this;
|
|
|
|
|
self.clickCount += 1;
|
|
|
|
|
if (self.clickCount === 1) {
|
|
|
|
|
self.singleClickTimer = setTimeout(function() {
|
|
|
|
|
self.clickCount = 0;
|
|
|
|
|
}, 400);
|
|
|
|
|
} else if (self.clickCount === 2) {
|
|
|
|
|
clearTimeout(self.singleClickTimer);
|
2022-12-21 11:10:01 -04:00
|
|
|
self.showOverlay = true;
|
2021-01-12 20:55:14 +00:00
|
|
|
self.clickCount = 0;
|
|
|
|
|
self.openCaseDetail(event.row);
|
|
|
|
|
}
|
|
|
|
|
},
|
2020-12-10 17:37:02 +00:00
|
|
|
/**
|
|
|
|
|
* Get cases data by header
|
|
|
|
|
*/
|
2020-12-15 17:34:47 -04:00
|
|
|
getCasesForVueTable(data) {
|
2020-12-10 17:37:02 +00:00
|
|
|
let that = this,
|
2020-12-15 17:34:47 -04:00
|
|
|
dt,
|
|
|
|
|
paged,
|
|
|
|
|
limit = data.limit,
|
2020-12-17 17:38:18 +00:00
|
|
|
filters = {},
|
2021-09-20 13:24:24 +00:00
|
|
|
start = data.page === 1 ? 0 : limit * (data.page - 1),
|
|
|
|
|
sort = "";
|
2021-08-23 13:35:51 +00:00
|
|
|
paged = start + "," + limit ;
|
|
|
|
|
filters = {
|
|
|
|
|
limit: limit,
|
|
|
|
|
offset: start
|
|
|
|
|
};
|
2021-07-14 14:21:28 +00:00
|
|
|
_.forIn(this.filters, function (item, key) {
|
|
|
|
|
if(filters && item.value) {
|
2020-12-17 17:38:18 +00:00
|
|
|
filters[item.filterVar] = item.value;
|
2021-07-14 14:21:28 +00:00
|
|
|
}
|
|
|
|
|
});
|
2021-09-20 13:24:24 +00:00
|
|
|
|
|
|
|
|
sort = that.prepareSortString(data);
|
|
|
|
|
if (sort) {
|
|
|
|
|
filters["sort"] = sort;
|
|
|
|
|
}
|
2021-07-14 14:21:28 +00:00
|
|
|
return new Promise((resolutionFunc, rejectionFunc) => {
|
2020-12-10 17:37:02 +00:00
|
|
|
api.cases
|
2020-12-17 17:38:18 +00:00
|
|
|
.search(filters)
|
2020-12-10 17:37:02 +00:00
|
|
|
.then((response) => {
|
|
|
|
|
dt = that.formatDataResponse(response.data.data);
|
|
|
|
|
resolutionFunc({
|
|
|
|
|
data: dt,
|
2020-12-18 12:48:24 +00:00
|
|
|
count:
|
|
|
|
|
dt.length < data.limit
|
|
|
|
|
? data.limit * data.page
|
|
|
|
|
: data.limit * data.page + 1,
|
2020-12-10 17:37:02 +00:00
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
.catch((e) => {
|
|
|
|
|
rejectionFunc(e);
|
|
|
|
|
});
|
|
|
|
|
});
|
2020-12-04 20:36:42 +00:00
|
|
|
},
|
2021-09-20 13:24:24 +00:00
|
|
|
/**
|
|
|
|
|
* Prepare sort string to be sended in the service
|
|
|
|
|
* @param {object} data
|
|
|
|
|
* @returns {string}
|
|
|
|
|
*/
|
|
|
|
|
prepareSortString(data) {
|
|
|
|
|
let sort = "";
|
|
|
|
|
if (data.orderBy && this.columMap[data.orderBy]) {
|
|
|
|
|
sort = `${this.columMap[data.orderBy]},${
|
|
|
|
|
data.ascending === 1 ? "ASC" : "DESC"
|
|
|
|
|
}`;
|
|
|
|
|
}
|
|
|
|
|
return sort;
|
|
|
|
|
},
|
2020-12-10 17:37:02 +00:00
|
|
|
/**
|
2020-12-21 11:07:51 +00:00
|
|
|
* Format the service response
|
2020-12-10 17:37:02 +00:00
|
|
|
*/
|
|
|
|
|
formatDataResponse(response) {
|
|
|
|
|
let data = [];
|
|
|
|
|
_.forEach(response, (v) => {
|
|
|
|
|
data.push({
|
|
|
|
|
CASE_NUMBER: v.APP_NUMBER,
|
2021-08-30 21:16:27 -04:00
|
|
|
THREAD_TITLE: v.THREAD_TITLES,
|
2020-12-10 17:37:02 +00:00
|
|
|
PROCESS_NAME: v.PRO_TITLE,
|
2021-11-19 19:53:07 +00:00
|
|
|
PROCESS_CATEGORY: v.CATEGORY,
|
2020-12-18 14:31:16 -04:00
|
|
|
TASK: this.formatTasks(v.THREAD_TASKS),
|
2021-01-20 17:23:39 +00:00
|
|
|
USER_DATA: this.formatUser(v.THREAD_USERS),
|
2020-12-18 14:31:16 -04:00
|
|
|
START_DATE: v.APP_CREATE_DATE_LABEL,
|
|
|
|
|
FINISH_DATE: v.APP_FINISH_DATE_LABEL,
|
|
|
|
|
DURATION: v.DURATION,
|
2020-12-10 17:37:02 +00:00
|
|
|
DEL_INDEX: v.DEL_INDEX,
|
|
|
|
|
APP_UID: v.APP_UID,
|
2021-04-06 22:29:37 +00:00
|
|
|
STATUS: this.$i18n.t("ID_CASES_STATUS_"+ v.APP_STATUS.toUpperCase()),
|
2020-12-21 11:07:51 +00:00
|
|
|
PRO_UID: v.PRO_UID,
|
|
|
|
|
TAS_UID: v.TAS_UID,
|
|
|
|
|
MESSAGE_COLOR: v.CASE_NOTES_COUNT > 0 ? "black":"silver"
|
2020-12-10 17:37:02 +00:00
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
return data;
|
2020-12-04 20:36:42 +00:00
|
|
|
},
|
2020-12-18 14:31:16 -04:00
|
|
|
/**
|
|
|
|
|
* Format the data for the column task
|
|
|
|
|
*/
|
|
|
|
|
formatTasks(data) {
|
|
|
|
|
var i,
|
|
|
|
|
dataFormat = [];
|
|
|
|
|
for (i = 0; i < data.length; i += 1) {
|
|
|
|
|
dataFormat.push({
|
|
|
|
|
TITLE: data[i].tas_title,
|
|
|
|
|
CODE_COLOR: data[i].tas_color,
|
2021-01-21 19:59:27 +00:00
|
|
|
DELAYED_TITLE: data[i].tas_status === "OVERDUE" ?
|
|
|
|
|
this.$i18n.t("ID_DELAYED") + ":" : this.statusTitle[data[i].tas_status],
|
|
|
|
|
DELAYED_MSG: data[i].tas_status === "OVERDUE" ? data[i].delay : ""
|
|
|
|
|
|
2020-12-18 14:31:16 -04:00
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
return dataFormat;
|
2021-01-21 19:59:27 +00:00
|
|
|
|
2020-12-18 14:31:16 -04:00
|
|
|
},
|
|
|
|
|
formatUser(data) {
|
|
|
|
|
var i,
|
2021-01-26 11:41:09 -04:00
|
|
|
dataFormat = [],
|
|
|
|
|
userDataFormat;
|
2020-12-18 14:31:16 -04:00
|
|
|
for (i = 0; i < data.length; i += 1) {
|
2021-01-26 11:41:09 -04:00
|
|
|
userDataFormat = utils.userNameDisplayFormat({
|
2021-01-14 15:39:53 +00:00
|
|
|
userName: data[i].usr_firstname,
|
|
|
|
|
firstName: data[i].usr_lastname,
|
|
|
|
|
lastName: data[i].usr_username,
|
|
|
|
|
format: window.config.FORMATS.format || null
|
2021-01-26 11:41:09 -04:00
|
|
|
});
|
|
|
|
|
dataFormat.push({
|
|
|
|
|
USERNAME_DISPLAY_FORMAT: userDataFormat !== "" ? userDataFormat : this.$i18n.t("ID_UNASSIGNED"),
|
2021-01-21 19:59:27 +00:00
|
|
|
EMAIL: data[i].user_tooltip.usr_email,
|
|
|
|
|
POSITION: data[i].user_tooltip.usr_position,
|
2021-03-24 14:56:11 +00:00
|
|
|
AVATAR: userDataFormat !== "" ? window.config.SYS_SERVER_AJAX +
|
2021-01-20 17:23:39 +00:00
|
|
|
window.config.SYS_URI +
|
2021-01-26 11:41:09 -04:00
|
|
|
`users/users_ViewPhotoGrid?pUID=${data[i].user_id}` : "",
|
|
|
|
|
UNASSIGNED: userDataFormat !== "" ? true : false
|
2020-12-18 14:31:16 -04:00
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
return dataFormat;
|
|
|
|
|
},
|
2020-12-10 17:37:02 +00:00
|
|
|
/**
|
|
|
|
|
* Convert string to date format
|
|
|
|
|
*
|
|
|
|
|
* @param {string} value
|
|
|
|
|
* @return {date} myDate
|
|
|
|
|
*/
|
|
|
|
|
convertDate(value) {
|
|
|
|
|
myDate = new Date(1900, 0, 1, 0, 0, 0);
|
|
|
|
|
try {
|
|
|
|
|
if (!isNaN(Date.parse(value))) {
|
|
|
|
|
var myArray = value.split(" ");
|
|
|
|
|
var myArrayDate = myArray[0].split("-");
|
|
|
|
|
if (myArray.length > 1) {
|
|
|
|
|
var myArrayHour = myArray[1].split(":");
|
|
|
|
|
} else {
|
|
|
|
|
var myArrayHour = new Array("0", "0", "0");
|
|
|
|
|
}
|
|
|
|
|
var myDate = new Date(
|
|
|
|
|
myArrayDate[0],
|
|
|
|
|
myArrayDate[1] - 1,
|
|
|
|
|
myArrayDate[2],
|
|
|
|
|
myArrayHour[0],
|
|
|
|
|
myArrayHour[1],
|
|
|
|
|
myArrayHour[2]
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
} catch (err) {
|
|
|
|
|
throw new Error(err);
|
|
|
|
|
}
|
|
|
|
|
return myDate;
|
|
|
|
|
},
|
|
|
|
|
/**
|
|
|
|
|
* Get a format for specific date
|
|
|
|
|
*
|
|
|
|
|
* @param {string} d
|
|
|
|
|
* @return {string} dateToConvert
|
|
|
|
|
*/
|
|
|
|
|
dateFormatCases(d) {
|
|
|
|
|
let dateToConvert = d;
|
|
|
|
|
const stringToDate = this.convertDate(dateToConvert);
|
|
|
|
|
if (this.pmDateFormat === "Y-m-d H:i:s") {
|
|
|
|
|
dateToConvert = dateFormat(stringToDate, "yyyy-mm-dd HH:MM:ss");
|
|
|
|
|
} else if (this.pmDateFormat === "d/m/Y") {
|
|
|
|
|
dateToConvert = dateFormat(stringToDate, "dd/mm/yyyy");
|
|
|
|
|
} else if (this.pmDateFormat === "m/d/Y") {
|
|
|
|
|
dateToConvert = dateFormat(stringToDate, "mm/dd/yyyy");
|
|
|
|
|
} else if (this.pmDateFormat === "Y/d/m") {
|
|
|
|
|
dateToConvert = dateFormat(stringToDate, "yyyy/dd/mm");
|
|
|
|
|
} else if (this.pmDateFormat === "Y/m/d") {
|
|
|
|
|
dateToConvert = dateFormat(stringToDate, "yyyy/mm/dd");
|
|
|
|
|
} else if (this.pmDateFormat === "F j, Y, g:i a") {
|
|
|
|
|
dateToConvert = dateFormat(
|
|
|
|
|
stringToDate,
|
|
|
|
|
"mmmm d, yyyy, h:MM tt"
|
|
|
|
|
);
|
|
|
|
|
} else if (this.pmDateFormat === "m.d.y") {
|
|
|
|
|
dateToConvert = dateFormat(stringToDate, "mm.dd.yy");
|
|
|
|
|
} else if (this.pmDateFormat === "j, n, Y") {
|
|
|
|
|
dateToConvert = dateFormat(stringToDate, "d,m,yyyy");
|
|
|
|
|
} else if (this.pmDateFormat === "D M j G:i:s T Y") {
|
|
|
|
|
dateToConvert = dateFormat(
|
|
|
|
|
stringToDate,
|
|
|
|
|
"ddd mmm d HH:MM:ss Z yyyy"
|
|
|
|
|
);
|
|
|
|
|
} else if (this.pmDateFormat === "M d, Y") {
|
|
|
|
|
dateToConvert = dateFormat(stringToDate, "mmm dd, yyyy");
|
|
|
|
|
} else if (this.pmDateFormat === "m D, Y") {
|
|
|
|
|
dateToConvert = dateFormat(stringToDate, "mm ddd, yyyy");
|
|
|
|
|
} else if (this.pmDateFormat === "D d M, Y") {
|
|
|
|
|
dateToConvert = dateFormat(stringToDate, "ddd dd mmm, yyyy");
|
|
|
|
|
} else if (this.pmDateFormat === "D M, Y") {
|
|
|
|
|
dateToConvert = dateFormat(stringToDate, "ddd mmm, yyyy");
|
|
|
|
|
} else if (this.pmDateFormat === "d M, Y") {
|
|
|
|
|
dateToConvert = dateFormat(stringToDate, "dd mmm, yyyy");
|
|
|
|
|
} else if (this.pmDateFormat === "d m, Y") {
|
|
|
|
|
dateToConvert = dateFormat(stringToDate, "dd mm, yyyy");
|
|
|
|
|
} else if (this.pmDateFormat === "d.m.Y") {
|
|
|
|
|
dateToConvert = dateFormat(stringToDate, "mm.dd.yyyy");
|
|
|
|
|
} else {
|
|
|
|
|
dateToConvert = dateFormat(
|
|
|
|
|
stringToDate,
|
|
|
|
|
'dd "de" mmmm "de" yyyy'
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
return dateToConvert;
|
|
|
|
|
},
|
|
|
|
|
/**
|
|
|
|
|
* Open selected cases in the inbox
|
|
|
|
|
*
|
|
|
|
|
* @param {object} item
|
|
|
|
|
*/
|
|
|
|
|
openCase(item) {
|
|
|
|
|
const action = "todo";
|
|
|
|
|
if (this.isIE) {
|
|
|
|
|
window.open(
|
|
|
|
|
"../../../cases/open?APP_UID=" +
|
|
|
|
|
item.row.APP_UID +
|
|
|
|
|
"&DEL_INDEX=" +
|
|
|
|
|
item.row.DEL_INDEX +
|
|
|
|
|
"&action=" +
|
|
|
|
|
action
|
|
|
|
|
);
|
|
|
|
|
} else {
|
|
|
|
|
window.location.href =
|
|
|
|
|
"../../../cases/open?APP_UID=" +
|
|
|
|
|
item.row.APP_UID +
|
|
|
|
|
"&DEL_INDEX=" +
|
|
|
|
|
item.row.DEL_INDEX +
|
|
|
|
|
"&action=" +
|
|
|
|
|
action;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
/**
|
|
|
|
|
* Open case detail
|
|
|
|
|
*
|
|
|
|
|
* @param {object} item
|
|
|
|
|
*/
|
|
|
|
|
openCaseDetail(item) {
|
2021-03-10 18:53:52 +00:00
|
|
|
this.$emit("onUpdateDataCase", {
|
2020-12-10 17:37:02 +00:00
|
|
|
APP_UID: item.APP_UID,
|
|
|
|
|
DEL_INDEX: item.DEL_INDEX,
|
2020-12-21 11:07:51 +00:00
|
|
|
PRO_UID: item.PRO_UID,
|
|
|
|
|
TAS_UID: item.TAS_UID,
|
2020-12-14 16:19:44 -04:00
|
|
|
APP_NUMBER: item.CASE_NUMBER
|
2021-03-10 18:53:52 +00:00
|
|
|
});
|
|
|
|
|
this.$emit("onUpdatePage", "case-detail");
|
2020-12-10 17:37:02 +00:00
|
|
|
},
|
2022-06-14 15:25:37 +00:00
|
|
|
/**
|
|
|
|
|
* Method to validate if the case is unassigned
|
|
|
|
|
*/
|
2020-12-10 17:37:02 +00:00
|
|
|
onJumpCase(caseNumber) {
|
2022-06-14 15:25:37 +00:00
|
|
|
api.cases.pendingtask({APP_NUMBER:caseNumber}).then((response) => {
|
|
|
|
|
if (response.data && response.data[0] && response.data[0]['USR_ID'] == 0) {
|
|
|
|
|
this.claimCase(response.data[0]);
|
|
|
|
|
} else {
|
|
|
|
|
this.jump(caseNumber);
|
|
|
|
|
}
|
|
|
|
|
}).catch((e)=>{
|
|
|
|
|
this.jump(caseNumber);
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
/**
|
|
|
|
|
* Method to jump case based in APP_NUMBER
|
|
|
|
|
*/
|
|
|
|
|
jump (caseNumber) {
|
|
|
|
|
let self = this;
|
2020-12-10 17:37:02 +00:00
|
|
|
const params = {
|
|
|
|
|
APP_NUMBER: caseNumber,
|
|
|
|
|
ACTION: "jump",
|
|
|
|
|
ACTION_FROM_LIST: "search",
|
|
|
|
|
};
|
2022-06-14 15:25:37 +00:00
|
|
|
|
2020-12-10 17:37:02 +00:00
|
|
|
api.cases
|
|
|
|
|
.jump(params)
|
2020-12-22 14:07:09 +00:00
|
|
|
.then(function(response) {
|
|
|
|
|
if (response.data.exists) {
|
|
|
|
|
self.$parent.dataCase = params;
|
|
|
|
|
self.$parent.page = "XCase";
|
|
|
|
|
} else {
|
|
|
|
|
self.showAlert(response.data.message, "danger");
|
|
|
|
|
}
|
2020-12-10 17:37:02 +00:00
|
|
|
})
|
|
|
|
|
.catch((err) => {
|
2020-12-22 14:07:09 +00:00
|
|
|
self.showAlert(err.message, "danger");
|
2020-12-10 17:37:02 +00:00
|
|
|
});
|
|
|
|
|
},
|
2020-12-10 11:19:30 -04:00
|
|
|
/**
|
|
|
|
|
* Updates the alert dismiss value to update
|
|
|
|
|
* dismissCountDown and decrease
|
|
|
|
|
* @param {mumber}
|
|
|
|
|
*/
|
|
|
|
|
countDownChanged(dismissCountDown) {
|
|
|
|
|
this.dismissCountDown = dismissCountDown;
|
|
|
|
|
},
|
|
|
|
|
/**
|
|
|
|
|
* Show the alert message
|
|
|
|
|
* @param {string} message - message to be displayen in the body
|
|
|
|
|
* @param {string} type - alert type
|
|
|
|
|
*/
|
2020-12-21 11:07:51 +00:00
|
|
|
showAlert(message, type) {
|
2020-12-10 11:19:30 -04:00
|
|
|
this.message = message;
|
|
|
|
|
this.variant = type || "info";
|
|
|
|
|
this.dismissCountDown = this.dismissSecs;
|
|
|
|
|
},
|
2020-12-10 17:37:02 +00:00
|
|
|
/**
|
|
|
|
|
* Handler submit filter
|
|
|
|
|
* @param {object} data - data returned from the server
|
|
|
|
|
*/
|
2020-12-10 11:19:30 -04:00
|
|
|
onSubmitFilter(params) {
|
|
|
|
|
if (params.type === "update") {
|
|
|
|
|
api.filters
|
|
|
|
|
.put({
|
|
|
|
|
id: params.id,
|
|
|
|
|
name: params.name,
|
|
|
|
|
filters: JSON.stringify(params.filters),
|
|
|
|
|
})
|
|
|
|
|
.then((response) => {
|
|
|
|
|
this.$emit("onSubmitFilter", params);
|
|
|
|
|
})
|
|
|
|
|
.catch((e) => {
|
|
|
|
|
this.showAlert(e.message, "danger");
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
api.filters
|
|
|
|
|
.post({
|
|
|
|
|
name: params.name,
|
|
|
|
|
filters: JSON.stringify(params.filters),
|
|
|
|
|
})
|
|
|
|
|
.then((response) => {
|
|
|
|
|
this.$emit("onSubmitFilter", response.data);
|
|
|
|
|
})
|
|
|
|
|
.catch((e) => {
|
|
|
|
|
this.showAlert(e.message, "danger");
|
|
|
|
|
});
|
|
|
|
|
}
|
2020-12-10 17:37:02 +00:00
|
|
|
},
|
|
|
|
|
/**
|
|
|
|
|
* Handler on remove filter
|
|
|
|
|
* @param {number} id - data returned fron the server
|
|
|
|
|
*/
|
|
|
|
|
onRemoveFilter(id) {
|
2020-12-10 11:19:30 -04:00
|
|
|
api.filters
|
|
|
|
|
.delete({
|
|
|
|
|
id: this.id,
|
|
|
|
|
})
|
|
|
|
|
.then((response) => {
|
|
|
|
|
this.$emit("onUpdateFilters", {});
|
|
|
|
|
this.$emit("onRemoveFilter", id);
|
|
|
|
|
})
|
|
|
|
|
.catch((e) => {
|
|
|
|
|
this.showAlert(e.message, "danger");
|
|
|
|
|
});
|
2020-12-10 17:37:02 +00:00
|
|
|
},
|
|
|
|
|
/**
|
|
|
|
|
* Handler on search filter
|
|
|
|
|
* @param {number} id - data returned fron the server
|
|
|
|
|
*/
|
|
|
|
|
onSearch(params) {
|
2020-12-10 11:19:30 -04:00
|
|
|
this.$nextTick(() => {
|
2020-12-21 11:07:51 +00:00
|
|
|
this.$refs.vueTable.refresh();
|
2020-12-10 11:19:30 -04:00
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
onUpdateFilters(params) {
|
|
|
|
|
this.$emit("onUpdateFilters", params);
|
2020-12-04 20:36:42 +00:00
|
|
|
},
|
2020-12-21 11:07:51 +00:00
|
|
|
/**
|
|
|
|
|
* Open the case notes modal
|
|
|
|
|
* @param {object} data - needed to create the data
|
|
|
|
|
*/
|
|
|
|
|
openComments(data) {
|
|
|
|
|
let that = this;
|
|
|
|
|
api.cases.open(_.extend({ ACTION: "todo" }, data)).then(() => {
|
|
|
|
|
that.$refs["modal-comments"].dataCase = data;
|
|
|
|
|
that.$refs["modal-comments"].show();
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
/**
|
|
|
|
|
* Post notes event handler
|
|
|
|
|
*/
|
|
|
|
|
onPostNotes() {
|
|
|
|
|
this.$refs["vueTable"].getData();
|
|
|
|
|
},
|
2021-10-25 17:03:50 -04:00
|
|
|
/**
|
|
|
|
|
* Reset the sort in the table
|
|
|
|
|
*/
|
|
|
|
|
clearSort() {
|
|
|
|
|
if (this.$refs['vueTable']) {
|
|
|
|
|
this.$refs['vueTable'].setOrder(false);
|
|
|
|
|
}
|
|
|
|
|
},
|
2022-06-14 15:25:37 +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();
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
/**
|
|
|
|
|
* Claim catch error handler message
|
|
|
|
|
*/
|
|
|
|
|
claimCatch(message) {
|
|
|
|
|
this.showAlert(message, "danger");
|
|
|
|
|
}
|
2020-12-04 20:36:42 +00:00
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|
<style>
|
2022-08-31 12:34:01 -04:00
|
|
|
.VueTables__row {
|
|
|
|
|
height: 75px;
|
|
|
|
|
}
|
2020-12-22 14:37:10 +00:00
|
|
|
.VuePagination__count {
|
|
|
|
|
display: none;
|
|
|
|
|
}
|
2020-12-04 20:36:42 +00:00
|
|
|
.v-container-mycases {
|
2020-12-10 17:37:02 +00:00
|
|
|
padding-top: 20px;
|
|
|
|
|
padding-bottom: 20px;
|
|
|
|
|
padding-left: 50px;
|
|
|
|
|
padding-right: 50px;
|
2020-12-04 20:36:42 +00:00
|
|
|
}
|
2020-12-18 14:31:16 -04:00
|
|
|
.v-user-cell {
|
2020-12-21 11:07:51 +00:00
|
|
|
display: inline-block;
|
2020-12-18 14:31:16 -04:00
|
|
|
}
|
|
|
|
|
.v-user-cell-ellipsis {
|
|
|
|
|
white-space: nowrap;
|
|
|
|
|
width: 140px;
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
|
}
|
2020-12-04 20:36:42 +00:00
|
|
|
</style>
|