sync
This commit is contained in:
@ -1,44 +1,12 @@
|
||||
<%@ Page Title="" Language="C#" MasterPageFile="~/Maintenance/MaintenanceBase.master" AutoEventWireup="true" CodeFile="FuelRecordManagement.aspx.cs" Inherits="Maintenance_FuelRecordManagement" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
|
||||
<link href="../css/jquery.datetimepicker.css" rel="stylesheet" />
|
||||
<style type="text/css">
|
||||
.selectinput {
|
||||
width: 150px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.dialog-content table {
|
||||
border-collapse: collapse;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.dialog-content table td.label {
|
||||
width: 150px;
|
||||
text-align: right;
|
||||
padding-right: 10px;
|
||||
line-height: 24px;
|
||||
height: 24px;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.dialog-content table td input,
|
||||
.dialog-content table td textarea {
|
||||
border: 1px solid #a9a9a9;
|
||||
width: 200px;
|
||||
height: 18px;
|
||||
padding: 1px;
|
||||
}
|
||||
|
||||
.dialog-content table td input[type="checkbox"] {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.dialog-content table td textarea {
|
||||
height: 100px;
|
||||
max-width: 200px;
|
||||
}
|
||||
|
||||
#dialogdatatb td {
|
||||
padding-top: 5px;
|
||||
}
|
||||
@ -53,9 +21,7 @@
|
||||
content: '\f08b';
|
||||
}
|
||||
</style>
|
||||
<script src="../js/jquery.datetimepicker.full.js"></script>
|
||||
<script src="<%=GetFileUrlWithVersion("js/inputdatactr.js")%>" type="text/javascript"></script>
|
||||
<script src="<%=GetFileUrlWithVersion("../js/editableselect.js")%>" type="text/javascript"></script>
|
||||
<script type="text/javascript">
|
||||
var fuelrecorddata;
|
||||
var assetid = "<%=AssetID %>";
|
||||
@ -97,16 +63,28 @@
|
||||
}
|
||||
|
||||
function OnRefresh() {
|
||||
showloading(true);
|
||||
var begindate = $('#startdatetxt').val();
|
||||
var enddate = $('#enddatetxt').val();
|
||||
if (begindate && !$('#startdatetxt').is(':valid')) {
|
||||
showAlert(GetTextByKey('P_COMMON_BEGINDATEISINVALID', "The begin date is invalid."), GetTextByKey("P_FR_ERROR", 'Error'));
|
||||
return;
|
||||
}
|
||||
if (enddate && !$('#enddatetxt').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 type = $('#typeselectinput').find("option:selected").val();
|
||||
var searchtxt = "";
|
||||
searchtxt = htmlencode($.trim($('#searchinputtxt').val()));
|
||||
var startdate = htmlencode($('#startdatetxt').val());
|
||||
var enddate = htmlencode($('#enddatetxt').val());
|
||||
var aid = (!assetid || assetid == "") ? -1 : eval(assetid);
|
||||
|
||||
fuelrequest("GetFuelRecords", type + String.fromCharCode(170) + startdate + String.fromCharCode(170) + enddate + String.fromCharCode(170) + searchtxt + String.fromCharCode(170) + aid, function (data) {
|
||||
showloading(true);
|
||||
fuelrequest("GetFuelRecords", type + String.fromCharCode(170) + begindate + String.fromCharCode(170) + enddate + String.fromCharCode(170) + searchtxt + String.fromCharCode(170) + aid, function (data) {
|
||||
showloading(false);
|
||||
if (typeof (data) === "string") {
|
||||
showAlert(data, GetTextByKey("P_FR_ERROR", 'Error'));
|
||||
@ -146,8 +124,7 @@
|
||||
// r[j] = { DisplayValue: getLangUom(r["Uom"]), Value: r[j] };
|
||||
//}
|
||||
}
|
||||
var fr = { Values: r };
|
||||
rows.push(fr);
|
||||
rows.push(r);
|
||||
}
|
||||
|
||||
grid_dt.setData(rows);
|
||||
@ -155,25 +132,20 @@
|
||||
|
||||
var grid_dt;
|
||||
function InitGridData() {
|
||||
grid_dt = new GridView('#recordlist');
|
||||
grid_dt.lang = {
|
||||
all: GetTextByKey("P_GRID_ALL", "(All)"),
|
||||
ok: GetTextByKey("P_GRID_OK", "OK"),
|
||||
reset: GetTextByKey("P_GRID_RESET", "Reset")
|
||||
};
|
||||
grid_dt = createGridView('#recordlist');
|
||||
var list_columns = [
|
||||
{ name: 'AssetName', caption: GetTextByKey("P_FR_ASSETNAME", "Asset Name"), valueIndex: 'AssetName', css: { 'width': 180, 'text-align': 'left' } },
|
||||
{ name: 'AssetName', caption: GetTextByKey("P_FR_ASSETNAME", "Asset Name"), valueIndex: 'AssetName', allowFilter: true, css: { 'width': 180, 'text-align': 'left' } },
|
||||
{ name: 'AssetMake', caption: GetTextByKey("P_FR_MAKE", "Make"), valueIndex: 'AssetMake', allowFilter: true, css: { 'width': 120, 'text-align': 'left' } },
|
||||
{ name: 'AssetModel', caption: GetTextByKey("P_FR_MODEL", "Model"), valueIndex: 'AssetModel', allowFilter: true, css: { 'width': 120, 'text-align': 'left' } },
|
||||
{ name: 'VIN', caption: GetTextByKey("P_FR_SNVIN", "SN/VIN"), valueIndex: 'VIN', css: { 'width': 180, 'text-align': 'left' } },
|
||||
{ name: 'VIN', caption: GetTextByKey("P_FR_SNVIN", "SN/VIN"), valueIndex: 'VIN', allowFilter: true, css: { 'width': 180, 'text-align': 'left' } },
|
||||
{ name: 'TransactionLocalDate', caption: GetTextByKey("P_FR_TRANSACTIONDATE", "Transaction Date"), valueIndex: 'TransactionLocalDate', css: { 'width': 120, 'text-align': 'left' } },
|
||||
{ name: 'DistributedBy', caption: GetTextByKey("P_FR_DISTRIBUTEDBY", "Distributed By"), valueIndex: 'DistributedBy', allowFilter: true, css: { 'width': 120, 'text-align': 'left' } },
|
||||
{ name: 'RetailerName', caption: GetTextByKey("P_FR_RETAILERNAME", "Retailer Name"), valueIndex: 'RetailerName', css: { 'width': 180, 'text-align': 'left' } },
|
||||
{ name: 'FuelingAssetName', caption: GetTextByKey("P_FR_ASSET", "Asset"), valueIndex: 'FuelingAssetName', css: { 'width': 180, 'text-align': 'left' } },
|
||||
{ name: 'Quantity', caption: GetTextByKey("P_FR_QUANTITY", "Quantity"), valueIndex: 'Quantity', css: { 'width': 80, 'text-align': 'right' } },
|
||||
{ name: 'Uom', caption: GetTextByKey("P_FR_UOM", "UOM"), valueIndex: 'Uom', css: { 'width': 80, 'text-align': 'left' } },
|
||||
{ name: 'UnitCost', caption: GetTextByKey("P_FR_UOMCOST", "Unit Cost"), valueIndex: 'UnitCost', css: { 'width': 80, 'text-align': 'right' } },
|
||||
{ name: 'TotalCost', caption: GetTextByKey("P_FR_TOTALCOST", "Total Cost"), valueIndex: 'TotalCost', css: { 'width': 80, 'text-align': 'right' } },
|
||||
{ name: 'DistributedBy', caption: GetTextByKey("P_FR_DISTRIBUTEDBY", "Distributed By"), allowFilter: true, valueIndex: 'DistributedBy', allowFilter: true, css: { 'width': 120, 'text-align': 'left' } },
|
||||
{ name: 'RetailerName', caption: GetTextByKey("P_FR_RETAILERNAME", "Retailer Name"), valueIndex: 'RetailerName', allowFilter: true, css: { 'width': 180, 'text-align': 'left' } },
|
||||
{ name: 'FuelingAssetName', caption: GetTextByKey("P_FR_ASSET", "Asset"), valueIndex: 'FuelingAssetName', allowFilter: true, css: { 'width': 180, 'text-align': 'left' } },
|
||||
{ name: 'Quantity', caption: GetTextByKey("P_FR_QUANTITY", "Quantity"), valueIndex: 'Quantity', allowFilter: true, css: { 'width': 80, 'text-align': 'right' } },
|
||||
{ name: 'Uom', caption: GetTextByKey("P_FR_UOM", "UOM"), valueIndex: 'Uom', allowFilter: true, css: { 'width': 80, 'text-align': 'left' } },
|
||||
{ name: 'UnitCost', caption: GetTextByKey("P_FR_UOMCOST", "Unit Cost"), allowFilter: true, valueIndex: 'UnitCost', css: { 'width': 80, 'text-align': 'right' } },
|
||||
{ name: 'TotalCost', caption: GetTextByKey("P_FR_TOTALCOST", "Total Cost"), allowFilter: true, valueIndex: 'TotalCost', css: { 'width': 80, 'text-align': 'right' } },
|
||||
{ name: 'Edit', caption: "", css: { 'width': 30, 'text-align': 'center' } },
|
||||
{ name: 'Delete', caption: "", css: { 'width': 30, 'text-align': 'center' } }
|
||||
];
|
||||
@ -190,8 +162,10 @@
|
||||
col.key = list_columns[hd].valueIndex;
|
||||
col.allowFilter = list_columns[hd].allowFilter;
|
||||
if (col.name === "Edit") {
|
||||
col.isurl = true;
|
||||
col.text = "\uf044";
|
||||
col.sortable = false;
|
||||
col.resizable = false;
|
||||
col.type = GridView.ColumnTypes.Icon;
|
||||
col.text = "edit";
|
||||
col.events = {
|
||||
onclick: function () {
|
||||
OnEdit();
|
||||
@ -203,8 +177,10 @@
|
||||
col.attrs = { 'title': GetTextByKey("P_FR_EDIT", 'Edit') };
|
||||
}
|
||||
else if (col.name === "Delete") {
|
||||
col.isurl = true;
|
||||
col.text = "\uf00d";
|
||||
col.sortable = false;
|
||||
col.resizable = false;
|
||||
col.type = GridView.ColumnTypes.Icon;
|
||||
col.text = "times";
|
||||
col.events = {
|
||||
onclick: function () {
|
||||
OnDelete(this);
|
||||
@ -222,16 +198,10 @@
|
||||
}
|
||||
columns.push(col);
|
||||
}
|
||||
grid_dt.canMultiSelect = false;
|
||||
grid_dt.multiSelect = false;
|
||||
grid_dt.columns = columns;
|
||||
grid_dt.init();
|
||||
grid_dt.rowdblclick = OnEdit;
|
||||
|
||||
grid_dt.selectedrowchanged = function (rowindex) {
|
||||
var rowdata = grid_dt.source[rowindex];
|
||||
if (rowdata) {
|
||||
}
|
||||
}
|
||||
grid_dt.onRowDblClicked = OnEdit;
|
||||
}
|
||||
|
||||
//执行iframe中函数
|
||||
@ -275,7 +245,7 @@
|
||||
showAlert(GetTextByKey("P_FR_PLEASESELECTAFUELRECORD", "Please select a fuel record."), GetTextByKey("P_FR_EDITFUELRECORD", "Edit Fuel Record"));
|
||||
return;
|
||||
}
|
||||
var record = grid_dt.source[index].Values;
|
||||
var record = grid_dt.source[index];
|
||||
if (!record)
|
||||
return;
|
||||
doIFrameFunc("init", [record], "iframfuelrecord");
|
||||
@ -308,26 +278,6 @@
|
||||
InitGridData();
|
||||
GetTypesData();
|
||||
|
||||
$('#startdatetxt').datetimepicker({
|
||||
timepicker: false,
|
||||
format: 'm/d/Y',
|
||||
enterLikeTab: false,
|
||||
onSelectDate: function (v, inp) {
|
||||
var date = new DateFormatter().formatDate(v, 'm/d/Y 00:00:00');
|
||||
inp.parent().data('val', [date]);
|
||||
}
|
||||
});
|
||||
|
||||
$('#enddatetxt').datetimepicker({
|
||||
timepicker: false,
|
||||
format: 'm/d/Y',
|
||||
enterLikeTab: false,
|
||||
onSelectDate: function (v, inp) {
|
||||
var date = new DateFormatter().formatDate(v, 'm/d/Y 00:00:00');
|
||||
inp.parent().data('val', [date]);
|
||||
}
|
||||
});
|
||||
|
||||
$('#searchinputtxt').keydown(enterKeydown);
|
||||
$('#typeselectinput').change(function () { OnRefresh(); });
|
||||
|
||||
@ -351,13 +301,26 @@
|
||||
}
|
||||
|
||||
function OnExport() {
|
||||
var begindate = $('#startdatetxt').val();
|
||||
var enddate = $('#enddatetxt').val();
|
||||
if (begindate && !$('#startdatetxt').is(':valid')) {
|
||||
showAlert(GetTextByKey('P_COMMON_BEGINDATEISINVALID', "The begin date is invalid."), GetTextByKey("P_FR_ERROR", 'Error'));
|
||||
return;
|
||||
}
|
||||
if (enddate && !$('#enddatetxt').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 searchtxt = "";
|
||||
searchtxt = htmlencode($.trim($('#searchinputtxt').val()));
|
||||
var type = $('#typeselectinput').find("option:selected").val();
|
||||
var from = htmlencode($('#startdatetxt').val());
|
||||
var to = htmlencode($('#enddatetxt').val());
|
||||
var aid = (!assetid || assetid == "") ? -1 : eval(assetid);
|
||||
window.open("../ExportToFile.aspx?type=fuelrecordmanagement&t=" + searchtxt + "&from=" + from + "&to=" + to + "&tp=" + type + "&aid=" + aid);
|
||||
window.open("../ExportToFile.aspx?type=fuelrecordmanagement&t=" + searchtxt + "&from=" + begindate + "&to=" + enddate + "&tp=" + type + "&aid=" + aid);
|
||||
}
|
||||
|
||||
</script>
|
||||
@ -374,10 +337,10 @@
|
||||
<input type="password" autocomplete="new-password" style="display: none" />
|
||||
<span data-lgid="P_FR_BEGINDATE_COLON">Begin Date: </span>
|
||||
<span>
|
||||
<input id="startdatetxt" type="text" style="width: 100px;" value="<%=BeginDate %>" autocomplete="off" /></span>
|
||||
<input id="startdatetxt" type="date" class="type-date" required min="1900-01-01" value="<%=BeginDate %>" style="width: 100px;" autocomplete="off" /></span>
|
||||
<span data-lgid="P_FR_ENDDATE_COLON">End Date: </span>
|
||||
<span>
|
||||
<input id="enddatetxt" type="text" style="width: 100px;" value="<%=EndDate %>" autocomplete="off" /></span>
|
||||
<input id="enddatetxt" type="date" class="type-date" required min="1900-01-01" value="<%=EndDate %>" style="width: 100px;" autocomplete="off" /></span>
|
||||
<span data-lgid="P_FR_ASSETTYPE_COLON" style="padding-left: 5px;">Type:</span> <select class="selectinput" id="typeselectinput"></select>
|
||||
<input id="searchinputtxt" type="text" autocomplete="off" />
|
||||
<input class="search" type="button" onclick="OnRefresh();" value="Search" data-lgid="P_FR_SEARCH" style="margin-left: 5px;" />
|
||||
|
Reference in New Issue
Block a user