This commit is contained in:
2023-05-30 17:34:56 +08:00
parent e728c66786
commit 9da1c4cf30
194 changed files with 10680 additions and 9060 deletions

View File

@ -302,7 +302,6 @@
function devicerequest(method, param, callback, error) {
_network.request("MachineDeviceManagement/ManageMachines.aspx", -1, method, param, callback, error || function (e) {
console.log(e);
showmaskbg(false, true);
showAlert('An unknown error occurred. Please refresh page.', 'Query');
});
}
@ -622,9 +621,9 @@
function getDeviceComments() {
var cid = $('#sel_contractor').val();
$('#mask_bg').show();
showloading(true);
devicerequest("GetDeviceComments", JSON.stringify([cid, deviceid]), function (data) {
$('#mask_bg').hide();
showloading(false);
if (typeof (data) === "string") {
return;
}
@ -637,7 +636,7 @@
}
}
}, function (err) {
$('#mask_bg').hide();
showloading(false);
});
}
@ -663,9 +662,9 @@
var cid = $('#sel_contractor').val();
var param = JSON.stringify([cid, deviceid, comment]);
param = htmlencode(param);
$('#mask_bg').show();
showloading(true);
devicerequest("AddDeviceComment", param, function (data) {
$('#mask_bg').hide();
showloading(false);
if (data !== "") {
showAlert(data, GetTextByKey("P_MD_ERROR", 'Error'));
return;
@ -673,7 +672,7 @@
$('#dialog_comments').val("");
getDeviceComments();
}, function (err) {
$('#mask_bg').hide();
showloading(false);
});
}
@ -683,9 +682,9 @@
function getDeviceInstallationNotes() {
var cid = $('#sel_contractor').val();
$('#mask_bg').show();
showloading(true);
devicerequest("GetDeviceInstallationNotes", JSON.stringify([cid, deviceid]), function (data) {
$('#mask_bg').hide();
showloading(false);
if (typeof (data) === "string") {
return;
}
@ -698,7 +697,7 @@
}
}
}, function (err) {
$('#mask_bg').hide();
showloading(false);
});
}
@ -739,7 +738,7 @@
var cid = $('#sel_contractor').val();
var param = JSON.stringify([cid, deviceid, inotes]);
$('#mask_bg').show();
showloading(true);
var formData = new FormData();
if (inImages && inImages.length > 0) {
@ -762,14 +761,14 @@
showAlert(data, alerttitle);
return;
}
$('#mask_bg').hide();
showloading(false);
$('#dialog_installationnotes').val("");
inImages = [];
$("#divINImages").empty();
getDeviceInstallationNotes();
},
error: function (err) {
$('#mask_bg').hide();
showloading(false);
}
});
}

View File

