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

596 lines
23 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Inventory\ManageFleet_Detail.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: Inventory\ManageFleet_Detail.js</h1>
<div class="file">
<pre class="code prettyprint linenums">
/**
* To Manage Fleet
* @module Inventory
*/
/**
* This class contains functions related to show device details and their state (Operational/Non-operational/Disabled/Archive/All&quot;)
* @class ManageFleet_details
* @constructor
*/
//Global variables
var activeRequest_Edit;
var vRegNo = &quot;&quot;;
var ConfirmDealerName = &quot;&quot;;
var vRowIndex = &quot;0&quot;;
/**
* Function of Binding Of Grid And set Delete Button In Vechile Grid.
* @method onRowBoundVechile
* @param {Object} e Contains Complete kendo grid property
* @for ManageFleet_Detail
*/
function onRowBoundDealer(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;);
var dataItem = this.dataItem($(e.currentTarget).closest(&quot;tr&quot;));
// called common file function to show title on mouse hover.
addTitleAttribute();
// called common file function to show title on mouse hover.
addTitleAttribute();
// severity functionality
var data = this.dataSource.view();
// Show Delete button in Grid if We add New Row And Hide Delete button in grid if Row is Already Inserted
//for (var i = 0; i &lt; data.length; i++) {
// if (data[i].VanId != &quot;&quot;) {
// $(&quot;#gridDealer&quot;).data(&quot;kendoGrid&quot;).tbody.find(&quot;tr[data-uid=&#x27;&quot; + data[i].uid + &quot;&#x27;]&quot;).find(&#x27;td&#x27;).find(&#x27;#cmdDelete&#x27;).find(&quot;span&quot;).removeClass(&quot;k-icon k-delete&quot;);
// }
// else {
// $(&quot;#gridDealer&quot;).data(&quot;kendoGrid&quot;).tbody.find(&quot;tr[data-uid=&#x27;&quot; + data[i].uid + &quot;&#x27;]&quot;).find(&#x27;td&#x27;).find(&#x27;#cmdVanLocation&#x27;).removeAttr(&quot;id&quot;);
// }
//}
// show no data available message when grid has no data.
//displayNoResultManageFleet(e)
}
/**
* Function to set the van Location.
* @method ShowVanLocation
* @param {Object} e Contains Complete Grid Selected Row Object
* @for ManageFleet_Detail
*/
function ShowVanLocation(e) {
addKendoWindowToDiv(&quot;#divShowVanLocation&quot;, &quot;Set Van Location&quot;, &quot;1000px&quot;, 250);
// Get selected row
var dataItem = this.dataItem($(e.currentTarget).closest(&quot;tr&quot;));
// Add Van Detail model
oDealer = {};
oDealer.VanId = dataItem.VanId;
oDealer.VanAlias = dataItem.VanAlias;
oDealer.VanState = dataItem.VanState;
oDealer.VanCity = dataItem.VanCity;
oDealer.VanModelName = dataItem.VanModelName;
oDealer.VanRegistrationNo = dataItem.VanRegistrationNo;
oDealer.ServiceEngineerName = dataItem.ServiceEngineerName;
oDealer.ServiceEngineerContactNumber = dataItem.ServiceEngineerContactNumber;
oDealer.ServiceEngineerApplicationLicenseKey = dataItem.ServiceEngineerApplicationLicenseKey;
oDealer.VanIsVisitedInterState = dataItem.VanIsVisitedInterState;
//// Ajax request for edit ; if exist then kill it.
if (activeRequest_Edit &amp;&amp; activeRequest_Edit.readystate != 4) {
activeRequest_Edit.abort();
}
if (dataItem.VanId == &quot;&quot;) {
//jAlert(&quot;Please First Add Van&quot;, &#x27;message&#x27;);
jAlert(MANAGE_FLEET_MESSAGES.addVanRequired, &#x27;message&#x27;);
}
else {
activeRequest_Edit = $.ajax({
type: &quot;GET&quot;,
url: &quot;/Inventory/ShowDealerVanDetail&quot;,
data: oDealer,
success: function (data) {
$(&quot;#divShowVanLocation&quot;).html(&#x27;&#x27;);
$(&quot;#divShowVanLocation&quot;).parent().addClass(&quot;responsive_popup&quot;) //addClass for respond the menu
$(&quot;#divShowVanLocation&quot;).html(data);
//open form in new dialog box
$(&quot;#divShowVanLocation&quot;).data(&quot;kendoWindow&quot;).open();
$(&quot;#btnSaveVan&quot;).prop(&#x27;value&#x27;, &#x27;Update&#x27;);
SetKendoWindowTitle(&quot;#divShowVanLocation&quot;, &quot;Set Van Location&quot;);
},
error: function (data) {
console.log(data);
}
});
}
// Add Van Detail model
}
/**
* Function to Update the Van Detail.
* @method editDealer
* @param {Object} e Contains Complete Grid Selected Row Object
* @for ManageFleet_Detail
*/
function editDealer(e) {
addKendoWindowToDiv(&quot;#divCreateDealer&quot;, &quot;Edit Van Detail&quot;, &quot;833px&quot;, 385);
// Get selected row
var dataItem = this.dataItem($(e.currentTarget).closest(&quot;tr&quot;));
vSelectedRow = this.dataItem($(e.currentTarget).closest(&quot;tr&quot;));
vDealerContactNoOnFocus = $(&quot;#DealerContactNo&quot;).val();
// Add Van Detail model
oDealer = {};
oDealer.VanId = dataItem.VanId;
oDealer.VanAlias = dataItem.VanAlias;
oDealer.VanState = dataItem.VanState;
oDealer.VanCity = dataItem.VanCity;
oDealer.VanModelName = dataItem.VanModelName;
oDealer.VanRegistrationNo = dataItem.VanRegistrationNo;
oDealer.ServiceEngineerName = dataItem.ServiceEngineerName;
oDealer.ServiceEngineerContactNumber = dataItem.ServiceEngineerContactNumber;
oDealer.ServiceEngineerApplicationLicenseKey = dataItem.ServiceEngineerApplicationLicenseKey;
oDealer.VanIsVisitedInterState = dataItem.VanIsVisitedInterState;
//// Ajax request for edit ; if exist then kill it.
if (activeRequest_Edit &amp;&amp; activeRequest_Edit.readystate != 4) {
activeRequest_Edit.abort();
}
$(&quot;#div_load&quot;).show();
activeRequest_Edit = $.ajax({
type: &quot;GET&quot;,
url: &quot;/Inventory/AddorEditVanDetail&quot;,
data: oDealer,
success: function (data) {
$(&quot;#divCreateDealer&quot;).html(&#x27;&#x27;);
$(&quot;#divCreateDealer&quot;).html(data);
//open form in new dialog box
$(&quot;#divCreateDealer&quot;).data(&quot;kendoWindow&quot;).open();
$(&quot;#btnSaveVan&quot;).prop(&#x27;value&#x27;, &#x27;Update&#x27;);
SetKendoWindowTitle(&quot;#divCreateDealer&quot;, &quot;Edit Van Detail&quot;);
$(&quot;#divShowVanLocation&quot;).html(&quot;&quot;);
//LoadCityListOnDealer(0);
LoadCityListForVan($(&quot;#ddState option:selected&quot;).val(), dataItem.VanCity);
vRegistrationNoOnFocus = dataItem.VanRegistrationNo;
//The Registration No is added till it is not inserted in DB
//if (dataItem.VanId == &quot;&quot;) {
// $(&#x27;#VanRegistrationNo&#x27;).attr(&#x27;readonly&#x27;, false);
//}
//else {
// $(&#x27;#VanRegistrationNo&#x27;).attr(&#x27;readonly&#x27;, true);
//}
//$(&#x27;#VanModelName&#x27;).attr(&#x27;readonly&#x27;, true);
vRegNo = $(&#x27;#VanRegistrationNo&#x27;).val();
HideVanDetailMessage();
},
error: function (data) {
console.log(data);
}, complete: function () {
$(&quot;#div_load&quot;).hide();
}
});
// Add Van Detail model
}
/**
* This function is used to Delete Van Detail In Grid.
* @method DeleteDealer
* @param {Object} e Contains Complete Grid Selected Row Object
* @for ManageFleet_Detail
*/
function DeleteDealer(e) {
var dataItem = this.dataItem($(e.currentTarget).closest(&quot;tr&quot;));
var grid = $(&quot;#gridDealer&quot;).data(&quot;kendoGrid&quot;);
datasource = grid.dataSource;
//jConfirm(&quot;Do you want to delete the Van Name &lt;b&gt;&quot; + dataItem.VanAlias + &#x27;&lt;/b&gt; ?&#x27;, &#x27;Delete&#x27;, function (result) {
jConfirm(MANAGE_FLEET_MESSAGES.confirmDeleteVan + &quot; &lt;b&gt;&quot; + dataItem.VanAlias + &#x27;&lt;/b&gt; ?&#x27;, &#x27;Delete&#x27;, function (result) {
if (result) {
dataItem.IsDeletedVan = true;
if (dataItem.VanId == &quot;&quot;)
datasource.remove(dataItem);
else {
$(e.currentTarget).closest(&quot;tr&quot;).hide();
for (var i = 0; i &lt;= datasource.total() - 1; i++) {
var datasourceItem = datasource.at(i);
if (dataItem.VanId === datasourceItem.VanId) {
datasourceItem.set(&quot;IsDeletedVan&quot;, true);
}
}
}
}
});
}
/**
* Function to show Dealer details.
* @method AddOrEditFleet
* @for ManageFleet_Detail
*/
function showDealerDetails() {
//function call on click of Dealer list table&#x27;s row
$(&quot;#tableDealerList tbody tr&quot;).click(function (e) {
var dealerId, $this;
$this = $(this);
console.log($this);
dealerId = e.currentTarget.id;
vRowIndex = e.currentTarget.rowIndex;
//Add button hide show
$(&quot;#btnAdd,#btnDelete&quot;).show();
// add selected class on selected row
$(&#x27;#tableDealerList &gt; tbody &gt; tr&#x27;).removeClass(&quot;SelectedRow&quot;);
$this.addClass(&quot;SelectedRow&quot;);
// ajax request to get non-vecv user detail
if (activeRequest_UserDetails &amp;&amp; activeRequest_UserDetails.readystate != 4) {
activeRequest_UserDetails.abort();
}
GetDealerDetailByID(dealerId);
});
}
/**
* This function is used to Delete Van Detail In Grid.
* @method GetDealerDetailByID
* @param {String} dealerID Dealer Id that is used to Get the Detail.
* @for ManageFleet_Detail
*/
function GetDealerDetailByID(dealerID) {
$(&quot;#div_load&quot;).show();
activeRequest_UserDetails = $.ajax({
type: &quot;POST&quot;,
url: &quot;/Inventory/AddOrEditFleet/&quot;,
data: { sDealerId: dealerID },
success: function (data) {
$(&quot;#divAddOrEditFleet&quot;).html(&#x27;&#x27;);
$(&quot;#divAddOrEditFleet&quot;).html(data);
stateVal = $(&quot;#ddState&quot;).val();
LoadCityList(stateVal);
//$(&quot;#ddOrganization&quot;).hide();
//$(&quot;#ddState&quot;).hide();
//$(&quot;#ddCity&quot;).hide();
//$(&quot;#DealerOrganizationName&quot;).show();
//$(&quot;#DealerStateName&quot;).show();
//$(&quot;#DealerCity&quot;).show();
vDealerContactNoOnFocus = $(&quot;#DealerContactNo&quot;).val();
HideDealerDetailMessage();
HideVanDetailMessage();
$(&quot;#btnSaveFleet&quot;).prop(&#x27;value&#x27;, &#x27;Update&#x27;);
ConfirmDealerName = $(&quot;#DealerDealerName&quot;).val();
$(&quot;#NewDealerId&quot;).prop(&#x27;readonly&#x27;, true);
},
complete: function () {
$(&quot;#div_load&quot;).hide();
},
error: function (data) {
console.log(data);
}
});
}
/**
* This Function to Hide the dealer Validation Messages.
* @method HideDealerDetailMessage
* @for ManageFleet_Detail
*/
function HideDealerDetailMessage() {
$(&quot;#spnDealerId&quot;).hide();
$(&quot;#spnOrganizationId&quot;).hide();
$(&quot;#spnDealerName&quot;).hide();
$(&quot;#spnDealerState&quot;).hide();
$(&quot;#spnDealerCity&quot;).hide();
$(&quot;#spnDealerContactNo&quot;).hide();
$(&quot;#spnDealerContactNo&quot;).html(&quot;&quot;);
}
/**
* This function is Used to Hide The Validation Message For Dealer Van Detail.
* @method HideVanDetailMessage
* @for ManageFleet_Detail
*/
function HideVanDetailMessage() {
$(&quot;#spnVanName&quot;).hide();
$(&quot;#spnVanState&quot;).hide();
$(&quot;#spanVanCity&quot;).hide();
$(&quot;#spanVanModelName&quot;).hide();
$(&quot;#spanVanRegistration&quot;).hide();
$(&quot;#spanVanServiceEngineerName&quot;).hide();
$(&quot;#spanVanServiceEngineerContactNo&quot;).hide();
$(&quot;#spnDealerContactNo&quot;).html(&quot;&quot;);
}
/**
* This function is Used to See Or Set The Van Location.
* @method HideVanDetailMessage
* @for ManageFleet_Detail
*/
function SetDealerLocation() {
if (AllValidAddVanDetail()) {
addKendoWindowToDiv(&quot;#divShowDealerLocation&quot;, &quot;Set Dealer Location&quot;, &quot;833px&quot;, 435);
$(&quot;#divShowDealerLocation&quot;).parent().addClass(&quot;responsive_popup&quot;) //addClass for respond the menu
// Get selected row
if (activeRequest_Edit &amp;&amp; activeRequest_Edit.readystate != 4) {
activeRequest_Edit.abort();
}
activeRequest_Edit = $.ajax({
type: &quot;GET&quot;,
url: &quot;/Inventory/ShowDealerMap&quot;,
success: function (data) {
$(&quot;#divShowDealerLocation&quot;).html(&#x27;&#x27;);
$(&quot;#divShowDealerLocation&quot;).html(data);
//open form in new dialog box
$(&quot;#divShowDealerLocation&quot;).data(&quot;kendoWindow&quot;).open();
SetKendoWindowTitle(&quot;#divShowDealerLocation&quot;, &quot;Set Dealer Location&quot;);
},
error: function (data) {
console.log(data);
}
});
}
// Add Van Detail model
//$(&quot;#divCreateDealer&quot;).parent().addClass(&quot;responsive_popup&quot;)
}
/**
* This function is Used to Check Whether the keypress No is Entered or Not.
* @method isNumber
* @param {Object} e Get Event Detail
* @param {Object} t Get Textbox Detail
* @for ManageFleet_Detail
*/
function isNumber(e, t) {
try {
if (window.event) {
var charCode = window.event.keyCode;
}
else if (e) {
var charCode = e.which;
}
else { return true; }
if (charCode &gt; 31 &amp;&amp; (charCode &lt; 48 || charCode &gt; 57)) {
return false;
}
return true;
}
catch (err) {
alert(err.Description);
}
}
/**
* This function is Used to Hide The Validation Message For Add Van Detail.
* @method AllValidAddVanDetail
* @for ManageFleet_Detail
*/
function AllValidAddVanDetail() {
HideDealerDetailMessage();
var DealerState = $(&quot;#ddState option:selected&quot;).val();
var DealerCity = $(&quot;#ddCity option:selected&quot;).val();
var vResult = false;
if (DealerState == &quot;&quot;)
$(&quot;#spnDealerState&quot;).show();
else if (DealerCity == &quot;&quot; || DealerCity == &quot;-Select-&quot;)
$(&quot;#spnDealerCity&quot;).show();
else if (vDealerContactExist == true)
jAlert(vDealerContactNoExistMsg, &#x27;message&#x27;);
else
vResult = true;
return vResult;
}
</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>