sync
This commit is contained in:
@ -10,16 +10,6 @@
|
||||
display: none;
|
||||
}
|
||||
|
||||
.popus-close {
|
||||
float: right;
|
||||
margin-right: 6px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.popus-close:before {
|
||||
content: '\e600';
|
||||
}
|
||||
|
||||
textarea {
|
||||
resize: none;
|
||||
}
|
||||
@ -284,7 +274,6 @@
|
||||
</style>
|
||||
<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/assetselector.js")%>" type="text/javascript"></script>
|
||||
<script src="<%=GetFileUrlWithVersion("js/deviceparinglogs.js")%>" type="text/javascript"></script>
|
||||
@ -299,6 +288,8 @@
|
||||
|
||||
var needRefreshDataOnCancel = false;//在点Cancel时需要刷新数据
|
||||
|
||||
var _selectDeviceTypes = ["SMARTWITNESS", "IDRIVE"];
|
||||
|
||||
function devicerequest(method, param, callback, error) {
|
||||
_network.request("MachineDeviceManagement/ManageMachines.aspx", -1, method, param, callback, error || function (e) {
|
||||
console.log(e);
|
||||
@ -360,11 +351,13 @@
|
||||
if (hide) {
|
||||
$('#dialog_devicetype').show();
|
||||
$('#dialog_seldevicetype').hide();
|
||||
$('#dialog_divdevicetype').hide();
|
||||
$('#tr_tamper').hide();
|
||||
}
|
||||
else {
|
||||
$('#dialog_devicetype').hide();
|
||||
$('#dialog_seldevicetype').show();
|
||||
$('#dialog_divdevicetype').hide();
|
||||
$('#tr_tamper').show();
|
||||
}
|
||||
}
|
||||
@ -379,6 +372,7 @@
|
||||
$('#dialog_sn').val('');
|
||||
$('#dialog_asn').val('');
|
||||
$('#dialog_devicetype').val('');
|
||||
$('#dialog_divdevicetype').dropdownVal('');
|
||||
$('#dialog_source').val('CALAMP').change();
|
||||
$('#dialog_status').val(1);
|
||||
$('#dialog_notes').val('');
|
||||
@ -413,6 +407,7 @@
|
||||
|
||||
if (device.Source.toUpperCase() === "NIMBELINK") {
|
||||
$('#dialog_devicetype').hide();
|
||||
$('#dialog_divdevicetype').hide();
|
||||
$('#dialog_seldevicetype').show();
|
||||
$('#dialog_seldevicetype').val(device.DeviceType);
|
||||
if (device.DeviceType !== "ATU-RB-8")
|
||||
@ -430,6 +425,13 @@
|
||||
$('#dialog_utilization').prop('checked', false);
|
||||
}
|
||||
}
|
||||
else if (_selectDeviceTypes.indexOf(device.Source.toUpperCase()) >= 0) {
|
||||
$('#dialog_devicetype').hide();
|
||||
$('#dialog_seldevicetype').hide();
|
||||
$('#dialog_divdevicetype').show();
|
||||
setSelectDeviceTypes(device.Source, device.DeviceType);
|
||||
$('#dialog_divdevicetype').dropdownVal(device.DeviceType);
|
||||
}
|
||||
else
|
||||
$('#dialog_devicetype').val(device.DeviceType);
|
||||
|
||||
@ -484,6 +486,9 @@
|
||||
if (item.DeviceType === "ATU-RB-5" || item.DeviceType === "ATU-RB-6" || item.DeviceType === "ATU-RB-8")
|
||||
item.Utilization = $('#dialog_utilization').prop('checked');
|
||||
}
|
||||
else if (_selectDeviceTypes.indexOf(item.Source.toUpperCase()) >= 0) {
|
||||
item.DeviceType = $.trim($('#dialog_divdevicetype').dropdownVal());
|
||||
}
|
||||
else
|
||||
item.DeviceType = $.trim($('#dialog_devicetype').val());
|
||||
|
||||
@ -498,7 +503,7 @@
|
||||
|
||||
if (!item.SerialNumber || item.SerialNumber.length == 0) {
|
||||
if (item.Source.toUpperCase() === "CALAMP")
|
||||
showAlert(GetTextByKey("P_MD_XXXXX", 'The Device Air ID can not be empty.'), alerttitle);
|
||||
showAlert(GetTextByKey("P_MD_THEDEVICEAIRIDCANNOTBEEMPTY", 'The Device Air ID can not be empty.'), alerttitle);
|
||||
else
|
||||
showAlert(GetTextByKey("P_MD_SNCANNOTBEEMPTY", 'SN cannot be empty.'), alerttitle);
|
||||
$('#dialog_sn').focus();
|
||||
@ -548,7 +553,7 @@
|
||||
callback(item);
|
||||
} else {
|
||||
if (parseInt(data[1]) == -10) {
|
||||
var msg = GetTextByKey("P_MD_XXX", "Only 1 {0} can be assigned to an asset at a time.");
|
||||
var msg = GetTextByKey("P_MD_ONLY1CANBEASSIGNEDTOANASSETATATIME", "Only 1 {0} can be assigned to an asset at a time.");
|
||||
msg = msg.replace("{0}", $("#dialog_source").find("option:selected").text())
|
||||
showAlert(msg, savetitle);
|
||||
}
|
||||
@ -613,12 +618,78 @@
|
||||
var op = $("<option></option>").val(kv.Key.toUpperCase()).text(kv.Value);
|
||||
$("#dialog_source").append(op);
|
||||
}
|
||||
if (currentDevice)
|
||||
$('#dialog_source').val(currentDevice.Source.toUpperCase()).change();
|
||||
}
|
||||
|
||||
}, function (err) {
|
||||
});
|
||||
}
|
||||
|
||||
function getNimbelingTypes() {
|
||||
devicerequest("GetNimbelingTypes", '', function (data) {
|
||||
if (typeof (data) === "string") {
|
||||
showAlert(data, GetTextByKey("P_MD_ERROR", 'Error'));
|
||||
return;
|
||||
}
|
||||
if (data && data.length > 0) {
|
||||
$("#dialog_seldevicetype").empty();
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
var op = $("<option></option>").val(data[i]).text(data[i]);
|
||||
$("#dialog_seldevicetype").append(op);
|
||||
}
|
||||
if (currentDevice)
|
||||
$('#dialog_seldevicetype').val(currentDevice.DeviceType);
|
||||
}
|
||||
|
||||
}, function (err) {
|
||||
});
|
||||
}
|
||||
|
||||
var selectDeviceTypeData;
|
||||
function getSelectDeviceTypes() {
|
||||
devicerequest("GetDeviceTypes", '', function (data) {
|
||||
if (typeof (data) === "string") {
|
||||
showAlert(data, GetTextByKey("P_MD_ERROR", 'Error'));
|
||||
return;
|
||||
}
|
||||
if (data && data.length > 0) {
|
||||
selectDeviceTypeData = data;
|
||||
if (currentDevice && _selectDeviceTypes.indexOf(source.toUpperCase()) >= 0) {
|
||||
setSelectDeviceTypes(currentDevice.source);
|
||||
}
|
||||
}
|
||||
|
||||
}, function (err) {
|
||||
});
|
||||
}
|
||||
|
||||
function setSelectDeviceTypes(source, devicetype) {
|
||||
if (!selectDeviceTypeData)
|
||||
return;
|
||||
|
||||
var data = [];
|
||||
if (source.toUpperCase() === "SMARTWITNESS") {
|
||||
data = selectDeviceTypeData[0];
|
||||
}
|
||||
else if (source.toUpperCase() === "IDRIVE") {
|
||||
data = selectDeviceTypeData[1];
|
||||
}
|
||||
|
||||
var seldata = [];
|
||||
var exists = false;
|
||||
for (var type of data) {
|
||||
if (devicetype && type.toUpperCase() == devicetype.toUpperCase())
|
||||
exists = true;
|
||||
seldata.push({ value: type });
|
||||
}
|
||||
if (devicetype && !exists)
|
||||
seldata.push({ value: devicetype });
|
||||
$('#dialog_divdevicetype').dropdownSource(seldata);
|
||||
if (!devicetype && data.length > 0)
|
||||
$('#dialog_divdevicetype').dropdownVal(data[0]);
|
||||
}
|
||||
|
||||
function getDeviceComments() {
|
||||
var cid = $('#sel_contractor').val();
|
||||
showloading(true);
|
||||
@ -812,11 +883,17 @@
|
||||
}).click();
|
||||
}
|
||||
|
||||
|
||||
|
||||
var dialogAssets;
|
||||
$(function () {
|
||||
getGPSSources();
|
||||
getNimbelingTypes();
|
||||
|
||||
$('#dialog_divdevicetype').dropdown([], {
|
||||
input: false,
|
||||
maxlength: 50,
|
||||
textKey: 'value'
|
||||
});
|
||||
getSelectDeviceTypes();
|
||||
|
||||
dialogAssets = new $assetselector('dialog_machines');
|
||||
dialogAssets.forceSingle = true;
|
||||
@ -826,7 +903,7 @@
|
||||
dialogAssets.onOK = function (source, selectedIndex) {
|
||||
var selectedAsset = null;
|
||||
if (selectedIndex >= 0)
|
||||
selectedAsset = source[selectedIndex].Values;
|
||||
selectedAsset = source[selectedIndex];
|
||||
setMachineInfo(selectedAsset);
|
||||
showmaskbg(false);
|
||||
};
|
||||
@ -837,6 +914,7 @@
|
||||
dialogAssets.showSelector();
|
||||
});
|
||||
|
||||
|
||||
$("#btnUnpair").click(function () {
|
||||
setMachineInfo();
|
||||
});
|
||||
@ -862,7 +940,8 @@
|
||||
});
|
||||
$('#dialog_source').change(function () {
|
||||
setNimbeLink(true);
|
||||
if ($('#dialog_source').val() == "CALAMP") {
|
||||
var devicesource = $('#dialog_source').val();
|
||||
if (devicesource == "CALAMP") {
|
||||
$('#tr_asn').show();
|
||||
$("#lblsn").text(GetTextByKey("P_MD_DEVICEAIRID_COLON", "Device Air Id:"));
|
||||
}
|
||||
@ -871,7 +950,7 @@
|
||||
$('#dialog_asn').val("");
|
||||
$("#lblsn").text(GetTextByKey("P_MD_SN_COLON", "SN:"));
|
||||
|
||||
if ($('#dialog_source').val() == "NIMBELINK") //NimbeLink
|
||||
if (devicesource == "NIMBELINK") //NimbeLink
|
||||
{
|
||||
setNimbeLink(false);
|
||||
var type = $('#dialog_seldevicetype').val();
|
||||
@ -882,6 +961,12 @@
|
||||
else
|
||||
$('#tr_tamper').hide();
|
||||
}
|
||||
else if (_selectDeviceTypes.indexOf(devicesource.toUpperCase()) >= 0) {
|
||||
$('#dialog_devicetype').hide();
|
||||
$('#dialog_seldevicetype').hide();
|
||||
$('#dialog_divdevicetype').show();
|
||||
setSelectDeviceTypes(devicesource);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@ -955,7 +1040,7 @@
|
||||
<li id="li_deviceinfo" data-href="tab_deviceinfo" class="selected" data-lgid="P_MD_SUMMARY">Summary</li>
|
||||
<li id="li_comments" data-href="tab_comments" data-lgid="P_MD_NOTES">Notes</li>
|
||||
<li id="li_installationnotes" data-href="tab_installationnotes" data-lgid="P_MD_INSTALLATIONNOTES">Installation Notes</li>
|
||||
<li id="li_devicepairinginfo" data-href="tab_devicepairinginfo" data-lgid="P_MD_XXX">Pairing Info</li>
|
||||
<li id="li_devicepairinginfo" data-href="tab_devicepairinginfo" data-lgid="P_MD_PAIRINGINFO">Pairing Info</li>
|
||||
</ul>
|
||||
<div id="dialog_device" data-page="tab_deviceinfo" style="padding-top: 30px;">
|
||||
<div id="div_content">
|
||||
@ -981,12 +1066,8 @@
|
||||
<td class="label" data-lgid="P_MD_DEVICETYPE_COLON">Device Type:</td>
|
||||
<td>
|
||||
<input type="text" id="dialog_devicetype" maxlength="100" tabindex="4" autocomplete="off" />
|
||||
<select id="dialog_seldevicetype" tabindex="4" style="width: 204px; display: none;">
|
||||
<option value="ATU-RB-1">ATU-RB-1</option>
|
||||
<option value="ATU-RB-5">ATU-RB-5</option>
|
||||
<option value="ATU-RB-6">ATU-RB-6</option>
|
||||
<option value="ATU-RB-8">ATU-RB-8</option>
|
||||
</select>
|
||||
<select id="dialog_seldevicetype" tabindex="4" style="width: 204px; display: none;"></select>
|
||||
<div id="dialog_divdevicetype" tabindex="4" style="width: 204px; display: none;" class="dropdown"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -1008,7 +1089,7 @@
|
||||
<input type="text" id="dialog_invoiceno" maxlength="200" tabindex="7" autocomplete="off" /></td>
|
||||
</tr>
|
||||
<tr class="sadminonly">
|
||||
<td class="label" data-lgid="P_MD_XXXXXX_COLON">Sales Order #:</td>
|
||||
<td class="label" data-lgid="P_MD_SALESORDER_COLON">Sales Order #:</td>
|
||||
<td>
|
||||
<input type="text" id="dialog_salesordernumber" maxlength="100" tabindex="7" autocomplete="off" /></td>
|
||||
</tr>
|
||||
@ -1041,8 +1122,8 @@
|
||||
<td class="label" style="width: 100px;" data-lgid="P_MD_ASSETASSIGNMENT_COLON">Asset Assignment:</td>
|
||||
<td>
|
||||
<span id="spassignedasset"></span>
|
||||
<input type="button" id="btnSelectAsset" value="Select Asset" data-lgid="P_MD_ASSETASSIGNMENT" tabindex="9" style="width: 80px; height: 22px; margin-left: 5px;" />
|
||||
<input type="button" id="btnUnpair" value="Unpair This Device" data-lgid="P_MD_UNPAIRTHISDEVICE" tabindex="10" style="width: 120px; height: 22px; margin-left: 5px;" />
|
||||
<input type="button" id="btnSelectAsset" value="Select Asset" data-lgid="P_MD_ASSETASSIGNMENT" tabindex="9" style="width: unset; height: 22px; margin-left: 5px; padding: 2px 5px;" />
|
||||
<input type="button" id="btnUnpair" value="Unpair This Device" data-lgid="P_MD_UNPAIRTHISDEVICE" tabindex="10" style="width: unset; height: 22px; margin-left: 5px; padding: 2px 5px;" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
Reference in New Issue
Block a user