@ -444,6 +444,17 @@
var rentalChanged = false;//编辑机器时是否有修改只用于Attributes和Rental
var jobsiteinputChanged = false;//编辑机器时是否有修改只用于JobSite
function showConfirm1(msg, title, fok, fcancel) {
_dialog.showConfirm(msg, title, function (e) {
if (typeof fok === 'function') {
fok(e);
}
}, function () {
if (fcancel)
fcancel();
});
}
function devicerequest(method, param, callback, error) {
_network.request("MachineDeviceManagement/ManageMachines.aspx", -1, method, param, callback, error || function (e) {
showmaskbg(false, true);
@ -1554,7 +1565,7 @@
if (!IsSupperAdmin) {
$('#dialog_preloaded').hide();
$('#dialog_preloaded_text').hide();
}
window.onresize = resizeContent;
@ -1615,6 +1626,34 @@
$("#dialogmask").hide();
}
function showsubloading(id, flag, noanimation) {
var mask = $("#" + id);
mask.children().show();
if (noanimation) {
mask.css('display', flag ? '' : 'none');
} else {
if (flag) {
mask.fadeIn(100);
} else {
mask.fadeOut(100);
}
}
}
function showsubmask(id, flag, noanimation) {
var mask = $("#" + id);
mask.children().hide();
if (noanimation) {
mask.css('display', flag ? '' : 'none');
} else {
if (flag) {
mask.fadeIn(100);
} else {
mask.fadeOut(100);
}
}
}
function OnNext() {
OnSave(0, 0, gotoNext);
}
@ -1642,9 +1681,6 @@
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
<div id="div_content" style="min-width: 1024px;">
<div id="dialogmask" class="maskbg" style="display: none; z-index: 500;">
<div class="loading_icon icon c-spin"></div>
</div>
<div class="function_title">
<span class="sbutton iconsave" onclick="OnSave(0,0);" data-lgid="P_MA_SAVE">Save</span>
<span class="sbutton iconsave" onclick="OnSave(1,0);" data-lgid="P_MA_SAVE1">Save and Exit</span>
@ -1723,7 +1759,7 @@
<tr>
<td class="label" data-lgid="P_MA_DESCRIPTION_COLON">Description:</td>
<td>
<textarea id="dialog_description" class="inputbox" style="height: 60px;" maxlength="1000" tabindex="15"></textarea>
<textarea id="dialog_description" style="height: 60px;" maxlength="1000" tabindex="15"></textarea>
</td>
</tr>
<tr>
@ -1983,7 +2019,7 @@
<tr>
<td class="label" data-lgid="P_MA_COMMENTS_COLON">Comments:</td>
<td colspan="3">
<textarea id="dialog_comments" class="inputbox" maxlength="1000" tabindex="68" style="width: 454px; margin-top: 2px;"></textarea>
<textarea id="dialog_comments" maxlength="1000" tabindex="68" style="width: 454px; margin-top: 2px;"></textarea>
</td>
</tr>
<tr>
@ -2158,13 +2194,16 @@
</div>
</div>
</div>
<div id="dialogmask" class="maskbg" style="display: none;">
<div class="loading_icon icon c-spin"></div>
</div>
</div>
<div id="mask_bg" style="display: none;">
<div class="loading c-spin"></div>
</div>
<div class="dialog" id="dialog_adjustodometer" style="display: none; width: 960px;">
<div id="adjustodomask" class="maskbg" style="display: none; z-index: 1;"></div>
<div class="dialog-title"><span class="title" data-lgid="P_MA_ADJUSTODOMETER">Adjust Odometer</span><em class="dialog-close"></em></div>
<div class="dialog-content adjust-content">
<table style="line-height: 25px; width: 100%;">
@ -2210,7 +2249,7 @@
</tr>
<tr>
<td class="label" colspan="2">
<div id="odometermostrecent" style="height: 90px; width:920px;"></div>
<div id="odometermostrecent" style="height: 90px; width: 920px;"></div>
</td>
</tr>
<tr>
@ -2218,7 +2257,7 @@
</tr>
<tr>
<td class="label" colspan="2">
<div id="odometerhislist" style="height: 300px; width:920px;"></div>
<div id="odometerhislist" style="height: 300px; width: 920px;"></div>
</td>
</tr>
</table>
@ -2229,10 +2268,10 @@
<input type="button" onclick="OnPreviewOdometer();" value="Preview" data-lgid="P_MA_PREVIEW" tabindex="108" />
<div class="clear"></div>
</div>
<div id="adjustodomask" class="maskbg" style="display: none;"><div class="loading c-spin"></div></div>
</div>
<div class="dialog" id="dialog_adjustenginehours" style="display: none; width: 940px;">
<div id="adjustenginehoursmask" class="maskbg" style="display: none; z-index: 1;"></div>
<div class="dialog-title"><span class="title" data-lgid="P_MA_ADJUSTENGINEHOURS">Adjust EngineHours</span><em class="dialog-close"></em></div>
<div class="dialog-content adjust-content">
<table style="line-height: 25px; width: 100%;">
@ -2270,7 +2309,7 @@
</tr>
<tr>
<td class="label" colspan="2">
<div id="enginehoursmostrecent" style="height: 90px;width:920px;"></div>
<div id="enginehoursmostrecent" style="height: 90px; width: 920px;"></div>
</td>
</tr>
<tr>
@ -2278,7 +2317,7 @@
</tr>
<tr>
<td class="label" colspan="2">
<div id="enginehourshislist" style="height: 300px;width:920px;"></div>
<div id="enginehourshislist" style="height: 300px; width: 920px;"></div>
</td>
</tr>
</table>
@ -2289,6 +2328,7 @@
<input type="button" onclick="OnPreviewEngineHours();" value="Preview" data-lgid="P_MA_PREVIEW" tabindex="127" />
<div class="clear"></div>
</div>
<div id="adjustenginehoursmask" class="maskbg" style="display: none;"><div class="loading c-spin"></div></div>
</div>
@ -2312,7 +2352,6 @@
<div class="dialog" id="dialog_addodometer" style="display: none; width: 600px;">
<div id="addodomask" class="maskbg" style="display: none; z-index: 1;"></div>
<div class="dialog-title"><span class="title" data-lgid="P_MA_ADDODOMETER">Add Odometer</span><em class="dialog-close"></em></div>
<div class="dialog-content adjust-content">
<table style="line-height: 25px; width: 100%;">
@ -2360,11 +2399,11 @@
<input type="button" onclick="OnAddOdometer();" value="Submit" data-lgid="P_MA_SUBMIT" tabindex="158" />
<div class="clear"></div>
</div>
<div id="addodomask" class="maskbg" style="display: none;"><div class="loading c-spin"></div></div>
</div>
<div class="dialog" id="dialog_addenginehours" style="display: none; width: 600px;">
<div id="addenginehoursmask" class="maskbg" style="display: none; z-index: 1;"></div>
<div class="dialog-title"><span class="title" data-lgid="P_MA_ADDOENGINEHOURS">Add Engine Hours</span><em class="dialog-close"></em></div>
<div class="dialog-content adjust-content">
<table style="line-height: 28px; width: 100%;">
@ -2404,6 +2443,7 @@
<input type="button" onclick="OnAddEngineHours();" value="Submit" data-lgid="P_MA_SUBMIT" tabindex="177" />
<div class="clear"></div>
</div>
<div id="addenginehoursmask" class="maskbg" style="display: none;"><div class="loading c-spin"></div></div>
</div>
@ -2419,7 +2459,6 @@
</div>
<div class="dialog" id="dialog_addmake" style="display: none; width: 360px;">
<div id="addmakemask" class="maskbg" style="display: none; z-index: 1;"></div>
<div class="dialog-title"><span class="title" data-lgid="P_MA_ADDMAKE">Add Make</span><em class="dialog-close"></em></div>
<div class="dialog-content assetcontent">
<table>
@ -2435,10 +2474,10 @@
<input type="button" onclick="OnSaveMake();" value="OK" data-lgid="P_MA_OK" tabindex="301" />
<div class="clear"></div>
</div>
<div id="addmakemask" class="maskbg" style="display: none;"><div class="loading c-spin"></div></div>
</div>
<div class="dialog" id="dialog_addmodel" style="display: none; width: 360px;">
<div id="addmodelmask" class="maskbg" style="display: none; z-index: 1;"></div>
<div class="dialog-title"><span class="title" data-lgid="P_MA_ADDMODEL">Add Model</span><em class="dialog-close"></em></div>
<div class="dialog-content assetcontent">
<table>
@ -2467,10 +2506,10 @@
<input type="button" onclick="OnSaveModel();" value="OK" data-lgid="P_MA_OK" tabindex="404" />
<div class="clear"></div>
</div>
<div id="addmodelmask" class="maskbg" style="display: none;"><div class="loading c-spin"></div></div>
</div>
<div class="dialog" id="dialog_assetduplicates" style="display: none; min-width: 540px;">
<div id="assetdupmask" class="maskbg" style="display: none; z-index: 1;"></div>
<div class="dialog-title">
<span class="title" style="float: left;" data-lgid="P_MA_POSSIBLEDUPLICATES_COLON">Possible Duplicates:&nbsp;<span id="spnumberinfo"></span></span>
<div class="function_title" id="divDupFun" style="float: left; margin-left: 230px; display: none; line-height: 28px;">
@ -2658,10 +2697,10 @@
<input type="button" value="Ignore and Create Asset" data-lgid="P_MA_IGNOREANDCREATEASSET" onclick="OnIgnoreDuplicate();" style="width: 150px;" tabindex="500" />
<div class="clear"></div>
</div>
<div id="assetdupmask" class="maskbg" style="display: none;"><div class="loading c-spin"></div></div>
</div>
<div class="dialog" id="dialog_mergeasset" style="display: none; min-width: 540px;">
<div id="mergeassetmask" class="maskbg" style="display: none; z-index: 1;"></div>
<div class="dialog-title">
<span class="title" style="float: left;" data-lgid="P_MA_XXX">Merge Asset</span>
<em class="dialog-close"></em>
@ -2857,11 +2896,11 @@
<input type="button" value="Cancel" data-lgid="P_MA_CANCEL" class="dialog-close" tabindex="501" />
<div class="clear"></div>
</div>
<div id="mergeassetmask" class="maskbg" style="display: none;"><div class="loading c-spin"></div></div>
</div>
<div class="dialog" id="dialog_adddocument" style="display: none; width: 500px;">
<div id="adddocumentmask" class="maskbg" style="display: none; z-index: 1;"></div>
<div class="dialog-title"><span class="title" data-lgid="P_MA_ADDITIONALDOCUMENTATION">Additional Documentation</span><em class="dialog-close"></em></div>
<div class="dialog-content adjust-content">
<table style="line-height: 30px; width: 100%;">
@ -2923,5 +2962,6 @@
<input type="button" onclick="OnSaveDocument();" value="Save" data-lgid="P_MA_SAVE" tabindex="400" />
<div class="clear"></div>
</div>
<div id="adddocumentmask" class="maskbg" style="display: none;"><div class="loading c-spin"></div></div>
</div>
</asp:Content>

View File

@ -493,7 +493,6 @@
return s.Values.ID;
});
dialogAssets.showSelector();
$('#mask_bg').css('height', '100%');
}
var grid_dtsm;
@ -514,7 +513,7 @@
// checkbox
name: 'check',
key: 'selected',
width: 30,
width: 45,
align: 'center',
sortable: false,
allcheck: true,
@ -619,9 +618,6 @@
<div class="loading c-spin"></div>
</div>
<div id="div_content">
<div id="dialogmask" class="maskbg" style="display: none; z-index: 500;">
<div class="loading_icon icon c-spin"></div>
</div>
<div class="function_title">
<span class="sbutton iconsave" onclick="OnSave(0);" data-lgid="P_AG_SAVE">Save</span>
<span class="sbutton iconsave" onclick="OnSave(1);" data-lgid="P_AG_SAVE1">Save and Exit</span>
@ -635,19 +631,19 @@
<tr>
<td class="label" data-lgid="P_AG_GROUPNAME_COLON">Group Name:</td>
<td>
<input type="text" id="dialog_groupname" class="inputbox" maxlength="200" tabindex="1" style="width: 300px;" />
<input type="text" id="dialog_groupname" maxlength="200" tabindex="1" style="width: 300px;" />
</td>
</tr>
<tr>
<td class="label" style="width: 50px; text-align: right;" data-lgid="P_AG_CODE_COLON">Code:</td>
<td>
<input type="text" id="dialog_groupcode" class="inputbox" maxlength="50" tabindex="1" style="width: 300px;" />
<input type="text" id="dialog_groupcode" maxlength="50" tabindex="1" style="width: 300px;" />
</td>
</tr>
<tr>
<td class="label" data-lgid="P_AG_DESCRIPTION_COLON">Description:</td>
<td>
<textarea id="dialog_description" class="inputbox" maxlength="1000" tabindex="2" style="width: 300px"></textarea></td>
<textarea id="dialog_description" maxlength="1000" tabindex="2" style="width: 300px"></textarea></td>
</tr>
</table>
<div class="dialog-subheader">

