2292 lines
97 KiB
Plaintext
2292 lines
97 KiB
Plaintext
<%@ Page Title="" Language="C#" MasterPageFile="~/JobSite/JobSiteMasterPage.master" AutoEventWireup="true" CodeFile="AddJobSite.aspx.cs" Inherits="AddJobSite" %>
|
||
|
||
|
||
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
|
||
<style type="text/css">
|
||
::-ms-clear, ::-ms-reveal {
|
||
display: none;
|
||
}
|
||
|
||
.edit-content table {
|
||
border-collapse: collapse;
|
||
width: 100%;
|
||
}
|
||
|
||
.edit-content table td.label {
|
||
width: 200px;
|
||
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;
|
||
}
|
||
|
||
.subtitle {
|
||
margin: 20px 40px 5px 0px;
|
||
font-size: 16px;
|
||
color: gray;
|
||
}
|
||
|
||
.subtitle span {
|
||
margin-left: 10px;
|
||
}
|
||
|
||
.subtitle hr {
|
||
background-color: #d8d8d8;
|
||
border: none;
|
||
height: 1px;
|
||
}
|
||
|
||
|
||
.machinetd {
|
||
white-space: nowrap;
|
||
text-overflow: ellipsis;
|
||
overflow: hidden;
|
||
}
|
||
|
||
#basemapTitle {
|
||
position: absolute;
|
||
z-index: 2;
|
||
bottom: 0px;
|
||
width: 90%;
|
||
color: #4c4c4c;
|
||
margin: 0;
|
||
font-size: 10px;
|
||
line-height: 12px;
|
||
display: block;
|
||
padding: 2px 5%;
|
||
background: #fff;
|
||
background: rgba(255, 255, 255, 0.80);
|
||
-webkit-border-radius: 0 0 5px 5px;
|
||
-moz-border-radius: 0 0 5px 5px;
|
||
-o-border-radius: 0 0 5px 5px;
|
||
border-radius: 0 0 5px 5px;
|
||
text-align: center;
|
||
}
|
||
|
||
|
||
#basemapImg {
|
||
width: 100%;
|
||
height: 100%;
|
||
margin: 0;
|
||
padding: 0;
|
||
background-repeat: no-repeat;
|
||
background-position: center center;
|
||
-webkit-border-radius: 5px;
|
||
-moz-border-radius: 5px;
|
||
-o-border-radius: 5px;
|
||
border-radius: 5px;
|
||
}
|
||
|
||
|
||
|
||
#basemapgalleryDiv {
|
||
position: absolute;
|
||
right: 30px;
|
||
top: 100px;
|
||
z-index: 199;
|
||
background-color: #EFEFEF;
|
||
height: 75px;
|
||
width: 75px;
|
||
border: solid 1px #57585A;
|
||
border-radius: 5px;
|
||
padding: 1px;
|
||
}
|
||
|
||
#basemapGallery {
|
||
position: absolute;
|
||
right: 15px;
|
||
top: 35px;
|
||
width: 370px;
|
||
height: 120px;
|
||
overflow: auto;
|
||
display: none;
|
||
z-index: 200;
|
||
background-color: #EFEFEF;
|
||
}
|
||
|
||
.div_filter .dropdown {
|
||
width: 322px;
|
||
margin: 2px 0 0 0px;
|
||
}
|
||
|
||
.div_panel {
|
||
min-width: 322px;
|
||
}
|
||
|
||
#machine-name {
|
||
margin: 10px 10px 6px;
|
||
/*color: gray;*/
|
||
font-weight: lighter;
|
||
font-size: 18px;
|
||
width: 770px;
|
||
overflow: hidden;
|
||
text-overflow: ellipsis;
|
||
white-space: nowrap;
|
||
}
|
||
|
||
.jobsitetitle {
|
||
font-weight: bold;
|
||
font-size: 16px;
|
||
padding-left: 10px;
|
||
}
|
||
|
||
#div_jslocation {
|
||
position: absolute;
|
||
background-color: #E8E8E8;
|
||
padding: 5px;
|
||
margin-left: 60px;
|
||
}
|
||
|
||
.jslocation_lable {
|
||
text-align: right;
|
||
padding-right: 10px;
|
||
line-height: 24px;
|
||
}
|
||
</style>
|
||
|
||
<script>
|
||
//必须放在地图js之前
|
||
var dojoConfig = {
|
||
paths: {
|
||
extras1: location.pathname.replace(/\/[^/]+$/, "") + "/../js/mapview"
|
||
},
|
||
cacheBust: true
|
||
};
|
||
</script>
|
||
<link href="<%=GetFileUrlWithVersion("../css/jquery.datetimepicker.css")%>" rel="stylesheet" />
|
||
<script src="<%=GetFileUrlWithVersion("../js/jquery.datetimepicker.full.js")%>"></script>
|
||
<script src="<%=GetFileUrlWithVersion("../js/editableselect.js")%>"></script>
|
||
<%--<link rel="stylesheet" type="text/css" href="css/default.css" />--%>
|
||
<link href="<%=GetFileUrlWithVersion("../css/spectrum.css")%>" rel="stylesheet" type="text/css" />
|
||
<script src="../js/spectrum.js?v=1" type="text/javascript"></script>
|
||
<script src="../Maintenance/js/inputdatactr.js"></script>
|
||
<%--<script src="<%=GetFileUrlWithVersion("js/mapview.js")%>"></script>--%>
|
||
<%--<script src="<%=GetFileUrlWithVersion("js/mapinit3.19.js")%>"></script>--%>
|
||
<link rel="stylesheet" href="https://js.arcgis.com/3.40/esri/css/esri.css" />
|
||
<script src="https://js.arcgis.com/3.40"></script>
|
||
<script src="<%=GetFileUrlWithVersion("../js/editmultiselect.js")%>" type="text/javascript"></script>
|
||
<script src="<%=GetFileUrlWithVersion("../js/assetselector.js")%>" type="text/javascript"></script>
|
||
|
||
<script type="text/javascript">
|
||
var jobsiteid;
|
||
var jobsiteitem;
|
||
var polygonitem = [];
|
||
|
||
var rentalsdata = [];
|
||
var machines;
|
||
var enableInfoWindow = false;
|
||
|
||
var foremans;
|
||
var statedata = [];
|
||
var editableSelectForeman;
|
||
var editableSelectState;
|
||
var editableSelectState_use;
|
||
var centerassetid = -1;
|
||
var currentdate = "<%=CurrentDate %>";
|
||
|
||
_network.jobsitequery = function (method, param, callback, error, nolog) {
|
||
_network.request("JobSite/AddJobSite.aspx?tp=ashx", -1, method, param, callback, error, nolog);
|
||
}
|
||
|
||
function showConfirm1(msg, title, fok, fcancel) {
|
||
$("#dialogmask").show();
|
||
_dialog.showConfirm(msg, title, function (e) {
|
||
$("#dialogmask").hide();
|
||
if (typeof fok === 'function') {
|
||
fok(e);
|
||
}
|
||
}, function () {
|
||
$("#dialogmask").hide();
|
||
});
|
||
}
|
||
|
||
function OnAdd() {
|
||
jobsiteid = undefined;
|
||
jobsiteitem = undefined;
|
||
polygonitem = [];
|
||
if (graphicLayer)
|
||
graphicLayer.clear();
|
||
$('#dialog_jobsitename').val('');
|
||
$('#dialog_jobsitecode').val('');
|
||
$('#dialog_jobsitetype').val("");
|
||
$("#dialog_machine").val("");
|
||
$('#dialog_latitude').val('0').prop("disabled", false);
|
||
$('#dialog_longitude').val('0').prop("disabled", false);
|
||
$('#dialog_color').val('#000000');
|
||
$("#jobsitecolor").spectrum("set", "#000000");
|
||
$('#dialog_radius').val('0');
|
||
$('#dialog_radiusuom').val(systemunitofodometer);
|
||
polygonitem = [];
|
||
$('#dialog_startdate').val(currentdate);
|
||
$('#dialog_projectenddate').val('');
|
||
$('#dialog_enddate').val('');
|
||
$("#dialog_machine").prop("disabled", false);
|
||
$('#dialog_region').val('');
|
||
$('#dialog_number').val('');
|
||
editableSelectForeman.text('');
|
||
$('#dialog_manager').val('');
|
||
$('#dialog_phone').val('');
|
||
$('#dialog_email').val('');
|
||
$('#dialog_group').val('');
|
||
$('#dialog_deliveryaddress1').val('');
|
||
$('#dialog_deliveryaddress2').val('');
|
||
$('#dialog_city').val('');
|
||
editableSelectState.text('');
|
||
$('#dialog_zip').val('');
|
||
$('#dialog_county').val('');
|
||
$('#dialog_notes').val('');
|
||
getRegions();
|
||
}
|
||
|
||
function OnEdit() {
|
||
polygonitem = jobsiteitem.Polygon;
|
||
$('#dialog_jobsitename').val(jobsiteitem.Name);
|
||
$('#dialog_jobsitecode').val(jobsiteitem.Code);
|
||
|
||
if (jobsiteitem.Types && jobsiteitem.Types.length > 0)
|
||
$('#dialog_jobsitetype').val(jobsiteitem.Types[0]);
|
||
else
|
||
$('#dialog_jobsitetype').val("");
|
||
|
||
if (jobsiteitem.BaseOnMachineID > 0) {
|
||
$("#dialog_machine").val(jobsiteitem.BaseOnMachineID);
|
||
$('#dialog_latitude').prop("disabled", true);
|
||
$('#dialog_longitude').prop("disabled", true);
|
||
}
|
||
else {
|
||
$('#dialog_latitude').prop("disabled", false);
|
||
$('#dialog_longitude').prop("disabled", false);
|
||
$("#dialog_machine").val("");
|
||
}
|
||
$('#dialog_latitude').val(jobsiteitem.Latitude);
|
||
$('#dialog_longitude').val(jobsiteitem.Longitude);
|
||
$('#dialog_color').val(jobsiteitem.ColorString);
|
||
$("#jobsitecolor").spectrum("set", jobsiteitem.ColorString);
|
||
$('#dialog_radius').val(jobsiteitem.Radius);
|
||
$('#dialog_radiusuom').val(jobsiteitem.Radius_UOM);
|
||
$('#dialog_startdate').val(jobsiteitem.StartDateStr);
|
||
$('#dialog_projectenddate').val(jobsiteitem.ProjectedEndDateStr);
|
||
$('#dialog_enddate').val(jobsiteitem.EndDateStr);
|
||
$('#dialog_region').val(jobsiteitem.RegionId);
|
||
$('#dialog_number').val(jobsiteitem.Number);
|
||
editableSelectForeman.text(jobsiteitem.Foreman);
|
||
$('#dialog_manager').val(jobsiteitem.Manager);
|
||
$('#dialog_phone').val(jobsiteitem.Phone);
|
||
$('#dialog_email').val(jobsiteitem.Email);
|
||
$('#dialog_group').val(jobsiteitem.Group);
|
||
$('#dialog_deliveryaddress1').val(jobsiteitem.Address1);
|
||
$('#dialog_deliveryaddress2').val(jobsiteitem.Address2);
|
||
$('#dialog_city').val(jobsiteitem.City);
|
||
editableSelectState.text(jobsiteitem.State);
|
||
$('#dialog_zip').val(jobsiteitem.Zip);
|
||
$('#dialog_county').val(jobsiteitem.County);
|
||
$('#dialog_notes').val(jobsiteitem.Notes)
|
||
$('#dialog_name').focus();
|
||
getRegions();
|
||
}
|
||
|
||
function trim_str(s) {
|
||
if (s == null)
|
||
return "";
|
||
else
|
||
return s.replace(/(^\s*)|(\s*$)/g, "");
|
||
}
|
||
var IsInteger = /^[0-9]+$/;
|
||
function OnSave(exit) {
|
||
var Radius = trim_str($('#dialog_radius').val());
|
||
var Radius_UOM = $('#dialog_radiusuom').val();
|
||
//if (Radius == 0) {
|
||
// Radius_UOM = "";
|
||
//}
|
||
var types = [];
|
||
var type = $('#dialog_jobsitetype').val()
|
||
if (type !== "")
|
||
types.push(type);
|
||
|
||
|
||
var item = {
|
||
'Name': trim_str($('#dialog_jobsitename').val()),
|
||
'Code': trim_str($('#dialog_jobsitecode').val()),
|
||
'BaseOnMachineID': $("#dialog_machine").val(),
|
||
'Latitude': trim_str($('#dialog_latitude').val()),
|
||
'Longitude': trim_str($('#dialog_longitude').val()),
|
||
'ColorString': trim_str($('#dialog_color').val()),
|
||
'Radius': Radius,
|
||
'Radius_UOM': Radius_UOM,
|
||
'StartDate': $('#dialog_startdate').val(),
|
||
'ProjectedEndDate': $('#dialog_projectenddate').val(),
|
||
'EndDate': $('#dialog_enddate').val(),
|
||
'Polygon': polygonitem,
|
||
'Types': types,
|
||
'RegionId': $('#dialog_region').val(),
|
||
'Number': $('#dialog_number').val(),
|
||
'Foreman': editableSelectForeman.text(),
|
||
'Manager': $('#dialog_manager').val(),
|
||
'Phone': $('#dialog_phone').val(),
|
||
'Email': $('#dialog_email').val(),
|
||
'Group': $('#dialog_group').val(),
|
||
'Address1': $('#dialog_deliveryaddress1').val(),
|
||
'Address2': $('#dialog_deliveryaddress2').val(),
|
||
'City': $('#dialog_city').val(),
|
||
'State': editableSelectState.text(),
|
||
'Zip': $('#dialog_zip').val(),
|
||
'County': $('#dialog_county').val(),
|
||
'Notes': $('#dialog_notes').val()
|
||
};
|
||
|
||
var alerttitle;
|
||
if (jobsiteid) {
|
||
item.ID = jobsiteid;
|
||
alerttitle = GetTextByKey("P_JS_EDITJOBSITE", "Edit Jobsite");
|
||
} else {
|
||
item.ID = "-1";
|
||
alerttitle = GetTextByKey("P_JS_ADDJOBSITE", "Add Jobsite");
|
||
}
|
||
if (!item.Name || item.Name.length == 0) {
|
||
showAlert(GetTextByKey("P_JS_JOBSITENAMEEMPTY", "Jobsite name cannot be empty."), alerttitle);
|
||
return;
|
||
}
|
||
|
||
if (item.Email !== "" && !isEmail(item.Email)) {
|
||
showAlert(GetTextByKey("P_JS_EMAILISNOTAVALIDEMAILADDRESS", 'The email address is invalid.'), alerttitle);
|
||
return;
|
||
}
|
||
|
||
if (!item.BaseOnMachineID || item.BaseOnMachineID === "" || isNaN(item.BaseOnMachineID))
|
||
item.BaseOnMachineID = -1;
|
||
|
||
if (item.Latitude === "" || isNaN(item.Latitude)) {
|
||
showAlert(GetTextByKey("P_JS_LATITUDEISINVALID", "Latitude is invalid. "), alerttitle);
|
||
return;
|
||
}
|
||
else if (item.Latitude > 90 || item.Latitude < -90) {
|
||
showAlert(GetTextByKey("P_JS_LATITUDEISINVALID1", "Latitude must be less than 90 and greater than -90."), alerttitle);
|
||
return;
|
||
}
|
||
|
||
if (item.Longitude === "" || isNaN(item.Longitude)) {
|
||
showAlert(GetTextByKey("P_JS_LONGITUDEISINVALID", "Longitude is invalid. "), alerttitle);
|
||
//$('#dialog_longitude').focus();
|
||
return;
|
||
}
|
||
else if (item.Longitude > 180 || item.Longitude < -180) {
|
||
showAlert(GetTextByKey("P_JS_LONGITUDEISINVALID1", "Longitude must be less than 180 and greater than -180."), alerttitle);
|
||
//$('#dialog_longitude').focus();
|
||
return;
|
||
}
|
||
|
||
if (!item.ColorString || item.ColorString.length == 0) {
|
||
showAlert(GetTextByKey("P_JS_COLOREMPTY", "Color cannot be empty."), alerttitle);
|
||
//$('#dialog_color').focus();
|
||
return;
|
||
}
|
||
|
||
if ((!item.Polygon || item.Polygon.length == 0) && ($('#dialog_radius').prop('disabled') == true)) {
|
||
showAlert(GetTextByKey("P_JS_PLEASEDRAWPOLYGON", "Please draw a polygon."), alerttitle);
|
||
//$('#dialog_radius').focus();
|
||
return;
|
||
}
|
||
|
||
if ((!item.Polygon || item.Polygon.length == 0) && (item.Radius === "" || isNaN(item.Radius) || item.Radius <= 0)) {
|
||
showAlert(GetTextByKey("P_JS_VALIDRADIUSORDRAWPOLYGON", "Please input a valid radius or draw a polygon."), alerttitle);
|
||
//$('#dialog_radius').focus();
|
||
return;
|
||
}
|
||
|
||
if (item.StartDate.length == 0) {
|
||
showAlert(GetTextByKey("P_JS_ENTERSTARTDATE", "Please enter a Start Date."), alerttitle);
|
||
return false;
|
||
}
|
||
|
||
if (!checkDate(item.StartDate)) {
|
||
showAlert(GetTextByKey("P_JS_STARTDATEFORMATERROR", "Start Date format error."), alerttitle);
|
||
return false;
|
||
}
|
||
|
||
//if (item.EndDate.length == 0) {
|
||
// showAlert("Please enter an End Date.", alerttitle);
|
||
// return false;
|
||
//}
|
||
if (item.ProjectedEndDate.length > 0) {//结束时间可以为空
|
||
if (!checkDate(item.ProjectedEndDate)) {
|
||
showAlert(GetTextByKey("P_SET_PROJECTEDENDDATEFORMATERROR", "Projected End Date format error."), alerttitle);
|
||
return false;
|
||
}
|
||
|
||
var sdate = item.StartDate;
|
||
var edate = item.ProjectedEndDate;
|
||
var stdt = new Date(sdate.replace("-", "/"));
|
||
var etdt = new Date(edate.replace("-", "/"));
|
||
if (stdt > etdt) {
|
||
showAlert(GetTextByKey("P_SET_PROJECTEDENDDATEFORMATERROR1", "Projected End Date must be later than Start Date."), alerttitle);
|
||
return false;
|
||
}
|
||
}
|
||
else {
|
||
item.ProjectedEndDate = "1900-01-01";
|
||
}
|
||
|
||
if (item.EndDate.length > 0) {//结束时间可以为空
|
||
if (!checkDate(item.EndDate)) {
|
||
showAlert(GetTextByKey("P_JS_ENDDATEFORMATERROR", "End Date format error."), alerttitle);
|
||
return false;
|
||
}
|
||
|
||
var sdate = item.StartDate;
|
||
var edate = item.EndDate;
|
||
var stdt = new Date(sdate.replace("-", "/"));
|
||
var etdt = new Date(edate.replace("-", "/"));
|
||
if (stdt > etdt) {
|
||
showAlert(GetTextByKey("P_JS_ENDDATEFORMATERROR1", "End Date must be later than Start Date."), alerttitle);
|
||
return false;
|
||
}
|
||
}
|
||
else {
|
||
item.EndDate = "1900-01-01";
|
||
}
|
||
if (item.RegionId === "")
|
||
item.RegionId = -1;
|
||
|
||
showloading(true);
|
||
var param = JSON.stringify(item);
|
||
param = htmlencode(param);
|
||
_network.jobsitequery("SaveJobSite", param, function (data) {
|
||
showloading(false);
|
||
if (typeof (data) === "string") {
|
||
showAlert(data, alerttitle);
|
||
} else {
|
||
jobsiteid = data[0];
|
||
jobsiteitem.Name = $('#dialog_jobsitename').val();
|
||
|
||
if (previousGraphics) {
|
||
BaseCircleLayer.remove(previousGraphics);
|
||
DrawPolygonLayer.remove(previousGraphics);
|
||
previousGraphics = null;
|
||
}
|
||
|
||
if (exit == 0) {
|
||
showAlert(GetTextByKey("P_JS_SAVSUCCESSFULLY", data[1]), alerttitle);
|
||
}
|
||
if (exit == 1)
|
||
OnExit(exit);
|
||
}
|
||
}, function (err) {
|
||
console.log(err);
|
||
showloading(false);
|
||
showAlert(GetTextByKey("P_JS_FAILEDTOSAVE", "Failed to save jobsite."), alerttitle);
|
||
});
|
||
}
|
||
|
||
function OnExit(type) {
|
||
$('#dialog_managemahchine').hideDialog();
|
||
if (typeof window.parent.CloseWorkOrderDialog == 'function')
|
||
window.parent.CloseJobsiteDialog();
|
||
else
|
||
window.parent.CloseDialog(type);
|
||
}
|
||
|
||
function init(js, assetid) {
|
||
$('#cleardrawn').removeAttr("disabled");
|
||
getJobsiteTypes();
|
||
GetForemans();
|
||
|
||
mapjobsite = null;
|
||
previousGraphics = null;
|
||
BaseCircleLayer && BaseCircleLayer.clear();
|
||
DrawPolygonLayer && DrawPolygonLayer.clear();
|
||
toolbar && toolbar.deactivate();
|
||
|
||
if (js) {
|
||
jobsiteid = js.ID;
|
||
jobsiteitem = js;
|
||
OnEdit();
|
||
}
|
||
else {
|
||
OnAdd();
|
||
}
|
||
|
||
centerassetid = assetid;
|
||
if (centerassetid > 0 && allmachines && BaseMachineLayer) {
|
||
for (var i = 0; i < BaseMachineLayer._clusterData.length; i++) {
|
||
var p = BaseMachineLayer._clusterData[i];
|
||
if (p.id == centerassetid) {
|
||
$('#dialog_latitude').val(p.y);
|
||
$('#dialog_longitude').val(p.x);
|
||
showJobSitePoint();
|
||
mapObj.setLevel(14);
|
||
BaseMachineLayer.locate(p, true, true);
|
||
break;
|
||
}
|
||
}
|
||
}
|
||
else
|
||
openMap();
|
||
editableSelectForeman.reload();
|
||
editableSelectState_use.reload();
|
||
}
|
||
|
||
function getJobsiteTypes() {
|
||
$('#dialog_jobsitetype').empty();
|
||
_network.jobsitequery('GetJobSiteTypes', '', function (data) {
|
||
if (typeof (data) === "string") {
|
||
showAlert(data, GetTextByKey("P_AM_ERROR", 'Error'));
|
||
return;
|
||
}
|
||
$('#dialog_jobsitetype').empty();
|
||
|
||
var opt = $('<option></option>').val("").text(" ");
|
||
$('#dialog_jobsitetype').append(opt);
|
||
for (var i = 0; i < data.length; i++) {
|
||
opt = $('<option></option>').val(data[i]).text(data[i]);
|
||
$('#dialog_jobsitetype').append(opt);
|
||
}
|
||
|
||
if (jobsiteitem && jobsiteitem.Types && jobsiteitem.Types.length > 0)
|
||
$('#dialog_jobsitetype').val(jobsiteitem.Types[0]);
|
||
else
|
||
$('#dialog_jobsitetype').val("");
|
||
});
|
||
}
|
||
|
||
function getRegions() {
|
||
var exists = false;
|
||
var sel = null;
|
||
if (jobsiteitem && jobsiteitem.RegionId > 0)
|
||
sel = jobsiteitem.RegionId;
|
||
if (!sel || sel == "")
|
||
exists = true;
|
||
|
||
showloading(true);
|
||
|
||
var selector = $('#dialog_region');
|
||
var selCurrent = selector.val();
|
||
selector.empty();
|
||
_network.jobsitequery('GetRegions', '', function (data) {
|
||
showloading(false);
|
||
if (typeof (data) === "string") {
|
||
showAlert(data, GetTextByKey("P_AM_ERROR", 'Error'));
|
||
return;
|
||
}
|
||
selector.empty();
|
||
|
||
selector.append('<option values=""> </option>');
|
||
for (var i = 0; i < data.length; i++) {
|
||
var op = $('<option></option>').val(data[i].Id).text(data[i].Name);
|
||
selector.append(op);
|
||
|
||
if (!exists && sel == data[i].Id)
|
||
exists = true;
|
||
}
|
||
|
||
if (!exists) {
|
||
selector.append($('<option></option>').val(jobsiteitem.RegionId).text(jobsiteitem.Region));
|
||
}
|
||
if (sel && sel != "")
|
||
selector.val(sel);
|
||
else if (selCurrent)
|
||
selector.val(selCurrent);
|
||
}, function () {
|
||
showloading(false);
|
||
});
|
||
}
|
||
|
||
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",
|
||
"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 = "";
|
||
|
||
editableSelectState_use.datasource = statedata;
|
||
editableSelectState_use.valuepath = ""
|
||
editableSelectState_use.displaypath = "";
|
||
}
|
||
|
||
function GetForemans() {
|
||
_network.jobsitequery("GetForemans", "", function (data) {
|
||
if (data && data.length > 0) {
|
||
foremans = data;
|
||
editableSelectForeman.datasource = foremans;
|
||
editableSelectForeman.valuepath = "IID"
|
||
editableSelectForeman.displaypath = "DisplayName";
|
||
}
|
||
if (jobsiteitem)
|
||
editableSelectForeman.text(jobsiteitem.Foreman);
|
||
else
|
||
editableSelectForeman.text('');
|
||
|
||
}, function (err) {
|
||
});
|
||
}
|
||
|
||
function setForemanInfo() {
|
||
var foreman = editableSelectForeman.selecteditem();
|
||
if (foreman) {
|
||
$('#dialog_manager').val(foreman.ManagerName);
|
||
$('#dialog_phone').val(foreman.Mobile);
|
||
$('#dialog_email').val(foreman.ID);
|
||
}
|
||
else {
|
||
$('#dialog_manager').val('');
|
||
$('#dialog_phone').val('');
|
||
$('#dialog_email').val('');
|
||
}
|
||
}
|
||
|
||
$(function () {
|
||
InitGridSelectedMachines();
|
||
editableSelectForeman = new $editableselect($("#dialog_foreman"));
|
||
editableSelectForeman.tabIndex(1);
|
||
editableSelectForeman.change(function () {
|
||
setForemanInfo();
|
||
});
|
||
|
||
editableSelectState = new $editableselect($("#dialog_state"), 50);
|
||
editableSelectState.tabIndex(1);
|
||
editableSelectState_use = new $editableselect($("#dialog_state_use"), 50);
|
||
|
||
getStates();
|
||
|
||
$("#dialog_machine").change(function () {
|
||
var machine = $("#dialog_machine").find("option:selected").data("m");
|
||
if (!machine) {
|
||
$('#dialog_latitude').prop("disabled", false);
|
||
$('#dialog_longitude').prop("disabled", false);
|
||
}
|
||
else {
|
||
showAlert(GetTextByKey("P_JS_WARNINGTIPS", "Warning: Interaction with jobsites bound to Assets (Mobile Jobsites) is limited to Assets utilizing Foresight Devices or FI Tracker."), GetTextByKey("P_JS_WARNING", "Warning"));
|
||
$('#dialog_latitude').val(machine.CurrentLocation.Latitude).prop("disabled", true);
|
||
$('#dialog_longitude').val(machine.CurrentLocation.Longitude).prop("disabled", true);
|
||
showJobSite(true);
|
||
}
|
||
})
|
||
|
||
$('#chk_displayassets').click(function () {
|
||
var checked = $('#chk_displayassets').is(':checked');
|
||
if (checked) {
|
||
if (allmachines) {
|
||
showMachines(allmachines);
|
||
}
|
||
}
|
||
else
|
||
BaseMachineLayer.clearData();
|
||
});
|
||
|
||
$('#chk_displayothers').click(function () {
|
||
var checked = $('#chk_displayothers').is(':checked');
|
||
if (checked) {
|
||
if (alllocations) {
|
||
showLocations(alllocations);
|
||
}
|
||
else {
|
||
getCompanyLocations();
|
||
}
|
||
if (allshapes) {
|
||
showShapeFiles(allshapes);
|
||
}
|
||
else {
|
||
getShapeFileInfos();
|
||
}
|
||
}
|
||
else {
|
||
BaseCompanyLocationLayer.clear();
|
||
BaseShapeLayer.clear();
|
||
}
|
||
});
|
||
|
||
$('#dialog_managemahchine').dialog(function () {
|
||
showmaskbg(false);
|
||
});
|
||
|
||
$('#dialog_useaddress').dialog(function () {
|
||
showmaskbg(false);
|
||
});
|
||
|
||
$('#dialog_color').keyup(null, function () {
|
||
$("#jobsitecolor").spectrum("set", $('#dialog_color').val());
|
||
});
|
||
|
||
$('#dialog_startdate').click(function () { $('#startdatespan').css('display', 'none'); }).blur(function () {
|
||
if ($.trim($(this).val()) == "") {
|
||
$('#startdatespan').css('display', '');
|
||
}
|
||
else {
|
||
$('#startdatespan').css('display', 'none');
|
||
}
|
||
})
|
||
|
||
$('#dialog_enddate').click(function () { $('#enddatespan').css('display', 'none'); }).blur(function () {
|
||
if ($.trim($(this).val()) == "") {
|
||
$('#enddatespan').css('display', '');
|
||
}
|
||
else {
|
||
$('#enddatespan').css('display', 'none');
|
||
}
|
||
})
|
||
|
||
$('#dialog_startdate').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]);
|
||
}
|
||
})
|
||
$('#dialog_projectenddate').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]);
|
||
}
|
||
})
|
||
$('#dialog_enddate').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]);
|
||
}
|
||
})
|
||
|
||
$("#basemapgalleryDiv").click(null, function (e) {
|
||
$("#basemapGallery").show();
|
||
});
|
||
|
||
initColorCtrl();
|
||
|
||
function resizeContent() {
|
||
$('#divcontent').css('height', $(window).height() - $('#divcontent').offset().top - 4);
|
||
$('.content_main').css('min-height', 0);
|
||
var top = (document.documentElement.clientHeight - $('#dialog_managemahchine').height()) / 3;
|
||
var left = (document.documentElement.clientWidth - $('#dialog_managemahchine').width()) / 2;
|
||
if (top < 0) top = 0;
|
||
if (left < 0) left = 0;
|
||
$('#dialog_managemahchine').css({ 'top': top, 'left': left });
|
||
}
|
||
window.onresize = resizeContent;
|
||
resizeContent();
|
||
});
|
||
|
||
function initColorCtrl() {
|
||
$("#jobsitecolor").spectrum({
|
||
allowEmpty: true,
|
||
color: "#FFF",
|
||
showInput: true,
|
||
containerClassName: "full-spectrum",
|
||
showInitial: true,
|
||
showPalette: true,
|
||
showSelectionPalette: true,
|
||
showAlpha: true,
|
||
maxPaletteSize: 10,
|
||
preferredFormat: "hex",
|
||
localStorageKey: "spectrum.demo",
|
||
chooseText: GetTextByKey("P_JS_OK", "OK"),
|
||
cancelText: GetTextByKey("P_JS_CANCEL", "Cancel"),
|
||
clearText: GetTextByKey("P_SPECTRUM_CLEARCOLORSELECTION", "Clear Color Selection"),
|
||
noColorSelectedText: GetTextByKey("P_SPECTRUM_NOCOLORSELECTED", "No Color Selected"),
|
||
move: function (color) {
|
||
if (color)
|
||
$("#dialog_color").val(color.toHexString().toUpperCase()); // #ff0000
|
||
},
|
||
show: function () {
|
||
|
||
},
|
||
beforeShow: function () {
|
||
|
||
},
|
||
hide: function (color) {
|
||
if (color) {
|
||
$("#dialog_color").val(color.toHexString().toUpperCase()); // #ff0000
|
||
showJobSite();
|
||
}
|
||
},
|
||
|
||
palette: [
|
||
["rgb(0, 0, 0)", "rgb(67, 67, 67)", "rgb(102, 102, 102)", /*"rgb(153, 153, 153)","rgb(183, 183, 183)",*/
|
||
"rgb(204, 204, 204)", "rgb(217, 217, 217)", /*"rgb(239, 239, 239)", "rgb(243, 243, 243)",*/ "rgb(255, 255, 255)"],
|
||
["rgb(152, 0, 0)", "rgb(255, 0, 0)", "rgb(255, 153, 0)", "rgb(255, 255, 0)", "rgb(0, 255, 0)",
|
||
"rgb(0, 255, 255)", "rgb(74, 134, 232)", "rgb(0, 0, 255)", "rgb(153, 0, 255)", "rgb(255, 0, 255)"],
|
||
["rgb(230, 184, 175)", "rgb(244, 204, 204)", "rgb(252, 229, 205)", "rgb(255, 242, 204)", "rgb(217, 234, 211)",
|
||
"rgb(208, 224, 227)", "rgb(201, 218, 248)", "rgb(207, 226, 243)", "rgb(217, 210, 233)", "rgb(234, 209, 220)",
|
||
"rgb(221, 126, 107)", "rgb(234, 153, 153)", "rgb(249, 203, 156)", "rgb(255, 229, 153)", "rgb(182, 215, 168)",
|
||
"rgb(162, 196, 201)", "rgb(164, 194, 244)", "rgb(159, 197, 232)", "rgb(180, 167, 214)", "rgb(213, 166, 189)",
|
||
"rgb(204, 65, 37)", "rgb(224, 102, 102)", "rgb(246, 178, 107)", "rgb(255, 217, 102)", "rgb(147, 196, 125)",
|
||
"rgb(118, 165, 175)", "rgb(109, 158, 235)", "rgb(111, 168, 220)", "rgb(142, 124, 195)", "rgb(194, 123, 160)",
|
||
"rgb(166, 28, 0)", "rgb(204, 0, 0)", "rgb(230, 145, 56)", "rgb(241, 194, 50)", "rgb(106, 168, 79)",
|
||
"rgb(69, 129, 142)", "rgb(60, 120, 216)", "rgb(61, 133, 198)", "rgb(103, 78, 167)", "rgb(166, 77, 121)",
|
||
/*"rgb(133, 32, 12)", "rgb(153, 0, 0)", "rgb(180, 95, 6)", "rgb(191, 144, 0)", "rgb(56, 118, 29)",
|
||
"rgb(19, 79, 92)", "rgb(17, 85, 204)", "rgb(11, 83, 148)", "rgb(53, 28, 117)", "rgb(116, 27, 71)",*/
|
||
"rgb(91, 15, 0)", "rgb(102, 0, 0)", "rgb(120, 63, 4)", "rgb(127, 96, 0)", "rgb(39, 78, 19)",
|
||
"rgb(12, 52, 61)", "rgb(28, 69, 135)", "rgb(7, 55, 99)", "rgb(32, 18, 77)", "rgb(76, 17, 48)"]
|
||
]
|
||
});
|
||
}
|
||
|
||
/***********Map*******************/
|
||
|
||
var polygonitem = [];
|
||
var machineGraphics = [];
|
||
var isMapLoaded = false;
|
||
var isLoadingMap = false;
|
||
var mapObj;
|
||
var graphicLayer = undefined;
|
||
var BaseMachineLayer = undefined;
|
||
var BaseCompanyLocationLayer = undefined;
|
||
var BaseShapeLayer = undefined;
|
||
var BaseCircleLayer = undefined;
|
||
var DrawPolygonLayer = undefined;
|
||
var TransportationLayer = undefined;
|
||
var GraphicC = undefined;
|
||
var PointC = undefined;
|
||
var PictureMarkerSymbolC = undefined;
|
||
var UnitsC = undefined;
|
||
var CircleC = undefined;
|
||
var SimpleFillSymbolC = undefined;
|
||
var ExtentC = undefined;
|
||
var DrawC = undefined;
|
||
var toolbar = undefined;
|
||
var PolygonC = undefined;
|
||
var ClusterLayerC = undefined;
|
||
var BasemapGalleryC = undefined;
|
||
var FontC = undefined;
|
||
|
||
var MultipointC = undefined;
|
||
var SimpleMarkerSymbolC = undefined;
|
||
var SimpleLineSymbolC = undefined;
|
||
var PolylineC = undefined;
|
||
var ColorC = undefined;
|
||
var SpatialReferenceC = undefined;
|
||
|
||
function openMap() {
|
||
if (!isMapLoaded) {
|
||
if (!isLoadingMap) {
|
||
isLoadingMap = true;
|
||
loadMap();
|
||
}
|
||
}
|
||
else {
|
||
showJobSite(true);
|
||
if (!jobsiteid)
|
||
setMapExtent();
|
||
|
||
mapObj.showZoomSlider();
|
||
$('#div_jslocation').show();
|
||
}
|
||
}
|
||
|
||
var mapLocator = null;
|
||
function loadMap() {
|
||
require(["esri/map", "esri/graphic", "esri/geometry/Point",
|
||
"esri/geometry/Multipoint",
|
||
"esri/geometry/Polyline", "esri/symbols/PictureMarkerSymbol", "esri/units",
|
||
"esri/geometry/Circle", "esri/symbols/SimpleFillSymbol", "esri/geometry/Extent", "esri/toolbars/draw", "esri/symbols/SimpleMarkerSymbol",
|
||
"esri/symbols/SimpleLineSymbol", "esri/symbols/SimpleFillSymbol", "esri/geometry/Polygon",
|
||
"extras1/clusterlayer", "esri/dijit/BasemapGallery",
|
||
"esri/symbols/Font",
|
||
"esri/Color", "esri/layers/ArcGISTiledMapServiceLayer", "esri/tasks/locator", "esri/urlUtils",
|
||
"esri/SpatialReference"],
|
||
function (Map, Graphic, Point, Multipoint, Polyline, PictureMarkerSymbol, Units, Circle, SimpleFillSymbol, Extent, Draw, SimpleMarkerSymbol,
|
||
SimpleLineSymbol, SimpleFillSymbol, Polygon, clusterlayer, BasemapGallery, Font, Color, ArcGISTiledMapServiceLayer, Locator, urlUtils, SpatialReference) {
|
||
MapC = Map;
|
||
GraphicC = Graphic;
|
||
PointC = Point;
|
||
PictureMarkerSymbolC = PictureMarkerSymbol;
|
||
UnitsC = Units;
|
||
CircleC = Circle;
|
||
SimpleFillSymbolC = SimpleFillSymbol;
|
||
ExtentC = Extent;
|
||
DrawC = Draw;
|
||
PolygonC = Polygon;
|
||
ClusterLayerC = clusterlayer;
|
||
BasemapGalleryC = BasemapGallery;
|
||
FontC = Font;
|
||
SpatialReferenceC = SpatialReference;
|
||
|
||
MultipointC = Multipoint;
|
||
SimpleMarkerSymbolC = SimpleMarkerSymbol;
|
||
SimpleLineSymbolC = SimpleLineSymbol;
|
||
PolylineC = Polyline;
|
||
ColorC = Color;
|
||
|
||
|
||
mapObj = new MapC("mapdiv", {
|
||
basemap: "topo",
|
||
center: [0, 0], // longitude, latitude
|
||
zoom: 3
|
||
});
|
||
mapObj.disableKeyboardNavigation();
|
||
|
||
dojo.connect(mapObj, "onClick", showCoordinates);
|
||
$('div.esriControlsBR').remove();
|
||
|
||
BaseCircleLayer = new esri.layers.GraphicsLayer();
|
||
mapObj.addLayer(BaseCircleLayer);
|
||
|
||
DrawPolygonLayer = new esri.layers.GraphicsLayer();
|
||
mapObj.addLayer(DrawPolygonLayer);
|
||
|
||
BaseShapeLayer = new esri.layers.GraphicsLayer();
|
||
mapObj.addLayer(BaseShapeLayer);
|
||
|
||
BaseCompanyLocationLayer = new esri.layers.GraphicsLayer();
|
||
mapObj.addLayer(BaseCompanyLocationLayer);
|
||
|
||
graphicLayer = new esri.layers.GraphicsLayer();
|
||
mapObj.addLayer(graphicLayer);
|
||
|
||
var layer = new ClusterLayerC({
|
||
"labelOffset": 35,
|
||
"labelColor": "#F00",
|
||
"labelFontSize": "20px",
|
||
"labelFontFamily": "Calibri",
|
||
"labelFontWeight": FontC.WEIGHT_BOLD
|
||
});//可合并显示的图层
|
||
mapObj.addLayer(layer);
|
||
BaseMachineLayer = layer;
|
||
|
||
urlUtils.addProxyRule({
|
||
urlPrefix: "geocode.arcgis.com",
|
||
proxyUrl: "../proxy/proxy.ashx"
|
||
});
|
||
|
||
mapLocator = new Locator("https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer");
|
||
|
||
mapLocator.on("addresses-to-locations-complete", function (evt) {
|
||
showmaskbg(false);
|
||
$('#dialog_useaddress .maskbg').hide();
|
||
$('#dialog_useaddress').hideDialog();
|
||
if (evt.addresses.length > 0) {
|
||
for (var address in evt.addresses) {
|
||
var i = evt.addresses[address].attributes.ResultID;
|
||
var loc = evt.addresses[address].location;
|
||
if (isNaN(loc.x))
|
||
loc.x = 0;
|
||
if (isNaN(loc.y))
|
||
loc.y = 0;
|
||
|
||
$('#dialog_latitude').val(loc.y.toFixed(6));
|
||
$('#dialog_longitude').val(loc.x.toFixed(6));
|
||
|
||
var radius = $('#dialog_radius').val();
|
||
if (!isNaN(radius) && radius > 0)
|
||
showJobSite();
|
||
else
|
||
showJobSitePoint();
|
||
break;
|
||
}
|
||
}
|
||
console.log(evt);
|
||
});
|
||
mapLocator.on('error', function (evt) {
|
||
$('#dialog_useaddress .maskbg')
|
||
showAlert("Field to get location.", GetTextByKey("P_JS_USEADDRESS", "Use Address"));
|
||
console.log(evt);
|
||
});
|
||
|
||
mapObj.on("load", function (e) {
|
||
$("#mapdiv_zoom_slider").css("z-index", 0);
|
||
});
|
||
|
||
// create a toolbar for the map
|
||
toolbar = new DrawC(mapObj);
|
||
toolbar.on("draw-complete", completeshape);
|
||
|
||
TransportationLayer = new esri.layers.ArcGISTiledMapServiceLayer("http://server.arcgisonline.com/arcgis/rest/services/Reference/World_Transportation/MapServer");
|
||
|
||
initBasemapGallery(mapObj);
|
||
|
||
isLoadingMap = false;
|
||
isMapLoaded = true;
|
||
//mapObj.centerAndZoom(point, 3);
|
||
|
||
getBindingMachines();
|
||
|
||
showJobSite(true);
|
||
getMachines();
|
||
});
|
||
}
|
||
|
||
function initBasemapGallery(map) {
|
||
$(window).click(function (e) {
|
||
if ($(e.target).attr("id") != "basemapImg")
|
||
$("#basemapGallery").hide();
|
||
});
|
||
var basemap = "topo";
|
||
$("#basemapImg").css("background-image", "url('https://js.arcgis.com/3.40/esri/images/basemap/topo.jpg')");
|
||
$("#basemapTitle").text(GetTextByKey("P_MAP_TOPOGRAPHIC", "Topographic"));
|
||
|
||
var basemapGallery = new BasemapGalleryC({
|
||
showArcGISBasemaps: false,
|
||
map: map
|
||
}, "basemapGallery");
|
||
|
||
var satellitemap = new esri.dijit.Basemap({
|
||
layers: [new esri.dijit.BasemapLayer({
|
||
url: "http://server.arcgisonline.com/arcgis/rest/services/World_Imagery/MapServer"
|
||
})],
|
||
title: GetTextByKey("P_MAP_IMAGERY", "Imagery"),
|
||
thumbnailUrl: "https://js.arcgis.com/3.40/esri/images/basemap/satellite.jpg"
|
||
});
|
||
basemapGallery.add(satellitemap);
|
||
|
||
var topomap = new esri.dijit.Basemap({
|
||
layers: [new esri.dijit.BasemapLayer({
|
||
url: "http://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer"
|
||
})],
|
||
title: GetTextByKey("P_MAP_TOPOGRAPHIC", "Topographic"),
|
||
thumbnailUrl: "https://js.arcgis.com/3.40/esri/images/basemap/topo.jpg"
|
||
});
|
||
basemapGallery.add(topomap);
|
||
|
||
var streetmap = new esri.dijit.Basemap({
|
||
layers: [new esri.dijit.BasemapLayer({
|
||
//type: "OpenStreetMap",
|
||
url: "http://server.arcgisonline.com/arcgis/rest/services/World_Street_Map/MapServer"
|
||
})],
|
||
title: GetTextByKey("P_MAP_STREETS", "Streets"),
|
||
thumbnailUrl: "https://js.arcgis.com/3.40/esri/images/basemap/streets.jpg"
|
||
|
||
});
|
||
basemapGallery.add(streetmap);
|
||
|
||
basemapGallery.startup();
|
||
|
||
basemapGallery.on("selection-change", function () {
|
||
var basemap = basemapGallery.getSelected();
|
||
if (basemap) {
|
||
if (basemap.title == "Imagery")
|
||
map.addLayer(TransportationLayer);
|
||
else
|
||
map.removeLayer(TransportationLayer);
|
||
|
||
$("#basemapImg").css("background-image", "url('" + basemap.thumbnailUrl + "')");
|
||
$("#basemapTitle").text(basemap.title);
|
||
}
|
||
$("#basemapGallery").hide();
|
||
});
|
||
|
||
basemapGallery.on("error", function (msg) {
|
||
console.log("basemap gallery error: ", msg);
|
||
});
|
||
}
|
||
|
||
function drawJobsite() {
|
||
$('#cleardrawn').removeAttr("disabled");
|
||
IsHideRadiusRelevant(true);//控制radius相关
|
||
removeJobSite();
|
||
polygonitem = [];
|
||
toolbar.activate(DrawC.POLYGON);
|
||
mapObj.hideZoomSlider();
|
||
$('#div_jslocation').hide();
|
||
}
|
||
|
||
function clearDrawn() {
|
||
toolbar.deactivate();
|
||
DrawPolygonLayer.clear();
|
||
polygonitem = [];
|
||
IsHideRadiusRelevant(false);
|
||
}
|
||
|
||
function completeshape(evtObj) {
|
||
//绘制的点存放到polygonitem
|
||
for (var i = 0; i < evtObj.geographicGeometry.rings[0].length; i++) {
|
||
var ring = evtObj.geographicGeometry.rings[0][i];
|
||
var lon = parseFloat(ring[0]).toFixed(6);
|
||
var lat = parseFloat(ring[1]).toFixed(6);
|
||
var piarr = {};
|
||
piarr.Longitude = lon;
|
||
piarr.Latitude = lat;
|
||
polygonitem.push(piarr);
|
||
}
|
||
|
||
toolbar.deactivate();
|
||
|
||
DrawPolygonLayer.clear();
|
||
BaseCircleLayer.clear();
|
||
|
||
var geometry = evtObj.geometry;
|
||
createPolygon(geometry);
|
||
|
||
mapObj.showZoomSlider();
|
||
$('#div_jslocation').show();
|
||
}
|
||
|
||
function createPolygon(polygon) {
|
||
previousGraphics = null;
|
||
var js = jobsiteitem;
|
||
var fillSymbol = new SimpleFillSymbolC({
|
||
color: [js.Color.Red, js.Color.Green, js.Color.Blue, 51],
|
||
outline: {
|
||
color: [js.Color.Red, js.Color.Green, js.Color.Blue],
|
||
width: 1
|
||
}
|
||
});
|
||
fillSymbol.setStyle(SimpleFillSymbolC.STYLE_SOLID);
|
||
var g = new esri.Graphic(polygon, fillSymbol);
|
||
DrawPolygonLayer.add(g);
|
||
|
||
machineGraphics["JSID" + js.ID] = g;
|
||
mapjobsite = js;
|
||
}
|
||
|
||
function showCoordinates(evt) {
|
||
if (evt) {
|
||
var mp = evt.mapPoint;
|
||
if (!$('#dialog_latitude').prop("disabled"))
|
||
$('#dialog_latitude').val(mp.getLatitude().toFixed(6));
|
||
if (!$('#dialog_longitude').prop("disabled"))
|
||
$('#dialog_longitude').val(mp.getLongitude().toFixed(6));
|
||
}
|
||
var radius = $('#dialog_radius').val();
|
||
if (!isNaN(radius) && radius > 0)
|
||
showJobSite();
|
||
else
|
||
showJobSitePoint();
|
||
}
|
||
|
||
function inputchange() {
|
||
$.debounce(showJobSite, 500, null);
|
||
}
|
||
|
||
var mapjobsite;
|
||
//jobsite
|
||
function showJobSite(isinit) {
|
||
showJobSitePoint();
|
||
|
||
if (!jobsiteitem) {
|
||
IsHideRadiusRelevant(false);
|
||
}
|
||
|
||
removeJobSite();
|
||
|
||
var js = jobsiteitem;
|
||
if (!js)
|
||
js = {};
|
||
js.Longitude = $('#dialog_longitude').val();
|
||
js.Latitude = $('#dialog_latitude').val();
|
||
js.Radius = $('#dialog_radius').val();
|
||
js.Radius_UOM = $('#dialog_radiusuom').val()
|
||
js.ColorString = $('#dialog_color').val();
|
||
js.Polygon = polygonitem;
|
||
var color = /^#([0-9a-fA-F]{6})$/.exec(js.ColorString);
|
||
if (!color) js.ColorString = "#000000";
|
||
if (js.ColorString != "" && js.ColorString != null) {
|
||
var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(js.ColorString);
|
||
if (!js.Color)
|
||
js.Color = {};
|
||
js.Color.Red = parseInt(result[1], 16);
|
||
js.Color.Green = parseInt(result[2], 16);
|
||
js.Color.Blue = parseInt(result[3], 16);
|
||
}
|
||
|
||
jobsiteitem = js;
|
||
|
||
if (js.Radius > 0) {
|
||
IsHideRadiusRelevant(false);
|
||
polygonitem = [];
|
||
//circle
|
||
if (js.Longitude == 0 && js.Latitude == 0) return;
|
||
var jsCircle = createJobSiteCircle(js);
|
||
BaseCircleLayer.add(jsCircle);
|
||
machineGraphics["JSID" + js.ID] = jsCircle;
|
||
mapjobsite = js;
|
||
//if (isinit)
|
||
mapObj.setExtent(jsCircle.geometry.getExtent());
|
||
}
|
||
else {//shape
|
||
if ($('#cleardrawn').attr('disabled') == "disabled")
|
||
return;
|
||
IsHideRadiusRelevant(true);//radius 相关控制
|
||
if (!js.Polygon || js.Polygon.length <= 0)
|
||
return;
|
||
|
||
var arrshapes = new Array();
|
||
for (var i = 0; i < js.Polygon.length; i++) {
|
||
var pi = js.Polygon[i];
|
||
var arr = [pi.Longitude, pi.Latitude];
|
||
arrshapes.push(arr);
|
||
}
|
||
var singleRingPolygon = new PolygonC(arrshapes);
|
||
createPolygon(singleRingPolygon);
|
||
//if (isinit)
|
||
mapObj.setExtent(singleRingPolygon.getExtent());
|
||
}
|
||
}
|
||
|
||
function showJobSitePoint() {
|
||
var latitude = parseFloat($('#dialog_latitude').val());
|
||
var longitude = parseFloat($('#dialog_longitude').val());
|
||
if (latitude == 0 && longitude == 0) return;
|
||
var point = new esri.geometry.Point({
|
||
latitude: latitude,
|
||
longitude: longitude
|
||
});
|
||
|
||
var symbol = new esri.symbol.TextSymbol({
|
||
color: [0xf7, 0xc0, 0x03],//#f7c003
|
||
haloColor: "black",
|
||
haloSize: "1px",
|
||
text: "\uf3c5",
|
||
xoffset: 3,
|
||
yoffset: 3,
|
||
font: { // autocast as esri/symbols/Font
|
||
size: 32,
|
||
family: "FontAwesome",
|
||
weight: "bolder"
|
||
}
|
||
});
|
||
graphicLayer.clear();
|
||
var graphic = new esri.Graphic(point, symbol);
|
||
graphicLayer.add(graphic);
|
||
}
|
||
|
||
//radius 相关控制
|
||
function IsHideRadiusRelevant(ishide) {
|
||
if (ishide == true) {
|
||
$('#dialog_radius').val(0);
|
||
$('#dialog_radius').attr("disabled", "disabled");
|
||
$('#dialog_radiusuom').attr("disabled", "disabled");
|
||
}
|
||
else {
|
||
$('#cleardrawn').attr("disabled", "disabled");
|
||
$('#dialog_radius').removeAttr("disabled");
|
||
$('#dialog_radiusuom').removeAttr("disabled");
|
||
}
|
||
}
|
||
|
||
var previousGraphics = null;
|
||
function removeJobSite() {
|
||
var js = mapjobsite;
|
||
if (!js) return;
|
||
var g = machineGraphics["JSID" + js.ID];
|
||
if (g) {
|
||
if (previousGraphics !== g) {
|
||
if (previousGraphics) {
|
||
BaseCircleLayer.remove(previousGraphics);
|
||
DrawPolygonLayer.remove(previousGraphics);
|
||
}
|
||
previousGraphics = g;
|
||
}
|
||
//machineGraphics.splice("JSID" + js.ID, 1);
|
||
delete machineGraphics["JSID" + js.ID];
|
||
}
|
||
}
|
||
|
||
function createJobSiteCircle(js) {
|
||
var point = new PointC({
|
||
longitude: js.Longitude,
|
||
latitude: js.Latitude
|
||
});
|
||
var unit = UnitsC.MILES;
|
||
if (js.Radius_UOM === "Kilometre")
|
||
unit = UnitsC.KILOMETERS;
|
||
var circle = new CircleC(
|
||
{
|
||
center: point,
|
||
radius: js.Radius,
|
||
radiusUnit: unit,
|
||
geodesic: true
|
||
});
|
||
|
||
// Create a symbol for rendering the graphic
|
||
var fillSymbol = new SimpleFillSymbolC({
|
||
color: [js.Color.Red, js.Color.Green, js.Color.Blue, 51],
|
||
outline: { // autocasts as new SimpleLineSymbol()
|
||
color: [js.Color.Red, js.Color.Green, js.Color.Blue],
|
||
width: 1
|
||
}
|
||
});
|
||
fillSymbol.setStyle(SimpleFillSymbolC.STYLE_SOLID);
|
||
|
||
var popContent = "<b>Name: </b>" + js.Name + "<br/>";
|
||
popContent += "<b>Latitude: </b>" + js.Latitude + "<br/>";
|
||
popContent += "<b>Longitude: </b> " + js.Longitude + "<br/>";
|
||
|
||
var g = new esri.Graphic(circle, fillSymbol);
|
||
g.setAttributes({ "infoContent": popContent, "name": js.Name });
|
||
return g;
|
||
}
|
||
|
||
// Machine
|
||
_network.mapviewquery = function (method, param, callback, error, nolog) {
|
||
_network.request("mapview.ashx?tp=ashx", -1, method, param, callback, error, nolog);
|
||
}
|
||
|
||
function getBindingMachines() {
|
||
_network.jobsitequery("GetBindingMachines", '', function (data) {
|
||
if (data != "-1") {
|
||
var opt = $('<option></option>').val("").text(" ");
|
||
var sel = $("#dialog_machine");
|
||
sel.empty();
|
||
sel.append(opt);
|
||
for (var i = 0; i < data.length; i++) {
|
||
var m = data[i];
|
||
opt = $('<option></option>').val(m.ID).text(m.DisplayName).data("m", m);
|
||
sel.append(opt);
|
||
}
|
||
if (jobsiteitem)
|
||
sel.val(jobsiteitem.BaseOnMachineID);
|
||
}
|
||
}, function () {
|
||
});
|
||
}
|
||
|
||
var allmachines;
|
||
function getMachines() {
|
||
var item = {
|
||
'IsAutoRefresh': false,
|
||
'ViewID': "",
|
||
'ContractorID': "",
|
||
'SearchText': "",
|
||
'Layers': ""
|
||
};
|
||
_network.jobsitequery("GetMachines", JSON.stringify(item), function (data) {
|
||
if (data != "-1") {
|
||
allmachines = data;
|
||
zoomMap(data);
|
||
|
||
if ($('#chk_displayassets').is(':checked'))
|
||
showMachines(allmachines);
|
||
}
|
||
}, function () {
|
||
});
|
||
}
|
||
|
||
function showMachines(machines) {
|
||
BaseMachineLayer.clearData();
|
||
var ps = [];
|
||
var senterpoint = null;
|
||
for (var i = 0; i < machines.length; i++) {
|
||
var machine = machines[i];
|
||
var p = this.createMachinePoint(machine);
|
||
ps.push(p);
|
||
if (machine.ID == centerassetid)
|
||
senterpoint = p;
|
||
}
|
||
BaseMachineLayer.adds(ps);
|
||
if (senterpoint) {
|
||
$('#dialog_latitude').val(senterpoint.y);
|
||
$('#dialog_longitude').val(senterpoint.x);
|
||
showJobSitePoint();
|
||
mapObj.setLevel(14);
|
||
BaseMachineLayer.locate(senterpoint, true, true);
|
||
}
|
||
|
||
}
|
||
|
||
function createMachinePoint(machine) {
|
||
var popContent = "<b data-lgid='P_JS_NAME_COLON'>Name: </b> " + machine.Name + "<br/>";
|
||
popContent += "<b data-lgid='P_JS_NAMECUSTOM_COLON'>Name (Custom): </b>" + machine.Name2 + "<br/>";
|
||
popContent += "<b data-lgid='P_JS_SN_COLON'>SN: </b>" + machine.VIN + "<br/>";
|
||
popContent += "<b data-lgid='P_JS_MAKE_COLON'>Make: </b>" + machine.Make + "<br/>";
|
||
popContent += "<b data-lgid='P_JS_MODEL_COLON'>Model: </b>" + machine.Model + "<br/>";
|
||
popContent += "<b data-lgid='P_JS_TYPE_COLON'>Type: </b>" + machine.AssetType + "<br/>";
|
||
var attributes = {
|
||
"Type": 0,//用于区分InfoWindow是否是Asset
|
||
"ID": machine.ID,
|
||
"Name": machine.Name,
|
||
"Name2": machine.Name2,
|
||
"VIN": machine.VIN,
|
||
"Make": machine.Make,
|
||
"Model": machine.Model,
|
||
"AssetType": machine.MachineType,
|
||
//"EngineHours": machine.EngineHours,
|
||
//"Odometer": machine.Odometer,
|
||
//"OdometerUOM": machine.OdometerUOM,
|
||
"IconUrl": machine.IconUrl,
|
||
"EmptyIconUrl": machine.IconUrl.replace(new RegExp("typeid=\\d+&", "i"), "typeid=-1&"),
|
||
//"Priority": machine.MapAlertLayerPriority,
|
||
"infoContent": popContent
|
||
};
|
||
var p = {
|
||
"id": machine.ID,
|
||
"x": machine.Longitude,
|
||
"y": machine.Latitude,
|
||
"attributes": attributes
|
||
}
|
||
|
||
return p;
|
||
}
|
||
|
||
var alllocations;
|
||
function getCompanyLocations() {
|
||
_network.jobsitequery("GetCompanyLocations", "", function (data) {
|
||
if (data != "-1") {
|
||
alllocations = data;
|
||
|
||
if ($('#chk_displayothers').is(':checked'))
|
||
showLocations(alllocations);
|
||
}
|
||
}, function () {
|
||
});
|
||
}
|
||
|
||
function showLocations(locations) {
|
||
BaseCompanyLocationLayer.clear();
|
||
for (var i = 0; i < locations.length; i++) {
|
||
var loc = locations[i];
|
||
showLocation(loc);
|
||
}
|
||
}
|
||
|
||
function showLocation(loc) {
|
||
if (loc.Longitude == 0 && loc.Latitude == 0) return;
|
||
var point = new PointC({
|
||
longitude: loc.Longitude,
|
||
latitude: loc.Latitude
|
||
});
|
||
point.z = 10;
|
||
|
||
var picSym = new PictureMarkerSymbolC(loc.IconUrl, 20, 20);
|
||
//picSym.setOffset(0, 25);
|
||
|
||
var popContent = "<b>" + GetTextByKey("P_MV_NAME_COLON", "Name:") + " </b> " + htmlencode(loc.LocationName) + "<br/>";
|
||
popContent += "<b>" + GetTextByKey("P_MV_LATITUDE_COLON", "Latitude:") + " </b>" + loc.Latitude + "<br/>";
|
||
popContent += "<b>" + GetTextByKey("P_MV_LONGITUDE_COLON", "Longitude:") + " </b>" + loc.Longitude + "<br/>";
|
||
popContent += "<b>" + GetTextByKey("P_MV_NOTES_COLON", "Notes:") + " </b>" + loc.Notes + "<br/>";
|
||
|
||
var g = new GraphicC(point, picSym);
|
||
g.setAttributes({ "infoContent": popContent, "name": htmlencode(loc.LocationName) });
|
||
|
||
BaseCompanyLocationLayer.add(g);
|
||
}
|
||
|
||
var allshapes;
|
||
//获取显示地图上导入的Shape文件
|
||
function getShapeFileInfos() {
|
||
var item = {
|
||
'Key': "",//ContractorID
|
||
'Value': ""//Filter
|
||
};
|
||
_network.jobsitequery("GetShapeFileInfos", JSON.stringify(item), function (data) {
|
||
if (data != "-1") {
|
||
allshapes = data;
|
||
|
||
if ($('#chk_displayothers').is(':checked'))
|
||
showShapeFiles(allshapes);
|
||
}
|
||
}, function () {
|
||
});
|
||
}
|
||
|
||
function showShapeFiles(shapes) {
|
||
BaseShapeLayer.clear();
|
||
for (var i = 0; i < shapes.length; i++) {
|
||
var sh = shapes[i];
|
||
getShapeFileData(sh);
|
||
}
|
||
}
|
||
function getShapeFileData(s) {
|
||
var item = {
|
||
'Key': "",//ContractorID
|
||
'Value': s.ID,
|
||
'Tag': s.FileName
|
||
};
|
||
if (!s.Shape) {
|
||
_network.jobsitequery("GetShapeData", JSON.stringify(item), function (data) {
|
||
if (typeof (data) === "string") {
|
||
_dialog.showAlert(data, GetTextByKey("P_MV_ERROR", 'Error'));
|
||
return;
|
||
}
|
||
s.Shape = data;
|
||
if ($('#chk_displayothers').is(':checked'))
|
||
showShape(s);
|
||
}, function () {
|
||
});
|
||
}
|
||
else
|
||
showShape(s);
|
||
}
|
||
|
||
function showShape(shape) {
|
||
if (!shape || !shape.Shape) return;
|
||
|
||
var color = "#FFA500";
|
||
var gs = [];
|
||
|
||
var popContent = "<b>" + GetTextByKey("P_MV_NAME_COLON", "Name:") + " </b> " + htmlencode(shape.Name) + "<br/>";
|
||
|
||
var reg = new RegExp("\r\n", "g");
|
||
shape.Notes = shape.Notes.replace(reg, "<br/>");
|
||
reg = new RegExp("\n", "g");
|
||
shape.Notes = shape.Notes.replace(reg, "<br/>");
|
||
|
||
popContent += "<b>" + GetTextByKey("P_MV_NOTES_COLON", "Notes:") + " </b>" + htmlencode(shape.Notes) + "<br/>";
|
||
|
||
if (shape.Shape.Points && shape.Shape.Points.length > 0) {
|
||
var pointSymbol = new SimpleMarkerSymbolC(SimpleMarkerSymbolC.STYLE_CIRCLE, 6, null, new ColorC(color));
|
||
var sPoints = new MultipointC();
|
||
for (var i = 0; i < shape.Shape.Points.length; i++) {
|
||
var p = shape.Shape.Points[i];
|
||
var point = new PointC({
|
||
longitude: p.Longitude,
|
||
latitude: p.Latitude
|
||
});
|
||
sPoints.addPoint(point);
|
||
}
|
||
var g = new GraphicC(sPoints, pointSymbol);
|
||
g.setAttributes({ "infoContent": popContent, "name": htmlencode(shape.Name), "Type": 1 });
|
||
BaseShapeLayer.add(g);
|
||
gs.push(g);
|
||
}
|
||
|
||
if (shape.Shape.Polylines && shape.Shape.Polylines.length > 0) {
|
||
var line = new PolylineC({
|
||
paths: []
|
||
});
|
||
for (var i = 0; i < shape.Shape.Polylines.length; i++) {
|
||
var l = shape.Shape.Polylines[i];
|
||
line.addPath([]);
|
||
for (var j = 0; j < l.Points.length; j++) {
|
||
var p = l.Points[j];
|
||
var point = new PointC({
|
||
longitude: p.Longitude,
|
||
latitude: p.Latitude
|
||
});
|
||
line.insertPoint(line.paths.length - 1, j, point);
|
||
}
|
||
}
|
||
|
||
var lineSymbol = new SimpleLineSymbolC({
|
||
color: [255, 165, 0],//[225, 95, 72],
|
||
width: 2
|
||
});
|
||
var g = new GraphicC(line, lineSymbol);
|
||
g.setAttributes({ "infoContent": popContent, "name": htmlencode(shape.Name), "Type": 1 });
|
||
BaseShapeLayer.add(g);
|
||
gs.push(g);
|
||
}
|
||
|
||
if (shape.Shape.Polygons && shape.Shape.Polygons.length > 0) {
|
||
var polygon = new PolygonC({
|
||
rings: []
|
||
});
|
||
for (var i = 0; i < shape.Shape.Polygons.length; i++) {
|
||
var pl = shape.Shape.Polygons[i];
|
||
polygon.addRing([]);
|
||
for (var j = 0; j < pl.Points.length; j++) {
|
||
var p = pl.Points[j];
|
||
var point = new PointC({
|
||
longitude: p.Longitude,
|
||
latitude: p.Latitude
|
||
});
|
||
polygon.insertPoint(polygon.rings.length - 1, j, point);
|
||
}
|
||
}
|
||
|
||
// Create a symbol for rendering the graphic
|
||
var fillSymbol = new SimpleFillSymbolC({
|
||
color: [255, 165, 0, 51],
|
||
outline: { // autocasts as new SimpleLineSymbol()
|
||
color: [255, 165, 0]
|
||
}
|
||
});
|
||
fillSymbol.setStyle(SimpleFillSymbolC.STYLE_SOLID);
|
||
|
||
var g = new GraphicC(polygon, fillSymbol);
|
||
g.setAttributes({ "infoContent": popContent, "name": htmlencode(shape.Name), "Type": 1 });
|
||
BaseShapeLayer.add(g);
|
||
gs.push(g);
|
||
}
|
||
|
||
machineGraphics["ShapeID" + shape.ID] = gs;
|
||
}
|
||
|
||
var maxLong, minLong, maxLat, minLat = null;
|
||
function zoomMap(allMachines) {
|
||
if (allMachines && allMachines.length > 0) {
|
||
for (var i in allMachines) {
|
||
var m = allMachines[i];
|
||
if (m.Longitude == 0 && m.Latitude == 0) continue;//不计算经纬度都为0的
|
||
|
||
if (maxLong == null || maxLong < m.Longitude)
|
||
maxLong = m.Longitude;
|
||
if (minLong == null || minLong > m.Longitude)
|
||
minLong = m.Longitude;
|
||
if (maxLat == null || maxLat < m.Latitude)
|
||
maxLat = m.Latitude;
|
||
if (minLat == null || minLat > m.Latitude)
|
||
minLat = m.Latitude;
|
||
}
|
||
if (!jobsiteid)
|
||
setMapExtent();
|
||
}
|
||
}
|
||
|
||
function setMapExtent() {
|
||
if (maxLong != minLong || maxLat != minLat) {//至少一个不相同
|
||
var ext = new ExtentC();
|
||
ext.xmax = maxLong + 0.001;
|
||
ext.xmin = minLong - 0.001;
|
||
ext.ymax = maxLat + 0.001;
|
||
ext.ymin = minLat - 0.001;
|
||
|
||
mapObj.setExtent(ext, true)
|
||
}
|
||
}
|
||
|
||
function UploadImportShapeFile() {
|
||
var file = $('<input type="file" style="display: none;" accept=".shp"/>');
|
||
file.change(function () {
|
||
var file = this.files[0];
|
||
ImportJobsitePolygon(file);
|
||
}).click();
|
||
}
|
||
|
||
function ImportJobsitePolygon(file) {
|
||
var alerttitle = GetTextByKey("P_JS_IMPORTSHAPEFILE", "Import Shape File");
|
||
var formData = new FormData();
|
||
formData.append("iconFile", file);
|
||
formData.append("MethodName", "ImportJobsitePolygon");
|
||
formData.append("ClientData", file.name);
|
||
$.ajax({
|
||
url: 'AddJobSite.aspx?tp=ashx',
|
||
type: 'POST',
|
||
dataType: 'json',
|
||
processData: false,
|
||
contentType: false,
|
||
data: formData,
|
||
async: true,
|
||
success: function (data) {
|
||
if (typeof (data) === "string") {
|
||
showAlert(data, alerttitle);
|
||
} else {
|
||
if (!data || data.length == 0) {
|
||
showAlert(GetTextByKey("P_JS_IMPORTSHAPEFILETIPS", "No polygon found in the uploaded file."), alerttitle);
|
||
return;
|
||
}
|
||
else {
|
||
$('#cleardrawn').removeAttr("disabled");
|
||
IsHideRadiusRelevant(true);//控制radius相关
|
||
BaseCircleLayer.clear();
|
||
toolbar.deactivate();
|
||
polygonitem = data;
|
||
|
||
if (polygonitem && polygonitem.length > 0) {
|
||
if (!$('#dialog_latitude').prop("disabled"))
|
||
$('#dialog_latitude').val(polygonitem[0].Latitude.toFixed(6));
|
||
if (!$('#dialog_longitude').prop("disabled"))
|
||
$('#dialog_longitude').val(polygonitem[0].Longitude.toFixed(6));
|
||
}
|
||
|
||
showJobSite();
|
||
}
|
||
}
|
||
},
|
||
error: function (err) {
|
||
showAlert(err.statusText, alerttitle);
|
||
}
|
||
});
|
||
}
|
||
|
||
|
||
/**************************JobSite Machine********************************/
|
||
/*************************************************************************/
|
||
|
||
function AddAssetToJobSite(items) {
|
||
var params = [
|
||
'', jobsiteid,
|
||
JSON.stringify(items.map(function (f) { return f.Values.AssetId; }))
|
||
];
|
||
_network.jobsitequery('AddAssetToJobSite', params.join(String.fromCharCode(170)), function (r) {
|
||
$('#dialogmask').hide();
|
||
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;
|
||
});
|
||
grid_dtsm.setData(grid_dtsm.innerSource.concat(items));
|
||
} else {
|
||
showAlert(r, GetTextByKey("P_JS_ASSETASSIGNMENT", "Asset Assignment"));
|
||
}
|
||
});
|
||
}
|
||
|
||
function OnMachineAdd() {
|
||
$('#dialogmask').show();
|
||
|
||
var dialogAssets = new $assetselector('dialog_machines');
|
||
dialogAssets.jobsiteId = jobsiteid;
|
||
dialogAssets.allowotherfilter = false;
|
||
dialogAssets.onDialogClosed = function () {
|
||
$('#dialogmask').hide();
|
||
$('#dialog_machines').remove();
|
||
};
|
||
dialogAssets.onOK = function (source) {
|
||
var items = [];
|
||
for (var i = 0; i < source.length; i++) {
|
||
var it = source[i].Values;
|
||
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
|
||
}
|
||
});
|
||
}
|
||
}
|
||
AddAssetToJobSite(items);
|
||
$('#dialogmask').hide();
|
||
};
|
||
dialogAssets.showSelector(2, true);
|
||
}
|
||
|
||
function OnMachineDeleteSingle(item) {
|
||
$("#dialogmask").show();
|
||
var alerttitle = GetTextByKey("P_JS_ASSETASSIGNMENT", "Asset Assignment");
|
||
showConfirm1(GetTextByKey("P_JS_DELETEASSIGNEDASSET", 'Are you sure you want to delete the assigned asset:{0}?').replace('{0}', item.Name), alerttitle, function () {
|
||
var params = [
|
||
'', jobsiteid,
|
||
JSON.stringify([item.AssetId])
|
||
];
|
||
_network.jobsitequery('RemoveAssetFromJobSite', params.join(String.fromCharCode(170)), function (r) {
|
||
$("#dialogmask").hide();
|
||
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();
|
||
}
|
||
});
|
||
});
|
||
}
|
||
|
||
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);
|
||
|
||
showConfirm1(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 allMachines;
|
||
var _availableMachines = [];
|
||
var _selectedMachines = [];
|
||
var _showSelectedMachines = [];
|
||
|
||
function OnManageMachine() {
|
||
if (!jobsiteid) {
|
||
showAlert(GetTextByKey("P_JS_SAVEJOBSITEFIRST", "Please save jobsite first."), GetTextByKey("P_JS_ADDJOBSITE", "Add Jobsite"));
|
||
return;
|
||
}
|
||
|
||
showmaskbg(true);
|
||
$('#machine-name').text(jobsiteitem.Name);
|
||
_selectedMachines = jobsiteitem.Machines == null ? [] : jobsiteitem.Machines;
|
||
_showSelectedMachines = jobsiteitem.Machines == null ? [] : jobsiteitem.Machines;
|
||
|
||
|
||
var title = GetTextByKey("P_JS_MANAGEASSETS", "Manage Assets");
|
||
$('#dialog_managemahchine .dialog-title span.title').html(title);
|
||
$('#dialog_managemahchine')
|
||
.attr('init', 1)
|
||
.css({
|
||
'top': (document.documentElement.clientHeight - $('#dialog_managemahchine').height()) / 3,
|
||
'left': (document.documentElement.clientWidth - $('#dialog_managemahchine').width()) / 2
|
||
}).showDialogfixed();
|
||
|
||
grid_dtsm.setData([]);
|
||
$('#selectedmachinelist input[type="checkbox"]').prop('checked', false);
|
||
|
||
GetSelectedMachines();
|
||
}
|
||
|
||
function GetSelectedMachines() {
|
||
_selectedMachines = [];
|
||
$("#dialogmask").show();
|
||
_network.jobsitequery('GetSelectedAssets', String.fromCharCode(170) + jobsiteid, function (data) {
|
||
if (typeof data === "string") {
|
||
showAlert(data, GetTextByKey("P_JS_ASSETASSIGNMENT", "Asset Assignment"));
|
||
return;
|
||
}
|
||
_selectedMachines = data;
|
||
showSelectedMachine(_selectedMachines);
|
||
$("#dialogmask").hide();
|
||
}, function (e) {
|
||
$("#dialogmask").hide();
|
||
});
|
||
}
|
||
|
||
function showSelectedMachine(data) {
|
||
var rows = [];
|
||
for (var i = 0; i < data.length; i++) {
|
||
var r = data[i];
|
||
var fr = { Values: r };
|
||
rows.push(fr);
|
||
}
|
||
|
||
grid_dtsm.setData(rows);
|
||
}
|
||
|
||
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")
|
||
};
|
||
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' } },
|
||
{ name: 'MakeName', caption: GetTextByKey("P_JS_MAKE", "Make"), valueIndex: 'MakeName', css: { 'width': 90, 'text-align': 'left' } },
|
||
{ name: 'ModelName', caption: GetTextByKey("P_JS_MODEL", "Model"), valueIndex: 'ModelName', css: { 'width': 90, 'text-align': 'left' } },
|
||
{ name: 'TypeName', caption: GetTextByKey("P_JS_TYPE", "Type"), valueIndex: 'TypeName', css: { 'width': 170, 'text-align': 'left' } }
|
||
];
|
||
var columns = [];
|
||
// head
|
||
for (var hd in list_columns) {
|
||
var col = {};
|
||
col.name = list_columns[hd].name;
|
||
col.caption = list_columns[hd].caption;
|
||
col.visible = true;
|
||
col.sortable = true;
|
||
col.width = list_columns[hd].css.width;
|
||
col.align = list_columns[hd].css["text-align"]
|
||
col.key = list_columns[hd].valueIndex;
|
||
if (list_columns[hd].type) {
|
||
col.type = list_columns[hd].type;
|
||
}
|
||
col.allowFilter = (col.key === 'TypeName');
|
||
col.styleFilter = function (item) {
|
||
if (item.Highlight)
|
||
return { 'background-color': 'yellow' };
|
||
}
|
||
if (col.key === 'OnSite') {
|
||
col.events = {
|
||
onclick: function (e) {
|
||
OnSiteChanging(this, e.target);
|
||
return false;
|
||
},
|
||
onchange: OnSiteChanged
|
||
};
|
||
}
|
||
columns.push(col);
|
||
}
|
||
columns.push({
|
||
name: 'delete',
|
||
width: 30,
|
||
align: 'center',
|
||
sortable: false,
|
||
isurl: true,
|
||
text: '\uf00d',
|
||
events: {
|
||
onclick: function () {
|
||
OnMachineDeleteSingle(this);
|
||
}
|
||
},
|
||
classFilter: function (e) {
|
||
return "icon-col";
|
||
},
|
||
attrs: { 'title': 'Delete' }
|
||
});
|
||
grid_dtsm.canMultiSelect = true;
|
||
grid_dtsm.columns = columns;
|
||
grid_dtsm.init();
|
||
grid_dtsm.selectedrowchanged = function (rowindex) {
|
||
var rowdata = grid_dtsm.source[rowindex];
|
||
if (rowdata) {
|
||
}
|
||
}
|
||
}
|
||
|
||
function openUseAdderss() {
|
||
//$('#dialog_useaddress .dialog-title span.title').html(title);
|
||
showmaskbg(true);
|
||
$('#dialog_useaddress')
|
||
.attr('init', 1)
|
||
.css({
|
||
'top': (document.documentElement.clientHeight - $('#dialog_useaddress').height()) / 3,
|
||
'left': (document.documentElement.clientWidth - $('#dialog_useaddress').width()) / 2
|
||
}).showDialogfixed();
|
||
$('#dialog_address_use').val($('#dialog_deliveryaddress1').val());
|
||
$('#dialog_city_use').val($('#dialog_city').val());
|
||
editableSelectState_use.text(editableSelectState.text());
|
||
$('#dialog_zip_use').val($('#dialog_zip').val());
|
||
}
|
||
|
||
function OnUseAddress() {
|
||
var addr = $('#dialog_address_use').val();
|
||
if ($.trim(addr) == '') {
|
||
showAlert("The address is required.", GetTextByKey("P_JS_USEADDRESS", "Use Address"));
|
||
return;
|
||
}
|
||
var city = $('#dialog_city_use').val();
|
||
var state = editableSelectState_use.text();
|
||
var zip = $('#dialog_zip_use').val();
|
||
|
||
$('#dialog_useaddress .maskbg').show();
|
||
var options = { addresses: [{ "OBJECTID": 0, "SingleLine": addr + ", " + city + ", " + state + " " + zip }] };
|
||
//var options = {
|
||
// addresses: [{
|
||
// "OBJECTID": 0,
|
||
// "Street": addr,
|
||
// "City": city,
|
||
// "State": state,
|
||
// "Zone": zip
|
||
// }]
|
||
//};
|
||
if (mapLocator) {
|
||
mapLocator.outSpatialReference = new SpatialReferenceC({
|
||
"wkid": 4326
|
||
});;
|
||
mapLocator.addressesToLocations(options);
|
||
}
|
||
}
|
||
|
||
</script>
|
||
</asp:Content>
|
||
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
|
||
<div>
|
||
<div class="function_title">
|
||
<span class="sbutton iconsave" onclick="OnSave(0);" data-lgid="P_JS_SAVE">Save</span>
|
||
<span class="sbutton iconsave" onclick="OnSave(1);" data-lgid="P_JS_SAVE1">Save and Exit</span>
|
||
<span class="sbutton iconassets" onclick="OnManageMachine();" data-lgid="P_JS_MANAGEASSETS">Manage Assets</span>
|
||
<span class="sbutton iconexit" onclick="OnExit(0);" data-lgid="P_JS_SAVE2">Exit Without Saving</span>
|
||
</div>
|
||
<div class="clear"></div>
|
||
<div class="subtitle">
|
||
<span data-lgid="P_JS_JOBSITEINFORMATION"></span>
|
||
<%--<span class="sbutton iconassets" onclick="OnManageMachine();" style="background-color: unset; margin-left: 280px;" data-title-lgid="P_JS_MANAGEASSETS"></span>--%>
|
||
<input type="checkbox" id="chk_displayassets" style="margin-left: 330px;" checked="checked" />
|
||
<label for="chk_displayassets" style="font-size: 12px; color: black;" data-lgid="P_JS_DISPLAYASSETS">Display Assets</label>
|
||
<input type="checkbox" id="chk_displayothers" style="margin-left: 20px;" />
|
||
<label for="chk_displayothers" style="font-size: 12px; color: black;" data-lgid="P_JS_DISPLAYIMAGESICONS">Display Images and Icons</label>
|
||
<hr />
|
||
</div>
|
||
<div id="divcontent" style="overflow: auto;">
|
||
<div class="edit-content">
|
||
<div style="width: 460px; float: left;">
|
||
<table>
|
||
<tr>
|
||
<td class="jobsitetitle" colspan="2" data-lgid="P_JS_GENERAL">General</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="label"><span style="color: red; margin-left: 3px;">*</span><span data-lgid="P_JS_NAME_COLON">Name:</span></td>
|
||
<td>
|
||
<input type="text" id="dialog_jobsitename" autocomplete="off" maxlength="200" tabindex="1" /></td>
|
||
</tr>
|
||
<tr>
|
||
<td class="label" data-lgid="P_JS_TYPE_COLON">Type:</td>
|
||
<td>
|
||
<%--<div id="dialog_jobsitetype"></div>--%>
|
||
<select id="dialog_jobsitetype" tabindex="1">
|
||
<option value=""></option>
|
||
<%--<option data-lgid="P_JS_FUEL" value="Fuel">Fuel</option>
|
||
<option data-lgid="P_JS_LOADING" value="Loading">Loading</option>
|
||
<option data-lgid="P_JS_DUMPING" value="Dumping">Dumping</option>
|
||
<option data-lgid="P_JS_PAVING" value="Paving">Paving</option>
|
||
<option data-lgid="P_JS_PARKING" value="Parking">Parking</option>--%>
|
||
</select>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="label" data-lgid="P_JS_REGION_COLON">Region:</td>
|
||
<td>
|
||
<%--<input type="text" id="dialog_region" autocomplete="off" maxlength="200" tabindex="1" />--%>
|
||
<select id="dialog_region" tabindex="1">
|
||
</select>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="label" data-lgid="P_JS_NUMBER_COLON">Number:</td>
|
||
<td>
|
||
<input type="text" id="dialog_number" autocomplete="off" maxlength="200" tabindex="1" /></td>
|
||
</tr>
|
||
<tr>
|
||
<td class="label" data-lgid="P_JS_CODE_COLON">Code:</td>
|
||
<td>
|
||
<input type="text" id="dialog_jobsitecode" autocomplete="off" maxlength="50" tabindex="1" /></td>
|
||
</tr>
|
||
<tr>
|
||
<td class="label" data-lgid="P_JS_BINDINGASSET_COLON">Binding to the Asset:</td>
|
||
<td title="Only Assets with CalAmp & FI Tracker are available">
|
||
<%--<div id="dialog_machine" style="width: 322px; height: 22px; margin: 5px 0px 6px 0px;" tabindex="2"></div>--%>
|
||
<select id="dialog_machine" style="width: 324px; margin: 5px 0px 6px 0px;" tabindex="1"></select>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="label" data-lgid="P_JS_COLOR_COLON">Color:</td>
|
||
<td>
|
||
<input type="text" id="dialog_color" autocomplete="off" onkeyup="inputchange();" maxlength="20" tabindex="1" style="width: 140px;" />
|
||
<input id="jobsitecolor" />
|
||
</td>
|
||
</tr>
|
||
|
||
<tr>
|
||
<td class="jobsitetitle" style="padding-top: 10px;" colspan="2" data-lgid="P_JS_CONTACTINFORMATION">Contact Information</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="label" data-lgid="P_JS_FOREMAN_COLON">Foreman:</td>
|
||
<td>
|
||
<div id="dialog_foreman" style="width: 322px; height: 22px;" tabindex="1"></div>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="label" data-lgid="P_JS_MANAGER_COLON">Manager:</td>
|
||
<td>
|
||
<input type="text" id="dialog_manager" autocomplete="off" maxlength="50" tabindex="1" /></td>
|
||
</tr>
|
||
<tr>
|
||
<td class="label" data-lgid="P_JS_PHONE_COLON">Phone:</td>
|
||
<td>
|
||
<input type="text" id="dialog_phone" autocomplete="off" maxlength="50" tabindex="1" /></td>
|
||
</tr>
|
||
<tr>
|
||
<td class="label" data-lgid="P_JS_EMAIL_COLON">Email:</td>
|
||
<td>
|
||
<input type="text" id="dialog_email" autocomplete="off" maxlength="50" tabindex="1" /></td>
|
||
</tr>
|
||
<tr>
|
||
<td class="label" data-lgid="P_JS_GROUP_COLON">Group:</td>
|
||
<td>
|
||
<input type="text" id="dialog_group" autocomplete="off" maxlength="50" tabindex="1" /></td>
|
||
</tr>
|
||
<tr>
|
||
<td class="label" data-lgid="P_JS_DELIVERYADDRESS1_COLON">Delivery Address 1:</td>
|
||
<td>
|
||
<input type="text" id="dialog_deliveryaddress1" autocomplete="off" maxlength="50" tabindex="1" /></td>
|
||
</tr>
|
||
<tr>
|
||
<td class="label" data-lgid="P_JS_DELIVERYADDRESS2_COLON">Delivery Address 2:</td>
|
||
<td>
|
||
<input type="text" id="dialog_deliveryaddress2" autocomplete="off" maxlength="50" tabindex="1" /></td>
|
||
</tr>
|
||
<tr>
|
||
<td class="label" data-lgid="P_JS_CITY_COLON">City:</td>
|
||
<td>
|
||
<input type="text" id="dialog_city" autocomplete="off" maxlength="50" tabindex="1" /></td>
|
||
</tr>
|
||
<tr>
|
||
<td class="label" data-lgid="P_JS_STATE_COLON">State:</td>
|
||
<td>
|
||
<div id="dialog_state" style="width: 322px; height: 22px;" tabindex="1"></div>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="label" data-lgid="P_JS_ZIP_COLON">Zip:</td>
|
||
<td>
|
||
<input type="text" id="dialog_zip" autocomplete="off" maxlength="50" tabindex="1" /></td>
|
||
</tr>
|
||
<tr>
|
||
<td class="label" data-lgid="P_JS_COUNTY_COLON">County:</td>
|
||
<td>
|
||
<input type="text" id="dialog_county" autocomplete="off" maxlength="50" tabindex="1" /></td>
|
||
</tr>
|
||
<tr>
|
||
<td class="jobsitetitle" style="padding-top: 10px;" colspan="2" data-lgid="P_JS_ACTIVEDATES">Active Dates</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="label" data-lgid="P_JS_STATDATE_COLON">Start Date:</td>
|
||
<td>
|
||
<input type="text" id="dialog_startdate" autocomplete="off" tabindex="1" />
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="label" data-lgid="P_JS_PROJECTEDENDDATE_COLON">Project End Date:</td>
|
||
<td>
|
||
<input type="text" id="dialog_projectenddate" autocomplete="off" tabindex="1" /></td>
|
||
</tr>
|
||
<tr>
|
||
<td class="label" data-lgid="P_JS_ENDDATE_COLON">End Date:</td>
|
||
<td>
|
||
<input type="text" id="dialog_enddate" autocomplete="off" tabindex="1" />
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="label jobsitetitle" style="padding-top: 10px;" data-lgid="P_JS_NOTES_COLON">Notes:</td>
|
||
<td>
|
||
<textarea id="dialog_notes" maxlength="1000" tabindex="1" style="width: 320px; height: 80px; margin-top: 15px;"></textarea>
|
||
</td>
|
||
</tr>
|
||
</table>
|
||
</div>
|
||
<div style="float: left; margin-left: 14px; margin-top: -5px;">
|
||
<div id="mapdiv" style="position: absolute; left: 470px; right: 5px; top: 82px; bottom: 5px; background-color: Window;">
|
||
</div>
|
||
<div id="basemapgalleryDiv">
|
||
<div id="basemapImg"></div>
|
||
<div id="basemapTitle"></div>
|
||
</div>
|
||
<div id="basemapGallery"></div>
|
||
|
||
<div id="div_jslocation">
|
||
<table style="margin-left: 5px; margin-right: 5px;">
|
||
<tr>
|
||
<td class="jslocation_lable" data-lgid="P_JS_LATITUDE_COLON">Latitude:</td>
|
||
<td>
|
||
<input type="text" id="dialog_latitude" onkeyup="inputchange();" autocomplete="off" maxlength="30" tabindex="1" style="width: 140px;" /></td>
|
||
</tr>
|
||
<tr>
|
||
<td class="jslocation_lable" data-lgid="P_JS_LONGITUDE_COLON">Longitude:</td>
|
||
<td>
|
||
<input type="text" id="dialog_longitude" onkeyup="inputchange();" autocomplete="off" maxlength="30" tabindex="1" style="width: 140px;" /></td>
|
||
|
||
</tr>
|
||
<tr>
|
||
<td class="jslocation_lable" data-lgid="P_JS_RADIUS_COLON">Radius:</td>
|
||
<td>
|
||
<input type="text" id="dialog_radius" onkeyup="inputchange();" autocomplete="off" maxlength="20" tabindex="1" style="width: 140px;" /></td>
|
||
</tr>
|
||
<tr>
|
||
<td class="jslocation_lable" data-lgid="P_JS_RADIUSUOM_COLON">Radius UOM:</td>
|
||
<td>
|
||
<select id="dialog_radiusuom" onchange="inputchange();" tabindex="1" style="width: 144px;">
|
||
<option value="Mile" data-lgid="P_JS_MILE">Mile</option>
|
||
<option value="Kilometre" data-lgid="P_JS_KILOMETER">Kilometer</option>
|
||
</select></td>
|
||
</tr>
|
||
<tr>
|
||
<td colspan="2" style="text-align: right; padding-top: 3px;">
|
||
<span id="importshapefile" class="sbutton iconimport" style="padding-left: 6px; padding-right: 1px;" data-title-lgid="P_JS_IMPORTSHAPEFILE" onclick="UploadImportShapeFile();" tabindex="10"></span>
|
||
<span id="drawjobsite" class="sbutton iconpolygon" style="padding-left: 6px; padding-right: 1px;" data-title-lgid="P_JS_DRAWJOBSITE" onclick="drawJobsite();" tabindex="10"></span>
|
||
<span id="cleardrawn" class="sbutton icontrash" style="padding-left: 6px; padding-right: 1px;" data-title-lgid="P_JS_CLEARDRAWN" onclick="clearDrawn();" tabindex="11"></span>
|
||
<span class="sbutton iconaddress" data-title-lgid="P_JS_USEADDRESS" style="padding-left: 6px; padding-right: 1px;" onclick="openUseAdderss();" tabindex="11"></span>
|
||
</td>
|
||
</tr>
|
||
</table>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<div id="mask_bg" style="display: none;">
|
||
<div class="loading c-spin"></div>
|
||
</div>
|
||
<div class="dialog" id="dialog_managemahchine" style="display: none;">
|
||
<div class="dialog-title"><span id="spTitle" class="title" data-lgid="P_JS_MANAGEASSETS"></span><em class="dialog-close"></em></div>
|
||
<div class="machine_filter" style="display: none">
|
||
<span style="margin-left: 10px;" data-lgid="P_JS_TYPE">Type: </span>
|
||
<select id="sel_machine_type" tabindex="20"></select>
|
||
<input type="text" id="txt_machine_key" tabindex="21" />
|
||
<input type="button" class="ybutton" id="btnFilter" value="Filter" tabindex="22" />
|
||
<span id="span_text_holder" style="display: none;"></span>
|
||
</div>
|
||
<div class="machine_filter" style="margin: 9px 6px 7px">
|
||
<span class="sbutton iconadd" onclick="OnMachineAdd()" data-lgid="P_JS_ADD">Add</span>
|
||
<span class="sbutton iconrefresh" onclick="GetSelectedMachines()" data-lgid="P_JS_REFRESH"></span>
|
||
</div>
|
||
<div class="machine_title">
|
||
<div id="machine-name"></div>
|
||
</div>
|
||
<div id="selectedmachinelist" style="height: 500px; width: 780px;"></div>
|
||
|
||
<div class="dialog-func">
|
||
<input type="button" value="Close" data-lgid="P_JS_CLOSE" class="dialog-close" tabindex="28" />
|
||
<%--<input type="button" onclick="OnSaveMachine();" value="OK" tabindex="27" />--%>
|
||
<div class="clear"></div>
|
||
</div>
|
||
<div id="dialogmask" class="maskbg" style="display: none;">
|
||
<div class="loading_icon icon c-spin"></div>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="dialog" id="dialog_useaddress" style="display: none;">
|
||
<div class="dialog-title"><span class="title" data-lgid="P_JS_USEADDRESS">Use Address</span><em class="dialog-close"></em></div>
|
||
<div class="edit-content" style="height: 150px; width: 460px;">
|
||
<table style="line-height: 40px;">
|
||
<tr>
|
||
<td class="label" style="width: 100px; vertical-align: middle;" data-lgid="P_JS_ADDRESS">Address</td>
|
||
<td>
|
||
<input type="text" id="dialog_address_use" maxlength="500" tabindex="1" style="width: 320px;" autocomplete="off" />
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="label" style="width: 100px; vertical-align: middle;" data-lgid="P_JS_CITY_COLON">City:</td>
|
||
<td>
|
||
<input type="text" id="dialog_city_use" autocomplete="off" maxlength="50" tabindex="1" /></td>
|
||
</tr>
|
||
<tr>
|
||
<td class="label" style="width: 100px; vertical-align: middle;" data-lgid="P_JS_STATE_COLON">State:</td>
|
||
<td>
|
||
<div id="dialog_state_use" style="width: 322px; height: 22px;" tabindex="1"></div>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="label" style="width: 100px; vertical-align: middle;" data-lgid="P_JS_ZIP_COLON">Zip:</td>
|
||
<td>
|
||
<input type="text" id="dialog_zip_use" autocomplete="off" maxlength="50" tabindex="1" /></td>
|
||
</tr>
|
||
</table>
|
||
</div>
|
||
<div class="dialog-func">
|
||
<input type="button" value="Close" data-lgid="P_JS_CANCEL" class="dialog-close" tabindex="28" />
|
||
<input type="button" onclick="OnUseAddress();" value="OK" tabindex="27" />
|
||
<div class="clear"></div>
|
||
</div>
|
||
|
||
<div class="maskbg" style="display: none;">
|
||
<div class="loading_icon icon c-spin"></div>
|
||
</div>
|
||
</div>
|
||
</asp:Content>
|