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

@ -3,43 +3,12 @@
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
<link href="<%=GetFileUrlWithVersion("../css/tabcontrol.css")%>" rel="stylesheet" />
<link href="<%=GetFileUrlWithVersion("css/maintenance.css")%>" rel="stylesheet" />
<style type="text/css">
::-ms-clear, ::-ms-reveal {
display: none;
}
.edit-content table {
border-collapse: collapse;
width: 100%;
}
.edit-content table td.label {
width: 130px;
text-align: right;
padding-right: 10px;
line-height: 24px;
height: 24px;
vertical-align: top;
}
.edit-content table td input,
.edit-content table td textarea {
border: 1px solid #a9a9a9;
width: 320px;
height: 18px;
padding: 1px;
}
.edit-content table td input[type="checkbox"] {
border: none;
}
.edit-content table td textarea {
height: 100px;
resize: none;
/*max-width: 200px;*/
}
.a {
text-decoration: none;
color: #2140fb;
@ -111,7 +80,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 src="<%=GetFileUrlWithVersion("../js/controls.js")%>" type="text/javascript"></script>
<script src="<%=GetFileUrlWithVersion("js/fuelrecordattachments.js")%>" type="text/javascript"></script>
<script src="<%=GetFileUrlWithVersion("../js/assetselector.js")%>" type="text/javascript"></script>
@ -124,10 +92,6 @@
var fueltypes = [];
var statedata = [];
var unitdata = [];
var editableSelectState;
var editableSelectMachine;
var editableSelectUnit;
function fuelrequest(method, param, callback, error) {
_network.request("Maintenance/AddFuelRecord.aspx", -1, method, param, callback, error || function (e) {
@ -145,7 +109,7 @@
}
function setMachineInfo() {
var machine = editableSelectMachine.selecteditem();
var machine = $('#dialog_machine').dropdownItem();
if (machine) {
$('#dialog_vin').text(machine.VIN);
$('#dialog_make').text(machine.MakeName);
@ -175,7 +139,7 @@
setEnable(false);
fuel = undefined;
fuelid = undefined;
editableSelectMachine.val('');
$('#dialog_machine').dropdownVal('');
setMachineInfo();
$('#dialog_transactiondate').val('');
$('#dialog_timehour').val('00');
@ -187,14 +151,14 @@
$('#dialog_fuelingasset').data('fuelingassetid', -1);
$('#dialog_retaileraddress').val('');
$('#dialog_retailercity').val('');
editableSelectState.val('');
$('#dialog_retailerstate').dropdownVal('');
$('#dialog_retailerzip').val('');
$('#dialog_odometer').val('');
$('#dialog_odometeruom').val(systemunitofodometer ? systemunitofodometer.toLowerCase() : "");
$('#dialog_fueltype').val('');
$('#dialog_odometeruom').dropdownVal(systemunitofodometer ? systemunitofodometer.toLowerCase() : "");
$('#dialog_fueltype').dropdownVal('');
$('#dialog_fueltypename').text('');
$('#dialog_brandname').val('');
editableSelectUnit.val('');
$('#dialog_unitofmeasure').dropdownVal('');
$('#dialog_quantity').val('');
$('#dialog_unitcost').val('');
$('#dialog_totalcost').val('');
@ -211,8 +175,8 @@
$('#tabAttachments').hide();
$("#tbAttas").empty();
$('#span_a').show();
editableSelectMachine.setEnable(false);
editableSelectMachine.val(fuel.AssetID);
$('#dialog_machine').dropdownDisabled(true);
$('#dialog_machine').dropdownVal(fuel.AssetID);
setMachineInfo();
var time = fuel.TransactionLocalDate.DisplayValue.split(' ');
$('#dialog_transactiondate').val(time[0]);
@ -242,14 +206,14 @@
setDistributedBy(distributedby);
$('#dialog_retaileraddress').val(fuel.RetailerAddress);
$('#dialog_retailercity').val(fuel.RetailerCity);
editableSelectState.text(fuel.RetailerState);
$('#dialog_retailerstate').dropdownVal(fuel.RetailerState);
$('#dialog_retailerzip').val(fuel.RetailerZip);
$('#dialog_odometer').val(fuel.Odomerter);
$('#dialog_odometeruom').val(fuel.OdometerUnits);
$('#dialog_fueltype').val(fuel.FuelType);
$('#dialog_odometeruom').dropdownVal(fuel.OdometerUnits);
$('#dialog_fueltype').dropdownVal(fuel.FuelType);
$('#dialog_fueltypename').text(fuel.FuelType);
$('#dialog_brandname').val(fuel.BrandName);
editableSelectUnit.text(fuel.Uom);
$('#dialog_unitofmeasure').dropdownVal(fuel.Uom);
$('#dialog_quantity').val(fuel.Quantity);
$('#dialog_unitcost').val(fuel.UnitCost);
$('#dialog_totalcost').val(fuel.TotalCost);
@ -281,6 +245,7 @@
if ($(obj).hasClass('disabled')) {
return;
}
var fueltype = $('#dialog_fueltype').dropdownItem();
var item = {
'TransactionDate': $('#dialog_transactiondate').val(),
'TicketNumber': $('#dialog_ticketnumber').val(),
@ -290,14 +255,14 @@
'FuelingAsset': $('#dialog_fuelingasset').data('fuelingassetid'),
'RetailerAddress': $('#dialog_retaileraddress').val(),
'RetailerCity': $('#dialog_retailercity').val(),
'RetailerState': $.trim(editableSelectState.text()),
'RetailerState': $.trim($('#dialog_retailerstate').dropdownVal()),
'RetailerZip': $('#dialog_retailerzip').val(),
'Odomerter': $('#dialog_odometer').val(),
'OdometerUnits': $('#dialog_odometeruom').val(),
'FuelTypeName': $("#dialog_fueltype").find("option:selected").text(),
'FuelType': $('#dialog_fueltype').val(),
'OdometerUnits': $.trim($('#dialog_odometeruom').dropdownVal()),
'FuelTypeName': fueltype.Value,
'FuelType': fueltype.Key,
'BrandName': $('#dialog_brandname').val(),
'Uom': $.trim(editableSelectUnit.text()),
'Uom': $.trim($('#dialog_unitofmeasure').dropdownVal()),
'Quantity': $('#dialog_quantity').val(),
'UnitCost': $('#dialog_unitcost').val(),
'TotalCost': $('#dialog_totalcost').val(),
@ -312,7 +277,7 @@
alerttitle = GetTextByKey("P_FR_ADDFUELRECORD", "Add Fule Record");
}
var machine = editableSelectMachine.selecteditem();
var machine = $('#dialog_machine').dropdownItem();
if (machine == null) {
showAlert(GetTextByKey("P_FR_ASSETNOTEMPTY", 'Asset cannot be empty.'), alerttitle);
$('#dialog_machine').focus();
@ -439,15 +404,16 @@
worequest("GetMachines", "", function (data) {
if (data && data.length > 0) {
machines = data;
editableSelectMachine.datasource = machines;
editableSelectMachine.valuepath = "Id"
editableSelectMachine.displaypath = "DisplayName";
if (fuel && fuel.AssetID !== undefined) {
editableSelectMachine.val(fuel.AssetID);
setMachineInfo();
}
}
$('#dialog_machine').dropdownSource(machines);
if (fuel && fuel.AssetID !== undefined) {
$('#dialog_machine').dropdownVal(fuel.AssetID);
setMachineInfo();
}
else {
$('#dialog_machine').dropdownVal('');
}
if (next)
next();
}, function (err) {
@ -464,9 +430,9 @@
$('.iconadd').css('display', 'none');
}
editableSelectMachine.setEnable(!enable);
editableSelectState.setEnable(!enable);
editableSelectUnit.setEnable(!enable);
$('#dialog_machine').dropdownDisabled(enable);
$('#dialog_retailerstate').dropdownDisabled(enable);
$('#dialog_unitofmeasure').dropdownDisabled(enable);
$('#tab_fuelrecordinformation input').attr('disabled', enable);
$('#tab_fuelrecordinformation select').attr('disabled', enable);
$('#tab_fuelrecordinformation textarea').attr('disabled', enable);
@ -493,10 +459,6 @@
$("#li_comments").hide();
}
$("#li_deviceinfo").click();
editableSelectMachine.reload();
editableSelectState.reload();
editableSelectUnit.reload();
}
@ -518,18 +480,21 @@
}
function getStates() {
statedata.push("AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DE", "FL", "GA", "HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MD", "MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ",
var data = [];
data.push("AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DE", "FL", "GA", "HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MD", "MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ",
"NM", "NY", "NC", "ND", "OH", "OK", "OR", "PA", "RI", "SC", "SD", "TN", "TX", "UT", "VT", "VA", "WA", "WV", "WI", "WY");
editableSelectState.datasource = statedata;
editableSelectState.valuepath = ""
editableSelectState.displaypath = "";
for (var type of data) {
statedata.push({ value: type });
}
$('#dialog_retailerstate').dropdownSource(statedata);
}
function getUnit() {
unitdata.push({ 'Key': 'GAL', 'Value': 'Gallon' }, { 'Key': 'Litre', 'Value': 'Litre' });
editableSelectUnit.datasource = unitdata;
editableSelectUnit.valuepath = "Key"
editableSelectUnit.displaypath = "Value";
$('#dialog_unitofmeasure').dropdownSource(unitdata);
}
function getFuelTypes() {
@ -540,16 +505,11 @@
}
if (data && data.length > 0) {
fueltypes = data;
$("#dialog_fueltype").empty();
for (var i = 0; i < data.length; i++) {
var kv = data[i];
var op = $("<option></option>").val(kv.Key).text(kv.Value);
$("#dialog_fueltype").append(op);
}
}
else
fueltypes = [];
$('#dialog_fueltype').dropdownSource(fueltypes);
}, function (err) {
});
}
@ -627,22 +587,43 @@
//*************************End Notes********************************//
$(function () {
editableSelectMachine = new $editableselect($("#dialog_machine"));
editableSelectMachine.tabIndex(1);
editableSelectMachine.change(function () {
$('#dialog_machine').dropdown([], {
search: true,
valueKey: 'Id',
textKey: 'DisplayName'
}).on('select', function (_e, item) {
setMachineInfo();
});
editableSelectState = new $editableselect($("#dialog_retailerstate"), 50);
editableSelectState.tabIndex(13);
editableSelectUnit = new $editableselect($("#dialog_unitofmeasure"));
editableSelectUnit.tabIndex(18);
$('#dialog_fueltype').change(function () {
var value = $("#dialog_fueltype").find("option:selected").val();
$('#dialog_fueltypename').text(value);
$('#dialog_retailerstate').dropdown([], {
input: true,
search: true,
maxlength: 50,
textKey: 'value'
});
$('#dialog_unitofmeasure').dropdown([], {
input: true,
maxlength: 50,
valueKey: 'Key',
textKey: 'Value'
});
$('#dialog_odometeruom').dropdown([
{ value: 'mile', text: GetTextByKey('P_FR_MILE', 'Mile') },
{ value: 'kilometre', text: GetTextByKey('P_FR_KILOMETER', 'Kilometer') }
], {
selected: 'mile'
});
$('#dialog_fueltype').dropdown([], {
valueKey: 'Key',
textKey: 'Value'
}).on('select', function (_e, fueltype) {
$('#dialog_fueltypename').text(fueltype.Key);
});
$("input[name=rdodistributedby]").each(function () {
$(this).click(function () {
var type = $(this).val();
@ -717,7 +698,7 @@
dialogAssets.onOK = function (source, selectedIndex) {
var selectedAsset = null;
if (selectedIndex >= 0)
selectedAsset = source[selectedIndex].Values;
selectedAsset = source[selectedIndex];
$('#dialog_fuelingasset').val(selectedAsset.DisplayName);
$('#dialog_fuelingasset').data('fuelingassetid', selectedAsset.Id);
showmaskbg(false);
@ -762,7 +743,7 @@
<tr>
<td class="label" data-lgid="P_FR_ASSET_COLON">Asset:</td>
<td colspan="4">
<div id="dialog_machine" style="width: 322px; height: 22px;"></div>
<div id="dialog_machine" style="width: 322px;" class="dropdown"></div>
</td>
</tr>
<tr>
@ -833,7 +814,7 @@
<input type="text" id="dialog_retailername" maxlength="100" tabindex="10" />
<label style="margin-left: 20px;" data-lgid="P_FR_ASSET_COLON">Asset:<span id="span_asset" style="display: none;">*</span></label>
<input type="text" readonly="readonly" disabled="disabled" id="dialog_fuelingasset" maxlength="100" tabindex="10" style="width: 200px;" />
<input type="button" onclick="OnSelectAssets();" id="btn_selectassets" value="Select" data-lgid="P_FR_SELCT" style="width: 100px; height: 22px;" />
<input type="button" onclick="OnSelectAssets();" id="btn_selectassets" value="Select" data-lgid="P_FR_SELCT" style="width: 100px; height: 28px;" />
</td>
</tr>
<tr>
@ -850,7 +831,7 @@
<input type="text" id="dialog_retailercity" maxlength="50" tabindex="12" style="width: 200px;" /></td>
<td data-lgid="P_FR_STATE_COLON">State:<span>*</span></td>
<td>
<div id="dialog_retailerstate" style="width: 150px; height: 22px;"></div>
<div id="dialog_retailerstate" class="dropdown" style="width: 150px;" tabindex="13"></div>
</td>
<td data-lgid="P_FR_ZIP_COLON">Zip:</td>
<td>
@ -870,10 +851,8 @@
<td style="min-width: 68px;"></td>
<td data-lgid="P_FR_ODOMETERUOM_COLON">Odometer Uom:</td>
<td>
<select id="dialog_odometeruom" tabindex="15" style="width: 200px;">
<option value="mile" data-lgid="P_FR_MILE">Mile</option>
<option value="kilometre" data-lgid="P_FR_KILOMETER">Kilometer</option>
</select></td>
<div id="dialog_odometeruom" style="width: 200px; display: inline-block" tabindex="15" class="dropdown"></div>
</td>
</tr>
</table>
@ -885,7 +864,8 @@
<table style="width: 601px;">
<tr>
<td style="padding: 0;">
<select id="dialog_fueltype" tabindex="16" style="width: 204px;"></select>
<%--<select id="dialog_fueltype" tabindex="16" style="width: 204px;"></select>--%>
<div id="dialog_fueltype" style="width: 200px; display: inline-block" tabindex="16" class="dropdown"></div>
</td>
<td style="min-width: 100px;"><span id="dialog_fueltypename" style="color: #adb0b4;"></span></td>
<td data-lgid="P_FR_BRANDNAME_COLON">Brand Name:</td>
@ -898,7 +878,7 @@
<tr>
<td class="label" data-lgid="P_FR_UNITOFMEASURE_COLON">Unit of Measure:<span>*</span></td>
<td>
<div id="dialog_unitofmeasure" style="width: 202px; height: 24px;"></div>
<div id="dialog_unitofmeasure" style="width: 202px;" class="dropdown"></div>
</td>
</tr>
<tr>