View File

@ -538,7 +538,7 @@
<tr>
<td class="label" data-lgid="P_MR_COMMENTS_COLON">Comments:</td>
<td>
<textarea id="dialog_comments" class="inputbox" maxlength="1000" tabindex="14" style="width: 540px; height: 120px;"></textarea>
<textarea id="dialog_comments" maxlength="1000" tabindex="14" style="width: 540px; height: 120px;"></textarea>
<span id="span_a" style="margin-left: 50px;"><a href="#" onclick="OnViewChangeHistory();" data-lgid="P_MR_VIEWCHANGEHIS">View Change History</a></span>
</td>
</tr>

View File

@ -96,8 +96,6 @@
$('.content_main').css('min-height', $(window).height() - $('.content_main').offset().top - 4);
if ($('#machinesDiv').length > 0)
$('#machinesDiv').css('min-height', $(window).height() - $('#machinesDiv').offset().top - 4);
$('#mask_bg').height($(document).outerHeight(false)).width($(document).outerWidth(false));
}
$(window).resize(function () {

View File

@ -32,11 +32,6 @@
left: 150px;
}
.inputbox {
width: 564px;
padding: 1px;
}
#dialog_description {
padding: 2px;
height: 60px;
@ -345,17 +340,17 @@
<tr>
<td class="label">Group Name:</td>
<td>
<input type="text" id="dialog_groupname" class="inputbox" maxlength="200" tabindex="1" style="width: 300px;" />
<input type="text" id="dialog_groupname" maxlength="200" tabindex="1" style="width: 300px;" />
</td>
<td class="label" style="width: 50px; text-align: right;">Code:</td>
<td>
<input type="text" id="dialog_groupcode" class="inputbox" maxlength="50" tabindex="1" style="width: 200px;" />
<input type="text" id="dialog_groupcode" maxlength="50" tabindex="1" style="width: 200px;" />
</td>
</tr>
<tr>
<td class="label">Description:</td>
<td colspan="3">
<textarea id="dialog_description" class="inputbox" maxlength="1000" tabindex="2"></textarea></td>
<textarea id="dialog_description" maxlength="1000" tabindex="2"></textarea></td>
</tr>
</table>
<div class="dialog-subheader">Group Assets</div>

View File

@ -178,11 +178,11 @@
if (j === "Status")
r[j] = { DisplayValue: r["Status"] === 1 ? "Active" : "Inactive", Value: r[j] };
else if (j === "AddDate")
r[j] = { DisplayValue: r["AddDateStr"], Value: r["AddDateStr1"] };
r[j] = { DisplayValue: r["AddDateStr"], Value: r[j] };
else if (j === "InvoiceDate")
r[j] = { DisplayValue: r["InvoiceDateStr"], Value: r[j] };
else if (j === "ServiceStartDate")
r[j] = { DisplayValue: r["ServiceStartDateStr"], Value: r["ServiceStartDateStr1"] };
r[j] = { DisplayValue: r["ServiceStartDateStr"], Value: r[j] };
else if (j === "EngineHoursDate")
r[j] = { DisplayValue: r["EngineHoursDateStr"], Value: r[j] };
else if (j === "EngineHours")
@ -548,7 +548,7 @@
type: 3,
key: 'checked',
allcheck: true,
width: 30,
width: 45,
align: 'center'
});
}

View File

@ -487,7 +487,7 @@
//grid_dt.lang.ok = "Apply";
//grid_dt.lang.reset;
var list_columns = [
{ name: 'Selected', caption: "", valueIndex: 'Selected', alwaysshow: true, css: { 'width': 40, 'text-align': 'center' }, type: 3 },
{ name: 'Selected', caption: "", valueIndex: 'Selected', alwaysshow: true, css: { 'width': 45, 'text-align': 'center' }, type: 3 },
{ name: 'VIN', caption: GetTextByKey("P_MA_VINSN", "SN/VIN"), valueIndex: 'VIN', css: { 'width': 180, 'text-align': 'left' } },
{ name: 'Name', caption: GetTextByKey("P_MA_ASSETNAME", "Asset Name"), valueIndex: 'Name', css: { 'width': 180, 'text-align': 'left' } },
{ name: 'Name2', caption: GetTextByKey("P_MA_ASSETNAME2", "Asset Name(Custom)"), valueIndex: 'Name2', css: { 'width': 180, 'text-align': 'left' } },
@ -897,7 +897,7 @@
type: 3,
key: 'checked',
allcheck: true,
width: 30,
width: 45,
align: 'center'
});
}

View File

