PMCORE-2700
updat update update
This commit is contained in:
@@ -5,7 +5,7 @@
|
|||||||
<div class="card-text">
|
<div class="card-text">
|
||||||
<div
|
<div
|
||||||
v-for="item in data.items"
|
v-for="item in data.items"
|
||||||
:key="item.title"
|
:key="item.data.id"
|
||||||
class="v-attached-block"
|
class="v-attached-block"
|
||||||
>
|
>
|
||||||
<div class="v-list v-list-row block">
|
<div class="v-list v-list-row block">
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<div class="card-text">
|
<div class="card-text">
|
||||||
<div
|
<div
|
||||||
v-for="item in data.items"
|
v-for="item in data.items"
|
||||||
:key="item.title"
|
:key="item.data.id"
|
||||||
class="v-attached-block"
|
class="v-attached-block"
|
||||||
>
|
>
|
||||||
<span>
|
<span>
|
||||||
|
|||||||
@@ -123,18 +123,22 @@ export default {
|
|||||||
onDropFile(e) {
|
onDropFile(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
|
if(this.data.noPerms === 1){
|
||||||
|
return;
|
||||||
|
}
|
||||||
let that = this,
|
let that = this,
|
||||||
fls = [];
|
fls = [];
|
||||||
_.each(e.dataTransfer.files, (f) => {
|
_.each(e.dataTransfer.files, (f) => {
|
||||||
that.files.push(f);
|
that.files.push(f);
|
||||||
});
|
});
|
||||||
|
that.files = that.files.slice(0,5);
|
||||||
_.each(that.files, (f) => {
|
_.each(that.files, (f) => {
|
||||||
fls.push({
|
fls.push({
|
||||||
data: f,
|
data: f,
|
||||||
title: f.name,
|
title: f.name,
|
||||||
extension: f.name.split(".").pop(),
|
extension: f.name.split(".").pop(),
|
||||||
onClick: () => {},
|
onClick: () => {},
|
||||||
|
id: _.random(1000000)
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -143,6 +147,9 @@ export default {
|
|||||||
},
|
},
|
||||||
onDragOver(e) {
|
onDragOver(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
if(this.data.noPerms === 1){
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (!this.showMaskDrop) {
|
if (!this.showMaskDrop) {
|
||||||
this.showMaskDrop = true;
|
this.showMaskDrop = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -387,6 +387,7 @@ export default {
|
|||||||
let that = this,
|
let that = this,
|
||||||
notesArray = [];
|
notesArray = [];
|
||||||
_.each(notes, (n) => {
|
_.each(notes, (n) => {
|
||||||
|
n.id = _.random(1000000);
|
||||||
notesArray.push({
|
notesArray.push({
|
||||||
user: that.nameFormatCases(
|
user: that.nameFormatCases(
|
||||||
n.USR_FIRSTNAME,
|
n.USR_FIRSTNAME,
|
||||||
|
|||||||
@@ -1,5 +1,14 @@
|
|||||||
<template>
|
<template>
|
||||||
<div id="v-mycases" ref="v-mycases" class="v-container-mycases">
|
<div id="v-mycases" ref="v-mycases" class="v-container-mycases">
|
||||||
|
<b-alert
|
||||||
|
:show="dataAlert.dismissCountDown"
|
||||||
|
dismissible
|
||||||
|
:variant="dataAlert.variant"
|
||||||
|
@dismissed="dataAlert.dismissCountDown = 0"
|
||||||
|
@dismiss-count-down="countDownChanged"
|
||||||
|
>
|
||||||
|
{{ dataAlert.message }}
|
||||||
|
</b-alert>
|
||||||
<button-fleft :data="newCase"></button-fleft>
|
<button-fleft :data="newCase"></button-fleft>
|
||||||
<MyCasesFilter
|
<MyCasesFilter
|
||||||
:filters="filters"
|
:filters="filters"
|
||||||
@@ -75,6 +84,12 @@ export default {
|
|||||||
props: ["filters"],
|
props: ["filters"],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
dataAlert: {
|
||||||
|
dismissSecs: 5,
|
||||||
|
dismissCountDown: 0,
|
||||||
|
message: "",
|
||||||
|
variant: "info"
|
||||||
|
},
|
||||||
metrics: [],
|
metrics: [],
|
||||||
title: this.$i18n.t('ID_MY_CASES'),
|
title: this.$i18n.t('ID_MY_CASES'),
|
||||||
filter: "CASES_INBOX",
|
filter: "CASES_INBOX",
|
||||||
@@ -466,7 +481,25 @@ export default {
|
|||||||
*/
|
*/
|
||||||
onPostNotes() {
|
onPostNotes() {
|
||||||
this.$refs["vueTable"].getData();
|
this.$refs["vueTable"].getData();
|
||||||
}
|
},
|
||||||
|
/**
|
||||||
|
* 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;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
@@ -477,4 +510,4 @@ export default {
|
|||||||
padding-left: 50px;
|
padding-left: 50px;
|
||||||
padding-right: 50px;
|
padding-right: 50px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -52,6 +52,7 @@ export default {
|
|||||||
mounted() {},
|
mounted() {},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
permission: true,
|
||||||
dataAlert: {
|
dataAlert: {
|
||||||
dismissSecs: 5,
|
dismissSecs: 5,
|
||||||
dismissCountDown: 0,
|
dismissCountDown: 0,
|
||||||
@@ -114,18 +115,33 @@ export default {
|
|||||||
return "btn v-btn-request " + cls;
|
return "btn v-btn-request " + cls;
|
||||||
},
|
},
|
||||||
show() {
|
show() {
|
||||||
this.getCasesNotes();
|
let that = this;
|
||||||
this.$refs["modal-comments"].show();
|
//Clean the data attached documents for ever
|
||||||
|
this.dataAttachedDocuments.items = [];
|
||||||
|
this.getCasesNotes((response) => {
|
||||||
|
if (that.permission) {
|
||||||
|
that.$refs["modal-comments"].show();
|
||||||
|
} else {
|
||||||
|
that.$parent.showAlert(
|
||||||
|
that.$i18n.t("ID_CASES_NOTES_NO_PERMISSIONS"),
|
||||||
|
"danger"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
},
|
},
|
||||||
cancel() {
|
cancel() {
|
||||||
this.$refs["modal-comments"].hide();
|
this.$refs["modal-comments"].hide();
|
||||||
},
|
},
|
||||||
getCasesNotes() {
|
getCasesNotes(callback) {
|
||||||
let that = this;
|
let that = this;
|
||||||
Api.cases
|
Api.cases
|
||||||
.casenotes(this.dataCase)
|
.casenotes(this.dataCase)
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
that.formatResponseCaseNotes(response.data.notes);
|
that.formatResponseCaseNotes(response.data.notes);
|
||||||
|
that.permission = response.data.noPerms == 1 ? false : true;
|
||||||
|
if (_.isFunction(callback)) {
|
||||||
|
callback(response);
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
throw new Error(err);
|
throw new Error(err);
|
||||||
@@ -138,6 +154,7 @@ export default {
|
|||||||
let that = this,
|
let that = this,
|
||||||
notesArray = [];
|
notesArray = [];
|
||||||
_.each(notes, (n) => {
|
_.each(notes, (n) => {
|
||||||
|
n.id = _.random(1000000);
|
||||||
notesArray.push({
|
notesArray.push({
|
||||||
user: that.nameFormatCases(
|
user: that.nameFormatCases(
|
||||||
n.USR_FIRSTNAME,
|
n.USR_FIRSTNAME,
|
||||||
@@ -154,6 +171,7 @@ export default {
|
|||||||
},
|
},
|
||||||
dropFiles(files) {
|
dropFiles(files) {
|
||||||
this.attachDocuments = true;
|
this.attachDocuments = true;
|
||||||
|
this.dataAttachedDocuments.items = [];
|
||||||
this.dataAttachedDocuments.items = files;
|
this.dataAttachedDocuments.items = files;
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user