Interface SAV
This commit is contained in:
@@ -63,9 +63,9 @@ onMounted(async () => {
|
|||||||
|
|
||||||
<Modal :show="showModal" :hide="hideModal" class="modal-xl messenger">
|
<Modal :show="showModal" :hide="hideModal" class="modal-xl messenger">
|
||||||
<template v-slot:modal-title>
|
<template v-slot:modal-title>
|
||||||
<h2 v-if="idTicket !== 0">Fiche n° {{ idTicket }} - {{ currentTicket.first_name }}
|
<h2 v-if="idTicket !== 0">Fiche n° {{ currentTicket.code }} - {{ currentTicket.first_name }}
|
||||||
{{ currentTicket.last_name }}</h2>
|
{{ currentTicket.last_name }}</h2>
|
||||||
<button v-if="idTicket !==0 && currentTicket.advisor_name === ''" class="btn btn-primary float-end">S'attribuer la fiche</button>
|
<!--<button v-if="idTicket !==0 && currentTicket.advisor_name === ''" class="btn btn-primary float-end">S'attribuer la fiche</button>-->
|
||||||
</template>
|
</template>
|
||||||
<template v-slot:modal-body>
|
<template v-slot:modal-body>
|
||||||
<Messenger :key="showModal" v-if="showModal"></Messenger>
|
<Messenger :key="showModal" v-if="showModal"></Messenger>
|
||||||
@@ -153,7 +153,7 @@ onMounted(async () => {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="tab-pane show active" id="new" role="tabpanel" tabindex="0">
|
<div class="tab-pane show active" id="new" role="tabpanel" tabindex="0">
|
||||||
<ticket-list :rows="mapListOfTickets(newTickets)"
|
<ticket-list :rows="(apiCounter >0) ? mapListOfTickets(newTickets) : waitingPromise"
|
||||||
:key="'new_'+originFilter+'_'+apiCounter"></ticket-list>
|
:key="'new_'+originFilter+'_'+apiCounter"></ticket-list>
|
||||||
</div>
|
</div>
|
||||||
<div class="tab-pane" id="pending" role="tabpanel" tabindex="0">
|
<div class="tab-pane" id="pending" role="tabpanel" tabindex="0">
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
|
import TicketApi from "@/services/TicketApi.js";
|
||||||
import {onMounted, ref, watch} from 'vue';
|
import {onMounted, ref, watch} from 'vue';
|
||||||
import {showModal, hideModal} from "@/setup/global.js";
|
import {showModal, hideModal} from "@/setup/global.js";
|
||||||
import {useTicketStore} from "@/stores/ticket";
|
import {useTicketStore} from "@/stores/ticket";
|
||||||
@@ -55,11 +56,19 @@ const grid = new Grid({
|
|||||||
{
|
{
|
||||||
name: 'Attribuer à',
|
name: 'Attribuer à',
|
||||||
formatter: (cell, row) => {
|
formatter: (cell, row) => {
|
||||||
|
|
||||||
if (cell !== '0') {
|
if (cell !== '0') {
|
||||||
return row.cells[4].data.advisor_name
|
return row.cells[4].data.advisor_name
|
||||||
} else {
|
}
|
||||||
return html('<a href="#" style="text-decoration: none" onclick="$(\'#11\').css({\'left\':\'0\',\'display\':\'block\',\'z-index\':\'1\'});window.location=\'#\';Affaire(\'11\',\'0\',\'' + row.cells[4].data.id_last_event + '\',\'' + row.cells[4].data.id + '\',\'4\',\'see\')"<i class="fa-solid fa-hand-point-down"></i></a>')
|
else {
|
||||||
|
|
||||||
|
return h('i', {
|
||||||
|
className: 'fas fa-hand-point-down cursor-pointer text-primary',
|
||||||
|
onClick: async () => {
|
||||||
|
await TicketApi.setAssignment(row.cells[4].data.code, row.cells[4].data.id)
|
||||||
|
showModal.value++;
|
||||||
|
storeTicket.setIdTicket(row.cells[4].data.id)
|
||||||
|
} // id_last_event
|
||||||
|
}, );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -45,6 +45,21 @@ export default {
|
|||||||
|
|
||||||
return response.json();
|
return response.json();
|
||||||
},
|
},
|
||||||
|
async setAssignment(code, id) {
|
||||||
|
const apiUrl = '/App/api.php?prj=pharmamp&controller=TicketingController&method=setTicketAssignment&code_business=' + code + '&id_business=' + id
|
||||||
|
|
||||||
|
if (import.meta.env.DEV) {
|
||||||
|
console.log(apiUrl)
|
||||||
|
}
|
||||||
|
|
||||||
|
const response = await fetch(apiUrl)
|
||||||
|
|
||||||
|
if (import.meta.env.DEV) {
|
||||||
|
console.log(response.clone().text())
|
||||||
|
}
|
||||||
|
|
||||||
|
return response.json();
|
||||||
|
},
|
||||||
async saveMessage(code, id, quill, attachedDoc, replyOption) {
|
async saveMessage(code, id, quill, attachedDoc, replyOption) {
|
||||||
const apiUrl = '/App/api.php?prj=pharmamp&controller=TicketingController&method=saveMessage'
|
const apiUrl = '/App/api.php?prj=pharmamp&controller=TicketingController&method=saveMessage'
|
||||||
if (import.meta.env.DEV) {
|
if (import.meta.env.DEV) {
|
||||||
|
|||||||
Reference in New Issue
Block a user