@ -62,7 +62,6 @@
<link href="<%=GetFileUrlWithVersion("../css/jquery.datetimepicker.css")%>" rel="stylesheet" />
<script src="<%=GetFileUrlWithVersion("../Maintenance/js/inputdatactr.js")%>" type="text/javascript"></script>
<script src="<%=GetFileUrlWithVersion("../js/jquery.datetimepicker.full.js")%>"></script>
<script src="<%=GetFileUrlWithVersion("../js/editableselect.js")%>"></script>
<script type="text/javascript">
var IsDealer = <%=IsDealer ?"true":"false"%>;
var IsAdmin =<%=IsAdmin ?"true":"false"%>;
@ -70,10 +69,6 @@
var MachineID = "<%=MachineID %>";
var machines;
var editableSelectMachine;
var listeditableSelectMachine;
function devicerequest(method, param, callback, error) {
_network.request("MachineDeviceManagement/ManageRentals.aspx", -1, method, param, callback, error || function (e) {
@ -106,8 +101,7 @@
else
$("#btnAdd").hide();
GetMachines();
OnRefresh();
});
}
@ -133,7 +127,7 @@
}
else
$("#btnAdd").hide();
GetMachines();
OnRefresh();
});
}
@ -207,29 +201,6 @@
});
}
function GetMachines() {
contractorid = htmlencode($.trim($('#sel_contractor').val()));
devicerequest("GetSelectMachinesByCompany", contractorid, function (data) {
if (data && data.length > 0) {
machines = data;
editableSelectMachine.datasource = machines;
editableSelectMachine.valuepath = "MachineID"
editableSelectMachine.displaypath = "DisplayName";
listeditableSelectMachine.datasource = machines;
listeditableSelectMachine.valuepath = "MachineID"
listeditableSelectMachine.displaypath = "DisplayName";
//if (MachineID !== "")//暂时不过滤机器
// listeditableSelectMachine.val(MachineID);
}
OnRefresh();
}, function (err) {
});
}
function OnRefresh() {
showloading(true);
@ -239,10 +210,6 @@
var startdate = htmlencode($('#startdatetxt').val());
var enddate = htmlencode($('#enddatetxt').val());
var machine = listeditableSelectMachine.selecteditem();
if (machine != null)
MachineID = machine.MachineID;
devicerequest("SearchRentals", contractorid + String.fromCharCode(170) + searchtxt
+ String.fromCharCode(170) + startdate + String.fromCharCode(170) + enddate
+ String.fromCharCode(170) + "", function (data) {
@ -411,8 +378,7 @@
var from = htmlencode($('#startdatetxt').val());
var to = htmlencode($('#enddatetxt').val());
mid = listeditableSelectMachine.val();
if (mid === undefined) mid = "";
var mid = "";
var sortPath = $("#tbRentals").data("sortPath");
if (sortPath === undefined) sortPath = "";
@ -429,8 +395,7 @@
var from = htmlencode($('#startdatetxt').val());
var to = htmlencode($('#enddatetxt').val());
mid = listeditableSelectMachine.val();
if (mid === undefined) mid = "";
var mid = "";
var sortPath = $("#tbRentals").data("sortPath");
if (sortPath === undefined) sortPath = "";
@ -444,10 +409,6 @@
setPageTitle(GetTextByKey("P_MANAGERENTALS", "Manage Rentals"), true);
InitGridData();
editableSelectMachine = new $editableselect($("#dialog_machine"));
editableSelectMachine.tabIndex(1);
listeditableSelectMachine = new $editableselect($("#sel_machine"));
if (IsDealer == true) {
$('#span_contractor').css('display', '');
$('#span_contractor').parent().css('display', '');
@ -458,13 +419,12 @@
}
}
else
GetMachines();
OnRefresh();
$("#sel_contractor").change(function () {
GetMachines();
OnRefresh();
});
$('#searchinputtxt').keydown(searchEnter);
$('#startdatetxt').datetimepicker({
@ -531,18 +491,6 @@
}
}
function OnViewHistory() {
var cid = "";
cid = htmlencode($.trim($('#sel_contractor').val()));
var machineID = "";
var machine = listeditableSelectMachine.selecteditem();
if (machine != null)
machineID = machine.MachineID;
else
machineID = "";
window.open("RentalChangeHistory.aspx?cid=" + cid + "&mid=" + machineID + "");
}
function OnViewChangeHistory(rental) {
if (!rental) {
return;
@ -550,11 +498,6 @@
var cid = "";
cid = htmlencode($.trim($('#sel_contractor').val()));
var machineID = "";
var machine = listeditableSelectMachine.selecteditem();
if (machine != null)
machineID = machine.MachineID;
else
machineID = "";
window.open("RentalChangeHistory.aspx?cid=" + cid + "&mid=" + machineID + "&rid=" + rental.RentalID + "");
}
@ -597,7 +540,6 @@
<span class="sbutton iconrefresh" onclick="OnRefresh();" data-lgid="P_MR_REFRESH">Refresh</span>
<span class="sbutton iconprint" onclick="OnPrint();" style="display: none;" data-lgid="P_MR_PRINT">Print</span>
<span id="spExport" class="sbutton iconexport" onclick="OnExport();" data-lgid="P_MR_EXPORTTOEXCEL">Export to Excel</span>
<%--<input id="btnhistory" type="button" onclick="OnViewHistory();" value="View Change History" style="width: 150px;" />--%>
</div>
</td>
</tr>

View File

@ -80,90 +80,14 @@
});
}
//admin用户 获取所有contractor
function getContractors() {
devicerequest('GetContractors', '', function (data) {
if (typeof (data) === "string") {
showAlert(data, GetTextByKey("P_MR_ERROR", 'Error'));
return;
}
if (data && data.length > 0) {
var sel_search = $('#sel_contractor').empty();
for (var i = 0; i < data.length; i++) {
var kv = data[i];
var op_search = $('<option></option>').val(kv.Key).text(kv.Value);
if (kv.Key == contractorid)
op_search.prop('selected', true);
sel_search.append(op_search);
}
if (contractorid !== "")
sel_search.val(contractorid);
}
GetMachines();
});
}
//普通用户 获取可操作的contractor
function GetContractorsByUser() {
devicerequest('GetContractorsByUser', '', function (data) {
if (typeof (data) === "string") {
showAlert(data, GetTextByKey("P_MR_ERROR", 'Error'));
return;
}
if (data && data.length > 0) {
var sel_search = $('#sel_contractor').empty();
for (var i = 0; i < data.length; i++) {
var kv = data[i];
var op_search = $('<option></option>').val(kv.Key).text(kv.Value);
sel_search.append(op_search);
}
if (contractorid !== "")
sel_search.val(contractorid);
}
GetMachines();
});
}
function GetMachines() {
contractorid = htmlencode($.trim($('#sel_contractor').val()));
devicerequest("GetSelectMachinesByCompany", contractorid, function (data) {
if (data && data.length > 0) {
machines = data;
listeditableSelectMachine.datasource = machines;
listeditableSelectMachine.valuepath = "MachineID"
listeditableSelectMachine.displaypath = "DisplayName";
//if (MachineID !== "")//暂时不过滤机器
//listeditableSelectMachine.val(MachineID);
}
OnRefresh();
}, function (err) {
});
}
function OnRefresh() {
showloading(true);
var cid = htmlencode($.trim($('#sel_contractor').val()));
if (cid && cid != '')
contractorid = cid;
var searchtxt = "";
searchtxt = htmlencode($.trim($('#searchinputtxt').val()));
var startdate = htmlencode($('#startdatetxt').val());
var enddate = htmlencode($('#enddatetxt').val());
var machine = listeditableSelectMachine.selecteditem();
if (machine != null)
MachineID = machine.MachineID;
else
MachineID = "";
devicerequest("SearchRentalChangeHistory", contractorid + String.fromCharCode(170) + searchtxt
+ String.fromCharCode(170) + startdate + String.fromCharCode(170) + enddate
+ String.fromCharCode(170) + MachineID + String.fromCharCode(170) + RentalID, function (data) {
@ -181,16 +105,11 @@
}
function OnExport() {
var cid = htmlencode($.trim($('#sel_contractor').val()));
if (cid && cid != '')
contractorid = cid;
var searchtxt = "";
searchtxt = htmlencode($.trim($('#searchinputtxt').val()));
var from = htmlencode($('#startdatetxt').val());
var to = htmlencode($('#enddatetxt').val());
mid = listeditableSelectMachine.val();
if (mid === undefined) mid = "";
var mid = "";
var sortPath = grid_dt.sortKey;
if (sortPath === undefined) sortPath = "";
@ -200,16 +119,11 @@
}
function OnPrint() {
var cid = htmlencode($.trim($('#sel_contractor').val()));
if (cid && cid != '')
contractorid = cid;
var searchtxt = "";
searchtxt = htmlencode($.trim($('#searchinputtxt').val()));
var from = htmlencode($('#startdatetxt').val());
var to = htmlencode($('#enddatetxt').val());
mid = listeditableSelectMachine.val();
if (mid === undefined) mid = "";
var mid = "";
var sortPath = grid_dt.sortKey;
if (sortPath === undefined) sortPath = "";
@ -298,22 +212,6 @@
$('#tr_search').css('display', 'none');
}
//if (IsDealer == true) {
// $('#span_contractor').css('display', '');
// $('#span_contractor').parent().css('display', '');
// if (IsAdmin)
// getContractors();
// else {
// GetContractorsByUser();
// }
//}
//else
// GetMachines();
//$("#sel_contractor").change(function () {
// GetMachines();
//});
OnRefresh();
$('#searchinputtxt').keydown(searchEnter);

View File

@ -371,7 +371,7 @@
//grid_dt.lang.ok = "Apply";
//grid_dt.lang.reset;
var list_columns = [
{ name: 'Selected', caption: "", valueIndex: 'Selected', alwaysshow: true, css: { 'width': 30, 'text-align': 'center' }, type: 3 },
{ name: 'Selected', caption: "", valueIndex: 'Selected', alwaysshow: true, css: { 'width': 45, 'text-align': 'center' }, type: 3 },
{ name: 'VIN', caption: GetTextByKey("P_MA_VINSN", "SN/VIN"), valueIndex: 'VIN', css: { 'width': 180, 'text-align': 'left' } },
{ name: 'Name', caption: GetTextByKey("P_MA_ASSETNAME", "Asset Name"), valueIndex: 'AssetName', css: { 'width': 180, 'text-align': 'left' } },
{ name: 'Name2', caption: GetTextByKey("P_MA_ASSETNAME2", "Asset Name(Custom)"), valueIndex: 'AssetCustomerName', css: { 'width': 180, 'text-align': 'left' } },
@ -659,7 +659,7 @@
{
key: 'Selected',
type: 3,
width: 30,
width: 45,
align: 'center',
allcheck: true,
enabled: '__selectable'
@ -799,7 +799,7 @@
reset: GetTextByKey("P_GRID_RESET", "Reset")
};
var list_columns = [
{ name: 'Sharable', caption: "", valueIndex: 'Sharable', css: { 'width': 30, 'text-align': 'center' }, type: 3 },
{ name: 'Sharable', caption: "", valueIndex: 'Sharable', css: { 'width': 45, 'text-align': 'center' }, type: 3 },
{ name: 'CustomerId', caption: GetTextByKey("P_XXXXXX", "ID"), valueIndex: 'CustomerId', css: { 'width': 120, 'text-align': 'left' } },
{ name: 'CustomerName', caption: GetTextByKey("P_XXXXXX", "Name"), valueIndex: 'CustomerName', css: { 'width': 200, 'text-align': 'left' } },
];
@ -1123,7 +1123,7 @@
<div id="customerlist" style="height: 400px; width: 400px; margin: 10px 0 4px;"></div>
</div>
<div class="dialog-func">
<input type="button" value="Cancel" data-lgid="P_UM_CANCEL" class="dialog-close" tabindex="18" style="height: 26px;" />
<input type="button" value="Cancel" data-lgid="P_UM_CANCEL" class="dialog-close" tabindex="18" style="height: unset;" />
<input type="button" onclick="saveShareWithCustomers();" value="OK" data-lgid="P_UM_OK" tabindex="17" />
<div style="clear: both;"></div>
</div>

View File

@ -229,18 +229,18 @@ function InitEnginehoursHisGridData() {
}
function getEnineHours() {
showLoading();
showsubloading("adjustenginehoursmask", true);
grid_enginehoursdt.setData([]);
devicerequest("GetAssetCurrentEngineHours", contractorid + String.fromCharCode(170) + machineid, function (data) {
hideLoading();
showsubloading("adjustenginehoursmask", false);
if (typeof (data) === "string") {
showAlert(data, GetTextByKey("P_MA_ERROR", 'Error'));
return;
}
ShowEngineHours(data);
}, function (err) {
hideLoading();
showsubloading("adjustenginehoursmask", false);
});
}
@ -248,7 +248,7 @@ function getEnineHours() {
function getEngineHoursHis() {
grid_enginehoursmostrecentdt.setData([]);
grid_enginehourshisdt.setData([]);
showLoading();
showsubloading("adjustenginehoursmask", true);
var methodname = "GetCalampEngineHoursHistory";
if (isPedigreeEH)
methodname = "GetPedigreeEngineHoursHistory";
@ -256,7 +256,7 @@ function getEngineHoursHis() {
methodname = "GetOEMDD2EngineHoursHistory";
devicerequest(methodname, contractorid + String.fromCharCode(170) + machineid, function (data) {
hideLoading();
showsubloading("adjustenginehoursmask", false);
if (typeof (data) === "string") {
showAlert(data, GetTextByKey("P_MA_ERROR", 'Error'));
return;
@ -264,7 +264,7 @@ function getEngineHoursHis() {
//ShowEngineHoursHis(data);
ShowMostRecentEngineHours(data);
}, function (err) {
hideLoading();
showsubloading("adjustenginehoursmask", false);
});
}
@ -282,27 +282,23 @@ function getEngineHoursHisPreview() {
if (item.EngineHours !== "") {
if (isNaN(item.EngineHours)) {
showAlert(GetTextByKey("P_MA_FORMATERROR", '{0} format error.').replace('{0}', enginehourstxt), alerttitle);
$('#adjustenginehoursmask').hide();
return;
}
else {
if (item.EngineHours <= 0) {
showAlert(GetTextByKey("P_MA_MUSTBEGREATERTHAN0", '{0} must be greater than 0.').replace('{0}', enginehourstxt), alerttitle);
$('#adjustenginehoursmask').hide();
return;
}
}
}
else {
showAlert(GetTextByKey("P_MA_NOTBEEMPTY", '{0} cannot be empty.').replace('{0}', enginehourstxt), alerttitle);
$('#adjustenginehoursmask').hide();
return;
}
if (item.EngineHoursDate === "") {
showAlert(GetTextByKey("P_MA_NOTBEEMPTY", '{0} cannot be empty.').replace('{0}', enginehourstxt), alerttitle);
$('#adjustenginehoursmask').hide();
return;
}
var offset = $('#dialogadjust_enginehourstimezone').find("option:selected").attr("offset");
@ -319,7 +315,7 @@ function getEngineHoursHisPreview() {
function GetCalampEngineHoursHistoryPreview(item) {
grid_enginehourshisdt.setData([]);
showLoading();
showsubloading("adjustenginehoursmask", true);
var param = JSON.stringify(item);
param = htmlencode(param);
@ -329,7 +325,7 @@ function GetCalampEngineHoursHistoryPreview(item) {
if (isOEMDD2EH)
methodname = "GetOEMDD2EngineHoursHistoryPreview";
devicerequest(methodname, param, function (data) {
hideLoading();
showsubloading("adjustenginehoursmask", false);
if (typeof (data) === "string") {
showAlert(data, GetTextByKey("P_MA_ERROR", 'Error'));
return;
@ -337,7 +333,7 @@ function GetCalampEngineHoursHistoryPreview(item) {
ShowEngineHoursHis(data);
ShowMostRecentEngineHoursPreview(data);
}, function (err) {
hideLoading();
showsubloading("adjustenginehoursmask", false);
});
}
@ -461,11 +457,11 @@ function openAdjustEngineHours() {
function OnAdjustEngineHours() {
$('#adjustenginehoursmask').show();
showsubmask("adjustenginehoursmask", true);
var alerttitle = GetTextByKey("P_MA_ADJUSTENGINEHOURS", 'Adjust Engine Hours');
var enginehourstxt = GetTextByKey("P_MA_ENGINEHOURS", "Engine Hours");
showConfirm('Do you want to adjust the engine hours?', alerttitle, function () {
$('#adjustodomask').hide();
showConfirm1('Do you want to adjust the engine hours?', alerttitle, function () {
showsubmask("adjustenginehoursmask", false);
var item = {
'CustomerID': contractorid,
'AssetID': machineid,
@ -478,26 +474,26 @@ function OnAdjustEngineHours() {
if (item.EngineHours !== "") {
if (isNaN(item.EngineHours)) {
showAlert(GetTextByKey("P_MA_FORMATERROR", '{0} format error.').replace('{0}', enginehourstxt), alerttitle);
$('#adjustenginehoursmask').hide();
showsubmask("adjustenginehoursmask", false);
return;
}
else {
if (item.EngineHours <= 0) {
showAlert(GetTextByKey("P_MA_MUSTBEGREATERTHAN0", '{0} must be greater than 0.').replace('{0}', enginehourstxt), alerttitle);
$('#adjustenginehoursmask').hide();
showsubmask("adjustenginehoursmask", false);
return;
}
}
}
else {
showAlert(GetTextByKey("P_MA_NOTBEEMPTY", '{0} cannot be empty.').replace('{0}', enginehourstxt), alerttitle);
$('#adjustenginehoursmask').hide();
showsubmask("adjustenginehoursmask", false);
return;
}
if (item.EngineHoursDate === "") {
showAlert(GetTextByKey("P_MA_NOTBEEMPTY", '{0} cannot be empty.').replace('{0}', enginehourstxt), alerttitle);
$('#adjustenginehoursmask').hide();
showsubmask("adjustenginehoursmask", false);
return;
}
var offset = $('#dialogadjust_enginehourstimezone').find("option:selected").attr("offset");
@ -510,7 +506,7 @@ function OnAdjustEngineHours() {
CheckEngineHourMinimumTime(item, "submit");
}, function () {
$('#adjustenginehoursmask').hide();
showsubmask("adjustenginehoursmask", false);
});
}
@ -518,12 +514,13 @@ function CheckEngineHourMinimumTime(item, type) {
var param = JSON.stringify(item);
param = htmlencode(param);
devicerequest("CheckEngineHourMinimumTime", param, function (data) {
showsubmask("adjustenginehoursmask", false);
if (data > 0) {
if (data == 1)
showAlert(GetTextByKey("P_MA_CHECKENGINEHOURSMINNIMUMTIME", "The adjustment cannot be completed as provided. The engine hours reading date provided cannot be prior to initial telematic data available for the asset."), GetTextByKey("P_MA_ADJUSTENGINEHOURS", 'Adjust Engine Hours'));
else
showAlert(GetTextByKey("P_MA_CHECKENGINEHOURSMINNIMUMTIME1", "The adjustment cannot be completed as provided. The engine hours reading date provided must be prior to or equal to the latest telematic data available for the asset."), GetTextByKey("P_MA_ADJUSTENGINEHOURS", 'Adjust Engine Hours'));
$('#adjustenginehoursmask').hide();
return;
} else {
if (type === "submit")
@ -532,18 +529,20 @@ function CheckEngineHourMinimumTime(item, type) {
GetCalampEngineHoursHistoryPreview(item);
}
}, function (err) {
showsubmask("adjustenginehoursmask", false);
});
}
function SaveAdjustEngineHours(item) {
showloading(true);
showsubloading("adjustenginehoursmask", true);
var param = JSON.stringify(item);
param = htmlencode(param);
showsubloading("adjustenginehoursmask", true);
var alerttitle = GetTextByKey("P_MA_ADJUSTENGINEHOURS", GetTextByKey("P_MA_ADJUSTENGINEHOURS", 'Adjust Engine Hours'));
devicerequest("SaveAdjustEngineHours", param, function (data) {
showloading(false);
showsubloading("adjustenginehoursmask", false);
if (data !== 'OK') {
showAlert(data, alerttitle);
} else {
@ -553,12 +552,11 @@ function SaveAdjustEngineHours(item) {
}
$('#dialog_adjustenginehours').hideDialog();
$('#adjustenginehoursmask').hide();
showmaskbg(false);
}, function (err) {
console.log(err);
showloading(false);
showAlert(GetTextByKey("P_MA_FAILEDTO", "Failed to {0}.").replace('{0}', alerttitle), alerttitle);
$('#adjustenginehoursmask').hide();
showsubloading("adjustenginehoursmask", false);
});
}
@ -598,11 +596,10 @@ function openAddEnginHours() {
function OnAddEngineHours() {
$('#addenginehoursmask').show();
showsubmask("addenginehoursmask", true);
var alerttitle = GetTextByKey("P_MA_ADDENGINEHOURS", 'Add Engine Hours');
var enginehourstxt = GetTextByKey("P_MA_ENGINEHOURS", "Engine Hours");
showConfirm(GetTextByKey("P_MA_DOYOUWANTTOADDTHEENGINEHOURS", 'Do you want to add the engine hours?'), alerttitle, function () {
$('#adjustodomask').hide();
showConfirm1(GetTextByKey("P_MA_DOYOUWANTTOADDTHEENGINEHOURS", 'Do you want to add the engine hours?'), alerttitle, function () {
var item = {
'CustomerID': contractorid,
'AssetID': machineid,
@ -614,26 +611,26 @@ function OnAddEngineHours() {
if (item.EngineHours !== "") {
if (isNaN(item.EngineHours)) {
showAlert(GetTextByKey("P_MA_FORMATERROR", '{0} format error.').replace('{0}', enginehourstxt), alerttitle);
$('#addenginehoursmask').hide();
showsubmask("addenginehoursmask", false);
return;
}
else {
if (item.EngineHours <= 0) {
showAlert(GetTextByKey("P_MA_MUSTBEGREATERTHAN0", '{0} must be greater than 0.').replace('{0}', enginehourstxt), alerttitle);
$('#addenginehoursmask').hide();
showsubmask("addenginehoursmask", false);
return;
}
}
}
else {
showAlert(GetTextByKey("P_MA_NOTBEEMPTY", '{0} cannot be empty.').replace('{0}', enginehourstxt), alerttitle);
$('#addenginehoursmask').hide();
showsubmask("addenginehoursmask", false);
return;
}
if (item.EngineHoursDate === "") {
showAlert(GetTextByKey("P_MA_NOTBEEMPTY", '{0} cannot be empty.').replace('{0}', enginehourstxt), alerttitle);
$('#addenginehoursmask').hide();
showsubmask("addenginehoursmask", false);
return;
}
var offset = $('#dialogadd_enginehourstimezone').find("option:selected").attr("offset");
@ -644,12 +641,12 @@ function OnAddEngineHours() {
item.EngineHoursDate = item.EngineHoursDate.replace("-", "/") + " " + hour + ":" + minute + ":" + "00";
showloading(true);
var param = JSON.stringify(item);
param = htmlencode(param);
showsubloading("addenginehoursmask", true);
devicerequest("AddManuallyInputEngineHours", param, function (data) {
showloading(false);
showsubloading("addenginehoursmask", false);
if (data !== 'OK') {
if (data === "Failed")
data = GetTextByKey("P_MA_FAILED", "Failed");
@ -661,16 +658,16 @@ function OnAddEngineHours() {
}
$('#dialog_addenginehours').hideDialog();
$('#addenginehoursmask').hide();
showmaskbg(false);
}, function (err) {
console.log(err);
showloading(false);
showsubloading("addenginehoursmask", false);
showAlert(GetTextByKey("P_MA_FAILEDTO", "Failed to {0}.").replace('{0}', GetTextByKey("P_MA_ADDENGINEHOURS", "Add Engine Hours")), alerttitle);
$('#addenginehoursmask').hide();
});
}, function () {
$('#addenginehoursmask').hide();
showsubmask("addenginehoursmask", false);
});
}

View File

@ -219,23 +219,23 @@ function InitOdometerHisGridData() {
function getOdometers() {
grid_odometerdt.setData([]);
showLoading();
showsubloading("adjustodomask", true);
devicerequest("GetAssetCurrentOdometer", contractorid + String.fromCharCode(170) + machineid, function (data) {
hideLoading();
showsubloading("adjustodomask", false);
if (typeof (data) === "string") {
showAlert(data, GetTextByKey("P_MA_ERROR", 'Error'));
return;
}
ShowOdometers(data);
}, function (err) {
hideLoading();
showsubloading("adjustodomask", false);
});
}
function getOdometerHis() {
grid_odometermostrecentdt.setData([]);
grid_odometerhisdt.setData([]);
showLoading();
showsubloading("adjustodomask", true);
var methodname = "";
if (isCalampOdo)
@ -246,7 +246,7 @@ function getOdometerHis() {
methodname = "GetSmartWitnessOdometerHistory";
devicerequest(methodname, contractorid + String.fromCharCode(170) + machineid, function (data) {
hideLoading();
showsubloading("adjustodomask", false);
if (typeof (data) === "string") {
showAlert(data, GetTextByKey("P_MA_ERROR", 'Error'));
return;
@ -254,7 +254,7 @@ function getOdometerHis() {
//ShowOdometerHis(data);
ShowMostRecentOdometer(data);
}, function (err) {
hideLoading();
showsubloading("adjustodomask", false);
});
}
@ -271,27 +271,23 @@ function getOdometerHisPreview() {
if (item.Odometer !== "") {
if (isNaN(item.Odometer)) {
showAlert(GetTextByKey("P_MA_ODOMETERFORMATERROR", 'Odometer format error.'), alerttitle);
$('#adjustodomask').hide();
return;
}
else {
if (item.Odometer <= 0) {
showAlert(GetTextByKey("P_MA_ODOMETERMUSTBEGREATERTHAN0", 'ODOMeter must be greater than 0.'), alerttitle);
$('#adjustodomask').hide();
return;
}
}
}
else {
showAlert(GetTextByKey("P_MA_ODOMETRCANNOTBEEMPTY", "Odometer cannot be empty."), alerttitle);
$('#adjustodomask').hide();
return;
}
if (item.OdometerDate === "") {
showAlert(GetTextByKey("P_MA_ODOMETRDATACANNOTBEEMPTY", "Odometer date cannot be empty."), alerttitle);
$('#adjustodomask').hide();
hideLoading();
return;
}
@ -309,7 +305,7 @@ function getOdometerHisPreview() {
function GetOdometerHistoryPreview(item) {
grid_odometerhisdt.setData([]);
showLoading();
showsubloading("adjustodomask", true);
var param = JSON.stringify(item);
param = htmlencode(param);
if (isCalampOdo)
@ -320,7 +316,7 @@ function GetOdometerHistoryPreview(item) {
methodname = "GetSmartWitnessOdometerHistoryPreview";
devicerequest(methodname, param, function (data) {
hideLoading();
showsubloading("adjustodomask", false);
if (typeof (data) === "string") {
showAlert(data, GetTextByKey("P_MA_ERROR", 'Error'));
return;
@ -328,7 +324,7 @@ function GetOdometerHistoryPreview(item) {
ShowOdometerHis(data);
ShowMostRecentOdometerPreview(data);
}, function (err) {
hideLoading();
showsubloading("adjustodomask", false);
});
}
@ -446,9 +442,9 @@ function openAdjustOdometer() {
}
function OnAdjustOdometer() {
$('#adjustodomask').show();
showsubmask("adjustodomask", true);
var alerttitle = GetTextByKey("P_MA_ADJUSTODOMETER", "Adjust Odometer");
showConfirm(GetTextByKey("P_MA_DOYOUWANTTOADJUSTTHEODOMETER", 'Do you want to adjust the odometer?'), alerttitle, function () {
showConfirm1(GetTextByKey("P_MA_DOYOUWANTTOADJUSTTHEODOMETER", 'Do you want to adjust the odometer?'), alerttitle, function () {
var item = {
'CustomerID': contractorid,
'AssetID': machineid,
@ -462,26 +458,26 @@ function OnAdjustOdometer() {
if (item.Odometer !== "") {
if (isNaN(item.Odometer)) {
showAlert(GetTextByKey("P_MA_ODOMETERFORMATERROR", 'Odometer format error.'), alerttitle);
$('#adjustodomask').hide();
showsubmask("adjustodomask", false);
return;
}
else {
if (item.Odometer <= 0) {
showAlert(GetTextByKey("P_MA_ODOMETERMUSTBEGREATERTHAN0", 'ODOMeter must be greater than 0.'), alerttitle);
$('#adjustodomask').hide();
showsubmask("adjustodomask", false);
return;
}
}
}
else {
showAlert(GetTextByKey("P_MA_ODOMETRCANNOTBEEMPTY", "Odometer cannot be empty."), alerttitle);
$('#adjustodomask').hide();
showsubmask("adjustodomask", false);
return;
}
if (item.OdometerDate === "") {
showAlert(GetTextByKey("P_MA_ODOMETRDATACANNOTBEEMPTY", "Odometer date cannot be empty."), alerttitle);
$('#adjustodomask').hide();
showsubmask("adjustodomask", false);
return;
}
var offset = $('#dialogadjust_odometertimezone').find("option:selected").attr("offset");
@ -495,9 +491,8 @@ function OnAdjustOdometer() {
CheckOdometerMinnimumTime(item, "submit");
}, function () {
$('#adjustodomask').hide();
showsubmask("adjustodomask", false);
});
}
@ -505,12 +500,13 @@ function CheckOdometerMinnimumTime(item, type) {
var param = JSON.stringify(item);
param = htmlencode(param);
devicerequest("CheckOdometerMinnimumTime", param, function (data) {
showsubmask("adjustodomask", false);
if (data > 0) {
if (data == 1)
showAlert(GetTextByKey("P_MA_CHECKODOMETERMINNIMUMTIME1", "The adjustment cannot be completed as provided. The odometer reading date provided cannot be prior to initial telematic data available for the asset."), GetTextByKey("P_MA_ADJUSTODOMETER", "Adjust Odometer"));
else
showAlert(GetTextByKey("P_MA_CHECKODOMETERMINNIMUMTIME", "The adjustment cannot be completed as provided. The odometer reading date provided must be prior to or equal to the latest telematic data available for the asset."), GetTextByKey("P_MA_ADJUSTODOMETER", "Adjust Odometer"));
$('#adjustodomask').hide();
return;
} else {
if (type === "submit")
@ -519,16 +515,17 @@ function CheckOdometerMinnimumTime(item, type) {
GetOdometerHistoryPreview(item);
}
}, function (err) {
showsubmask("adjustodomask", false);
});
}
function SaveAdjustOdometer(item) {
showloading(true);
showsubloading("adjustodomask", true);
var param = JSON.stringify(item);
param = htmlencode(param);
devicerequest("SaveAdjustOdometer", param, function (data) {
showloading(false);
showsubloading("adjustodomask", false);
if (data !== 'OK') {
showAlert(data, GetTextByKey("P_MA_ADJUSTODOMETER", "Adjust Odometer"));
} else {
@ -538,11 +535,10 @@ function SaveAdjustOdometer(item) {
}
$('#dialog_adjustodometer').hideDialog();
$('#adjustodomask').hide();
showmaskbg(false);
}, function (err) {
showloading(false);
showAlert(GetTextByKey("P_MA_FAILEDTOADJUSTDOMETER", 'Failed to adjust Odometer.'), GetTextByKey("P_MA_ADJUSTODOMETER", "Adjust Odometer"));
$('#adjustodomask').hide();
showsubloading("adjustodomask", false);
});
}
@ -571,7 +567,6 @@ function openAddOdometer() {
$('#dialog_addodometer .dialog-title span.title').text(GetTextByKey("P_MA_ADDODOMETER", 'Add Odometer'));
showmaskbg(true);
$('#dialog_addodometer')
.attr('act', 'add')
.css({
'top': (document.documentElement.clientHeight - $('#dialog_addodometer').height()) / 3,
'left': (document.documentElement.clientWidth - $('#dialog_addodometer').width()) / 2
@ -581,9 +576,9 @@ function openAddOdometer() {
}
function OnAddOdometer() {
$('#addodomask').show();
showsubmask("addodomask", true);
var alerttile = GetTextByKey("P_MA_ADDODOMETER", 'Add Odometer');
showConfirm(GetTextByKey("P_MA_DOYOUWANTTOADDTHEODOMETER", 'Do you want to add the odometer?'), alerttile, function () {
showConfirm1(GetTextByKey("P_MA_DOYOUWANTTOADDTHEODOMETER", 'Do you want to add the odometer?'), alerttile, function () {
var item = {
'CustomerID': contractorid,
'AssetID': machineid,
@ -596,26 +591,26 @@ function OnAddOdometer() {
if (item.Odometer !== "") {
if (isNaN(item.Odometer)) {
showAlert(GetTextByKey("P_MA_ODOMETERFORMATERROR", 'Odometer format error.'), alerttile);
$('#addodomask').hide();
showsubmask("addodomask", false);
return;
}
else {
if (item.Odometer <= 0) {
showAlert(GetTextByKey("P_MA_ODOMETERMUSTBEGREATERTHAN0", 'ODOMeter must be greater than 0.'), alerttile);
$('#addodomask').hide();
showsubmask("addodomask", false);
return;
}
}
}
else {
showAlert(GetTextByKey("P_MA_ODOMETRCANNOTBEEMPTY", "Odometer cannot be empty."), alerttile);
$('#addodomask').hide();
showsubmask("addodomask", false);
return;
}
if (item.OdometerDate === "") {
showAlert(GetTextByKey("P_MA_ODOMETRDATACANNOTBEEMPTY", "Odometer date cannot be empty."), alerttile);
$('#addodomask').hide();
showsubmask("addodomask", false);
return;
}
var offset = $('#dialogadd_odometertimezone').find("option:selected").attr("offset");
@ -625,11 +620,12 @@ function OnAddOdometer() {
var minute = $('#dialogadd_timeminute').val();
item.OdometerDate = item.OdometerDate.replace("-", "/") + " " + hour + ":" + minute + ":" + "00";
showloading(true);
var param = JSON.stringify(item);
param = htmlencode(param);
showsubloading("addodomask", true);
devicerequest("AddManuallyInputOdometer", param, function (data) {
showloading(false);
showsubloading("addodomask", false);
if (data !== 'OK') {
showAlert(data, alerttile);
} else {
@ -639,15 +635,13 @@ function OnAddOdometer() {
}
$('#dialog_addodometer').hideDialog();
$('#addodomask').hide();
showmaskbg(false);
}, function (err) {
showloading(false);
showAlert('Failed to add Odometer.', alerttile);
$('#addodomask').hide();
showsubloading("addodomask", false);
});
}, function () {
$('#addodomask').hide();
showsubloading("addodomask", false);
});
}

View File

@ -167,7 +167,8 @@ function InitJobSiteGridData() {
col.events = {
onchange: function () {
inputChanged = true;
jobsiteinputChanged = true;
if (this.OnSite)
jobsiteinputChanged = true;
}
};
col.tooltip = GetTextByKey("P_MA_ONSITETITLE", "The On Site box should only be checked if the asset has a permanent assignment not based on location. Geofence and Jobsite Add/Remove will not be triggered if checked.");
@ -265,7 +266,7 @@ function InitAssetGroupGridData() {
reset: GetTextByKey("P_GRID_RESET", "Reset")
};
var list_columns = [
{ name: 'Selected', caption: "", valueIndex: 'Selected', type: 3, css: { 'width': 30, 'text-align': 'center' } },
{ name: 'Selected', caption: "", valueIndex: 'Selected', type: 3, css: { 'width': 45, 'text-align': 'center' } },
{ name: 'GroupName', caption: GetTextByKey("P_MA_GROUPNAME", "Group Name"), valueIndex: 'GroupName', css: { 'width': 300, 'text-align': 'left' } }
];
var columns = [];

View File

@ -36,7 +36,7 @@ function InitPMGridData() {
reset: GetTextByKey("P_GRID_RESET", "Reset")
};
var list_columns = [
{ name: 'Selected', caption: "", valueIndex: 'Selected', type: 3, css: { 'width': 30, 'text-align': 'center' } },
{ name: 'Selected', caption: "", valueIndex: 'Selected', type: 3, css: { 'width': 45, 'text-align': 'center' } },
{ name: 'PmScheduleName', caption: GetTextByKey("P_MA_SCHEDULENAME", "Schedule Name"), valueIndex: 'PmScheduleName', css: { 'width': 200, 'text-align': 'left' } },
{ name: 'StartValue', caption: GetTextByKey("P_MA_INITIALSERVICEVALUE", "Initial Service Value"), valueIndex: 'StartValue', css: { 'width': 120, 'text-align': 'right' } },
{ name: 'LastAlertTimeString', caption: GetTextByKey("P_MA_LASTSERVICEDATE", "Last Service Date"), valueIndex: 'LastAlertTimeString', css: { 'width': 120, 'text-align': 'left' } },
@ -429,7 +429,7 @@ function createTBMContent(contentctrl, pmschedule) {
item.PmScheduleID = pmschedule.PmScheduleID;
//item.PMType = pmschedule.PmScheduleType;
if (radio1.prop("checked")) {
item.StartDate = nowdate;
item.StartDate = currentdate;
}
else {
item.StartDate = txtLastServiceDate.val();

View File

@ -223,7 +223,6 @@ function OnMergeAsset() {
dialogSelectMergeAssets.exceptShareAsset = true;
dialogSelectMergeAssets.exceptSource = [machineid];
dialogSelectMergeAssets.showSelector(3, true);//与attachmentInfo中的showSelector冲突,需设置force
$('#mask_bg').css('height', '100%');
}
var mergeassetid;