sync
This commit is contained in:
@ -2,195 +2,14 @@
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
|
||||
<link href="../css/jquery.datetimepicker.css" rel="stylesheet" />
|
||||
<style type="text/css">
|
||||
.itemselcted {
|
||||
background-color: #ccc;
|
||||
}
|
||||
|
||||
.itemhidden {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.itemsuggested {
|
||||
background-color: #ffff99;
|
||||
}
|
||||
|
||||
#tbMachineTypes tbody tr:hover {
|
||||
cursor: default;
|
||||
background: #ddd;
|
||||
}
|
||||
|
||||
#tbodyAssigned tr:hover {
|
||||
cursor: default;
|
||||
background: #ddd;
|
||||
}
|
||||
|
||||
#tbodyUnassigned tr:hover {
|
||||
cursor: default;
|
||||
background: #ddd;
|
||||
}
|
||||
|
||||
#tbodySelected tr:hover {
|
||||
cursor: default;
|
||||
background: #ddd;
|
||||
}
|
||||
|
||||
#contentctrl {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.float_left {
|
||||
float: left;
|
||||
}
|
||||
|
||||
.function_bar {
|
||||
float: right;
|
||||
}
|
||||
|
||||
.user_main {
|
||||
padding: 0 4px;
|
||||
}
|
||||
|
||||
.dialog .dialog-title .dialog-close {
|
||||
float: right;
|
||||
margin-right: 6px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.dialog .dialog-title .dialog-close:before {
|
||||
content: '\e600';
|
||||
}
|
||||
|
||||
.dialog-content table {
|
||||
border-collapse: collapse;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.dialog-content table td.label {
|
||||
width: 170px;
|
||||
text-align: right;
|
||||
padding-right: 10px;
|
||||
line-height: 28px;
|
||||
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_machines .dialog-content table td input,
|
||||
#dialog_layouts .dialog-content table td input {
|
||||
width: auto;
|
||||
}
|
||||
|
||||
.dialog-content table td input[type="checkbox"] {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.dialog-content table td textarea {
|
||||
height: 100px;
|
||||
max-width: 200px;
|
||||
}
|
||||
|
||||
#dialog_user_randompass {
|
||||
width: auto;
|
||||
height: 16px;
|
||||
margin: 3px 4px 0 4px;
|
||||
}
|
||||
|
||||
.icon {
|
||||
font-family: CalciteWebCoreIcons;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.machine_filter {
|
||||
height: 20px;
|
||||
line-height: 20px;
|
||||
}
|
||||
|
||||
.machine_filter select {
|
||||
height: 23px;
|
||||
min-width: 100px;
|
||||
max-width: 300px;
|
||||
}
|
||||
|
||||
.ybutton {
|
||||
width: 80px;
|
||||
line-height: normal;
|
||||
margin-left: 6px;
|
||||
border: none;
|
||||
background: rgb(249, 189, 117);
|
||||
padding: 5px 14px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.ybutton:hover {
|
||||
background: #d7690E;
|
||||
}
|
||||
|
||||
.td_controller {
|
||||
vertical-align: middle;
|
||||
padding: 40px 8px;
|
||||
/*border-left: 1px solid #b0b0b0;
|
||||
border-right: 1px solid #b0b0b0;*/
|
||||
}
|
||||
|
||||
.ctl_button {
|
||||
font-family: 'CalciteWebCoreIcons';
|
||||
display: block;
|
||||
margin: 6px auto;
|
||||
width: 60px;
|
||||
height: 22px;
|
||||
line-height: 21px;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.subdialog {
|
||||
width: -moz-calc(100% - 24px);
|
||||
width: -webkit-calc(100% - 24px);
|
||||
width: calc(100% - 24px);
|
||||
}
|
||||
|
||||
.machine_maskbg {
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
background: #000;
|
||||
opacity: 0.2;
|
||||
}
|
||||
|
||||
#machine-name {
|
||||
margin: 10px 10px 6px;
|
||||
/*color: gray;*/
|
||||
font-weight: lighter;
|
||||
font-size: 18px;
|
||||
width: 770px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
</style>
|
||||
<link href="<%=GetFileUrlWithVersion("../css/panel.css")%>" rel="stylesheet" />
|
||||
<link href="<%=GetFileUrlWithVersion("../css/spectrum.css")%>" rel="stylesheet" type="text/css" />
|
||||
<link rel="stylesheet" type="text/css" href="../css/editmultiselect.css" />
|
||||
<script type="text/javascript" src="<%=GetFileUrlWithVersion("../js/vue.min.js")%>"></script>
|
||||
<script>Vue.config.productionTip = false; Vue.config.silent = true;</script>
|
||||
<script type="text/javascript" src="<%=GetFileUrlWithVersion("../js/components/datagrid.js")%>"></script>
|
||||
<script src="../js/spectrum.js?v=1" type="text/javascript"></script>
|
||||
<script src="../js/jquery.datetimepicker.full.js"></script>
|
||||
<script src="<%=GetFileUrlWithVersion("../js/assetselector.js")%>" type="text/javascript"></script>
|
||||
<script src="<%=GetFileUrlWithVersion("../js/editmultiselect.js")%>" type="text/javascript"></script>
|
||||
<script src="<%=GetFileUrlWithVersion("../js/gridlayout.js")%>" type="text/javascript"></script>
|
||||
<script>
|
||||
_network.jobsitequery = function (method, param, callback, error, nolog) {
|
||||
@ -199,10 +18,9 @@
|
||||
|
||||
var gridLayoutID = "Jobsites";
|
||||
var _allJobSites;
|
||||
var jobsitetypeparam;
|
||||
var IsAdmin =<%=IsAdmin ?"true":"false"%>;
|
||||
|
||||
/***************************Jobsites***************************/
|
||||
/***************************Jobsites***************************/
|
||||
|
||||
function OnDelete(jobsite) {
|
||||
if (!jobsite) {
|
||||
@ -263,7 +81,7 @@
|
||||
|
||||
var jobsiteid;
|
||||
function OnEdit() {
|
||||
var jobsite = grid_dt.source[grid_dt.selectedIndex].Values;
|
||||
var jobsite = grid_dt.source[grid_dt.selectedIndex];
|
||||
if (!jobsite) {
|
||||
jobsiteid = undefined;
|
||||
return;
|
||||
@ -285,9 +103,7 @@
|
||||
|
||||
var searchtxt = "";
|
||||
searchtxt = htmlencode($.trim($('#searchinputtxt').val()));
|
||||
var jobsitetypes = [];
|
||||
if (jobsitetypeparam)
|
||||
jobsitetypes = jobsitetypeparam.selectedvalue;
|
||||
var jobsitetypes = $("#div_jobsitetype").dropdownVals();
|
||||
var active = $('#chk_activesitesonly').prop('checked');
|
||||
|
||||
_network.jobsitequery("GetJobSites", JSON.stringify(jobsitetypes) + String.fromCharCode(170) + searchtxt + String.fromCharCode(170) + active, function (data) {
|
||||
@ -303,6 +119,13 @@
|
||||
var rows = [];
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
var r = data[i];
|
||||
var radiusstr = "";
|
||||
if (r.Radius > 0) {
|
||||
if (r.Radius_UOM === "Mile")
|
||||
radiusstr = r.Radius + " " + GetTextByKey('P_JS_MILE', 'Mile') + '(s)';
|
||||
else if (r.Radius_UOM === "Kilometre")
|
||||
radiusstr = r.Radius + " " + GetTextByKey('P_JS_KILOMETER', 'Kilometer') + '(s)';
|
||||
}
|
||||
for (var j in r) {
|
||||
//if (j === "Radius_UOM")
|
||||
// r[j] = { DisplayValue: r["Radius"] > 0 ? r["Radius_UOM"] : '', Value: r["Radius"] > 0 ? r[j] : '' };
|
||||
@ -312,9 +135,10 @@
|
||||
r[j] = { DisplayValue: r["EndDateStr"], Value: r[j] };
|
||||
else if (j === "ProjectedEndDate")
|
||||
r[j] = { DisplayValue: r["ProjectedEndDateStr"], Value: r[j] };
|
||||
else if (j === "RadiusStr")
|
||||
r[j] = { DisplayValue: radiusstr, Value: r[j] };
|
||||
}
|
||||
var fr = { Values: r };
|
||||
rows.push(fr);
|
||||
rows.push(r);
|
||||
}
|
||||
|
||||
grid_dt.setData(rows);
|
||||
@ -323,36 +147,31 @@
|
||||
|
||||
var grid_dt;
|
||||
function InitGridData() {
|
||||
grid_dt = new GridView('#jobsitelist');
|
||||
grid_dt.lang = {
|
||||
all: GetTextByKey("P_GRID_ALL", "(All)"),
|
||||
ok: GetTextByKey("P_GRID_OK", "OK"),
|
||||
reset: GetTextByKey("P_GRID_RESET", "Reset")
|
||||
};
|
||||
grid_dt = createGridView('#jobsitelist');
|
||||
var list_columns = [
|
||||
{ name: 'Name', caption: GetTextByKey("P_JS_NAME", "Name"), valueIndex: 'Name', css: { 'width': 200, 'text-align': 'left' } },
|
||||
{ name: 'Region', caption: GetTextByKey("P_JS_REGION", "Region"), valueIndex: 'Region', css: { 'width': 120, 'text-align': 'left' } },
|
||||
{ name: 'Number', caption: GetTextByKey("P_JS_NUMBER", "Number"), valueIndex: 'Number', css: { 'width': 120, 'text-align': 'left' } },
|
||||
{ name: 'Code', caption: GetTextByKey("P_JS_CODE", "Code"), valueIndex: 'Code', css: { 'width': 120, 'text-align': 'left' } },
|
||||
{ name: 'Name', caption: GetTextByKey("P_JS_NAME", "Name"), valueIndex: 'Name', allowFilter: true, css: { 'width': 200, 'text-align': 'left' } },
|
||||
{ name: 'Region', caption: GetTextByKey("P_JS_REGION", "Region"), valueIndex: 'Region', allowFilter: true, css: { 'width': 120, 'text-align': 'left' } },
|
||||
{ name: 'Number', caption: GetTextByKey("P_JS_NUMBER", "Number"), valueIndex: 'Number', allowFilter: true, css: { 'width': 120, 'text-align': 'left' } },
|
||||
{ name: 'Code', caption: GetTextByKey("P_JS_CODE", "Code"), valueIndex: 'Code', allowFilter: true, css: { 'width': 120, 'text-align': 'left' } },
|
||||
{ name: 'Types', caption: GetTextByKey("P_JS_TYPES", "Types"), valueIndex: 'Types', allowFilter: true, css: { 'width': 160, 'text-align': 'left' } },
|
||||
{ name: 'Latitude', caption: GetTextByKey("P_JS_LATITUDE", "Latitude"), valueIndex: 'Latitude', css: { 'width': 100, 'text-align': 'right' } },
|
||||
{ name: 'Longitude', caption: GetTextByKey("P_JS_LONGITUDE", "Longitude"), valueIndex: 'Longitude', css: { 'width': 100, 'text-align': 'right' } },
|
||||
{ name: 'ColorString', caption: GetTextByKey("P_JS_COLOR", "Color"), valueIndex: 'ColorString', css: { 'width': 60, 'text-align': 'center' } },
|
||||
{ name: 'RadiusStr', caption: GetTextByKey("P_JS_RADIUS", "RadiusStr"), valueIndex: 'RadiusStr', css: { 'width': 100, 'text-align': 'right' } },
|
||||
{ name: 'BaseonAsset', caption: GetTextByKey("P_JS_BINDINGTOASSET", "Binding to Asset"), valueIndex: 'BaseonMachineName', css: { 'width': 200, 'text-align': 'left' } },
|
||||
{ name: 'Latitude', caption: GetTextByKey("P_JS_LATITUDE", "Latitude"), valueIndex: 'Latitude', allowFilter: true, css: { 'width': 100, 'text-align': 'right' } },
|
||||
{ name: 'Longitude', caption: GetTextByKey("P_JS_LONGITUDE", "Longitude"), valueIndex: 'Longitude', allowFilter: true, css: { 'width': 100, 'text-align': 'right' } },
|
||||
{ name: 'ColorString', caption: GetTextByKey("P_JS_COLOR", "Color"), valueIndex: 'ColorString', css: { 'width': 80, 'text-align': 'center' } },
|
||||
{ name: 'RadiusStr', caption: GetTextByKey("P_JS_RADIUS", "RadiusStr"), valueIndex: 'RadiusStr', allowFilter: true, css: { 'width': 100, 'text-align': 'right' } },
|
||||
{ name: 'BaseonAsset', caption: GetTextByKey("P_JS_BINDINGTOASSET", "Binding to Asset"), valueIndex: 'BaseonMachineName', allowFilter: true, css: { 'width': 200, 'text-align': 'left' } },
|
||||
//{ name: 'Radius', caption: GetTextByKey("P_JS_RADIUS", "Radius"), valueIndex: 'Radius', css: { 'width': 100, 'text-align': 'right' } },
|
||||
//{ name: 'Radius_UOM', caption: GetTextByKey("P_JS_RADIUSUOM", "Radius UOM"), valueIndex: 'Radius_UOM', allowFilter: true, css: { 'width': 100, 'text-align': 'left' } },
|
||||
{ name: 'Foreman', caption: GetTextByKey("P_JS_FOREMAN", "Foreman"), valueIndex: 'Foreman', css: { 'width': 120, 'text-align': 'left' } },
|
||||
{ name: 'Manager', caption: GetTextByKey("P_JS_MANAGER", "Manager"), valueIndex: 'Manager', visible: false, css: { 'width': 120, 'text-align': 'left' } },
|
||||
{ name: 'Phone', caption: GetTextByKey("P_JS_PHONE", "Phone"), valueIndex: 'Phone', visible: false, css: { 'width': 100, 'text-align': 'left' } },
|
||||
{ name: 'Email', caption: GetTextByKey("P_JS_EMAIL", "Email"), valueIndex: 'Email', visible: false, css: { 'width': 100, 'text-align': 'left' } },
|
||||
{ name: 'Group', caption: GetTextByKey("P_JS_GROUP", "Group"), valueIndex: 'Group', visible: false, css: { 'width': 100, 'text-align': 'left' } },
|
||||
{ name: 'Address1', caption: GetTextByKey("P_JS_DELIVERYADDRESS1", "Delivery Address 1"), valueIndex: 'Address1', visible: false, css: { 'width': 140, 'text-align': 'left' } },
|
||||
{ name: 'Address2', caption: GetTextByKey("P_JS_DELIVERYADDRESS2", "Delivery Address 2"), valueIndex: 'Address2', visible: false, css: { 'width': 140, 'text-align': 'left' } },
|
||||
{ name: 'City', caption: GetTextByKey("P_JS_CITY", "City"), valueIndex: 'City', visible: false, css: { 'width': 100, 'text-align': 'left' } },
|
||||
{ name: 'State', caption: GetTextByKey("P_JS_STATE", "State"), valueIndex: 'State', visible: false, css: { 'width': 100, 'text-align': 'left' } },
|
||||
{ name: 'Zip', caption: GetTextByKey("P_JS_ZIP", "Zip"), valueIndex: 'Zip', visible: false, css: { 'width': 100, 'text-align': 'left' } },
|
||||
{ name: 'County', caption: GetTextByKey("P_JS_COUNTY", "County"), valueIndex: 'County', visible: false, css: { 'width': 100, 'text-align': 'left' } },
|
||||
{ name: 'Foreman', caption: GetTextByKey("P_JS_FOREMAN", "Foreman"), valueIndex: 'Foreman', allowFilter: true, css: { 'width': 120, 'text-align': 'left' } },
|
||||
{ name: 'Manager', caption: GetTextByKey("P_JS_MANAGER", "Manager"), valueIndex: 'Manager', allowFilter: true, visible: false, css: { 'width': 120, 'text-align': 'left' } },
|
||||
{ name: 'Phone', caption: GetTextByKey("P_JS_PHONE", "Phone"), valueIndex: 'Phone', allowFilter: true, visible: false, css: { 'width': 100, 'text-align': 'left' } },
|
||||
{ name: 'Email', caption: GetTextByKey("P_JS_EMAIL", "Email"), valueIndex: 'Email', allowFilter: true, visible: false, css: { 'width': 100, 'text-align': 'left' } },
|
||||
{ name: 'Group', caption: GetTextByKey("P_JS_GROUP", "Group"), valueIndex: 'Group', allowFilter: true, visible: false, css: { 'width': 100, 'text-align': 'left' } },
|
||||
{ name: 'Address1', caption: GetTextByKey("P_JS_DELIVERYADDRESS1", "Delivery Address 1"), allowFilter: true, valueIndex: 'Address1', visible: false, css: { 'width': 140, 'text-align': 'left' } },
|
||||
{ name: 'Address2', caption: GetTextByKey("P_JS_DELIVERYADDRESS2", "Delivery Address 2"), allowFilter: true, valueIndex: 'Address2', visible: false, css: { 'width': 140, 'text-align': 'left' } },
|
||||
{ name: 'City', caption: GetTextByKey("P_JS_CITY", "City"), valueIndex: 'City', allowFilter: true, visible: false, css: { 'width': 100, 'text-align': 'left' } },
|
||||
{ name: 'State', caption: GetTextByKey("P_JS_STATE", "State"), valueIndex: 'State', allowFilter: true, visible: false, css: { 'width': 100, 'text-align': 'left' } },
|
||||
{ name: 'Zip', caption: GetTextByKey("P_JS_ZIP", "Zip"), valueIndex: 'Zip', allowFilter: true, visible: false, css: { 'width': 100, 'text-align': 'left' } },
|
||||
{ name: 'County', caption: GetTextByKey("P_JS_COUNTY", "County"), valueIndex: 'County', allowFilter: true, visible: false, css: { 'width': 100, 'text-align': 'left' } },
|
||||
{ name: 'StartDate', caption: GetTextByKey("P_JS_STATDATE", "Start Date"), valueIndex: 'StartDate', css: { 'width': 100, 'text-align': 'left' } },
|
||||
{ name: 'ProjectedEndDate', caption: GetTextByKey("P_JS_PROJECTEDENDDATE", "Projected End Date"), valueIndex: 'ProjectedEndDate', css: { 'width': 130, 'text-align': 'left' } },
|
||||
{ name: 'EndDate', caption: GetTextByKey("P_JS_ENDDATE", "End Date"), valueIndex: 'EndDate', css: { 'width': 100, 'text-align': 'left' } },
|
||||
@ -377,68 +196,68 @@
|
||||
col.alwaysshow = list_columns[hd].alwaysshow;
|
||||
if (col.name === "Edit") {
|
||||
col.sortable = false;
|
||||
col.isurl = true;
|
||||
col.text = "\uf044";
|
||||
col.resizable = false;
|
||||
col.type = GridView.ColumnTypes.Icon;
|
||||
col.text = 'edit';
|
||||
col.events = {
|
||||
onclick: function () {
|
||||
OnEdit()
|
||||
}
|
||||
};
|
||||
col.classFilter = function (e) {
|
||||
return "icon-col";
|
||||
}
|
||||
col.attrs = { 'title': GetTextByKey("P_JS_EDIT", 'Edit') };
|
||||
}
|
||||
else if (col.name === "Delete") {
|
||||
col.sortable = false;
|
||||
col.isurl = true;
|
||||
col.text = "\uf00d";
|
||||
col.resizable = false;
|
||||
col.type = GridView.ColumnTypes.Icon;
|
||||
col.text = 'times';
|
||||
col.events = {
|
||||
onclick: function () {
|
||||
OnDelete(this);
|
||||
}
|
||||
};
|
||||
col.classFilter = function (e) {
|
||||
return "icon-col";
|
||||
};
|
||||
col.attrs = { 'title': GetTextByKey("P_JS_DELETE", 'Delete') };
|
||||
}
|
||||
else if (col.name === "ManageAssets") {
|
||||
col.sortable = false;
|
||||
col.isurl = true;
|
||||
col.text = "\uf63c";
|
||||
col.resizable = false;
|
||||
col.type = GridView.ColumnTypes.Icon;
|
||||
col.text = 'truck-pickup';
|
||||
col.events = {
|
||||
onclick: function () {
|
||||
OnManageMachine(this);
|
||||
}
|
||||
};
|
||||
col.classFilter = function (e) {
|
||||
return "icon-col";
|
||||
};
|
||||
col.attrs = { 'title': GetTextByKey("P_JS_MANAGEASSETS", 'Manage Assets') };
|
||||
} else if (col.name === 'ColorString') {
|
||||
col.allowHtml = true;
|
||||
col.filter = function (item) {
|
||||
}
|
||||
else if (col.name === 'ColorString') {
|
||||
col.sortable = false;
|
||||
col.styleFilter = function (item) {
|
||||
var bg = 'rgb(' + item.Color.Red + ',' + item.Color.Green + ',' + item.Color.Blue + ')';
|
||||
var cb = '<div style="background:' + bg + ';width:16px;height:16px;"></div>';
|
||||
//return cb + item.ColorString;
|
||||
return cb;
|
||||
return { 'background-color': bg }
|
||||
};
|
||||
col.styleFilter = function () {
|
||||
return { display: 'block' };
|
||||
col.filter = function () { "" };
|
||||
}
|
||||
else if (col.name === 'RadiusStr') {
|
||||
col.sortFilter = function (a, b) {
|
||||
var ra = a.Radius;
|
||||
if (a.Radius_UOM == "Mile")
|
||||
ra = ra * 1.609344;
|
||||
var rb = b.Radius;
|
||||
if (b.Radius_UOM == "Mile")
|
||||
rb = rb * 1.609344;
|
||||
return ra > rb ? 1 : -1;
|
||||
};
|
||||
}
|
||||
columns.push(col);
|
||||
}
|
||||
grid_dt.canMultiSelect = false;
|
||||
//grid_dt.columns = columns;
|
||||
//grid_dt.init();
|
||||
grid_dt.rowdblclick = OnEdit;
|
||||
grid_dt.onRowDblClicked = OnEdit;
|
||||
|
||||
grid_dt.selectedrowchanged = function (rowindex) {
|
||||
grid_dt.onSelectedRowChanged = function (rowindex) {
|
||||
var rowdata = grid_dt.source[rowindex];
|
||||
if (rowdata) {
|
||||
jobsiteid = rowdata.Values.ID;
|
||||
jobsiteid = rowdata.ID;
|
||||
}
|
||||
}
|
||||
grid_dt.allcolumns = columns;
|
||||
@ -461,33 +280,31 @@
|
||||
dialogAssets.onOK = function (source) {
|
||||
var items = [];
|
||||
for (var i = 0; i < source.length; i++) {
|
||||
var it = source[i].Values;
|
||||
var it = source[i];
|
||||
if (it.Selected) {
|
||||
items.push({
|
||||
Values: {
|
||||
AssetId: it.Id,
|
||||
VIN: it.VIN,
|
||||
Name: it.Name,
|
||||
MakeName: it.MakeName,
|
||||
ModelName: it.ModelName,
|
||||
TypeName: it.TypeName,
|
||||
OnSite: false
|
||||
}
|
||||
AssetId: it.Id,
|
||||
VIN: it.VIN,
|
||||
Name: it.Name,
|
||||
MakeName: it.MakeName,
|
||||
ModelName: it.ModelName,
|
||||
TypeName: it.TypeName,
|
||||
OnSite: false
|
||||
});
|
||||
}
|
||||
}
|
||||
$("#dialogmask").hide();
|
||||
var params = [
|
||||
'', jobsiteid,
|
||||
JSON.stringify(items.map(function (f) { return f.Values.AssetId; }))
|
||||
JSON.stringify(items.map(function (f) { return f.AssetId; }))
|
||||
];
|
||||
_network.jobsitequery('AddAssetToJobSite', params.join(String.fromCharCode(170)), function (r) {
|
||||
if (r === 'OK') {
|
||||
items = items.filter(function (it) {
|
||||
var assetId = it.Values.AssetId;
|
||||
return grid_dtsm.innerSource.filter(function (st) { return st.Values.AssetId === assetId; }).length === 0;
|
||||
var assetId = it.AssetId;
|
||||
return grid_dtsm.source.filter(function (st) { return st.AssetId === assetId; }).length === 0;
|
||||
});
|
||||
grid_dtsm.setData(grid_dtsm.innerSource.concat(items));
|
||||
grid_dtsm.setData(grid_dtsm.source.concat(items));
|
||||
} else {
|
||||
showAlert(r, GetTextByKey("P_JS_ASSETASSIGNMENT", "Asset Assignment"));
|
||||
}
|
||||
@ -509,52 +326,33 @@
|
||||
if (r !== 'OK') {
|
||||
showAlert(r, alerttitle);
|
||||
} else {
|
||||
for (var i = 0; i < grid_dtsm.innerSource.length; i++) {
|
||||
var s = grid_dtsm.innerSource[i].Values;
|
||||
if (s.AssetId === item.AssetId) {
|
||||
grid_dtsm.innerSource.splice(i, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (grid_dtsm.source != null) {
|
||||
for (var j = 0; j < grid_dtsm.source.length; j++) {
|
||||
if (item.AssetId === grid_dtsm.source[j].Values.AssetId) {
|
||||
grid_dtsm.source.splice(j, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
grid_dtsm.reset();
|
||||
grid_dtsm.removeItem(grid_dtsm.selectedIndex);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function OnSiteChanging(item, input) {
|
||||
var input_chk = $(input).closest('td').find('input');
|
||||
var checked = !$(input_chk).prop('checked');
|
||||
if (navigator.userAgent.toUpperCase().indexOf("FIREFOX") >= 0)
|
||||
checked = !checked;
|
||||
var text = GetTextByKey("P_JS_ONSITETIPS", "You have manually assigned a jobsite. This action will disable geofence alerts and jobsite auto-assignment. Do you want to proceed? ");
|
||||
if (!checked)
|
||||
text = GetTextByKey("P_JS_ONSITETIPS1", "Are you sure you want to change the on-site of the asset:{0}?").replace('{0}', item.Name);
|
||||
showConfirm(text, GetTextByKey("P_JS_ONSITECHANGE", "On Site Change"), function () {
|
||||
$(input_chk).prop('checked', !$(input_chk).prop('checked')).change();
|
||||
});
|
||||
}
|
||||
|
||||
function OnSiteChanged() {
|
||||
var params = [
|
||||
'', jobsiteid,
|
||||
this.AssetId,
|
||||
this.OnSite ? '1' : '0'
|
||||
];
|
||||
$('#dialogmask').show();
|
||||
_network.jobsitequery('ChangeAssetOnSiteState', params.join(String.fromCharCode(170)), function (r) {
|
||||
$("#dialogmask").hide();
|
||||
if (r !== 'OK') {
|
||||
showAlert(r, GetTextByKey("P_JS_ASSETASSIGNMENT", "Asset Assignment"));
|
||||
}
|
||||
var item = this;
|
||||
var text = item.OnSite ?
|
||||
GetTextByKey("P_JS_ONSITETIPS", "You have manually assigned a jobsite. This action will disable geofence alerts and jobsite auto-assignment. Do you want to proceed? ") :
|
||||
GetTextByKey("P_JS_ONSITETIPS1", "Are you sure you want to change the on-site of the asset:{0}?").replace('{0}', item.Name);
|
||||
showConfirm(text, GetTextByKey("P_JS_ONSITECHANGE", "On Site Change"), function () {
|
||||
var params = [
|
||||
'', jobsiteid,
|
||||
item.AssetId,
|
||||
item.OnSite ? '1' : '0'
|
||||
];
|
||||
$('#dialogmask').show();
|
||||
_network.jobsitequery('ChangeAssetOnSiteState', params.join(String.fromCharCode(170)), function (r) {
|
||||
$("#dialogmask").hide();
|
||||
if (r !== 'OK') {
|
||||
showAlert(r, GetTextByKey("P_JS_ASSETASSIGNMENT", "Asset Assignment"));
|
||||
}
|
||||
});
|
||||
}, function () {
|
||||
item.OnSite = !item.OnSite;
|
||||
grid_dtsm.refresh();
|
||||
});
|
||||
}
|
||||
|
||||
@ -669,8 +467,7 @@
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
var r = data[i];
|
||||
r.State = "UNASSIGNED";
|
||||
var fr = { Values: r };
|
||||
rows.push(fr);
|
||||
rows.push(r);
|
||||
}
|
||||
|
||||
grid_dtam.setData(rows);
|
||||
@ -680,8 +477,7 @@
|
||||
var rows = [];
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
var r = data[i];
|
||||
var fr = { Values: r };
|
||||
rows.push(fr);
|
||||
rows.push(r);
|
||||
}
|
||||
|
||||
grid_dtsm.setData(rows);
|
||||
@ -689,12 +485,7 @@
|
||||
|
||||
var grid_dtam;
|
||||
function InitGridAvailableMachines() {
|
||||
grid_dtam = new GridView('#availablemachinelist');
|
||||
grid_dtam.lang = {
|
||||
all: GetTextByKey("P_GRID_ALL", "(All)"),
|
||||
ok: GetTextByKey("P_GRID_OK", "OK"),
|
||||
reset: GetTextByKey("P_GRID_RESET", "Reset")
|
||||
};
|
||||
grid_dtam = createGridView('#availablemachinelist');
|
||||
var list_columns = [
|
||||
{ name: 'DisplayName', caption: "Asset Name", valueIndex: 'DisplayName', css: { 'width': 170, 'text-align': 'left' } },
|
||||
{ name: 'State', caption: "Current State", valueIndex: 'State', css: { 'width': 100, 'text-align': 'left' } },
|
||||
@ -728,13 +519,13 @@
|
||||
}
|
||||
};
|
||||
}
|
||||
grid_dtam.canMultiSelect = true;
|
||||
grid_dtam.multiSelect = true;
|
||||
grid_dtam.columns = columns;
|
||||
grid_dtam.init();
|
||||
grid_dtam.rowdblclick = function (rowindex) {
|
||||
grid_dtam.onRowDblClicked = function (rowindex) {
|
||||
var rowdata = grid_dtam.source[rowindex];
|
||||
if (rowdata) {
|
||||
var machine = rowdata.Values;
|
||||
var machine = rowdata;
|
||||
_availableMachines.splice(_availableMachines.indexOf(machine), 1);
|
||||
machine.OnSite = true;
|
||||
_selectedMachines.push(machine);
|
||||
@ -743,23 +534,12 @@
|
||||
showMachines();
|
||||
}
|
||||
};
|
||||
|
||||
grid_dtam.selectedrowchanged = function (rowindex) {
|
||||
var rowdata = grid_dtam.source[rowindex];
|
||||
if (rowdata) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
var grid_dtsm;
|
||||
function InitGridSelectedMachines() {
|
||||
grid_dtsm = new GridView('#selectedmachinelist');
|
||||
grid_dtsm.lang = {
|
||||
all: GetTextByKey("P_GRID_ALL", "(All)"),
|
||||
ok: GetTextByKey("P_GRID_OK", "OK"),
|
||||
reset: GetTextByKey("P_GRID_RESET", "Reset")
|
||||
};
|
||||
grid_dtsm = createGridView('#selectedmachinelist');
|
||||
var list_columns = [
|
||||
{ name: 'OnSite', caption: GetTextByKey("P_JS_ONSITE", "On Site"), valueIndex: 'OnSite', type: 3, css: { 'width': 70, 'text-align': 'center' } },
|
||||
{ name: 'DisplayName', caption: GetTextByKey("P_JS_ASSETNAME", "Asset Name"), valueIndex: 'Name', css: { 'width': 170, 'text-align': 'left' } },
|
||||
@ -788,10 +568,6 @@
|
||||
}
|
||||
if (col.key === 'OnSite') {
|
||||
col.events = {
|
||||
onclick: function (e) {
|
||||
OnSiteChanging(this, e.target);
|
||||
return false;
|
||||
},
|
||||
onchange: OnSiteChanged
|
||||
};
|
||||
}
|
||||
@ -802,38 +578,19 @@
|
||||
width: 30,
|
||||
align: 'center',
|
||||
sortable: false,
|
||||
isurl: true,
|
||||
text: '\uf00d',
|
||||
resizable: false,
|
||||
type: GridView.ColumnTypes.Icon,
|
||||
text: 'times',
|
||||
events: {
|
||||
onclick: function () {
|
||||
OnMachineDeleteSingle(this);
|
||||
}
|
||||
},
|
||||
classFilter: function (e) {
|
||||
return "icon-col";
|
||||
},
|
||||
attrs: { 'title': 'Delete' }
|
||||
});
|
||||
grid_dtsm.canMultiSelect = true;
|
||||
grid_dtsm.multiSelect = true;
|
||||
grid_dtsm.columns = columns;
|
||||
grid_dtsm.init();
|
||||
//grid_dtsm.rowdblclick = function (rowindex) {
|
||||
// var rowdata = grid_dtsm.source[rowindex];
|
||||
// if (rowdata) {
|
||||
// var machine = rowdata.Values;
|
||||
// _selectedMachines.splice(_selectedMachines.indexOf(machine), 1);
|
||||
// _showSelectedMachines.splice(_showSelectedMachines.indexOf(machine), 1);
|
||||
// _availableMachines.push(machine);
|
||||
|
||||
// showMachines();
|
||||
// }
|
||||
//};
|
||||
|
||||
grid_dtsm.selectedrowchanged = function (rowindex) {
|
||||
var rowdata = grid_dtsm.source[rowindex];
|
||||
if (rowdata) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -843,7 +600,7 @@
|
||||
return;
|
||||
for (var i = 0; i < indexs.length; i++) {
|
||||
var index = indexs[i];
|
||||
var m = grid_dtam.source[index].Values;
|
||||
var m = grid_dtam.source[index];
|
||||
_availableMachines.splice(_availableMachines.indexOf(m), 1);
|
||||
m.OnSite = true;
|
||||
_selectedMachines.push(m);
|
||||
@ -867,7 +624,7 @@
|
||||
return;
|
||||
for (var i = 0; i < indexs.length; i++) {
|
||||
var index = indexs[i];
|
||||
var m = grid_dtsm.source[index].Values;
|
||||
var m = grid_dtsm.source[index];
|
||||
_selectedMachines.splice(_selectedMachines.indexOf(m), 1);
|
||||
_showSelectedMachines.splice(_showSelectedMachines.indexOf(m), 1);
|
||||
_availableMachines.push(m);
|
||||
@ -890,8 +647,9 @@
|
||||
'ID': jobsiteid,
|
||||
'Machines': []
|
||||
};
|
||||
for (var i = 0; i < grid_dtsm.innerSource.length; i++) {
|
||||
var m = grid_dtsm.innerSource[i].Values;
|
||||
var tempsource = grid_dtsm.source;
|
||||
for (var i = 0; i < tempsource.length; i++) {
|
||||
var m = tempsource[i];
|
||||
item.Machines.push({
|
||||
'AssetId': m.AssetId,
|
||||
'VIN': m.VIN,
|
||||
@ -959,7 +717,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
var jobsitetypesdata;
|
||||
function getJobsiteTypes() {
|
||||
_network.jobsitequery('GetJobSiteTypes', '', function (data) {
|
||||
if (typeof (data) === "string") {
|
||||
@ -971,13 +728,7 @@
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
items.push({ 'Key': data[i], 'Value': data[i] })
|
||||
}
|
||||
jobsitetypeparam = {
|
||||
items: items,
|
||||
selectedvalue: []
|
||||
};
|
||||
jobsitetypesdata = data;
|
||||
var iptalertype = editmultiselect(jobsitetypeparam);
|
||||
$('#div_jobsitetype').append(iptalertype);
|
||||
$('#div_jobsitetype').dropdownSource(items);
|
||||
});
|
||||
}
|
||||
|
||||
@ -990,6 +741,14 @@
|
||||
InitGridData();
|
||||
InitGridSelectedMachines();
|
||||
|
||||
$("#div_jobsitetype").css('width', 200).dropdown([], {
|
||||
search: true,
|
||||
multiselect: true,
|
||||
allowselectall: true,
|
||||
textKey: 'Value',
|
||||
valueKey: 'Key'
|
||||
});
|
||||
|
||||
getJobsiteTypes();
|
||||
$('#tbody_jobsite').click(function (e) {
|
||||
var target = $(e.target);
|
||||
@ -1053,9 +812,7 @@
|
||||
function OnExport() {
|
||||
var searchtxt = "";
|
||||
searchtxt = htmlencode($.trim($('#searchinputtxt').val()));
|
||||
var jobsitetypes = [];
|
||||
if (jobsitetypeparam)
|
||||
jobsitetypes = jobsitetypeparam.selectedvalue;
|
||||
var jobsitetypes = $("#div_jobsitetype").dropdownVals();
|
||||
var active = $('#chk_activesitesonly').prop('checked');
|
||||
|
||||
var layout = getLayoutOnGrid(grid_dt);
|
||||
@ -1122,6 +879,7 @@
|
||||
formData.append("iconFile", fildata);
|
||||
formData.append("MethodName", "GetImportJobsiteColumns");
|
||||
formData.append("ClientData", '');
|
||||
showloading(true);
|
||||
$.ajax({
|
||||
url: 'JobSIteManage.aspx',
|
||||
type: 'POST',
|
||||
@ -1133,6 +891,7 @@
|
||||
success: function (data) {
|
||||
if (typeof (data) === "string") {
|
||||
showAlert(data, GetTextByKey("P_JS_IMPORT", 'Import'));
|
||||
showloading(false);
|
||||
} else {
|
||||
CreateImportColumns(data);
|
||||
$('#dialog_import')
|
||||
@ -1145,6 +904,7 @@
|
||||
}
|
||||
},
|
||||
error: function (err) {
|
||||
showloading(false);
|
||||
showAlert(err.statusText, GetTextByKey("P_JS_IMPORT", 'Import'));
|
||||
}
|
||||
});
|
||||
@ -1202,6 +962,7 @@
|
||||
formData.append("iconFile", fildata);
|
||||
formData.append("MethodName", "ImportJobsites");
|
||||
formData.append("ClientData", param);
|
||||
$('#dialogimportmask').show();
|
||||
$.ajax({
|
||||
url: 'JobSIteManage.aspx',
|
||||
type: 'POST',
|
||||
@ -1214,6 +975,7 @@
|
||||
importing = false;
|
||||
if (typeof (data) === "string") {
|
||||
showAlert(data, GetTextByKey("P_JS_IMPORT", 'Import'));
|
||||
$('#dialogimportmask').hide();
|
||||
} else {
|
||||
showAlert(data + GetTextByKey("P_JS_JOBSITESIMPORTEDSUCCESSFULLY", ' jobsite(s) imported successfully.'), GetTextByKey("P_JS_IMPORT", 'Import Jobsites'));
|
||||
$('#dialog_import').hideDialog();
|
||||
@ -1224,6 +986,7 @@
|
||||
error: function (err) {
|
||||
importing = false;
|
||||
showAlert(err.statusText, GetTextByKey("P_JS_IMPORT", 'Import'));
|
||||
$('#dialogimportmask').hide();
|
||||
}
|
||||
});
|
||||
|
||||
@ -1263,7 +1026,7 @@
|
||||
<%}%>
|
||||
<span class="sbutton iconlayout iconmenu" data-lgid="P_MR_LAYOUT">Layout</span>
|
||||
</div>
|
||||
<div id="jobsitelist"></div>
|
||||
<div id="jobsitelist" class="fixedgrid"></div>
|
||||
</div>
|
||||
<div id="mask_bg" style="display: none;">
|
||||
<div class="loading c-spin"></div>
|
||||
@ -1283,7 +1046,7 @@
|
||||
<span class="sbutton iconrefresh" onclick="GetSelectedMachines()" data-lgid="P_JS_REFRESH"></span>
|
||||
</div>
|
||||
<div class="machine_title">
|
||||
<div id="machine-name"></div>
|
||||
<div id="machine-name" style="padding-left: 15px;"></div>
|
||||
</div>
|
||||
<div class="div_machines">
|
||||
<table class="table_holder">
|
||||
@ -1292,7 +1055,7 @@
|
||||
<td>Available Assets</td>
|
||||
<td></td>
|
||||
<td>Assigned Assets
|
||||
<input type="checkbox" id="chk_showallassignedassets" title="When checked, all associated or linked items will display regardless of filter. " /><label for="chk_showallassignedassets">Show All Assigned</label>
|
||||
<input type="checkbox" id="chk_showallassignedassets" title="When checked, all associated or linked items will display regardless of filter. " /><label for="chk_showallassignedassets" data-lgid="P_M3_SHOWALLASSIGNED">Show All Assigned</label>
|
||||
</td>
|
||||
</tr>
|
||||
</thead>
|
||||
@ -1354,5 +1117,6 @@
|
||||
<input type="button" onclick="OnImportJobsites();" value="OK" tabindex="27" />
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
<div id="dialogimportmask" class="maskbg" style="display: none;"><div class="loading c-spin"></div></div>
|
||||
</div>
|
||||
</asp:Content>
|
||||
|
Reference in New Issue
Block a user