This commit is contained in:
2024-03-26 15:56:31 +08:00
parent 634e8b71ab
commit 0855ae42cd
547 changed files with 94818 additions and 60463 deletions

View File

@ -20,19 +20,12 @@ define([], function () {
header.append(search_bar);
search_bar.append('<input type="password" autocomplete="new-password" style="display: none" />');
search_bar.append('<span style="margin-left:5px;">' + GetTextByKey("P_IPT_BEGINDATE_COLON", "Begin Date:") + '</span>');
startdateinputcontrol = $('<input type="text" style="margin-left: 5px; width: 80px;" autocomplete="off" />').val(begindate);
startdateinputcontrol = $('<input type="date" class="type-date" required min="1900-01-01" style="margin-left: 5px; width: 100px;" autocomplete="off" />').val(begindate);
search_bar.append($('<span></span>').append(startdateinputcontrol));
startdateinputcontrol.datetimepicker({
timepicker: false,
format: 'm/d/Y'
});
search_bar.append('<span style="margin-left:10px;">' + GetTextByKey("P_IPT_ENDDATE_COLON", "End Date:") + '</span>');
enddateinputcontrol = $('<input type="text" style="margin-left: 5px; width: 80px;" autocomplete="off" />').val(enddate);
enddateinputcontrol = $('<input type="date" class="type-date" required min="1900-01-01" style="margin-left: 5px; width: 100px;" autocomplete="off" />').val(enddate);
search_bar.append($('<span></span>').append(enddateinputcontrol));
enddateinputcontrol.datetimepicker({
timepicker: false,
format: 'm/d/Y'
});
var btnRefresh = $('<input class="search" type="button" value="' + GetTextByKey("P_IPT_SEARCH", "Search") + '" style="margin-left:10px;"/>');
search_bar.append(btnRefresh);
@ -75,12 +68,26 @@ define([], function () {
}
gs.refresh = function () {
var begindate = startdateinputcontrol.val();
var enddate = enddateinputcontrol.val();
if (begindate && !startdateinputcontrol.is(':valid')) {
showAlert(GetTextByKey('P_COMMON_BEGINDATEISINVALID', "The begin date is invalid."), GetTextByKey("P_FR_ERROR", 'Error'));
return;
}
if (enddate && !enddateinputcontrol.is(':valid')) {
showAlert(GetTextByKey('P_COMMON_ENDDATEISINVALID', "The end date is invalid."), GetTextByKey("P_FR_ERROR", 'Error'));
return;
}
if (begindate && enddate && begindate > enddate) {
showAlert(GetTextByKey("P_JS_ENDDATEMUSTBELATERTHANBEGINDATE", "End Date must be later than Begin Date."), GetTextByKey("P_FR_ERROR", 'Error'));
return;
}
var _this = this;
datacontent.empty();
var startydate = startdateinputcontrol.val();
var enddate = enddateinputcontrol.val();
var p = JSON.stringify([teamintelligence, startydate, enddate]);
var p = JSON.stringify([teamintelligence, begindate, enddate]);
showloading(true);
inspectionrequest("GetFuelReportItems", htmlencode(p), function (data) {
showloading(false);
datacontent.empty();
if (typeof (data) === "string") {
showAlert(data, GetTextByKey("P_IPT_ERROR", 'Error'));
@ -93,6 +100,7 @@ define([], function () {
//showFuelLogs(data);
}
}, function (err) {
showloading(false);
});
}
gs.createFuelLog = function (fuellog) {