EOS/Scripts/out/files/Ticket_manageEscalation.js.html
Nidhi Bhargava f0c1ab20e1 code push
2025-09-04 16:25:07 +05:30

671 lines
24 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Ticket\manageEscalation.js</title>
<link rel="stylesheet" href="http://yui.yahooapis.com/3.9.1/build/cssgrids/cssgrids-min.css">
<link rel="stylesheet" href="../assets/vendor/prettify/prettify-min.css">
<link rel="stylesheet" href="../assets/css/main.css" id="site_styles">
<link rel="shortcut icon" type="image/png" href="../assets/favicon.png">
<script src="http://yui.yahooapis.com/combo?3.9.1/build/yui/yui-min.js"></script>
</head>
<body class="yui3-skin-sam">
<div id="doc">
<div id="hd" class="yui3-g header">
<div class="yui3-u-3-4">
<h1><img src="../assets/css/logo.png" title=""></h1>
</div>
<div class="yui3-u-1-4 version">
<em>API Docs for: </em>
</div>
</div>
<div id="bd" class="yui3-g">
<div class="yui3-u-1-4">
<div id="docs-sidebar" class="sidebar apidocs">
<div id="api-list">
<h2 class="off-left">APIs</h2>
<div id="api-tabview" class="tabview">
<ul class="tabs">
<li><a href="#api-classes">Classes</a></li>
<li><a href="#api-modules">Modules</a></li>
</ul>
<div id="api-tabview-filter">
<input type="search" id="api-filter" placeholder="Type to filter APIs">
</div>
<div id="api-tabview-panel">
<ul id="api-classes" class="apis classes">
<li><a href="../classes/CallFeedbackRating.html">CallFeedbackRating</a></li>
<li><a href="../classes/CloseTicketReport.html">CloseTicketReport</a></li>
<li><a href="../classes/ConsolidatedReport.html">ConsolidatedReport</a></li>
<li><a href="../classes/CustomerReport.html">CustomerReport</a></li>
<li><a href="../classes/DealerWiseCallDetails.html">DealerWiseCallDetails</a></li>
<li><a href="../classes/DeclinedCalls.html">DeclinedCalls</a></li>
<li><a href="../classes/DropDownData.html">DropDownData</a></li>
<li><a href="../classes/EicherPromise.html">EicherPromise</a></li>
<li><a href="../classes/EosCallCount.html">EosCallCount</a></li>
<li><a href="../classes/GeoAnalysis.html">GeoAnalysis</a></li>
<li><a href="../classes/HdBusLmdContrCallFeedbackRatingibution.html">HdBusLmdContrCallFeedbackRatingibution</a></li>
<li><a href="../classes/HdBusLmdContribution.html">HdBusLmdContribution</a></li>
<li><a href="../classes/HistoryTracking.html">HistoryTracking</a></li>
<li><a href="../classes/LiveTracking.html">LiveTracking</a></li>
<li><a href="../classes/ManageEscalation.html">ManageEscalation</a></li>
<li><a href="../classes/ManageFleet.html">ManageFleet</a></li>
<li><a href="../classes/ManageFleet_Detail.html">ManageFleet_Detail</a></li>
<li><a href="../classes/ManageFleet_details.html">ManageFleet_details</a></li>
<li><a href="../classes/ManageOwner.html">ManageOwner</a></li>
<li><a href="../classes/ManageReason.html">ManageReason</a></li>
<li><a href="../classes/ManageVechile.html">ManageVechile</a></li>
<li><a href="../classes/ManageVehicle.html">ManageVehicle</a></li>
<li><a href="../classes/NonVecvUserManagement.html">NonVecvUserManagement</a></li>
<li><a href="../classes/Notifications.html">Notifications</a></li>
<li><a href="../classes/OpenTicketReport.html">OpenTicketReport</a></li>
<li><a href="../classes/OrganizationChart.html">OrganizationChart</a></li>
<li><a href="../classes/PositioningTool.html">PositioningTool</a></li>
<li><a href="../classes/PositioningTool_Report.html">PositioningTool_Report</a></li>
<li><a href="../classes/ReasonForClosure.html">ReasonForClosure</a></li>
<li><a href="../classes/Report.html">Report</a></li>
<li><a href="../classes/ShowDealerMap.html">ShowDealerMap</a></li>
<li><a href="../classes/TicketAdministration.html">TicketAdministration</a></li>
<li><a href="../classes/TicketAdministration_FullDetail.html">TicketAdministration_FullDetail</a></li>
<li><a href="../classes/TicketFeedback.html">TicketFeedback</a></li>
<li><a href="../classes/TicketForDealer.html">TicketForDealer</a></li>
<li><a href="../classes/TicketForDealer_FullDetails.html">TicketForDealer_FullDetails</a></li>
<li><a href="../classes/TicketReassign.html">TicketReassign</a></li>
<li><a href="../classes/TileDashboard.html">TileDashboard</a></li>
<li><a href="../classes/TimeSlotClosure.html">TimeSlotClosure</a></li>
<li><a href="../classes/TollFreeAndOpportunityLoss.html">TollFreeAndOpportunityLoss</a></li>
<li><a href="../classes/VanCoverageDesigner.html">VanCoverageDesigner</a></li>
<li><a href="../classes/VecvUserManagement.html">VecvUserManagement</a></li>
</ul>
<ul id="api-modules" class="apis modules">
<li><a href="../modules/Dashboard.html">Dashboard</a></li>
<li><a href="../modules/DropDownData.html">DropDownData</a></li>
<li><a href="../modules/Geo.html">Geo</a></li>
<li><a href="../modules/Inventory.html">Inventory</a></li>
<li><a href="../modules/Notifications.html">Notifications</a></li>
<li><a href="../modules/ReportModule.html">ReportModule</a></li>
<li><a href="../modules/Ticket.html">Ticket</a></li>
<li><a href="../modules/TrackingModule.html">TrackingModule</a></li>
<li><a href="../modules/UserManagement.html">UserManagement</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="yui3-u-3-4">
<div id="api-options">
Show:
<label for="api-show-inherited">
<input type="checkbox" id="api-show-inherited" checked>
Inherited
</label>
<label for="api-show-protected">
<input type="checkbox" id="api-show-protected">
Protected
</label>
<label for="api-show-private">
<input type="checkbox" id="api-show-private">
Private
</label>
<label for="api-show-deprecated">
<input type="checkbox" id="api-show-deprecated">
Deprecated
</label>
</div>
<div class="apidocs">
<div id="docs-main">
<div class="content">
<h1 class="file-heading">File: Ticket\manageEscalation.js</h1>
<div class="file">
<pre class="code prettyprint linenums">
/*================================================================================================================\
+
+ Project : GoData-VECV
+ Filename : manageEscalation.js
+ Module Name : Ticket
+ Purpose : For Manage Escalation CRUD.
+ Coded By : Parul Gupta
+
+================================================================================================================*/
/**
* For manage escalation
* @module Ticket
*/
/**
* This class contains functions related to show escaltion details and mange CURD.
* @class ManageEscalation
* @constructor
*/
var activeRequest, activeRequest_Edit, xhr_exportReport, activeRequest_service, activeRequest_dataSource, activeRequest_dealer;
var activeRequest_Organization;
// ========================== Common function ===================================================================
/**
* Close the kendo window.
* @method closeWindow
* @param divId : Id which we want to close kendowindo.
* @for ManageEscalation
*/
function closeWindow(divId) {
$(divId).data(&quot;kendoWindow&quot;).close();
}
// ========================== End of Common function ===================================================================
//================= Escalation Details ==============================================================================
/**
* Fired when data bound to grid Escalation.
* @method onRowBoundConnectedDevice
* @for ManageEscalation
*/
function onRowBoundEscalation(e) {
// Add Edit and delete icon.
$(&#x27;.k-grid-Edit&#x27;).text(&quot;&quot;).removeClass(&quot;k-button k-button-icontext&quot;).html(&quot;&lt;span class=&#x27;k-icon k-edit&#x27;&gt;&lt;/span&gt;&quot;);
$(&#x27;.k-grid-Delete&#x27;).text(&quot;&quot;).removeClass(&quot;k-button k-button-icontext&quot;).html(&quot;&lt;span class=&#x27;k-icon k-delete&#x27;&gt;&lt;/span&gt;&quot;);
// called common file function to show title on mouse hover.
addTitleAttribute();
// show no data available message when grid has no data.
displayNoResult(e)
}
/**
* Delete escalation entry.
* @method deleteConnection
* @for ManageEscalation
*/
function deleteEscalation(e) {
// get row data on which click event fired
var dataItem = this.dataItem($(e.currentTarget).closest(&quot;tr&quot;));
jConfirm(MANAGE_ESCALATION_MESSAGES.confirmDeleteEscalation + &#x27; &lt;b&gt; &#x27; + dataItem.ManagerName + &#x27;&lt;/b&gt; ?&#x27;, &#x27;Delete&#x27;, function (result) {
//again check whether user input is true
if (result) {
//send ajax request to controller to delete connected device entry.
$.ajax({
type: &quot;POST&quot;,
url: &quot;/Ticket/DeleteEscalation/&quot;,
data: { escalationId: dataItem.Id },
success: function (data) {
if (data.success == true) {
var grid = $(&quot;#gridEscalation&quot;).data(&quot;kendoGrid&quot;);
grid.removeRow(grid.tbody.find(&quot;tr&quot;)[$(e.currentTarget).closest(&quot;tr&quot;).index()]);
//jAlert(&#x27;Escalation deleted successfully!!&#x27;, &#x27;Message&#x27;);
jAlert(MANAGE_ESCALATION_MESSAGES.escalationDeleteSuccess, &#x27;Message&#x27;);
}
else {
//alert box to show unsuccess deletion message
jAlert(MANAGE_ESCALATION_MESSAGES.escalationDeleteFailed, &#x27;Message&#x27;);
}
},
error: function (data) {
console.log(data);
}
});
}
});
}
/**
* Show escalation details to grid.
* @method showEscalationDetails
* @for ManageEscalation
*/
function showEscalationDetails(dealerId) {
console.log(dealerId);
$.post(&quot;/Ticket/ManageEscalation_Details?dealerId=&quot; + dealerId, null, function (data) {
$(&quot;#divEscalationDetails&quot;).html(data);
$(&quot;#DealerId&quot;).data(&#x27;kendoComboBox&#x27;).value(dealerId);
});
}
/**
* Get Escalation data of selected dealer from combo box.
* @method onSelectDealer
* @for ManageEscalation
*/
function onSelectDealer() {
// Get dealer id
var dealerId = $(&quot;#DealerId&quot;).data(&quot;kendoComboBox&quot;).value();
$(&quot;#divEscalationDetails&quot;).html(&#x27;&#x27;);
// check request already exist or not.
if (activeRequest_dealer &amp;&amp; activeRequest_dealer.readystate != 4) {
activeRequest_dealer.abort();
}
// Get service of dealer.
activeRequest_dealer = $.post(&quot;/Ticket/ManageEscalation_Details?dealerId=&quot; + dealerId, null, function (data) {
//$(&quot;#divEscalationDetails&quot;).html(&#x27;&#x27;);
$(&quot;#divEscalationDetails&quot;).html(data);
});
}
//================= End of Escalation Details ==============================================================================
// ========================== Create Escalation ======================================================================
/**
* This function create a popup for Create escalation.
* @method createConnection
* @for ManageEscalation
*/
function createEscalation() {
// Ajax request
if (activeRequest &amp;&amp; activeRequest.readystate != 4) {
activeRequest.abort();
}
activeRequest = $.ajax({
type: &quot;GET&quot;,
url: &quot;/Ticket/CreateEscalation&quot;,
success: function (data) {
$(&quot;#divEditEscalation&quot;).html(&#x27;&#x27;);
$(&quot;#divCreateEscalation&quot;).html(&#x27;&#x27;);
$(&quot;#divCreateEscalation&quot;).html(data);
//open form in new dialog box
$(&quot;#divCreateEscalation&quot;).data(&quot;kendoWindow&quot;).open();
openKendoWindowInCenter(&quot;#divCreateEscalation&quot;);
},
error: function (data) {
console.log(data);
}
});
}
/**
* Function To bind vehicle product variant list
* @method bindVehicleProductVariant
* @for ManageEscalation
*/
function bindVehicleProductVariant() {
// empty data source dropdown.
$(&quot;#ddVehicleType&quot;).text(&quot;&quot;);
// by default add select text.
$(&quot;#ddVehicleType&quot;).append($(&#x27;&lt;option&gt;&lt;/option&gt;&#x27;).val(&quot;&quot;).html(&quot;-Select-&quot;));
// add data to dropdown.
if (vehicleProductVariantList) {
//console.log(&#x27;v p v&#x27;);
for (var counter = 0; counter &lt; vehicleProductVariantList.length; counter++) {
$(&quot;#ddVehicleType&quot;).append($(&#x27;&lt;option&gt;&lt;/option&gt;&#x27;).val(vehicleProductVariantList[counter].Value).html(vehicleProductVariantList[counter].Text));
}
}
}
/**
* Function To bind Manager Level list
* @method bindManagerLevel
* @for ManageEscalation
*/
function bindManagerLevel() {
// empty data source dropdown.
$(&quot;#ddManagerLevel&quot;).text(&quot;&quot;);
// by default add select text.
$(&quot;#ddManagerLevel&quot;).append($(&#x27;&lt;option&gt;&lt;/option&gt;&#x27;).val(&quot;&quot;).html(&quot;-Select-&quot;));
// add data to dropdown.
if (managerLevelListForEscalation) {
for (var counter = 0; counter &lt; managerLevelListForEscalation.length; counter++) {
$(&quot;#ddManagerLevel&quot;).append($(&#x27;&lt;option&gt;&lt;/option&gt;&#x27;).val(managerLevelListForEscalation[counter].Value).html(managerLevelListForEscalation[counter].Text));
}
}
}
/**
* Fired when change in State list.
* @method onChangeState
* @for ManageEscalation
*/
function onChangeState() {
// get device id and service id.
var stateId = $(&quot;#ddStateList&quot;).val();
$(&quot;#stateName&quot;).val($(&#x27;#ddStateList&#x27;).find(&#x27;option:selected&#x27;).text());
// ajax request which load data sources.
if (activeRequest_dataSource &amp;&amp; activeRequest_dataSource.readystate != 4) {
activeRequest_dataSource.abort();
}
activeRequest_dataSource = $.ajax({
type: &quot;GET&quot;,
url: &quot;/Ticket_CustomerInventory/showCityStateWise&quot;,
data: { stateVal: stateId },
success: function (data) {
// empty data source dropdown.
$(&quot;#ddCityList&quot;).text(&quot;&quot;);
// by default add select text.
$(&quot;#ddCityList&quot;).append($(&#x27;&lt;option&gt;&lt;/option&gt;&#x27;).val(&quot;&quot;).html(&quot;-Select-&quot;));
// add data to dropdown.
if (data.list) {
for (var counter = 0; counter &lt; data.list.length; counter++) {
$(&quot;#ddCityList&quot;).append($(&#x27;&lt;option&gt;&lt;/option&gt;&#x27;).val(data.list[counter].Value).html(data.list[counter].Text));
}
}
},
error: function (data) {
console.log(data);
}
});
}
/**
* Fired when change on Organization.
* @method onChangeOrganization
* @for ManageEscalation
*/
function onChangeOrganization() {
// get organization id.
var organizationId = $(&quot;#ddOrganization&quot;).val();
$(&quot;#regionName&quot;).val($(&#x27;#ddOrganization&#x27;).find(&#x27;option:selected&#x27;).text());
// ajax request for get Device list based on organization id.
if (activeRequest_Organization &amp;&amp; activeRequest_Organization.readystate != 4) {
activeRequest_Organization.abort();
}
activeRequest_Organization = $.ajax({
type: &quot;GET&quot;,
url: &quot;/Ticket/GetDealerListOrganizationWise&quot;,
data: { organizationId: organizationId },
success: function (data) {
// empty Dealer dropdown.
$(&quot;#ddDealerName&quot;).data(&quot;kendoComboBox&quot;).value(&quot;&quot;);
// add data to dropdown.
if (data.list) {
if (data.list.length &gt; 0) {
$(&quot;#ddDealerName&quot;).kendoComboBox({
dataTextField: &quot;Text&quot;,
dataValueField: &quot;Value&quot;,
filter: &quot;contains&quot;,
dataSource: data.list
});
}
else {
$(&quot;#ddDealerName&quot;).kendoComboBox({
dataTextField: &quot;&quot;,
dataValueField: &quot;&quot;,
filter: &quot;contains&quot;,
dataSource: &quot;&quot;
});
}
}
},
error: function (data) {
console.log(data);
}
});
}
/**
* Called when submit button clicked on Create Escation and Edit escalation form.
* and Validate create escalation form.
* @method onBeginCreateEscalation
* @for ManageEscalation
*/
function onBeginCreateEscalation() {
// get length of chech box values and email/phone numbers
var chkEmail = $(&quot;#chkEmail&quot;).is(&#x27;:checked&#x27;);
var chkSMS = $(&quot;#chkSms&quot;).is(&#x27;:checked&#x27;);
var emailFieldval = $(&quot;#Emails&quot;).val();
var phoneNoFieldval = $(&quot;#Phones&quot;).val();
// Hide error message for Email and phone number.
$(&quot;#spanEmail&quot;).hide();
$(&quot;#spanPhoneNo&quot;).hide();
if (chkEmail == false &amp;&amp; chkSMS == false) {
$(&quot;#spanNotificationType&quot;).show();
return false;
}
else {
$(&quot;#spanNotificationType&quot;).hide();
}
// If both email and sms required
if (chkEmail == true &amp;&amp; chkSMS == true) {
if (emailFieldval == &quot;&quot; &amp;&amp; phoneNoFieldval == &quot;&quot;) {
$(&quot;#spanEmail&quot;).show(); $(&quot;#spanPhoneNo&quot;).show();
return false;
}
else {
$(&quot;#spanEmail&quot;).hide(); $(&quot;#spanPhoneNo&quot;).hide();
}
}
// if only mail required
if (chkEmail == true) {
if (emailFieldval == &quot;&quot;) {
$(&quot;#spanEmail&quot;).show(); $(&quot;#spanPhoneNo&quot;).hide();
return false;
}
else {
$(&quot;#spanEmail&quot;).hide(); $(&quot;#spanPhoneNo&quot;).hide();
}
}
// if only SMS required
if (chkSMS == true) {
if (phoneNoFieldval == &quot;&quot;) {
$(&quot;#spanPhoneNo&quot;).show(); $(&quot;#spanEmail&quot;).hide();
return false;
}
else {
$(&quot;#spanPhoneNo&quot;).hide(); $(&quot;#spanEmail&quot;).hide();
}
}
}
/**
* Called when escalation added successfully.
* In case of success close popup otherwise show error message.
* @method onSuccessEscalation
* @for ManageEscalation
*/
function onSuccessEscalation(result) {
if (result.success == true) {
// close popup for create escalation
closeWindow(&quot;#divCreateEscalation&quot;);
jAlert(&#x27;Escalation added successfully!!!&#x27;, &#x27;message&#x27;);
// show updated escalation details
showEscalationDetails(result.dealerId);
}
else {
//jAlert(&#x27;This escalation already exist!!!.&#x27;, &#x27;message&#x27;);
jAlert(MANAGE_ESCALATION_MESSAGES.escalationAlreadyExist, &#x27;message&#x27;);
}
}
// ========================== Edit Escalation ======================================================================
/**
* Open edit escalation popup window.
* @method editEscalation
* @for ManageEscalation
*/
function editEscalation(e) {
// Get selected row
var dataItem = this.dataItem($(e.currentTarget).closest(&quot;tr&quot;));
console.log(dataItem);
var escalationId = dataItem.Id;
// Ajax request for edit ; if exist then kill it.
if (activeRequest_Edit &amp;&amp; activeRequest_Edit.readystate != 4) {
activeRequest_Edit.abort();
}
activeRequest_Edit = $.ajax({
type: &quot;POST&quot;,
url: &quot;/Ticket/EditEscalation&quot;,
data: { escalationId: escalationId },
success: function (data) {
$(&quot;#divCreateEscalation&quot;).html(&#x27;&#x27;);
$(&quot;#divEditEscalation&quot;).html(&#x27;&#x27;);
$(&quot;#divEditEscalation&quot;).html(data);
//open form in new dialog box
$(&quot;#divEditEscalation&quot;).data(&quot;kendoWindow&quot;).open();
openKendoWindowInCenter(&quot;#divEditEscalation&quot;);
},
error: function (data) {
console.log(data);
}
});
}
/**
* Called after updation of Edit escalation form.
* Update Details form.
* @method onSuccessEditEscalation
* @for ManageEscalation
*/
function onSuccessEditEscalation(result) {
if (result.success == true) {
closeWindow(&quot;#divEditEscalation&quot;);
jAlert(&#x27;Escalation updated successfully!!!&#x27;, &#x27;message&#x27;);
showEscalationDetails(result.dealerId);
}
else if (result.success == &quot;error&quot;) {
jAlert(MANAGE_ESCALATION_MESSAGES.errorInEditEscalation, &#x27;Message&#x27;);
}
else {
jAlert(MANAGE_ESCALATION_MESSAGES.exceptionInEditEscalation, &#x27;Message&#x27;);
}
}
// ========================== End of Edit Escalation ======================================================================
/**
* Export all devices in excel form.
* @method exportToExcel
* @for ManageEscalation
*/
function exportToExcel() {
// check request already exist or not.
if (xhr_exportReport &amp;&amp; xhr_exportReport.readystate != 4) {
xhr_exportReport.abort();
}
xhr_exportReport = $.post(&quot;/Ticket/ManageEscalation_ExportToExcel&quot;, function (data) {
window.location.href = data;
});
}
//========================== document ready=======================
/**
* To do some initial functionality on page when Document is ready.
* @event document.ready
* @for ManageEscalation
*/
$(document).ready(function () {
addKendoWindow(&quot;#divCreateEscalation&quot;, &quot;Create Escalation&quot;, &quot;1000px&quot;, 340, 180);
addKendoWindow(&quot;#divEditEscalation&quot;, &quot;Edit Escalation&quot;, &quot;1000px&quot;, 340, 180);
$(&quot;#divCreateEscalation&quot;).parent().addClass(&quot;ManageEscalation_Window&quot;);
$(&quot;#divEditEscalation&quot;).parent().addClass(&quot;ManageEscalation_Window&quot;);
onSelectDealer();
});
</pre>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="../assets/vendor/prettify/prettify-min.js"></script>
<script>prettyPrint();</script>
<script src="../assets/js/yui-prettify.js"></script>
<script src="../assets/../api.js"></script>
<script src="../assets/js/api-filter.js"></script>
<script src="../assets/js/api-list.js"></script>
<script src="../assets/js/api-search.js"></script>
<script src="../assets/js/apidocs.js"></script>
</body>
</html>