This commit is contained in:
2023-05-25 12:33:00 +05:30
parent 60ea1797f1
commit 3c8f09f209
56 ha cambiato i file con 8654 aggiunte e 0 eliminazioni
+79
Vedi File
@@ -0,0 +1,79 @@
function supportTicketMain() {
// https://qa.anwisystems.com/apis/v4/anwisystems/integrations/products/getticket/contactid/{contactid}
let cookieRes = COOKIE_HELPER_ACTIONS.getCookie();
let { userId } = cookieRes;
init()
function init() {
getTickets();
};
async function getTickets() {
let res = await API_SERVICES_ACTIONS.getAPIService(`apis/v4/anwisystems/integrations/products/getticket/contactid/${userId}`);
if (res.isError) {
toasterHelper("error", res.errorMsg);
return;
}
res = JSON.parse(res.response.result);
if (!res.length) {
$('.nosupportticket').removeClass('d-none');
$('.headersupportlist').addClass('d-none');
return;
} else {
$('.nosupportticket').addClass('d-none');
$('.headersupportlist').removeClass('d-none');
}
let supportHTMLTicketList = '';
debugger
for (let i = 0; i < res.length; i++) {
supportHTMLTicketList += getTicketHTML(res[i]);
}
$('.support-list-container').html(supportHTMLTicketList);
console.log(res, "support");
}
function getTicketHTML(ticket) {
let color = '';
let prioityName = ticket[`Priority Name`];
if (prioityName.toLowerCase() === 'low') {
color = 'info';
} else if (prioityName.toLowerCase() === 'high') {
color = 'danger';
} else {
color = 'warning';
}
//<a href="#" data-bs-toggle="modal" data-bs-target="#supportmodalticket" class="supportlistview d-block
return `<a href="supportticket.html?ticketno=${ticket[`ticketno`]}" class="supportlistview d-block bg-gradient-anwi-outline btn-sm btn "><div class="p-2"><div class="card p-2">
<div class="row ">
<div class="col-sm-3">
${ticket[`Raised Date`]}
</div>
<div class="col-sm-3">
${ticket[`ticketno`]}
</div>
<div class="col-sm-3 text-center">
${ticket[`Stage Name`]}
</div>
<div class="col-sm-3 text-center">
<span class="badge badge-${color} text-bg-${color}">${prioityName}</span>
</div>
</div>
</div></div> </a>`;
}
}