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

@ -12,38 +12,6 @@
margin-right: 10px;
}
.dialog-content table {
border-collapse: collapse;
width: 100%;
}
.dialog-content table td.label {
width: 100px;
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;*/
width: 350px;
}
#dialogdatatb td {
padding-top: 30px;
}
@ -57,7 +25,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")%>" type="text/javascript"></script>
<script src="<%=GetFileUrlWithVersion("../fic/js/utility.js")%>" type="text/javascript"></script>
<script type="text/javascript">
var IsSuperAdmin =<%=IsSuperAdmin ?"true":"false"%>;
@ -107,7 +74,7 @@
}
function ShowDeviceDialog(type) {
showmaskbg(true);
//showmaskbg(true);
$('#dialog_gpsdevice1')
.attr('act', type)
.showDialogRight();
@ -125,7 +92,7 @@
var gpsDeviceID;
var gpsdata;
function OnEdit(type) {
var gps = grid_dt.source[grid_dt.selectedIndex].Values;
var gps = grid_dt.source[grid_dt.selectedIndex];
if (!gps) {
gpsDeviceID = undefined;
return;
@ -173,18 +140,30 @@
r.EngineHoursDate = r.PairedAsset.EngineHoursDate;
r.EngineHoursDateStr = r.PairedAsset.EngineHoursDateStr;
}
else {
r.MachineID = "";
r.VIN = "";
r.Name = "";
r.Year = "";
r.Make = "";
r.Model = "";
r.MachineType = "";
r.EngineHours = "";
r.EngineHoursDate = "";
r.EngineHoursDateStr = "";
}
for (var j in r) {
if (j === "Status")
r[j] = { DisplayValue: r["Status"] === 1 ? "Active" : "Inactive", Value: r[j] };
r[j] = { DisplayValue: r["Status"] === 1 ? GetTextByKey("P_MD_ACTIVE", "Active") : GetTextByKey("P_MD_INACTIVE", "Inactive"), Value: r[j] };
else if (j === "AddDate")
r[j] = { DisplayValue: r["AddDateStr"], Value: r[j] };
else if (j === "InvoiceDate")
r[j] = { DisplayValue: r["InvoiceDateStr"], Value: r[j] };
r[j] = { DisplayValue: r["InvoiceDateStr"], Value: r[j] || "" };
else if (j === "ServiceStartDate")
r[j] = { DisplayValue: r["ServiceStartDateStr"], Value: r[j] };
r[j] = { DisplayValue: r["ServiceStartDateStr"], Value: r[j] || "" };
else if (j === "EngineHoursDate")
r[j] = { DisplayValue: r["EngineHoursDateStr"], Value: r[j] };
r[j] = { DisplayValue: r["EngineHoursDateStr"], Value: r[j] || "" };
else if (j === "EngineHours")
r[j] = r[j] === 0 ? "" : r[j];
else if (j === "Year")
@ -192,11 +171,15 @@
else if (j === "Name")
r[j] = r[j] === "0" ? "" : r[j];
else if (j == "FIInstalltion") {
r[j] = { DisplayValue: r[j] == 1 ? "Yes" : "No", Value: r[j] };
r[j] = { DisplayValue: r[j] == 1 ? GetTextByKey("P_UTILITY_YES", "Yes") : GetTextByKey("P_UTILITY_NO", "No"), Value: r[j] };
}
}
var fr = { Values: r };
rows.push(fr);
if (r.VIN == null) {
r.VIN = "";
}
rows.push(r);
}
grid_dt.setData(rows);
@ -204,15 +187,10 @@
var grid_dt;
function InitGridData() {
grid_dt = new GridView('#devicelist');
grid_dt.lang = {
all: GetTextByKey("P_GRID_ALL", "(All)"),
ok: GetTextByKey("P_GRID_OK", "OK"),
reset: GetTextByKey("P_GRID_RESET", "Reset")
};
grid_dt = createGridView('#devicelist');
var list_columns = [
{ name: 'SN', caption: GetTextByKey("P_MD_SN", "Air ID or SN"), valueIndex: 'SerialNumber', css: { 'width': 120, 'text-align': 'left' } },
{ name: 'AlternativeSerialNumber', caption: GetTextByKey("P_MD_ESN", "ESN"), valueIndex: 'AlternativeSerialNumber', css: { 'width': 120, 'text-align': 'left' } },
{ name: 'SN', caption: GetTextByKey("P_MD_SN", "Air ID or SN"), valueIndex: 'SerialNumber', allowFilter: true, css: { 'width': 120, 'text-align': 'left' } },
{ name: 'AlternativeSerialNumber', caption: GetTextByKey("P_MD_ESN", "ESN"), valueIndex: 'AlternativeSerialNumber', allowFilter: true, css: { 'width': 120, 'text-align': 'left' } },
{ name: 'DeviceType', caption: GetTextByKey("P_MD_DEVICETYPE", "Device Type"), valueIndex: 'DeviceType', allowFilter: true, css: { 'width': 120, 'text-align': 'left' } },
{ name: 'Source', caption: GetTextByKey("P_MD_SOURCE", "Source"), valueIndex: 'SourceName', allowFilter: true, css: { 'width': 120, 'text-align': 'left' } },
{ name: 'Status', caption: GetTextByKey("P_MD_STATUS", "Status"), valueIndex: 'Status', allowFilter: true, css: { 'width': 80, 'text-align': 'left' } },
@ -230,8 +208,8 @@
{ name: 'EngineHours', caption: GetTextByKey("P_MD_ENGINEHOURS", "Engine Hours"), valueIndex: 'EngineHours', css: { 'width': 90, 'text-align': 'left' } },
{ name: 'EngineHoursDate', caption: GetTextByKey("P_MD_ENGINEHOURSDATE", "Engine Hours Date"), valueIndex: 'EngineHoursDate', css: { 'width': 120, 'text-align': 'left' } },
{ name: 'InvoiceDate', caption: GetTextByKey("P_MD_INVOICEDATE", "Invoice Date"), valueIndex: 'InvoiceDate', css: { 'width': 100, 'text-align': 'left' } },
{ name: 'InvoiceNumber', caption: GetTextByKey("P_MD_INVOICENUMBER", "Invoice #"), valueIndex: 'InvoiceNumber', css: { 'width': 120, 'text-align': 'left' } },
{ name: 'SalesOrderNumber', caption: GetTextByKey("P_MD_XXXXXX", "Sales Order #"), valueIndex: 'SalesOrderNumber', css: { 'width': 120, 'text-align': 'left' } },
{ name: 'InvoiceNumber', caption: GetTextByKey("P_MD_INVOICENUMBER", "Invoice #"), valueIndex: 'InvoiceNumber', allowFilter: true, css: { 'width': 120, 'text-align': 'left' } },
{ name: 'SalesOrderNumber', caption: GetTextByKey("P_MD_SALESORDER", "Sales Order #"), valueIndex: 'SalesOrderNumber', allowFilter: true, css: { 'width': 120, 'text-align': 'left' } },
{ name: 'Edit', caption: "", css: { 'width': 30, 'text-align': 'center' } },
{ name: 'ONotes', caption: "", css: { 'width': 30, 'text-align': 'center' } },
{ name: 'ChangeContractor', caption: "", css: { 'width': 30, 'text-align': 'center' } }
@ -249,8 +227,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(0);
@ -262,8 +242,10 @@
col.attrs = { 'title': GetTextByKey("P_MD_EDIT", 'Edit') };
}
else if (col.name === "ONotes") {
col.isurl = true;
col.text = "\uf075";
col.sortable = false;
col.resizable = false;
col.type = GridView.ColumnTypes.Icon;
col.text = "comment";
col.events = {
onclick: function () {
OnEdit(1);
@ -277,8 +259,10 @@
else if (col.name === "ChangeContractor") {
if (!IsDealer)
continue;
col.isurl = true;
col.text = "\uf0ec";
col.sortable = false;
col.resizable = false;
col.type = GridView.ColumnTypes.Icon;
col.text = "exchange";
col.events = {
onclick: function () {
OnChangeContractor(1);
@ -295,21 +279,21 @@
}
columns.push(col);
}
grid_dt.canMultiSelect = false;
grid_dt.multiSelect = false;
grid_dt.columns = columns;
grid_dt.init();
grid_dt.rowdblclick = function () { OnEdit(0) };
grid_dt.onRowDblClicked = function () { OnEdit(0) };
grid_dt.selectedrowchanged = function (rowindex) {
grid_dt.onSelectedRowChanged = function (rowindex) {
var rowdata = grid_dt.source[rowindex];
if (rowdata) {
gpsDeviceID = rowdata.Values.Id;
gpsDeviceID = rowdata.Id;
}
}
}
function OnChangeContractor() {
var gps = grid_dt.source[grid_dt.selectedIndex].Values;
var gps = grid_dt.source[grid_dt.selectedIndex];
if (!gps) {
gpsDeviceID = undefined;
return;
@ -485,7 +469,7 @@
columnsdata.push({ Id: "InvoiceDate", Name: GetTextByKey("P_MD_INVOICEDATE", "Invoice Date"), Width: 120, Key: 'InvoiceDate' });
columnsdata.push({ Id: "InvoiceNumber", Name: GetTextByKey("P_MD_INVOICENUMBER", "Invoice #"), Width: 120, Key: 'InvoiceNumber' });
if (IsSuperAdmin) {
columnsdata.push({ Id: "SalesOrderNumber", Name: GetTextByKey("P_MD_XXXXXX", "Sales Order #"), Width: 120, Key: 'SalesOrderNumber' });
columnsdata.push({ Id: "SalesOrderNumber", Name: GetTextByKey("P_MD_SALESORDER", "Sales Order #"), Width: 120, Key: 'SalesOrderNumber' });
}
columnsdata.push({ Id: "ServiceStartDate", Name: GetTextByKey("P_MD_SERVICESTATDATE", "Service Start Date"), Width: 120, Key: 'ServiceStartDate' });
columnsdata.push({ Id: "VIN/SN", Name: GetTextByKey("P_MA_VINSN", "VIN/SN"), Width: 120, Key: 'VIN' });
@ -499,7 +483,7 @@
return columnsdata;
}
function CreateSelect(excelcolumns, colid) {
function CreateSelect(excelcolumns, colid, colname) {
var sel = $('<select style="width:180px;" name="sel_import"></select>').data('id', colid);
sel.append('<option></option>');
if (excelcolumns && excelcolumns.length > 0) {
@ -507,7 +491,7 @@
var op = $('<option></option>').text(excelcolumns[i]).val(excelcolumns[i]);
sel.append(op);
}
sel.val(colid);
sel.val(colname);
}
return sel;
}
@ -528,7 +512,7 @@
tr.append(td);
td = $('<td></td>');
tr.append(td);
var sel = CreateSelect(excelcolumns, col.Id);
var sel = CreateSelect(excelcolumns, col.Id, col.Name);
td.append(sel);
}
}
@ -574,7 +558,7 @@
}
columns.push(col);
}
grid_import_result.canMultiSelect = false;
grid_import_result.multiSelect = false;
grid_import_result.columns = columns;
grid_import_result.init();
@ -589,27 +573,26 @@
for (var j in r) {
if (j === "Status")
r[j] = { DisplayValue: r["Status"] === 1 ? "Active" : "Inactive", Value: r[j] };
r[j] = { DisplayValue: r["Status"] === 1 ? GetTextByKey('P_MD_ACTIVE', "Active") : GetTextByKey('P_MD_INACTIVE', "Inactive"), 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[j] };
else if (j == "Tamper") {
r[j] = { DisplayValue: r[j] == 1 ? "Yes" : "No", Value: r[j] };
r[j] = { DisplayValue: r[j] == 1 ? GetTextByKey("P_UTILITY_YES", "Yes") : GetTextByKey("P_UTILITY_NO", "No"), Value: r[j] };
}
else if (j == "FIInstalltion") {
r[j] = { DisplayValue: r[j] == 1 ? "Yes" : "No", Value: r[j] };
r[j] = { DisplayValue: r[j] == 1 ? GetTextByKey("P_UTILITY_YES", "Yes") : GetTextByKey("P_UTILITY_NO", "No"), Value: r[j] };
}
else if (j == "Utilization") {
r[j] = { DisplayValue: r[j] == 1 ? "Yes" : "No", Value: r[j] };
r[j] = { DisplayValue: r[j] == 1 ? GetTextByKey("P_UTILITY_YES", "Yes") : GetTextByKey("P_UTILITY_NO", "No"), Value: r[j] };
}
}
var fr = { Values: r };
rows.push(fr);
rows.push(r);
}
grid_import_result.setData(rows);
grid_import_result.resize();
grid_import_result.reload(true);
}
@ -699,7 +682,7 @@
var selected = [];
if (t == 1) {
for (var i in grid_import_result.source) {
selected.push(grid_import_result.source[i].Values.checked);
selected.push(grid_import_result.source[i].checked);
}
grid_import_result.setData([]);
}
@ -831,7 +814,9 @@
<div class="clear"></div>
<div id="devicelist"></div>
</div>
<div id="mask_bg" style="display: none;"><div class="loading c-spin"></div></div>
<div id="mask_bg" style="display: none;">
<div class="loading c-spin"></div>
</div>
<div class="dialog" id="dialog_gpsdevice1" style="display: none; height: 100%; border-bottom: 0; border-top: 0; z-index: 2">
<iframe id="iframe_gpsdevice" style="width: 100%; height: 100%; display: block; border: none" src="AddDevice.aspx"></iframe>
<div class="maskbg" style="display: none"></div>