sync
This commit is contained in:
@ -8,27 +8,6 @@
|
||||
display: none;
|
||||
}
|
||||
|
||||
.tab-header {
|
||||
float: left;
|
||||
padding: 2px 6px;
|
||||
cursor: pointer;
|
||||
border: 1px solid #fff;
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.tab-header:hover {
|
||||
background: #eee;
|
||||
}
|
||||
|
||||
.tab-header.selected {
|
||||
border-color: #d8d8d8;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.tab-header.selected:hover {
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.label { /*cover tab.css*/
|
||||
display: table-cell;
|
||||
}
|
||||
@ -60,9 +39,9 @@
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.dialog, .data-column-header-filter-panel, .data-column-header-filter-bg {
|
||||
/*.dialog, .data-column-header-filter-panel, .data-column-header-filter-bg {
|
||||
z-index: 700;
|
||||
}
|
||||
}*/
|
||||
|
||||
.subtitle {
|
||||
margin: 20px 40px 5px 0px;
|
||||
@ -97,7 +76,6 @@
|
||||
<script src="<%=GetFileUrlWithVersion("js/addcustomerrecord.js")%>" type="text/javascript"></script>
|
||||
<script type="text/javascript">
|
||||
var custid = "";
|
||||
var loadingCount = 0;
|
||||
var assetid = 0;
|
||||
var CRReadOnly = <%=CRReadOnly ?"true":"false"%>;
|
||||
var AllowCanOpenWO = <%=AllowCanOpenWO ?"true":"false"%>;
|
||||
@ -137,9 +115,9 @@
|
||||
|
||||
var customer;
|
||||
function getCustomerRecordInfo() {
|
||||
showLoading();
|
||||
showloading(true);
|
||||
crrequest("GetCustomerRecordInfo", custid, function (data) {
|
||||
hideLoading();
|
||||
showloading(false);
|
||||
if (typeof (data) === "string") {
|
||||
showAlert(data, GetTextByKey("P_UM_ERROR", 'Error'));
|
||||
return;
|
||||
@ -155,7 +133,7 @@
|
||||
$('#dialog_salespersonname').val(customer.SalespersonName);
|
||||
|
||||
}, function (err) {
|
||||
hideLoading();
|
||||
showloading(false);
|
||||
});
|
||||
}
|
||||
|
||||
@ -191,10 +169,10 @@
|
||||
return;
|
||||
}
|
||||
|
||||
showmaskbg(true);
|
||||
showloading(true);
|
||||
param = htmlencode(JSON.stringify(item));
|
||||
crrequest("SaveCustomerRecord", param, function (data) {
|
||||
showmaskbg(false);
|
||||
showloading(false);
|
||||
if (typeof (data) === "string") {
|
||||
showAlert(data, alerttitle);
|
||||
} else {
|
||||
@ -215,6 +193,7 @@
|
||||
OnExit(exit);
|
||||
}
|
||||
}, function (err) {
|
||||
showloading(false);
|
||||
showAlert(GetTextByKey("P_CR_FAILEDTOSAVECUSTOMER", 'Failed to save customer.'), alerttitle);
|
||||
});
|
||||
}
|
||||
@ -227,6 +206,8 @@
|
||||
}
|
||||
|
||||
var assignmenloaded = false;
|
||||
var crcomment;
|
||||
|
||||
function init(cid, aid) {
|
||||
custid = cid;
|
||||
assetid = aid || 0;
|
||||
@ -237,6 +218,7 @@
|
||||
$('.comments').hide();
|
||||
if (custid && custid !== '') {
|
||||
OnEdit();
|
||||
createCustomerComment();
|
||||
getCustomerComments();
|
||||
$('#tab_header_assignment').show();
|
||||
$('#btncomments').show();
|
||||
@ -256,20 +238,40 @@
|
||||
}
|
||||
}
|
||||
|
||||
function showLoading() {
|
||||
loadingCount++;
|
||||
$("#dialogmask").show();
|
||||
}
|
||||
|
||||
function hideLoading() {
|
||||
loadingCount--;
|
||||
if (loadingCount === 0)
|
||||
$("#dialogmask").hide();
|
||||
}
|
||||
|
||||
|
||||
//*************************Start Comment********************************//
|
||||
|
||||
function createCustomerComment() {
|
||||
crcomment = new window['lib-app'].CustomerRecordComment({
|
||||
getText: GetTextByKey,
|
||||
readonly: CRReadOnly,
|
||||
hasClose: true,
|
||||
onAddComment: function (comment) {
|
||||
if ($.trim(comment) == "") {
|
||||
//showAlert(GetTextByKey("P_FR_PLEASEINPUTTHECOMMENT", "Please input the comment."), GetTextByKey("P_WO_ERROR", 'Error'));
|
||||
return;
|
||||
}
|
||||
|
||||
var param = JSON.stringify([custid, false, comment]);
|
||||
param = htmlencode(param);
|
||||
$('#mask_over_bg').show();
|
||||
crrequest("SubmitComment", param, function (data) {
|
||||
$('#mask_over_bg').hide();
|
||||
if (data !== "") {
|
||||
showAlert(data, GetTextByKey("P_FR_ERROR", 'Error'));
|
||||
return;
|
||||
}
|
||||
crcomment.text = '';
|
||||
getCustomerComments();
|
||||
}, function () {
|
||||
$('#mask_over_bg').hide();
|
||||
});
|
||||
},
|
||||
onClose: closeComments
|
||||
});
|
||||
$('.comments').empty().append(crcomment.create());
|
||||
}
|
||||
|
||||
function getCustomerComments() {
|
||||
$('#mask_over_bg').show();
|
||||
crrequest("GetCustomerComments", custid, function (data) {
|
||||
@ -278,62 +280,17 @@
|
||||
return;
|
||||
}
|
||||
$("#li_comments").data("loaded", true);
|
||||
$("#divcomments").empty();
|
||||
if (data && data.length > 0) {
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
var comment = data[i];
|
||||
showComment(comment, i == 0)
|
||||
}
|
||||
}
|
||||
crcomment.load(data);
|
||||
}, function (err) {
|
||||
$('#mask_over_bg').hide();
|
||||
});
|
||||
}
|
||||
|
||||
function showComment(comment, isfirst) {
|
||||
var commoentctrl = $("#divcomments");
|
||||
var div = $("<div class='msgdiv'></div>").appendTo(commoentctrl);
|
||||
if (isfirst)
|
||||
div.css("margin-top", 0);
|
||||
var divuser = $("<div class='msgtime'></div>").appendTo(div);
|
||||
divuser.append($("<div style='float:left;font-weight: bold;'></div>").text(comment.UserName));
|
||||
divuser.append($("<div style='float:right;color: #aaa;'></div>").text(comment.SubmitLocalDateStr));
|
||||
var contentctrl = $("<div style='clear:both;'></div>").appendTo(div);
|
||||
contentctrl.html(replaceHtmlText(comment.Comment));
|
||||
}
|
||||
|
||||
function addCustomerComment() {
|
||||
var comment = $('#dialog_comments').val();
|
||||
if ($.trim(comment) == "") {
|
||||
showAlert(GetTextByKey("P_FR_PLEASEINPUTTHECOMMENT", "Please input the comment."), GetTextByKey("P_FR_ERROR", 'Error'));
|
||||
return;
|
||||
}
|
||||
|
||||
var param = JSON.stringify([custid, false, comment]);
|
||||
param = htmlencode(param);
|
||||
$('#mask_over_bg').show();
|
||||
crrequest("SubmitComment", param, function (data) {
|
||||
$('#mask_over_bg').hide();
|
||||
if (data !== "") {
|
||||
showAlert(data, GetTextByKey("P_FR_ERROR", 'Error'));
|
||||
return;
|
||||
}
|
||||
$('#dialog_comments').val("");
|
||||
getCustomerComments();
|
||||
}, function (err) {
|
||||
$('#mask_over_bg').hide();
|
||||
});
|
||||
}
|
||||
|
||||
function OnAddComment() {
|
||||
addCustomerComment();
|
||||
}
|
||||
|
||||
function openComments() {
|
||||
if ($('.comments').is(":visible"))
|
||||
$('.comments').hide();
|
||||
else
|
||||
$('.comments').show();
|
||||
$('.comments').css('display', 'flex');
|
||||
}
|
||||
|
||||
function closeComments() {
|
||||
@ -345,12 +302,7 @@
|
||||
//*************************Contact********************************//
|
||||
var grid_dt;
|
||||
function InitGridData() {
|
||||
grid_dt = new GridView('#contactlist');
|
||||
grid_dt.lang = {
|
||||
all: GetTextByKey("P_GRID_ALL", "(All)"),
|
||||
ok: GetTextByKey("P_GRID_OK", "OK"),
|
||||
reset: GetTextByKey("P_GRID_RESET", "Reset")
|
||||
};
|
||||
grid_dt = createGridView('#contactlist');
|
||||
var list_columns = [
|
||||
{ name: 'Name', caption: GetTextByKey("P_CR_CONTACTNAME", "Contact Name"), valueIndex: 'Name', css: { 'width': 150, 'text-align': 'left' } },
|
||||
{ name: 'ContactEmail', caption: GetTextByKey("P_CR_CONTACTEMAIL", "Contact Email"), valueIndex: 'Email', css: { 'width': 130, 'text-align': 'left' } },
|
||||
@ -358,8 +310,8 @@
|
||||
{ name: 'ContactPreferenceStr', caption: GetTextByKey("P_CR_CONTACTPREFERENCES", "Contact Preferences"), valueIndex: 'ContactPreferenceStr', css: { 'width': 130, 'text-align': 'left' } },
|
||||
{ name: 'Active', caption: GetTextByKey("P_CR_ACTIVE", "Active"), valueIndex: 'Active', type: 3, css: { 'width': 60, 'text-align': 'center' } },
|
||||
{ name: 'OptOut', caption: GetTextByKey("P_CR_OPTOUT", "Opt Out"), valueIndex: 'OptOut', type: 3, css: { 'width': 60, 'text-align': 'center' } },
|
||||
{ name: 'SurveyOptOut', caption: GetTextByKey("P_CR_XXXXXX", "Survey Opt Out"), valueIndex: 'SurveyOptOut', type: 3, css: { 'width': 80, 'text-align': 'center' } },
|
||||
{ name: 'CanOpenWO', caption: GetTextByKey("P_CR_XXXXXX", "Can Open WO"), valueIndex: 'CanOpenWO', type: 3, css: { 'width': 80, 'text-align': 'center' } },
|
||||
{ name: 'SurveyOptOut', caption: GetTextByKey("P_CR_SURVEYOPTOUT", "Survey Opt Out"), valueIndex: 'SurveyOptOut', type: 3, css: { 'width': 80, 'text-align': 'center' } },
|
||||
{ name: 'CanOpenWO', caption: GetTextByKey("P_CR_CANOPENWO", "Can Open WO"), valueIndex: 'CanOpenWO', type: 3, css: { 'width': 80, 'text-align': 'center' } },
|
||||
{ name: 'Notes', caption: GetTextByKey("P_CR_NOTES", "Notes"), valueIndex: 'Notes', css: { 'width': 200, 'text-align': 'left' } },
|
||||
{ name: 'Edit', caption: "", css: { 'width': 30, 'text-align': 'center' } },
|
||||
{ name: 'Delete', caption: "", css: { 'width': 30, 'text-align': 'center' } }
|
||||
@ -394,9 +346,10 @@
|
||||
};
|
||||
}
|
||||
else if (col.name === "Edit") {
|
||||
col.isurl = true;
|
||||
col.text = "\uf044";
|
||||
col.text = "edit";
|
||||
col.sortable = false;
|
||||
col.resizable = false;
|
||||
col.type = GridView.ColumnTypes.Icon;
|
||||
col.events = {
|
||||
onclick: function () {
|
||||
onEditContact();
|
||||
@ -408,9 +361,10 @@
|
||||
col.attrs = { 'title': GetTextByKey("P_UM_EDIT", 'Edit') };
|
||||
}
|
||||
else if (col.name === "Delete") {
|
||||
col.isurl = true;
|
||||
col.text = "\uf00d";
|
||||
col.sortable = false;
|
||||
col.resizable = false;
|
||||
col.type = GridView.ColumnTypes.Icon;
|
||||
col.text = "times";
|
||||
col.events = {
|
||||
onclick: function () {
|
||||
onDeleteContact(this);
|
||||
@ -423,11 +377,11 @@
|
||||
}
|
||||
columns.push(col);
|
||||
}
|
||||
grid_dt.canMultiSelect = false;
|
||||
grid_dt.multiSelect = false;
|
||||
grid_dt.columns = columns;
|
||||
grid_dt.init();
|
||||
if (!CRReadOnly)
|
||||
grid_dt.rowdblclick = onEditContact;
|
||||
grid_dt.onRowDblClicked = onEditContact;
|
||||
}
|
||||
|
||||
function getContacts() {
|
||||
@ -448,11 +402,10 @@
|
||||
var r = data[i];
|
||||
//for (var j in r) {
|
||||
// if (j === "Active") {
|
||||
// r[j] = { DisplayValue: r.Active ? "Yes" : "No", Value: r[j] };
|
||||
// r[j] = { DisplayValue: r.Active ? GetTextByKey("P_UTILITY_YES", "Yes") : GetTextByKey("P_UTILITY_NO", "No"), Value: r[j] };
|
||||
// }
|
||||
//}
|
||||
var fr = { Values: r };
|
||||
rows.push(fr);
|
||||
rows.push(r);
|
||||
}
|
||||
|
||||
grid_dt.setData(rows);
|
||||
@ -490,7 +443,7 @@
|
||||
var index = grid_dt.selectedIndex;
|
||||
if (index < 0) return;
|
||||
|
||||
var contact = grid_dt.source[index].Values;
|
||||
var contact = grid_dt.source[index];
|
||||
contactid = contact.Id;
|
||||
$('#dialog_contactname').val(contact.Name);
|
||||
$('#dialog_contactpreference').val(contact.ContactPreference);
|
||||
@ -538,14 +491,22 @@
|
||||
showAlert(GetTextByKey("P_CR_CONTACTNAMECANNOTBEEMPTY", 'Contact Name cannot be empty.'), alerttitle, undefined, function () { $('#dialog_contactname').focus(); });
|
||||
return;
|
||||
}
|
||||
if ((!item.Email || item.Email.length == 0) && (!item.MobilePhone || item.MobilePhone.length == 0)) {
|
||||
showAlert(GetTextByKey("P_CR_EMAILANDMOBILEPHONECANNOTBOTHBEEMPTY", 'Email and Mobile Phone cannot both be empty. '), alerttitle);
|
||||
if ((item.ContactPreference == '0' || item.ContactPreference == '2') && (!item.MobilePhone || item.MobilePhone.length == 0)) {
|
||||
showAlert(GetTextByKey("P_CR_MOBILECANNOTBEEMPTY", 'Mobile cannot be empty. '), alerttitle, undefined, function () {
|
||||
$('#dialog_mobile').focus();
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (item.ContactPreference == '1' && (!item.Email || item.Email.length == 0)) {
|
||||
showAlert(GetTextByKey("P_CR_EMAILCANNOTBEEMPTY", 'Email cannot both be empty. '), alerttitle, undefined, function () {
|
||||
$('#dialog_emailaddress').focus();
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (item.Email !== "" && !isEmail(item.Email)) {
|
||||
showcontatcmask(true);
|
||||
showAlert(GetTextByKey("P_CR_EMAILISNOTAVALIDEMAILADDRESS", 'The email address is invalid.'), alerttitle, undefined, function () {
|
||||
showcontatcmask(false);
|
||||
$('#dialog_emailaddress').focus();
|
||||
});
|
||||
return;
|
||||
}
|
||||
@ -596,12 +557,7 @@
|
||||
|
||||
var grid_dtfollower;
|
||||
function InitFollowerGridData() {
|
||||
grid_dtfollower = new GridView('#followerlist');
|
||||
grid_dtfollower.lang = {
|
||||
all: GetTextByKey("P_GRID_ALL", "(All)"),
|
||||
ok: GetTextByKey("P_GRID_OK", "OK"),
|
||||
reset: GetTextByKey("P_GRID_RESET", "Reset")
|
||||
};
|
||||
grid_dtfollower = createGridView('#followerlist');
|
||||
var list_columns = [
|
||||
{ name: 'Name', caption: GetTextByKey("P_CR_CONTACTNAME", "Contact Name"), valueIndex: 'Name', css: { 'width': 150, 'text-align': 'left' } },
|
||||
{ name: 'ContactEmail', caption: GetTextByKey("P_CR_CONTACTEMAIL", "Contact Email"), valueIndex: 'Email', css: { 'width': 130, 'text-align': 'left' } },
|
||||
@ -642,9 +598,10 @@
|
||||
}
|
||||
}
|
||||
else if (col.name === "Delete") {
|
||||
col.isurl = true;
|
||||
col.text = "\uf00d";
|
||||
col.sortable = false;
|
||||
col.resizable = false;
|
||||
col.type = GridView.ColumnTypes.Icon;
|
||||
col.text = "times";
|
||||
col.events = {
|
||||
onclick: function () {
|
||||
onDeleteFollower(this);
|
||||
@ -658,7 +615,7 @@
|
||||
|
||||
columns.push(col);
|
||||
}
|
||||
grid_dtfollower.canMultiSelect = false;
|
||||
grid_dtfollower.multiSelect = false;
|
||||
grid_dtfollower.columns = columns;
|
||||
grid_dtfollower.init();
|
||||
}
|
||||
@ -667,8 +624,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_dtfollower.setData(rows);
|
||||
@ -676,12 +632,7 @@
|
||||
|
||||
var grid_allfollower;
|
||||
function InitAllFollowerGridData() {
|
||||
grid_allfollower = new GridView('#allfollowerlist');
|
||||
grid_allfollower.lang = {
|
||||
all: GetTextByKey("P_GRID_ALL", "(All)"),
|
||||
ok: GetTextByKey("P_GRID_OK", "OK"),
|
||||
reset: GetTextByKey("P_GRID_RESET", "Reset")
|
||||
};
|
||||
grid_allfollower = createGridView('#allfollowerlist');
|
||||
var list_columns = [
|
||||
{ name: 'DisplayName', caption: GetTextByKey("P_WO_CONTACTNAME", "Contact Name"), valueIndex: 'DisplayName', css: { 'width': 240, 'text-align': 'left' } },
|
||||
{ name: 'ContactTypeName', caption: GetTextByKey("P_WO_CONTACTTYPE", "Contact Type"), valueIndex: 'ContactTypeName', css: { 'width': 120, 'text-align': 'left' } },
|
||||
@ -714,7 +665,7 @@
|
||||
};
|
||||
}
|
||||
}
|
||||
grid_allfollower.canMultiSelect = false;
|
||||
grid_allfollower.multiSelect = false;
|
||||
grid_allfollower.columns = columns;
|
||||
grid_allfollower.init();
|
||||
}
|
||||
@ -730,8 +681,7 @@
|
||||
r.Text = false;
|
||||
if (!r.Email)
|
||||
r.Email = false;
|
||||
var fr = { Values: r };
|
||||
rows.push(fr);
|
||||
rows.push(r);
|
||||
}
|
||||
|
||||
grid_allfollower.setData(rows);
|
||||
@ -790,7 +740,7 @@
|
||||
}
|
||||
|
||||
function onAddFollower() {
|
||||
var alerttitle = GetTextByKey("P_CR_XXX", 'Add Followers')
|
||||
var alerttitle = GetTextByKey("P_CR_ADDFOLLOWERS", 'Add Followers')
|
||||
if (!custid) {
|
||||
showAlert(GetTextByKey("P_CR_PLEASESAVETHECUSTOMERFIRST", 'Please save the customer first.'), alerttitle, undefined);
|
||||
return;
|
||||
@ -817,8 +767,9 @@
|
||||
|
||||
function onSaveFollowers() {
|
||||
var followers = [];
|
||||
for (var i = 0; i < grid_allfollower.source.length; i++) {
|
||||
var ct = grid_allfollower.source[i].Values;
|
||||
var tempsource = grid_allfollower.source;
|
||||
for (var i = 0; i < tempsource.length; i++) {
|
||||
var ct = tempsource[i];
|
||||
if (ct.Email || ct.Text) {
|
||||
var f = {};
|
||||
f.Id = -1;
|
||||
@ -850,11 +801,11 @@
|
||||
if (!c) {
|
||||
return;
|
||||
}
|
||||
showConfirm(GetTextByKey("P_CR_XXX", 'Do you want to delete this follower?'), GetTextByKey("P_CR_XXXXXX", 'Delete Follower'), function () {
|
||||
showConfirm(GetTextByKey("P_CR_DOYOUWANTTODELETETHISFOLLOWER", 'Do you want to delete this follower?'), GetTextByKey("P_CR_DELETEFOLLOWERS", 'Delete Follower'), function () {
|
||||
crrequest('DeleteFollower', c.Id, function (data) {
|
||||
getFollowers();
|
||||
}, function (err) {
|
||||
showAlert(GetTextByKey('P_CR_XXX', 'Failed to delete this follower.'), GetTextByKey("P_CR_DELETECONTACT", 'Delete Contact'));
|
||||
showAlert(GetTextByKey('P_CR_FAILEDTODELETETHISFOLLOWER', 'Failed to delete this follower.'), GetTextByKey("P_CR_DELETEFOLLOWERS", 'Delete Follower'));
|
||||
});
|
||||
});
|
||||
}
|
||||
@ -894,6 +845,8 @@
|
||||
});
|
||||
$('#sp_searchinputtxt').keydown(searchSalespersonEnter);
|
||||
|
||||
$('input[placeholder=Search]').attr("placeholder", GetTextByKey("P_AM_SEARCH", "Search"));
|
||||
|
||||
window.onresize = resizeContent;
|
||||
resizeContent();
|
||||
});
|
||||
@ -930,8 +883,8 @@
|
||||
<input type="text" id="dialog_salespersoncode" tabindex="1" style="width: 296px;" disabled="disabled" autocomplete="off" />
|
||||
<%if (!CRReadOnly)
|
||||
{%>
|
||||
<span class="sbutton iconsearch" style="display: inline; padding: 6px 0px 6px 5px;" onclick="onOpenSalesperson()" data-titlt-lgid="P_CR_SELECTSALESPERSON" title="Select Salesperson"></span>
|
||||
<span class="sbutton icondelete" style="display: inline; padding: 6px 0px 6px 5px;" onclick="onDeleteSalesperson()" data-titlt-lgid="P_CR_DELETESALESPERSON" title="Delete Salesperson"></span>
|
||||
<span class="sbutton iconsearch" style="display: inline; padding: 6px 0px 6px 5px;" onclick="onOpenSalesperson()" data-title-lgid="P_CR_SELECTSALESPERSON" title="Select Salesperson"></span>
|
||||
<span class="sbutton icondelete" style="display: inline; padding: 6px 0px 6px 5px;" onclick="onDeleteSalesperson()" data-title-lgid="P_CR_DELETESALESPERSON" title="Delete Salesperson"></span>
|
||||
<%}%>
|
||||
</td>
|
||||
<td></td>
|
||||
@ -978,10 +931,10 @@
|
||||
|
||||
|
||||
<div class="subtitle">
|
||||
<span data-lgid="P_CR_XXX">Following</span>
|
||||
<span data-lgid="P_CR_FOLLOWING">Following</span>
|
||||
<%if (!CRReadOnly)
|
||||
{%>
|
||||
<span class="sbutton iconadd" style="display: inline;" onclick="onAddFollower()">Add</span>
|
||||
<span class="sbutton iconadd" style="display: inline;" onclick="onAddFollower()" data-lgid="P_CR_ADD">Add</span>
|
||||
<%}%>
|
||||
<hr />
|
||||
</div>
|
||||
@ -1012,45 +965,19 @@
|
||||
<div class="mask_loading dialog" style="display: none;"></div>
|
||||
|
||||
|
||||
<div class="comments" style="display: none; width: 400px; background-color: #f4f4f4; position: absolute; right: 0; top: 0; bottom: 0; box-shadow: #CECACA -4px 0px 6px;">
|
||||
<div style="padding: 5px 0 5px 10px; background-color: #dcdcdc;">
|
||||
<span data-lgid="P_CR_COMMENTS">Comments</span>
|
||||
<em class="spanbtn icondelete" style="float: right; margin-right: 5px; font-size: 14px;" onclick="closeComments()"></em>
|
||||
</div>
|
||||
<div style="clear: both;"></div>
|
||||
<div style="position: absolute; width: 380px; top: 32px; bottom: 1px; right: 10px;">
|
||||
<div style="left: 2px; top: 5px; height: 106px;">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<div style="border: solid 1px rgb(123,28,33);">
|
||||
<textarea id="dialog_comments" maxlength="3000" tabindex="1" style="margin-top: 4px; width: 360px; height: 60px; border: none; outline: none;"></textarea>
|
||||
<br />
|
||||
<div style="font-size: 20px; text-align: right; margin-bottom: 3px;">
|
||||
<%if (!CRReadOnly)
|
||||
{%>
|
||||
<span class="spanbtn iconsend" onclick="OnAddComment();"></span>
|
||||
<%}%>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div id="divcomments" style="position: absolute; bottom: 5px; top: 110px; left: 5px; right: 0; overflow: auto;">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="comments" style="display: none; position: absolute; right: 20px; top: 33px; bottom: 0; z-index: 3;"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="dialogmask" class="maskbg" style="display: none;">
|
||||
<div class="loading_icon icon c-spin"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="mask_bg" style="display: none; "><div class="loading c-spin"></div></div>
|
||||
|
||||
<div id="mask_bg" style="display: none;">
|
||||
<div class="loading c-spin"></div>
|
||||
</div>
|
||||
<div class="dialog" id="dialog_contact" style="display: none;">
|
||||
<div class="dialog-title"><span class="title" data-lgid="P_CR_ADDCONTACT">Add Contact</span><em class="dialog-close"></em></div>
|
||||
<div class="dialog-content">
|
||||
@ -1090,19 +1017,19 @@
|
||||
<input type="checkbox" id="dialog_active" checked="checked" tabindex="1" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label" data-lgid="P_CR_XXXXXX">Opt Out:</td>
|
||||
<td class="label" data-lgid="P_CR_OPTOUT_COLON">Opt Out:</td>
|
||||
<td>
|
||||
<input type="checkbox" id="dialog_optout" tabindex="1" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label" data-lgid="P_CR_XXXXXX">Survey Opt Out:</td>
|
||||
<td class="label" data-lgid="P_CR_SURVEYOPTOUT_COLON">Survey Opt Out:</td>
|
||||
<td>
|
||||
<input type="checkbox" id="dialog_surveyoptout" tabindex="1" /></td>
|
||||
</tr>
|
||||
<%if (AllowCanOpenWO)
|
||||
{%>
|
||||
<tr>
|
||||
<td class="label" data-lgid="P_CR_XXXXXX">Can Open WO:</td>
|
||||
<td class="label" data-lgid="P_CR_CANOPENWO_COLON">Can Open WO:</td>
|
||||
<td>
|
||||
<input type="checkbox" id="dialog_canopenwo" tabindex="1" /></td>
|
||||
</tr>
|
||||
@ -1142,11 +1069,11 @@
|
||||
|
||||
<div id="addfollowerpopupmask" class="maskbg" style="display: none;"></div>
|
||||
<div class="dialog" id="addfollowerpopupdialog" style="display: none; width: 560px;">
|
||||
<div class="dialog-title"><span class="title" data-lgid="P_WO_XXXXXX">Add Followers</span><em class="dialog-close"></em></div>
|
||||
<div class="dialog-title"><span class="title" data-lgid="P_CR_ADDFOLLOWERS">Add Followers</span><em class="dialog-close"></em></div>
|
||||
<div class="dialog-content">
|
||||
<table style="line-height: 25px;">
|
||||
<tr>
|
||||
<td data-lgid="P_WO_XXXXXX">Who do you want to receive customer notifications?</td>
|
||||
<td data-lgid="P_CR_WHODOYOUWANTTORECEIVECUSTOMERNOTIFICATIONS">Who do you want to receive customer notifications?</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
|
@ -3,43 +3,12 @@
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
|
||||
<link href="<%=GetFileUrlWithVersion("../css/tabcontrol.css")%>" rel="stylesheet" />
|
||||
<link href="<%=GetFileUrlWithVersion("css/maintenance.css")%>" rel="stylesheet" />
|
||||
<style type="text/css">
|
||||
::-ms-clear, ::-ms-reveal {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.edit-content table {
|
||||
border-collapse: collapse;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.edit-content table td.label {
|
||||
width: 130px;
|
||||
text-align: right;
|
||||
padding-right: 10px;
|
||||
line-height: 24px;
|
||||
height: 24px;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.edit-content table td input,
|
||||
.edit-content table td textarea {
|
||||
border: 1px solid #a9a9a9;
|
||||
width: 320px;
|
||||
height: 18px;
|
||||
padding: 1px;
|
||||
}
|
||||
|
||||
.edit-content table td input[type="checkbox"] {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.edit-content table td textarea {
|
||||
height: 100px;
|
||||
resize: none;
|
||||
/*max-width: 200px;*/
|
||||
}
|
||||
|
||||
.a {
|
||||
text-decoration: none;
|
||||
color: #2140fb;
|
||||
@ -111,7 +80,6 @@
|
||||
<link href="<%=GetFileUrlWithVersion("../css/jquery.datetimepicker.css")%>" rel="stylesheet" />
|
||||
<script src="<%=GetFileUrlWithVersion("../Maintenance/js/inputdatactr.js")%>" type="text/javascript"></script>
|
||||
<script src="<%=GetFileUrlWithVersion("../js/jquery.datetimepicker.full.js")%>"></script>
|
||||
<script src="<%=GetFileUrlWithVersion("../js/editableselect.js")%>"></script>
|
||||
<script src="<%=GetFileUrlWithVersion("../js/controls.js")%>" type="text/javascript"></script>
|
||||
<script src="<%=GetFileUrlWithVersion("js/fuelrecordattachments.js")%>" type="text/javascript"></script>
|
||||
<script src="<%=GetFileUrlWithVersion("../js/assetselector.js")%>" type="text/javascript"></script>
|
||||
@ -124,10 +92,6 @@
|
||||
var fueltypes = [];
|
||||
var statedata = [];
|
||||
var unitdata = [];
|
||||
var editableSelectState;
|
||||
var editableSelectMachine;
|
||||
var editableSelectUnit;
|
||||
|
||||
|
||||
function fuelrequest(method, param, callback, error) {
|
||||
_network.request("Maintenance/AddFuelRecord.aspx", -1, method, param, callback, error || function (e) {
|
||||
@ -145,7 +109,7 @@
|
||||
}
|
||||
|
||||
function setMachineInfo() {
|
||||
var machine = editableSelectMachine.selecteditem();
|
||||
var machine = $('#dialog_machine').dropdownItem();
|
||||
if (machine) {
|
||||
$('#dialog_vin').text(machine.VIN);
|
||||
$('#dialog_make').text(machine.MakeName);
|
||||
@ -175,7 +139,7 @@
|
||||
setEnable(false);
|
||||
fuel = undefined;
|
||||
fuelid = undefined;
|
||||
editableSelectMachine.val('');
|
||||
$('#dialog_machine').dropdownVal('');
|
||||
setMachineInfo();
|
||||
$('#dialog_transactiondate').val('');
|
||||
$('#dialog_timehour').val('00');
|
||||
@ -187,14 +151,14 @@
|
||||
$('#dialog_fuelingasset').data('fuelingassetid', -1);
|
||||
$('#dialog_retaileraddress').val('');
|
||||
$('#dialog_retailercity').val('');
|
||||
editableSelectState.val('');
|
||||
$('#dialog_retailerstate').dropdownVal('');
|
||||
$('#dialog_retailerzip').val('');
|
||||
$('#dialog_odometer').val('');
|
||||
$('#dialog_odometeruom').val(systemunitofodometer ? systemunitofodometer.toLowerCase() : "");
|
||||
$('#dialog_fueltype').val('');
|
||||
$('#dialog_odometeruom').dropdownVal(systemunitofodometer ? systemunitofodometer.toLowerCase() : "");
|
||||
$('#dialog_fueltype').dropdownVal('');
|
||||
$('#dialog_fueltypename').text('');
|
||||
$('#dialog_brandname').val('');
|
||||
editableSelectUnit.val('');
|
||||
$('#dialog_unitofmeasure').dropdownVal('');
|
||||
$('#dialog_quantity').val('');
|
||||
$('#dialog_unitcost').val('');
|
||||
$('#dialog_totalcost').val('');
|
||||
@ -211,8 +175,8 @@
|
||||
$('#tabAttachments').hide();
|
||||
$("#tbAttas").empty();
|
||||
$('#span_a').show();
|
||||
editableSelectMachine.setEnable(false);
|
||||
editableSelectMachine.val(fuel.AssetID);
|
||||
$('#dialog_machine').dropdownDisabled(true);
|
||||
$('#dialog_machine').dropdownVal(fuel.AssetID);
|
||||
setMachineInfo();
|
||||
var time = fuel.TransactionLocalDate.DisplayValue.split(' ');
|
||||
$('#dialog_transactiondate').val(time[0]);
|
||||
@ -242,14 +206,14 @@
|
||||
setDistributedBy(distributedby);
|
||||
$('#dialog_retaileraddress').val(fuel.RetailerAddress);
|
||||
$('#dialog_retailercity').val(fuel.RetailerCity);
|
||||
editableSelectState.text(fuel.RetailerState);
|
||||
$('#dialog_retailerstate').dropdownVal(fuel.RetailerState);
|
||||
$('#dialog_retailerzip').val(fuel.RetailerZip);
|
||||
$('#dialog_odometer').val(fuel.Odomerter);
|
||||
$('#dialog_odometeruom').val(fuel.OdometerUnits);
|
||||
$('#dialog_fueltype').val(fuel.FuelType);
|
||||
$('#dialog_odometeruom').dropdownVal(fuel.OdometerUnits);
|
||||
$('#dialog_fueltype').dropdownVal(fuel.FuelType);
|
||||
$('#dialog_fueltypename').text(fuel.FuelType);
|
||||
$('#dialog_brandname').val(fuel.BrandName);
|
||||
editableSelectUnit.text(fuel.Uom);
|
||||
$('#dialog_unitofmeasure').dropdownVal(fuel.Uom);
|
||||
$('#dialog_quantity').val(fuel.Quantity);
|
||||
$('#dialog_unitcost').val(fuel.UnitCost);
|
||||
$('#dialog_totalcost').val(fuel.TotalCost);
|
||||
@ -281,6 +245,7 @@
|
||||
if ($(obj).hasClass('disabled')) {
|
||||
return;
|
||||
}
|
||||
var fueltype = $('#dialog_fueltype').dropdownItem();
|
||||
var item = {
|
||||
'TransactionDate': $('#dialog_transactiondate').val(),
|
||||
'TicketNumber': $('#dialog_ticketnumber').val(),
|
||||
@ -290,14 +255,14 @@
|
||||
'FuelingAsset': $('#dialog_fuelingasset').data('fuelingassetid'),
|
||||
'RetailerAddress': $('#dialog_retaileraddress').val(),
|
||||
'RetailerCity': $('#dialog_retailercity').val(),
|
||||
'RetailerState': $.trim(editableSelectState.text()),
|
||||
'RetailerState': $.trim($('#dialog_retailerstate').dropdownVal()),
|
||||
'RetailerZip': $('#dialog_retailerzip').val(),
|
||||
'Odomerter': $('#dialog_odometer').val(),
|
||||
'OdometerUnits': $('#dialog_odometeruom').val(),
|
||||
'FuelTypeName': $("#dialog_fueltype").find("option:selected").text(),
|
||||
'FuelType': $('#dialog_fueltype').val(),
|
||||
'OdometerUnits': $.trim($('#dialog_odometeruom').dropdownVal()),
|
||||
'FuelTypeName': fueltype.Value,
|
||||
'FuelType': fueltype.Key,
|
||||
'BrandName': $('#dialog_brandname').val(),
|
||||
'Uom': $.trim(editableSelectUnit.text()),
|
||||
'Uom': $.trim($('#dialog_unitofmeasure').dropdownVal()),
|
||||
'Quantity': $('#dialog_quantity').val(),
|
||||
'UnitCost': $('#dialog_unitcost').val(),
|
||||
'TotalCost': $('#dialog_totalcost').val(),
|
||||
@ -312,7 +277,7 @@
|
||||
alerttitle = GetTextByKey("P_FR_ADDFUELRECORD", "Add Fule Record");
|
||||
}
|
||||
|
||||
var machine = editableSelectMachine.selecteditem();
|
||||
var machine = $('#dialog_machine').dropdownItem();
|
||||
if (machine == null) {
|
||||
showAlert(GetTextByKey("P_FR_ASSETNOTEMPTY", 'Asset cannot be empty.'), alerttitle);
|
||||
$('#dialog_machine').focus();
|
||||
@ -439,15 +404,16 @@
|
||||
worequest("GetMachines", "", function (data) {
|
||||
if (data && data.length > 0) {
|
||||
machines = data;
|
||||
editableSelectMachine.datasource = machines;
|
||||
editableSelectMachine.valuepath = "Id"
|
||||
editableSelectMachine.displaypath = "DisplayName";
|
||||
|
||||
if (fuel && fuel.AssetID !== undefined) {
|
||||
editableSelectMachine.val(fuel.AssetID);
|
||||
setMachineInfo();
|
||||
}
|
||||
}
|
||||
$('#dialog_machine').dropdownSource(machines);
|
||||
if (fuel && fuel.AssetID !== undefined) {
|
||||
$('#dialog_machine').dropdownVal(fuel.AssetID);
|
||||
setMachineInfo();
|
||||
}
|
||||
else {
|
||||
$('#dialog_machine').dropdownVal('');
|
||||
}
|
||||
|
||||
if (next)
|
||||
next();
|
||||
}, function (err) {
|
||||
@ -464,9 +430,9 @@
|
||||
$('.iconadd').css('display', 'none');
|
||||
}
|
||||
|
||||
editableSelectMachine.setEnable(!enable);
|
||||
editableSelectState.setEnable(!enable);
|
||||
editableSelectUnit.setEnable(!enable);
|
||||
$('#dialog_machine').dropdownDisabled(enable);
|
||||
$('#dialog_retailerstate').dropdownDisabled(enable);
|
||||
$('#dialog_unitofmeasure').dropdownDisabled(enable);
|
||||
$('#tab_fuelrecordinformation input').attr('disabled', enable);
|
||||
$('#tab_fuelrecordinformation select').attr('disabled', enable);
|
||||
$('#tab_fuelrecordinformation textarea').attr('disabled', enable);
|
||||
@ -493,10 +459,6 @@
|
||||
$("#li_comments").hide();
|
||||
}
|
||||
$("#li_deviceinfo").click();
|
||||
|
||||
editableSelectMachine.reload();
|
||||
editableSelectState.reload();
|
||||
editableSelectUnit.reload();
|
||||
}
|
||||
|
||||
|
||||
@ -518,18 +480,21 @@
|
||||
}
|
||||
|
||||
function getStates() {
|
||||
statedata.push("AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DE", "FL", "GA", "HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MD", "MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ",
|
||||
var data = [];
|
||||
data.push("AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DE", "FL", "GA", "HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MD", "MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ",
|
||||
"NM", "NY", "NC", "ND", "OH", "OK", "OR", "PA", "RI", "SC", "SD", "TN", "TX", "UT", "VT", "VA", "WA", "WV", "WI", "WY");
|
||||
editableSelectState.datasource = statedata;
|
||||
editableSelectState.valuepath = ""
|
||||
editableSelectState.displaypath = "";
|
||||
|
||||
for (var type of data) {
|
||||
statedata.push({ value: type });
|
||||
}
|
||||
|
||||
$('#dialog_retailerstate').dropdownSource(statedata);
|
||||
}
|
||||
|
||||
function getUnit() {
|
||||
unitdata.push({ 'Key': 'GAL', 'Value': 'Gallon' }, { 'Key': 'Litre', 'Value': 'Litre' });
|
||||
editableSelectUnit.datasource = unitdata;
|
||||
editableSelectUnit.valuepath = "Key"
|
||||
editableSelectUnit.displaypath = "Value";
|
||||
|
||||
$('#dialog_unitofmeasure').dropdownSource(unitdata);
|
||||
}
|
||||
|
||||
function getFuelTypes() {
|
||||
@ -540,16 +505,11 @@
|
||||
}
|
||||
if (data && data.length > 0) {
|
||||
fueltypes = data;
|
||||
$("#dialog_fueltype").empty();
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
var kv = data[i];
|
||||
var op = $("<option></option>").val(kv.Key).text(kv.Value);
|
||||
$("#dialog_fueltype").append(op);
|
||||
}
|
||||
}
|
||||
else
|
||||
fueltypes = [];
|
||||
|
||||
$('#dialog_fueltype').dropdownSource(fueltypes);
|
||||
}, function (err) {
|
||||
});
|
||||
}
|
||||
@ -627,22 +587,43 @@
|
||||
//*************************End Notes********************************//
|
||||
|
||||
$(function () {
|
||||
editableSelectMachine = new $editableselect($("#dialog_machine"));
|
||||
editableSelectMachine.tabIndex(1);
|
||||
editableSelectMachine.change(function () {
|
||||
$('#dialog_machine').dropdown([], {
|
||||
search: true,
|
||||
valueKey: 'Id',
|
||||
textKey: 'DisplayName'
|
||||
}).on('select', function (_e, item) {
|
||||
setMachineInfo();
|
||||
});
|
||||
|
||||
editableSelectState = new $editableselect($("#dialog_retailerstate"), 50);
|
||||
editableSelectState.tabIndex(13);
|
||||
|
||||
editableSelectUnit = new $editableselect($("#dialog_unitofmeasure"));
|
||||
editableSelectUnit.tabIndex(18);
|
||||
$('#dialog_fueltype').change(function () {
|
||||
var value = $("#dialog_fueltype").find("option:selected").val();
|
||||
$('#dialog_fueltypename').text(value);
|
||||
$('#dialog_retailerstate').dropdown([], {
|
||||
input: true,
|
||||
search: true,
|
||||
maxlength: 50,
|
||||
textKey: 'value'
|
||||
});
|
||||
|
||||
$('#dialog_unitofmeasure').dropdown([], {
|
||||
input: true,
|
||||
maxlength: 50,
|
||||
valueKey: 'Key',
|
||||
textKey: 'Value'
|
||||
});
|
||||
|
||||
$('#dialog_odometeruom').dropdown([
|
||||
{ value: 'mile', text: GetTextByKey('P_FR_MILE', 'Mile') },
|
||||
{ value: 'kilometre', text: GetTextByKey('P_FR_KILOMETER', 'Kilometer') }
|
||||
], {
|
||||
selected: 'mile'
|
||||
});
|
||||
|
||||
$('#dialog_fueltype').dropdown([], {
|
||||
valueKey: 'Key',
|
||||
textKey: 'Value'
|
||||
}).on('select', function (_e, fueltype) {
|
||||
$('#dialog_fueltypename').text(fueltype.Key);
|
||||
});
|
||||
|
||||
|
||||
$("input[name=rdodistributedby]").each(function () {
|
||||
$(this).click(function () {
|
||||
var type = $(this).val();
|
||||
@ -717,7 +698,7 @@
|
||||
dialogAssets.onOK = function (source, selectedIndex) {
|
||||
var selectedAsset = null;
|
||||
if (selectedIndex >= 0)
|
||||
selectedAsset = source[selectedIndex].Values;
|
||||
selectedAsset = source[selectedIndex];
|
||||
$('#dialog_fuelingasset').val(selectedAsset.DisplayName);
|
||||
$('#dialog_fuelingasset').data('fuelingassetid', selectedAsset.Id);
|
||||
showmaskbg(false);
|
||||
@ -762,7 +743,7 @@
|
||||
<tr>
|
||||
<td class="label" data-lgid="P_FR_ASSET_COLON">Asset:</td>
|
||||
<td colspan="4">
|
||||
<div id="dialog_machine" style="width: 322px; height: 22px;"></div>
|
||||
<div id="dialog_machine" style="width: 322px;" class="dropdown"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -833,7 +814,7 @@
|
||||
<input type="text" id="dialog_retailername" maxlength="100" tabindex="10" />
|
||||
<label style="margin-left: 20px;" data-lgid="P_FR_ASSET_COLON">Asset:<span id="span_asset" style="display: none;">*</span></label>
|
||||
<input type="text" readonly="readonly" disabled="disabled" id="dialog_fuelingasset" maxlength="100" tabindex="10" style="width: 200px;" />
|
||||
<input type="button" onclick="OnSelectAssets();" id="btn_selectassets" value="Select" data-lgid="P_FR_SELCT" style="width: 100px; height: 22px;" />
|
||||
<input type="button" onclick="OnSelectAssets();" id="btn_selectassets" value="Select" data-lgid="P_FR_SELCT" style="width: 100px; height: 28px;" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -850,7 +831,7 @@
|
||||
<input type="text" id="dialog_retailercity" maxlength="50" tabindex="12" style="width: 200px;" /></td>
|
||||
<td data-lgid="P_FR_STATE_COLON">State:<span>*</span></td>
|
||||
<td>
|
||||
<div id="dialog_retailerstate" style="width: 150px; height: 22px;"></div>
|
||||
<div id="dialog_retailerstate" class="dropdown" style="width: 150px;" tabindex="13"></div>
|
||||
</td>
|
||||
<td data-lgid="P_FR_ZIP_COLON">Zip:</td>
|
||||
<td>
|
||||
@ -870,10 +851,8 @@
|
||||
<td style="min-width: 68px;"></td>
|
||||
<td data-lgid="P_FR_ODOMETERUOM_COLON">Odometer Uom:</td>
|
||||
<td>
|
||||
<select id="dialog_odometeruom" tabindex="15" style="width: 200px;">
|
||||
<option value="mile" data-lgid="P_FR_MILE">Mile</option>
|
||||
<option value="kilometre" data-lgid="P_FR_KILOMETER">Kilometer</option>
|
||||
</select></td>
|
||||
<div id="dialog_odometeruom" style="width: 200px; display: inline-block" tabindex="15" class="dropdown"></div>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
</table>
|
||||
@ -885,7 +864,8 @@
|
||||
<table style="width: 601px;">
|
||||
<tr>
|
||||
<td style="padding: 0;">
|
||||
<select id="dialog_fueltype" tabindex="16" style="width: 204px;"></select>
|
||||
<%--<select id="dialog_fueltype" tabindex="16" style="width: 204px;"></select>--%>
|
||||
<div id="dialog_fueltype" style="width: 200px; display: inline-block" tabindex="16" class="dropdown"></div>
|
||||
</td>
|
||||
<td style="min-width: 100px;"><span id="dialog_fueltypename" style="color: #adb0b4;"></span></td>
|
||||
<td data-lgid="P_FR_BRANDNAME_COLON">Brand Name:</td>
|
||||
@ -898,7 +878,7 @@
|
||||
<tr>
|
||||
<td class="label" data-lgid="P_FR_UNITOFMEASURE_COLON">Unit of Measure:<span>*</span></td>
|
||||
<td>
|
||||
<div id="dialog_unitofmeasure" style="width: 202px; height: 24px;"></div>
|
||||
<div id="dialog_unitofmeasure" style="width: 202px;" class="dropdown"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -7,38 +7,6 @@
|
||||
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;
|
||||
@ -75,7 +43,6 @@
|
||||
<link href="<%=GetFileUrlWithVersion("../css/jquery.datetimepicker.css")%>" rel="stylesheet" />
|
||||
<script src="<%=GetFileUrlWithVersion("../Maintenance/js/inputdatactr.js")%>" type="text/javascript"></script>
|
||||
<script src="<%=GetFileUrlWithVersion("../js/jquery.datetimepicker.full.js")%>"></script>
|
||||
<script src="<%=GetFileUrlWithVersion("../js/editableselect.js")%>"></script>
|
||||
<script src="<%=GetFileUrlWithVersion("js/maintenancelogattachment.js")%>" type="text/javascript"></script>
|
||||
<script type="text/javascript">
|
||||
var maintenanceid = ""; <%--"<%=MaintenanceID %>";--%>
|
||||
@ -438,7 +405,9 @@
|
||||
</script>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
|
||||
<div id="mask_bg" style="display: none;"><div class="loading c-spin"></div></div>
|
||||
<div id="mask_bg" style="display: none;">
|
||||
<div class="loading c-spin"></div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="function_title">
|
||||
<span class="sbutton iconsave" onclick="OnSave(0);" data-lgid="P_MRM_SAVE">Save</span>
|
||||
|
@ -7,28 +7,7 @@
|
||||
<style type="text/css">
|
||||
::-ms-clear, ::-ms-reveal {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.tab-header {
|
||||
float: left;
|
||||
padding: 2px 6px;
|
||||
cursor: pointer;
|
||||
border: 1px solid #fff;
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.tab-header:hover {
|
||||
background: #eee;
|
||||
}
|
||||
|
||||
.tab-header.selected {
|
||||
border-color: #d8d8d8;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.tab-header.selected:hover {
|
||||
background: #fff;
|
||||
}
|
||||
}
|
||||
|
||||
.label { /*cover tab.css*/
|
||||
display: table-cell;
|
||||
@ -297,7 +276,7 @@
|
||||
</table>
|
||||
<div class="subtitle">
|
||||
<span data-lgid="P_WOS_QUESTIONINFORMATION">Question Information</span>
|
||||
<span class="sbutton iconadd" style="display: inline;" onclick="onAddQuestion()">Add</span>
|
||||
<span class="sbutton iconadd" style="display: inline;" data-lgid="P_WOS_ADD" onclick="onAddQuestion()">Add</span>
|
||||
<hr />
|
||||
</div>
|
||||
<div class="question-holder no-hover" style="font-weight: bold; font-size: 14px; background-color: #f0f0f0;">
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
|
||||
<link href="<%=GetFileUrlWithVersion("css/maintenance.css")%>" rel="stylesheet" />
|
||||
<style type="text/css">
|
||||
body {
|
||||
min-height: 640px;
|
||||
@ -19,20 +20,26 @@
|
||||
line-height: 22px;
|
||||
}
|
||||
|
||||
.dropdown {
|
||||
width: 240px;
|
||||
}
|
||||
|
||||
#mask_bg, #dialogattmask, .mask_dialog, .dialog {
|
||||
z-index: 3;
|
||||
}
|
||||
</style>
|
||||
|
||||
<link href="<%=GetFileUrlWithVersion("../css/tabcontrol.css")%>" rel="stylesheet" />
|
||||
<link href="<%=GetFileUrlWithVersion("../css/panel.css")%>" rel="stylesheet" />
|
||||
<link href="<%=GetFileUrlWithVersion("css/maintenance.css")%>" rel="stylesheet" />
|
||||
<link href="<%=GetFileUrlWithVersion("../css/jquery.datetimepicker.css")%>" rel="stylesheet" />
|
||||
<script src="<%=GetFileUrlWithVersion("../js/lib/amrnb.js")%>"></script>
|
||||
<script src="<%=GetFileUrlWithVersion("../Maintenance/js/inputdatactr.js")%>" type="text/javascript"></script>
|
||||
<script src="<%=GetFileUrlWithVersion("../js/jquery.datetimepicker.full.js")%>"></script>
|
||||
<script src="<%=GetFileUrlWithVersion("../js/editableselect.js")%>"></script>
|
||||
<script src="<%=GetFileUrlWithVersion("../js/controls.js")%>" type="text/javascript"></script>
|
||||
<script src="<%=GetFileUrlWithVersion("js/workordersendemail.js")%>" type="text/javascript"></script>
|
||||
<script src="<%=GetFileUrlWithVersion("js/wocommunication.js")%>" type="text/javascript"></script>
|
||||
<script src="<%=GetFileUrlWithVersion("../js/assetselector.js")%>" type="text/javascript"></script>
|
||||
<script src="<%=GetFileUrlWithVersion("js/workordertabitems.js")%>" type="text/javascript"></script>
|
||||
<script src="<%=GetFileUrlWithVersion("js/workordertabitems.min.js")%>" type="text/javascript"></script>
|
||||
<script src="<%=GetFileUrlWithVersion("js/addworkorder.js")%>" type="text/javascript"></script>
|
||||
<script type="text/javascript">
|
||||
var contacts;
|
||||
@ -137,6 +144,7 @@
|
||||
$('#dialog_salesperson').dropdownDisabled(di);
|
||||
$('#dialog_isptemplate').dropdownDisabled(di);
|
||||
$('#dialog_internalid').attr('disabled', di);
|
||||
$('#dialog_ponumber').attr('disabled', di);
|
||||
$('#dialog_notes').attr('disabled', di);
|
||||
$('#dialog_metertype').dropdownDisabled(di);
|
||||
$('#dialog_hourmeter').attr('disabled', di);
|
||||
@ -195,11 +203,11 @@
|
||||
$("#tdExportReport").show();
|
||||
}
|
||||
|
||||
showloading(true);
|
||||
showLoading(true);
|
||||
getWorkOrderContacts(workorderid);
|
||||
getWorkOrderFollowers(workorderid);
|
||||
worequest("GetWorkOrderInfo", workorderid, function (data) {
|
||||
showloading(false);
|
||||
showLoading(false);
|
||||
loading = false;
|
||||
if (typeof (data) === "string") {
|
||||
showAlert(data, GetTextByKey("P_WO_ERROR", 'Error'));
|
||||
@ -267,6 +275,10 @@
|
||||
else
|
||||
$('#dialog_nextfollowupdate').css("color", "unset");
|
||||
$('#dialog_duedate').val(wo.DueDateStr);
|
||||
if (new Date(wo.DueDateStr) < new Date(currentdate))
|
||||
$('#dialog_duedate').css("color", "red");
|
||||
else
|
||||
$('#dialog_duedate').css("color", "unset");
|
||||
$('#dialog_completeddate').val(wo.CompleteDateStr);
|
||||
$('#dialog_workordercosts').val(wo.WorkOrderTotalCost == 0 ? "" : wo.WorkOrderTotalCost);
|
||||
$('#dialog_timetocomplete').val(wo.HoursToComplete == 0 ? "" : wo.HoursToComplete);
|
||||
@ -274,6 +286,7 @@
|
||||
$('#dialog_department').dropdownVal(wo.DepartmentId);
|
||||
$('#dialog_advisor').dropdownVal(wo.AdvisorId);
|
||||
$('#dialog_internalid').val(wo.InternalID);
|
||||
$('#dialog_ponumber').val(wo.PONumber);
|
||||
$('#dialog_notes').val(wo.Notes);
|
||||
$('#dialog_hourmeter').val(wo.HourMeter < 0 ? "" : wo.HourMeter);
|
||||
$('#dialog_odometer').val(wo.Odometer < 0 ? "" : wo.Odometer);
|
||||
@ -321,6 +334,10 @@
|
||||
customer.autoUpdates = wo.AutoText;
|
||||
}
|
||||
$('#dialog_partsexpecteddate').val(wo.PartsExpectedDateStr);
|
||||
if (new Date(wo.PartsExpectedDateStr) < new Date(currentdate))
|
||||
$('#dialog_partsexpecteddate').css("color", "red");
|
||||
else
|
||||
$('#dialog_partsexpecteddate').css("color", "unset");
|
||||
$('#dialog_lastlabordate').val(wo.LastLaborDateStr);
|
||||
$('#dialog_inspectionrequired').prop('checked', wo.InspectionRequired);
|
||||
$('#dialog_inspectioncount').text(wo.InspectionCount).css('color', 'unset');
|
||||
@ -363,7 +380,7 @@
|
||||
|
||||
}, function (err) {
|
||||
loading = false;
|
||||
showloading(false);
|
||||
showLoading(false);
|
||||
});
|
||||
}
|
||||
|
||||
@ -794,7 +811,9 @@
|
||||
}
|
||||
|
||||
function getTotalCost() {
|
||||
if (segmentdata && segmentdata.length > 0)
|
||||
//if (segmentdata && segmentdata.length > 0)
|
||||
// return;
|
||||
if (wosegmentobj && wosegmentobj.hasSegment())
|
||||
return;
|
||||
var othercost = $('#dialog_othercost').val();
|
||||
var partscost = $('#dialog_partscost').val();
|
||||
@ -829,6 +848,7 @@
|
||||
'DepartmentId': $.trim($('#dialog_department').dropdownVal()),
|
||||
'AdvisorId': $.trim($('#dialog_advisor').dropdownVal()),
|
||||
'InternalID': $.trim($('#dialog_internalid').val()),
|
||||
'PONumber': $.trim($('#dialog_ponumber').val()),
|
||||
'Notes': $.trim($('#dialog_notes').val()),
|
||||
'MeterType': $('#dialog_metertype').dropdownVal(),
|
||||
'HourMeter': $('#dialog_hourmeter').val(),
|
||||
@ -853,11 +873,13 @@
|
||||
'InspectionTemplateId': $('#dialog_isptemplate').dropdownVal()
|
||||
};
|
||||
var s = $('#dialog_status').data('dropdown').selected;
|
||||
item.Status = s.Id;
|
||||
item.StatusType = s.StatusType;
|
||||
item.StatusName = s.Name;
|
||||
item.StatusAutoText = s.AutoText;
|
||||
item.StatusMessage = s.Message;
|
||||
if (s) {
|
||||
item.Status = s.Id;
|
||||
item.StatusType = s.StatusType;
|
||||
item.StatusName = s.Name;
|
||||
item.StatusAutoText = s.AutoText;
|
||||
item.StatusMessage = s.Message;
|
||||
}
|
||||
item.Contacts = customercontacts;
|
||||
item.ContactsClient = customercontacts;
|
||||
item.Followers = followers;
|
||||
@ -1075,7 +1097,7 @@
|
||||
}
|
||||
|
||||
if (rst) {
|
||||
showConfirm(GetTextByKey("P_WO_XXX", "This work order was completed on {1} but is using the current {0} is this correct? ").replace('{0}', msg).replace('{1}', item.CompleteDate), alerttitle, function () {
|
||||
showConfirm(GetTextByKey("P_WO_THISWORKORDERWASCOMPLETEDTIPS", "This work order was completed on {1} but is using the current {0} is this correct? ").replace('{0}', msg).replace('{1}', item.CompleteDate), alerttitle, function () {
|
||||
checkStatusChange(item, function (phoneemail) {
|
||||
saveWorkOrder(item, alerttitle, exit, callback, phoneemail);
|
||||
});
|
||||
@ -1094,6 +1116,7 @@
|
||||
}
|
||||
|
||||
function checkStatusChange(item, next) {
|
||||
onRemoveSelectedAttachment();
|
||||
if (AllowCommunicate && !COMMReadOnly && (!workorderdata || item.Status != workorderdata.Status)) {
|
||||
showmaskbg(true);
|
||||
$('#dialog_statuschange .dialog-title span.title').text(GetTextByKey("P_WO_STATUSCHANGE", 'Status Change') + " - " + item.StatusName);
|
||||
@ -1103,6 +1126,10 @@
|
||||
'left': (document.documentElement.clientWidth - $('#dialog_statuschange').width()) / 2
|
||||
}).showDialogfixed();
|
||||
|
||||
if (!workorderid || workorderid == "")
|
||||
$("#trselectatta").hide();
|
||||
else
|
||||
$("#trselectatta").show();
|
||||
|
||||
$('#dialog_chksendtextmsg').prop('checked', item.StatusAutoText && !COMMReadOnly).prop('disabled', COMMReadOnly).change();
|
||||
if (!COMMReadOnly)
|
||||
@ -1149,6 +1176,7 @@
|
||||
|
||||
if (isadd) {
|
||||
woalertobj && woalertobj.changewo(workorderid, machineid);
|
||||
wosegmentobj && wosegmentobj.changewo(workorderid, machineid);
|
||||
//GetInvoiceNumber();
|
||||
}
|
||||
|
||||
@ -1241,15 +1269,40 @@
|
||||
}
|
||||
var includeStatusLink = $('#dialog_chkIncludeStatusLink').prop("checked");
|
||||
|
||||
var param = JSON.stringify([wo.Id.Value || wo.Id, JSON.stringify(pmemails), comm, (includeStatusLink ? "1" : "0")]);
|
||||
param = htmlencode(param);
|
||||
worequest("AddWorkOrderCommunication", param, function (data) {
|
||||
if (data !== "") {
|
||||
showAlert(data, GetTextByKey("P_WO_ERROR", 'Error'));
|
||||
return;
|
||||
var url = 'AddWorkOrder.aspx';
|
||||
var method = 'AddWorkOrderCommunication';
|
||||
var data = new FormData();
|
||||
data.append('MethodName', method);
|
||||
data.append('WorkorderId', wo.Id.Value || wo.Id);
|
||||
data.append('PMEmails', JSON.stringify(pmemails));
|
||||
data.append('Comment', encodeURIComponent(comm));
|
||||
data.append('IncludeStatusLink', includeStatusLink ? "1" : "0");
|
||||
if (_selectedattachment) {
|
||||
data.append('AttaData', encodeURIComponent(JSON.stringify(_selectedattachment)));
|
||||
}
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'POST',
|
||||
dataType: 'json',
|
||||
processData: false,
|
||||
contentType: false,
|
||||
cache: false,
|
||||
data: data,
|
||||
success: function (data) {
|
||||
//$('#mask_over_bg').hide();
|
||||
if (data !== "") {
|
||||
showAlert(data, GetTextByKey("P_WO_ERROR", 'Error'));
|
||||
return;
|
||||
}
|
||||
//getCommunications();
|
||||
},
|
||||
error: function (request, textStatus, errorThrown) {
|
||||
if (request?.readyState == 0) {
|
||||
console.log(request);
|
||||
} else {
|
||||
writelog_ironintel("onAddMessage", url + ".-1." + method + "." + JSON.stringify(param), JSON.stringify(request), textStatus + errorThrown);
|
||||
}
|
||||
}
|
||||
}, function (err) {
|
||||
//showmaskbg(false);
|
||||
});
|
||||
}
|
||||
|
||||
@ -1303,6 +1356,7 @@
|
||||
$('#dialog_nextfollowupdate').val('');
|
||||
$('#dialog_nextfollowupdate').css("color", "unset");
|
||||
$('#dialog_duedate').val('');
|
||||
$('#dialog_duedate').css("color", "unset");
|
||||
$('#dialog_description').val('');
|
||||
$('#dialog_workordercosts').val('');
|
||||
$('#dialog_timetocomplete').val('');
|
||||
@ -1311,6 +1365,7 @@
|
||||
$('#dialog_department').dropdownVal('-1');
|
||||
$('#dialog_advisor').dropdownVal('-1');
|
||||
$('#dialog_internalid').val('');
|
||||
$('#dialog_ponumber').val('');
|
||||
$('#dialog_notes').val('');
|
||||
$('#dialog_hourmeter').val('');
|
||||
$('#dialog_expectedcost').val('');
|
||||
@ -1337,6 +1392,7 @@
|
||||
customer.autoUpdates = false;
|
||||
}
|
||||
$('#dialog_partsexpecteddate').val('');
|
||||
$('#dialog_partsexpecteddate').css("color", "unset");
|
||||
$('#dialog_lastlabordate').val('');
|
||||
$('#dialog_inspectionrequired').prop('checked', false);
|
||||
$('#dialog_inspectioncount').text('0').css('color', 'unset');
|
||||
@ -1360,12 +1416,14 @@
|
||||
if (!keepinfo)
|
||||
clearWorkOrderInfo();
|
||||
if (workorderid && workorderid !== '') {
|
||||
$("#li_workorder").click();
|
||||
$("#li_segments").data("dataload", false);
|
||||
$("#li_attachments").data("dataload", false);
|
||||
$("#li_inspections").data("dataload", false);
|
||||
$("#li_estimates").data("dataload", false);
|
||||
$("#li_invoices").data("dataload", false);
|
||||
if (!keepinfo) {
|
||||
$("#li_workorder").click();
|
||||
$("#li_segments").data("dataload", false);
|
||||
$("#li_attachments").data("dataload", false);
|
||||
$("#li_inspections").data("dataload", false);
|
||||
$("#li_estimates").data("dataload", false);
|
||||
$("#li_invoices").data("dataload", false);
|
||||
}
|
||||
|
||||
$('#spanopenworkorders').hide();
|
||||
$(".comm").show();
|
||||
@ -1768,6 +1826,27 @@
|
||||
saveWorkOrderCollapsed();
|
||||
}
|
||||
|
||||
function getMessageStatusHistoryText(p) {
|
||||
var getStatusText = function (s) {
|
||||
switch (s) {
|
||||
case 0: return GetTextByKey('P_CU_PENDING', 'Pending');
|
||||
case 1: return GetTextByKey('P_WO_SENT', 'Sent');
|
||||
case 5: return GetTextByKey('P_CU_DELIVERYCONFIRMED', 'Delivery Confirmed');
|
||||
case 6: return GetTextByKey('P_CU_RESENT', 'Resent');
|
||||
case 9:
|
||||
case 10:
|
||||
case 412: return GetTextByKey('P_MA_FAILED', 'Failed');
|
||||
default: return GetTextByKey('P_CU_UNKNOWN', 'Unknown');
|
||||
}
|
||||
};
|
||||
var msg = GetTextByKey('P_CU_UPDATESTATUSDESC', 'Status changed from {0} to {1}\nBy {2} on {3}')
|
||||
.replace('{0}', getStatusText(p.History.StatusFrom))
|
||||
.replace('{1}', getStatusText(p.History.StatusTo))
|
||||
.replace('{2}', p.History.UpdatedBy)
|
||||
.replace('{3}', p.UpdatedOnStr);
|
||||
return msg;
|
||||
}
|
||||
|
||||
var dialogAssets;
|
||||
var woalertobj = null;
|
||||
var woattachmentobj = null;
|
||||
@ -1776,14 +1855,15 @@
|
||||
var woinvoiceobj = null;
|
||||
var woinspectionobj = null;
|
||||
$(function () {
|
||||
woalertobj = new $woalert({ parent: $('#tab_alerts'), showloading: function (flag) { showloading(flag) }, workorderid: workorderid, machineid: machineid, alertids: alertids });
|
||||
woattachmentobj = new $woattachment({ parent: $('#tab_attachments'), showloading: function (flag) { showloading(flag) }, canExport: canExport, workorderid: workorderid, machineid: machineid });
|
||||
wosegmentobj = new $wosegment({ parent: $('#tab_segments'), showloading: function (flag) { showloading(flag) }, workorderid: workorderid });
|
||||
woestimateobj = new $woestimate({ parent: $('#tab_estimates'), showloading: function (flag) { showloading(flag) }, workorderid: workorderid });
|
||||
woinvoiceobj = new $woinvoice({ parent: $('#tab_invoices'), showloading: function (flag) { showloading(flag) }, workorderid: workorderid });
|
||||
woinspectionobj = new $woinspection({ parent: $('#tab_inspections'), showloading: function (flag) { showloading(flag) }, workorderid: workorderid, machineid: machineid });
|
||||
woalertobj = new $woalert({ parent: $('#tab_alerts'), showloading: function (flag) { showLoading(flag) }, workorderid: workorderid, machineid: machineid, alertids: alertids });
|
||||
woattachmentobj = new $woattachment({ parent: $('#tab_attachments'), showloading: function (flag) { showLoading(flag) }, canExport: canExport, workorderid: workorderid, machineid: machineid });
|
||||
wosegmentobj = new $wosegment({ parent: $('#tab_segments'), showloading: function (flag) { showLoading(flag) }, workorderid: workorderid });
|
||||
woestimateobj = new $woestimate({ parent: $('#tab_estimates'), showloading: function (flag) { showLoading(flag) }, workorderid: workorderid });
|
||||
woinvoiceobj = new $woinvoice({ parent: $('#tab_invoices'), showloading: function (flag) { showLoading(flag) }, workorderid: workorderid });
|
||||
woinspectionobj = new $woinspection({ parent: $('#tab_inspections'), showloading: function (flag) { showLoading(flag) }, workorderid: workorderid, machineid: machineid });
|
||||
|
||||
InitGridCustomers();
|
||||
InitGridSelectedAttachments();
|
||||
|
||||
if (WOReadOnly) {
|
||||
$(".iconadd").hide();
|
||||
@ -1799,7 +1879,7 @@
|
||||
meterType = "";
|
||||
var selectedAsset = null;
|
||||
if (selectedIndex >= 0)
|
||||
selectedAsset = source[selectedIndex].Values;
|
||||
selectedAsset = source[selectedIndex];
|
||||
setMachineInfo(selectedAsset);
|
||||
if (selectedAsset) {
|
||||
machineid = selectedAsset.Id;
|
||||
@ -1818,6 +1898,7 @@
|
||||
woalertobj && woalertobj.getAssetAlerts(machineid);
|
||||
getAssetDetailInfo(machineid);
|
||||
GetAssetContacts();
|
||||
$("#li_attachments").data("dataload", false);
|
||||
}
|
||||
showmaskbg(false);
|
||||
};
|
||||
@ -1835,13 +1916,53 @@
|
||||
const app = window['lib-app'];
|
||||
if (AllowCommunicate) {
|
||||
customer = new app.CustomerCommunication({
|
||||
getText: GetTextByKey,
|
||||
autoUpdates: false,
|
||||
statusLink: window.parent.wowidgetobj?.widgets?.CustomerCommunication?.customer?.statusLink ?? false,
|
||||
readonly: WOReadOnly || COMMReadOnly,
|
||||
recordReadonly: !AllowCustomer || WOReadOnly || CRReadOnly,
|
||||
contactCollapserVisible: false,
|
||||
onStatusLinkChanged: function (checked) {
|
||||
var widgetobj = window.parent.wowidgetobj;
|
||||
var customer = widgetobj?.widgets?.CustomerCommunication?.customer;
|
||||
if (customer != null && !customer.freeze) {
|
||||
customer.statusLink = checked;
|
||||
var checklink = widgetobj.popups?.CustomerCommunication?.container?.querySelector('.check-status-link>input');
|
||||
if (checklink != null) {
|
||||
checklink.checked = checked;
|
||||
ui.setTooltip(widgetobj.popups?.CustomerCommunication?.container?.querySelector('.check-status-link'), checked ?
|
||||
GetTextByKey('P_WO_STATUSLINKINCLUDED', 'Status Link Included') :
|
||||
GetTextByKey('P_WO_STATUSLINKEXCLUDED', 'Status Link Excluded'));
|
||||
}
|
||||
}
|
||||
},
|
||||
onAddMessage: addWorkOrderCommunication,
|
||||
onUpdateMessageStatus: function (msgs) {
|
||||
if (msgs?.length > 0) {
|
||||
worequest('UpdateMessageStatus', JSON.stringify(msgs), function (data) {
|
||||
if (data !== 'OK') {
|
||||
ui.showAlert(GetTextByKey('P_WO_ERROR', 'Error'), data, 'error');
|
||||
return;
|
||||
}
|
||||
getCommunications();
|
||||
});
|
||||
}
|
||||
},
|
||||
onMessageStatusClicked: function (p) {
|
||||
worequest('GetMessageStatusHistory', String(p.Id), function (data) {
|
||||
if (typeof data === 'string') {
|
||||
ui.showAlert(GetTextByKey('P_WO_ERROR', 'Error'), data, 'error');
|
||||
return;
|
||||
}
|
||||
if (data.length > 0) {
|
||||
var msg = data.map(function (p) { return getMessageStatusHistoryText(p) }).join('\n\n');
|
||||
ui.showAlert(data[0].CustomerNumberFormatted, msg);
|
||||
}
|
||||
});
|
||||
},
|
||||
onSave: function (item, add) {
|
||||
if (!add) {
|
||||
contact = customercontacts.filter(function (f) { return f.Id < 0 ? f.Name === item.Name && f.MobilePhone === item.MobilePhone : f.Id === item.Id })[0];
|
||||
contact = customercontacts.filter(function (f) { return f.Id < 0 ? f.Name === item.OldName && f.MobilePhone === item.OldMobilePhone : f.Id === item.Id })[0];
|
||||
}
|
||||
var array = [];
|
||||
for (let c of customercontacts) {
|
||||
@ -1877,7 +1998,7 @@
|
||||
return new Promise(function (resolve, reject) {
|
||||
SaveWorkorderContact(array, function (data) {
|
||||
if (typeof data === 'string') {
|
||||
ui.showAlert(GetTextByKey("P_WO_ERROR", 'Error'), data, 'error')
|
||||
ui.showAlert(GetTextByKey('P_WO_ERROR', 'Error'), data, 'error')
|
||||
reject();
|
||||
} else {
|
||||
for (let d of data) {
|
||||
@ -2026,9 +2147,34 @@
|
||||
document.querySelector('#communication_holder').append(customer.create());
|
||||
}
|
||||
internal = new app.InternalComment({
|
||||
getText: GetTextByKey,
|
||||
readonly: WOReadOnly,
|
||||
onAddMessage: openSendICEmail,
|
||||
onAddComment: addWorkOrderComment
|
||||
onAddComment: addWorkOrderComment,
|
||||
|
||||
onUpdateMessageStatus: function (msgs) {
|
||||
if (msgs?.length > 0) {
|
||||
worequest('UpdateMessageStatus', JSON.stringify(msgs), function (data) {
|
||||
if (data !== 'OK') {
|
||||
ui.showAlert(GetTextByKey('P_WO_ERROR', 'Error'), data, 'error');
|
||||
return;
|
||||
}
|
||||
getComments();
|
||||
});
|
||||
}
|
||||
},
|
||||
onMessageStatusClicked: function (p) {
|
||||
worequest('GetMessageStatusHistory', String(p.Id), function (data) {
|
||||
if (typeof data === 'string') {
|
||||
ui.showAlert(GetTextByKey('P_WO_ERROR', 'Error'), data, 'error');
|
||||
return;
|
||||
}
|
||||
if (data.length > 0) {
|
||||
var msg = data.map(function (p) { return getMessageStatusHistoryText(p) }).join('\n\n');
|
||||
ui.showAlert(data[0].CustomerNumberFormatted, msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
document.querySelector('#communication_holder').append(internal.create());
|
||||
|
||||
@ -2059,6 +2205,10 @@
|
||||
onSelectDate: function (v, inp) {
|
||||
var date = new DateFormatter().formatDate(v, 'm/d/Y 00:00:00');
|
||||
inp.parent().data('val', [date]);
|
||||
if (new Date(date) < new Date(currentdate))
|
||||
$('#dialog_duedate').css("color", "red");
|
||||
else
|
||||
$('#dialog_duedate').css("color", "unset");
|
||||
}
|
||||
});
|
||||
$('#dialog_partsexpecteddate').datetimepicker({
|
||||
@ -2069,6 +2219,10 @@
|
||||
onSelectDate: function (v, inp) {
|
||||
var date = new DateFormatter().formatDate(v, 'm/d/Y 00:00:00');
|
||||
inp.parent().data('val', [date]);
|
||||
if (new Date(date) < new Date(currentdate))
|
||||
$('#dialog_partsexpecteddate').css("color", "red");
|
||||
else
|
||||
$('#dialog_partsexpecteddate').css("color", "unset");
|
||||
}
|
||||
});
|
||||
$('#dialog_lastlabordate').datetimepicker({
|
||||
@ -2126,8 +2280,7 @@
|
||||
$("#txt_customer_key").keypress(onCustomerKeyPress);
|
||||
|
||||
function resizeContent() {
|
||||
$('#divcontent').css('height', $(window).height() - $('#divcontent').offset().top - 4);
|
||||
//$('#div_atts').css('height', $(window).height() - $('#divcontent').offset().top - 4);
|
||||
$('.tabcontent').css('height', $(window).height() - $('#divcontent').offset().top - 4);
|
||||
$('.content_main').css('min-height', 0);
|
||||
}
|
||||
|
||||
@ -2187,6 +2340,10 @@
|
||||
showmaskbg(false);
|
||||
});
|
||||
|
||||
$('#dialog_selecteattachments').dialog(function () {
|
||||
$('#statuschange_maskbg').hide();
|
||||
});
|
||||
|
||||
if (!canExport) {
|
||||
$('#btnExportReport').hide();
|
||||
$('#btnPrint').hide();
|
||||
@ -2200,6 +2357,7 @@
|
||||
$('#dialog_variables').prop('disabled', !checked);
|
||||
$('#dialog_insertfield').prop('disabled', !checked);
|
||||
});
|
||||
$('input[placeholder=Search]').attr("placeholder", GetTextByKey("P_AM_SEARCH", "Search"));
|
||||
|
||||
window.onresize = resizeContent;
|
||||
resizeContent();
|
||||
@ -2217,7 +2375,7 @@
|
||||
return;
|
||||
|
||||
if (data && data.Code == "501")
|
||||
loadworkorder(workorderid);
|
||||
loadworkorder(workorderid, true);
|
||||
else if (data && data.Code == "502")
|
||||
OnExit(0);
|
||||
else if (data && (data.Code == "503" || data.Code == "504"))
|
||||
@ -2232,12 +2390,59 @@
|
||||
if (workorderid)
|
||||
getWorkOrderFollowers(workorderid);
|
||||
}
|
||||
else if (data.Code == "508") {
|
||||
woalertobj && woalertobj.changewo(workorderid, machineid);
|
||||
}
|
||||
else if (data.Code == "509") {
|
||||
if ($('#tab_segments').is(':visible'))
|
||||
wosegmentobj && wosegmentobj.changewo(workorderid);
|
||||
else
|
||||
$("#li_segments").data("dataload", false);
|
||||
}
|
||||
else if (data.Code == "510") {
|
||||
if ($('#tab_attachments').is(':visible'))
|
||||
woattachmentobj && woattachmentobj.changewo(workorderid, machineid);
|
||||
else
|
||||
$("#li_attachments").data("dataload", false);
|
||||
}
|
||||
else if (data.Code == "511") {
|
||||
if ($('#tab_inspections').is(':visible'))
|
||||
woinspectionobj && woinspectionobj.changewo(workorderid);
|
||||
else
|
||||
$("#li_inspections").data("dataload", false);
|
||||
|
||||
woalertobj.changewo(workorderid, machineid);
|
||||
|
||||
if ($('#tab_attachments').is(':visible'))
|
||||
woattachmentobj && woattachmentobj.changewo(workorderid, machineid);
|
||||
else
|
||||
$("#li_attachments").data("dataload", false);
|
||||
}
|
||||
else if (data.Code == "512") {
|
||||
if ($('#tab_estimates').is(':visible'))
|
||||
woestimateobj && woestimateobj.changewo(workorderid);
|
||||
else
|
||||
$("#li_estimates").data("dataload", false);
|
||||
}
|
||||
else if (data.Code == "513") {
|
||||
if ($('#tab_invoices').is(':visible'))
|
||||
woinvoiceobj && woinvoiceobj.changewo(workorderid);
|
||||
else
|
||||
$("#li_invoices").data("dataload", false);
|
||||
}
|
||||
}
|
||||
|
||||
var loadingCount = 0;
|
||||
function showLoading() {
|
||||
loadingCount++;
|
||||
$("#dialogattmask").show();
|
||||
function showLoading(flag) {
|
||||
if (flag) {
|
||||
loadingCount++;
|
||||
$("#dialogattmask").show();
|
||||
}
|
||||
else {
|
||||
loadingCount--;
|
||||
if (loadingCount === 0)
|
||||
$("#dialogattmask").hide();
|
||||
}
|
||||
}
|
||||
|
||||
function hideLoading() {
|
||||
@ -2282,8 +2487,8 @@
|
||||
<%} %>
|
||||
</ul>
|
||||
|
||||
<div id="tab_workorder" data-page="tab_workorder">
|
||||
<div id="divcontent" style="overflow: auto; min-width: 1610px;">
|
||||
<div id="tab_workorder" data-page="tab_workorder" class="tabcontent" style="overflow: auto; min-width: 1610px;">
|
||||
<div id="divcontent">
|
||||
<div class="edit-content">
|
||||
<div style="width: 920px;">
|
||||
<div class="subtitle">
|
||||
@ -2302,7 +2507,7 @@
|
||||
<span id="spanopenworkorderstext"></span>
|
||||
</div>
|
||||
</td>
|
||||
<td style="width: 100px;">
|
||||
<td style="width: 120px;">
|
||||
<button id="input_emaildetails" onclick="openSendEmail();" style="width: unset;" data-lgid="P_WO_EMAILDETAILS">Email Details</button>
|
||||
</td>
|
||||
<td style="width: 60px;">
|
||||
@ -2431,7 +2636,7 @@
|
||||
<tr>
|
||||
<td class="label" data-lgid="P_WO_METERTYPE_COLON">Meter Type:</td>
|
||||
<td>
|
||||
<div id="dialog_metertype" tabindex="3" class="dropdown"></div>
|
||||
<div id="dialog_metertype" tabindex="2" class="dropdown"></div>
|
||||
</td>
|
||||
<td class="label" data-lgid="P_WO_WORKORDERTYPE_COLON">Work Order Type:</td>
|
||||
<td>
|
||||
@ -2442,8 +2647,8 @@
|
||||
<td class="label">
|
||||
<span data-lgid="P_WO_HOURMETER_COLON">Hour Meter:</span><span class="span_required redasterisk" style="display: none;">*</span></td>
|
||||
<td>
|
||||
<input type="text" id="dialog_hourmeter" maxlength="12" tabindex="3" autocomplete="off" /></td>
|
||||
<td class="label" data-lgid="P_WO_XXXXXX_COLON">Parts Order Number:</td>
|
||||
<input type="text" id="dialog_hourmeter" maxlength="12" tabindex="2" autocomplete="off" /></td>
|
||||
<td class="label" data-lgid="P_WO_PARTSORDERNUMBER_COLON">Parts Order Number:</td>
|
||||
<td>
|
||||
<input type="text" id="dialog_partsordernumber" tabindex="2" maxlength="50" autocomplete="off" />
|
||||
</td>
|
||||
@ -2452,12 +2657,12 @@
|
||||
<td class="label">
|
||||
<span data-lgid="P_WO_ODOMETER_COLON">Odometer:</span><span class="span_required redasterisk" style="display: none;">*</span></td>
|
||||
<td>
|
||||
<input type="text" id="dialog_odometer" disabled="disabled" maxlength="12" tabindex="3" style="width: 147px;" autocomplete="off" />
|
||||
<div id="dig_odometeruom" style="width: 90px; display: inline-block" tabindex="3" class="dropdown"></div>
|
||||
<input type="text" id="dialog_odometer" disabled="disabled" maxlength="12" tabindex="2" style="width: 147px;" autocomplete="off" />
|
||||
<div id="dig_odometeruom" style="width: 90px; display: inline-block" tabindex="2" class="dropdown"></div>
|
||||
</td>
|
||||
<td class="label" data-lgid="P_WO_XXXXXX_COLON">Parts Status:</td>
|
||||
<td class="label" data-lgid="P_WO_PARTSSTATUS_COLON">Parts Status:</td>
|
||||
<td>
|
||||
<div id="dialog_partsstatus" tabindex="3" class="dropdown"></div>
|
||||
<div id="dialog_partsstatus" tabindex="2" class="dropdown"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -2490,7 +2695,7 @@
|
||||
<input type="text" id="dialog_nextfollowupdate" tabindex="2" maxlength="200" autocomplete="off" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label" data-lgid="P_WO_XXX">Salesperson:</td>
|
||||
<td class="label" data-lgid="P_WO_SALESPERSON_COLON">Salesperson:</td>
|
||||
<td colspan="3">
|
||||
<div id="dialog_salesperson" tabindex="2" class="dropdown"></div>
|
||||
</td>
|
||||
@ -2544,7 +2749,7 @@
|
||||
<td class="label" data-lgid="P_WO_HOURLYRATE_COLON">Hourly Rate:</td>
|
||||
<td>
|
||||
<input type="text" id="dialog_hourlyrate" maxlength="12" tabindex="3" disabled="disabled" autocomplete="off" /></td>
|
||||
<td class="label" data-lgid="P_WO_TIMETOCOMPLATEHOURS_COLON">Time To Complete(Hrs):</td>
|
||||
<td class="label" data-lgid="P_WO_TIMETOCOMPLATEHOURS_COLON">Labor Hours:</td>
|
||||
<td>
|
||||
<input type="text" id="dialog_timetocomplete" maxlength="12" tabindex="3" onblur="getLaborCost(false,true);" autocomplete="off" /></td>
|
||||
</tr>
|
||||
@ -2557,20 +2762,25 @@
|
||||
<%if (AllowCustomer)
|
||||
{ %>
|
||||
<td class="label" data-lgid="P_WO_ESTIMATESTATUS_COLON">Estimate Status:</td>
|
||||
<td>
|
||||
<td rowspan="3" style="vertical-align: top">
|
||||
<span id="dialog_estimatestatus"></span></td>
|
||||
<%} %>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label" data-lgid="P_WO_INTERNALID_COLON">Internal ID:</td>
|
||||
<td>
|
||||
<input type="text" id="dialog_internalid" maxlength="50" tabindex="2" autocomplete="off" /></td>
|
||||
<input type="text" id="dialog_internalid" maxlength="50" tabindex="3" autocomplete="off" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label" data-lgid="P_WO_XXXXXX_COLON">Billable:</td>
|
||||
<td class="label" data-lgid="P_WO_PONUMBER_COLON">PO Number:</td>
|
||||
<td>
|
||||
<input type="text" id="dialog_ponumber" maxlength="50" tabindex="3" autocomplete="off" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label" data-lgid="P_WO_BILLABLE_COLON">Billable:</td>
|
||||
<td>
|
||||
<input type="checkbox" id="dialog_billable" tabindex="3" autocomplete="off" /></td>
|
||||
<td class="label" data-lgid="P_WO_XXXXXX_COLON">Bill to job:</td>
|
||||
<td class="label" data-lgid="P_WO_BILLTOJOB_COLON">Bill to job:</td>
|
||||
<td>
|
||||
<div id="dialog_billtojob" tabindex="3" class="dropdown"></div>
|
||||
</td>
|
||||
@ -2585,22 +2795,22 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="tab_alerts" data-page="tab_alerts">
|
||||
<div id="tab_alerts" data-page="tab_alerts" class="tabcontent" style="overflow: auto;">
|
||||
</div>
|
||||
|
||||
<div id="tab_segments" data-page="tab_segments">
|
||||
<div id="tab_segments" data-page="tab_segments" class="tabcontent" style="overflow: auto;">
|
||||
</div>
|
||||
|
||||
<div id="tab_attachments" data-page="tab_attachments">
|
||||
<div id="tab_attachments" data-page="tab_attachments" class="tabcontent" style="overflow: auto;">
|
||||
</div>
|
||||
|
||||
<div id="tab_inspections" data-page="tab_inspections">
|
||||
<div id="tab_inspections" data-page="tab_inspections" class="tabcontent" style="overflow: auto;">
|
||||
</div>
|
||||
|
||||
<div id="tab_estimates" class="edit-content" data-page="tab_estimates">
|
||||
<div id="tab_estimates" class="edit-content tabcontent" data-page="tab_estimates" style="overflow: auto;">
|
||||
</div>
|
||||
|
||||
<div id="tab_invoices" class="edit-content" data-page="tab_invoices">
|
||||
<div id="tab_invoices" class="edit-content tabcontent" data-page="tab_invoices" style="overflow: auto;">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -2608,28 +2818,29 @@
|
||||
<div class="loading c-spin"></div>
|
||||
</div>
|
||||
|
||||
<div class="dialog" id="sendemailpopupdialog" style="display: none; width: 480px;">
|
||||
<div class="dialog" id="sendemailpopupdialog" style="display: none; width: 510px;">
|
||||
<div class="dialog-title"><span class="title" data-lgid="P_WO_SENDWORKORDER">Send Work Order</span><em class="dialog-close"></em></div>
|
||||
<div class="dialog-content" style="height: 430px;">
|
||||
<table>
|
||||
<div class="dialog-content">
|
||||
<table style="line-height: 24px;">
|
||||
<tr>
|
||||
<td data-lgid="P_WO_SENDTHISTO">Who do you want to send this to? Select from existing relationships or manual entry.</td>
|
||||
<td colspan="2" data-lgid="P_WO_SENDTHISTO">Who do you want to send this to? Select from existing relationships or manual entry.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<input type="text" id="sendworkorder_search" style="width: 445px; margin-left: 10px;" placeholder="Search" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<div id="contactlist" style="height: 240px; width: 420px; margin-left: 10px; margin-right: 10px;"></div>
|
||||
<td colspan="2">
|
||||
<div id="contactlist" style="height: 240px; width: 450px; margin-left: 10px; margin-right: 10px;"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td data-lgid="P_WO_EMAILADDRESSESTIPS">Separate multiple manually entered email addresses with a semi-colon (;).</td>
|
||||
<td colspan="2" data-lgid="P_WO_EMAILADDRESSESTIPS">Separate multiple manually entered email addresses with a semi-colon (;).</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span data-lgid="P_WO_OTHEREMAILADDRESS">Other Email Address</span>
|
||||
<input type="text" id="sendworkorder_otheremailaddress" style="width: 312px;" autocomplete="off" /></td>
|
||||
<td style="text-align:right;padding-right:5px;"><span data-lgid="P_WO_OTHEREMAILADDRESS">Other Email Address</span></td>
|
||||
<td>
|
||||
<input type="text" id="sendworkorder_otheremailaddress" style="width: 350px;" autocomplete="off" /></td>
|
||||
</tr>
|
||||
<%-- <tr>
|
||||
<td><span>Other Text Address</span>
|
||||
@ -2637,11 +2848,9 @@
|
||||
</td>
|
||||
</tr>--%>
|
||||
<tr>
|
||||
<td data-lgid="P_WO_DESCRIPTION_COLON">Description:</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align:right;padding-right:5px;"><span data-lgid="P_WO_DESCRIPTION">Description</span></td>
|
||||
<td>
|
||||
<textarea id="sendworkorder_desc" style="width: 410px; height: 80px; resize: none; margin-left: 12px;" tabindex="151"></textarea></td>
|
||||
<textarea id="sendworkorder_desc" style="width: 350px; height: 80px; resize: none;" tabindex="151"></textarea></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
@ -2652,32 +2861,38 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="dialog" id="sendicemailpopupdialog" style="display: none; width: 485px;">
|
||||
<div class="dialog" id="sendicemailpopupdialog" style="display: none; width: 510px;">
|
||||
<div class="dialog-title"><span class="title" data-lgid="P_WO_SENDINTERNALCOMMENTS">Send Internal Comments</span><em class="dialog-close"></em></div>
|
||||
<div class="dialog-content">
|
||||
<table style="line-height: 25px;">
|
||||
<table style="line-height: 24px;">
|
||||
<tr>
|
||||
<td data-lgid="P_WO_SENDTHISTO">Who do you want to send this to? Select from existing relationships or manual entry.</td>
|
||||
<td colspan="2" data-lgid="P_WO_SENDTHISTO">Who do you want to send this to? Select from existing relationships or manual entry.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<input type="text" id="sendinternalcomments_search" style="width: 445px; margin-left: 10px;" placeholder="Search" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<td colspan="2">
|
||||
<div id="iccontactlist" style="height: 240px; width: 440px; margin-left: 10px; margin-right: 10px;"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td data-lgid="P_WO_EMAILADDRESSESTIPS">Separate multiple manually entered email addresses with a semi-colon (;).</td>
|
||||
<td colspan="2" data-lgid="P_WO_EMAILADDRESSESTIPS">Separate multiple manually entered email addresses with a semi-colon (;).</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span data-lgid="P_WO_OTHEREMAILADDRESS">Other Email Address</span>
|
||||
<input type="text" id="sendic_otheremailaddress" style="width: 332px;" autocomplete="off" /></td>
|
||||
<td style="text-align:right;padding-right:5px;">
|
||||
<span data-lgid="P_WO_OTHEREMAILADDRESS">Other Email Address</span>
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" id="sendic_otheremailaddress" style="width: 350px;" autocomplete="off" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span data-lgid="P_WO_PHONENUMBER">Phone Number</span>
|
||||
<input type="text" id="sendic_phonenumber" style="width: 353px; margin-left: 7px;" autocomplete="off" />
|
||||
<td style="text-align:right;padding-right:5px;">
|
||||
<span data-lgid="P_WO_PHONENUMBER">Phone Number</span>
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" id="sendic_phonenumber" style="width: 350px;" autocomplete="off" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -2714,7 +2929,7 @@
|
||||
</div>
|
||||
|
||||
<div class="dialog" id="dialog_addcustomer" style="display: none; height: 100%; border-bottom: 0; border-top: 0;">
|
||||
<iframe id="iframeuser" src="AddCustomerRecord.aspx" style="width: 100%; height: 100%; display: block; border: none;"></iframe>
|
||||
<iframe id="iframecr" src="AddCustomerRecord.aspx" style="width: 100%; height: 100%; display: block; border: none;"></iframe>
|
||||
<div class="maskbg" style="display: none;"></div>
|
||||
</div>
|
||||
|
||||
@ -2747,7 +2962,7 @@
|
||||
<div class="dialog-content">
|
||||
<table style="line-height: 30px; margin-left: 10px; margin-right: 10px;">
|
||||
<tr>
|
||||
<td style="text-align: right; width:120px;">
|
||||
<td style="text-align: right; width: 120px;">
|
||||
<input id="dialog_chksendtextmsg" type="checkbox" style="width: unset;" /></td>
|
||||
<td style="text-align: left;">
|
||||
<label for="dialog_chksendtextmsg" data-lgid="P_WO_SENDUPDATETOCUSTOMER" style="user-select: none;">Send Update To Customer</label></td>
|
||||
@ -2767,12 +2982,12 @@
|
||||
<label for="dialog_chkIncludeStatusLink" data-lgid="P_WO_INCLUDESTATUSLINK" style="user-select: none;">Include Status Link</label></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label" style="width:120px;"><span data-lgid="P_WO_MESSAGE_COLON">Message:</span></td>
|
||||
<td class="label" style="width: 120px;"><span data-lgid="P_WO_MESSAGE_COLON">Message:</span></td>
|
||||
<td>
|
||||
<select id="dialog_variables" style="width: 156px;">
|
||||
<option value="0">[Site_Name]</option>
|
||||
<option value="1">[Location]</option>
|
||||
<option value="13">[Asset]</option>
|
||||
<option value="14">[Asset]</option>
|
||||
<option value="4">[VIN]</option>
|
||||
<option value="2">[Make]</option>
|
||||
<option value="3">[Model]</option>
|
||||
@ -2786,18 +3001,40 @@
|
||||
<option value="12">[Work_Order_Number]</option>
|
||||
<option value="13">[Parts_Order_Number]</option>
|
||||
</select>
|
||||
<input type="button" id="dialog_insertfield" onclick="insertfield();" data-lgid="P_WO_ADD" style="width: 35px; height: auto; margin-left: 5px;" tabindex="1" />
|
||||
<input type="button" id="dialog_insertfield" onclick="insertfield();" data-lgid="P_WO_ADD" style="width: auto; height: auto; margin-left: 5px;" tabindex="1" />
|
||||
<br />
|
||||
<textarea id="dialog_textmsg" tabindex="1" style="width: 320px; height: 120px; margin-top: 6px;" maxlength="2000"></textarea></td>
|
||||
</tr>
|
||||
<tr id="trselectatta">
|
||||
<td>
|
||||
<div style="font-size: 20px; margin-right: 5px; float: right;" onclick="openSelectAttachment()"><em class="spanbtn iconlink" style="font-weight: 900; font-size: 14px; cursor: pointer; padding-left: 0; padding-right: 3px; padding-top: 0;" data-title-lgid="P_WO_SELECTATTACHMENT"></em></div>
|
||||
</td>
|
||||
<td>
|
||||
<span id="span_attachmentname" style="float: left; width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: pre;"></span>
|
||||
<span id="span_attachmentdelete" onclick="onRemoveSelectedAttachment()" style="display: none;">
|
||||
<em class="spanbtn icondelete" style="font-weight: 900; font-size: 14px; cursor: default; padding-left: 5px; padding-right: 3px; padding-top: 0;"></em></span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="dialog-func">
|
||||
<input type="button" value="Cancel" data-lgid="P_WO_CANCEL" class="dialog-close" tabindex="1" />
|
||||
<input type="button" id="btn_savestatuschange" value="Save Work Order and Send" data-lgid="P_WO_XXXXXX" style="width: unset;" tabindex="1" />
|
||||
<input type="button" id="btn_savestatuschange" value="Save Work Order and Send" data-lgid="P_WO_SAVEWORKORDERANDSEND" style="width: unset;" tabindex="1" />
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
<div class="maskbg" style="display: none;"></div>
|
||||
<div id="statuschange_maskbg" class="maskbg" style="display: none;"></div>
|
||||
</div>
|
||||
|
||||
<div class="dialog" id="dialog_selecteattachments" style="display: none;">
|
||||
<div class="dialog-title"><span class="title" data-lgid="P_WO_SELECTATTACHMENT">Select Attachment</span><em class="dialog-close"></em></div>
|
||||
<div class="dialog-content">
|
||||
<div id="div_selectattachmentlist" style="height: 320px; width: 400px;"></div>
|
||||
</div>
|
||||
<div class="dialog-func">
|
||||
<input type="button" value="Cancel" data-lgid="P_UM_CANCEL" class="dialog-close" tabindex="1" />
|
||||
<input type="button" onclick="onSetSelectAttachment();" value="Attach" data-lgid="P_WO_ATTACH" tabindex="1" />
|
||||
<div style="clear: both;"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="dialogattmask" class="maskbg" style="display: none;">
|
||||
@ -2805,4 +3042,5 @@
|
||||
<div class="loading c-spin"></div>
|
||||
<lable class="lable_attuploadname"></lable>
|
||||
</div>
|
||||
<iframe id="ifdiv" style="height: 1px; width: 1px; display: none;"></iframe>
|
||||
</asp:Content>
|
||||
|
@ -7,78 +7,18 @@
|
||||
display: none;
|
||||
}
|
||||
|
||||
.tab-header {
|
||||
float: left;
|
||||
padding: 2px 6px;
|
||||
cursor: pointer;
|
||||
border: 1px solid #fff;
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.tab-header:hover {
|
||||
background: #eee;
|
||||
}
|
||||
|
||||
.tab-header.selected {
|
||||
border-color: #d8d8d8;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.tab-header.selected:hover {
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.label { /*cover tab.css*/
|
||||
display: table-cell;
|
||||
}
|
||||
|
||||
.login_lable {
|
||||
height: 24px;
|
||||
line-height: 24px;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.sbutton {
|
||||
font-weight: 200;
|
||||
}
|
||||
|
||||
.msgdiv {
|
||||
border: solid 1px lightgray;
|
||||
margin-top: 5px;
|
||||
padding-left: 5px;
|
||||
padding-right: 10px;
|
||||
padding-top: 3px;
|
||||
padding-bottom: 3px;
|
||||
line-height: 24px;
|
||||
white-space: normal;
|
||||
word-break: break-word;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.msgtime {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.dialog, .data-column-header-filter-panel, .data-column-header-filter-bg {
|
||||
z-index: 700;
|
||||
}
|
||||
|
||||
.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;
|
||||
}
|
||||
|
||||
.dialog-content table td.label {
|
||||
width: 120px;
|
||||
}
|
||||
@ -86,15 +26,6 @@
|
||||
.dialog-content table td input[type="text"], .dialog-content table td textarea {
|
||||
width: 320px;
|
||||
}
|
||||
|
||||
.div_filter .dropdown {
|
||||
width: 322px;
|
||||
margin: 2px 0 0 0px;
|
||||
}
|
||||
|
||||
.div_panel {
|
||||
min-width: 322px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<link href="<%=GetFileUrlWithVersion("../css/tabcontrol.css")%>" rel="stylesheet" />
|
||||
@ -104,16 +35,7 @@
|
||||
<script src="<%=GetFileUrlWithVersion("../js/utility.js")%>" type="text/javascript"></script>
|
||||
<script src="<%=GetFileUrlWithVersion("../js/language.js")%>" type="text/javascript"></script>
|
||||
<script src="<%=GetFileUrlWithVersion("../js/modulelang.js")%>" type="text/javascript"></script>
|
||||
<script type="text/javascript">
|
||||
var alerttypeparam;
|
||||
var assetgroupparam;
|
||||
var jobsitesparam;
|
||||
var assigntosparam;
|
||||
var alerttype_editmultiselect;
|
||||
var assetgroup_editmultiselect;
|
||||
var jobsite_editmultiselect;
|
||||
var assignto_editmultiselect;
|
||||
|
||||
<script type="text/javascript">
|
||||
function alertrequest(method, param, callback, error) {
|
||||
_network.request("Maintenance/AlertAutomationManagement.aspx", -1, method, param, callback, error || function (e) {
|
||||
console.log(e);
|
||||
@ -128,7 +50,7 @@
|
||||
showAlert(GetTextByKey('P_UM_PAGEERROR', 'An unknown error occurred. Please refresh page.'), GetTextByKey('P_UM_QUERY', 'Query'));
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
function showstatusmask(flag) {
|
||||
if (flag) {
|
||||
@ -149,20 +71,14 @@
|
||||
var rows = [];
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
var r = data[i];
|
||||
var fr = { Values: r };
|
||||
rows.push(fr);
|
||||
rows.push(r);
|
||||
}
|
||||
|
||||
autoacknowledge_dt.setData(rows);
|
||||
}
|
||||
var autoacknowledge_dt;
|
||||
function InitAutoAcknowledgeGridData() {
|
||||
autoacknowledge_dt = new GridView('#div_autoacknowledgelist');
|
||||
autoacknowledge_dt.lang = {
|
||||
all: GetTextByKey("P_GRID_ALL", "(All)"),
|
||||
ok: GetTextByKey("P_GRID_OK", "OK"),
|
||||
reset: GetTextByKey("P_GRID_RESET", "Reset")
|
||||
};
|
||||
autoacknowledge_dt = createGridView('#div_autoacknowledgelist');
|
||||
var list_columns = [
|
||||
{ name: 'Selected', caption: "", valueIndex: 'Selected', type: 3, css: { 'width': 45, 'text-align': 'center' } },
|
||||
{ name: 'Value', caption: GetTextByKey("P_AM_ALERTTYPE", "Alert Type"), valueIndex: 'Value', css: { 'width': 300, 'text-align': 'left' } }
|
||||
@ -184,7 +100,7 @@
|
||||
}
|
||||
columns.push(col);
|
||||
}
|
||||
autoacknowledge_dt.canMultiSelect = false;
|
||||
autoacknowledge_dt.multiSelect = false;
|
||||
autoacknowledge_dt.columns = columns;
|
||||
autoacknowledge_dt.init();
|
||||
}
|
||||
@ -196,15 +112,10 @@
|
||||
showAlert(data, GetTextByKey("P_AM_ERROR", 'Error'));
|
||||
return;
|
||||
}
|
||||
data.splice(0, 0, { Key: "", Value: GetTextByKey("P_XXXXX", '(Blank)') });
|
||||
data.splice(0, 0, { Key: "", Value: GetTextByKey("P_AM_BLANK", '(Blank)') });
|
||||
alerttypesdata = data;
|
||||
alerttypeparam = {
|
||||
items: data,
|
||||
selectedvalue: []
|
||||
};
|
||||
alerttypesdata = data;
|
||||
alerttype_editmultiselect = editmultiselect(alerttypeparam);
|
||||
$('#div_alerttype').append(alerttype_editmultiselect);
|
||||
|
||||
$("#div_alerttype").dropdownSource(alerttypesdata);
|
||||
GetAutoAcknowledgeAlertTypes();
|
||||
});
|
||||
}
|
||||
@ -215,12 +126,8 @@
|
||||
showAlert(data, GetTextByKey("P_AM_ERROR", 'Error'));
|
||||
return;
|
||||
}
|
||||
assetgroupparam = {
|
||||
items: data,
|
||||
selectedvalue: []
|
||||
};
|
||||
assetgroup_editmultiselect = editmultiselect(assetgroupparam);
|
||||
$('#div_assetgroup').append(assetgroup_editmultiselect);
|
||||
|
||||
$("#div_assetgroup").dropdownSource(data);
|
||||
});
|
||||
}
|
||||
|
||||
@ -231,12 +138,7 @@
|
||||
return;
|
||||
}
|
||||
|
||||
jobsitesparam = {
|
||||
items: data,
|
||||
selectedvalue: []
|
||||
};
|
||||
jobsite_editmultiselect = editmultiselect(jobsitesparam);
|
||||
$('#div_jobsites').append(jobsite_editmultiselect);
|
||||
$("#div_jobsites").dropdownSource(data);
|
||||
});
|
||||
}
|
||||
|
||||
@ -247,12 +149,7 @@
|
||||
return;
|
||||
}
|
||||
|
||||
assigntosparam = {
|
||||
items: data,
|
||||
selectedvalue: []
|
||||
};
|
||||
assignto_editmultiselect = editmultiselect(assigntosparam);
|
||||
$('#div_assigntos').append(assignto_editmultiselect);
|
||||
$("#div_assigntos").dropdownSource(data);
|
||||
});
|
||||
}
|
||||
|
||||
@ -301,8 +198,9 @@
|
||||
|
||||
function onSaveAutoAcknowledgeAlertTypes() {
|
||||
var alerttypes = [];
|
||||
for (var i = 0; i < autoacknowledge_dt.source.length; i++) {
|
||||
var ct = autoacknowledge_dt.source[i].Values;
|
||||
var tempsource = autoacknowledge_dt.source;
|
||||
for (var i = 0; i < tempsource.length; i++) {
|
||||
var ct = tempsource[i];
|
||||
if (ct.Selected)
|
||||
alerttypes.push(ct.Key);
|
||||
}
|
||||
@ -325,22 +223,17 @@
|
||||
|
||||
var wogeneratorgrid_dt;
|
||||
function InitWOGeneratorGridData() {
|
||||
wogeneratorgrid_dt = new GridView('#wogeneratorlist');
|
||||
wogeneratorgrid_dt.lang = {
|
||||
all: GetTextByKey("P_GRID_ALL", "(All)"),
|
||||
ok: GetTextByKey("P_GRID_OK", "OK"),
|
||||
reset: GetTextByKey("P_GRID_RESET", "Reset")
|
||||
};
|
||||
wogeneratorgrid_dt = createGridView('#wogeneratorlist');
|
||||
var list_columns = [
|
||||
{ name: 'AlertTypesStr', caption: GetTextByKey("P_AM_ALERTTYPE", "Alert Type"), valueIndex: 'AlertTypesStr', css: { 'width': 200, 'text-align': 'left' } },
|
||||
{ name: 'AlertTypesStr', caption: GetTextByKey("P_AM_ALERTTYPE", "Alert Type"), valueIndex: 'AlertTypesStr', allowFilter: true, css: { 'width': 200, 'text-align': 'left' } },
|
||||
{ name: 'AssetGroupsStr', caption: GetTextByKey("P_AM_ASSETGROUP", "Asset Group"), valueIndex: 'AssetGroupsStr', css: { 'width': 200, 'text-align': 'left' } },
|
||||
{ name: 'JobSitesStr', caption: GetTextByKey("P_UM_JOBSITES", "Jobsite(s)"), valueIndex: 'JobSitesStr', css: { 'width': 200, 'text-align': 'left' } },
|
||||
{ name: 'AssignTosStr', caption: GetTextByKey("P_JS_ASSIGNEDTO", "Assigned To"), valueIndex: 'AssignTosStr', css: { 'width': 200, 'text-align': 'left' } },
|
||||
{ name: 'StatusAssignmentName', caption: GetTextByKey("P_AM_STATUSASSIGNMENT", "Status Assignment"), valueIndex: 'StatusAssignmentName', css: { 'width': 150, 'text-align': 'left' } },
|
||||
{ name: 'IncludeAllAlerts', caption: GetTextByKey("P_AM_INCLUDEALLALERTS", "Include All Alerts"), valueIndex: 'IncludeAllAlerts', css: { 'width': 150, 'text-align': 'left' } },
|
||||
{ name: 'EmailWorkorder', caption: GetTextByKey("P_AM_EMAILWORKORDER", "Email Work Order"), valueIndex: 'EmailWorkorder', css: { 'width': 150, 'text-align': 'left' } },
|
||||
{ name: 'EmailFrom', caption: GetTextByKey("P_AM_XXX", "Email From"), valueIndex: 'EmailFrom', css: { 'width': 150, 'text-align': 'left' } },
|
||||
{ name: 'Description', caption: GetTextByKey("P_AM_XXX", "Description"), valueIndex: 'Description', css: { 'width': 150, 'text-align': 'left' } },
|
||||
{ name: 'StatusAssignmentName', caption: GetTextByKey("P_AM_STATUSASSIGNMENT", "Status Assignment"), valueIndex: 'StatusAssignmentName', allowFilter: true, css: { 'width': 150, 'text-align': 'left' } },
|
||||
{ name: 'IncludeAllAlerts', caption: GetTextByKey("P_AM_INCLUDEALLALERTS", "Include All Alerts"), valueIndex: 'IncludeAllAlerts', allowFilter: true, css: { 'width': 150, 'text-align': 'left' } },
|
||||
{ name: 'EmailWorkorder', caption: GetTextByKey("P_AM_EMAILWORKORDER", "Email Work Order"), valueIndex: 'EmailWorkorder', allowFilter: true, css: { 'width': 150, 'text-align': 'left' } },
|
||||
{ name: 'EmailFrom', caption: GetTextByKey("P_AM_EMAILFROM", "Email From"), valueIndex: 'EmailFrom', allowFilter: true, css: { 'width': 150, 'text-align': 'left' } },
|
||||
{ name: 'Description', caption: GetTextByKey("P_AM_DESCRIPTION", "Description"), valueIndex: 'Description', css: { 'width': 150, 'text-align': 'left' } },
|
||||
{ name: 'Edit', caption: "", css: { 'width': 30, 'text-align': 'center' } },
|
||||
{ name: 'Delete', caption: "", css: { 'width': 30, 'text-align': 'center' } }
|
||||
];
|
||||
@ -359,9 +252,10 @@
|
||||
col.type = list_columns[hd].type;
|
||||
|
||||
if (col.name === "Edit") {
|
||||
col.isurl = true;
|
||||
col.text = "\uf044";
|
||||
col.sortable = false;
|
||||
col.resizable = false;
|
||||
col.type = GridView.ColumnTypes.Icon;
|
||||
col.text = "edit";
|
||||
col.events = {
|
||||
onclick: function () {
|
||||
OnEditWOGenerator();
|
||||
@ -373,9 +267,10 @@
|
||||
col.attrs = { 'title': GetTextByKey("P_UM_EDIT", 'Edit') };
|
||||
}
|
||||
else if (col.name === "Delete") {
|
||||
col.isurl = true;
|
||||
col.text = "\uf00d";
|
||||
col.sortable = false;
|
||||
col.resizable = false;
|
||||
col.type = GridView.ColumnTypes.Icon;
|
||||
col.text = "times";
|
||||
col.events = {
|
||||
onclick: function () {
|
||||
OnDeleteWOGenerator(this);
|
||||
@ -392,10 +287,10 @@
|
||||
}
|
||||
columns.push(col);
|
||||
}
|
||||
wogeneratorgrid_dt.canMultiSelect = false;
|
||||
wogeneratorgrid_dt.multiSelect = false;
|
||||
wogeneratorgrid_dt.columns = columns;
|
||||
wogeneratorgrid_dt.init();
|
||||
wogeneratorgrid_dt.rowdblclick = OnEditWOGenerator;
|
||||
wogeneratorgrid_dt.onRowDblClicked = OnEditWOGenerator;
|
||||
}
|
||||
|
||||
function GetWorkOrderGenerators() {
|
||||
@ -426,10 +321,10 @@
|
||||
|
||||
for (var j in r) {
|
||||
if (j === "IncludeAllAlerts") {
|
||||
r[j] = { DisplayValue: r.IncludeAllAlerts ? "Yes" : "No", Value: r[j] };
|
||||
r[j] = { DisplayValue: r.IncludeAllAlerts ? GetTextByKey("P_UTILITY_YES", "Yes") : GetTextByKey("P_UTILITY_NO", "No"), Value: r[j] };
|
||||
}
|
||||
if (j === "EmailWorkorder") {
|
||||
r[j] = { DisplayValue: r.EmailWorkorder ? "Yes" : "No", Value: r[j] };
|
||||
r[j] = { DisplayValue: r.EmailWorkorder ? GetTextByKey("P_UTILITY_YES", "Yes") : GetTextByKey("P_UTILITY_NO", "No"), Value: r[j] };
|
||||
}
|
||||
if (j === "AlertTypesStr") {
|
||||
r[j] = { DisplayValue: r.AlertTypesStr === "" ? "All" : r.AlertTypesStr, Value: r[j] };
|
||||
@ -447,8 +342,7 @@
|
||||
r[j] = { DisplayValue: desc, Value: r[j] };
|
||||
}
|
||||
}
|
||||
var fr = { Values: r };
|
||||
rows.push(fr);
|
||||
rows.push(r);
|
||||
}
|
||||
|
||||
wogeneratorgrid_dt.setData(rows);
|
||||
@ -457,11 +351,11 @@
|
||||
function OnAddWOGenerator() {
|
||||
$('#tr_desc').hide();
|
||||
generatorid = undefined;
|
||||
var alerttitle = GetTextByKey("P_AM_ADDWORKORDERGENERATOR", 'Add Work Order Generator')
|
||||
alerttype_editmultiselect.setValues([]);
|
||||
assetgroup_editmultiselect.setValues([]);
|
||||
jobsite_editmultiselect.setValues([]);
|
||||
assignto_editmultiselect.setValues([]);
|
||||
var alerttitle = GetTextByKey("P_AM_ADDWORKORDERGENERATOR", 'Add Work Order Generator');
|
||||
$('#div_alerttype').dropdownVals([]);
|
||||
$('#div_assetgroup').dropdownVals([]);
|
||||
$('#div_jobsites').dropdownVals([]);
|
||||
$('#div_assigntos').dropdownVals([]);
|
||||
$('#dialog_wostatus').val("");
|
||||
$('#dialog_includeallalerts').prop('checked', false);
|
||||
$('#dialog_emailworkorder').prop('checked', false);
|
||||
@ -483,12 +377,12 @@
|
||||
var index = wogeneratorgrid_dt.selectedIndex;
|
||||
if (index < 0) return;
|
||||
|
||||
var generator = wogeneratorgrid_dt.source[index].Values;
|
||||
var generator = wogeneratorgrid_dt.source[index];
|
||||
generatorid = generator.Id;
|
||||
alerttype_editmultiselect.setValues(generator.AlertTypes || []);
|
||||
assetgroup_editmultiselect.setValues(generator.AssetGroups || []);
|
||||
jobsite_editmultiselect.setValues(generator.JobSites || []);
|
||||
assignto_editmultiselect.setValues(generator.AssignTos || []);
|
||||
$('#div_alerttype').dropdownVals(generator.AlertTypes || []);
|
||||
$('#div_assetgroup').dropdownVals(generator.AssetGroups || []);
|
||||
$('#div_jobsites').dropdownVals(generator.JobSites || []);
|
||||
$('#div_assigntos').dropdownVals(generator.AssignTos || []);
|
||||
$('#dialog_wostatus').val(generator.StatusAssignment);
|
||||
$('#dialog_includeallalerts').prop('checked', generator.IncludeAllAlerts.Value);
|
||||
$('#dialog_emailworkorder').prop('checked', generator.EmailWorkorder.Value);
|
||||
@ -515,25 +409,10 @@
|
||||
|
||||
function onSaveWorkOrderGenerator() {
|
||||
showstatusmask(true);
|
||||
var alerttypes = [];
|
||||
if (alerttypeparam) {
|
||||
alerttypes = alerttypeparam.selectedvalue;
|
||||
}
|
||||
|
||||
var assetgroups = [];
|
||||
if (assetgroupparam) {
|
||||
assetgroups = assetgroupparam.selectedvalue;
|
||||
}
|
||||
|
||||
var jobsites = [];
|
||||
if (jobsitesparam) {
|
||||
jobsites = jobsitesparam.selectedvalue;
|
||||
}
|
||||
|
||||
var assigntos = [];
|
||||
if (assigntosparam) {
|
||||
assigntos = assigntosparam.selectedvalue;
|
||||
}
|
||||
var alerttypes = $('#div_alerttype').dropdownVals();
|
||||
var assetgroups = $('#div_assetgroup').dropdownVals();
|
||||
var jobsites = $('#div_jobsites').dropdownVals();
|
||||
var assigntos = $('#div_assigntos').dropdownVals();
|
||||
|
||||
var item = {
|
||||
'StatusAssignment': $('#dialog_wostatus').val(),
|
||||
@ -558,7 +437,7 @@
|
||||
}
|
||||
|
||||
if (item.AssignTos.length == 0) {
|
||||
showAlert(GetTextByKey("P_WO_XXX", 'Assigned to cannot be empty.'), alerttitle, undefined, function () {
|
||||
showAlert(GetTextByKey("P_AM_ASSIGNEDTOCANNOTBEEMPTY", 'Assigned to cannot be empty.'), alerttitle, undefined, function () {
|
||||
showstatusmask(false);
|
||||
|
||||
});
|
||||
@ -566,14 +445,14 @@
|
||||
}
|
||||
|
||||
if (!item.StatusAssignment) {
|
||||
showAlert(GetTextByKey("P_WO_XXX", 'Status assignment cannot be empty.'), alerttitle, undefined, function () {
|
||||
showAlert(GetTextByKey("P_AM_STATUSASSIGNMENTCANNOTBEEMPTY", 'Status assignment cannot be empty.'), alerttitle, undefined, function () {
|
||||
showstatusmask(false);
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (item.EmailFrom !== "" && !isEmail(item.EmailFrom)) {
|
||||
showAlert(GetTextByKey("P_WO_XXX", 'Email from is not a valid.'), alerttitle, undefined, function () {
|
||||
showAlert(GetTextByKey("P_AM_EMAILFROMISNOTAVALID", 'Email from is not a valid.'), alerttitle, undefined, function () {
|
||||
showstatusmask(false);
|
||||
});
|
||||
return;
|
||||
@ -623,6 +502,38 @@
|
||||
InitAutoAcknowledgeGridData();
|
||||
InitWOGeneratorGridData();
|
||||
|
||||
$("#div_alerttype").css('width', 324).dropdown([], {
|
||||
search: true,
|
||||
multiselect: true,
|
||||
allowselectall: true,
|
||||
textKey: 'Value',
|
||||
valueKey: 'Key'
|
||||
});
|
||||
|
||||
$("#div_assetgroup").css('width', 324).dropdown([], {
|
||||
search: true,
|
||||
multiselect: true,
|
||||
allowselectall: true,
|
||||
textKey: 'Value',
|
||||
valueKey: 'Key'
|
||||
});
|
||||
|
||||
$("#div_jobsites").css('width', 324).dropdown([], {
|
||||
search: true,
|
||||
multiselect: true,
|
||||
allowselectall: true,
|
||||
textKey: 'Value',
|
||||
valueKey: 'Key'
|
||||
});
|
||||
|
||||
$("#div_assigntos").css('width', 324).dropdown([], {
|
||||
search: true,
|
||||
multiselect: true,
|
||||
allowselectall: true,
|
||||
textKey: 'Value',
|
||||
valueKey: 'Key'
|
||||
});
|
||||
|
||||
GetAlertTypes();
|
||||
GetWorkOrderGenerators();
|
||||
GetAssetGroups();
|
||||
@ -735,7 +646,7 @@
|
||||
<tr>
|
||||
<td class="label"><span data-lgid="P_AM_STATUSASSIGNMENT_COLON">Status Assignment:</span></td>
|
||||
<td>
|
||||
<select id="dialog_wostatus" tabindex="1" style="width: 322px;"></select>
|
||||
<select id="dialog_wostatus" tabindex="1" style="width: 322px; height: 24px;"></select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -751,15 +662,15 @@
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label"><span data-lgid="P_AM_XXX">Email From:</span></td>
|
||||
<td class="label"><span data-lgid="P_AM_EMAILFROM_COLON">Email From:</span></td>
|
||||
<td>
|
||||
<input type="text" id="dialog_emailfrom" maxlength="200" tabindex="1" />
|
||||
<input type="text" id="dialog_emailfrom" maxlength="200" tabindex="1" style="height: 24px;" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label"><span data-lgid="P_AM_XXX">Description:</span></td>
|
||||
<td class="label"><span data-lgid="P_AM_DESCRIPTION_COLON">Description:</span></td>
|
||||
<td>
|
||||
<select id="dialog_desctype" tabindex="1" style="width: 324px;">
|
||||
<select id="dialog_desctype" tabindex="1" style="width: 324px; height: 24px;">
|
||||
<option value="-1"></option>
|
||||
<option value="0">Trigger Alerts</option>
|
||||
<option value="1">All Alerts</option>
|
||||
|
1138
Site/Maintenance/AlertMappingManagement.aspx
Normal file
1138
Site/Maintenance/AlertMappingManagement.aspx
Normal file
File diff suppressed because it is too large
Load Diff
53
Site/Maintenance/AlertMappingManagement.aspx.cs
Normal file
53
Site/Maintenance/AlertMappingManagement.aspx.cs
Normal file
@ -0,0 +1,53 @@
|
||||
using Foresight.Fleet.Services.User;
|
||||
using IronIntel.Contractor;
|
||||
using IronIntel.Contractor.Site.Maintenance;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
public partial class AlertMappingManagement : AlertsBasePage
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!CheckLoginSession())
|
||||
{
|
||||
// TODO: sub page
|
||||
//RedirectToLoginPage();
|
||||
}
|
||||
else
|
||||
{
|
||||
string methodName = Request.Form["MethodName"];
|
||||
if (!string.IsNullOrEmpty(methodName))
|
||||
{
|
||||
ProcessRequest(methodName);
|
||||
}
|
||||
else if (!IsPostBack)
|
||||
{
|
||||
bool license = SystemParams.HasLicense("AlertsManagement");
|
||||
if (!license)
|
||||
RedirectToLoginPage();
|
||||
|
||||
bool permission = CheckRight(SystemParams.CompanyID, Feature.ALERTS_MANAGEMENT);
|
||||
if (!permission)
|
||||
RedirectToLoginPage();
|
||||
}
|
||||
}
|
||||
}
|
||||
public bool IsSupperAdmin
|
||||
{
|
||||
get
|
||||
{
|
||||
var user = GetCurrentUser();
|
||||
return user.UserType == IronIntel.Contractor.Users.UserTypes.SupperAdmin;
|
||||
}
|
||||
}
|
||||
|
||||
protected override bool AllowCurrentLoginSessionEnter()
|
||||
{
|
||||
var user = GetCurrentUser();
|
||||
return user.UserType == IronIntel.Contractor.Users.UserTypes.SupperAdmin;
|
||||
}
|
||||
}
|
@ -1,44 +1,12 @@
|
||||
<%@ Page Title="" Language="C#" MasterPageFile="~/Maintenance/MaintenanceBase.master" AutoEventWireup="true" CodeFile="AlertsManagement.aspx.cs" Inherits="Maintenance_AlertsManagement" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
|
||||
<link href="../css/jquery.datetimepicker.css" rel="stylesheet" />
|
||||
<style type="text/css">
|
||||
.selectinput {
|
||||
width: 150px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.dialog-content table {
|
||||
border-collapse: collapse;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.dialog-content table td.label {
|
||||
width: 150px;
|
||||
text-align: right;
|
||||
padding-right: 10px;
|
||||
line-height: 24px;
|
||||
height: 24px;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.dialog-content table td input,
|
||||
.dialog-content table td textarea {
|
||||
border: 1px solid #a9a9a9;
|
||||
width: 400px;
|
||||
height: 18px;
|
||||
padding: 1px;
|
||||
}
|
||||
|
||||
.dialog-content table td select {
|
||||
width: 403px;
|
||||
}
|
||||
|
||||
.dialog-content table td input[type="checkbox"] {
|
||||
border: none;
|
||||
}
|
||||
|
||||
|
||||
#dialogdatatb td {
|
||||
padding-top: 5px;
|
||||
}
|
||||
@ -64,10 +32,6 @@
|
||||
/*font-size: 10px;*/
|
||||
}
|
||||
|
||||
.div_filter .dropdown {
|
||||
width: 100px;
|
||||
}
|
||||
|
||||
.assettr {
|
||||
background: #f1f4f8;
|
||||
}
|
||||
@ -132,7 +96,6 @@
|
||||
width: unset;
|
||||
}
|
||||
</style>
|
||||
<script src="<%=GetFileUrlWithVersion("../js/jquery.datetimepicker.full.js")%>" type="text/javascript"></script>
|
||||
<script src="<%=GetFileUrlWithVersion("js/inputdatactr.js")%>" type="text/javascript"></script>
|
||||
<script type="text/javascript">
|
||||
var CanEditWorkOrder = <%=CanEditWorkOrder?"true":"false"%>;
|
||||
@ -146,16 +109,17 @@
|
||||
var selectedAlerts = [];//已选择的AlertID
|
||||
var selectedAlertData = [];//已选择的Alert
|
||||
var selectedAssetGroups = [];
|
||||
var alerttypeparam;
|
||||
var assetgroupparam;
|
||||
var alertstatusparam;
|
||||
var jobsitesparam;
|
||||
var isalertview = true;
|
||||
var isacknowledgingalerts = false;
|
||||
|
||||
var tabIndex = 0;
|
||||
var assetid = "<%=AssetID %>";
|
||||
|
||||
var AlertViewApiAddress = "<%=AlertViewApiAddress%>";
|
||||
var AssetViewApiAddress = "<%=AssetViewApiAddress%>";
|
||||
var AcknowledgedApiAddress = "<%=AcknowledgedApiAddress%>";
|
||||
var CompanyID = "<%=CompanyID%>";
|
||||
|
||||
function alertrequest(method, param, callback, error) {
|
||||
_network.request("Maintenance/AlertsManagement.aspx", -1, method, param, callback, error || function (e) {
|
||||
console.log(e);
|
||||
@ -172,25 +136,39 @@
|
||||
});
|
||||
}
|
||||
|
||||
var SPLIT_CHAR175 = String.fromCharCode(175);
|
||||
var SPLIT_CHAR180 = String.fromCharCode(180);
|
||||
var SPLIT_CHAR181 = String.fromCharCode(181);
|
||||
var SPLIT_CHAR182 = String.fromCharCode(182);
|
||||
var SPLIT_CHAR183 = String.fromCharCode(183);
|
||||
function GetAlerts() {
|
||||
if (AlertViewApiAddress) {
|
||||
GetAlerts1();
|
||||
return;
|
||||
}
|
||||
var begindate = $('#txtbegindate').val();
|
||||
var enddate = $('#txtenddate').val();
|
||||
if (begindate && !$('#txtbegindate').is(':valid')) {
|
||||
showAlert(GetTextByKey('P_COMMON_BEGINDATEISINVALID', "The begin date is invalid."), GetTextByKey("P_FR_ERROR", 'Error'));
|
||||
return;
|
||||
}
|
||||
if (enddate && !$('#txtenddate').is(':valid')) {
|
||||
showAlert(GetTextByKey('P_COMMON_ENDDATEISINVALID', "The end date is invalid."), GetTextByKey("P_FR_ERROR", 'Error'));
|
||||
return;
|
||||
}
|
||||
if (begindate && enddate && begindate > enddate) {
|
||||
showAlert(GetTextByKey("P_JS_ENDDATEMUSTBELATERTHANBEGINDATE", "End Date must be later than Begin Date."), GetTextByKey("P_FR_ERROR", 'Error'));
|
||||
return;
|
||||
}
|
||||
showloading(true);
|
||||
$('#chk_all_ackalert').prop('checked', false);
|
||||
var searchtxt = htmlencode($.trim($('#searchinputtxt').val()));
|
||||
//var showCompleted = $('#chkShowCompleted').prop("checked") ? 1 : 0;
|
||||
var beginDate = $('#txtbegindate').val();
|
||||
var endDate = $('#txtenddate').val();
|
||||
var alerttypes = [];
|
||||
var assetgroups = [];
|
||||
var alertstatus = [];
|
||||
var jobsites = [];
|
||||
if (alerttypeparam)
|
||||
alerttypes = alerttypeparam.selectedvalue;
|
||||
if (assetgroupparam)
|
||||
assetgroups = assetgroupparam.selectedvalue;
|
||||
if (alertstatusparam)
|
||||
alertstatus = alertstatusparam.selectedvalue;
|
||||
if (jobsitesparam)
|
||||
jobsites = jobsitesparam.selectedvalue;
|
||||
var alerttypes = $('#div_alerttype').dropdownVals();
|
||||
var assetgroups = $('#div_assetgroup').dropdownVals();
|
||||
var alertstatus = $('#div_alertstatus').dropdownVals();
|
||||
var jobsites = $('#div_jobsites').dropdownVals();
|
||||
var category = $('#div_categorys').dropdownVals();
|
||||
var item = {
|
||||
AssetID: assetid == "" ? -1 : eval(assetid),
|
||||
SearchText: searchtxt,
|
||||
@ -198,8 +176,9 @@
|
||||
AssetGroups: assetgroups,
|
||||
AlertTypes: alerttypes,
|
||||
JobSites: jobsites,
|
||||
BeginDate: beginDate,
|
||||
EndDate: endDate,
|
||||
Category: category,
|
||||
BeginDate: begindate,
|
||||
EndDate: enddate,
|
||||
IncludeunCompleted: $('#chk_includeuncompleted').prop("checked"),
|
||||
}
|
||||
|
||||
@ -207,12 +186,12 @@
|
||||
$('#alertviewlist').data("dataloaded", true);
|
||||
alertrequest("GETALERTS", JSON.stringify(item), function (data) {
|
||||
showloading(false);
|
||||
if (typeof (data) === "string") {
|
||||
showAlert(data, GetTextByKey("P_AM_ERROR", 'Error'));
|
||||
if (typeof (data) !== "string") {
|
||||
showAlert(data[0], GetTextByKey("P_AM_ERROR", 'Error'));
|
||||
return;
|
||||
}
|
||||
if (data && data.length > 0)
|
||||
allalertdata = data;
|
||||
if (data !== "")
|
||||
allalertdata = ConvertAlertInfos(data);
|
||||
else
|
||||
allalertdata = [];
|
||||
|
||||
@ -226,12 +205,12 @@
|
||||
alertrequest("GETMACHINEALERTS", JSON.stringify(item), function (data) {
|
||||
showloading(false);
|
||||
$('#tbody_alerts').empty();
|
||||
if (typeof (data) === "string") {
|
||||
showAlert(data, GetTextByKey("P_AM_ERROR", 'Error'));
|
||||
if (typeof (data) !== "string") {
|
||||
showAlert(data[0], GetTextByKey("P_AM_ERROR", 'Error'));
|
||||
return;
|
||||
}
|
||||
if (data && data.length > 0)
|
||||
allmachinealertdata = data;
|
||||
if (data !== "")
|
||||
allmachinealertdata = ConvertMachineInfoForAlert(data);
|
||||
else
|
||||
allmachinealertdata = [];
|
||||
|
||||
@ -246,12 +225,12 @@
|
||||
$('#acknowledgedalertslist').data("dataloaded", true);
|
||||
alertrequest("GetAcknowledgedAlerts", JSON.stringify(item), function (data) {
|
||||
showloading(false);
|
||||
if (typeof (data) === "string") {
|
||||
showAlert(data, GetTextByKey("P_AM_ERROR", 'Error'));
|
||||
if (typeof (data) !== "string") {
|
||||
showAlert(data[0], GetTextByKey("P_AM_ERROR", 'Error'));
|
||||
return;
|
||||
}
|
||||
if (data && data.length > 0)
|
||||
allAcknowledgedalertdata = data;
|
||||
if (data !== "")
|
||||
allAcknowledgedalertdata = ConvertAlertInfos(data);
|
||||
else
|
||||
allAcknowledgedalertdata = [];
|
||||
|
||||
@ -262,6 +241,190 @@
|
||||
}
|
||||
}
|
||||
|
||||
function GetAlerts1() {
|
||||
var begindate = $('#txtbegindate').val();
|
||||
var enddate = $('#txtenddate').val();
|
||||
if (begindate && !$('#txtbegindate').is(':valid')) {
|
||||
showAlert(GetTextByKey('P_COMMON_BEGINDATEISINVALID', "The begin date is invalid."), GetTextByKey("P_FR_ERROR", 'Error'));
|
||||
return;
|
||||
}
|
||||
if (enddate && !$('#txtenddate').is(':valid')) {
|
||||
showAlert(GetTextByKey('P_COMMON_ENDDATEISINVALID', "The end date is invalid."), GetTextByKey("P_FR_ERROR", 'Error'));
|
||||
return;
|
||||
}
|
||||
if (begindate && enddate && begindate > enddate) {
|
||||
showAlert(GetTextByKey("P_JS_ENDDATEMUSTBELATERTHANBEGINDATE", "End Date must be later than Begin Date."), GetTextByKey("P_FR_ERROR", 'Error'));
|
||||
return;
|
||||
}
|
||||
|
||||
showloading(true);
|
||||
$('#chk_all_ackalert').prop('checked', false);
|
||||
var searchtxt = htmlencode($.trim($('#searchinputtxt').val()));
|
||||
//var showCompleted = $('#chkShowCompleted').prop("checked") ? 1 : 0;
|
||||
var alerttypes = $('#div_alerttype').dropdownVals();
|
||||
var assetgroups = $('#div_assetgroup').dropdownVals();
|
||||
var alertstatus = $('#div_alertstatus').dropdownVals();
|
||||
var jobsites = $('#div_jobsites').dropdownVals();
|
||||
var category = $('#div_categorys').dropdownVals();
|
||||
var item = {
|
||||
AssetID: assetid == "" ? -1 : eval(assetid),
|
||||
SearchText: searchtxt,
|
||||
AlertStatus: alertstatus,
|
||||
AssetGroups: assetgroups,
|
||||
AlertTypes: alerttypes,
|
||||
JobSites: jobsites,
|
||||
Category: category,
|
||||
BeginDate: begindate,
|
||||
EndDate: enddate,
|
||||
IncludeunCompleted: $('#chk_includeuncompleted').prop("checked"),
|
||||
}
|
||||
|
||||
if (tabIndex == 0) {
|
||||
$('#alertviewlist').data("dataloaded", true);
|
||||
_network.apipost(AlertViewApiAddress, CompanyID, item, function (data) {
|
||||
showloading(false);
|
||||
if (typeof (data) !== "string") {
|
||||
showAlert(data[0], GetTextByKey("P_AM_ERROR", 'Error'));
|
||||
return;
|
||||
}
|
||||
if (data !== "")
|
||||
allalertdata = ConvertAlertInfos(data);
|
||||
else
|
||||
allalertdata = [];
|
||||
|
||||
showAlerts(allalertdata);
|
||||
}, function (err) {
|
||||
showloading(false);
|
||||
});
|
||||
}
|
||||
else if (tabIndex == 1) {
|
||||
$('#machineviewlist').data("dataloaded", true);
|
||||
_network.apipost(AssetViewApiAddress, CompanyID, item, function (data) {
|
||||
showloading(false);
|
||||
$('#tbody_alerts').empty();
|
||||
if (typeof (data) !== "string") {
|
||||
showAlert(data[0], GetTextByKey("P_AM_ERROR", 'Error'));
|
||||
return;
|
||||
}
|
||||
if (data !== "")
|
||||
allmachinealertdata = ConvertMachineInfoForAlert(data);
|
||||
else
|
||||
allmachinealertdata = [];
|
||||
|
||||
sortTableData($('#tbRecordList'), allmachinealertdata);
|
||||
showMachineAlerts(allmachinealertdata);
|
||||
}, function (err) {
|
||||
console.log(err);
|
||||
showloading(false);
|
||||
});
|
||||
}
|
||||
else {
|
||||
$('#acknowledgedalertslist').data("dataloaded", true);
|
||||
_network.apipost(AcknowledgedApiAddress, CompanyID, item, function (data) {
|
||||
showloading(false);
|
||||
if (typeof (data) !== "string") {
|
||||
showAlert(data[0], GetTextByKey("P_AM_ERROR", 'Error'));
|
||||
return;
|
||||
}
|
||||
if (data !== "")
|
||||
allAcknowledgedalertdata = ConvertAlertInfos(data);
|
||||
else
|
||||
allAcknowledgedalertdata = [];
|
||||
|
||||
showAcknowledgedAlerts(allAcknowledgedalertdata);
|
||||
}, function (err) {
|
||||
showloading(false);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function ConvertMachineInfoForAlert(str) {
|
||||
var machinealerts = [];
|
||||
var arrays = str.split(SPLIT_CHAR183);
|
||||
if (arrays && arrays.length > 0) {
|
||||
for (var i = 0; i < arrays.length; i++) {
|
||||
var array = arrays[i].split(SPLIT_CHAR182);
|
||||
var mi = {};
|
||||
mi.MachineID = parseInt(array[0]);
|
||||
mi.VIN = array[1];
|
||||
mi.MachineName = array[2];
|
||||
mi.Make = array[3];
|
||||
mi.Model = array[4];
|
||||
mi.EngineHours = parseFloat(array[5]);
|
||||
mi.DTCAlertCount = parseInt(array[6]);
|
||||
mi.PMAlertCount = parseInt(array[7]);
|
||||
mi.InspectAlertCount = parseInt(array[8]);
|
||||
mi.OpenWorkOrders = parseInt(array[9]);
|
||||
mi.LatestAlertDateTime = array[10];
|
||||
mi.LatestAlertDateTimeStr = array[11];
|
||||
var alertsstr = array[12];
|
||||
if (alertsstr !== "") {
|
||||
mi.Alerts = ConvertAlertInfos(alertsstr);
|
||||
}
|
||||
|
||||
machinealerts.push(mi);
|
||||
}
|
||||
}
|
||||
|
||||
return machinealerts;
|
||||
}
|
||||
|
||||
function ConvertAlertInfos(str) {
|
||||
var alerts = [];
|
||||
var arrays = str.split(SPLIT_CHAR180);
|
||||
if (arrays && arrays.length > 0) {
|
||||
for (var i = 0; i < arrays.length; i++) {
|
||||
var array = arrays[i].split(SPLIT_CHAR175);
|
||||
var alert = {};
|
||||
alert.AlertID = parseInt(array[0]);
|
||||
alert.WorkOrderID = parseInt(array[1]);
|
||||
alert.WorkOrderStatus = array[2];
|
||||
alert.AlertType = array[3];
|
||||
alert.AlertTime_UTC = array[4];
|
||||
alert.AlertTime_UTCStr = array[5];
|
||||
alert.AlertLocalTime = array[6];
|
||||
alert.AlertLocalTimeStr = array[7];
|
||||
alert.Completed = parseInt(array[8]) == 1;
|
||||
alert.MachineID = parseInt(array[9]);
|
||||
alert.ModelID = parseInt(array[10]);
|
||||
alert.Model = array[11];
|
||||
alert.MakeID = parseInt(array[12]);
|
||||
alert.Make = array[13];
|
||||
alert.VIN = array[14];
|
||||
alert.MachineName = array[15];
|
||||
alert.EngineHours = parseFloat(array[16]);
|
||||
alert.CurrentHours = parseFloat(array[17]);
|
||||
alert.Description = array[18];
|
||||
alert.ServiceDescription = array[19];
|
||||
alert.ScheduleID = array[20];
|
||||
alert.IntervalID = array[21];
|
||||
alert.Recurring = parseInt(array[22]) == 1;
|
||||
alert.Priority = parseInt(array[23]);
|
||||
alert.ExpectedCost = parseFloat(array[24]);
|
||||
alert.AlertCount = parseInt(array[25]);
|
||||
var repeatedalertsstr = array[26];
|
||||
if (repeatedalertsstr !== "") {
|
||||
alert.RepeatedAlerts = repeatedalertsstr.split(SPLIT_CHAR181);
|
||||
}
|
||||
alert.OpenWorkOrderCount = parseInt(array[27]);
|
||||
alert.PMType = array[28];
|
||||
alert.AcknowledgedBy = array[29];
|
||||
alert.AcknowledgedByName = array[30];
|
||||
alert.AcknowledgedTime_UTC = array[31];
|
||||
alert.AcknowledgedTime_UTCStr = array[32];
|
||||
alert.AcknowledgedTime_Local = array[33];
|
||||
alert.AcknowledgedTime_LocalStr = array[34];
|
||||
alert.AcknowledgedComment = array[35];
|
||||
alert.WorkOrderNumber = array[36];
|
||||
alert.Comment = array[37];
|
||||
|
||||
alerts.push(alert);
|
||||
}
|
||||
}
|
||||
|
||||
return alerts;
|
||||
}
|
||||
|
||||
function showAlerts(data) {
|
||||
var rows = [];
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
@ -276,11 +439,10 @@
|
||||
r[j] = { DisplayValue: "", Value: r[j] };
|
||||
}
|
||||
if (j === "AlertType") {
|
||||
r[j] = { DisplayValue: ($.trim(r[j]) == "" ? GetTextByKey("P_XXXXX", '(Blank)') : r[j]), Value: $.trim(r[j]) };
|
||||
r[j] = { DisplayValue: ($.trim(r[j]) == "" ? GetTextByKey("P_AM_BLANK", '(Blank)') : r[j]), Value: $.trim(r[j]) };
|
||||
}
|
||||
}
|
||||
var fr = { Values: r };
|
||||
rows.push(fr);
|
||||
rows.push(r);
|
||||
}
|
||||
|
||||
alertview_dt.SelectedCount = 0;
|
||||
@ -503,14 +665,15 @@
|
||||
var table = $("<table class='main_table'></table>");
|
||||
var thr = $("<tr></tr>").appendTo(table);
|
||||
$("<th style='width: 54px;'></th>").appendTo(thr);
|
||||
$("<th style='width: 100px;' data-lgid='P_AM_WORKORDERID'>Work Order ID</th>").appendTo(thr);
|
||||
$("<th style='width: 110px;' data-lgid='P_AM_WORKORDERSTATUS'>Work Order Status</th>").appendTo(thr);
|
||||
$("<th style='width: 120px;' data-lgid='P_AM_ALERTTYPE'>Alert Type</th>").appendTo(thr);
|
||||
$("<th style='width: 300px;' data-lgid='P_AM_DESCRIPTION'>Description</th>").appendTo(thr);
|
||||
$("<th style='width: 150px;' data-lgid='P_AM_ENGINEHOURS'>Engine Hours</th>").appendTo(thr);
|
||||
$("<th style='width: 120px;' data-lgid='P_AM_ALERTDATETIME'>Alert DateTime</th>").appendTo(thr);
|
||||
$("<th style='width: 70px;' data-lgid='P_AM_ALERTCOUNT'>Alert Count</th>").appendTo(thr);
|
||||
$("<th style='white-space:nowrap;' data-lgid='P_AM_SERVICEDESCRIPTION'>Service Description</th>").appendTo(thr);
|
||||
$("<th style='width: 100px;'>" + GetTextByKey('P_WO_WORKORDERNUMBER', 'Work Order Number') + "</th>").appendTo(thr);
|
||||
$("<th style='width: 110px;'>" + GetTextByKey('P_AM_WORKORDERSTATUS', 'Work Order Status') + "</th>").appendTo(thr);
|
||||
$("<th style='width: 120px;'>" + GetTextByKey('P_AM_ALERTTYPE', 'Alert Type') + "</th>").appendTo(thr);
|
||||
$("<th style='width: 300px;'>" + GetTextByKey('P_AM_DESCRIPTION', 'Description') + "</th>").appendTo(thr);
|
||||
$("<th style='width: 150px;'>" + GetTextByKey('P_AM_ENGINEHOURS', 'Engine Hours') + "</th>").appendTo(thr);
|
||||
$("<th style='width: 120px;'>" + GetTextByKey('P_AM_ALERTDATETIME', 'Alert DateTime') + "</th>").appendTo(thr);
|
||||
$("<th style='width: 70px;'>" + GetTextByKey('P_AM_ALERTCOUNT', 'Alert Count') + "</th>").appendTo(thr);
|
||||
$("<th style='white-space:nowrap;'>" + GetTextByKey('P_AM_SERVICEDESCRIPTION', 'Service Description') + "</th>").appendTo(thr);
|
||||
$("<th style='white-space:nowrap;'>" + GetTextByKey('P_AM_COMMENT', 'Comment') + "</th>").appendTo(thr);
|
||||
//$("<th style='width: 50px;'>Completed</th>").appendTo(thr);
|
||||
var pmalertsarray = [];
|
||||
for (var i = 0; i < alerts.length; i++) {
|
||||
@ -527,9 +690,9 @@
|
||||
}
|
||||
tr.append(tdacksubchk);
|
||||
|
||||
tr.append($('<td></td>').text(alert.WorkOrderID > 0 ? alert.WorkOrderID : ""));
|
||||
tr.append($('<td></td>').text(alert.WorkOrderNumber));
|
||||
tr.append($('<td></td>').text(alert.WorkOrderStatus));
|
||||
tr.append($('<td></td>').text($.trim(alert.AlertType) == "" ? GetTextByKey("P_XXXXX", '(Blank)') : alert.AlertType));
|
||||
tr.append($('<td></td>').text($.trim(alert.AlertType) == "" ? GetTextByKey("P_AM_BLANK", '(Blank)') : alert.AlertType));
|
||||
var tdnote = $('<td style="word-wrap:break-word;"></td>').text(alert.Description).attr('title', alert.Description);
|
||||
tr.append(tdnote);
|
||||
tr.append($('<td></td>').text(alert.EngineHours == 0 ? "" : alert.EngineHours));
|
||||
@ -538,7 +701,10 @@
|
||||
var text = alert.ServiceDescription.length > 80 ? alert.ServiceDescription.substring(0, 80) + " ..." : alert.ServiceDescription;
|
||||
var tdsnote = $('<td style="word-wrap:break-word;"></td>').text(text).attr('title', alert.ServiceDescription);
|
||||
tr.append(tdsnote);
|
||||
//tr.append($('<td></td>').html(alert.Completed ? "Yes" : "No"));
|
||||
//tr.append($('<td></td>').html(alert.Completed ? GetTextByKey("P_UTILITY_YES", "Yes") : GetTextByKey("P_UTILITY_NO", "No")));
|
||||
text = alert.Comment?.length > 80 ? alert.Comment.substring(0, 80) + " ..." : alert.Comment;
|
||||
var tdscomment = $('<td style="word-wrap:break-word;"></td>').html(window['lib-utility'].escapeHtml(text)).attr('title', alert.Comment);
|
||||
tr.append(tdscomment);
|
||||
table.append(tr);
|
||||
|
||||
if (alert.AlertType == "Preventative Maintenance")
|
||||
@ -632,6 +798,7 @@
|
||||
|
||||
function CloseDialog(type) {
|
||||
$('#dialog_workorder').hideDialog();
|
||||
setPageTitle(GetTextByKey("P_ALERTSMANAGEMENT", "Alerts Management"), true);
|
||||
if (type == 1) {
|
||||
OnSearchClick();
|
||||
}
|
||||
@ -751,32 +918,28 @@
|
||||
|
||||
var alerttypesdata;
|
||||
function GetAlertTypes() {
|
||||
$('#div_alerttype').empty();
|
||||
alertrequest('GetAlertTypes', '', function (data) {
|
||||
if (typeof (data) === "string") {
|
||||
showAlert(data, GetTextByKey("P_AM_ERROR", 'Error'));
|
||||
return;
|
||||
}
|
||||
data.splice(0, 0, { Key: "", Value: GetTextByKey("P_XXXXX", '(Blank)') });
|
||||
alerttypeparam = {
|
||||
items: data,
|
||||
selectedvalue: []
|
||||
};
|
||||
alerttypesdata = data;
|
||||
var iptalertype = editmultiselect(alerttypeparam);
|
||||
$('#div_alerttype').append(iptalertype);
|
||||
iptalertype.change(function () {
|
||||
showIncludeunCompleted(false);
|
||||
if (alerttypeparam) {
|
||||
var alerttypes = alerttypeparam.selectedvalue;
|
||||
if (alerttypes && alerttypes.length > 0) {
|
||||
if (alerttypes.indexOf("Preventative Maintenance") >= 0 || alerttypes.indexOf("Yellow-Inspect") >= 0 || alerttypes.indexOf("Red-Inspect") >= 0) {
|
||||
showIncludeunCompleted(true);
|
||||
}
|
||||
}
|
||||
else
|
||||
data.splice(0, 0, { Key: "", Value: GetTextByKey("P_AM_BLANK", '(Blank)') });
|
||||
$('#div_alerttype').css('width', 110).dropdown(data, {
|
||||
search: true,
|
||||
multiselect: true,
|
||||
textKey: 'Value',
|
||||
valueKey: 'Key'
|
||||
}).on('collapsed', function (_e, wo) {
|
||||
var alerttypes = $('#div_alerttype').dropdownVals();
|
||||
if (alerttypes && alerttypes.length > 0) {
|
||||
if (alerttypes.indexOf("Preventative Maintenance") >= 0 || alerttypes.indexOf("Yellow-Inspect") >= 0 || alerttypes.indexOf("Red-Inspect") >= 0) {
|
||||
showIncludeunCompleted(true);
|
||||
}
|
||||
}
|
||||
})
|
||||
else
|
||||
showIncludeunCompleted(true);
|
||||
});
|
||||
});
|
||||
}
|
||||
function GetAssetGroups() {
|
||||
@ -785,12 +948,12 @@
|
||||
showAlert(data, GetTextByKey("P_AM_ERROR", 'Error'));
|
||||
return;
|
||||
}
|
||||
assetgroupparam = {
|
||||
items: data,
|
||||
selectedvalue: []
|
||||
};
|
||||
var iptalertype = editmultiselect(assetgroupparam);
|
||||
$('#div_assetgroup').append(iptalertype);
|
||||
$('#div_assetgroup').css('width', 110).dropdown(data, {
|
||||
search: true,
|
||||
multiselect: true,
|
||||
textKey: 'Value',
|
||||
valueKey: 'Key'
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@ -801,12 +964,28 @@
|
||||
return;
|
||||
}
|
||||
|
||||
jobsitesparam = {
|
||||
items: data,
|
||||
selectedvalue: []
|
||||
};
|
||||
var ipt = editmultiselect(jobsitesparam);
|
||||
$('#div_jobsites').append(ipt);
|
||||
$('#div_jobsites').css('width', 110).dropdown(data, {
|
||||
search: true,
|
||||
multiselect: true,
|
||||
textKey: 'Value',
|
||||
valueKey: 'Key'
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function GetCategory() {
|
||||
alertrequest('GetAlertCategory', '', function (data) {
|
||||
if (typeof (data) === "string") {
|
||||
showAlert(data, GetTextByKey("P_AM_ERROR", 'Error'));
|
||||
return;
|
||||
}
|
||||
|
||||
$('#div_categorys').css('width', 110).dropdown(data, {
|
||||
search: true,
|
||||
multiselect: true,
|
||||
textKey: 'Value',
|
||||
valueKey: 'Value'
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@ -817,37 +996,68 @@
|
||||
{ 'Key': "Completed", 'Value': "Show Completed" },
|
||||
{ 'Key': "Uncompleted", 'Value': "Show Uncompleted" }
|
||||
];
|
||||
alertstatusparam = {
|
||||
items: data,
|
||||
selectedvalue: []
|
||||
};
|
||||
var iptalertype = editmultiselect(alertstatusparam);
|
||||
$('#div_alertstatus').append(iptalertype);
|
||||
|
||||
$('#div_alertstatus').css('width', 110).dropdown(data, {
|
||||
search: true,
|
||||
multiselect: true,
|
||||
textKey: 'Value',
|
||||
valueKey: 'Key'
|
||||
});
|
||||
}
|
||||
|
||||
function onEditText(it, next) {
|
||||
showmaskbg(true);
|
||||
$('#dialog_edittext').data('item', it).data('next', next)
|
||||
.css({
|
||||
'top': (document.documentElement.clientHeight - $('#dialog_edittext').height()) / 3,
|
||||
'left': (document.documentElement.clientWidth - $('#dialog_edittext').width()) / 2
|
||||
}).showDialogfixed();
|
||||
$('#dialog_text').val(it.Comment).focus();
|
||||
}
|
||||
|
||||
function SaveText() {
|
||||
var text = $('#dialog_text').val();
|
||||
var item = $('#dialog_edittext').data('item');
|
||||
var next = $('#dialog_edittext').data('next');
|
||||
item.Comment = text;
|
||||
|
||||
if (next)
|
||||
next();
|
||||
|
||||
$('#dialog_edittext').hideDialog();
|
||||
showmaskbg(false);
|
||||
|
||||
var ids = [item.AlertID];
|
||||
if (item.RepeatedAlerts) {
|
||||
ids = ids.concat(item.RepeatedAlerts);
|
||||
}
|
||||
alertrequest('UpdateAlertComment', encodeURIComponent(JSON.stringify([ids.join(','), item.Comment])), function (data) {
|
||||
if (data !== 'OK') {
|
||||
showAlert(data, GetTextByKey('P_AM_EDITCOMMENT', 'Edit Comment'));
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
var alertview_dt;
|
||||
function InitGridData() {
|
||||
alertview_dt = new GridView('#alertviewlist');
|
||||
alertview_dt.lang = {
|
||||
all: GetTextByKey("P_GRID_ALL", "(All)"),
|
||||
ok: GetTextByKey("P_GRID_OK", "OK"),
|
||||
reset: GetTextByKey("P_GRID_RESET", "Reset")
|
||||
};
|
||||
alertview_dt = createGridView('#alertviewlist');
|
||||
var list_columns = [
|
||||
{ name: 'Selected', caption: "", valueIndex: 'Selected', type: 3, css: { 'width': 45, 'text-align': 'center' } },
|
||||
{ name: 'WorkOrderID', caption: GetTextByKey("P_AM_WORKORDERID", "Work Order ID"), valueIndex: 'WorkOrderID', css: { 'width': 120, 'text-align': 'left' } },
|
||||
{ name: 'WorkOrderNumber', caption: GetTextByKey("P_WO_WORKORDERNUMBER", "Work Order Number"), valueIndex: 'WorkOrderNumber', allowFilter: true, css: { 'width': 120, 'text-align': 'left' } },
|
||||
{ name: 'WorkOrderStatus', caption: GetTextByKey("P_AM_WORKORDERSTATUS", "Work Order Status"), valueIndex: 'WorkOrderStatus', allowFilter: true, css: { 'width': 140, 'text-align': 'left' } },
|
||||
{ name: 'MachineName', caption: GetTextByKey("P_AM_ASSETNAME", "Asset Name"), valueIndex: 'MachineName', css: { 'width': 180, 'text-align': 'left' } },
|
||||
{ name: 'MachineName', caption: GetTextByKey("P_AM_ASSETNAME", "Asset Name"), valueIndex: 'MachineName', allowFilter: true, css: { 'width': 180, 'text-align': 'left' } },
|
||||
{ name: 'Make', caption: GetTextByKey("P_AM_MAKE", "Make"), valueIndex: 'Make', allowFilter: true, css: { 'width': 120, 'text-align': 'left' } },
|
||||
{ name: 'Model', caption: GetTextByKey("P_AM_MODEL", "Model"), valueIndex: 'Model', allowFilter: true, css: { 'width': 120, 'text-align': 'left' } },
|
||||
{ name: 'VIN', caption: GetTextByKey("P_AM_VIN", "SN/VIN"), valueIndex: 'VIN', css: { 'width': 180, 'text-align': 'left' } },
|
||||
{ name: 'CurrentHours', caption: GetTextByKey("P_AM_CURRENTHOURS", "Current Hours"), valueIndex: 'CurrentHours', css: { 'width': 120, 'text-align': 'left' } },
|
||||
{ name: 'EngineHours', caption: GetTextByKey("P_AM_HOURS", "Hours"), valueIndex: 'EngineHours', css: { 'width': 120, 'text-align': 'left' } },
|
||||
{ name: 'VIN', caption: GetTextByKey("P_AM_VIN", "SN/VIN"), valueIndex: 'VIN', allowFilter: true, css: { 'width': 180, 'text-align': 'left' } },
|
||||
{ name: 'CurrentHours', caption: GetTextByKey("P_AM_CURRENTHOURS", "Current Hours"), valueIndex: 'CurrentHours', allowFilter: true, css: { 'width': 120, 'text-align': 'left' } },
|
||||
{ name: 'EngineHours', caption: GetTextByKey("P_AM_HOURS", "Hours"), valueIndex: 'EngineHours', allowFilter: true, css: { 'width': 120, 'text-align': 'left' } },
|
||||
{ name: 'AlertType', caption: GetTextByKey("P_AM_ALERTTYPE", "Alert Type"), valueIndex: 'AlertType', allowFilter: true, css: { 'width': 120, 'text-align': 'left' } },
|
||||
{ name: 'Description', caption: GetTextByKey("P_AM_DESCRIPTION", "Description"), valueIndex: 'Description', css: { 'width': 240, 'text-align': 'left' } },
|
||||
{ name: 'AlertCount', caption: GetTextByKey("P_AM_ALERTCOUNT", "Alert Count"), valueIndex: 'AlertCount', css: { 'width': 80, 'text-align': 'left' } },
|
||||
{ name: 'AlertCount', caption: GetTextByKey("P_AM_ALERTCOUNT", "Alert Count"), valueIndex: 'AlertCount', allowFilter: true, css: { 'width': 100, 'text-align': 'left' } },
|
||||
{ name: 'AlertLocalTime', caption: GetTextByKey("P_AM_LATESTALERTDATETIME", "Latest Alert DateTime"), valueIndex: 'AlertLocalTime', css: { 'width': 150, 'text-align': 'left' } },
|
||||
{ name: 'OpenWorkOrderCount', caption: GetTextByKey("P_AM_OPENWORKORDERS", "Open Work Orders"), valueIndex: 'OpenWorkOrderCount', css: { 'width': 130, 'text-align': 'left' } },
|
||||
{ name: 'OpenWorkOrderCount', caption: GetTextByKey("P_AM_OPENWORKORDERS", "Open Work Orders"), allowFilter: true, valueIndex: 'OpenWorkOrderCount', css: { 'width': 130, 'text-align': 'left' } },
|
||||
{ name: 'Comment', caption: GetTextByKey("P_AM_COMMENT", "Comment"), valueIndex: 'Comment', css: { 'width': 240, 'text-align': 'left' } },
|
||||
];
|
||||
var columns = [];
|
||||
// head
|
||||
@ -867,6 +1077,7 @@
|
||||
columns.push(col);
|
||||
if (col.name === "Selected") {
|
||||
col.enabled = "Enabled";
|
||||
col.sortable = false;
|
||||
col.events = {
|
||||
onchange: function () {
|
||||
if (this.Selected) {
|
||||
@ -878,7 +1089,7 @@
|
||||
if (a.MachineID !== this.MachineID)
|
||||
a.Enabled = false;
|
||||
}
|
||||
alertview_dt.reload();
|
||||
alertview_dt.refresh();
|
||||
}
|
||||
else {
|
||||
alertview_dt.SelectedCount--;
|
||||
@ -887,29 +1098,35 @@
|
||||
var a = allalertdata[i];
|
||||
a.Enabled = true;
|
||||
}
|
||||
alertview_dt.reload();
|
||||
alertview_dt.refresh();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
if (col.name === "Selected") {
|
||||
col.styleFilter = function (item) {
|
||||
return {
|
||||
display: (item.WorkOrderID > 0 || item.Completed) ? 'none' : ''
|
||||
};
|
||||
}
|
||||
}
|
||||
else if (col.name === 'Comment') {
|
||||
col.type = NoteColumn;
|
||||
col.onClicked = function (item, element) {
|
||||
onEditText(item, function () {
|
||||
element.querySelector('.cell-flex-memo').innerHTML = window['lib-utility'].escapeHtml(item.Comment);
|
||||
});
|
||||
};
|
||||
}
|
||||
}
|
||||
alertview_dt.canMultiSelect = false;
|
||||
alertview_dt.isEditable = true;
|
||||
alertview_dt.multiSelect = false;
|
||||
alertview_dt.columns = columns;
|
||||
alertview_dt.init();
|
||||
//alertview_dt.rowdblclick = OnEdit;
|
||||
|
||||
alertview_dt.selectedrowchanged = function (rowindex) {
|
||||
alertview_dt.onSelectedRowChanged = function (rowindex) {
|
||||
var rowdata = alertview_dt.source[rowindex];
|
||||
if (rowdata) {
|
||||
workOrderID = rowdata.Values.workOrderID;
|
||||
workOrderID = rowdata.workOrderID;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -927,11 +1144,10 @@
|
||||
r[j] = { DisplayValue: r["AcknowledgedTime_LocalStr"], Value: r[j] };
|
||||
}
|
||||
if (j === "AlertType") {
|
||||
r[j] = { DisplayValue: ($.trim(r[j]) == "" ? GetTextByKey("P_XXXXX", '(Blank)') : r[j]), Value: $.trim(r[j]) };
|
||||
r[j] = { DisplayValue: ($.trim(r[j]) == "" ? GetTextByKey("P_AM_BLANK", '(Blank)') : r[j]), Value: $.trim(r[j]) };
|
||||
}
|
||||
}
|
||||
var fr = { Values: r };
|
||||
rows.push(fr);
|
||||
rows.push(r);
|
||||
}
|
||||
|
||||
acknowledgedalerts_dt.SelectedCount = 0;
|
||||
@ -940,26 +1156,22 @@
|
||||
|
||||
var acknowledgedalerts_dt;
|
||||
function InitAcknowledgedAlertsGridData() {
|
||||
acknowledgedalerts_dt = new GridView('#acknowledgedalertslist');
|
||||
acknowledgedalerts_dt.lang = {
|
||||
all: GetTextByKey("P_GRID_ALL", "(All)"),
|
||||
ok: GetTextByKey("P_GRID_OK", "OK"),
|
||||
reset: GetTextByKey("P_GRID_RESET", "Reset")
|
||||
};
|
||||
acknowledgedalerts_dt = createGridView('#acknowledgedalertslist');
|
||||
var list_columns = [
|
||||
{ name: 'AcknowledgedByName', caption: GetTextByKey("P_AM_ACKNOWLEDGEDBY", "Acknowledged By"), valueIndex: 'AcknowledgedByName', allowFilter: true, css: { 'width': 150, 'text-align': 'left' } },
|
||||
{ name: 'AcknowledgedTime_Local', caption: GetTextByKey("P_AM_ACKNOWLEDGEDDATETIME", "Acknowledged DateTime"), valueIndex: 'AcknowledgedTime_Local', css: { 'width': 150, 'text-align': 'left' } },
|
||||
{ name: 'MachineName', caption: GetTextByKey("P_AM_ASSETNAME", "Asset Name"), valueIndex: 'MachineName', css: { 'width': 180, 'text-align': 'left' } },
|
||||
{ name: 'MachineName', caption: GetTextByKey("P_AM_ASSETNAME", "Asset Name"), valueIndex: 'MachineName', allowFilter: true, css: { 'width': 180, 'text-align': 'left' } },
|
||||
{ name: 'Make', caption: GetTextByKey("P_AM_MAKE", "Make"), valueIndex: 'Make', allowFilter: true, css: { 'width': 120, 'text-align': 'left' } },
|
||||
{ name: 'Model', caption: GetTextByKey("P_AM_MODEL", "Model"), valueIndex: 'Model', allowFilter: true, css: { 'width': 120, 'text-align': 'left' } },
|
||||
{ name: 'VIN', caption: GetTextByKey("P_AM_VIN", "SN/VIN"), valueIndex: 'VIN', css: { 'width': 180, 'text-align': 'left' } },
|
||||
{ name: 'EngineHours', caption: GetTextByKey("P_AM_HOURS", "Hours"), valueIndex: 'EngineHours', css: { 'width': 120, 'text-align': 'left' } },
|
||||
{ name: 'VIN', caption: GetTextByKey("P_AM_VIN", "SN/VIN"), valueIndex: 'VIN', allowFilter: true, css: { 'width': 180, 'text-align': 'left' } },
|
||||
{ name: 'EngineHours', caption: GetTextByKey("P_AM_HOURS", "Hours"), valueIndex: 'EngineHours', allowFilter: true, css: { 'width': 120, 'text-align': 'left' } },
|
||||
{ name: 'AlertType', caption: GetTextByKey("P_AM_ALERTTYPE", "Alert Type"), valueIndex: 'AlertType', allowFilter: true, css: { 'width': 120, 'text-align': 'left' } },
|
||||
{ name: 'Description', caption: GetTextByKey("P_AM_DESCRIPTION", "Description"), valueIndex: 'Description', css: { 'width': 240, 'text-align': 'left' } },
|
||||
{ name: 'AlertCount', caption: GetTextByKey("P_AM_ALERTCOUNT", "Alert Count"), valueIndex: 'AlertCount', css: { 'width': 80, 'text-align': 'left' } },
|
||||
{ name: 'AlertCount', caption: GetTextByKey("P_AM_ALERTCOUNT", "Alert Count"), valueIndex: 'AlertCount', allowFilter: true, css: { 'width': 80, 'text-align': 'left' } },
|
||||
{ name: 'AlertLocalTime', caption: GetTextByKey("P_AM_LATESTALERTDATETIME", "Latest Alert DateTime"), valueIndex: 'AlertLocalTime', css: { 'width': 150, 'text-align': 'left' } },
|
||||
{ name: 'OpenWorkOrderCount', caption: GetTextByKey("P_AM_OPENWORKORDERS", "Open Work Orders"), valueIndex: 'OpenWorkOrderCount', css: { 'width': 130, 'text-align': 'left' } },
|
||||
{ name: 'OpenWorkOrderCount', caption: GetTextByKey("P_AM_OPENWORKORDERS", "Open Work Orders"), valueIndex: 'OpenWorkOrderCount', allowFilter: true, css: { 'width': 130, 'text-align': 'left' } },
|
||||
{ name: 'AcknowledgedComment', caption: GetTextByKey("P_AM_ACKNOWLEDGEDCOMMENT", "Acknowledged Comment"), valueIndex: 'AcknowledgedComment', css: { 'width': 200, 'text-align': 'left' } },
|
||||
{ name: 'Comment', caption: GetTextByKey("P_AM_COMMENT", "Comment"), valueIndex: 'Comment', css: { 'width': 200, 'text-align': 'left' } },
|
||||
];
|
||||
var columns = [];
|
||||
// head
|
||||
@ -979,18 +1191,15 @@
|
||||
//if (col.name === "AcknowledgedComment") {
|
||||
// col.visible = isacknowledgingalerts;
|
||||
//}
|
||||
if (col.name === 'Comment') {
|
||||
col.type = NoteColumn;
|
||||
col.enabled = false;
|
||||
}
|
||||
columns.push(col);
|
||||
}
|
||||
acknowledgedalerts_dt.canMultiSelect = false;
|
||||
acknowledgedalerts_dt.multiSelect = false;
|
||||
acknowledgedalerts_dt.columns = columns;
|
||||
acknowledgedalerts_dt.init();
|
||||
//acknowledgedalerts_dt.rowdblclick = OnEdit;
|
||||
|
||||
acknowledgedalerts_dt.selectedrowchanged = function (rowindex) {
|
||||
var rowdata = acknowledgedalerts_dt.source[rowindex];
|
||||
if (rowdata) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function switchPage(index) {
|
||||
@ -1062,6 +1271,7 @@
|
||||
GetAssetGroups();
|
||||
GetAlertStatus();
|
||||
GetJobsites();
|
||||
GetCategory();
|
||||
|
||||
|
||||
InitGridData();
|
||||
@ -1078,6 +1288,9 @@
|
||||
$('#dialog_acknowledgingalerts').dialog(function () {
|
||||
showmaskbg(false);
|
||||
});
|
||||
$('#dialog_edittext').dialog(function () {
|
||||
showmaskbg(false);
|
||||
});
|
||||
|
||||
$('#searchinputtxt').keydown(enterKeydown);
|
||||
$('#chk_all_ackalert').change(function (e) {
|
||||
@ -1091,26 +1304,6 @@
|
||||
});
|
||||
});
|
||||
|
||||
$('#dialog_duedate').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_completeddate').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]);
|
||||
}
|
||||
});
|
||||
|
||||
$("#listDiv").scroll(null, function (e) {
|
||||
var t = $(e.target);
|
||||
$('#tbalertlist').css('margin-left', -(t.scrollLeft()));
|
||||
@ -1127,15 +1320,6 @@
|
||||
$('#listDiv').css('height', $(window).height() - $('#alertviewlist').offset().top - 40);
|
||||
}).resize();
|
||||
|
||||
$("#txtbegindate").datetimepicker({
|
||||
timepicker: false,
|
||||
format: 'm/d/Y'
|
||||
});
|
||||
$("#txtenddate").datetimepicker({
|
||||
timepicker: false,
|
||||
format: 'm/d/Y'
|
||||
});
|
||||
|
||||
if (!canExport) {
|
||||
$('#spExport').hide();
|
||||
}
|
||||
@ -1193,21 +1377,27 @@
|
||||
|
||||
|
||||
function OnExport() {
|
||||
var begindate = $('#txtbegindate').val();
|
||||
var enddate = $('#txtenddate').val();
|
||||
if (begindate && !$('#txtbegindate').is(':valid')) {
|
||||
showAlert(GetTextByKey('P_COMMON_BEGINDATEISINVALID', "The begin date is invalid."), GetTextByKey("P_FR_ERROR", 'Error'));
|
||||
return;
|
||||
}
|
||||
if (enddate && !$('#txtenddate').is(':valid')) {
|
||||
showAlert(GetTextByKey('P_COMMON_ENDDATEISINVALID', "The end date is invalid."), GetTextByKey("P_FR_ERROR", 'Error'));
|
||||
return;
|
||||
}
|
||||
if (begindate && enddate && begindate > enddate) {
|
||||
showAlert(GetTextByKey("P_JS_ENDDATEMUSTBELATERTHANBEGINDATE", "End Date must be later than Begin Date."), GetTextByKey("P_FR_ERROR", 'Error'));
|
||||
return;
|
||||
}
|
||||
|
||||
var searchtxt = htmlencode($.trim($('#searchinputtxt').val()));
|
||||
var beginDate = $('#txtbegindate').val();
|
||||
var endDate = $('#txtenddate').val();
|
||||
var alerttypes = [];
|
||||
var assetgroups = [];
|
||||
var alertstatus = [];
|
||||
var jobsites = [];
|
||||
if (alerttypeparam)
|
||||
alerttypes = alerttypeparam.selectedvalue;
|
||||
if (assetgroupparam)
|
||||
assetgroups = assetgroupparam.selectedvalue;
|
||||
if (alertstatusparam)
|
||||
alertstatus = alertstatusparam.selectedvalue;
|
||||
if (jobsitesparam)
|
||||
jobsites = jobsitesparam.selectedvalue;
|
||||
var alerttypes = $('#div_alerttype').dropdownVals();
|
||||
var assetgroups = $('#div_assetgroup').dropdownVals();
|
||||
var alertstatus = $('#div_alertstatus').dropdownVals();
|
||||
var jobsites = $('#div_jobsites').dropdownVals();
|
||||
var category = $('#div_categorys').dropdownVals();
|
||||
var item = {
|
||||
AssetID: assetid == "" ? -1 : eval(assetid),
|
||||
SearchText: searchtxt,
|
||||
@ -1215,8 +1405,9 @@
|
||||
AssetGroups: assetgroups,
|
||||
AlertTypes: alerttypes,
|
||||
JobSites: jobsites,
|
||||
BeginDate: beginDate,
|
||||
EndDate: endDate,
|
||||
Category: category,
|
||||
BeginDate: begindate,
|
||||
EndDate: enddate,
|
||||
IncludeunCompleted: $('#chk_includeuncompleted').prop("checked"),
|
||||
}
|
||||
|
||||
@ -1230,11 +1421,11 @@
|
||||
<div id="recordcontent" style="padding: 0px; margin: 0px;">
|
||||
<div class="page_title">
|
||||
<span data-lgid="P_ALERTSMANAGEMENT">Alerts Management</span>
|
||||
|
||||
<span class="exit" onclick="OnExit();" style="<%=InDialog?"": "display:none;"%>;float: right; font-size: 14px; margin-right: 10px; cursor: pointer;">
|
||||
|
||||
<span class="exit" onclick="OnExit();" style="<%=InDialog?"": "display:none;"%>; float: right; font-size: 14px; margin-right: 10px; cursor: pointer;">
|
||||
<label data-lgid="P_WO_EXIT" style="padding-left: 2px;">Exit</label>
|
||||
</span>
|
||||
<span id="spExport" class="export" style="float: right; font-size: 14px;margin-right: 10px; cursor: pointer;" onclick="OnExport();">
|
||||
<span id="spExport" class="export" style="float: right; font-size: 14px; margin-right: 10px; cursor: pointer;" onclick="OnExport();">
|
||||
<label data-lgid="P_AM_EXPORT" style="padding-left: 2px;">Export</label>
|
||||
</span>
|
||||
<span class="autoacknowledge" style="<%=InDialog?"display:none;": ""%>; float: right; font-size: 14px; margin-right: 15px; cursor: pointer;" onclick="openOpenAutoAcknowled();">
|
||||
@ -1250,15 +1441,15 @@
|
||||
<td style="border-bottom: 1px solid #bbb;"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="search_bar" style="margin-top: 10px;margin-bottom: 0px; min-width: 1320px;">
|
||||
<div class="search_bar" style="margin-top: 10px; margin-bottom: 0px; min-width: 1400px;">
|
||||
<input type="password" autocomplete="new-password" style="display: none" />
|
||||
<span data-lgid="P_AM_BEGINDATE_COLON">Begin Date:</span>
|
||||
<div>
|
||||
<input type="text" style="margin-left: 5px; width: 70px;" id="txtbegindate" value="<%=BeginDate %>" />
|
||||
<input id="txtbegindate" type="date" class="type-date" required min="1900-01-01" style="margin-left: 5px; width: 90px;" value="<%=BeginDate %>" />
|
||||
</div>
|
||||
<span data-lgid="P_AM_ENDDATE_COLON">End Date:</span>
|
||||
<div>
|
||||
<input type="text" style="margin-left: 5px; width: 70px;" id="txtenddate" value="<%=EndDate %>" />
|
||||
<input id="txtenddate" type="date" class="type-date" required min="1900-01-01" style="margin-left: 5px; width: 90px;" value="<%=EndDate %>" />
|
||||
</div>
|
||||
<div style="<%=InDialog?"display:none;": ""%>; display: flex;">
|
||||
<span data-lgid="P_AM_ALERTTYPE_COLON">Alert Type:</span>
|
||||
@ -1271,12 +1462,14 @@
|
||||
</div>
|
||||
<span data-lgid="P_AM_JOBSITES_COLON">Jobsites:</span>
|
||||
<div id="div_jobsites"></div>
|
||||
<span data-lgid="P_AM_CATEGORY_COLON">Category:</span>
|
||||
<div id="div_categorys"></div>
|
||||
<input style="margin-left: 5px; width: 140px;" type="text" id="searchinputtxt" autocomplete="off" />
|
||||
</div>
|
||||
<input class="search" type="button" style="margin-left: 8px;" onclick="OnSearchClick();" value="Search" data-lgid="P_AM_SEARCH" />
|
||||
<%--<input id="chkShowCompleted" type="checkbox" onclick="GetAlerts();" /><span>Show Completed Alerts</span>--%>
|
||||
</div>
|
||||
<div class="search_bar" style="margin-top: 5px;"">
|
||||
<div class="search_bar" style="margin-top: 5px;">
|
||||
<div id="div_includeuncompleted">
|
||||
<input id="chk_includeuncompleted" type="checkbox" onclick="OnSearchClick();" />
|
||||
<span data-lgid="P_AM_INCLUDEUNCOMPLETED">Display triggered/incomplete PM and red/yellow inspect alerts despite date selection</span>
|
||||
@ -1289,10 +1482,10 @@
|
||||
<span class="sbutton iconexpand" id="btnExpandAll" onclick="ExpandAll(this);" data-lgid="P_AM_EXPANDALL">Expand All</span>
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
<div id="alertviewlist" style="min-width: 1280px;"></div>
|
||||
<div id="alertviewlist" style="min-width: 1300px;"></div>
|
||||
<div id="machineviewlist" class="content_main" style="overflow-x: auto; display: none;">
|
||||
<div style="overflow: hidden;">
|
||||
<table id="tbalertlist" class="main_table" style="min-width: 1280px; width: 100%; table-layout: fixed;">
|
||||
<table id="tbalertlist" class="main_table" style="min-width: 1300px; width: 100%; table-layout: fixed;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 12px;"></th>
|
||||
@ -1313,17 +1506,19 @@
|
||||
</table>
|
||||
</div>
|
||||
<div id="listDiv" class="content_div">
|
||||
<table class="main_table" style="min-width: 1280px; width: 100%; table-layout: fixed;">
|
||||
<table class="main_table" style="min-width: 1300px; width: 100%; table-layout: fixed;">
|
||||
<tbody id="tbody_alerts">
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="acknowledgedalertslist" style="min-width: 1280px;"></div>
|
||||
<div id="acknowledgedalertslist" style="min-width: 1300px;"></div>
|
||||
|
||||
</div>
|
||||
<div id="mask_bg" style="display: none;"><div class="loading c-spin"></div></div>
|
||||
<div id="mask_bg" style="display: none;">
|
||||
<div class="loading c-spin"></div>
|
||||
</div>
|
||||
<div class="dialog" id="dialog_workorder" style="display: none; height: 100%; border-bottom: 0; border-top: 0;">
|
||||
<iframe id="iframeworkorder" style="width: 100%; height: 100%; display: block; border: none;"></iframe>
|
||||
<div class="maskbg" style="display: none;"></div>
|
||||
@ -1354,5 +1549,22 @@
|
||||
<div class="maskbg" style="display: none;"></div>
|
||||
</div>
|
||||
|
||||
<div class="dialog" id="dialog_edittext" style="display: none;">
|
||||
<div class="dialog-title"><span class="title" data-lgid="P_AM_EDITCOMMENT">Edit Comment</span><em class="dialog-close"></em></div>
|
||||
<div class="dialog-content">
|
||||
<table style="line-height: 30px;">
|
||||
<tr>
|
||||
<td>
|
||||
<textarea id="dialog_text" tabindex="1" style="width: 480px; height: 200px; margin-top: 6px;" maxlength="1000"></textarea></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="dialog-func">
|
||||
<input type="button" value="Cancel" data-lgid="P_WO_CANCEL" class="dialog-close" tabindex="3" />
|
||||
<input type="button" onclick="SaveText();" value="Save" data-lgid="P_WO_SAVE" tabindex="2" />
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</asp:Content>
|
||||
|
||||
|
@ -4,6 +4,8 @@ using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using DocumentFormat.OpenXml.Bibliography;
|
||||
using DocumentFormat.OpenXml.Wordprocessing;
|
||||
using Foresight.Fleet.Services.User;
|
||||
using IronIntel.Contractor;
|
||||
using IronIntel.Contractor.Site.Maintenance;
|
||||
@ -14,6 +16,11 @@ public partial class Maintenance_AlertsManagement : AlertsBasePage
|
||||
public string EndDate = "";
|
||||
public string AssetID = "";
|
||||
public bool InDialog = false;
|
||||
protected string AlertViewApiAddress;
|
||||
protected string AssetViewApiAddress;
|
||||
protected string AcknowledgedApiAddress;
|
||||
protected string CompanyID;
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!CheckLoginSession())
|
||||
@ -40,15 +47,23 @@ public partial class Maintenance_AlertsManagement : AlertsBasePage
|
||||
|
||||
AssetID = Request.Params["mid"] ?? "";
|
||||
InDialog = Request.Params["InDialog"] == "1";
|
||||
|
||||
if (!Request.Url.AbsoluteUri.Contains("localhost") && "https".Equals(Request.Url.Scheme, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
AlertViewApiAddress = SystemParams.CurrentCustomerParams.AlertListApiAddress_AlertView;
|
||||
AssetViewApiAddress = SystemParams.CurrentCustomerParams.AlertListApiAddress_AssetView;
|
||||
AcknowledgedApiAddress = SystemParams.CurrentCustomerParams.AlertListApiAddress_Acknowledged;
|
||||
}
|
||||
CompanyID = SystemParams.CompanyID;
|
||||
}
|
||||
|
||||
DateTime userlocaldate = SystemParams.ConvertToUserTimeFromUtc(GetCurrentLoginSession().User, DateTime.UtcNow);
|
||||
if (InDialog)
|
||||
BeginDate = userlocaldate.AddDays(-13).ToShortDateString();
|
||||
BeginDate = userlocaldate.AddDays(-13).ToString("yyyy-MM-dd");
|
||||
else
|
||||
BeginDate = userlocaldate.AddDays(-6).ToShortDateString();
|
||||
BeginDate = userlocaldate.AddDays(-6).ToString("yyyy-MM-dd");
|
||||
|
||||
EndDate = userlocaldate.ToShortDateString();
|
||||
EndDate = userlocaldate.ToString("yyyy-MM-dd");
|
||||
}
|
||||
}
|
||||
|
||||
@ -61,5 +76,4 @@ public partial class Maintenance_AlertsManagement : AlertsBasePage
|
||||
return license && permission;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -7,37 +7,6 @@
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.dialog-content table {
|
||||
border-collapse: collapse;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.dialog-content table td.label {
|
||||
width: 150px;
|
||||
text-align: right;
|
||||
padding-right: 10px;
|
||||
line-height: 24px;
|
||||
height: 24px;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.dialog-content table td input,
|
||||
.dialog-content table td textarea {
|
||||
border: 1px solid #a9a9a9;
|
||||
width: 200px;
|
||||
height: 18px;
|
||||
padding: 1px;
|
||||
}
|
||||
|
||||
.dialog-content table td input[type="checkbox"] {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.dialog-content table td textarea {
|
||||
height: 100px;
|
||||
max-width: 200px;
|
||||
}
|
||||
|
||||
#dialogdatatb td {
|
||||
padding-top: 5px;
|
||||
}
|
||||
@ -86,14 +55,13 @@
|
||||
var r = data[i];
|
||||
for (var j in r) {
|
||||
if (j === "AutoAcknowledge") {
|
||||
r[j] = { DisplayValue: r["AutoAcknowledge"] > 0 ? "Yes" : "No", Value: r[j] };
|
||||
r[j] = { DisplayValue: r["AutoAcknowledge"] > 0 ? GetTextByKey("P_UTILITY_YES", "Yes") : GetTextByKey("P_UTILITY_NO", "No"), Value: r[j] };
|
||||
}
|
||||
else if (j === "LocalUpdatedOn") {
|
||||
r[j] = { DisplayValue: r["LocalUpdatedOnStr"], Value: r[j] };
|
||||
}
|
||||
}
|
||||
var fr = { Values: r };
|
||||
rows.push(fr);
|
||||
rows.push(r);
|
||||
}
|
||||
|
||||
grid_dt.setData(rows);
|
||||
@ -101,12 +69,7 @@
|
||||
|
||||
var grid_dt;
|
||||
function InitGridData() {
|
||||
grid_dt = new GridView('#autoacknowledgelist');
|
||||
grid_dt.lang = {
|
||||
all: GetTextByKey("P_GRID_ALL", "(All)"),
|
||||
ok: GetTextByKey("P_GRID_OK", "OK"),
|
||||
reset: GetTextByKey("P_GRID_RESET", "Reset")
|
||||
};
|
||||
grid_dt = createGridView('#autoacknowledgelist');
|
||||
var list_columns = [
|
||||
{ name: 'AlertType', caption: GetTextByKey("P_AM_ALERTTYPE", "Alert Type"), valueIndex: 'AlertType', allowFilter: true, css: { 'width': 300, 'text-align': 'left' } },
|
||||
{ name: 'AutoAcknowledge', caption: GetTextByKey("P_AM_AUTOACKNOWLEDGE1", "Auto Acknowledge"), valueIndex: 'AutoAcknowledge', allowFilter: true, css: { 'width': 150, 'text-align': 'left' } },
|
||||
@ -128,15 +91,9 @@
|
||||
|
||||
columns.push(col);
|
||||
}
|
||||
grid_dt.canMultiSelect = false;
|
||||
grid_dt.multiSelect = false;
|
||||
grid_dt.columns = columns;
|
||||
grid_dt.init();
|
||||
|
||||
grid_dt.selectedrowchanged = function (rowindex) {
|
||||
var rowdata = grid_dt.source[rowindex];
|
||||
if (rowdata) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function OnExport() {
|
||||
|
@ -14,30 +14,6 @@
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.dialog-content table {
|
||||
border-collapse: collapse;
|
||||
width: 100%;
|
||||
line-height: 32px;
|
||||
}
|
||||
|
||||
.dialog-content table td.label {
|
||||
width: 130px;
|
||||
text-align: right;
|
||||
padding-right: 10px;
|
||||
line-height: 24px;
|
||||
height: 24px;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.dialog-content table td input,
|
||||
.dialog-content table td textarea {
|
||||
border: 1px solid #a9a9a9;
|
||||
width: 250px;
|
||||
height: 18px;
|
||||
padding: 1px;
|
||||
}
|
||||
|
||||
#dialog_machines .dialog-content table td input {
|
||||
width: auto;
|
||||
}
|
||||
@ -119,16 +95,6 @@
|
||||
line-height: 21px;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.machine_maskbg {
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
background: #000;
|
||||
opacity: 0.2;
|
||||
}
|
||||
</style>
|
||||
<script src="<%=GetFileUrlWithVersion("js/controls.js")%>" type="text/javascript"></script>
|
||||
<script src="<%=GetFileUrlWithVersion("../js/assetselector.js")%>" type="text/javascript"></script>
|
||||
@ -175,7 +141,7 @@
|
||||
if (index < 0) {
|
||||
showAlert(GetTextByKey("P_CR_PLEASESELECTCUSTOMERRECORD", "Please select customer record."), GetTextByKey("P_CUSTOMERRECORD", "Customer Record")); return;
|
||||
}
|
||||
var cust = grid_dt.source[index].Values;
|
||||
var cust = grid_dt.source[index];
|
||||
if (!cust) {
|
||||
custrecordid = undefined;
|
||||
return;
|
||||
@ -216,8 +182,7 @@
|
||||
for (var j in r) {
|
||||
}
|
||||
|
||||
var fr = { Values: r };
|
||||
rows.push(fr);
|
||||
rows.push(r);
|
||||
}
|
||||
|
||||
grid_dt.setData(rows);
|
||||
@ -225,12 +190,7 @@
|
||||
|
||||
var grid_dt;
|
||||
function InitGridData() {
|
||||
grid_dt = new GridView('#customerlist');
|
||||
grid_dt.lang = {
|
||||
all: GetTextByKey("P_GRID_ALL", "(All)"),
|
||||
ok: GetTextByKey("P_GRID_OK", "OK"),
|
||||
reset: GetTextByKey("P_GRID_RESET", "Reset")
|
||||
};
|
||||
grid_dt = createGridView('#customerlist');
|
||||
var list_columns = [
|
||||
{ name: 'Code', caption: GetTextByKey("P_CR_CODE", "Code"), valueIndex: 'Code', allowFilter: true, css: { 'width': 120, 'text-align': 'left' } },
|
||||
{ name: 'Name', caption: GetTextByKey("P_CR_COMPANYNAME", "Company Name"), valueIndex: 'Name', allowFilter: true, css: { 'width': 240, 'text-align': 'left' } },
|
||||
@ -263,9 +223,10 @@
|
||||
}
|
||||
|
||||
if (col.name === "Edit") {
|
||||
col.isurl = true;
|
||||
col.text = "\uf044";
|
||||
col.sortable = false;
|
||||
col.resizable = false;
|
||||
col.type = GridView.ColumnTypes.Icon;
|
||||
col.text = "edit";
|
||||
col.events = {
|
||||
onclick: function () {
|
||||
OnEdit();
|
||||
@ -277,9 +238,10 @@
|
||||
col.attrs = { 'title': GetTextByKey("P_UM_EDIT", 'Edit') };
|
||||
}
|
||||
else if (col.name === "Delete") {
|
||||
col.isurl = true;
|
||||
col.text = "\uf00d";
|
||||
col.sortable = false;
|
||||
col.resizable = false;
|
||||
col.type = GridView.ColumnTypes.Icon;
|
||||
col.text = "times";
|
||||
col.events = {
|
||||
onclick: function () {
|
||||
OnDelete(this);
|
||||
@ -292,9 +254,10 @@
|
||||
}
|
||||
else if (col.name === "AssetAssignment") {
|
||||
col.visible = !IsDealer;
|
||||
col.isurl = true;
|
||||
col.text = "\uf63c";
|
||||
col.sortable = false;
|
||||
col.resizable = false;
|
||||
col.type = GridView.ColumnTypes.Icon;
|
||||
col.text = "truck-pickup";
|
||||
col.events = {
|
||||
onclick: function () {
|
||||
OnManageMachine(this);
|
||||
@ -307,15 +270,15 @@
|
||||
}
|
||||
columns.push(col);
|
||||
}
|
||||
grid_dt.canMultiSelect = false;
|
||||
grid_dt.multiSelect = 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) {
|
||||
uiid = rowdata.Values.IID;
|
||||
uiid = rowdata.IID;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -326,13 +289,13 @@
|
||||
InitGridData();
|
||||
|
||||
$('#dialog_managemahchine').dialog(function () {
|
||||
$('.machine_maskbg').hide();
|
||||
showmaskbg(false);
|
||||
});
|
||||
|
||||
OnRefresh();
|
||||
|
||||
$('#dialog_managemahchine').dialog(function () {
|
||||
$('.machine_maskbg').hide();
|
||||
showmaskbg(false);
|
||||
});
|
||||
|
||||
$('#searchinputtxt').keydown(searchEnter);
|
||||
@ -366,7 +329,7 @@
|
||||
<div class="search_bar">
|
||||
<input type="password" autocomplete="new-password" style="display: none" />
|
||||
<input type="text" id="searchinputtxt" autocomplete="off" />
|
||||
<input class="search" type="button" onclick="OnRefresh();" value="Search" data-lgid="P_CM_SEARCH" />
|
||||
<input class="search" type="button" onclick="OnRefresh();" value="Search" data-lgid="P_CM_SEARCH" style="margin-left: 5px" />
|
||||
</div>
|
||||
<div class="function_title">
|
||||
<%if (!CRReadOnly)
|
||||
@ -379,8 +342,10 @@
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
<div id="customerlist"></div>
|
||||
|
||||
<div class="machine_maskbg" style="display: none;"></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 id="dialogmask" class="maskbg" style="display: none; z-index: 1;">
|
||||
<div class="loading_icon icon c-spin"></div>
|
||||
@ -416,9 +381,6 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="mask_bg" style="display: none;">
|
||||
<div class="loading c-spin"></div>
|
||||
</div>
|
||||
<div class="dialog" id="dialog_user" style="display: none; height: 100%; border-bottom: 0; border-top: 0;">
|
||||
<iframe id="iframeuser" src="AddCustomerRecord.aspx" style="width: 100%; height: 100%; display: block; border: none;"></iframe>
|
||||
<div class="maskbg" style="display: none;"></div>
|
||||
|
@ -7,37 +7,6 @@
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.dialog-content table {
|
||||
border-collapse: collapse;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.dialog-content table td.label {
|
||||
width: 150px;
|
||||
text-align: right;
|
||||
padding-right: 10px;
|
||||
line-height: 24px;
|
||||
height: 24px;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.dialog-content table td input,
|
||||
.dialog-content table td textarea {
|
||||
border: 1px solid #a9a9a9;
|
||||
width: 200px;
|
||||
height: 18px;
|
||||
padding: 1px;
|
||||
}
|
||||
|
||||
.dialog-content table td input[type="checkbox"] {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.dialog-content table td textarea {
|
||||
height: 100px;
|
||||
max-width: 200px;
|
||||
}
|
||||
|
||||
#dialogdatatb td {
|
||||
padding-top: 5px;
|
||||
}
|
||||
@ -96,8 +65,7 @@
|
||||
r[j] = { DisplayValue: r["LastUpdatedOn_LocalStr"], Value: r[j] };
|
||||
}
|
||||
}
|
||||
var fr = { Values: r };
|
||||
rows.push(fr);
|
||||
rows.push(r);
|
||||
}
|
||||
|
||||
grid_dt.setData(rows);
|
||||
@ -105,32 +73,27 @@
|
||||
|
||||
var grid_dt;
|
||||
function InitGridData() {
|
||||
grid_dt = new GridView('#recordlist');
|
||||
grid_dt.lang = {
|
||||
all: GetTextByKey("P_GRID_ALL", "(All)"),
|
||||
ok: GetTextByKey("P_GRID_OK", "OK"),
|
||||
reset: GetTextByKey("P_GRID_RESET", "Reset")
|
||||
};
|
||||
grid_dt = createGridView('#recordlist');
|
||||
var list_columns = [
|
||||
{ name: 'AssetName', caption: GetTextByKey("P_FR_ASSETNAME", GetTextByKey("P_FR_ASSETNAME", "Asset Name")), valueIndex: 'AssetName', css: { 'width': 180, 'text-align': 'left' } },
|
||||
{ name: 'AssetName', caption: GetTextByKey("P_FR_ASSETNAME", GetTextByKey("P_FR_ASSETNAME", "Asset Name")), valueIndex: 'AssetName', allowFilter: true, css: { 'width': 180, 'text-align': 'left' } },
|
||||
{ name: 'AssetMake', caption: GetTextByKey("P_FR_MAKE", "Make"), valueIndex: 'AssetMake', allowFilter: true, css: { 'width': 120, 'text-align': 'left' } },
|
||||
{ name: 'AssetModel', caption: GetTextByKey("P_FR_MODEL", "Model"), valueIndex: 'AssetModel', allowFilter: true, css: { 'width': 120, 'text-align': 'left' } },
|
||||
{ name: 'VIN', caption: GetTextByKey("P_FR_SNVIN", "SN/VIN"), valueIndex: 'VIN', css: { 'width': 180, 'text-align': 'left' } },
|
||||
{ name: 'TicketNumber', caption: GetTextByKey("P_FR_TICKETNUMBER", "Ticket Number"), valueIndex: 'TicketNumber', css: { 'width': 120, 'text-align': 'left' } },
|
||||
{ name: 'DriverName', caption: GetTextByKey("P_FR_DRIVERNAME", "Driver Name"), valueIndex: 'DriverName', css: { 'width': 120, 'text-align': 'left' } },
|
||||
{ name: 'VIN', caption: GetTextByKey("P_FR_SNVIN", "SN/VIN"), valueIndex: 'VIN', allowFilter: true, css: { 'width': 180, 'text-align': 'left' } },
|
||||
{ name: 'TicketNumber', caption: GetTextByKey("P_FR_TICKETNUMBER", "Ticket Number"), valueIndex: 'TicketNumber', allowFilter: true, css: { 'width': 120, 'text-align': 'left' } },
|
||||
{ name: 'DriverName', caption: GetTextByKey("P_FR_DRIVERNAME", "Driver Name"), valueIndex: 'DriverName', allowFilter: true, css: { 'width': 120, 'text-align': 'left' } },
|
||||
{ name: 'FuelType', caption: GetTextByKey("P_FR_FUELTYPE", "Fuel Type"), valueIndex: 'FuelType', allowFilter: true, css: { 'width': 90, 'text-align': 'left' } },
|
||||
{ name: 'TransactionLocalDate', caption: GetTextByKey("P_FR_TRANSACTIONDATE", "Transaction Date"), valueIndex: 'TransactionLocalDate', css: { 'width': 120, 'text-align': 'left' } },
|
||||
{ name: 'RetailerName', caption: GetTextByKey("P_FR_RETAILERNAME", "Retailer Name"), valueIndex: 'RetailerName', css: { 'width': 180, 'text-align': 'left' } },
|
||||
{ name: 'RetailerAddress', caption: GetTextByKey("P_FR_ADDRESS", "Address"), valueIndex: 'RetailerAddress', css: { 'width': 180, 'text-align': 'left' } },
|
||||
{ name: 'RetailerCity', caption: GetTextByKey("P_FR_CITY", "City"), valueIndex: 'RetailerCity', css: { 'width': 150, 'text-align': 'left' } },
|
||||
{ name: 'RetailerState', caption: GetTextByKey("P_FR_STATE", "State"), valueIndex: 'RetailerState', css: { 'width': 80, 'text-align': 'left' } },
|
||||
{ name: 'RetailerZip', caption: GetTextByKey("P_FR_ZIP", "Zip"), valueIndex: 'RetailerZip', css: { 'width': 80, 'text-align': 'left' } },
|
||||
{ name: 'Quantity', caption: GetTextByKey("P_FR_QUANTITY", "Quantity"), valueIndex: 'Quantity', css: { 'width': 80, 'text-align': 'right' } },
|
||||
{ name: 'Uom', caption: GetTextByKey("P_FR_UOM", "Uom"), valueIndex: 'Uom', css: { 'width': 80, 'text-align': 'left' } },
|
||||
{ name: 'TotalCost', caption: GetTextByKey("P_FR_TOTALCOST", "Total Cost"), valueIndex: 'TotalCost', css: { 'width': 80, 'text-align': 'right' } },
|
||||
{ name: 'AddedByName', caption: GetTextByKey("P_FR_ADDEDNAME", "Added Name"), valueIndex: 'AddedByName', css: { 'width': 120, 'text-align': 'left' } },
|
||||
{ name: 'RetailerName', caption: GetTextByKey("P_FR_RETAILERNAME", "Retailer Name"), valueIndex: 'RetailerName', allowFilter: true, css: { 'width': 180, 'text-align': 'left' } },
|
||||
{ name: 'RetailerAddress', caption: GetTextByKey("P_FR_ADDRESS", "Address"), valueIndex: 'RetailerAddress', allowFilter: true, css: { 'width': 180, 'text-align': 'left' } },
|
||||
{ name: 'RetailerCity', caption: GetTextByKey("P_FR_CITY", "City"), valueIndex: 'RetailerCity', allowFilter: true, css: { 'width': 150, 'text-align': 'left' } },
|
||||
{ name: 'RetailerState', caption: GetTextByKey("P_FR_STATE", "State"), valueIndex: 'RetailerState', allowFilter: true, css: { 'width': 80, 'text-align': 'left' } },
|
||||
{ name: 'RetailerZip', caption: GetTextByKey("P_FR_ZIP", "Zip"), valueIndex: 'RetailerZip', allowFilter: true, css: { 'width': 80, 'text-align': 'left' } },
|
||||
{ name: 'Quantity', caption: GetTextByKey("P_FR_QUANTITY", "Quantity"), valueIndex: 'Quantity', allowFilter: true, css: { 'width': 80, 'text-align': 'right' } },
|
||||
{ name: 'Uom', caption: GetTextByKey("P_FR_UOM", "Uom"), valueIndex: 'Uom', allowFilter: true, css: { 'width': 80, 'text-align': 'left' } },
|
||||
{ name: 'TotalCost', caption: GetTextByKey("P_FR_TOTALCOST", "Total Cost"), valueIndex: 'TotalCost', allowFilter: true, css: { 'width': 80, 'text-align': 'right' } },
|
||||
{ name: 'AddedByName', caption: GetTextByKey("P_FR_ADDEDNAME", "Added Name"), valueIndex: 'AddedByName', allowFilter: true, css: { 'width': 120, 'text-align': 'left' } },
|
||||
{ name: 'AddedOn_Local', caption: GetTextByKey("P_FR_ADDEDON", "Added On"), valueIndex: 'AddedOn_Local', css: { 'width': 120, 'text-align': 'left' } },
|
||||
{ name: 'LasetUpdatedByName', caption: GetTextByKey("P_FR_LASTUPDATEDNAME", "Last Updated Name"), valueIndex: 'LasetUpdatedByName', css: { 'width': 122, 'text-align': 'left' } },
|
||||
{ name: 'LasetUpdatedByName', caption: GetTextByKey("P_FR_LASTUPDATEDNAME", "Last Updated Name"), valueIndex: 'LasetUpdatedByName', allowFilter: true, css: { 'width': 122, 'text-align': 'left' } },
|
||||
{ name: 'LastUpdatedOn_Local', caption: GetTextByKey("P_FR_LASTUPDATEDON", "Last Updated On"), valueIndex: 'LastUpdatedOn_Local', css: { 'width': 120, 'text-align': 'left' } },
|
||||
{ name: 'Notes', caption: GetTextByKey("P_FR_NOTES", "Notes"), valueIndex: 'Notes', css: { 'width': 200, 'text-align': 'left' } }
|
||||
];
|
||||
@ -149,15 +112,9 @@
|
||||
|
||||
columns.push(col);
|
||||
}
|
||||
grid_dt.canMultiSelect = false;
|
||||
grid_dt.multiSelect = false;
|
||||
grid_dt.columns = columns;
|
||||
grid_dt.init();
|
||||
|
||||
grid_dt.selectedrowchanged = function (rowindex) {
|
||||
var rowdata = grid_dt.source[rowindex];
|
||||
if (rowdata) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,44 +1,12 @@
|
||||
<%@ Page Title="" Language="C#" MasterPageFile="~/Maintenance/MaintenanceBase.master" AutoEventWireup="true" CodeFile="FuelRecordManagement.aspx.cs" Inherits="Maintenance_FuelRecordManagement" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
|
||||
<link href="../css/jquery.datetimepicker.css" rel="stylesheet" />
|
||||
<style type="text/css">
|
||||
.selectinput {
|
||||
width: 150px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.dialog-content table {
|
||||
border-collapse: collapse;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.dialog-content table td.label {
|
||||
width: 150px;
|
||||
text-align: right;
|
||||
padding-right: 10px;
|
||||
line-height: 24px;
|
||||
height: 24px;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.dialog-content table td input,
|
||||
.dialog-content table td textarea {
|
||||
border: 1px solid #a9a9a9;
|
||||
width: 200px;
|
||||
height: 18px;
|
||||
padding: 1px;
|
||||
}
|
||||
|
||||
.dialog-content table td input[type="checkbox"] {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.dialog-content table td textarea {
|
||||
height: 100px;
|
||||
max-width: 200px;
|
||||
}
|
||||
|
||||
#dialogdatatb td {
|
||||
padding-top: 5px;
|
||||
}
|
||||
@ -53,9 +21,7 @@
|
||||
content: '\f08b';
|
||||
}
|
||||
</style>
|
||||
<script src="../js/jquery.datetimepicker.full.js"></script>
|
||||
<script src="<%=GetFileUrlWithVersion("js/inputdatactr.js")%>" type="text/javascript"></script>
|
||||
<script src="<%=GetFileUrlWithVersion("../js/editableselect.js")%>" type="text/javascript"></script>
|
||||
<script type="text/javascript">
|
||||
var fuelrecorddata;
|
||||
var assetid = "<%=AssetID %>";
|
||||
@ -97,16 +63,28 @@
|
||||
}
|
||||
|
||||
function OnRefresh() {
|
||||
showloading(true);
|
||||
var begindate = $('#startdatetxt').val();
|
||||
var enddate = $('#enddatetxt').val();
|
||||
if (begindate && !$('#startdatetxt').is(':valid')) {
|
||||
showAlert(GetTextByKey('P_COMMON_BEGINDATEISINVALID', "The begin date is invalid."), GetTextByKey("P_FR_ERROR", 'Error'));
|
||||
return;
|
||||
}
|
||||
if (enddate && !$('#enddatetxt').is(':valid')) {
|
||||
showAlert(GetTextByKey('P_COMMON_ENDDATEISINVALID', "The end date is invalid."), GetTextByKey("P_FR_ERROR", 'Error'));
|
||||
return;
|
||||
}
|
||||
if (begindate && enddate && begindate > enddate) {
|
||||
showAlert(GetTextByKey("P_JS_ENDDATEMUSTBELATERTHANBEGINDATE", "End Date must be later than Begin Date."), GetTextByKey("P_FR_ERROR", 'Error'));
|
||||
return;
|
||||
}
|
||||
|
||||
var type = $('#typeselectinput').find("option:selected").val();
|
||||
var searchtxt = "";
|
||||
searchtxt = htmlencode($.trim($('#searchinputtxt').val()));
|
||||
var startdate = htmlencode($('#startdatetxt').val());
|
||||
var enddate = htmlencode($('#enddatetxt').val());
|
||||
var aid = (!assetid || assetid == "") ? -1 : eval(assetid);
|
||||
|
||||
fuelrequest("GetFuelRecords", type + String.fromCharCode(170) + startdate + String.fromCharCode(170) + enddate + String.fromCharCode(170) + searchtxt + String.fromCharCode(170) + aid, function (data) {
|
||||
showloading(true);
|
||||
fuelrequest("GetFuelRecords", type + String.fromCharCode(170) + begindate + String.fromCharCode(170) + enddate + String.fromCharCode(170) + searchtxt + String.fromCharCode(170) + aid, function (data) {
|
||||
showloading(false);
|
||||
if (typeof (data) === "string") {
|
||||
showAlert(data, GetTextByKey("P_FR_ERROR", 'Error'));
|
||||
@ -146,8 +124,7 @@
|
||||
// r[j] = { DisplayValue: getLangUom(r["Uom"]), Value: r[j] };
|
||||
//}
|
||||
}
|
||||
var fr = { Values: r };
|
||||
rows.push(fr);
|
||||
rows.push(r);
|
||||
}
|
||||
|
||||
grid_dt.setData(rows);
|
||||
@ -155,25 +132,20 @@
|
||||
|
||||
var grid_dt;
|
||||
function InitGridData() {
|
||||
grid_dt = new GridView('#recordlist');
|
||||
grid_dt.lang = {
|
||||
all: GetTextByKey("P_GRID_ALL", "(All)"),
|
||||
ok: GetTextByKey("P_GRID_OK", "OK"),
|
||||
reset: GetTextByKey("P_GRID_RESET", "Reset")
|
||||
};
|
||||
grid_dt = createGridView('#recordlist');
|
||||
var list_columns = [
|
||||
{ name: 'AssetName', caption: GetTextByKey("P_FR_ASSETNAME", "Asset Name"), valueIndex: 'AssetName', css: { 'width': 180, 'text-align': 'left' } },
|
||||
{ name: 'AssetName', caption: GetTextByKey("P_FR_ASSETNAME", "Asset Name"), valueIndex: 'AssetName', allowFilter: true, css: { 'width': 180, 'text-align': 'left' } },
|
||||
{ name: 'AssetMake', caption: GetTextByKey("P_FR_MAKE", "Make"), valueIndex: 'AssetMake', allowFilter: true, css: { 'width': 120, 'text-align': 'left' } },
|
||||
{ name: 'AssetModel', caption: GetTextByKey("P_FR_MODEL", "Model"), valueIndex: 'AssetModel', allowFilter: true, css: { 'width': 120, 'text-align': 'left' } },
|
||||
{ name: 'VIN', caption: GetTextByKey("P_FR_SNVIN", "SN/VIN"), valueIndex: 'VIN', css: { 'width': 180, 'text-align': 'left' } },
|
||||
{ name: 'VIN', caption: GetTextByKey("P_FR_SNVIN", "SN/VIN"), valueIndex: 'VIN', allowFilter: true, css: { 'width': 180, 'text-align': 'left' } },
|
||||
{ name: 'TransactionLocalDate', caption: GetTextByKey("P_FR_TRANSACTIONDATE", "Transaction Date"), valueIndex: 'TransactionLocalDate', css: { 'width': 120, 'text-align': 'left' } },
|
||||
{ name: 'DistributedBy', caption: GetTextByKey("P_FR_DISTRIBUTEDBY", "Distributed By"), valueIndex: 'DistributedBy', allowFilter: true, css: { 'width': 120, 'text-align': 'left' } },
|
||||
{ name: 'RetailerName', caption: GetTextByKey("P_FR_RETAILERNAME", "Retailer Name"), valueIndex: 'RetailerName', css: { 'width': 180, 'text-align': 'left' } },
|
||||
{ name: 'FuelingAssetName', caption: GetTextByKey("P_FR_ASSET", "Asset"), valueIndex: 'FuelingAssetName', css: { 'width': 180, 'text-align': 'left' } },
|
||||
{ name: 'Quantity', caption: GetTextByKey("P_FR_QUANTITY", "Quantity"), valueIndex: 'Quantity', css: { 'width': 80, 'text-align': 'right' } },
|
||||
{ name: 'Uom', caption: GetTextByKey("P_FR_UOM", "UOM"), valueIndex: 'Uom', css: { 'width': 80, 'text-align': 'left' } },
|
||||
{ name: 'UnitCost', caption: GetTextByKey("P_FR_UOMCOST", "Unit Cost"), valueIndex: 'UnitCost', css: { 'width': 80, 'text-align': 'right' } },
|
||||
{ name: 'TotalCost', caption: GetTextByKey("P_FR_TOTALCOST", "Total Cost"), valueIndex: 'TotalCost', css: { 'width': 80, 'text-align': 'right' } },
|
||||
{ name: 'DistributedBy', caption: GetTextByKey("P_FR_DISTRIBUTEDBY", "Distributed By"), allowFilter: true, valueIndex: 'DistributedBy', allowFilter: true, css: { 'width': 120, 'text-align': 'left' } },
|
||||
{ name: 'RetailerName', caption: GetTextByKey("P_FR_RETAILERNAME", "Retailer Name"), valueIndex: 'RetailerName', allowFilter: true, css: { 'width': 180, 'text-align': 'left' } },
|
||||
{ name: 'FuelingAssetName', caption: GetTextByKey("P_FR_ASSET", "Asset"), valueIndex: 'FuelingAssetName', allowFilter: true, css: { 'width': 180, 'text-align': 'left' } },
|
||||
{ name: 'Quantity', caption: GetTextByKey("P_FR_QUANTITY", "Quantity"), valueIndex: 'Quantity', allowFilter: true, css: { 'width': 80, 'text-align': 'right' } },
|
||||
{ name: 'Uom', caption: GetTextByKey("P_FR_UOM", "UOM"), valueIndex: 'Uom', allowFilter: true, css: { 'width': 80, 'text-align': 'left' } },
|
||||
{ name: 'UnitCost', caption: GetTextByKey("P_FR_UOMCOST", "Unit Cost"), allowFilter: true, valueIndex: 'UnitCost', css: { 'width': 80, 'text-align': 'right' } },
|
||||
{ name: 'TotalCost', caption: GetTextByKey("P_FR_TOTALCOST", "Total Cost"), allowFilter: true, valueIndex: 'TotalCost', css: { 'width': 80, 'text-align': 'right' } },
|
||||
{ name: 'Edit', caption: "", css: { 'width': 30, 'text-align': 'center' } },
|
||||
{ name: 'Delete', caption: "", css: { 'width': 30, 'text-align': 'center' } }
|
||||
];
|
||||
@ -190,8 +162,10 @@
|
||||
col.key = list_columns[hd].valueIndex;
|
||||
col.allowFilter = list_columns[hd].allowFilter;
|
||||
if (col.name === "Edit") {
|
||||
col.isurl = true;
|
||||
col.text = "\uf044";
|
||||
col.sortable = false;
|
||||
col.resizable = false;
|
||||
col.type = GridView.ColumnTypes.Icon;
|
||||
col.text = "edit";
|
||||
col.events = {
|
||||
onclick: function () {
|
||||
OnEdit();
|
||||
@ -203,8 +177,10 @@
|
||||
col.attrs = { 'title': GetTextByKey("P_FR_EDIT", 'Edit') };
|
||||
}
|
||||
else if (col.name === "Delete") {
|
||||
col.isurl = true;
|
||||
col.text = "\uf00d";
|
||||
col.sortable = false;
|
||||
col.resizable = false;
|
||||
col.type = GridView.ColumnTypes.Icon;
|
||||
col.text = "times";
|
||||
col.events = {
|
||||
onclick: function () {
|
||||
OnDelete(this);
|
||||
@ -222,16 +198,10 @@
|
||||
}
|
||||
columns.push(col);
|
||||
}
|
||||
grid_dt.canMultiSelect = false;
|
||||
grid_dt.multiSelect = false;
|
||||
grid_dt.columns = columns;
|
||||
grid_dt.init();
|
||||
grid_dt.rowdblclick = OnEdit;
|
||||
|
||||
grid_dt.selectedrowchanged = function (rowindex) {
|
||||
var rowdata = grid_dt.source[rowindex];
|
||||
if (rowdata) {
|
||||
}
|
||||
}
|
||||
grid_dt.onRowDblClicked = OnEdit;
|
||||
}
|
||||
|
||||
//执行iframe中函数
|
||||
@ -275,7 +245,7 @@
|
||||
showAlert(GetTextByKey("P_FR_PLEASESELECTAFUELRECORD", "Please select a fuel record."), GetTextByKey("P_FR_EDITFUELRECORD", "Edit Fuel Record"));
|
||||
return;
|
||||
}
|
||||
var record = grid_dt.source[index].Values;
|
||||
var record = grid_dt.source[index];
|
||||
if (!record)
|
||||
return;
|
||||
doIFrameFunc("init", [record], "iframfuelrecord");
|
||||
@ -308,26 +278,6 @@
|
||||
InitGridData();
|
||||
GetTypesData();
|
||||
|
||||
$('#startdatetxt').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]);
|
||||
}
|
||||
});
|
||||
|
||||
$('#enddatetxt').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]);
|
||||
}
|
||||
});
|
||||
|
||||
$('#searchinputtxt').keydown(enterKeydown);
|
||||
$('#typeselectinput').change(function () { OnRefresh(); });
|
||||
|
||||
@ -351,13 +301,26 @@
|
||||
}
|
||||
|
||||
function OnExport() {
|
||||
var begindate = $('#startdatetxt').val();
|
||||
var enddate = $('#enddatetxt').val();
|
||||
if (begindate && !$('#startdatetxt').is(':valid')) {
|
||||
showAlert(GetTextByKey('P_COMMON_BEGINDATEISINVALID', "The begin date is invalid."), GetTextByKey("P_FR_ERROR", 'Error'));
|
||||
return;
|
||||
}
|
||||
if (enddate && !$('#enddatetxt').is(':valid')) {
|
||||
showAlert(GetTextByKey('P_COMMON_ENDDATEISINVALID', "The end date is invalid."), GetTextByKey("P_FR_ERROR", 'Error'));
|
||||
return;
|
||||
}
|
||||
if (begindate && enddate && begindate > enddate) {
|
||||
showAlert(GetTextByKey("P_JS_ENDDATEMUSTBELATERTHANBEGINDATE", "End Date must be later than Begin Date."), GetTextByKey("P_FR_ERROR", 'Error'));
|
||||
return;
|
||||
}
|
||||
|
||||
var searchtxt = "";
|
||||
searchtxt = htmlencode($.trim($('#searchinputtxt').val()));
|
||||
var type = $('#typeselectinput').find("option:selected").val();
|
||||
var from = htmlencode($('#startdatetxt').val());
|
||||
var to = htmlencode($('#enddatetxt').val());
|
||||
var aid = (!assetid || assetid == "") ? -1 : eval(assetid);
|
||||
window.open("../ExportToFile.aspx?type=fuelrecordmanagement&t=" + searchtxt + "&from=" + from + "&to=" + to + "&tp=" + type + "&aid=" + aid);
|
||||
window.open("../ExportToFile.aspx?type=fuelrecordmanagement&t=" + searchtxt + "&from=" + begindate + "&to=" + enddate + "&tp=" + type + "&aid=" + aid);
|
||||
}
|
||||
|
||||
</script>
|
||||
@ -374,10 +337,10 @@
|
||||
<input type="password" autocomplete="new-password" style="display: none" />
|
||||
<span data-lgid="P_FR_BEGINDATE_COLON">Begin Date: </span>
|
||||
<span>
|
||||
<input id="startdatetxt" type="text" style="width: 100px;" value="<%=BeginDate %>" autocomplete="off" /></span>
|
||||
<input id="startdatetxt" type="date" class="type-date" required min="1900-01-01" value="<%=BeginDate %>" style="width: 100px;" autocomplete="off" /></span>
|
||||
<span data-lgid="P_FR_ENDDATE_COLON">End Date: </span>
|
||||
<span>
|
||||
<input id="enddatetxt" type="text" style="width: 100px;" value="<%=EndDate %>" autocomplete="off" /></span>
|
||||
<input id="enddatetxt" type="date" class="type-date" required min="1900-01-01" value="<%=EndDate %>" style="width: 100px;" autocomplete="off" /></span>
|
||||
<span data-lgid="P_FR_ASSETTYPE_COLON" style="padding-left: 5px;">Type:</span> <select class="selectinput" id="typeselectinput"></select>
|
||||
<input id="searchinputtxt" type="text" autocomplete="off" />
|
||||
<input class="search" type="button" onclick="OnRefresh();" value="Search" data-lgid="P_FR_SEARCH" style="margin-left: 5px;" />
|
||||
|
@ -42,8 +42,8 @@ public partial class Maintenance_FuelRecordManagement : FuelRecordBasePage
|
||||
InDialog = Request.Params["InDialog"] == "1";
|
||||
|
||||
DateTime userlocaldate = SystemParams.ConvertToUserTimeFromUtc(GetCurrentLoginSession().User, DateTime.UtcNow);
|
||||
BeginDate = userlocaldate.AddDays(-6).ToShortDateString();
|
||||
EndDate = userlocaldate.ToShortDateString();
|
||||
BeginDate = userlocaldate.AddDays(-6).ToString("yyyy-MM-dd");
|
||||
EndDate = userlocaldate.ToString("yyyy-MM-dd");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -16,20 +16,6 @@
|
||||
content: '\e631';
|
||||
}
|
||||
|
||||
.cupbutton {
|
||||
background-color: rgb(249, 189, 117);
|
||||
border: none;
|
||||
padding-top: 5px;
|
||||
padding-bottom: 5px;
|
||||
margin-left: 10px;
|
||||
cursor: pointer;
|
||||
width: 60px;
|
||||
}
|
||||
|
||||
.cupbutton:hover {
|
||||
background: #d7690E;
|
||||
}
|
||||
|
||||
.labeltdstyle {
|
||||
text-align: right;
|
||||
padding-top: 10px;
|
||||
@ -46,47 +32,6 @@
|
||||
color: #2140fb;
|
||||
}
|
||||
|
||||
.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: 150px;
|
||||
text-align: right;
|
||||
padding-right: 10px;
|
||||
line-height: 24px;
|
||||
height: 24px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.dialog-content table td input,
|
||||
.dialog-content table td textarea {
|
||||
border: 1px solid #a9a9a9;
|
||||
width: 200px;
|
||||
height: 18px;
|
||||
padding: 1px;
|
||||
}
|
||||
|
||||
.dialog-content table td input[type="checkbox"] {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.dialog-content table td textarea {
|
||||
height: 100px;
|
||||
max-width: 200px;
|
||||
}
|
||||
|
||||
#dialogdatatb td {
|
||||
padding-top: 5px;
|
||||
}
|
||||
@ -107,7 +52,6 @@
|
||||
</style>
|
||||
<script src="../js/jquery.datetimepicker.full.js"></script>
|
||||
<script src="<%=GetFileUrlWithVersion("js/inputdatactr.js")%>" type="text/javascript"></script>
|
||||
<script src="<%=GetFileUrlWithVersion("../js/editableselect.js")%>" type="text/javascript"></script>
|
||||
<%--<script src="<%=GetFileUrlWithVersion("js/attachments.js")%>" type="text/javascript"></script>--%>
|
||||
<script type="text/javascript">
|
||||
|
||||
@ -277,11 +221,11 @@
|
||||
}
|
||||
|
||||
function GetRecordesbymachineID() {
|
||||
showloading(true);
|
||||
if ($('#mid').val() == "") {
|
||||
showAlert(GetTextByKey("P_MRM_SAVEWORKORDERFIRST", "Please select an Asset."), GetTextByKey("P_MRM_SYSTEMINFORMATION", "System Information"));
|
||||
return false;
|
||||
}
|
||||
showloading(true);
|
||||
$.ajax(
|
||||
{
|
||||
type: "POST",
|
||||
@ -327,20 +271,14 @@
|
||||
r[j] = { DisplayValue: r["StrForMaintenanceDate"], Value: r[j] };
|
||||
}
|
||||
}
|
||||
var fr = { Values: r };
|
||||
rows.push(fr);
|
||||
rows.push(r);
|
||||
}
|
||||
|
||||
grid_dt.setData(rows);
|
||||
}
|
||||
var grid_dt;
|
||||
function InitGridData() {
|
||||
grid_dt = new GridView('#recordlist');
|
||||
grid_dt.lang = {
|
||||
all: GetTextByKey("P_GRID_ALL", "(All)"),
|
||||
ok: GetTextByKey("P_GRID_OK", "OK"),
|
||||
reset: GetTextByKey("P_GRID_RESET", "Reset")
|
||||
};
|
||||
grid_dt = createGridView('#recordlist');
|
||||
var list_columns = [
|
||||
{ name: 'MaintenanceDate', caption: GetTextByKey("P_MRM_DATE", "Date"), valueIndex: 'MaintenanceDate', css: { 'width': 90, 'text-align': 'left' } },
|
||||
{ name: 'LogType', caption: GetTextByKey("P_MRM_MAINTENANCETYPE", "Maintenance Type"), valueIndex: 'LogType', css: { 'width': 120, 'text-align': 'left' } },
|
||||
@ -366,8 +304,10 @@
|
||||
col.align = list_columns[hd].css["text-align"]
|
||||
col.key = list_columns[hd].valueIndex;
|
||||
if (col.name === "Edit") {
|
||||
col.isurl = true;
|
||||
col.text = "\uf044";
|
||||
col.sortable = false;
|
||||
col.resizable = false;
|
||||
col.type = GridView.ColumnTypes.Icon;
|
||||
col.text = "edit";
|
||||
col.events = {
|
||||
onclick: function () {
|
||||
OnEdit();
|
||||
@ -379,8 +319,10 @@
|
||||
col.attrs = { 'title': GetTextByKey("P_MRM_EDIT", 'Edit') };
|
||||
}
|
||||
else if (col.name === "Delete") {
|
||||
col.isurl = true;
|
||||
col.text = "\uf00d";
|
||||
col.sortable = false;
|
||||
col.resizable = false;
|
||||
col.type = GridView.ColumnTypes.Icon;
|
||||
col.text = "times";
|
||||
col.events = {
|
||||
onclick: function () {
|
||||
OnDelete(this);
|
||||
@ -393,16 +335,10 @@
|
||||
}
|
||||
columns.push(col);
|
||||
}
|
||||
grid_dt.canMultiSelect = false;
|
||||
grid_dt.multiSelect = false;
|
||||
grid_dt.columns = columns;
|
||||
grid_dt.init();
|
||||
grid_dt.rowdblclick = OnEdit;
|
||||
|
||||
grid_dt.selectedrowchanged = function (rowindex) {
|
||||
var rowdata = grid_dt.source[rowindex];
|
||||
if (rowdata) {
|
||||
}
|
||||
}
|
||||
grid_dt.onRowDblClicked = OnEdit;
|
||||
}
|
||||
|
||||
|
||||
@ -510,7 +446,7 @@
|
||||
.showDialogRight();
|
||||
}
|
||||
function OnEdit() {
|
||||
var record = grid_dt.source[grid_dt.selectedIndex].Values;
|
||||
var record = grid_dt.source[grid_dt.selectedIndex];
|
||||
|
||||
doIFrameFunc("init", [record.MachineID, record.MaintenanceID], "iframemaintenancerecord");
|
||||
|
||||
@ -562,7 +498,7 @@
|
||||
<span style="margin-left: 10px;" data-lgid="P_MRM_TYPE_COLON">Type: </span>
|
||||
<select class="selectinput" id="typeselectinput" style="width: 150px;"></select>
|
||||
<input id="searchinputtxt" autocomplete="off" style="width: 500px; padding: 0px; height: 18px; margin: 0px; border: 1px solid #b0b0b0;" />
|
||||
<input class="search cupbutton" type="button" onclick="OnSearch();" value="Search" data-lgid="P_MRM_SEARCH" />
|
||||
<input class="funcctionbtn" type="button" onclick="OnSearch();" value="Search" data-lgid="P_MRM_SEARCH" />
|
||||
<span id="currentmachineID"></span>
|
||||
<div style="position: absolute; top: -10px; left: 10px; background-color: Window;" data-lgid="P_MRM_SEARCHASSET">Search Asset</div>
|
||||
<div id="dropDIV" style="border: 1px solid #b0b0b0; width: 500px; height: 400px; overflow: auto; position: absolute; top: 43px; left: 200px; background-color: Window; display: none; z-index: 10;">
|
||||
@ -616,8 +552,8 @@
|
||||
</div>
|
||||
<div style="border: 1px solid #b0b0b0; position: relative; padding-top: 0px; padding-bottom: 10px;">
|
||||
<div style="float: right; margin-top: 10px; margin-bottom: 10px; padding-right: 20px;">
|
||||
<input type="button" class="cupbutton" onclick="OnAdd();" value="Add" data-lgid="P_MRM_ADD" />
|
||||
<input type="button" class="cupbutton" onclick="GetRecordesbymachineID();" value="Refresh" data-lgid="P_MRM_REFRESH" />
|
||||
<input type="button" class="funcctionbtn" onclick="OnAdd();" value="Add" data-lgid="P_MRM_ADD" />
|
||||
<input type="button" class="funcctionbtn" onclick="GetRecordesbymachineID();" value="Refresh" data-lgid="P_MRM_REFRESH" />
|
||||
</div>
|
||||
<div id="recordlist" style="margin-top: 50px;"></div>
|
||||
<div style="position: absolute; top: -10px; left: 10px; background-color: Window;" data-lgid="P_MAINTENANCERECORDS">Maintenance Records</div>
|
||||
|
@ -1,44 +1,12 @@
|
||||
<%@ Page Title="" Language="C#" MasterPageFile="~/Maintenance/MaintenanceBase.master" AutoEventWireup="true" CodeFile="MaintanceRecordsManagement.aspx.cs" Inherits="Maintenance_MaintanceRecordsManagement" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
|
||||
<link href="../css/jquery.datetimepicker.css" rel="stylesheet" />
|
||||
<style type="text/css">
|
||||
.selectinput {
|
||||
width: 150px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.dialog-content table {
|
||||
border-collapse: collapse;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.dialog-content table td.label {
|
||||
width: 150px;
|
||||
text-align: right;
|
||||
padding-right: 10px;
|
||||
line-height: 24px;
|
||||
height: 24px;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.dialog-content table td input,
|
||||
.dialog-content table td textarea {
|
||||
border: 1px solid #a9a9a9;
|
||||
width: 200px;
|
||||
height: 18px;
|
||||
padding: 1px;
|
||||
}
|
||||
|
||||
.dialog-content table td input[type="checkbox"] {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.dialog-content table td textarea {
|
||||
height: 100px;
|
||||
max-width: 200px;
|
||||
}
|
||||
|
||||
#dialogdatatb td {
|
||||
padding-top: 5px;
|
||||
}
|
||||
@ -48,13 +16,11 @@
|
||||
color: #2140fb;
|
||||
}
|
||||
</style>
|
||||
<script src="../js/jquery.datetimepicker.full.js"></script>
|
||||
<script src="<%=GetFileUrlWithVersion("js/inputdatactr.js")%>" type="text/javascript"></script>
|
||||
<script src="<%=GetFileUrlWithVersion("../js/editableselect.js")%>" type="text/javascript"></script>
|
||||
<script type="text/javascript">
|
||||
var recorddata;
|
||||
var assetid = "<%=AssetID %>";
|
||||
|
||||
|
||||
$(function () {
|
||||
setPageTitle(GetTextByKey("P_MAINTENANCERECORDSMANAGEMENT", "Maintenance Records Management"), true);
|
||||
InitGridData();
|
||||
@ -70,25 +36,6 @@
|
||||
$('#dateformatspan').css('display', 'none');
|
||||
}
|
||||
})
|
||||
$('#startdatetxt').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]);
|
||||
}
|
||||
});
|
||||
|
||||
$('#enddatetxt').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_mdate').datetimepicker({
|
||||
timepicker: false,
|
||||
format: 'm/d/Y',
|
||||
@ -143,6 +90,21 @@
|
||||
)
|
||||
}
|
||||
function GetRecordes() {
|
||||
var begindate = $('#startdatetxt').val();
|
||||
var enddate = $('#enddatetxt').val();
|
||||
if (begindate && !$('#startdatetxt').is(':valid')) {
|
||||
showAlert(GetTextByKey('P_COMMON_BEGINDATEISINVALID', "The begin date is invalid."), GetTextByKey("P_FR_ERROR", 'Error'));
|
||||
return;
|
||||
}
|
||||
if (enddate && !$('#enddatetxt').is(':valid')) {
|
||||
showAlert(GetTextByKey('P_COMMON_ENDDATEISINVALID', "The end date is invalid."), GetTextByKey("P_FR_ERROR", 'Error'));
|
||||
return;
|
||||
}
|
||||
if (begindate && enddate && begindate > enddate) {
|
||||
showAlert(GetTextByKey("P_JS_ENDDATEMUSTBELATERTHANBEGINDATE", "End Date must be later than Begin Date."), GetTextByKey("P_FR_ERROR", 'Error'));
|
||||
return;
|
||||
}
|
||||
|
||||
showloading(true);
|
||||
$.ajax(
|
||||
{
|
||||
@ -157,8 +119,8 @@
|
||||
searchtxt: encodeURIComponent($.trim($('#searchinputtxt').val())),
|
||||
sortype: encodeURIComponent($.trim($('#maintance_type').val())),
|
||||
sortdata: encodeURIComponent($.trim($('#maintance_sort').val())),
|
||||
startdate: encodeURIComponent($.trim($('#startdatetxt').val())),
|
||||
enddate: encodeURIComponent($.trim($('#enddatetxt').val())),
|
||||
startdate: encodeURIComponent(begindate),
|
||||
enddate: encodeURIComponent(enddate),
|
||||
MethodName: "GetRecords"
|
||||
},
|
||||
success: function (datastr) {
|
||||
@ -201,20 +163,14 @@
|
||||
r[j] = r[j] <= 0 ? "" : r[j];
|
||||
}
|
||||
}
|
||||
var fr = { Values: r };
|
||||
rows.push(fr);
|
||||
rows.push(r);
|
||||
}
|
||||
|
||||
grid_dt.setData(rows);
|
||||
}
|
||||
var grid_dt;
|
||||
function InitGridData() {
|
||||
grid_dt = new GridView('#recordlist');
|
||||
grid_dt.lang = {
|
||||
all: GetTextByKey("P_GRID_ALL", "(All)"),
|
||||
ok: GetTextByKey("P_GRID_OK", "OK"),
|
||||
reset: GetTextByKey("P_GRID_RESET", "Reset")
|
||||
};
|
||||
grid_dt = createGridView('#recordlist');
|
||||
var list_columns = [
|
||||
{ name: 'MachineID', caption: GetTextByKey("P_MRM_ASSETID", "Asset ID"), valueIndex: 'MachineID', css: { 'width': 120, 'text-align': 'left' } },
|
||||
{ name: 'MachinePin', caption: GetTextByKey("P_MRM_SN", "SN"), valueIndex: 'MachinePin', css: { 'width': 200, 'text-align': 'left' } },
|
||||
@ -252,8 +208,10 @@
|
||||
col.key = list_columns[hd].valueIndex;
|
||||
col.allowFilter = list_columns[hd].allowFilter;
|
||||
if (col.name === "Attachment") {
|
||||
//col.isurl = true;
|
||||
col.text = "\uf0c6";
|
||||
col.sortable = false;
|
||||
col.resizable = false;
|
||||
col.type = GridView.ColumnTypes.Icon;
|
||||
col.text = "paperclip";
|
||||
col.classFilter = function (e) {
|
||||
return "icon-col";
|
||||
}
|
||||
@ -266,8 +224,10 @@
|
||||
col.attrs = { 'title': GetTextByKey("P_MRM_ATTACHMENT", 'Attachment') };
|
||||
}
|
||||
else if (col.name === "Edit") {
|
||||
col.isurl = true;
|
||||
col.text = "\uf044";
|
||||
col.sortable = false;
|
||||
col.resizable = false;
|
||||
col.type = GridView.ColumnTypes.Icon;
|
||||
col.text = "edit";
|
||||
col.events = {
|
||||
onclick: function () {
|
||||
OnEdit();
|
||||
@ -279,8 +239,10 @@
|
||||
col.attrs = { 'title': GetTextByKey("P_MRM_EDIT", 'Edit') };
|
||||
}
|
||||
else if (col.name === "Delete") {
|
||||
col.isurl = true;
|
||||
col.text = "\uf00d";
|
||||
col.sortable = false;
|
||||
col.resizable = false;
|
||||
col.type = GridView.ColumnTypes.Icon;
|
||||
col.text = "times";
|
||||
col.events = {
|
||||
onclick: function () {
|
||||
OnDelete(this);
|
||||
@ -293,16 +255,10 @@
|
||||
}
|
||||
columns.push(col);
|
||||
}
|
||||
grid_dt.canMultiSelect = false;
|
||||
grid_dt.multiSelect = false;
|
||||
grid_dt.columns = columns;
|
||||
grid_dt.init();
|
||||
grid_dt.rowdblclick = OnEdit;
|
||||
|
||||
grid_dt.selectedrowchanged = function (rowindex) {
|
||||
var rowdata = grid_dt.source[rowindex];
|
||||
if (rowdata) {
|
||||
}
|
||||
}
|
||||
grid_dt.onRowDblClicked = OnEdit;
|
||||
}
|
||||
|
||||
//执行iframe中函数
|
||||
@ -343,7 +299,7 @@
|
||||
OnEdit();
|
||||
}
|
||||
function OnEdit() {
|
||||
var record = grid_dt.source[grid_dt.selectedIndex].Values;
|
||||
var record = grid_dt.source[grid_dt.selectedIndex];
|
||||
|
||||
doIFrameFunc("init", [record.MachineID, record.MaintenanceID], "iframemaintenancerecord");
|
||||
|
||||
@ -387,15 +343,28 @@
|
||||
}
|
||||
|
||||
function OnExport() {
|
||||
var begindate = $('#startdatetxt').val();
|
||||
var enddate = $('#enddatetxt').val();
|
||||
if (begindate && !$('#startdatetxt').is(':valid')) {
|
||||
showAlert(GetTextByKey('P_COMMON_BEGINDATEISINVALID', "The begin date is invalid."), GetTextByKey("P_FR_ERROR", 'Error'));
|
||||
return;
|
||||
}
|
||||
if (enddate && !$('#enddatetxt').is(':valid')) {
|
||||
showAlert(GetTextByKey('P_COMMON_ENDDATEISINVALID', "The end date is invalid."), GetTextByKey("P_FR_ERROR", 'Error'));
|
||||
return;
|
||||
}
|
||||
if (begindate && enddate && begindate > enddate) {
|
||||
showAlert(GetTextByKey("P_JS_ENDDATEMUSTBELATERTHANBEGINDATE", "End Date must be later than Begin Date."), GetTextByKey("P_FR_ERROR", 'Error'));
|
||||
return;
|
||||
}
|
||||
|
||||
var maintenancetype = "Hours";
|
||||
var type = $('#typeselectinput').find("option:selected").val();
|
||||
var searchtxt = encodeURIComponent($.trim($('#searchinputtxt').val()));
|
||||
var sortype = encodeURIComponent($.trim($('#maintance_type').val()));
|
||||
var sortdata = encodeURIComponent($.trim($('#maintance_sort').val()));
|
||||
var startdate = encodeURIComponent($.trim($('#startdatetxt').val()));
|
||||
var enddate = encodeURIComponent($.trim($('#enddatetxt').val()));
|
||||
|
||||
var p = [assetid, maintenancetype, type, searchtxt, sortype, sortdata, startdate, enddate];
|
||||
var p = [assetid, maintenancetype, type, searchtxt, sortype, sortdata, encodeURIComponent(begindate), encodeURIComponent(enddate)];
|
||||
var param = htmlencode(JSON.stringify(p));
|
||||
window.open("../ExportToFile.aspx?type=maintenancerecords¶m=" + param);
|
||||
}
|
||||
@ -409,10 +378,10 @@
|
||||
<input type="password" autocomplete="new-password" style="display: none" />
|
||||
<span style="padding-left: 5px;" data-lgid="P_FR_BEGINDATE_COLON">Begin Date: </span>
|
||||
<span>
|
||||
<input id="startdatetxt" style="width: 100px;" value="<%=BeginDate %>" autocomplete="off" /></span>
|
||||
<input id="startdatetxt" type="date" class="type-date" required min="1900-01-01" style="width: 100px;" value="<%=BeginDate %>" autocomplete="off" /></span>
|
||||
<span style="padding-left: 5px;" data-lgid="P_FR_ENDDATE_COLON">End Date: </span>
|
||||
<span>
|
||||
<input id="enddatetxt" style="width: 100px;" value="<%=EndDate %>" autocomplete="off" /></span>
|
||||
<input id="enddatetxt" type="date" class="type-date" required min="1900-01-01" style="width: 100px;" value="<%=EndDate %>" autocomplete="off" /></span>
|
||||
<span style="padding-left: 5px;" data-lgid="P_MRM_TYPE_COLON">Type:</span> <select class="selectinput" id="typeselectinput"></select>
|
||||
<input id="searchinputtxt" autocomplete="off" />
|
||||
<input class="search" type="button" onclick="GetRecordes();" value="Search" data-lgid="P_MRM_SEARCH" />
|
||||
@ -426,7 +395,9 @@
|
||||
<div class="clear"></div>
|
||||
<div id="recordlist"></div>
|
||||
</div>
|
||||
<div id="mask_bg" style="display: none;"><div class="loading c-spin"></div></div>
|
||||
<div id="mask_bg" style="display: none;">
|
||||
<div class="loading c-spin"></div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="dialog" id="dialog_maintenancerecord" style="display: none; height: 100%; border-bottom: 0; border-top: 0;">
|
||||
|
@ -42,8 +42,8 @@ public partial class Maintenance_MaintanceRecordsManagement : MaintanceRecordsBa
|
||||
InDialog = Request.Params["InDialog"] == "1";
|
||||
|
||||
DateTime userlocaldate = SystemParams.ConvertToUserTimeFromUtc(GetCurrentLoginSession().User, DateTime.UtcNow);
|
||||
BeginDate = userlocaldate.AddDays(-6).ToShortDateString();
|
||||
EndDate = userlocaldate.ToShortDateString();
|
||||
BeginDate = userlocaldate.AddDays(-6).ToString("yyyy-MM-dd");
|
||||
EndDate = userlocaldate.ToString("yyyy-MM-dd");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -104,7 +104,7 @@
|
||||
var item = items[i];
|
||||
if (!item) continue;
|
||||
var li = $('<li></li>');
|
||||
var a = $('<a></a>').append($("<span></span>").text(item.Title));
|
||||
var a = $('<a></a>').append($("<span></span>").text(getNavInfoByID(item.ID, item.Title, null)));
|
||||
a.attr('href', '#' + item.ID);
|
||||
li.append(a);
|
||||
ulsubmenus.append(li);
|
||||
@ -120,6 +120,10 @@
|
||||
title = GetTextByKey("P_ALERTSMANAGEMENTNEW", title);
|
||||
$(icon).addClass("iconmanagealerts");
|
||||
}
|
||||
else if (id === "nav_alertsmappings") {
|
||||
title = GetTextByKey("P_ALERTMAPPINGS", title);
|
||||
$(icon).addClass("iconalertsmappings");
|
||||
}
|
||||
else if (id === "nav_workorder") {
|
||||
title = GetTextByKey("P_WORKORDERNEW", title);
|
||||
$(icon).addClass("iconworkorder");
|
||||
|
@ -6,12 +6,10 @@
|
||||
<head runat="server">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
<title></title>
|
||||
<link type="text/css" href="<%=GetUrl("js/components/css/gridview.css") %>" rel="stylesheet" />
|
||||
<link type="text/css" href="<%=GetUrl("js/lib/ui.min.css") %>" rel="stylesheet" />
|
||||
<link type="text/css" href="<%=GetUrl("css/override.css") %>" rel="stylesheet" />
|
||||
<link rel="stylesheet" href="<%=GetUrl("css/default.css")%>" type="text/css" />
|
||||
<link rel="stylesheet" href="<%=GetUrl("css/split_sub.css")%>" type="text/css" />
|
||||
<link rel="stylesheet" href="<%=GetUrl("css/editmultiselect.css")%>" type="text/css" />
|
||||
<link rel="stylesheet" href="<%=GetUrl("js/lib/app.min.css") %>" type="text/css" />
|
||||
<style type="text/css">
|
||||
:root { <%=StyleVariables%> }
|
||||
@ -34,17 +32,12 @@
|
||||
<script src="<%=GetUrl("js/jquery-3.6.0.min.js")%>" type="text/javascript"></script>
|
||||
<script src="<%=GetUrl("js/cookie.js")%>" type="text/javascript"></script>
|
||||
<script src="<%=GetUrl("js/utility.js")%>" type="text/javascript"></script>
|
||||
<script src="<%=GetUrl("js/editmultiselect.js")%>" type="text/javascript"></script>
|
||||
<script type="text/javascript" src="<%=GetUrl("js/components/gridview.js") %>"></script>
|
||||
<script type="text/javascript" src="<%=GetUrl("js/language.js") %>"></script>
|
||||
<script type="text/javascript">
|
||||
var canExport = <%= CanExportFile %>;
|
||||
var GridView = window.GridView || window['g5-gridview'];
|
||||
var GridView = window['lib-ui'].Grid;
|
||||
_network.root = '<%=Page.ResolveUrl("~/")%>';
|
||||
consts = {
|
||||
path: _network.root
|
||||
};
|
||||
|
||||
|
||||
function getText(s, flag) {
|
||||
return (s == null)
|
||||
? (flag ? '<i>null</i>' : '')
|
||||
@ -59,6 +52,7 @@
|
||||
return lang;
|
||||
}
|
||||
}
|
||||
_fleet.currentLang = GetLanguageByCookie();
|
||||
|
||||
function systemrequest(method, param, callback, error) {
|
||||
_network.request("SystemSettings/SystemOptions.aspx", -1, method, param, callback, error || function (e) {
|
||||
@ -76,7 +70,6 @@
|
||||
}
|
||||
|
||||
$(function () {
|
||||
_fleet.currentLang = GetLanguageByCookie();
|
||||
GetSystemUnitOfOdometer();
|
||||
$("#content1").applyFleetLanguageText(true);
|
||||
|
||||
|
@ -75,21 +75,22 @@
|
||||
showAlert('An unknown error occurred. Please refresh page.', 'Query');
|
||||
showAlert(GetTextByKey('P_PM_PAGEERROR', 'An unknown error occurred. Please refresh page.'), GetTextByKey('P_PM_QUERY', 'Query'));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function getIntervalLabel(type, unit) {
|
||||
switch (type) {
|
||||
case "TBM": return "Days"; break;
|
||||
case "TBM": return GetTextByKey("P_WO_DAYS", 'Days'); break;
|
||||
case "ADM":
|
||||
case "RDM":
|
||||
if (unit === "Kilometre")
|
||||
return "Kilometres"
|
||||
return GetTextByKey("P_PM_KILOMETERS", 'Kilometers');
|
||||
else
|
||||
return "Miles";
|
||||
return GetTextByKey("P_PM_MILES", 'Miles');
|
||||
break;
|
||||
default: return "Hours"; break;
|
||||
default: return GetTextByKey("P_PM_HOURS", 'Hours');
|
||||
}
|
||||
}
|
||||
|
||||
function OnAdd() {
|
||||
window.location.href = 'ScheduleDetail.aspx?TP=ADM';
|
||||
}
|
||||
@ -159,26 +160,45 @@
|
||||
showloading(false);
|
||||
});
|
||||
}
|
||||
function getPmScheduleTypeText(pmtype) {
|
||||
var text = "";
|
||||
if (pmtype === 'ADM')
|
||||
text = GetTextByKey('P_PM_ABSOLUTEDISTANCE', 'Absolute Distance');
|
||||
if (pmtype === 'PM')
|
||||
text = GetTextByKey('P_PM_ABSOLUTEHOURS', 'Absolute Hours');
|
||||
if (pmtype === 'RDM')
|
||||
text = GetTextByKey('P_PM_RELATIVEDISTANCE', 'Relative Distance');
|
||||
if (pmtype === 'HM')
|
||||
text = GetTextByKey('P_PM_RELATIVEEHOURS', 'Relative Hours');
|
||||
if (pmtype === 'TBM')
|
||||
text = GetTextByKey('P_PM_RELATIVEETIME', 'Relative Time');
|
||||
|
||||
return text;
|
||||
}
|
||||
|
||||
function createItem(trs, item) {
|
||||
var tr = $('<tr></tr>').attr('data-id', item.PmScheduleID);
|
||||
var td = $('<td></td>').css('width', 340);
|
||||
td.append($('<em class="icon collapse"></em>').click(collapse));
|
||||
td.append($('<em class="icon collapse" style="line-height:20px;"></em>').click(collapse));
|
||||
td.append($('<div class="item_name"></div>').html(getText(item.PmScheduleName)).attr('title', item.PmScheduleName));
|
||||
tr.append(td);
|
||||
td = $('<td></td>');
|
||||
td.append($('<div class="item_desc"></div>').html(getText(item.Notes)).attr('title', item.Notes));
|
||||
tr.append(td);
|
||||
td = $('<td></td>');
|
||||
td.append($('<div class="item_type"></div>').html(getText(item.PmScheduleTypeStr)).attr('title', item.PmScheduleTypeStr));
|
||||
var pmscheduletypetext = getPmScheduleTypeText(item.PmScheduleType);
|
||||
td.append($('<div class="item_type"></div>').html(getText(pmscheduletypetext)).attr('title', pmscheduletypetext));
|
||||
tr.append(td);
|
||||
td = $('<td class="td_funcs"></td>').css({ 'width': 70, 'min-width': 70 });
|
||||
td = $('<td></td>');
|
||||
td.append($('<div class="item_type" style="color: red"></div>').text(item.Enabled ? '' : GetTextByKey("P_PM_DISABLED", "Disabled")));
|
||||
tr.append(td);
|
||||
td = $('<td class="td_funcs"></td>').css({ 'width': 70, 'min-width': 70, 'padding-right': 10 });
|
||||
td.append($('<a onclick="return false;">' + GetTextByKey("P_PM_DELETE", "Delete") + '</a>').click(deleteItem));
|
||||
tr.append(td);
|
||||
td = $('<td class="td_funcs"></td>').css({ 'width': 120, 'min-width': 120 });
|
||||
td = $('<td class="td_funcs"></td>').css({ 'width': 120, 'min-width': 120, 'padding-right': 10 });
|
||||
td.append($('<a onclick="return false;">' + GetTextByKey("P_PM_MANAGESCHEDULE", "Manage schedule") + '</a>').click(editItem));
|
||||
tr.append(td);
|
||||
td = $('<td class="td_funcs"></td>').css({ 'width': 120, 'min-width': 120 });
|
||||
td = $('<td class="td_funcs"></td>').css({ 'width': 120, 'min-width': 120, 'padding-right': 10 });
|
||||
var a = $('<a onclick="return false;">' + GetTextByKey("P_PM_MANAGEASSETS", "Manage assets") + '</a>');
|
||||
if (item.Intervals && item.Intervals.length > 0) {
|
||||
a.click(editItemMachine);
|
||||
@ -282,6 +302,24 @@
|
||||
}
|
||||
}
|
||||
|
||||
function CloseWOPlansDialog(type) {
|
||||
$('#dialog_plans').hideDialog();
|
||||
showmaskbg(false);
|
||||
//refreshData();
|
||||
}
|
||||
|
||||
function ShowWOPlansDialog(type) {
|
||||
showmaskbg(true);
|
||||
$('#dialog_plans')
|
||||
.attr('act', type)
|
||||
.showDialogRight();
|
||||
}
|
||||
|
||||
function openPlans() {
|
||||
$('#iframeworkorderplans').attr('src', 'WorkOrderPlansManagement.aspx');
|
||||
ShowWOPlansDialog();
|
||||
}
|
||||
|
||||
$(function () {
|
||||
setPageTitle(GetTextByKey("P_PM_MAINTENANCESCHEDULES", "Maintenance Schedules"), true);
|
||||
$('#sel_plantype').change(refreshData);
|
||||
@ -289,19 +327,21 @@
|
||||
|
||||
$("#expandintervals").click(function (e) {
|
||||
var btn = $(this);
|
||||
if (btn.text() == "Expand Intervals") {
|
||||
if (btn.attr("Expand") !== "0") {
|
||||
btn.attr("Expand", "0");
|
||||
btn.removeClass("iconadd");
|
||||
btn.addClass("iconreduce");
|
||||
btn.text("Collapse Intervals");
|
||||
btn.text(GetTextByKey("P_PM_COLLAPSEINTERVALS", "Collapse Intervals"));
|
||||
$('#pm_tbody').find(".icon").each(function () {
|
||||
if ($(this).hasClass("collapse"))
|
||||
$(this).click();
|
||||
});
|
||||
}
|
||||
else {
|
||||
btn.attr("Expand", "1");
|
||||
btn.removeClass("iconreduce");
|
||||
btn.addClass("iconadd");
|
||||
btn.text("Expand Intervals");
|
||||
btn.text(GetTextByKey("P_PM_EXPANDINTERVALS", "Expand Intervals"));
|
||||
$('#pm_tbody').find(".icon").each(function () {
|
||||
if ($(this).hasClass("expand"))
|
||||
$(this).click();
|
||||
@ -325,18 +365,26 @@
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
|
||||
<div style="min-width: 850px;">
|
||||
<div class="page_title" data-lgid="P_PM_MAINTENANCESCHEDULES">Maintenance Schedules</div>
|
||||
<div class="page_title">
|
||||
<span data-lgid="P_PM_MAINTENANCESCHEDULES">Maintenance Schedules</span>
|
||||
<% if (!IsForesightUser)
|
||||
{ %>
|
||||
<span class="sbutton iconcog" style="float: right; font-size: 14px; cursor: pointer" onclick="openPlans();">
|
||||
<label data-lgid="P_WO_PLANS">Plans</label></span>
|
||||
<% } %>
|
||||
<div style="clear: both;"></div>
|
||||
</div>
|
||||
<div class="search_bar">
|
||||
<input type="password" autocomplete="new-password" style="display: none" />
|
||||
<span style="padding-left: 5px;" data-lgid="P_PM_PLAN_COLON">Plan:</span> <select class="selectinput" id="sel_plan"></select>
|
||||
<span style="padding-left: 5px;" data-lgid="P_PM_PLANTYPE_COLON">Plan Type:</span>
|
||||
<select class="selectinput" id="sel_plantype">
|
||||
<option value=""></option>
|
||||
<option value="ADM">Absolute Distance</option>
|
||||
<option value="PM">Absolute Hours</option>
|
||||
<option value="RDM">Relative Distance</option>
|
||||
<option value="HM">Relative Hours</option>
|
||||
<option value="TBM">Relative Time</option>
|
||||
<option value="ADM" data-lgid="P_PM_ABSOLUTEDISTANCE">Absolute Distance</option>
|
||||
<option value="PM" data-lgid="P_PM_ABSOLUTEHOURS">Absolute Hours</option>
|
||||
<option value="RDM" data-lgid="P_PM_RELATIVEDISTANCE">Relative Distance</option>
|
||||
<option value="HM" data-lgid="P_PM_RELATIVEEHOURS">Relative Hours</option>
|
||||
<option value="TBM" data-lgid="P_PM_RELATIVEETIME">Relative Time</option>
|
||||
</select>
|
||||
<span style="padding-left: 5px;" data-lgid="P_PM_ASSET_COLON">Asset:</span>
|
||||
<input id="searchinputtxt" type="text" autocomplete="off" />
|
||||
@ -353,9 +401,11 @@
|
||||
<tbody id="pm_tbody"></tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div id="mask_bg" style="display: none;"><div class="loading c-spin"></div></div>
|
||||
<div id="mask_bg" style="display: none;">
|
||||
<div class="loading c-spin"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="dialog" id="dialog_interval" style="display: none; ">
|
||||
<div class="dialog" id="dialog_interval" style="display: none;">
|
||||
<div class="dialog-title"><span class="title" data-lgid="P_PM_ADDABSOLUTEHOURSINTERVAL">Add Absolute Hours Interval</span><em class="dialog-close"></em></div>
|
||||
<div class="dialog-content">
|
||||
<table class="dialog_table">
|
||||
@ -403,5 +453,10 @@
|
||||
</div>
|
||||
<div class="maskbg" style="display: none;"></div>
|
||||
</div>
|
||||
|
||||
<div class="dialog" id="dialog_plans" style="display: none; height: 100%; border-bottom: 0; border-top: 0">
|
||||
<iframe id="iframeworkorderplans" style="width: 100%; height: 100%; display: block; border: none"></iframe>
|
||||
<div class="maskbg" style="display: none"></div>
|
||||
</div>
|
||||
</asp:Content>
|
||||
|
||||
|
@ -11,6 +11,8 @@ using System.Web.UI.WebControls;
|
||||
public partial class MaintenanceSchedulesManagement : PreventativeMaintenanceBasePage
|
||||
{
|
||||
public string CurrentDate = "";
|
||||
protected bool IsForesightUser = false;
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!CheckLoginSession())
|
||||
@ -36,7 +38,9 @@ public partial class MaintenanceSchedulesManagement : PreventativeMaintenanceBas
|
||||
RedirectToLoginPage();
|
||||
}
|
||||
}
|
||||
DateTime userlocaldate = SystemParams.ConvertToUserTimeFromUtc(GetCurrentLoginSession().User, DateTime.UtcNow);
|
||||
var user = GetCurrentLoginSession().User;
|
||||
IsForesightUser = user.IsForesightUser;
|
||||
DateTime userlocaldate = SystemParams.ConvertToUserTimeFromUtc(user, DateTime.UtcNow);
|
||||
CurrentDate = userlocaldate.ToShortDateString();
|
||||
}
|
||||
}
|
@ -70,26 +70,25 @@
|
||||
</style>
|
||||
<script src="<%=GetFileUrlWithVersion("js/controls.js")%>" type="text/javascript"></script>
|
||||
<script src="<%=GetFileUrlWithVersion("js/schedule.js")%>" type="text/javascript"></script>
|
||||
<script src="<%=GetFileUrlWithVersion("../js/editableselect.js")%>"></script>
|
||||
<script type="text/javascript">
|
||||
|
||||
var iid = '<%=IID%>';
|
||||
var scheduleUom = '<%=PmScheduleUom%>';
|
||||
var scheduletype = '<%=ScheduleType%>';
|
||||
var interval_label = getIntervalLabel();
|
||||
var currentdate = "<%=CurrentDate %>";
|
||||
var currentdate = "<%=CurrentDate %>";
|
||||
|
||||
function getIntervalLabel() {
|
||||
switch (scheduletype) {
|
||||
case "TBM": return "Days"; break;
|
||||
case "TBM": return GetTextByKey("P_WO_DAYS", 'Days'); break;
|
||||
case "ADM":
|
||||
case "RDM":
|
||||
if (scheduleUom === "Kilometre")
|
||||
return "Kilometres"
|
||||
return GetTextByKey("P_PM_KILOMETERS", 'Kilometers');
|
||||
else
|
||||
return "Miles";
|
||||
return GetTextByKey("P_PM_MILES", 'Miles');
|
||||
break;
|
||||
default: return "Hours"; break;
|
||||
default: return GetTextByKey("P_PM_HOURS", 'Hours');
|
||||
}
|
||||
}
|
||||
|
||||
@ -123,7 +122,8 @@
|
||||
'Type': $('#sc_plantype').val(),
|
||||
'Notes': notes,
|
||||
'ScheduleUom': scheduleUom,
|
||||
'Intervals': []
|
||||
'Intervals': [],
|
||||
'Enabled': $('#sc_enabled').prop('checked')
|
||||
};
|
||||
|
||||
|
||||
@ -208,7 +208,6 @@
|
||||
next();
|
||||
}
|
||||
|
||||
var editableSelectSchedule;
|
||||
$(function () {
|
||||
if (iid) {
|
||||
$('#sc_plantype').val(scheduletype);
|
||||
@ -253,7 +252,10 @@
|
||||
|
||||
pmquery('GETPMINTERVALBYSCHEDULEID', iid, function (data) {
|
||||
$('#th_intervals').append(loadIntervals(data));
|
||||
editableSelectSchedule = new $editableselect($("#dialog_schedule"));
|
||||
$('#dialog_schedule').dropdown([], {
|
||||
valueKey: 'PmScheduleID',
|
||||
textKey: 'PmScheduleName'
|
||||
});
|
||||
getSchedules();
|
||||
});
|
||||
|
||||
@ -282,15 +284,15 @@
|
||||
tr.append('<th style="width: 150px;">' + GetTextByKey("P_PM_INTERVAL", "Interval") + '</th>');
|
||||
tr.append('<th style="width: 180px;">' + GetTextByKey("P_PM_NOTIFICATIONPERIOD", "Notification Period") + '</th>');
|
||||
tr.append('<th style="width: 80px;">' + GetTextByKey("P_PM_RECURRING", "Recurring") + '</th>');
|
||||
//tr.append('<th style="width: 80px;">Predictive</th>');
|
||||
//tr.app end('<th style="width: 80px;">Predictive</th>');
|
||||
//tr.append('<th style="width: 100px;">Service Type</th>');
|
||||
tr.append('<th style="width: 200px;">' + GetTextByKey("P_PM_SERVICEDESCRIPTION", "Service Description") + '</th>');
|
||||
tr.append('<th style="width: 100px;">' + GetTextByKey("P_PM_EXPECTEDCOST", "Expected Cost") + '</th>');
|
||||
tr.append('<th style="width: 80px;">' + GetTextByKey("P_PM_PRIORITY", "Priority") + '</th>');
|
||||
tr.append($('<th style="width: 350px;" class="td_funcs"></th>')
|
||||
.append($('<a onclick="return false;">' + GetTextByKey("P_PM_ADD", "Add") + '</a>').click(iid, _sc.addIntervalItem))
|
||||
.append($('<div id="dialog_schedule" style="width: 150px; height: 22px;margin-left: 20px;float:left;"></div>'))
|
||||
.append($('<a onclick="return false;" style="margin-left: 5px;">' + GetTextByKey("P_PM_COPYSCHEDULE", "Copy Schedule") + '</a>').click(function () {
|
||||
.append($('<a onclick="return false;" style="margin-top:6px;">' + GetTextByKey("P_PM_ADD", "Add") + '</a>').click(iid, _sc.addIntervalItem))
|
||||
.append($('<div id="dialog_schedule" style="width: 150px; margin-left: 20px;float:left;position: relative;" class="dropdown"></div>'))
|
||||
.append($('<a onclick="return false;" style="margin-left: 5px;margin-top:6px;">' + GetTextByKey("P_PM_COPYSCHEDULE", "Copy Schedule") + '</a>').click(function () {
|
||||
onCopySchedule();
|
||||
})
|
||||
)
|
||||
@ -326,9 +328,8 @@
|
||||
schedules.push(s);
|
||||
}
|
||||
}
|
||||
editableSelectSchedule.datasource = schedules;
|
||||
editableSelectSchedule.valuepath = "PmScheduleID"
|
||||
editableSelectSchedule.displaypath = "PmScheduleName";
|
||||
|
||||
$('#dialog_schedule').dropdownSource(schedules);
|
||||
}
|
||||
|
||||
}, function (err) {
|
||||
@ -336,7 +337,7 @@
|
||||
}
|
||||
|
||||
function onCopySchedule() {
|
||||
var schedule = editableSelectSchedule.selecteditem();
|
||||
var schedule = $('#dialog_schedule').dropdownItem();
|
||||
if (schedule && schedule.Intervals && schedule.Intervals.length > 0) {
|
||||
var tboby = $('#tbody_intervals');
|
||||
for (var i = 0; i < schedule.Intervals.length; i++) {
|
||||
@ -374,15 +375,21 @@
|
||||
<td>
|
||||
<input type="text" id="sc_name" value="<%=Schedule == null ? null : Schedule.PmScheduleName %>" maxlength="200" autocomplete="off" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="width: 140px;" data-lgid="P_CRE_ENABLED_COLON">Enabled:</th>
|
||||
<td>
|
||||
<input type="checkbox" id="sc_enabled" <%=PmEnabled ? " checked=\"checked\"" : "" %> />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th data-lgid="P_PM_PLANTYPE_COLON">Plan Type:</th>
|
||||
<td>
|
||||
<select id="sc_plantype" style="width: 150px;" disabled="disabled">
|
||||
<option value="ADM">Absolute Distance</option>
|
||||
<option value="PM">Absolute Hours</option>
|
||||
<option value="RDM">Relative Distance</option>
|
||||
<option value="HM">Relative Hours</option>
|
||||
<option value="TBM">Relative Time</option>
|
||||
<option value="ADM" data-lgid="P_PM_ABSOLUTEDISTANCE">Absolute Distance</option>
|
||||
<option value="PM" data-lgid="P_PM_ABSOLUTEHOURS">Absolute Hours</option>
|
||||
<option value="RDM" data-lgid="P_PM_RELATIVEDISTANCE">Relative Distance</option>
|
||||
<option value="HM" data-lgid="P_PM_RELATIVEEHOURS">Relative Hours</option>
|
||||
<option value="TBM" data-lgid="P_PM_RELATIVEETIME">Relative Time</option>
|
||||
</select></td>
|
||||
</tr>
|
||||
<tr id="trScheduleUom" style="display: none;">
|
||||
@ -405,7 +412,9 @@
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
<div id="mask_bg" style="display: none;"><div class="loading c-spin"></div></div>
|
||||
<div id="mask_bg" style="display: none;">
|
||||
<div class="loading c-spin"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="dialog" id="dialog_interval" style="display: none;">
|
||||
<div class="dialog-title"><span class="title" data-lgid="P_PM_ADDINTERVAL">Add Interval</span><em class="dialog-close"></em></div>
|
||||
|
@ -16,6 +16,7 @@ public partial class Maintenance_ScheduleDetail : PreventativeMaintenanceBasePag
|
||||
protected string ScheduleType;
|
||||
protected PmScheduleInfo Schedule;
|
||||
protected string PmScheduleUom;
|
||||
protected bool PmEnabled;
|
||||
public string CurrentDate = "";
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
@ -49,10 +50,12 @@ public partial class Maintenance_ScheduleDetail : PreventativeMaintenanceBasePag
|
||||
Schedule = MaintenanceManagement.GetPMScheduleByID(GetCurrentLoginSession().SessionID, IID);
|
||||
ScheduleType = Schedule.PmScheduleType;
|
||||
PmScheduleUom = Schedule.PmScheduleUom;
|
||||
PmEnabled = Schedule.Enabled;
|
||||
}
|
||||
else
|
||||
{
|
||||
PmScheduleUom = SystemParams.GetStringParam("UnitOfOdometer");
|
||||
PmEnabled = true;
|
||||
}
|
||||
if (string.IsNullOrWhiteSpace(ScheduleType))
|
||||
{
|
||||
|
@ -2,7 +2,6 @@
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
|
||||
<link href="../css/jquery.datetimepicker.css" rel="stylesheet" />
|
||||
<link href="../css/datepicker.min.css" rel="stylesheet" />
|
||||
<style type="text/css">
|
||||
body {
|
||||
min-width: 995px;
|
||||
@ -155,20 +154,6 @@
|
||||
border: 1px solid #aaa;
|
||||
}
|
||||
|
||||
.ybutton {
|
||||
width: auto;
|
||||
line-height: normal;
|
||||
margin-left: 6px;
|
||||
border: none;
|
||||
background: rgb(249, 189, 117);
|
||||
padding: 5px 14px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.ybutton:hover {
|
||||
background: #d7690E;
|
||||
}
|
||||
|
||||
.machines {
|
||||
/*table-layout: fixed;*/
|
||||
word-break: keep-all;
|
||||
@ -255,34 +240,32 @@
|
||||
<script src="<%=GetFileUrlWithVersion("js/schedule.js")%>" type="text/javascript"></script>
|
||||
<script src="<%=GetFileUrlWithVersion("js/scheduleassets.js")%>" type="text/javascript"></script>
|
||||
<script src="<%=GetFileUrlWithVersion("../js/assetselector.js")%>" type="text/javascript"></script>
|
||||
<%--<script src="../js/jquery.datetimepicker.full.js"></script>--%>
|
||||
<script src="../js/datepicker.min.js"></script>
|
||||
<script src="../js/jquery.datetimepicker.full.js"></script>
|
||||
<script type="text/javascript">
|
||||
|
||||
var iid = '<%=IID%>';
|
||||
var scheduleUom = '<%=PmScheduleUom%>';
|
||||
var scheduletype = '<%=ScheduleType%>';
|
||||
var interval_label = getIntervalLabel();
|
||||
var currentdate = "<%=CurrentDate %>";
|
||||
var currentdate = "<%=CurrentDate %>";
|
||||
|
||||
var _ScheduleAssets = [];
|
||||
var _showSelectedMachines = [];
|
||||
var _SelectedUnSavedMachines = [];
|
||||
|
||||
var assignedassetCtrl;
|
||||
var allintervals = [];
|
||||
var allintervals = [];
|
||||
|
||||
function getIntervalLabel() {
|
||||
switch (scheduletype) {
|
||||
case "TBM": return "Days"; break;
|
||||
case "TBM": return GetTextByKey("P_WO_DAYS", 'Days'); break;
|
||||
case "ADM":
|
||||
case "RDM":
|
||||
if (scheduleUom === "Kilometre")
|
||||
return "Kilometres"
|
||||
return GetTextByKey("P_PM_KILOMETERS", 'Kilometers');
|
||||
else
|
||||
return "Miles";
|
||||
return GetTextByKey("P_PM_MILES", 'Miles');
|
||||
break;
|
||||
default: return "Hours"; break;
|
||||
default: return GetTextByKey("P_PM_HOURS", 'Hours');
|
||||
}
|
||||
}
|
||||
|
||||
@ -331,11 +314,9 @@
|
||||
}
|
||||
|
||||
$(function () {
|
||||
assignedassetCtrl = new $manageassetsCtrl();
|
||||
assignedassetCtrl.Init($("#divScheduleAssets"));
|
||||
|
||||
selectedassetsctrl = new $manageassetsCtrl();
|
||||
selectedassetsctrl.Init($("#selectedassets"), true);
|
||||
InitAssignedAssetsGridData();
|
||||
InitSelectedAssetsGridData();
|
||||
|
||||
if (scheduletype == "ADM" || scheduletype == "RDM") {
|
||||
$('#trScheduleUom').css('display', '');
|
||||
@ -453,26 +434,28 @@
|
||||
<span data-lgid="P_PM_ASSETSTYPE_COLON">Assets Type: </span>
|
||||
<select id="sel_machine_type" style="width: 230px;"></select>
|
||||
<input type="text" id="txt_machine_key" />
|
||||
<input type="button" class="ybutton" id="button_machine_filter" value="Filter" data-lgid="P_PM_FILTER" />
|
||||
<input type="button" class="ybutton" onclick="OnSaveMachines();" value="Save" data-lgid="P_PM_SAVE" />
|
||||
<input type="button" class="ybutton" onclick="OnAddAssets();" value="Add" data-lgid="P_PM_ADD" />
|
||||
<input type="button" class="ybutton" onclick="OnRemoveAssets();" value="Remove" data-lgid="P_PM_REMOVE" />
|
||||
<input type="button" class="funcctionbtn" id="button_machine_filter" value="Filter" data-lgid="P_PM_FILTER" />
|
||||
<input type="button" class="funcctionbtn" onclick="OnSaveMachines();" value="Save" data-lgid="P_PM_SAVE" />
|
||||
<input type="button" class="funcctionbtn" onclick="OnAddAssets();" value="Add" data-lgid="P_PM_ADD" />
|
||||
<input type="button" class="funcctionbtn" onclick="OnRemoveAssets();" value="Remove" data-lgid="P_PM_REMOVE" />
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
<div>
|
||||
<div id="divScheduleAssets" style="min-height: 400px;"></div>
|
||||
<div id="divScheduleAssets" style="min-height: 400px; position: relative;"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="mask_bg" style="display: none;"><div class="loading c-spin"></div></div>
|
||||
<div id="mask_bg" style="display: none;">
|
||||
<div class="loading c-spin"></div>
|
||||
</div>
|
||||
|
||||
<div class="dialog" id="dialog_selectedassets" style="display: none;">
|
||||
<div class="dialog-title"><span class="title" data-lgid="P_PM_SETASSETS">Set Assets</span><em class="dialog-close"></em></div>
|
||||
<div class="dialog-content">
|
||||
<div id="selectedassets" style="height: 400px; width: 700px;"></div>
|
||||
<div>
|
||||
<div id="selectedassets" style="height: 400px; width: 700px; position: relative;"></div>
|
||||
</div>
|
||||
<div class="dialog-func">
|
||||
<input type="button" value="Cancel" data-lgid="P_PM_CANCEL" class="dialog-close" tabindex="18" />
|
||||
|
@ -17,22 +17,6 @@
|
||||
margin-bottom: 1px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.subtitle {
|
||||
margin: 20px 40px 5px 0px;
|
||||
font-size: 16px;
|
||||
color: gray;
|
||||
}
|
||||
|
||||
.subtitle span {
|
||||
margin-left: 30px;
|
||||
}
|
||||
|
||||
.subtitle hr {
|
||||
background-color: #d8d8d8;
|
||||
border: none;
|
||||
height: 1px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<link href="<%=GetFileUrlWithVersion("../css/tabcontrol.css")%>" rel="stylesheet" />
|
||||
@ -192,11 +176,11 @@
|
||||
}
|
||||
var endMin = $("#smswt_endtimeminute").val();
|
||||
|
||||
var alerttitle = GetTextByKey("P_XXXX", "Survey Automation");
|
||||
var alerttitle = GetTextByKey("P_WOS_SURVEYAUTOMATION", "Survey Automation");
|
||||
|
||||
if (item.DaysFromCompletedDate !== "") {
|
||||
if (!IsPositiveInteger.test(item.DaysFromCompletedDate)) {
|
||||
showAlert(GetTextByKey("P_SET_XXX", 'Number of Days from Completed Date format error.'), alerttitle);
|
||||
showAlert(GetTextByKey("P_WOS_NUMBEROFDAYSFROMCOMPLETEDDATEFORMATERROR", 'Number of Days from Completed Date format error.'), alerttitle);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -205,7 +189,7 @@
|
||||
|
||||
if (item.DaysSinceLastReceivedSurvey !== "") {
|
||||
if (!IsPositiveInteger.test(item.DaysSinceLastReceivedSurvey)) {
|
||||
showAlert(GetTextByKey("P_SET_XXX", 'Days Since Contact Last Received a Survey format error.'), alerttitle);
|
||||
showAlert(GetTextByKey("P_WOS_DAYSSINCECONTACTLASTRECEIVEDASURVEYFORMATERROR", 'Days Since Contact Last Received a Survey format error.'), alerttitle);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -214,7 +198,7 @@
|
||||
|
||||
if (item.ResendAfterDays !== "") {
|
||||
if (!IsPositiveInteger.test(item.ResendAfterDays)) {
|
||||
showAlert(GetTextByKey("P_SET_XXX", 'Resend After Number of Days format error.'), alerttitle);
|
||||
showAlert(GetTextByKey("P_WOS_RESENDAFTERNUMBEROFDAYSFORMATERROR", 'Resend After Number of Days format error.'), alerttitle);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -223,7 +207,7 @@
|
||||
|
||||
if (item.Randomization !== "") {
|
||||
if (!IsPositiveInteger.test(item.Randomization)) {
|
||||
showAlert(GetTextByKey("P_SET_XXX", 'Randomization format error.'), alerttitle);
|
||||
showAlert(GetTextByKey("P_WOS_RANDOMIZATIONFORMATERROR", 'Randomization format error.'), alerttitle);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -250,13 +234,13 @@
|
||||
}
|
||||
}, function (err) {
|
||||
showloading(false);
|
||||
showAlert(GetTextByKey("P_XXXX", 'Failed to save Survey Automation.'), alerttitle);
|
||||
showAlert(GetTextByKey("P_WOS_FAILEDTOSAVESURVEYAUTOMATION", 'Failed to save Survey Automation.'), alerttitle);
|
||||
});
|
||||
}
|
||||
|
||||
var surveyautomationdata;
|
||||
function OnRefresh() {
|
||||
var alerttitle = GetTextByKey("P_XXXX", "Survey Automation");
|
||||
var alerttitle = GetTextByKey("P_WOS_SURVEYAUTOMATION", "Survey Automation");
|
||||
showloading(true);
|
||||
worequest("GetSurveyAutomationSetting", "", function (data) {
|
||||
showloading(false);
|
||||
@ -368,71 +352,71 @@
|
||||
<div class="content_main content_div" style="padding-top: 20px;">
|
||||
<table style="line-height: 30px;">
|
||||
<tr>
|
||||
<td class="label" style="width: 300px;" data-lgid="P_XXXX">Default Template:</td>
|
||||
<td class="label" style="width: 300px;" data-lgid="P_WOS_DEFAULTTEMPLATE_COLON">Default Template:</td>
|
||||
<td colspan="4">
|
||||
<select style="width: 300px; margin-left: 5px;" id="dialog_template"></select>
|
||||
<span class="sbutton iconquestion" style="padding-right: 0px;"></span>
|
||||
<span class="span_title" style="color: gray; display: none;" data-lgid="XXXX">Select the survey you would like sent by default</span>
|
||||
<span class="span_title" style="color: gray; display: none;" data-lgid="P_WOS_SELECTTHESURVEYYOUWOULDLIKESENTBYDEFAULT">Select the survey you would like sent by default</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label" data-lgid="P_XXXX">Number of Days from Completed Date:</td>
|
||||
<td class="label" data-lgid="P_WOS_NUMBEROFDAYSFROMCOMPLETEDDATE_COLON">Number of Days from Completed Date:</td>
|
||||
<td colspan="4">
|
||||
<input id="dialog_completeddatedays" type="text" style="width: 100px;" maxlength="10" />
|
||||
<span class="sbutton iconquestion" style="padding-right: 0px;"></span>
|
||||
<span class="span_title" style="color: gray; display: none;" data-lgid="XXXX">How many days after a work order is closed would you like the survey sent? To send immediately upon close enter 0.</span>
|
||||
<span class="span_title" style="color: gray; display: none;" data-lgid="P_WOS_WORKORDERISCLOSEDSYRVEYSENT_TIPS">How many days after a work order is closed would you like the survey sent? To send immediately upon close enter 0.</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label" data-lgid="P_XXXX">Days Since Contact Last Received a Survey:</td>
|
||||
<td class="label" data-lgid="P_WOS_DAYSSINCECONTACTLASTRECEIVEDASURVEY_COLON">Days Since Contact Last Received a Survey:</td>
|
||||
<td colspan="4">
|
||||
<input id="dialog_receivedsurveydays" type="text" style="width: 100px;" maxlength="10" />
|
||||
<span class="sbutton iconquestion" style="padding-right: 0px;"></span>
|
||||
<span class="span_title" style="color: gray; display: none;" data-lgid="XXXX">For customers with multiple work orders, limit how many surveys they can receive. Ex:
|
||||
<span class="span_title" style="color: gray; display: none;" data-lgid="P_WOS_CUSTOMERMULTIPLEWOLIMITHOWMANYSURVEYSTHEYCANRECEIVE_TIPS">For customers with multiple work orders, limit how many surveys they can receive. Ex:
|
||||
0: Customer is eligible to receive a survey for every work order closed.
|
||||
30: Customer would not receive a second survey for at least 30 days regardless of how many work orders have been completed for them.
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label" data-lgid="P_XXXX">Resend?</td>
|
||||
<td class="label" data-lgid="P_WOS_RESEND">Resend?</td>
|
||||
<td colspan="4">
|
||||
<select id="dialog_resend" style="width: 104px;">
|
||||
<option value="0" data-lgid="P_SET_NO">No</option>
|
||||
<option value="1" data-lgid="P_SET_YES">Yes</option>
|
||||
</select>
|
||||
<span class="sbutton iconquestion" style="padding-right: 0px;"></span>
|
||||
<span class="span_title" style="color: gray; display: none;" data-lgid="XXXX">If a customer has not replied, would you like to automatically resend the survey? Y/N</span>
|
||||
<span class="span_title" style="color: gray; display: none;" data-lgid="P_WOS_CUSTOMERHASNOTREPLIED_TIPS">If a customer has not replied, would you like to automatically resend the survey? Y/N</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label" data-lgid="P_XXXX">Resend After Number of Days:</td>
|
||||
<td class="label" data-lgid="P_WOS_RESENDAFTERNUMBEROFDAYS_COLON">Resend After Number of Days:</td>
|
||||
<td colspan="4">
|
||||
<input id="dialog_resendafterdays" type="text" style="width: 100px;" maxlength="10" />
|
||||
<span class="sbutton iconquestion" style="padding-right: 0px;"></span>
|
||||
<span class="span_title" style="color: gray; display: none;" data-lgid="XXXX">If resend is selected, resend after how many days of non-response? Note that this will only be resent 1 time.</span>
|
||||
<span class="span_title" style="color: gray; display: none;" data-lgid="P_WOS_RESENDISSELECTEDRESENDAFTERHOWMANYDAYS_TIPS">If resend is selected, resend after how many days of non-response? Note that this will only be resent 1 time.</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label" data-lgid="P_XXXX">Randomization: </td>
|
||||
<td class="label" data-lgid="P_WOS_RANDOMIZATION_COLON">Randomization: </td>
|
||||
<td colspan="4">
|
||||
<input id="dialog_randomization" type="text" style="width: 100px;" maxlength="10" />
|
||||
<span class="sbutton iconquestion" style="padding-right: 0px;"></span>
|
||||
<span class="span_title" style="color: gray; display: none;" data-lgid="XXXX">Send 1 survey for every how many completed work orders? Note that if a work order is selected that has no valid contacts or all contacts are opted out, that work order will not be counted in the randomization. </span>
|
||||
<span class="span_title" style="color: gray; display: none;" data-lgid="P_WOS_SENDSURVEYHOWMANTCOMPLEEDWORKORDER_TIPS">Send 1 survey for every how many completed work orders? Note that if a work order is selected that has no valid contacts or all contacts are opted out, that work order will not be counted in the randomization. </span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label" data-lgid="P_XXXX">Exclude Specific Work Order Types:</td>
|
||||
<td class="label" data-lgid="P_WOS_EXCLUDESPECIFICWORKORDERTYPES_COLON">Exclude Specific Work Order Types:</td>
|
||||
<td colspan="4">
|
||||
<div id="dialog_wotype" style="width: 320px; float: left;" class="dropdown"></div>
|
||||
<div style="float: left; padding-left: 5px;">
|
||||
<span class="sbutton iconquestion" style="padding-right: 0px;"></span>
|
||||
<span class="span_title" style="color: gray; display: none;" data-lgid="XXXX">To exclude specific work order types (ie, Internal) select from the dropdown here. Multi-Select is allowed.</span>
|
||||
<span class="span_title" style="color: gray; display: none;" data-lgid="P_WOS_TOEXCLUDESPECIFICWORKORDERTYPES_TIPS">To exclude specific work order types (ie, Internal) select from the dropdown here. Multi-Select is allowed.</span>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label" data-lgid="P_XXXX">Survey Send Times:</td>
|
||||
<td class="label" data-lgid="P_WOS_SURVEYSENDTIMES_COLON">Survey Send Times:</td>
|
||||
<td colspan="4"></td>
|
||||
</tr>
|
||||
<tr class="tdDays">
|
||||
@ -464,7 +448,7 @@
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label">Start Time:</td>
|
||||
<td class="label" data-lgid="P_CM_STARTTIME_COLON">Start Time:</td>
|
||||
<td colspan="5">
|
||||
<select id="smswt_starttimehour" style="width: 48px;">
|
||||
</select>
|
||||
@ -478,7 +462,7 @@
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label">End Time:</td>
|
||||
<td class="label" data-lgid="P_CM_ENDTIME_COLON">End Time:</td>
|
||||
<td colspan="5">
|
||||
<select id="smswt_endtimehour" style="width: 48px;">
|
||||
</select>
|
||||
|
@ -9,27 +9,6 @@
|
||||
display: none;
|
||||
}
|
||||
|
||||
.tab-header {
|
||||
float: left;
|
||||
padding: 2px 6px;
|
||||
cursor: pointer;
|
||||
border: 1px solid #fff;
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.tab-header:hover {
|
||||
background: #eee;
|
||||
}
|
||||
|
||||
.tab-header.selected {
|
||||
border-color: #d8d8d8;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.tab-header.selected:hover {
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.label { /*cover tab.css*/
|
||||
display: table-cell;
|
||||
}
|
||||
@ -44,26 +23,6 @@
|
||||
font-weight: 200;
|
||||
}
|
||||
|
||||
.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;
|
||||
}
|
||||
|
||||
.dialog-content table td.label {
|
||||
width: 120px;
|
||||
}
|
||||
|
||||
.catelog {
|
||||
color: #444;
|
||||
height: 30px;
|
||||
|
@ -15,29 +15,6 @@
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.dialog-content table {
|
||||
border-collapse: collapse;
|
||||
width: 100%;
|
||||
line-height: 32px;
|
||||
}
|
||||
|
||||
.dialog-content table td.label {
|
||||
width: 130px;
|
||||
text-align: right;
|
||||
padding-right: 10px;
|
||||
line-height: 24px;
|
||||
height: 24px;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.dialog-content table td input,
|
||||
.dialog-content table td textarea {
|
||||
border: 1px solid #a9a9a9;
|
||||
width: 250px;
|
||||
height: 18px;
|
||||
padding: 1px;
|
||||
}
|
||||
|
||||
#dialog_machines .dialog-content table td input {
|
||||
width: auto;
|
||||
}
|
||||
@ -129,13 +106,7 @@
|
||||
background: #000;
|
||||
opacity: 0.2;
|
||||
}
|
||||
|
||||
.div_filter .dropdown {
|
||||
width: 100px;
|
||||
}
|
||||
</style>
|
||||
<link href="../css/jquery.datetimepicker.css" rel="stylesheet" />
|
||||
<script src="../js/jquery.datetimepicker.full.js"></script>
|
||||
<script src="<%=GetFileUrlWithVersion("js/controls.js")%>" type="text/javascript"></script>
|
||||
<script src="<%=GetFileUrlWithVersion("../fic/js/utility.js")%>" type="text/javascript"></script>
|
||||
<script type="text/javascript">
|
||||
@ -146,25 +117,46 @@
|
||||
}
|
||||
|
||||
function OnRefresh() {
|
||||
showloading(true);
|
||||
var type = $('#typeselectinput').find("option:selected").val();
|
||||
var startdate = htmlencode($('#startdatetxt').val());
|
||||
var enddate = htmlencode($('#enddatetxt').val());
|
||||
var begindate = $('#startdatetxt').val();
|
||||
var enddate = $('#enddatetxt').val();
|
||||
if (begindate && !$('#startdatetxt').is(':valid')) {
|
||||
showAlert(GetTextByKey('P_WOS_SURVEYSENTBEGINDATEISINVALID', "Survey sent begin date is invalid."), GetTextByKey("P_FR_ERROR", 'Error'));
|
||||
return;
|
||||
}
|
||||
if (enddate && !$('#enddatetxt').is(':valid')) {
|
||||
showAlert(GetTextByKey('P_WOS_SURVEYSENTENDDATEISINVALID', "Survey sent end date is invalid."), GetTextByKey("P_FR_ERROR", 'Error'));
|
||||
return;
|
||||
}
|
||||
if (begindate && enddate && begindate > enddate) {
|
||||
showAlert(GetTextByKey("P_WOS_SURVEYSENTENDDATEMUSTBELATERTHANBEGINDATE", "Survey sent end date must be later than begin date."), GetTextByKey("P_FR_ERROR", 'Error'));
|
||||
return;
|
||||
}
|
||||
var wostartdate = htmlencode($('#wostartdatetxt').val());
|
||||
var woenddate = htmlencode($('#woenddatetxt').val());
|
||||
if (wostartdate && !$('#wostartdatetxt').is(':valid')) {
|
||||
showAlert(GetTextByKey('P_WOS_WORKORDERCOMPLETEDBEGINDATEISINVALID', "Work order completed begin date is invalid."), GetTextByKey("P_FR_ERROR", 'Error'));
|
||||
return;
|
||||
}
|
||||
if (woenddate && !$('#woenddatetxt').is(':valid')) {
|
||||
showAlert(GetTextByKey('P_WOS_WORKORDERCOMPLETEDENDDATEISINVALID', "Work order completed end date is invalid."), GetTextByKey("P_FR_ERROR", 'Error'));
|
||||
return;
|
||||
}
|
||||
if (wostartdate && woenddate && wostartdate > woenddate) {
|
||||
showAlert(GetTextByKey("P_WOS_WORKORDERCOMPLETEDENDDATEMUSTBELATERTHANBEGINDATE", "Work order completed end date must be later than begin date."), GetTextByKey("P_FR_ERROR", 'Error'));
|
||||
return;
|
||||
}
|
||||
|
||||
var searchtxt = "";
|
||||
searchtxt = htmlencode($.trim($('#searchinputtxt').val()));
|
||||
|
||||
var locations = [];
|
||||
if (locationparam)
|
||||
locations = locationparam.selectedvalue;
|
||||
var advisors = [];
|
||||
if (advisorparam)
|
||||
advisors = advisorparam.selectedvalue;
|
||||
var locations = $("#div_locations").dropdownVals();
|
||||
var advisors = $("#div_advisors").dropdownVals();
|
||||
|
||||
var template = $('#templateselectinput').find("option:selected").val();
|
||||
|
||||
var param = JSON.stringify([type, startdate, enddate, searchtxt, JSON.stringify(locations), JSON.stringify(advisors), template, wostartdate, woenddate]);
|
||||
showloading(true);
|
||||
var param = JSON.stringify([type, begindate, enddate, searchtxt, JSON.stringify(locations), JSON.stringify(advisors), template, wostartdate, woenddate]);
|
||||
param = htmlencode(param);
|
||||
|
||||
if (drilldownparams == null) {
|
||||
@ -207,9 +199,9 @@
|
||||
else if (r.Status === 1)
|
||||
statusstr = GetTextByKey('P_WOS_REPLIED', 'Replied');
|
||||
else if (r.Status === 2)
|
||||
statusstr = GetTextByKey('P_WOS_XXX', 'No Sent');
|
||||
statusstr = GetTextByKey('P_WOS_NOSENT', 'No Sent');
|
||||
else if (r.Status === 3)
|
||||
statusstr = GetTextByKey('P_WOS_XXX', 'Do Not Send');
|
||||
statusstr = GetTextByKey('P_WOS_DONOTSEND', 'Do Not Send');
|
||||
for (var j in r) {
|
||||
if (j === "SentTime") {
|
||||
r[j] = { DisplayValue: r["SentTimeStr"], Value: r[j] };
|
||||
@ -222,8 +214,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
var fr = { Values: r };
|
||||
rows.push(fr);
|
||||
rows.push(r);
|
||||
}
|
||||
|
||||
grid_dt.setData(rows);
|
||||
@ -231,28 +222,23 @@
|
||||
|
||||
var grid_dt;
|
||||
function InitGridData() {
|
||||
grid_dt = new GridView('#surveylist');
|
||||
grid_dt.lang = {
|
||||
all: GetTextByKey("P_GRID_ALL", "(All)"),
|
||||
ok: GetTextByKey("P_GRID_OK", "OK"),
|
||||
reset: GetTextByKey("P_GRID_RESET", "Reset")
|
||||
};
|
||||
grid_dt = createGridView('#surveylist');
|
||||
var list_columns = [
|
||||
{ name: 'Selected', caption: "", valueIndex: 'Selected', type: 3, css: { 'width': 45, 'text-align': 'center' } },
|
||||
{ name: 'WorkOrderNumber', caption: GetTextByKey("P_WO_WORKORDERNUMBER", "Work Order Number"), valueIndex: 'WorkOrderNumber', allowFilter: true, css: { 'width': 150, 'text-align': 'left' } },
|
||||
{ name: 'SurveyName', caption: GetTextByKey("P_WOS_SURVEYNAME", "Survey Name"), valueIndex: 'SurveyName', css: { 'width': 150, 'text-align': 'left' } },
|
||||
{ name: 'SurveyName', caption: GetTextByKey("P_WOS_SURVEYNAME", "Survey Name"), valueIndex: 'SurveyName', allowFilter: true, css: { 'width': 150, 'text-align': 'left' } },
|
||||
{ name: 'Status', caption: GetTextByKey("P_WO_STATUS", "Status"), valueIndex: 'Status', allowFilter: true, css: { 'width': 160, 'text-align': 'left' } },
|
||||
{ name: 'SentTime', caption: GetTextByKey("P_WOS_SENTDATE", "Sent Date"), valueIndex: 'SentTime', css: { 'width': 130, 'text-align': 'left' } },
|
||||
{ name: 'SubmitTime', caption: GetTextByKey("P_WOS_REPLYDATE", "Reply Date"), valueIndex: 'SubmitTime', css: { 'width': 130, 'text-align': 'left' } },
|
||||
{ name: 'CustomerName', caption: GetTextByKey("P_WOS_CUSTOMERNAME", "Customer Name"), valueIndex: 'CustomerName', allowFilter: true, css: { 'width': 150, 'text-align': 'left' } },
|
||||
{ name: 'ContactName', caption: GetTextByKey("P_WOS_CONTACTNAME", "Contact Name"), valueIndex: 'ContactName', allowFilter: true, css: { 'width': 150, 'text-align': 'left' } },
|
||||
{ name: 'ContactNumber', caption: GetTextByKey("P_WOS_CONTACTNUMBER", "Contact Number"), valueIndex: 'ContactNumber', allowFilter: true, css: { 'width': 150, 'text-align': 'left' } },
|
||||
{ name: 'ContactNumber', caption: GetTextByKey("P_WOS_CONTACTNUMBER", "Contact Number"), valueIndex: 'ContactNumberStr', allowFilter: true, css: { 'width': 150, 'text-align': 'left' } },
|
||||
//{ name: 'AssetVIN', caption: GetTextByKey("P_WO_VIN", "VIN"), valueIndex: 'AssetVIN', allowFilter: true, css: { 'width': 150, 'text-align': 'left' } },
|
||||
{ name: 'LocationName', caption: GetTextByKey("P_WO_LOCATION", "Location"), valueIndex: 'LocationName', allowFilter: true, css: { 'width': 150, 'text-align': 'left' } },
|
||||
{ name: 'AdvisorName', caption: GetTextByKey("P_WO_ADVISOR", "Advisor"), valueIndex: 'AdvisorName', allowFilter: true, css: { 'width': 150, 'text-align': 'left' } },
|
||||
{ name: 'AssetMake', caption: GetTextByKey("P_WO_MAKE", "Make"), valueIndex: 'AssetMake', allowFilter: true, css: { 'width': 120, 'text-align': 'left' } },
|
||||
{ name: 'AssetModel', caption: GetTextByKey("P_WO_MODEL", "Model"), valueIndex: 'AssetModel', allowFilter: true, css: { 'width': 120, 'text-align': 'left' } },
|
||||
{ name: 'DoNotSend', caption: GetTextByKey("P_JS_XXX", "Do Not Send"), valueIndex: 'DoNotSend', type: 3, css: { 'width': 90, 'text-align': 'center' } },
|
||||
{ name: 'DoNotSend', caption: GetTextByKey("P_WOS_DONOTSEND", "Do Not Send"), valueIndex: 'DoNotSend', allowFilter: true, type: 3, css: { 'width': 90, 'text-align': 'center' } },
|
||||
//{ name: 'AssetType', caption: GetTextByKey("P_WO_ASSETTYPE", "Asset Type"), valueIndex: 'AssetType', allowFilter: true, css: { 'width': 120, 'text-align': 'left' } },
|
||||
{ name: 'Detail', caption: "", css: { 'width': 30, 'text-align': 'center' } },
|
||||
{ name: 'DownloadPDF', caption: "", css: { 'width': 30, 'text-align': 'center' } },
|
||||
@ -272,6 +258,9 @@
|
||||
col.key = list_columns[hd].valueIndex;
|
||||
col.allowFilter = list_columns[hd].allowFilter;
|
||||
col.type = list_columns[hd].type;
|
||||
if (col.name === "DoNotSend") {
|
||||
col.filterSource = [{ Value: true, DisplayValue: GetTextByKey('P_UTILITY_YES', 'Yes') }, { Value: false, DisplayValue: GetTextByKey('P_UTILITY_NO', 'No') }];
|
||||
}
|
||||
if (col.name === "Selected") {
|
||||
col.allcheck = true;
|
||||
col.events = {
|
||||
@ -285,8 +274,14 @@
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
if (col.name === "DoNotSend") {
|
||||
else if (col.name === "Status") {
|
||||
col.sortFilter = function (a, b) {
|
||||
a = a.Status.DisplayValue;
|
||||
b = b.Status.DisplayValue;
|
||||
return a > b ? 1 : (a < b ? -1 : 0);
|
||||
};
|
||||
}
|
||||
else if (col.name === "DoNotSend") {
|
||||
col.events = {
|
||||
onchange: function () {
|
||||
var item = this;
|
||||
@ -299,11 +294,11 @@
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
if (col.name === "Surveys") {
|
||||
else if (col.name === "Surveys") {
|
||||
col.sortable = false;
|
||||
col.isurl = true;
|
||||
col.text = "\uf15c";
|
||||
col.resizable = false;
|
||||
col.type = GridView.ColumnTypes.Icon;
|
||||
col.text = "file-lines";
|
||||
col.events = {
|
||||
onclick: function () {
|
||||
onSendWOSurveys(this);
|
||||
@ -317,11 +312,9 @@
|
||||
display: (item.Status.Value == 2 && item.Contacts.length > 0) ? '' : 'none'
|
||||
};
|
||||
};
|
||||
col.attrs = { 'title': GetTextByKey("P_XXXXX", 'Send Survey') };
|
||||
col.attrs = { 'title': GetTextByKey("P_WOS_SENDSURVEY", 'Send Survey') };
|
||||
}
|
||||
|
||||
if (col.name === "WorkOrderNumber" || col.name === "SurveyName") {
|
||||
col.isurl = true;
|
||||
else if (col.name === "WorkOrderNumber" || col.name === "SurveyName") {
|
||||
//col.sortable = false;
|
||||
col.events = {
|
||||
onclick: function () {
|
||||
@ -337,9 +330,10 @@
|
||||
}
|
||||
}
|
||||
else if (col.name === "Detail") {
|
||||
col.isurl = true;
|
||||
col.text = "\uf0c9";
|
||||
col.sortable = false;
|
||||
col.resizable = false;
|
||||
col.type = GridView.ColumnTypes.Icon;
|
||||
col.text = "bars";
|
||||
col.events = {
|
||||
onclick: function () {
|
||||
openSurveyDetail();
|
||||
@ -355,9 +349,10 @@
|
||||
col.attrs = { 'title': GetTextByKey("P_IPT_DETAIL", 'Detail') };
|
||||
}
|
||||
else if (col.name === "DownloadPDF") {
|
||||
col.isurl = true;
|
||||
col.text = "\uf019";
|
||||
col.sortable = false;
|
||||
col.resizable = false;
|
||||
col.type = GridView.ColumnTypes.Icon;
|
||||
col.text = "download";
|
||||
col.events = {
|
||||
onclick: function () {
|
||||
window.open("SurveyManagement.aspx?rt=f&t=1&id=" + this.Id, '_blank');
|
||||
@ -376,9 +371,10 @@
|
||||
col.attrs = { 'title': GetTextByKey("P_IPT_DOWNLOADPDF", 'Download PDF') };
|
||||
}
|
||||
else if (col.name === "Print") {
|
||||
col.isurl = true;
|
||||
col.text = "\uf02f";
|
||||
col.sortable = false;
|
||||
col.resizable = false;
|
||||
col.type = GridView.ColumnTypes.Icon;
|
||||
col.text = "print";
|
||||
col.events = {
|
||||
onclick: function () {
|
||||
if (navigator.userAgent.indexOf('Firefox') >= 0 ||
|
||||
@ -423,16 +419,10 @@
|
||||
}
|
||||
columns.push(col);
|
||||
}
|
||||
grid_dt.canMultiSelect = false;
|
||||
grid_dt.multiSelect = false;
|
||||
grid_dt.columns = columns;
|
||||
grid_dt.init();
|
||||
grid_dt.rowdblclick = openSurveyDetail;
|
||||
|
||||
grid_dt.selectedrowchanged = function (rowindex) {
|
||||
var rowdata = grid_dt.source[rowindex];
|
||||
if (rowdata) {
|
||||
}
|
||||
}
|
||||
grid_dt.onRowDblClicked = openSurveyDetail;
|
||||
}
|
||||
|
||||
function CloseDialog(type) {
|
||||
@ -446,7 +436,7 @@
|
||||
if (index < 0) {
|
||||
showAlert(GetTextByKey("P_WOS_PLEASESELECTSURVEY", "Please select survey."), GetTextByKey("P_WORKORDERSURVEYTEMPLATES", "Work Order Survey Templates")); return;
|
||||
}
|
||||
var survey = grid_dt.source[index].Values;
|
||||
var survey = grid_dt.source[index];
|
||||
if (!survey) {
|
||||
surveyid = undefined;
|
||||
return;
|
||||
@ -463,14 +453,7 @@
|
||||
.showDialogRight2();
|
||||
}
|
||||
|
||||
var locationparam;
|
||||
var advisorparam;
|
||||
var location_editmultiselect;
|
||||
var advisor_editmultiselect;
|
||||
function GetFilterDataSource() {
|
||||
$('#div_locations').empty();
|
||||
$('#div_departments').empty();
|
||||
$('#div_advisors').empty();
|
||||
woquery('GetFilterDataSource', '', function (data) {
|
||||
if (typeof (data) === "string") {
|
||||
showAlert(data, GetTextByKey("P_AM_ERROR", 'Error'));
|
||||
@ -481,23 +464,8 @@
|
||||
var loc = data.Locations[i];
|
||||
loc.sublevel = loc.PId > 0 ? 1 : 0;
|
||||
}
|
||||
locationparam = {
|
||||
items: data.Locations,
|
||||
selectedvalue: locationparam ? locationparam.selectedvalue : [],
|
||||
width: 120,
|
||||
valuepath: "ID",
|
||||
textpath: "Name"
|
||||
};
|
||||
location_editmultiselect = editmultiselect(locationparam);
|
||||
$('#div_locations').append(location_editmultiselect);
|
||||
|
||||
advisorparam = {
|
||||
items: JSON.parse(JSON.stringify(data.Advisors)),
|
||||
selectedvalue: advisorparam ? advisorparam.selectedvalue : [],
|
||||
width: 120
|
||||
};
|
||||
advisor_editmultiselect = editmultiselect(advisorparam);
|
||||
$('#div_advisors').append(advisor_editmultiselect);
|
||||
$("#div_locations").dropdownSource(data.Locations);
|
||||
$("#div_advisors").dropdownSource(data.Advisors);
|
||||
}, function () {
|
||||
});
|
||||
}
|
||||
@ -533,10 +501,8 @@
|
||||
$('#enddatetxt').val(p[2]);
|
||||
$('#wostartdatetxt').val('');
|
||||
$('#woenddatetxt').val('');
|
||||
if (!locationparam) locationparam = {};
|
||||
locationparam.selectedvalue = JSON.parse(p[3]);
|
||||
if (!advisorparam) advisorparam = {};
|
||||
advisorparam.selectedvalue = JSON.parse(p[4]);
|
||||
$("#div_locations").dropdownVals(JSON.parse(p[3]));
|
||||
$("#div_advisors").dropdownVals(JSON.parse(p[4]));
|
||||
|
||||
if (p[5] != null) {
|
||||
drilldownparams = p[5];
|
||||
@ -551,45 +517,21 @@
|
||||
GetFilterDataSource();
|
||||
GetTemplateData();
|
||||
|
||||
$('#startdatetxt').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]);
|
||||
}
|
||||
$("#div_locations").css('width', 120).dropdown([], {
|
||||
search: true,
|
||||
multiselect: true,
|
||||
allowselectall: true,
|
||||
textKey: 'Name',
|
||||
valueKey: 'ID'
|
||||
});
|
||||
|
||||
$('#enddatetxt').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]);
|
||||
}
|
||||
});
|
||||
|
||||
$('#wostartdatetxt').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]);
|
||||
}
|
||||
});
|
||||
|
||||
$('#woenddatetxt').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]);
|
||||
}
|
||||
});
|
||||
$("#div_advisors").css('width', 120).dropdown([], {
|
||||
search: true,
|
||||
multiselect: true,
|
||||
allowselectall: true,
|
||||
textKey: 'Value',
|
||||
valueKey: 'Key'
|
||||
});
|
||||
|
||||
$('#dialog_sendwosurveys').dialog(function () {
|
||||
showmaskbg(false);
|
||||
@ -665,8 +607,9 @@
|
||||
if (!wo) {
|
||||
var woids = [];
|
||||
var wos = [];
|
||||
for (var i = 0; i < grid_dt.source.length; i++) {
|
||||
var gwo = grid_dt.source[i].Values;
|
||||
var tempsource = grid_dt.source;
|
||||
for (var i = 0; i < tempsource.length; i++) {
|
||||
var gwo = tempsource[i];
|
||||
if (gwo.Selected && gwo.Status.Value == 2 && gwo.Contacts.length > 0) {
|
||||
woids.push(gwo.WorkOrderId);
|
||||
wos.push(gwo);
|
||||
@ -735,7 +678,7 @@
|
||||
var tempid = $('#dialog_wosurveytemplates').val();
|
||||
|
||||
if (!tempid || tempid == "") {
|
||||
showAlert(GetTextByKey("P_WO_XXXXXX", 'Please select a template.'), GetTextByKey("P_WO_SENDWORKORDERSURVEYS", 'Send Work Order Surveys'));
|
||||
showAlert(GetTextByKey("P_WO_PLEASESELECTATEMPLATE", 'Please select a template.'), GetTextByKey("P_WO_SENDWORKORDERSURVEYS", 'Send Work Order Surveys'));
|
||||
return;
|
||||
}
|
||||
|
||||
@ -823,13 +766,13 @@
|
||||
<%if (IsAdmin)
|
||||
{%>
|
||||
<span class="sbutton iconcog" style="float: right; font-size: 14px; margin-right: 15px; cursor: pointer;" onclick="openSurveyAutomation();">
|
||||
<label data-lgid="P_XXXXX">Survey Automation</label></span>
|
||||
<label data-lgid="P_WOS_SURVEYAUTOMATION">Survey Automation</label></span>
|
||||
<%}%>
|
||||
<div style="clear: both;"></div>
|
||||
</div>
|
||||
<div style="margin-top: -15px; font-size: 12px;">
|
||||
<span style="margin-left: 310px;" data-lgid="P_FR_XXX">Survey Sent Date</span>
|
||||
<span style="margin-left: 730px;" data-lgid="P_FR_XXX">Work Order Completed</span>
|
||||
<span style="margin-left: 345px;" data-lgid="P_WOS_SURVEYSENTDATE">Survey Sent Date</span>
|
||||
<span style="margin-left: 790px;" data-lgid="P_WOS_WORKORDERCOMPLETED">Work Order Completed</span>
|
||||
</div>
|
||||
<div class="search_bar">
|
||||
<input type="password" autocomplete="new-password" style="display: none" />
|
||||
@ -837,13 +780,13 @@
|
||||
<div>
|
||||
<select class="selectinput" style="width: 120px; margin-left: 5px;" id="templateselectinput"></select>
|
||||
</div>
|
||||
<span style="margin-left: 5px;" data-lgid="P_FR_XXX">Begin Date: </span>
|
||||
<span style="margin-left: 5px;" data-lgid="P_WOS_BEGINDATE_COLON">Begin Date: </span>
|
||||
<div>
|
||||
<input id="startdatetxt" type="text" style="width: 70px; margin-left: 5px;" value="<%=BeginDate %>" autocomplete="off" />
|
||||
<input id="startdatetxt" type="date" class="type-date" required min="1900-01-01" style="width: 90px; margin-left: 5px;" value="<%=BeginDate %>" autocomplete="off" />
|
||||
</div>
|
||||
<span style="margin-left: 5px;" data-lgid="P_FR_XXX">End Date: </span>
|
||||
<span style="margin-left: 5px;" data-lgid="P_WOS_ENDDATE_COLON">End Date: </span>
|
||||
<div>
|
||||
<input id="enddatetxt" type="text" style="width: 70px; margin-left: 5px;" value="<%=EndDate %>" autocomplete="off" />
|
||||
<input id="enddatetxt" type="date" class="type-date" required min="1900-01-01" style="width: 90px; margin-left: 5px;" value="<%=EndDate %>" autocomplete="off" />
|
||||
</div>
|
||||
<span data-lgid="P_WOS_SURVEYSTATUS" style="margin-left: 5px;">Survey Status:</span>
|
||||
<div>
|
||||
@ -851,21 +794,21 @@
|
||||
<option value="-1" data-lgid="P_WOS_ALL">All</option>
|
||||
<option value="0" data-lgid="P_WOS_WAITINGCUSTOMERREPLY">Waiting Customer Reply</option>
|
||||
<option value="1" data-lgid="P_WOS_REPLIED">Replied</option>
|
||||
<option value="2" data-lgid="P_WOS_XXX">No Sent</option>
|
||||
<option value="3" data-lgid="P_WOS_XXX">Do Not Send</option>
|
||||
<option value="2" data-lgid="P_WOS_NOSENT">No Sent</option>
|
||||
<option value="3" data-lgid="P_WOS_DONOTSEND">Do Not Send</option>
|
||||
</select>
|
||||
</div>
|
||||
<span data-lgid="P_WO_LOCATION_COLON">Location:</span>
|
||||
<div id="div_locations"></div>
|
||||
<span data-lgid="P_WO_ADVISOR_COLON">Advisor:</span>
|
||||
<div id="div_advisors"></div>
|
||||
<span style="margin-left: 5px;" data-lgid="P_FR_XXX">Begin Date: </span>
|
||||
<span style="margin-left: 5px;" data-lgid="P_WOS_BEGINDATE_COLON">Begin Date: </span>
|
||||
<div>
|
||||
<input id="wostartdatetxt" type="text" style="width: 70px; margin-left: 5px;" value="<%=BeginDate %>" autocomplete="off" />
|
||||
<input id="wostartdatetxt" type="date" class="type-date" required min="1900-01-01" style="width: 90px; margin-left: 5px;" value="<%=BeginDate %>" autocomplete="off" />
|
||||
</div>
|
||||
<span style="margin-left: 5px;" data-lgid="P_FR_XXX">End Date: </span>
|
||||
<span style="margin-left: 5px;" data-lgid="P_WOS_ENDDATE_COLON">End Date: </span>
|
||||
<div>
|
||||
<input id="woenddatetxt" type="text" style="width: 70px; margin-left: 5px;" value="<%=EndDate %>" autocomplete="off" />
|
||||
<input id="woenddatetxt" type="date" class="type-date" required min="1900-01-01" style="width: 90px; margin-left: 5px;" value="<%=EndDate %>" autocomplete="off" />
|
||||
</div>
|
||||
<input id="searchinputtxt" type="text" autocomplete="off" style="width: 100px; margin-left: 5px;" />
|
||||
<input class="search" type="button" onclick="OnRefresh();" value="Search" data-lgid="P_FR_SEARCH" style="margin-left: 5px;" />
|
||||
@ -873,7 +816,7 @@
|
||||
</div>
|
||||
<div class="function_title">
|
||||
<span class="sbutton iconrefresh" onclick="OnRefresh();" data-lgid="P_UM_REFRESH">Refresh</span>
|
||||
<span class="sbutton iconsendsurvey" onclick="onSendWOSurveys(null);" data-lgid="P_UM_XXX">Send Survey</span>
|
||||
<span class="sbutton iconsendsurvey" onclick="onSendWOSurveys(null);" data-lgid="P_WOS_SENDSURVEY">Send Survey</span>
|
||||
<%--<span class="sbutton iconexport" onclick="OnExport();" data-lgid="P_MR_EXPORTTOEXCEL">Export to Excel</span>--%>
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
|
@ -50,8 +50,8 @@ public partial class SurveyManagement : WorkOrderBasePage
|
||||
|
||||
|
||||
DateTime userlocaldate = SystemParams.ConvertToUserTimeFromUtc(GetCurrentLoginSession().User, DateTime.UtcNow);
|
||||
BeginDate = userlocaldate.AddMonths(-1).ToShortDateString();
|
||||
EndDate = userlocaldate.ToShortDateString();
|
||||
BeginDate = userlocaldate.AddMonths(-1).ToString("yyyy-MM-dd");
|
||||
EndDate = userlocaldate.ToString("yyyy-MM-dd");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -15,29 +15,6 @@
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.dialog-content table {
|
||||
border-collapse: collapse;
|
||||
width: 100%;
|
||||
line-height: 32px;
|
||||
}
|
||||
|
||||
.dialog-content table td.label {
|
||||
width: 130px;
|
||||
text-align: right;
|
||||
padding-right: 10px;
|
||||
line-height: 24px;
|
||||
height: 24px;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.dialog-content table td input,
|
||||
.dialog-content table td textarea {
|
||||
border: 1px solid #a9a9a9;
|
||||
width: 250px;
|
||||
height: 18px;
|
||||
padding: 1px;
|
||||
}
|
||||
|
||||
#dialog_machines .dialog-content table td input {
|
||||
width: auto;
|
||||
}
|
||||
@ -173,7 +150,7 @@
|
||||
if (index < 0) {
|
||||
showAlert(GetTextByKey("P_WOS_PLEASESELECTSURVEYTEMPLATE", "Please select survey template."), GetTextByKey("P_WORKORDERSURVEYTEMPLATES", "Work Order Survey Templates")); return;
|
||||
}
|
||||
var survey = grid_dt.source[index].Values;
|
||||
var survey = grid_dt.source[index];
|
||||
if (!survey) {
|
||||
surveyid = undefined;
|
||||
return;
|
||||
@ -221,31 +198,17 @@
|
||||
}
|
||||
|
||||
function showSurveyList(data) {
|
||||
var rows = [];
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
var r = data[i];
|
||||
for (var j in r) {
|
||||
}
|
||||
|
||||
var fr = { Values: r };
|
||||
rows.push(fr);
|
||||
}
|
||||
|
||||
grid_dt.setData(rows);
|
||||
|
||||
grid_dt.setData(data);
|
||||
}
|
||||
|
||||
var grid_dt;
|
||||
function InitGridData() {
|
||||
grid_dt = new GridView('#surveylist');
|
||||
grid_dt.lang = {
|
||||
all: GetTextByKey("P_GRID_ALL", "(All)"),
|
||||
ok: GetTextByKey("P_GRID_OK", "OK"),
|
||||
reset: GetTextByKey("P_GRID_RESET", "Reset")
|
||||
};
|
||||
grid_dt = createGridView('#surveylist');
|
||||
var list_columns = [
|
||||
{ name: 'Name', caption: GetTextByKey("P_WOS_NAME", "Name"), valueIndex: 'Name', css: { 'width': 300, 'text-align': 'left' } },
|
||||
{ name: 'Name', caption: GetTextByKey("P_WOS_NAME", "Name"), valueIndex: 'Name', allowFilter: true, css: { 'width': 300, 'text-align': 'left' } },
|
||||
{ name: 'Notes', caption: GetTextByKey("P_WOS_NOTES", "Notes"), valueIndex: 'Notes', css: { 'width': 320, 'text-align': 'left' } },
|
||||
{ name: 'Active', caption: GetTextByKey("P_UM_ACTIVE", "Active"), valueIndex: 'Active', css: { 'width': 100, 'text-align': 'center' } },
|
||||
{ name: 'Active', caption: GetTextByKey("P_UM_ACTIVE", "Active"), valueIndex: 'Active', allowFilter: true, css: { 'width': 100, 'text-align': 'center' } },
|
||||
{ name: 'Edit', caption: "", css: { 'width': 30, 'text-align': 'center' } },
|
||||
{ name: 'Copy', caption: "", css: { 'width': 30, 'text-align': 'center' } },
|
||||
{ name: 'Preview', caption: "", css: { 'width': 30, 'text-align': 'center' } },
|
||||
@ -263,14 +226,17 @@
|
||||
col.align = list_columns[hd].css["text-align"]
|
||||
col.key = list_columns[hd].valueIndex;
|
||||
col.allowFilter = list_columns[hd].allowFilter;
|
||||
|
||||
if (col.name === 'Active') {
|
||||
col.type = 3;
|
||||
col.enabled = false;
|
||||
col.filterSource = [{ Value: true, DisplayValue: GetTextByKey('P_UTILITY_YES', 'Yes') }, { Value: false, DisplayValue: GetTextByKey('P_UTILITY_NO', 'No') }];
|
||||
}
|
||||
else if (col.name === "Edit") {
|
||||
col.isurl = true;
|
||||
col.text = "\uf044";
|
||||
col.sortable = false;
|
||||
col.resizable = false;
|
||||
col.type = GridView.ColumnTypes.Icon;
|
||||
col.text = "edit";
|
||||
col.events = {
|
||||
onclick: function () {
|
||||
OnEdit();
|
||||
@ -282,9 +248,10 @@
|
||||
col.attrs = { 'title': GetTextByKey("P_WOS_EDIT", 'Edit') };
|
||||
}
|
||||
else if (col.name === 'Copy') {
|
||||
col.isurl = true;
|
||||
col.text = '\uf0c5';
|
||||
col.sortable = false;
|
||||
col.resizable = false;
|
||||
col.type = GridView.ColumnTypes.Icon;
|
||||
col.text = 'copy';
|
||||
col.classFilter = function () { return 'icon-col' };
|
||||
col.attrs = { 'title': GetTextByKey('P_IPT_COPY', 'Copy') };
|
||||
col.events = {
|
||||
@ -294,9 +261,10 @@
|
||||
};
|
||||
}
|
||||
else if (col.name === 'Preview') {
|
||||
col.isurl = true;
|
||||
col.text = '\uf06e';
|
||||
col.sortable = false;
|
||||
col.resizable = false;
|
||||
col.type = GridView.ColumnTypes.Icon;
|
||||
col.text = 'eye';
|
||||
col.classFilter = function () { return 'icon-col' };
|
||||
col.attrs = { 'title': GetTextByKey('P_MA_PREVIEW', 'Preview') };
|
||||
col.events = {
|
||||
@ -317,9 +285,10 @@
|
||||
};
|
||||
}
|
||||
else if (col.name === "Delete") {
|
||||
col.isurl = true;
|
||||
col.text = "\uf00d";
|
||||
col.sortable = false;
|
||||
col.resizable = false;
|
||||
col.type = GridView.ColumnTypes.Icon;
|
||||
col.text = "times";
|
||||
col.events = {
|
||||
onclick: function () {
|
||||
OnDelete(this);
|
||||
@ -337,16 +306,10 @@
|
||||
}
|
||||
columns.push(col);
|
||||
}
|
||||
grid_dt.canMultiSelect = false;
|
||||
grid_dt.multiSelect = false;
|
||||
grid_dt.columns = columns;
|
||||
grid_dt.init();
|
||||
grid_dt.rowdblclick = OnEdit;
|
||||
|
||||
grid_dt.selectedrowchanged = function (rowindex) {
|
||||
var rowdata = grid_dt.source[rowindex];
|
||||
if (rowdata) {
|
||||
}
|
||||
}
|
||||
grid_dt.onRowDblClicked = OnEdit;
|
||||
}
|
||||
|
||||
|
||||
|
@ -15,29 +15,6 @@
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.dialog-content table {
|
||||
border-collapse: collapse;
|
||||
width: 100%;
|
||||
line-height: 32px;
|
||||
}
|
||||
|
||||
.dialog-content table td.label {
|
||||
width: 130px;
|
||||
text-align: right;
|
||||
padding-right: 10px;
|
||||
line-height: 24px;
|
||||
height: 24px;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.dialog-content table td input,
|
||||
.dialog-content table td textarea {
|
||||
border: 1px solid #a9a9a9;
|
||||
width: 250px;
|
||||
height: 18px;
|
||||
padding: 1px;
|
||||
}
|
||||
|
||||
#dialog_machines .dialog-content table td input {
|
||||
width: auto;
|
||||
}
|
||||
@ -130,10 +107,6 @@
|
||||
opacity: 0.2;
|
||||
}
|
||||
|
||||
.div_filter .dropdown {
|
||||
width: 100px;
|
||||
}
|
||||
|
||||
.page-chart {
|
||||
page-break-inside: avoid;
|
||||
}
|
||||
|
@ -2,6 +2,10 @@
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
|
||||
<style type="text/css">
|
||||
html, body {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.no_wrap th {
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
@ -15,29 +19,6 @@
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.dialog-content table {
|
||||
border-collapse: collapse;
|
||||
width: 100%;
|
||||
line-height: 32px;
|
||||
}
|
||||
|
||||
.dialog-content table td.label {
|
||||
width: 130px;
|
||||
text-align: right;
|
||||
padding-right: 10px;
|
||||
line-height: 24px;
|
||||
height: 24px;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.dialog-content table td input,
|
||||
.dialog-content table td textarea {
|
||||
border: 1px solid #a9a9a9;
|
||||
width: 250px;
|
||||
height: 18px;
|
||||
padding: 1px;
|
||||
}
|
||||
|
||||
#dialog_machines .dialog-content table td input {
|
||||
width: auto;
|
||||
}
|
||||
@ -61,79 +42,6 @@
|
||||
max-width: 500px;
|
||||
}
|
||||
|
||||
.ctl_button {
|
||||
font-family: 'CalciteWebCoreIcons';
|
||||
display: block;
|
||||
margin: 6px auto;
|
||||
width: 60px;
|
||||
height: 22px;
|
||||
line-height: 21px;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.group_table .main_table {
|
||||
table-layout: fixed;
|
||||
}
|
||||
|
||||
.group_table .main_table thead tr {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.group_table .main_table tbody {
|
||||
height: 280px;
|
||||
display: block;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.group_table .main_table th {
|
||||
width: 165px;
|
||||
}
|
||||
|
||||
.group_table .main_table td {
|
||||
width: 165px;
|
||||
white-space: nowrap;
|
||||
word-break: keep-all;
|
||||
}
|
||||
|
||||
.group_table .main_table td div {
|
||||
width: 165px;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
word-break: keep-all;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.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;
|
||||
}
|
||||
|
||||
.machine_maskbg {
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
background: #000;
|
||||
opacity: 0.2;
|
||||
}
|
||||
|
||||
.div_filter .dropdown {
|
||||
width: 100px;
|
||||
}
|
||||
|
||||
.emailpopus-close {
|
||||
float: right;
|
||||
margin-right: 6px;
|
||||
@ -149,8 +57,6 @@
|
||||
height: unset;
|
||||
}
|
||||
</style>
|
||||
<link href="../css/jquery.datetimepicker.css" rel="stylesheet" />
|
||||
<script src="../js/jquery.datetimepicker.full.js"></script>
|
||||
<script src="../js/echarts.min.js"></script>
|
||||
<script src="<%=GetFileUrlWithVersion("js/controls.js")%>" type="text/javascript"></script>
|
||||
<script src="<%=GetFileUrlWithVersion("../fic/js/utility.js")%>" type="text/javascript"></script>
|
||||
@ -440,19 +346,26 @@
|
||||
}
|
||||
|
||||
function drilldowndetail(ids) {
|
||||
|
||||
var begindate = $('#startdatetxt').val();
|
||||
var enddate = $('#enddatetxt').val();
|
||||
if (begindate && !$('#startdatetxt').is(':valid')) {
|
||||
showAlert(GetTextByKey('P_COMMON_BEGINDATEISINVALID', "The begin date is invalid."), GetTextByKey("P_FR_ERROR", 'Error'));
|
||||
return;
|
||||
}
|
||||
if (enddate && !$('#enddatetxt').is(':valid')) {
|
||||
showAlert(GetTextByKey('P_COMMON_ENDDATEISINVALID', "The end date is invalid."), GetTextByKey("P_FR_ERROR", 'Error'));
|
||||
return;
|
||||
}
|
||||
if (begindate && enddate && begindate > enddate) {
|
||||
showAlert(GetTextByKey("P_JS_ENDDATEMUSTBELATERTHANBEGINDATE", "End Date must be later than Begin Date."), GetTextByKey("P_FR_ERROR", 'Error'));
|
||||
return;
|
||||
}
|
||||
var template = $('#templateselectinput').find("option:selected").val();
|
||||
var startdate = htmlencode($('#startdatetxt').val());
|
||||
var enddate = htmlencode($('#enddatetxt').val());
|
||||
|
||||
var locations = [];
|
||||
if (locationparam)
|
||||
locations = locationparam.selectedvalue;
|
||||
var advisors = [];
|
||||
if (advisorparam)
|
||||
advisors = advisorparam.selectedvalue;
|
||||
var locations = $("#div_locations").dropdownVals();
|
||||
var advisors = $("#div_advisors").dropdownVals();
|
||||
|
||||
var param = JSON.stringify([template, startdate, enddate, JSON.stringify(locations), JSON.stringify(advisors), ids]);
|
||||
var param = JSON.stringify([template, begindate, enddate, JSON.stringify(locations), JSON.stringify(advisors), ids]);
|
||||
param = htmlencode(param);
|
||||
|
||||
setCookieSeconds("WOSurveyReportParams", param, 60);
|
||||
@ -536,65 +449,55 @@
|
||||
}
|
||||
}
|
||||
|
||||
var locationparam;
|
||||
var advisorparam;
|
||||
var location_editmultiselect;
|
||||
var advisor_editmultiselect;
|
||||
|
||||
var filterDataSource = null;
|
||||
function GetFilterDataSource() {
|
||||
$('#div_locations').empty();
|
||||
$('#div_advisors').empty();
|
||||
reportrequest('GetFilterDataSource', '', function (data) {
|
||||
if (typeof (data) === "string") {
|
||||
showAlert(data, GetTextByKey("P_AM_ERROR", 'Error'));
|
||||
return;
|
||||
}
|
||||
filterDataSource = data;
|
||||
|
||||
for (var i = 0; i < data.Locations.length; i++) {
|
||||
var loc = data.Locations[i];
|
||||
loc.sublevel = loc.PId > 0 ? 1 : 0;
|
||||
}
|
||||
locationparam = {
|
||||
items: data.Locations,
|
||||
selectedvalue: [],
|
||||
width: 120,
|
||||
valuepath: "ID",
|
||||
textpath: "Name"
|
||||
};
|
||||
location_editmultiselect = editmultiselect(locationparam);
|
||||
$('#div_locations').append(location_editmultiselect);
|
||||
|
||||
advisorparam = {
|
||||
items: JSON.parse(JSON.stringify(data.Advisors)),
|
||||
selectedvalue: [],
|
||||
width: 120
|
||||
};
|
||||
advisor_editmultiselect = editmultiselect(advisorparam);
|
||||
$('#div_advisors').append(advisor_editmultiselect);
|
||||
$("#div_locations").dropdownSource(data.Locations);
|
||||
$("#div_advisors").dropdownSource(data.Advisors);
|
||||
}, function () {
|
||||
});
|
||||
}
|
||||
|
||||
function getParams(tid) {
|
||||
var startdate = htmlencode($('#startdatetxt').val());
|
||||
var enddate = htmlencode($('#enddatetxt').val());
|
||||
var begindate = $('#startdatetxt').val();
|
||||
var enddate = $('#enddatetxt').val();
|
||||
if (begindate && !$('#startdatetxt').is(':valid')) {
|
||||
showAlert(GetTextByKey('P_COMMON_BEGINDATEISINVALID', "The begin date is invalid."), GetTextByKey("P_FR_ERROR", 'Error'));
|
||||
return false;
|
||||
}
|
||||
if (enddate && !$('#enddatetxt').is(':valid')) {
|
||||
showAlert(GetTextByKey('P_COMMON_ENDDATEISINVALID', "The end date is invalid."), GetTextByKey("P_FR_ERROR", 'Error'));
|
||||
return false;
|
||||
}
|
||||
if (begindate && enddate && begindate > enddate) {
|
||||
showAlert(GetTextByKey("P_JS_ENDDATEMUSTBELATERTHANBEGINDATE", "End Date must be later than Begin Date."), GetTextByKey("P_FR_ERROR", 'Error'));
|
||||
return false;
|
||||
}
|
||||
|
||||
var locations = [];
|
||||
if (locationparam)
|
||||
locations = locationparam.selectedvalue;
|
||||
var advisors = [];
|
||||
if (advisorparam)
|
||||
advisors = advisorparam.selectedvalue;
|
||||
var locations = $("#div_locations").dropdownVals();
|
||||
var advisors = $("#div_advisors").dropdownVals();
|
||||
|
||||
return JSON.stringify([tid, startdate, enddate, JSON.stringify(locations), JSON.stringify(advisors)]);
|
||||
return JSON.stringify([tid, htmlencode(begindate), htmlencode(enddate), JSON.stringify(locations), JSON.stringify(advisors)]);
|
||||
}
|
||||
|
||||
var reportData;
|
||||
function OnRefresh() {
|
||||
showloading(true);
|
||||
var template = $('#templateselectinput').find("option:selected").val();
|
||||
var param = getParams(template);
|
||||
if (param == false)
|
||||
return;
|
||||
param = htmlencode(param);
|
||||
showloading(true);
|
||||
reportrequest('GetSurveyTemplateReport', param, function (data) {
|
||||
showloading(false);
|
||||
//console.log(data);
|
||||
@ -618,21 +521,40 @@
|
||||
var selectedTemplate = $('#templateselectinput').find("option:selected");
|
||||
var tid = Number(selectedTemplate.val());
|
||||
if (tid < 0) {
|
||||
showAlert(GetTextByKey("P_WO_XXXX", "Please select a template."), GetTextByKey("P_MR_PRINT", "Print"));
|
||||
showAlert(GetTextByKey("P_WO_PLEASESELECTATEMPLATE", "Please select a template."), GetTextByKey("P_MR_PRINT", "Print"));
|
||||
return;
|
||||
}
|
||||
var tname = encodeURIComponent(selectedTemplate.text());
|
||||
var start = encodeURIComponent($('#startdatetxt').val());
|
||||
var end = encodeURIComponent($('#enddatetxt').val());
|
||||
var locs = locationparam == null ? '' : encodeURIComponent(locationparam.selectedvalue.map(function (v) {
|
||||
var item = locationparam.items.filter(function (i) { return i.ID == v })[0];
|
||||
var begindate = $('#startdatetxt').val();
|
||||
var enddate = $('#enddatetxt').val();
|
||||
if (begindate && !$('#startdatetxt').is(':valid')) {
|
||||
showAlert(GetTextByKey('P_COMMON_BEGINDATEISINVALID', "The begin date is invalid."), GetTextByKey("P_FR_ERROR", 'Error'));
|
||||
return;
|
||||
}
|
||||
if (enddate && !$('#enddatetxt').is(':valid')) {
|
||||
showAlert(GetTextByKey('P_COMMON_ENDDATEISINVALID', "The end date is invalid."), GetTextByKey("P_FR_ERROR", 'Error'));
|
||||
return;
|
||||
}
|
||||
if (begindate && enddate && begindate > enddate) {
|
||||
showAlert(GetTextByKey("P_JS_ENDDATEMUSTBELATERTHANBEGINDATE", "End Date must be later than Begin Date."), GetTextByKey("P_FR_ERROR", 'Error'));
|
||||
return;
|
||||
}
|
||||
|
||||
var start = encodeURIComponent(begindate);
|
||||
var end = encodeURIComponent(enddate);
|
||||
|
||||
var locations = $("#div_locations").dropdownVals();
|
||||
var locs = locations == null ? '' : encodeURIComponent(locations.map(function (v) {
|
||||
var item = filterDataSource.Locations.filter(function (i) { return i.ID == v })[0];
|
||||
if (item != null) {
|
||||
return v + ';' + item.Name;
|
||||
}
|
||||
return v;
|
||||
}).join(','));
|
||||
var advs = advisorparam == null ? '' : encodeURIComponent(advisorparam.selectedvalue.map(function (v) {
|
||||
var item = advisorparam.items.filter(function (i) { return i.Key == v })[0];
|
||||
|
||||
var advisors = $("#div_advisors").dropdownVals();
|
||||
var advs = advisors == null ? '' : encodeURIComponent(advisors.map(function (v) {
|
||||
var item = filterDataSource.Advisors.filter(function (i) { return i.Key == v })[0];
|
||||
if (item != null) {
|
||||
return v + ';' + item.Value;
|
||||
}
|
||||
@ -644,12 +566,7 @@
|
||||
|
||||
var grid_contactdt;
|
||||
function InitContactGridData() {
|
||||
grid_contactdt = new GridView('#contactlist');
|
||||
grid_contactdt.lang = {
|
||||
all: GetTextByKey("P_GRID_ALL", "(All)"),
|
||||
ok: GetTextByKey("P_GRID_OK", "OK"),
|
||||
reset: GetTextByKey("P_GRID_RESET", "Reset")
|
||||
};
|
||||
grid_contactdt = createGridView('#contactlist');
|
||||
var list_columns = [
|
||||
{ name: 'DisplayName', caption: GetTextByKey("P_WO_CONTACTNAME", "Contact Name"), valueIndex: 'DisplayName', css: { 'width': 148, 'text-align': 'left' } },
|
||||
//{ name: 'ContactTypeName', caption: GetTextByKey("P_WO_CONTACTTYPE", "Contact Type"), valueIndex: 'ContactTypeName', css: { 'width': 148, 'text-align': 'left' } },
|
||||
@ -672,7 +589,7 @@
|
||||
}
|
||||
columns.push(col);
|
||||
}
|
||||
grid_contactdt.canMultiSelect = false;
|
||||
grid_contactdt.multiSelect = false;
|
||||
grid_contactdt.columns = columns;
|
||||
grid_contactdt.init();
|
||||
}
|
||||
@ -687,12 +604,10 @@
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
var r = data[i];
|
||||
var fr = {
|
||||
Values: {
|
||||
ID: r.ID,
|
||||
DisplayName: r.DisplayName,
|
||||
ContactTypeName: r.ContactTypeName,
|
||||
Email: false
|
||||
}
|
||||
ID: r.ID,
|
||||
DisplayName: r.DisplayName,
|
||||
ContactTypeName: r.ContactTypeName,
|
||||
Email: false
|
||||
};
|
||||
rows.push(fr);
|
||||
}
|
||||
@ -708,7 +623,7 @@
|
||||
var tid = Number(template);
|
||||
|
||||
if (isNaN(tid) || tid < 0) {
|
||||
showAlert(GetTextByKey("P_WO_XXXX", "Please select a template."), GetTextByKey("P_WO_SENDEMAIL", "Send Email"));
|
||||
showAlert(GetTextByKey("P_WO_PLEASESELECTATEMPLATE", "Please select a template."), GetTextByKey("P_WO_SENDEMAIL", "Send Email"));
|
||||
return;
|
||||
}
|
||||
$(document.body).css('overflow', 'hidden');
|
||||
@ -753,8 +668,9 @@
|
||||
}
|
||||
}
|
||||
|
||||
for (var i = 0; i < grid_contactdt.source.length; i++) {
|
||||
var ct = grid_contactdt.source[i].Values;
|
||||
var tempsource = grid_contactdt.source;
|
||||
for (var i = 0; i < tempsource.length; i++) {
|
||||
var ct = tempsource[i];
|
||||
if (ct.Email) {
|
||||
emailaddress.push({ 'Key': ct.DisplayName, 'Value': ct.ID });
|
||||
}
|
||||
@ -767,6 +683,8 @@
|
||||
|
||||
var template = $('#templateselectinput').find("option:selected").val();
|
||||
var param = getParams(template);
|
||||
if (param == false)
|
||||
return;
|
||||
reportrequest('GetSurveyTemplateEmail', encodeURIComponent(param + String.fromCharCode(170) + JSON.stringify(emailaddress)), function (data) {
|
||||
if (typeof data === 'string') {
|
||||
_dialog.showAlert(data, alerttitle);
|
||||
@ -783,30 +701,26 @@
|
||||
GetTemplateData();
|
||||
GetFilterDataSource();
|
||||
|
||||
$("#div_locations").css('width', 120).dropdown([], {
|
||||
search: true,
|
||||
multiselect: true,
|
||||
allowselectall: true,
|
||||
textKey: 'Name',
|
||||
valueKey: 'ID'
|
||||
});
|
||||
|
||||
$("#div_advisors").css('width', 120).dropdown([], {
|
||||
search: true,
|
||||
multiselect: true,
|
||||
allowselectall: true,
|
||||
textKey: 'Value',
|
||||
valueKey: 'Key'
|
||||
});
|
||||
|
||||
$('.emailpopus-close').on('click', function () {
|
||||
hideSendEmailPopup();
|
||||
});
|
||||
|
||||
$('#startdatetxt').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]);
|
||||
}
|
||||
});
|
||||
|
||||
$('#enddatetxt').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]);
|
||||
}
|
||||
});
|
||||
|
||||
$('#templateselectinput').change(function () { OnRefresh(); });
|
||||
|
||||
});
|
||||
@ -840,11 +754,11 @@
|
||||
</div>
|
||||
<span style="margin-left: 5px;" data-lgid="P_FR_BEGINDATE_COLON">Begin Date: </span>
|
||||
<div>
|
||||
<input id="startdatetxt" type="text" style="width: 80px; margin-left: 5px;" autocomplete="off" />
|
||||
<input id="startdatetxt" type="date" class="type-date" required min="1900-01-01" style="width: 90px; margin-left: 5px;" autocomplete="off" />
|
||||
</div>
|
||||
<span style="margin-left: 5px;" data-lgid="P_FR_ENDDATE_COLON">End Date: </span>
|
||||
<div>
|
||||
<input id="enddatetxt" type="text" style="width: 80px; margin-left: 5px;" autocomplete="off" />
|
||||
<input id="enddatetxt" type="date" class="type-date" required min="1900-01-01" style="width: 80px; margin-left: 5px;" autocomplete="off" />
|
||||
</div>
|
||||
<span data-lgid="P_WO_LOCATION_COLON">Location:</span>
|
||||
<div id="div_locations"></div>
|
||||
@ -859,29 +773,34 @@
|
||||
<br />
|
||||
<div id="surveyreport"></div>
|
||||
|
||||
<div id="mask_bg" style="display: none;"><div class="loading c-spin"></div></div>
|
||||
<div id="mask_bg" style="display: none;">
|
||||
<div class="loading c-spin"></div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="sendemailpopupmask" class="maskbg" style="display: none;"></div>
|
||||
<div class="dialog" id="sendemailpopupdialog" style="display: none; width: 480px">
|
||||
<div class="dialog-title"><span class="title" data-lgid="P_WO_XXXX">Send Survey Report</span><em class="emailpopus-close"></em></div>
|
||||
<div class="dialog-content" style="height: 350px">
|
||||
<table>
|
||||
<div class="dialog" id="sendemailpopupdialog" style="display: none; width: 510px">
|
||||
<div class="dialog-title"><span class="title" data-lgid="P_WOS_SENDSURVEYREPORT">Send Survey Report</span><em class="emailpopus-close"></em></div>
|
||||
<div class="dialog-content">
|
||||
<table style="line-height: 24px;">
|
||||
<tr>
|
||||
<td data-lgid="P_WO_SENDTHISTO">Who do you want to send this to? Select from existing relationships or manual entry.</td>
|
||||
<td colspan="2" data-lgid="P_WO_SENDTHISTO">Who do you want to send this to? Select from existing relationships or manual entry.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<div id="contactlist" style="height: 240px; width: 420px; margin-left: 10px; margin-right: 10px;"></div>
|
||||
<td colspan="2" style="text-align: right; padding-right: 5px;">
|
||||
<div id="contactlist" style="height: 240px; width: 470px; margin-left: 10px; margin-right: 10px;"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td data-lgid="P_WO_EMAILADDRESSESTIPS">Separate multiple manually entered email addresses with a semi-colon (;).</td>
|
||||
<td colspan="2" data-lgid="P_WO_EMAILADDRESSESTIPS">Separate multiple manually entered email addresses with a semi-colon (;).</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span data-lgid="P_WO_OTHEREMAILADDRESS">Other Email Address</span>
|
||||
<input type="text" id="email_otheremailaddress" style="width: 312px;" autocomplete="off" /></td>
|
||||
<td style="text-align: right; padding-right: 5px;">
|
||||
<span data-lgid="P_WO_OTHEREMAILADDRESS">Other Email Address</span>
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" id="email_otheremailaddress" style="width: 350px;" autocomplete="off" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
@ -1,7 +1,6 @@
|
||||
<%@ Page Title="" Language="C#" MasterPageFile="~/Maintenance/MaintenanceBase.master" AutoEventWireup="true" CodeFile="WorkOrderHistory.aspx.cs" Inherits="WorkOrderHistory" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
|
||||
<link href="../css/jquery.datetimepicker.css" rel="stylesheet" />
|
||||
<style type="text/css">
|
||||
.no_wrap th {
|
||||
white-space: nowrap;
|
||||
@ -16,28 +15,6 @@
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.dialog-content table {
|
||||
border-collapse: collapse;
|
||||
width: 100%;
|
||||
line-height: 32px;
|
||||
}
|
||||
|
||||
.dialog-content table td.label {
|
||||
width: 130px;
|
||||
text-align: right;
|
||||
padding-right: 10px;
|
||||
line-height: 24px;
|
||||
height: 24px;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.dialog-content table td input,
|
||||
.dialog-content table td textarea {
|
||||
border: 1px solid #a9a9a9;
|
||||
width: 250px;
|
||||
height: 18px;
|
||||
padding: 1px;
|
||||
}
|
||||
|
||||
#dialog_machines .dialog-content table td input {
|
||||
width: auto;
|
||||
@ -147,8 +124,6 @@
|
||||
padding-left: 5px;
|
||||
}
|
||||
</style>
|
||||
<script src="<%=GetFileUrlWithVersion("../js/jquery.datetimepicker.full.js")%>" type="text/javascript"></script>
|
||||
<script src="<%=GetFileUrlWithVersion("../js/editableselect.js")%>"></script>
|
||||
<script src="<%=GetFileUrlWithVersion("js/controls.js")%>" type="text/javascript"></script>
|
||||
<script type="text/javascript">
|
||||
woquery = function (method, param, callback, error) {
|
||||
@ -165,13 +140,27 @@
|
||||
if (!woid) {
|
||||
return;
|
||||
}
|
||||
|
||||
var begindate = $('#startdatetxt').val();
|
||||
var enddate = $('#enddatetxt').val();
|
||||
if (begindate && !$('#startdatetxt').is(':valid')) {
|
||||
showAlert(GetTextByKey('P_COMMON_BEGINDATEISINVALID', "The begin date is invalid."), GetTextByKey("P_FR_ERROR", 'Error'));
|
||||
return;
|
||||
}
|
||||
if (enddate && !$('#enddatetxt').is(':valid')) {
|
||||
showAlert(GetTextByKey('P_COMMON_ENDDATEISINVALID', "The end date is invalid."), GetTextByKey("P_FR_ERROR", 'Error'));
|
||||
return;
|
||||
}
|
||||
if (begindate && enddate && begindate > enddate) {
|
||||
showAlert(GetTextByKey("P_JS_ENDDATEMUSTBELATERTHANBEGINDATE", "End Date must be later than Begin Date."), GetTextByKey("P_FR_ERROR", 'Error'));
|
||||
return;
|
||||
}
|
||||
|
||||
showloading(true);
|
||||
|
||||
var beginDate = $('#startdatetxt').val();
|
||||
var endDate = $('#enddatetxt').val();
|
||||
var searchtxt = "";
|
||||
searchtxt = htmlencode($.trim($('#searchinputtxt').val()));
|
||||
woquery('GetWorkOrderHistorys', JSON.stringify([woid, beginDate, endDate, searchtxt]), function (data) {
|
||||
woquery('GetWorkOrderHistorys', JSON.stringify([woid, begindate, enddate, searchtxt]), function (data) {
|
||||
showloading(false);
|
||||
if (typeof (data) === "string") {
|
||||
showAlert(data, GetTextByKey('P_WORKORDER', "Work Order"));
|
||||
@ -196,184 +185,190 @@
|
||||
var status = "";
|
||||
var category = "";
|
||||
if (r.UpdateType == 0)
|
||||
type = GetTextByKey('P_WO_XXX', 'Manually');
|
||||
type = GetTextByKey('P_WO_HIS_MANUALLY', 'Manually');
|
||||
else if (r.UpdateType == 1)
|
||||
type = GetTextByKey('P_WO_XXX', 'Automatically');
|
||||
type = GetTextByKey('P_WO_HIS_AUTOMATICALLY', 'Automatically');
|
||||
else if (r.UpdateType == 2)
|
||||
type = GetTextByKey('P_WO_XXX', 'System');
|
||||
type = GetTextByKey('P_WO_HIS_SYSTEM', 'System');
|
||||
|
||||
if (r.UpdateStatus == 0)
|
||||
status = GetTextByKey('P_WO_XXX', 'Created');
|
||||
status = GetTextByKey('P_WO_HIS_CREATED', 'Created');
|
||||
else if (r.UpdateStatus == 1 || r.UpdateStatus == 4 || r.UpdateStatus == 9999)
|
||||
status = GetTextByKey('P_WO_XXX', 'Modified');
|
||||
status = GetTextByKey('P_WO_HIS_MODIFIED', 'Modified');
|
||||
else if (r.UpdateStatus == 2)
|
||||
status = GetTextByKey('P_WO_XXX', 'Closed');
|
||||
status = GetTextByKey('P_WO_HIS_CLOSED', 'Closed');
|
||||
else if (r.UpdateStatus == 3)
|
||||
status = GetTextByKey('P_WO_XXX', 'Re_Opened');
|
||||
status = GetTextByKey('P_WO_HIS_REOPENED', 'Re_Opened');
|
||||
//else if (r.UpdateStatus == 4)
|
||||
// status = GetTextByKey('P_WO_XXX', 'Restored');
|
||||
// status = GetTextByKey('P_WO_HIS_RESTORED', 'Restored');
|
||||
//else if (r.UpdateStatus == 9999)
|
||||
// status = GetTextByKey('P_WO_XXX', 'Deleted');
|
||||
// status = GetTextByKey('P_WO_HIS_DELETED', 'Deleted');
|
||||
|
||||
switch (r.Category) {
|
||||
case 0:
|
||||
category = GetTextByKey('P_WO_XXX', 'Work Order Status');
|
||||
category = GetTextByKey('P_WO_WORKORDERSTATUS', 'Work Order Status');
|
||||
break;
|
||||
case 1:
|
||||
category = GetTextByKey('P_WO_XXX', 'Assigned To');
|
||||
category = GetTextByKey('P_WO_ASSIGNEDTO', 'Assigned To');
|
||||
break;
|
||||
case 2:
|
||||
category = GetTextByKey('P_WO_XXX', 'Advisor');
|
||||
category = GetTextByKey('P_WO_ADVISOR', 'Advisor');
|
||||
break;
|
||||
case 3:
|
||||
category = GetTextByKey('P_WO_XXX', 'Work Order Type');
|
||||
category = GetTextByKey('P_WO_WORKORDERTYPE', 'Work Order Type');
|
||||
break;
|
||||
case 4:
|
||||
category = GetTextByKey('P_WO_XXX', 'Location');
|
||||
category = GetTextByKey('P_WO_LOCATION', 'Location');
|
||||
break;
|
||||
case 5:
|
||||
category = GetTextByKey('P_WO_XXX', 'Department');
|
||||
category = GetTextByKey('P_WO_DEPARTMENT', 'Department');
|
||||
break;
|
||||
case 6:
|
||||
category = GetTextByKey('P_WO_XXX', 'Alternate Status');
|
||||
category = GetTextByKey('P_WO_ALTERNATESTATUS', 'Alternate Status');
|
||||
break;
|
||||
case 7:
|
||||
category = GetTextByKey('P_WO_XXX', 'Description');
|
||||
category = GetTextByKey('P_WO_DESCRIPTION', 'Description');
|
||||
break;
|
||||
case 8:
|
||||
category = GetTextByKey('P_WO_XXX', 'Invoice Number');
|
||||
category = GetTextByKey('P_WO_INVOICENUMBER', 'Invoice Number');
|
||||
break;
|
||||
case 9:
|
||||
category = GetTextByKey('P_WO_XXX', 'Internal ID');
|
||||
category = GetTextByKey('P_WO_INTERNALID', 'Internal ID');
|
||||
break;
|
||||
case 10:
|
||||
category = GetTextByKey('P_WO_XXX', 'Complete Date');
|
||||
category = GetTextByKey('P_WO_COMPLETEDATE', 'Complete Date');
|
||||
break;
|
||||
case 11:
|
||||
category = GetTextByKey('P_WO_XXX', 'Next Follow Up Date');
|
||||
category = GetTextByKey('P_WO_NEXTFOLLOWUPDATE', 'Next Follow Up Date');
|
||||
break;
|
||||
case 12:
|
||||
category = GetTextByKey('P_WO_XXX', 'Due Date');
|
||||
category = GetTextByKey('P_WO_DUEDATE', 'Due Date');
|
||||
break;
|
||||
case 13:
|
||||
category = GetTextByKey('P_WO_XXX', 'Parts Expected Date');
|
||||
category = GetTextByKey('P_WO_PARTSEXPECTEDDATE', 'Parts Expected Date');
|
||||
break;
|
||||
case 14:
|
||||
category = GetTextByKey('P_WO_XXX', 'Last Labor Date');
|
||||
category = GetTextByKey('P_WO_LASTLABORDATE', 'Last Labor Date');
|
||||
break;
|
||||
case 15:
|
||||
category = GetTextByKey('P_WO_XXX', 'Total Cost');
|
||||
category = GetTextByKey('P_WO_TOTALCOST', 'Total Cost');
|
||||
break;
|
||||
case 16:
|
||||
category = GetTextByKey('P_WO_XXX', 'Expected Cost');
|
||||
category = GetTextByKey('P_WO_EXPECTEDCOST', 'Expected Cost');
|
||||
break;
|
||||
case 17:
|
||||
category = GetTextByKey('P_WO_XXX', 'Parts Cost');
|
||||
category = GetTextByKey('P_WO_PARTSCOST1', 'Parts Cost');
|
||||
break;
|
||||
case 18:
|
||||
category = GetTextByKey('P_WO_XXX', 'Travel Time Cost');
|
||||
category = GetTextByKey('P_WO_TRAVELTIMECOST1', 'Travel Time Cost');
|
||||
break;
|
||||
case 19:
|
||||
category = GetTextByKey('P_WO_XXX', 'Labor Cost');
|
||||
category = GetTextByKey('P_WO_LABORCOST1', 'Labor Cost');
|
||||
break;
|
||||
case 20:
|
||||
category = GetTextByKey('P_WO_XXX', 'Other Cost');
|
||||
category = GetTextByKey('P_WO_OTHERCOST1', 'Other Cost');
|
||||
break;
|
||||
case 21:
|
||||
category = GetTextByKey('P_WO_XXX', 'Estimate');
|
||||
category = GetTextByKey('P_WO_ESTIMATE', 'Estimate');
|
||||
break;
|
||||
case 22:
|
||||
category = GetTextByKey('P_WO_XXX', 'Inspection');
|
||||
category = GetTextByKey('P_WO_INSPECTION', 'Inspection');
|
||||
break;
|
||||
case 23:
|
||||
category = GetTextByKey('P_WO_XXX', 'Invoice');
|
||||
category = GetTextByKey('P_WO_INVOICE', 'Invoice');
|
||||
break;
|
||||
case 24:
|
||||
category = GetTextByKey('P_WO_XXX', 'Segment User');
|
||||
category = GetTextByKey('P_WO_SEGMENTUSER', 'Segment User');
|
||||
break;
|
||||
case 25:
|
||||
category = GetTextByKey('P_WO_XXX', 'Segment Hours');
|
||||
category = GetTextByKey('P_WO_SEGMENTHOURS', 'Segment Hours');
|
||||
break;
|
||||
case 26:
|
||||
category = GetTextByKey('P_WO_XXX', 'Segment Jobsite');
|
||||
category = GetTextByKey('P_WO_SEGMENTJOBSITE', 'Segment Jobsite');
|
||||
break;
|
||||
case 27:
|
||||
category = GetTextByKey('P_WO_XXX', 'Segment Cost');
|
||||
category = GetTextByKey('P_WO_SEGMENTCOST', 'Segment Cost');
|
||||
break;
|
||||
case 28:
|
||||
category = GetTextByKey('P_WO_XXX', 'Segment Component');
|
||||
category = GetTextByKey('P_WO_SEGMENTCOMPONENT', 'Segment Component');
|
||||
break;
|
||||
case 29:
|
||||
category = GetTextByKey('P_WO_XXX', 'Segment Completed');
|
||||
category = GetTextByKey('P_WO_SEGMENTCOMPLETED', 'Segment Completed');
|
||||
break;
|
||||
case 30:
|
||||
category = GetTextByKey('P_WO_XXX', 'Segment Completed Date');
|
||||
category = GetTextByKey('P_WO_SEGMENTCOMPLETEDDATE', 'Segment Completed Date');
|
||||
break;
|
||||
case 31:
|
||||
category = GetTextByKey('P_WO_XXX', 'Segment Description');
|
||||
category = GetTextByKey('P_WO_SEGMENTDESCRIPTION', 'Segment Description');
|
||||
break;
|
||||
case 32:
|
||||
category = GetTextByKey('P_WO_XXX', 'Segment Notes');
|
||||
category = GetTextByKey('P_WO_SEGMENTNOTES', 'Segment Notes');
|
||||
break;
|
||||
case 33:
|
||||
category = GetTextByKey('P_WO_XXX', 'Segment');
|
||||
category = GetTextByKey('P_WO_SEGMENT', 'Segment');
|
||||
break;
|
||||
case 34:
|
||||
category = GetTextByKey('P_WO_XXX', 'Alerts');
|
||||
category = GetTextByKey('P_WO_ALERTS', 'Alerts');
|
||||
break;
|
||||
case 35:
|
||||
category = GetTextByKey('P_WO_XXX', 'Segment Type');
|
||||
category = GetTextByKey('P_WO_SEGMENTTYPE', 'Segment Type');
|
||||
break;
|
||||
case 36:
|
||||
category = GetTextByKey('P_WO_XXX', 'Segment Billable');
|
||||
category = GetTextByKey('P_WO_SEGMENTBILLABLE', 'Segment Billable');
|
||||
break;
|
||||
case 37:
|
||||
category = GetTextByKey('P_WO_XXX', 'Component');
|
||||
category = GetTextByKey('P_WO_COMPONENT', 'Component');
|
||||
break;
|
||||
case 38:
|
||||
category = GetTextByKey('P_WO_XXX', 'Billable');
|
||||
category = GetTextByKey('P_WO_BILLABLE', 'Billable');
|
||||
break;
|
||||
case 39:
|
||||
category = GetTextByKey('P_WO_XXX', 'Bill to job');
|
||||
category = GetTextByKey('P_WO_BILLTOJOB', 'Bill to job');
|
||||
break;
|
||||
case 40:
|
||||
category = GetTextByKey('P_WO_XXX', 'Work Order Attachment');
|
||||
category = GetTextByKey('P_WO_WORKORDERATTACHMENT', 'Work Order Attachment');
|
||||
break;
|
||||
case 41:
|
||||
category = GetTextByKey('P_WO_XXX', 'Estimate Attachment');
|
||||
category = GetTextByKey('P_WO_ESTIMATEATTACHMENT', 'Estimate Attachment');
|
||||
break;
|
||||
case 42:
|
||||
category = GetTextByKey('P_WO_XXX', 'Invoice Attachment');
|
||||
category = GetTextByKey('P_WO_INVOICEATTACHMENT', 'Invoice Attachment');
|
||||
break;
|
||||
case 43:
|
||||
category = GetTextByKey('P_WO_XXX', 'Company Name');
|
||||
category = GetTextByKey('P_WO_COMPANYNAME', 'Company Name');
|
||||
break;
|
||||
case 44:
|
||||
category = GetTextByKey('P_WO_XXX', 'Asset');
|
||||
category = GetTextByKey('P_WO_ASSET', 'Asset');
|
||||
break;
|
||||
case 45:
|
||||
category = GetTextByKey('P_WO_XXX', 'Parts Order Number');
|
||||
category = GetTextByKey('P_WO_PARTSORDERNUMBER', 'Parts Order Number');
|
||||
break;
|
||||
case 46:
|
||||
category = GetTextByKey('P_WO_XXX', 'Parts Status');
|
||||
category = GetTextByKey('P_WO_PARTSSTATUS', 'Parts Status');
|
||||
break;
|
||||
case 47:
|
||||
category = GetTextByKey('P_WO_XXX', 'Salesperson');
|
||||
category = GetTextByKey('P_WO_SALESPERSON', 'Salesperson');
|
||||
break;
|
||||
case 48:
|
||||
category = GetTextByKey('P_WO_XXX', 'Inspection Template');
|
||||
category = GetTextByKey('P_WO_INSPECTIONTEMPLATE', 'Inspection Template');
|
||||
break;
|
||||
case 49:
|
||||
category = GetTextByKey('P_WO_MESSAGESTATUS', 'Message Status');
|
||||
break;
|
||||
case 50:
|
||||
category = GetTextByKey('P_WO_PONUMBER', 'PO Number');
|
||||
break;
|
||||
case 97:
|
||||
category = GetTextByKey('P_WO_XXX', 'Deleted');
|
||||
category = GetTextByKey('P_WO_HIS_DELETED', 'Deleted');
|
||||
break;
|
||||
case 98:
|
||||
category = GetTextByKey('P_WO_XXX', 'Restored');
|
||||
category = GetTextByKey('P_WO_HIS_RESTORED', 'Restored');
|
||||
break;
|
||||
case 99:
|
||||
category = GetTextByKey('P_WO_XXX', 'WO Life Cycle');
|
||||
category = GetTextByKey('P_WO_HIS_WOLIFECYCLE', 'WO Life Cycle');
|
||||
break;
|
||||
default:
|
||||
category = GetTextByKey('P_WO_XXX', 'Other');
|
||||
category = GetTextByKey('P_WO_HIS_OTHER', 'Other');
|
||||
break;
|
||||
}
|
||||
|
||||
@ -394,7 +389,7 @@
|
||||
var td_del = $("<td></td>");
|
||||
tr.append(td_del);
|
||||
if (r.UpdateStatus == 9999 && r.CanDeleteAndRestore) {
|
||||
var span_del = $('<a href="#" data-lgid="P_UM_XXXX">Restore</a>').data('wo', r).click(ManageDeleteAndRestore);
|
||||
var span_del = $('<a href="#" data-lgid="P_WO_HIS_RESTORED">Restore</a>').data('wo', r).click(ManageDeleteAndRestore);
|
||||
td_del.append(span_del);
|
||||
}
|
||||
if (i % 2 == 1)
|
||||
@ -415,12 +410,12 @@
|
||||
return;
|
||||
|
||||
var alerttitle = GetTextByKey('P_WORKORDER', "Work Order");
|
||||
showConfirm(GetTextByKey("P_WO_XXX", 'Are you sure you want to restore this work order?'), alerttitle, function () {
|
||||
showConfirm(GetTextByKey("P_WO_HIS_AREYOUSUREYOUWANTTORESTORETHISWORKORDER", 'Are you sure you want to restore this work order?'), alerttitle, function () {
|
||||
woquery("RestoreDeleteWorkOrder", wo.WorkOrderId, function (data) {
|
||||
if (data == "OK")
|
||||
OnRefresh();
|
||||
}, function (err) {
|
||||
showAlert(GetTextByKey("P_WO_XXX", 'Failed to restore this work order.'), alerttitle);
|
||||
showAlert(GetTextByKey("P_WO_HIS_FAILEDTORESTORETHISWORKORDER", 'Failed to restore this work order.'), alerttitle);
|
||||
});
|
||||
});
|
||||
}
|
||||
@ -446,27 +441,6 @@
|
||||
|
||||
GetWorkOrderNumbers();
|
||||
OnRefresh();
|
||||
|
||||
$('#startdatetxt').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]);
|
||||
}
|
||||
});
|
||||
|
||||
$('#enddatetxt').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]);
|
||||
}
|
||||
});
|
||||
|
||||
$('#searchinputtxt').keydown(searchEnter);
|
||||
$(window).resize(function () {
|
||||
$("#divwoh").css("height", $(window).height() - $("#divwoh").offset().top - 4);
|
||||
@ -491,28 +465,40 @@
|
||||
return;
|
||||
}
|
||||
|
||||
var from = $('#startdatetxt').val();
|
||||
var to = $('#enddatetxt').val();
|
||||
var searchtxt = "";
|
||||
var begindate = $('#startdatetxt').val();
|
||||
var enddate = $('#enddatetxt').val();
|
||||
if (begindate && !$('#startdatetxt').is(':valid')) {
|
||||
showAlert(GetTextByKey('P_COMMON_BEGINDATEISINVALID', "The begin date is invalid."), GetTextByKey("P_FR_ERROR", 'Error'));
|
||||
return;
|
||||
}
|
||||
if (enddate && !$('#enddatetxt').is(':valid')) {
|
||||
showAlert(GetTextByKey('P_COMMON_ENDDATEISINVALID', "The end date is invalid."), GetTextByKey("P_FR_ERROR", 'Error'));
|
||||
return;
|
||||
}
|
||||
if (begindate && enddate && begindate > enddate) {
|
||||
showAlert(GetTextByKey("P_JS_ENDDATEMUSTBELATERTHANBEGINDATE", "End Date must be later than Begin Date."), GetTextByKey("P_FR_ERROR", 'Error'));
|
||||
return;
|
||||
}
|
||||
|
||||
window.open("../ExportToFile.aspx?type=wohis&t=" + searchtxt + "&from=" + from + "&to=" + to + "&woid=" + woid);
|
||||
var searchtxt = "";
|
||||
window.open("../ExportToFile.aspx?type=wohis&t=" + searchtxt + "&from=" + begindate + "&to=" + enddate + "&woid=" + woid);
|
||||
}
|
||||
</script>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
|
||||
<div style="min-width: 400px;">
|
||||
<div class="page_title" data-lgid="P_XXX">Work Order History</div>
|
||||
<div class="page_title" data-lgid="P_WO_HIS_WORKORDERHISTORY">Work Order History</div>
|
||||
<div class="search_bar">
|
||||
<input type="password" autocomplete="new-password" style="display: none" />
|
||||
<span data-lgid="P_XXX">Work Order Number:</span>
|
||||
<span data-lgid="P_WO_WORKORDERNUMBER_COLON">Work Order Number:</span>
|
||||
<div class="dropdown" id="div_wonumber" style="width: 200px"></div>
|
||||
<span style="margin-left: 5px;" data-lgid="P_FR_BEGINDATE_COLON">Begin Date: </span>
|
||||
<div>
|
||||
<input id="startdatetxt" type="text" style="width: 80px; margin-left: 5px;" value="<%=BeginDate %>" autocomplete="off" />
|
||||
<input id="startdatetxt" type="date" class="type-date" required min="1900-01-01" style="width: 90px; margin-left: 5px;" value="<%=BeginDate %>" autocomplete="off" />
|
||||
</div>
|
||||
<span style="margin-left: 5px;" data-lgid="P_FR_ENDDATE_COLON">End Date: </span>
|
||||
<div>
|
||||
<input id="enddatetxt" type="text" style="width: 80px; margin-left: 5px;" value="<%=EndDate %>" autocomplete="off" />
|
||||
<input id="enddatetxt" type="date" class="type-date" required min="1900-01-01" style="width: 90px; margin-left: 5px;" value="<%=EndDate %>" autocomplete="off" />
|
||||
</div>
|
||||
<div style="display: none;">
|
||||
<input id="searchinputtxt" autocomplete="off" style="width: 100px; margin-left: 5px;" />
|
||||
@ -528,12 +514,12 @@
|
||||
<table id="tbwoh" style="min-width: 1250px; table-layout: fixed;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 150px;" data-lgid="P_XXX">Date/Time Stamp</th>
|
||||
<th style="width: 80px;" data-lgid="P_XXX">Update</th>
|
||||
<th style="width: 120px;" data-lgid="P_XXX">Update Type</th>
|
||||
<th style="width: 200px;" data-lgid="P_XXX">By</th>
|
||||
<th style="width: 200px;" data-lgid="P_XXX">Category</th>
|
||||
<th style="width: 400px;" data-lgid="P_XXX">Detail</th>
|
||||
<th style="width: 150px;" data-lgid="P_WO_HIS_DATETIMESTAMP">Date/Time Stamp</th>
|
||||
<th style="width: 80px;" data-lgid="P_WO_HIS_UPDATE">Update</th>
|
||||
<th style="width: 120px;" data-lgid="P_WO_HIS_UPDATETYPE">Update Type</th>
|
||||
<th style="width: 200px;" data-lgid="P_WO_HIS_BY">By</th>
|
||||
<th style="width: 200px;" data-lgid="P_WO_HIS_CATEGORY">Category</th>
|
||||
<th style="width: 400px;" data-lgid="P_WO_HIS_DETAIL">Detail</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
@ -39,8 +39,8 @@ public partial class WorkOrderHistory : WorkOrderBasePage
|
||||
RedirectToLoginPage();
|
||||
|
||||
DateTime userlocaldate = SystemParams.ConvertToUserTimeFromUtc(GetCurrentLoginSession().User, DateTime.UtcNow);
|
||||
BeginDate = userlocaldate.AddMonths(-1).ToShortDateString();
|
||||
EndDate = userlocaldate.ToShortDateString();
|
||||
BeginDate = userlocaldate.AddMonths(-1).ToString("yyyy-MM-dd");
|
||||
EndDate = userlocaldate.ToString("yyyy-MM-dd");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -26,7 +26,10 @@ public partial class Maintenance_WorkOrderMaintenance : WorkOrderBasePage
|
||||
public bool AllowInspection = false;
|
||||
public bool AllowReassignWorkorders = false;
|
||||
public bool AllowDeleteAtta = false;
|
||||
public bool CanOpenWO = false;
|
||||
protected string CID = "";
|
||||
|
||||
protected string WorkOrderListApiAddress = "";
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
string methodName = Request.Form["MethodName"];
|
||||
@ -48,7 +51,8 @@ public partial class Maintenance_WorkOrderMaintenance : WorkOrderBasePage
|
||||
|
||||
bool permission = CheckRight(SystemParams.CompanyID, Feature.WORK_ORDER);
|
||||
if (!permission)
|
||||
RedirectToLoginPage();
|
||||
RedirectToLoginPage();
|
||||
CanOpenWO= CheckRight(SystemParams.CompanyID, Feature.OPENWORKORDERS);
|
||||
WOReadOnly = CheckReadonly(SystemParams.CompanyID, Feature.WORK_ORDER);
|
||||
AllowWorkOrderConfiguration = CheckRight(SystemParams.CompanyID, Feature.WORKORDERCONFIGURATION);
|
||||
|
||||
@ -72,11 +76,26 @@ public partial class Maintenance_WorkOrderMaintenance : WorkOrderBasePage
|
||||
AssetID = Request.Params["mid"] ?? "";
|
||||
InDialog = Request.Params["InDialog"] == "1";
|
||||
|
||||
MSGWebSocketURL = SystemParams.WebSocketURL + "&msgcodes=500,501,502,503,504,505,506,507";
|
||||
if (!Request.Url.AbsoluteUri.Contains("test.tsanie.org") && "https".Equals(Request.Url.Scheme, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
MSGWebSocketURL = SystemParams.CurrentCustomerParams.WebSocketURL + "?custid=" + SystemParams.CompanyID + "&msgcodes=500,501,502,503,504,505,506,507,508,509,510,511,512,513";
|
||||
}
|
||||
CID = SystemParams.CompanyID;
|
||||
|
||||
DateTime userlocaldate = SystemParams.ConvertToUserTimeFromUtc(GetCurrentLoginSession().User, DateTime.UtcNow);
|
||||
NowDate = userlocaldate.ToShortDateString();
|
||||
|
||||
if (!Request.Url.AbsoluteUri.Contains("test.tsanie.org") && "https".Equals(Request.Url.Scheme, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
WorkOrderListApiAddress = SystemParams.CurrentCustomerParams.WorkOrderListApiAddress;
|
||||
}
|
||||
}
|
||||
}
|
||||
public string CompanyID
|
||||
{
|
||||
get
|
||||
{
|
||||
return SystemParams.CompanyID;
|
||||
}
|
||||
}
|
||||
|
||||
|
93
Site/Maintenance/WorkOrderPlansManagement.aspx
Normal file
93
Site/Maintenance/WorkOrderPlansManagement.aspx
Normal file
@ -0,0 +1,93 @@
|
||||
<%@ Page Title="" Language="C#" MasterPageFile="~/Maintenance/MaintenanceBase.master" AutoEventWireup="true" CodeFile="WorkOrderPlansManagement.aspx.cs" Inherits="WorkOrderPlansManagement" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
|
||||
<link rel="stylesheet" href="<%=GetFileUrlWithVersion("../css/datepicker.min.css") %>" type="text/css" />
|
||||
<link rel="stylesheet" href="<%=GetFileUrlWithVersion("../js/lib/element.min.css") %>" type="text/css" />
|
||||
<script src="<%=GetFileUrlWithVersion("../js/datepicker.min.js")%>" type="text/javascript"></script>
|
||||
<script src="<%=GetFileUrlWithVersion("../js/lib/element.min.js")%>" type="text/javascript"></script>
|
||||
<style type="text/css">
|
||||
.label {
|
||||
min-width: 100px;
|
||||
font-weight: bold;
|
||||
padding-right: 10px;
|
||||
text-align: right;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
var scheduleItem;
|
||||
|
||||
function worequest(method, param, callback, error) {
|
||||
_network.request("Maintenance/WorkOrderPlansManagement.aspx", -1, method, param, callback, error || function (e) {
|
||||
console.log(e);
|
||||
showmaskbg(false, true);
|
||||
showAlert(GetTextByKey('P_UM_PAGEERROR', 'An unknown error occurred. Please refresh page.'), GetTextByKey('P_UM_QUERY', 'Query'));
|
||||
});
|
||||
}
|
||||
|
||||
function OnRefresh() {
|
||||
showloading(true);
|
||||
worequest("GetPlanConfiguration", "", function (data) {
|
||||
showloading(false);
|
||||
if (typeof data === 'string') {
|
||||
showAlert(data, GetTextByKey('P_UM_QUERY', 'Query'));
|
||||
} else {
|
||||
scheduleItem.setParameters(data);
|
||||
}
|
||||
}, function (err) {
|
||||
showloading(false);
|
||||
});
|
||||
}
|
||||
|
||||
function OnSave() {
|
||||
var errors = $('.schedule-item-container').find('.validation-error');
|
||||
if (errors.length > 0) {
|
||||
showAlert(GetTextByKey('P_WO_INPUTISINVALID', 'The input value is invalid.'), GetTextByKey("P_WO_PLANS", 'Plans'), null, function () { $(errors[0]).focus() });
|
||||
return;
|
||||
}
|
||||
var p = scheduleItem.getParameters();
|
||||
var start = new Date(p.Schedule.StartDate);
|
||||
var end = new Date(p.Schedule.EndDate);
|
||||
if (start > end) {
|
||||
showAlert(GetTextByKey('P_JS_ENDDATEMUSTBELATERTHANBEGINDATE1', 'End Date must be later than Begin Date. Please select another date range.'), GetTextByKey("P_WO_PLANS", 'Plans'));
|
||||
return;
|
||||
}
|
||||
showloading(true);
|
||||
worequest('UpdatePlanConfiguration', encodeURIComponent(JSON.stringify(p)), function (data) {
|
||||
showloading(false);
|
||||
if (data !== 'OK') {
|
||||
showAlert(data, GetTextByKey('P_UM_QUERY', 'Query'));
|
||||
} else {
|
||||
showAlert(GetTextByKey("P_MV_SAVSUCCESSFULLY", 'Saved successfully.'), GetTextByKey("P_WO_PLANS", 'Plans'));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function OnExit(type) {
|
||||
window.parent.CloseWOPlansDialog(type);
|
||||
}
|
||||
|
||||
$(function () {
|
||||
setPageTitle(GetTextByKey("P_WO_PLANS", 'Plans'), true);
|
||||
scheduleItem = new window['lib-element'].ScheduleItem();
|
||||
document.querySelector('.content_main').replaceChildren(scheduleItem.create());
|
||||
OnRefresh();
|
||||
});
|
||||
|
||||
</script>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
|
||||
<div style="padding: 0px; margin: 0px;">
|
||||
<div class="page_title" data-lgid="P_WO_PLANS">Plans</div>
|
||||
<div class="function_title">
|
||||
<span class="sbutton iconsave" onclick="OnSave();" data-lgid="P_SET_SAVE">Save</span>
|
||||
<span class="sbutton iconrefresh" onclick="OnRefresh();" data-lgid="P_WO_REFRESH">Refresh</span>
|
||||
<span class="sbutton iconexit" onclick="OnExit(0);" data-lgid="P_WO_EXIT">Exit</span>
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
<div class="content_main content_div" style="padding: 20px; width: 600px; box-sizing: border-box"></div>
|
||||
</div>
|
||||
<div id="mask_bg" style="display: none;">
|
||||
<div class="loading c-spin"></div>
|
||||
</div>
|
||||
</asp:Content>
|
||||
|
25
Site/Maintenance/WorkOrderPlansManagement.aspx.cs
Normal file
25
Site/Maintenance/WorkOrderPlansManagement.aspx.cs
Normal file
@ -0,0 +1,25 @@
|
||||
using IronIntel.Contractor.Site.Maintenance;
|
||||
using System;
|
||||
|
||||
public partial class WorkOrderPlansManagement : WorkOrderBasePage
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!CheckLoginSession())
|
||||
{
|
||||
RedirectToLoginPage();
|
||||
}
|
||||
else
|
||||
{
|
||||
string methodName = Request.Form["MethodName"];
|
||||
if (!string.IsNullOrEmpty(methodName))
|
||||
{
|
||||
ProcessRequest(methodName);
|
||||
}
|
||||
else if (!IsPostBack)
|
||||
{
|
||||
Title = PageTitle;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -7,27 +7,6 @@
|
||||
display: none;
|
||||
}
|
||||
|
||||
.tab-header {
|
||||
float: left;
|
||||
padding: 2px 6px;
|
||||
cursor: pointer;
|
||||
border: 1px solid #fff;
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.tab-header:hover {
|
||||
background: #eee;
|
||||
}
|
||||
|
||||
.tab-header.selected {
|
||||
border-color: #d8d8d8;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.tab-header.selected:hover {
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.label { /*cover tab.css*/
|
||||
display: table-cell;
|
||||
}
|
||||
@ -124,12 +103,7 @@
|
||||
|
||||
var grid_dt;
|
||||
function InitGridData() {
|
||||
grid_dt = new GridView('#statuslist');
|
||||
grid_dt.lang = {
|
||||
all: GetTextByKey("P_GRID_ALL", "(All)"),
|
||||
ok: GetTextByKey("P_GRID_OK", "OK"),
|
||||
reset: GetTextByKey("P_GRID_RESET", "Reset")
|
||||
};
|
||||
grid_dt = createGridView('#statuslist');
|
||||
var list_columns = [
|
||||
{ name: 'Name', caption: GetTextByKey("P_WO_NAME", "Name"), valueIndex: 'Name', css: { 'width': 300, 'text-align': 'left' } },
|
||||
{ name: 'StatusCode', caption: GetTextByKey("P_WO_STATUSCODE", "Status Code"), valueIndex: 'StatusCode', css: { 'width': 110, 'text-align': 'left' } },
|
||||
@ -159,10 +133,18 @@
|
||||
col.allowFilter = list_columns[hd].allowFilter;
|
||||
col.type = list_columns[hd].type;
|
||||
|
||||
if (col.name === "Edit") {
|
||||
col.isurl = true;
|
||||
col.text = "\uf044";
|
||||
if (col.name === "Repeating") {
|
||||
col.sortFilter = function (a, b) {
|
||||
a = a.Repeating.DisplayValue;
|
||||
b = b.Repeating.DisplayValue;
|
||||
return a > b ? 1 : (a < b ? -1 : 0);
|
||||
};
|
||||
}
|
||||
else if (col.name === "Edit") {
|
||||
col.sortable = false;
|
||||
col.resizable = false;
|
||||
col.type = GridView.ColumnTypes.Icon;
|
||||
col.text = "edit";
|
||||
col.events = {
|
||||
onclick: function () {
|
||||
OnEdit();
|
||||
@ -174,9 +156,10 @@
|
||||
col.attrs = { 'title': GetTextByKey("P_UM_EDIT", 'Edit') };
|
||||
}
|
||||
else if (col.name === "Delete") {
|
||||
col.isurl = true;
|
||||
col.text = "\uf00d";
|
||||
col.sortable = false;
|
||||
col.resizable = false;
|
||||
col.type = GridView.ColumnTypes.Icon;
|
||||
col.text = "times";
|
||||
col.events = {
|
||||
onclick: function () {
|
||||
OnDelete(this);
|
||||
@ -192,10 +175,13 @@
|
||||
col.attrs = { 'title': GetTextByKey("P_UM_DELETE", 'Delete') };
|
||||
} else if (col.name === 'Color') {
|
||||
col.allowHtml = true;
|
||||
col.filter = function (item) {
|
||||
var cb = '<div style="background:' + item.Color + ';width:16px;height:16px;"></div>';
|
||||
return cb;//+ item.Color;
|
||||
col.sortable = false;
|
||||
col.bgFilter = function (item) {
|
||||
return item.Color;
|
||||
};
|
||||
col.filter = function (item) {
|
||||
return "";
|
||||
}
|
||||
col.styleFilter = function () {
|
||||
return { display: 'block' };
|
||||
};
|
||||
@ -232,9 +218,12 @@
|
||||
onchange: function () {
|
||||
var item = this;
|
||||
UpdateWODefaultOnOpen(item.Id, item.DefaultOnOpen ? 1 : 0);
|
||||
for (var i = 0; i < grid_dt.source.length; i++) {
|
||||
if (grid_dt.source[i].Values.Id != item.Id)
|
||||
grid_dt.source[i].Values.DefaultOnOpen = false;
|
||||
var tempsource = grid_dt.source;
|
||||
for (var i = 0; i < tempsource.length; i++) {
|
||||
if (tempsource[i].Id != item.Id) {
|
||||
tempsource[i].DefaultOnOpen = false;
|
||||
grid_dt.setItem(i, tempsource[i]);
|
||||
}
|
||||
}
|
||||
grid_dt.reload();
|
||||
}
|
||||
@ -242,10 +231,10 @@
|
||||
}
|
||||
columns.push(col);
|
||||
}
|
||||
grid_dt.canMultiSelect = false;
|
||||
grid_dt.multiSelect = false;
|
||||
grid_dt.columns = columns;
|
||||
grid_dt.init();
|
||||
grid_dt.rowdblclick = OnEdit;
|
||||
grid_dt.onRowDblClicked = OnEdit;
|
||||
}
|
||||
|
||||
function UpdateWOStatusTechniciansAvailable(id, value) {
|
||||
@ -357,8 +346,7 @@
|
||||
r[j] = { DisplayValue: (r["FollowUpMessage"] !== "" && r["WaitingPeriod"] > 0) ? (r["WaitingPeriod"] + " " + r["WaitingPeriodUom"]) : "", Value: r[j] };
|
||||
}
|
||||
}
|
||||
var fr = { Values: r };
|
||||
rows.push(fr);
|
||||
rows.push(r);
|
||||
}
|
||||
|
||||
grid_dt.setData(rows);
|
||||
@ -399,7 +387,7 @@
|
||||
var index = grid_dt.selectedIndex;
|
||||
if (index < 0) return;
|
||||
|
||||
var status = grid_dt.source[index].Values;
|
||||
var status = grid_dt.source[index];
|
||||
statusid = status.Id;
|
||||
$('#dialog_statusname').val(status.Name);
|
||||
if (statusid == 100) {
|
||||
@ -896,11 +884,14 @@
|
||||
<div id="div_container">
|
||||
<ul id="ul_container" class="tab_header">
|
||||
<li data-href="tab_statussetting" onclick="reshowgrid();" class="selected" data-lgid="P_WO_STATUSSETTING">Status Setting</li>
|
||||
<%if (IsAdmin)
|
||||
<%if (IsAdmin && AllowCustomer)
|
||||
{%>
|
||||
<li id="li_smsautosendschedule" data-href="tab_smsautosendschedule" data-lgid="P_WO_SMSAUTOSENDSCHEDULE">SMS Auto-Send Schedule</li>
|
||||
<%}%>
|
||||
<%if (AllowCustomer)
|
||||
{%>
|
||||
<li id="li_smsfootnotes" data-href="tab_smsfootnotes" data-lgid="P_WO_SMSFOOTNOTES">SMS Footnotes</li>
|
||||
<%}%>
|
||||
<li id="li_estimatemsg" data-href="tab_estimatemsg" data-lgid="P_WO_ESTIMATES">Estimates</li>
|
||||
<li id="li_invoicemsg" data-href="tab_invoicemsg" data-lgid="P_WO_INVOICES">Invoices</li>
|
||||
</ul>
|
||||
@ -920,9 +911,9 @@
|
||||
<span class="sbutton iconexit" onclick="OnExit(0);" data-lgid="P_WO_EXIT">Exit</span>
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
<table style="line-height: 32px; margin-left: 20px; margin-right: 10px; width: 450px;">
|
||||
<table style="line-height: 32px; margin-left: 20px; margin-right: 10px; width: 480px;">
|
||||
<tr class="tdDays">
|
||||
<td class="label" data-lgid="P_CM_DAYS_COLON">Day(s):</td>
|
||||
<td class="label" style="width: 100px;" data-lgid="P_CM_DAYS_COLON">Day(s):</td>
|
||||
<td>
|
||||
<input type="checkbox" id="chkSu" checked="checked" tabindex="3" style="width: auto; margin-left: 0px; margin-right: 2px;" class="middlechk" /><label for="chkSu" data-lgid="P_CM_SUNDAY">Sunday</label>
|
||||
</td>
|
||||
@ -950,7 +941,7 @@
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label">Start Time:</td>
|
||||
<td class="label" data-lgid="P_CM_STARTTIME_COLON">Start Time:</td>
|
||||
<td colspan="5">
|
||||
<select id="smswt_starttimehour" style="width: 48px;">
|
||||
</select>
|
||||
@ -964,7 +955,7 @@
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label">End Time:</td>
|
||||
<td class="label" data-lgid="P_CM_ENDTIME_COLON">End Time:</td>
|
||||
<td colspan="5">
|
||||
<select id="smswt_endtimehour" style="width: 48px;">
|
||||
</select>
|
||||
@ -988,11 +979,11 @@
|
||||
<div class="clear"></div>
|
||||
|
||||
<div class="subtitle" style="margin-top: 10px;">
|
||||
<span data-lgid="P_WO_XXXXXX">Text Message Footnote</span>
|
||||
<span data-lgid="P_WO_TEXTMESSAGEFOOTNOTE">Text Message Footnote</span>
|
||||
<select id="dialog_footnotevariables" style="width: 156px; margin-left: 20px;">
|
||||
<option value="0">[Site_Name]</option>
|
||||
<option value="1">[Location]</option>
|
||||
<option value="13">[Asset]</option>
|
||||
<option value="14">[Asset]</option>
|
||||
<option value="4">[VIN]</option>
|
||||
<option value="2">[Make]</option>
|
||||
<option value="3">[Model]</option>
|
||||
@ -1021,11 +1012,11 @@
|
||||
<div class="clear"></div>
|
||||
|
||||
<div class="subtitle" style="margin-top: 10px;">
|
||||
<span data-lgid="P_WO_XXXXXX">Message</span>
|
||||
<span data-lgid="P_WO_MESSAGE">Message</span>
|
||||
<select id="dialog_estimatemsgvariables" style="width: 156px; margin-left: 20px;">
|
||||
<option value="0">[Site_Name]</option>
|
||||
<option value="1">[Location]</option>
|
||||
<option value="13">[Asset]</option>
|
||||
<option value="14">[Asset]</option>
|
||||
<option value="4">[VIN]</option>
|
||||
<option value="2">[Make]</option>
|
||||
<option value="3">[Model]</option>
|
||||
@ -1045,7 +1036,7 @@
|
||||
<textarea id="dialog_estimatemsg" style="width: 640px; height: 160px;" maxlength="200"></textarea>
|
||||
</div>
|
||||
<div>
|
||||
<label data-lgid="P_WO_XXXXXX" for="dialog_estimateporequired">Default to PO Required: </label>
|
||||
<label data-lgid="P_WO_DEFAULTTOPOREQUIRED_COLON" for="dialog_estimateporequired">Default to PO Required: </label>
|
||||
<input type="checkbox" id="dialog_estimateporequired" />
|
||||
</div>
|
||||
</div>
|
||||
@ -1058,11 +1049,11 @@
|
||||
<div class="clear"></div>
|
||||
|
||||
<div class="subtitle" style="margin-top: 10px;">
|
||||
<span data-lgid="P_WO_XXXXXX">Message</span>
|
||||
<span data-lgid="P_WO_MESSAGE">Message</span>
|
||||
<select id="dialog_invoicemsgvariables" style="width: 156px; margin-left: 20px;">
|
||||
<option value="0">[Site_Name]</option>
|
||||
<option value="1">[Location]</option>
|
||||
<option value="13">[Asset]</option>
|
||||
<option value="14">[Asset]</option>
|
||||
<option value="4">[VIN]</option>
|
||||
<option value="2">[Make]</option>
|
||||
<option value="3">[Model]</option>
|
||||
@ -1075,6 +1066,8 @@
|
||||
<option value="11">[Technician_Name]</option>
|
||||
<option value="12">[Work_Order_Number]</option>
|
||||
<option value="13">[Parts_Order_Number]</option>
|
||||
<option value="15">[Invoice_Number]</option>
|
||||
<option value="16">[Invoice_Total_Cost]</option>
|
||||
</select>
|
||||
<input type="button" onclick="insertinvoicemsgfield();" data-lgid="P_WO_ADD" style="width: auto; margin-left: 5px;" tabindex="1" />
|
||||
</div>
|
||||
@ -1090,14 +1083,14 @@
|
||||
<div class="dialog" id="dialog_status" style="display: none;">
|
||||
<div class="dialog-title"><span class="title" data-lgid="P_WO_ADDSTATUS">Add Status</span><em class="dialog-close"></em></div>
|
||||
<div class="dialog-content">
|
||||
<table style="line-height: 30px; table-layout: fixed; width: 620px;">
|
||||
<table style="line-height: 30px; table-layout: fixed; width: 680px;">
|
||||
<tr>
|
||||
<td class="label" style="width: 155px;"><span data-lgid="P_WO_NAME_COLON">Name:</span><span class="redasterisk">*</span></td>
|
||||
<td class="label" style="width: 210px;"><span data-lgid="P_WO_NAME_COLON">Name:</span><span class="redasterisk">*</span></td>
|
||||
<td>
|
||||
<input type="text" id="dialog_statusname" tabindex="1" maxlength="200" autocomplete="off" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label" style="width: 155px;"><span data-lgid="P_WO_STATUSCODE_COLON">Status Code:</span></td>
|
||||
<td class="label"><span data-lgid="P_WO_STATUSCODE_COLON">Status Code:</span></td>
|
||||
<td>
|
||||
<input type="text" id="dialog_statuscode" tabindex="1" maxlength="15" autocomplete="off" style="width: 140px;" /></td>
|
||||
</tr>
|
||||
@ -1134,10 +1127,10 @@
|
||||
<tr>
|
||||
<td class="label" style="width: 130px;"><span data-lgid="P_WO_MESSAGE_COLON">Message:</span></td>
|
||||
<td>
|
||||
<select id="dialog_variables" style="width: 156px;">
|
||||
<select id="dialog_variables" style="width: 156px; height: 22px;">
|
||||
<option value="0">[Site_Name]</option>
|
||||
<option value="1">[Location]</option>
|
||||
<option value="13">[Asset]</option>
|
||||
<option value="14">[Asset]</option>
|
||||
<option value="4">[VIN]</option>
|
||||
<option value="2">[Make]</option>
|
||||
<option value="3">[Model]</option>
|
||||
@ -1157,10 +1150,10 @@
|
||||
<tr>
|
||||
<td class="label" style="width: 130px;"><span data-lgid="P_WO_FOLLOWUPMESSAGE_COLON">Follow Up Message:</span></td>
|
||||
<td>
|
||||
<select id="dialog_fuvariables" style="width: 156px;">
|
||||
<select id="dialog_fuvariables" style="width: 156px; height: 22px;">
|
||||
<option value="0">[Site_Name]</option>
|
||||
<option value="1">[Location]</option>
|
||||
<option value="13">[Asset]</option>
|
||||
<option value="14">[Asset]</option>
|
||||
<option value="4">[VIN]</option>
|
||||
<option value="2">[Make]</option>
|
||||
<option value="3">[Model]</option>
|
||||
@ -1176,13 +1169,13 @@
|
||||
</select>
|
||||
<input type="button" onclick="insertfufield();" data-lgid="P_WO_ADD" style="width: auto; margin-left: 5px;" tabindex="1" />
|
||||
<input type="text" id="dialog_waitingperiod" tabindex="1" maxlength="8" autocomplete="off" style="width: 60px; margin-left: 10px;" />
|
||||
<select id="dialog_waitingperioduom" style="width: 80px;">
|
||||
<option value="Hours">Hours</option>
|
||||
<option value="Days">Days</option>
|
||||
<option value="Weeks">Weeks</option>
|
||||
<option value="Months">Months</option>
|
||||
<select id="dialog_waitingperioduom" style="width: 80px; height: 22px;">
|
||||
<option value="Hours" data-lgid="P_WO_HOURS">Hours</option>
|
||||
<option value="Days" data-lgid="P_WO_DAYS">Days</option>
|
||||
<option value="Weeks" data-lgid="P_WO_WEEKS">Weeks</option>
|
||||
<option value="Months" data-lgid="P_WO_MONTHS">Months</option>
|
||||
</select>
|
||||
<select id="dialog_repeating" style="width: 80px;">
|
||||
<select id="dialog_repeating" style="width: 80px; height: 22px;">
|
||||
<option value="0" data-lgid="P_WO_ONETIME">One Time</option>
|
||||
<option value="1" data-lgid="P_WO_REPEATING">Repeating</option>
|
||||
</select>
|
||||
|
@ -13,6 +13,8 @@ public partial class WorkOrderStatusManagement : WorkOrderBasePage
|
||||
protected string IID;
|
||||
public bool IsDealer = IronIntel.Contractor.SystemParams.IsDealer;
|
||||
public bool EmailSubscribe = false;
|
||||
public bool IsCustomerRecordAllow = false;
|
||||
public bool AllowCustomer = false;
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
@ -37,6 +39,10 @@ public partial class WorkOrderStatusManagement : WorkOrderBasePage
|
||||
bool permission = CheckRight(SystemParams.CompanyID, Feature.WORK_ORDER);
|
||||
if (!permission)
|
||||
RedirectToLoginPage();
|
||||
|
||||
IsCustomerRecordAllow = SystemParams.HasLicense("CustomerRecord");
|
||||
bool crpermission = CheckRight(SystemParams.CompanyID, Feature.CUSTOMER_RECORD);
|
||||
AllowCustomer = IsCustomerRecordAllow && crpermission;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -207,12 +207,17 @@
|
||||
|
||||
.subtitle {
|
||||
margin: 20px 40px 5px 0px;
|
||||
font-size: 16px;
|
||||
font-size: 14px;
|
||||
color: gray;
|
||||
}
|
||||
|
||||
.subtitle span {
|
||||
margin-left: 10px;
|
||||
.subtitle .sttitle {
|
||||
display: inline-block;
|
||||
width: 150px;
|
||||
margin-left: 5px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.subtitle hr {
|
||||
@ -398,7 +403,7 @@
|
||||
content: '\f00d';
|
||||
}
|
||||
|
||||
.attadownload {
|
||||
.attaicon {
|
||||
position: absolute;
|
||||
vertical-align: top;
|
||||
font-size: 16px;
|
||||
@ -406,24 +411,40 @@
|
||||
color: rgb(123,28,33);
|
||||
right: 5px;
|
||||
bottom: 5px;
|
||||
background-color: rgba(255,255,255,.6);
|
||||
padding: 4px;
|
||||
border-radius: 4px;
|
||||
transition: background-color .12s;
|
||||
}
|
||||
|
||||
.attadownload::before {
|
||||
content: '\f019';
|
||||
.attaicon:hover {
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
.attaprint {
|
||||
.attadownload::before {
|
||||
content: '\f019';
|
||||
}
|
||||
|
||||
.attaprint::before {
|
||||
content: '\f02f';
|
||||
}
|
||||
|
||||
.attasend::before {
|
||||
content: '\f1d8';
|
||||
}
|
||||
|
||||
.attasend {
|
||||
position: absolute;
|
||||
vertical-align: top;
|
||||
font-size: 16px;
|
||||
font-family: 'Fontawesome';
|
||||
color: rgb(123,28,33);
|
||||
right: 30px;
|
||||
right: 55px;
|
||||
bottom: 5px;
|
||||
}
|
||||
|
||||
.attaprint::before {
|
||||
content: '\f02f';
|
||||
.attasend::before {
|
||||
content: '\f1d8';
|
||||
}
|
||||
|
||||
.attaedit {
|
||||
@ -464,22 +485,18 @@
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.dropdown {
|
||||
width: 240px;
|
||||
.dropdown .dropdown-wrapper {
|
||||
border-color: #a9a9a9;
|
||||
}
|
||||
|
||||
.dropdown .dropdown-wrapper {
|
||||
border-color: #a9a9a9;
|
||||
.dropdown .dropdown-wrapper > .dropdown-header {
|
||||
min-height: 26px;
|
||||
}
|
||||
|
||||
.dropdown .dropdown-wrapper > .dropdown-header {
|
||||
min-height: 26px;
|
||||
.dropdown .dropdown-wrapper > .dropdown-header > .dropdown-text {
|
||||
line-height: 26px;
|
||||
}
|
||||
|
||||
.dropdown .dropdown-wrapper > .dropdown-header > .dropdown-text {
|
||||
line-height: 26px;
|
||||
}
|
||||
|
||||
.subtitle .dropdown .dropdown-wrapper > .dropdown-header {
|
||||
min-height: 24px;
|
||||
}
|
||||
@ -565,10 +582,19 @@
|
||||
content: '\f019';
|
||||
}
|
||||
|
||||
.wolist_attasend::before {
|
||||
content: '\f1d8';
|
||||
}
|
||||
|
||||
.wolist_attaprint::before {
|
||||
content: '\f02f';
|
||||
}
|
||||
|
||||
.wolist_send::before {
|
||||
content: '\f1d8';
|
||||
}
|
||||
|
||||
|
||||
.divattp input {
|
||||
width: 60px;
|
||||
border: 1px solid #fff;
|
||||
@ -616,6 +642,17 @@
|
||||
/*min-width: 160px;*/
|
||||
}
|
||||
|
||||
#mask_bg, #dialogattmask, .dialog {
|
||||
#mask_bg, #dialogattmask, .mask_dialog, .dialog {
|
||||
z-index: 1000;
|
||||
}
|
||||
|
||||
.attalabel {
|
||||
/*border-bottom: 1px solid RGB(30, 144, 255);*/
|
||||
color: RGB(30,144,255);
|
||||
cursor: pointer;
|
||||
overflow: hidden;
|
||||
display: block;
|
||||
width: 100%;
|
||||
text-overflow: ellipsis;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
@ -10,22 +10,20 @@ $(function () {
|
||||
var items = [];
|
||||
var ids = [];
|
||||
for (var i = 0; i < source.length; i++) {
|
||||
var it = source[i].Values;
|
||||
var it = source[i];
|
||||
if (it.Selected) {
|
||||
items.push({
|
||||
Values: {
|
||||
ID: it.Id,
|
||||
VIN: it.VIN,
|
||||
Name: it.Name,
|
||||
MakeName: it.MakeName,
|
||||
ModelName: it.ModelName,
|
||||
TypeName: it.TypeName
|
||||
}
|
||||
});
|
||||
});
|
||||
ids.push(it.Id);
|
||||
}
|
||||
}
|
||||
grid_dtassets.setData(grid_dtassets.innerSource.concat(items));
|
||||
grid_dtassets.setData(grid_dtassets.source.concat(items));
|
||||
if (ids.length > 0)
|
||||
assignAssets(ids);
|
||||
showmaskbg(false);
|
||||
@ -45,12 +43,7 @@ function getAssignData() {
|
||||
//**************************************Asset(s)****************************************************//
|
||||
var grid_dtassets;
|
||||
function InitGridSelectedMachines() {
|
||||
grid_dtassets = new GridView('#selectedmachinelist');
|
||||
grid_dtassets.lang = {
|
||||
all: GetTextByKey("P_GRID_ALL", "(All)"),
|
||||
ok: GetTextByKey("P_GRID_OK", "OK"),
|
||||
reset: GetTextByKey("P_GRID_RESET", "Reset")
|
||||
};
|
||||
grid_dtassets = createGridView('#selectedmachinelist');
|
||||
var list_columns = [
|
||||
{ name: 'VIN', caption: GetTextByKey("P_UM_SN", "SN"), valueIndex: 'VIN', css: { 'width': 200, 'text-align': 'left' } },
|
||||
{ name: 'Name', caption: GetTextByKey("P_UM_NAME", "Name"), valueIndex: 'Name', css: { 'width': 200, 'text-align': 'left' } },
|
||||
@ -88,23 +81,16 @@ function InitGridSelectedMachines() {
|
||||
columns.push(col);
|
||||
}
|
||||
|
||||
grid_dtassets.canMultiSelect = true;
|
||||
grid_dtassets.multiSelect = true;
|
||||
grid_dtassets.columns = columns;
|
||||
grid_dtassets.init();
|
||||
|
||||
grid_dtassets.selectedrowchanged = function (rowindex) {
|
||||
var rowdata = grid_dtassets.source[rowindex];
|
||||
if (rowdata) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function showSelectedMachine(data) {
|
||||
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_dtassets.setData(rows);
|
||||
@ -148,8 +134,8 @@ function assignAssets(ids, next) {
|
||||
|
||||
function OnAssetAdd() {
|
||||
showmaskbg(true);
|
||||
dialogAUAssets.exceptSource = grid_dtassets.innerSource.map(function (s) {
|
||||
return s.Values.ID;
|
||||
dialogAUAssets.exceptSource = grid_dtassets.source.map(function (s) {
|
||||
return s.ID;
|
||||
});
|
||||
dialogAUAssets.showSelector();
|
||||
}
|
||||
@ -157,22 +143,17 @@ function OnAssetAdd() {
|
||||
function OnMachineDelete() {
|
||||
showConfirm(GetTextByKey("P_UM_DELETESELECTEDASSET", 'Are you sure you want to delete these selected assets?'), GetTextByKey("P_UM_ASSETASSIGNMENT", "Asset Assignment"), function () {
|
||||
var ids = [];
|
||||
for (var i = grid_dtassets.innerSource.length - 1; i >= 0; i--) {
|
||||
var s = grid_dtassets.innerSource[i].Values;
|
||||
if (s.selected) {
|
||||
grid_dtassets.innerSource.splice(i, 1);
|
||||
ids.push(s.ID);
|
||||
}
|
||||
}
|
||||
if (grid_dtassets.source != null) {
|
||||
for (var j = grid_dtassets.source.length - 1; j >= 0; j--) {
|
||||
var l = grid_dtassets.source[j].Values;
|
||||
var tmp = grid_dtassets.source;
|
||||
if (tmp != null) {
|
||||
for (var j = tmp.length - 1; j >= 0; j--) {
|
||||
var l = tmp[j];
|
||||
if (l.selected) {
|
||||
grid_dtassets.source.splice(j, 1);
|
||||
tmp.splice(j, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
grid_dtassets.reset();
|
||||
grid_dtassets.setData(tmp);
|
||||
grid_dtassets.reload(true);
|
||||
|
||||
var params = [
|
||||
custid,
|
||||
@ -202,12 +183,7 @@ function showsalespersonmask(flag) {
|
||||
|
||||
var grid_dtsp;
|
||||
function InitSPGridData() {
|
||||
grid_dtsp = new GridView('#salespersonlist');
|
||||
grid_dtsp.lang = {
|
||||
all: GetTextByKey("P_GRID_ALL", "(All)"),
|
||||
ok: GetTextByKey("P_GRID_OK", "OK"),
|
||||
reset: GetTextByKey("P_GRID_RESET", "Reset")
|
||||
};
|
||||
grid_dtsp = createGridView('#salespersonlist');
|
||||
var list_columns = [
|
||||
{ name: 'ID', caption: GetTextByKey("P_UM_USERIDOREMAIL", "User ID/Email"), valueIndex: 'ID', css: { 'width': 180, 'text-align': 'left' } },
|
||||
{ name: 'DisplayName', caption: GetTextByKey("P_UM_USERNAME", "User Name"), valueIndex: 'DisplayName', css: { 'width': 200, 'text-align': 'left' } },
|
||||
@ -227,22 +203,14 @@ function InitSPGridData() {
|
||||
col.allowFilter = list_columns[hd].allowFilter;
|
||||
columns.push(col);
|
||||
}
|
||||
grid_dtsp.canMultiSelect = false;
|
||||
grid_dtsp.multiSelect = false;
|
||||
grid_dtsp.columns = columns;
|
||||
grid_dtsp.init();
|
||||
}
|
||||
|
||||
function showSalespersons(data) {
|
||||
var rows = [];
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
var r = data[i];
|
||||
for (var j in r) {
|
||||
}
|
||||
var fr = { Values: r };
|
||||
rows.push(fr);
|
||||
}
|
||||
|
||||
grid_dtsp.setData(rows);
|
||||
grid_dtsp.setData(data);
|
||||
}
|
||||
|
||||
function GetSalespersons() {
|
||||
@ -288,7 +256,7 @@ function onSetSalesperson() {
|
||||
showmaskbg(false);
|
||||
return;
|
||||
}
|
||||
var salesperson = grid_dtsp.source[index].Values;
|
||||
var salesperson = grid_dtsp.source[index];
|
||||
$('#dialog_salespersoncode').data('spiid', salesperson.IID);
|
||||
$('#dialog_salespersoncode').val(salesperson.FOB);
|
||||
$('#dialog_salespersonname').val(salesperson.DisplayName);
|
||||
|
@ -69,12 +69,7 @@ function saveWorkOrderCollapsed() {
|
||||
var customerid;
|
||||
var grid_dtcustomer;
|
||||
function InitGridCustomers() {
|
||||
grid_dtcustomer = new GridView('#customerlist');
|
||||
grid_dtcustomer.lang = {
|
||||
all: GetTextByKey("P_GRID_ALL", "(All)"),
|
||||
ok: GetTextByKey("P_GRID_OK", "OK"),
|
||||
reset: GetTextByKey("P_GRID_RESET", "Reset")
|
||||
};
|
||||
grid_dtcustomer = createGridView('#customerlist');
|
||||
var list_columns = [
|
||||
{ name: 'Code', caption: GetTextByKey("P_CR_CODE", "Code"), valueIndex: 'Code', css: { 'width': 120, 'text-align': 'left' } },
|
||||
{ name: 'Name', caption: GetTextByKey("P_CR_COMPANYNAME", "Company Name"), valueIndex: 'Name', css: { 'width': 200, 'text-align': 'left' } },
|
||||
@ -94,27 +89,20 @@ function InitGridCustomers() {
|
||||
col.key = list_columns[hd].valueIndex;
|
||||
columns.push(col);
|
||||
}
|
||||
grid_dtcustomer.canMultiSelect = true;
|
||||
grid_dtcustomer.multiSelect = true;
|
||||
grid_dtcustomer.columns = columns;
|
||||
grid_dtcustomer.init();
|
||||
grid_dtcustomer.rowdblclick = function (rowindex) {
|
||||
grid_dtcustomer.onRowDblClicked = function (rowindex) {
|
||||
var rowdata = grid_dtcustomer.source[rowindex];
|
||||
if (rowdata) {
|
||||
//setCustomerData(rowdata.Values);
|
||||
OnSetSelectCustomer();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
function showCustomerList(data) {
|
||||
var rows = [];
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
var r = data[i];
|
||||
var fr = { Values: r };
|
||||
rows.push(fr);
|
||||
}
|
||||
|
||||
grid_dtcustomer.setData(rows);
|
||||
grid_dtcustomer.setData(data);
|
||||
}
|
||||
|
||||
function onSelectCustomer() {
|
||||
@ -130,7 +118,7 @@ function onSelectCustomer() {
|
||||
'top': (document.documentElement.clientHeight - $('#dialog_customer').height()) / 3,
|
||||
'left': (document.documentElement.clientWidth - $('#dialog_customer').width()) / 2
|
||||
})
|
||||
.showDialog();
|
||||
.showDialogfixed();
|
||||
|
||||
GetCustomerList();
|
||||
}
|
||||
@ -207,7 +195,7 @@ function OnSetSelectCustomer() {
|
||||
if (index < 0) {
|
||||
showAlert(GetTextByKey("P_WO_PLEASESELECTACUSTOMER", "Please select a customer."), GetTextByKey("P_WO_SELECTCUSTOMER", "Select Customer")); return;
|
||||
}
|
||||
var cust = grid_dtcustomer.source[index].Values;
|
||||
var cust = grid_dtcustomer.source[index];
|
||||
setCustomerData(cust);
|
||||
}
|
||||
|
||||
@ -231,7 +219,7 @@ function setCustomerData(cust) {
|
||||
}
|
||||
|
||||
function OnAddCustomer() {
|
||||
execIframeFunc("init", [null, machineid], "iframeuser");
|
||||
execIframeFunc("init", [null, machineid], "iframecr");
|
||||
$('#contatcmask').show();
|
||||
$('#dialog_addcustomer')
|
||||
.showDialogRight();
|
||||
@ -314,12 +302,16 @@ function showCustomerContacts(data) {
|
||||
}
|
||||
|
||||
if (customer) {
|
||||
customer.setData('contacts', customercontacts);
|
||||
//customer.setData('contacts', customercontacts);
|
||||
customer.contacts = customercontacts;
|
||||
}
|
||||
if (internal) {
|
||||
internal.contacts = customercontacts;
|
||||
}
|
||||
|
||||
woestimateobj?.updatecontact(customercontacts);
|
||||
woinvoiceobj?.updatecontact(customercontacts);
|
||||
woattachmentobj?.updatecontact(customercontacts);
|
||||
|
||||
setPhoneNumber_statuschange();
|
||||
}
|
||||
@ -490,3 +482,192 @@ function onSaveCompletedStatus() {
|
||||
}
|
||||
|
||||
/*****************************************End Completed Status**************************************************/
|
||||
|
||||
|
||||
|
||||
|
||||
/********************************************Begin Stauts Change Select Attachment*************************************************/
|
||||
var imgTypes = [".jfif", ".jpg", ".jpeg", ".bmp", ".png", ".tiff", ".gif"];
|
||||
|
||||
var grid_selectattachments;
|
||||
function InitGridSelectedAttachments() {
|
||||
grid_selectattachments = new GridView("#div_selectattachmentlist");
|
||||
var list_columns = [
|
||||
{ name: 'Selected', caption: "", valueIndex: 'Selected', type: 3, css: { 'width': 45, 'text-align': 'center' } },
|
||||
{ name: 'ThumbnailUrl', caption: "", valueIndex: 'ThumbnailUrl', css: { 'width': 42, 'text-align': 'center' } },
|
||||
{ name: 'Notes', caption: GetTextByKey("P_WO_NAME", "Name"), valueIndex: 'Notes', css: { 'width': 280, 'text-align': 'left' } }
|
||||
];
|
||||
|
||||
var columns = [];
|
||||
for (var hd in list_columns) {
|
||||
var col = {};
|
||||
if (list_columns[hd].type) {
|
||||
col.type = list_columns[hd].type;
|
||||
}
|
||||
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;
|
||||
columns.push(col);
|
||||
|
||||
if (col.name == "Selected") {
|
||||
col.allcheck = false;
|
||||
col.sortable = false;
|
||||
col.events = {
|
||||
onchange: function () {
|
||||
if (this.Selected) {
|
||||
for (var i in grid_selectattachments.source) {
|
||||
var a = grid_selectattachments.source[i];
|
||||
if (a.Id !== this.Id)
|
||||
a.Selected = false;
|
||||
}
|
||||
grid_selectattachments.reload();
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
else if (col.name == "ThumbnailUrl") {
|
||||
col.type = ThumbnailUrlColumn;
|
||||
//col.filter = function (item) {
|
||||
// if (imgTypes.indexOf(item.FileType.toLowerCase()) >= 0)
|
||||
// return $('<img style="height:30px;width:30px;"></img>').attr('src', item.ThumbnailUrl);
|
||||
// else {
|
||||
// var sdown = $('<img style="height:30px;width:30px;line-height:40px;" />')
|
||||
// setAttachemntIcon(item.FileType, sdown);
|
||||
// return sdown;
|
||||
// }
|
||||
//}
|
||||
//col.styleFilter = function () {
|
||||
// return { "width": "100%", 'margin': 0 };
|
||||
//}
|
||||
}
|
||||
}
|
||||
grid_selectattachments.multiSelect = false;
|
||||
grid_selectattachments.columns = columns;
|
||||
grid_selectattachments.init();
|
||||
}
|
||||
|
||||
function showSelectAttachment(data) {
|
||||
var rows = [];
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
var att = data[i];
|
||||
if (att.FileType.toLowerCase() == "url") continue;
|
||||
var fr = {
|
||||
Id: att.AttachmentIdStr,
|
||||
AttaType: att.AttachmentType,
|
||||
FileName: att.FileName,
|
||||
Caption: att.Notes,
|
||||
FileType: att.FileType,
|
||||
Url: att.Url,
|
||||
ThumbnailUrl: att.ThumbnailUrl,
|
||||
Notes: att.Notes === "" ? att.FileName : att.Notes,
|
||||
Selected: false,
|
||||
};
|
||||
rows.push(fr);
|
||||
}
|
||||
grid_selectattachments.setData(rows);
|
||||
$('#dialogattmask').hide();
|
||||
}
|
||||
|
||||
function openSelectAttachment() {
|
||||
$('#dialogattmask').show();
|
||||
$('#statuschange_maskbg').show();
|
||||
GetWorkorderAttachemnt();
|
||||
$('#dialog_selecteattachments .dialog-title span.title').text(GetTextByKey("P_WO_SELECTATTACHMENT", 'Select Attachment'));
|
||||
$('#dialog_selecteattachments')
|
||||
.attr('act', 'add')
|
||||
.css({
|
||||
'top': (document.documentElement.clientHeight - $('#dialog_selecteattachments').height()) / 3,
|
||||
'left': (document.documentElement.clientWidth - $('#dialog_selecteattachments').width()) / 2
|
||||
})
|
||||
.showDialogfixed();
|
||||
}
|
||||
|
||||
var woattachments;
|
||||
function GetWorkorderAttachemnt() {
|
||||
grid_selectattachments.setData([]);
|
||||
if (!workorderid || workorderid == "")
|
||||
return;
|
||||
worequest('GetWorkOrderAttachments', htmlencode(workorderid), function (data) {
|
||||
if (typeof (data) === "string") {
|
||||
showAlert(data, GetTextByKey('P_WO_SELECTATTACHMENT', "Select Attachment"));
|
||||
$('#dialogattmask').hide();
|
||||
$('#statuschange_maskbg').hide();
|
||||
return;
|
||||
}
|
||||
showSelectAttachment(data);
|
||||
}, function () {
|
||||
});
|
||||
}
|
||||
|
||||
var _selectedattachment;
|
||||
function onSetSelectAttachment() {
|
||||
$("#dialogattmask").show();
|
||||
$('#statuschange_maskbg').show();
|
||||
_selectedattachment = undefined;
|
||||
$('#span_attachmentname').text('').attr('title', '');
|
||||
$('#span_attachmentdelete').hide();
|
||||
var alerttitle = GetTextByKey('P_WO_SELECTATTACHMENT', "Select Attachment");
|
||||
var selatt;
|
||||
if (grid_selectattachments) {
|
||||
var tempsource = grid_selectattachments.source || [];
|
||||
for (var i = 0; i < tempsource.length; i++) {
|
||||
var a = tempsource[i];
|
||||
if (a.Selected) {
|
||||
selatt = a;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (selatt) {
|
||||
if (imgTypes.indexOf(selatt.FileType.toLowerCase()) >= 0) {//图片无需验证大小
|
||||
_selectedattachment = selatt;
|
||||
$('#span_attachmentname').text(_selectedattachment.Notes).attr('title', _selectedattachment.Notes);
|
||||
$('#span_attachmentdelete').show();
|
||||
$("#dialogattmask").hide();
|
||||
$('#statuschange_maskbg').hide();
|
||||
$('#dialog_selecteattachments').hideDialog();
|
||||
}
|
||||
else {
|
||||
worequest('IsAttachmentExceedsLimit', htmlencode(selatt.Id), function (data) {
|
||||
$("#dialogattmask").hide();
|
||||
if (typeof (data) === "string") {
|
||||
showAlert(data, alerttitle);
|
||||
return;
|
||||
}
|
||||
if (data) {
|
||||
showAlert(GetTextByKey('P_WO_ATTACHMENTSIZEEXCEEDSTHEMAXIMUMTIPS', 'Attachment size exceeds the maximum allowed to be sent (1.2MB).'), alerttitle);
|
||||
return;
|
||||
}
|
||||
else {
|
||||
_selectedattachment = selatt;
|
||||
$('#span_attachmentname').text(_selectedattachment.Notes).attr('title', _selectedattachment.Notes);
|
||||
$('#span_attachmentdelete').show();
|
||||
$('#statuschange_maskbg').hide();
|
||||
$('#dialog_selecteattachments').hideDialog();
|
||||
}
|
||||
}, function () {
|
||||
$("#dialogattmask").hide();
|
||||
$('#statuschange_maskbg').hide();
|
||||
});
|
||||
}
|
||||
}
|
||||
else {
|
||||
$('#dialog_selecteattachments').hideDialog();
|
||||
$("#dialogattmask").hide();
|
||||
$('#statuschange_maskbg').hide();
|
||||
}
|
||||
}
|
||||
|
||||
function onRemoveSelectedAttachment() {
|
||||
_selectedattachment = undefined;
|
||||
$('#span_attachmentname').text('').attr('title', '');
|
||||
$('#span_attachmentdelete').hide();
|
||||
}
|
||||
|
||||
|
||||
/********************************************End Stauts Change Select Attachment*************************************************/
|
265
Site/Maintenance/js/alertmapping.js
Normal file
265
Site/Maintenance/js/alertmapping.js
Normal file
@ -0,0 +1,265 @@
|
||||
/// <reference path="../../js/jquery-3.6.0.min.js" />
|
||||
/// <reference path="../../js/utility.js" />
|
||||
|
||||
_am = {};
|
||||
|
||||
(function () {
|
||||
_am.focusAlertMappingItem = function (tr) {
|
||||
tr.find('.general').css('display', 'none');
|
||||
tr.find('.editing').css('display', 'block');
|
||||
};
|
||||
|
||||
_am.addAlertMappingItem = function (mappingid, edesc) {
|
||||
$('#dialog_make').dropdownVal(null);
|
||||
$('#dialog_model').dropdownVals([]);
|
||||
$('#dialog_alerttype').dropdownVal(null);
|
||||
//$('#dialog_description').dropdownVal(null);
|
||||
$('#dialog_description').text(edesc);
|
||||
$('#dialog_category').dropdownVal(null);
|
||||
|
||||
showmaskbg(true);
|
||||
$('#dialog_alertmappingitem').attr('data-mappingid', mappingid)
|
||||
.css({
|
||||
'top': ($(window).height() - $('#dialog_alertmappingitem').height()) / 3,
|
||||
'left': ($(window).width() - $('#dialog_alertmappingitem').width()) / 3
|
||||
}).showDialogfixed();
|
||||
$('#dig_name').focus();
|
||||
};
|
||||
_am.deleteAlertMappingItem = function (e, alertmapping) {
|
||||
var tr = $(this).parents('tr:first');
|
||||
var id = tr.attr('data-id');
|
||||
var alerttitle = GetTextByKey("P_AMP_DELETE", 'Delete');
|
||||
var comfirmmsg = GetTextByKey("P_AMP_DOYOUWANTTODELETETHISALERTMAPPINGITEM", 'Do you want to delete this alert mapping item?');
|
||||
if (e.data || !id) {
|
||||
showConfirm(comfirmmsg, alerttitle, function (e) {
|
||||
tr.remove();
|
||||
});
|
||||
} else {
|
||||
showConfirm(comfirmmsg, alerttitle, function (e) {
|
||||
alertquery('DeleteAlertMappingItem', id, function (data) {
|
||||
if (!data || data.length == 0) {
|
||||
var subctrls = tr.data('subctrls');
|
||||
alertmapping.Items.splice(alertmapping.Items.indexOf(subctrls.item), 1);
|
||||
tr.remove();
|
||||
} else {
|
||||
showAlert(data, alerttitle);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
_am.checkAlertMappingItem = function (item) {
|
||||
var alerttitle = GetTextByKey("P_AMP_SAVEALERTMAPPINGITEM", 'Save Alert Mapping Item');
|
||||
if (!item.Make) {
|
||||
showAlert(GetTextByKey("P_AMP_MAKEISREQUIRED", 'Make is required.'), alerttitle);
|
||||
return false;
|
||||
}
|
||||
if (!item.Models || item.Models.length == 0) {
|
||||
showAlert(GetTextByKey("P_AMP_MODELISREQUIRED", 'Model is required.'), alerttitle);
|
||||
return false;
|
||||
}
|
||||
//if (!item.AlertType || item.AlertType.length == 0) {
|
||||
// showAlert(GetTextByKey("P_AMP_ALERTTYPEISREQUIRED", 'Alert Type is required.'), alerttitle);
|
||||
// return false;
|
||||
//}
|
||||
//if (!item.DescriptionId || item.DescriptionId <= 0) {
|
||||
// showAlert(GetTextByKey("P_AMP_DESCRIPTIONISREQUIRED", 'Description is required.'), alerttitle);
|
||||
// return false;
|
||||
//}
|
||||
//if (!item.CategoryId || item.CategoryId <= 0) {
|
||||
// showAlert(GetTextByKey("P_AMP_CATEGORYISREQUIRED", 'Category is required.'), alerttitle);
|
||||
// return false;
|
||||
//}
|
||||
return true;
|
||||
};
|
||||
|
||||
_am.saveAlertMappingItem = function (alertmapping) {
|
||||
var tr = $(this).parents('tr:first');
|
||||
function next() {
|
||||
subctrls.item.Make = item.Make;
|
||||
subctrls.item.Models = item.Models;
|
||||
subctrls.item.AlertType = item.AlertType;
|
||||
//subctrls.item.DescriptionId = item.DescriptionId;
|
||||
subctrls.item.CategoryId = item.CategoryId;
|
||||
|
||||
createAlertMappingItem(alertmapping, tr.parents('tbody:first'));
|
||||
}
|
||||
|
||||
var subctrls = tr.data('subctrls');
|
||||
var item = {
|
||||
'Id': parseInt(tr.attr('data-id')),
|
||||
'MappingId': parseInt(tr.attr('data-mappingid')),
|
||||
'Make': subctrls.divmake.dropdownVal(),
|
||||
'Models': subctrls.divmodel.dropdownVals(),
|
||||
'AlertType': subctrls.divalerttype.dropdownVal(),
|
||||
//'DescriptionId': subctrls.divdesc.dropdownVal(),
|
||||
'CategoryId': subctrls.divcategory.dropdownVal() || "-1"
|
||||
};
|
||||
if (item.Models.length == 0 && subctrls.divmodel.allselected())
|
||||
item.Models = [-1];
|
||||
if (!_am.checkAlertMappingItem(item)) {
|
||||
return;
|
||||
}
|
||||
|
||||
alertquery('SaveAlertMappingItem', htmlencode(JSON.stringify(item)), function (data) {
|
||||
if (data > 0) {
|
||||
next();
|
||||
}
|
||||
else if (data == -1) {
|
||||
showAlert(GetTextByKey('P_AMP_THISCOMBINATIONOFMAKEANDMODELSALREADYEXISTS', 'This combination of Make and Models already exists. '), title);
|
||||
}
|
||||
else {
|
||||
showAlert(data, GetTextByKey("P_AMP_SAVEALERTMAPPINGITEM", 'Save Alert Mapping Item'));
|
||||
}
|
||||
});
|
||||
};
|
||||
_am.cancelAlertMappingSave = function (e) {
|
||||
var tr = $(this).parents('tr:first');
|
||||
tr.find('input[type="text"]').removeClass('focused');
|
||||
tr.find('textarea').removeClass('focused');
|
||||
tr.find('select').removeClass('focused');
|
||||
tr.find('.general').css('display', 'block');
|
||||
tr.find('.editing').css('display', 'none');
|
||||
var inps = tr.find('input');
|
||||
for (var i = 0; i < inps.length; i++) {
|
||||
var inp = $(inps[i]);
|
||||
var data = inp.attr('data-ori');
|
||||
if (inp.attr('type') == 'text') {
|
||||
inp.val(data || '');
|
||||
} else if (inp.attr('type') == 'checkbox') {
|
||||
inp.prop('checked', eval(data));
|
||||
}
|
||||
}
|
||||
var recurring = tr.find('.inp_recurring').prop('checked');
|
||||
var inp = tr.find('.inp_priority');
|
||||
inp.prop('disabled', !recurring);
|
||||
if (recurring) {
|
||||
inp.parent('td').removeClass('gray_field');
|
||||
} else {
|
||||
inp.parent('td').addClass('gray_field');
|
||||
}
|
||||
|
||||
var textarea = tr.find('.textarea_desc');
|
||||
var desc = $(textarea).attr('data-ori');
|
||||
$(textarea).val(desc);
|
||||
};
|
||||
|
||||
_am.createAlertMappingTr = function (item, alertmapping) {
|
||||
|
||||
var tr = $('<tr></tr>').attr('data-id', item.Id).attr('data-mappingid', item.MappingId);
|
||||
var td;
|
||||
td = $('<td></td>');
|
||||
var divmake = $('<div></div>');
|
||||
td.append(divmake);
|
||||
tr.append(td);
|
||||
divmake.css('width', 200).css('position', 'relative').dropdown(alertMappingDataSource.Makes, {
|
||||
search: true,
|
||||
valueKey: 'ID',
|
||||
textKey: 'Name'
|
||||
}).on('select', function (_e, it) {
|
||||
_am.focusAlertMappingItem(tr);
|
||||
if (it) {
|
||||
var r = filterModels(it.ID, item.Id, alertmapping);
|
||||
divmodel.allowselectall(r.allowAll).dropdownSource(r.models).dropdownVals([]);
|
||||
if (it.ID == -1 && r.allowAll)
|
||||
divmodel.allselected(true);
|
||||
else
|
||||
divmodel.dropdownVals([]);
|
||||
}
|
||||
}).dropdownVal(item.Make);
|
||||
|
||||
td = $('<td></td>');
|
||||
var divmodel = $('<div></div>');
|
||||
td.append(divmodel);
|
||||
tr.append(td);
|
||||
divmodel.css('width', 320).css('position', 'relative').dropdown([], {
|
||||
search: true,
|
||||
multiselect: true,
|
||||
//allowselectall: false,
|
||||
valueKey: 'ID',
|
||||
textKey: 'Name',
|
||||
enableKey: 'Enable'
|
||||
}).on('collapsed', function (_e) {
|
||||
if (item.Models.toString() != divmodel.dropdownVals().toString())
|
||||
_am.focusAlertMappingItem(tr);
|
||||
});
|
||||
var r = filterModels(item.Make, item.Id, alertmapping);
|
||||
divmodel.allowselectall(r.allowAll).dropdownSource(r.models).dropdownVals(item.Models);
|
||||
if (item.Models.length == 1 && item.Models[0] == -1)
|
||||
divmodel.allselected(true);
|
||||
|
||||
|
||||
td = $('<td></td>');
|
||||
var divalerttype = $('<div></div>');
|
||||
td.append(divalerttype);
|
||||
tr.append(td);
|
||||
divalerttype.css('width', 200).css('position', 'relative').dropdown(alertMappingDataSource.AlertTypes, {
|
||||
search: false,
|
||||
valueKey: 'ID',
|
||||
textKey: 'Name'
|
||||
}).on('select', function (_e, it) {
|
||||
_am.focusAlertMappingItem(tr);
|
||||
}).dropdownVal(item.AlertType);
|
||||
|
||||
td = $('<td></td>');
|
||||
var divdesc = $('<div></div>').css('width', 400).text(alertmapping.EnhancedDescription);
|
||||
td.append(divdesc);
|
||||
tr.append(td);
|
||||
|
||||
//td = $('<td></td>');
|
||||
//var divdesc = $('<div class="descdropdown"></div>');
|
||||
//td.append(divdesc);
|
||||
//tr.append(td);
|
||||
//divdesc.css('width', 400).css('position', 'relative').dropdown(alertMappingDataSource.Descriptions, {
|
||||
// search: true,
|
||||
// valueKey: 'ID',
|
||||
// textKey: 'Name'
|
||||
//}).on('select', function (_e, it) {
|
||||
// if (it && it.ID == "") {
|
||||
// divdesc.dropdownVal(item.DescriptionId);
|
||||
// OnAddAlertMappingSource(1);
|
||||
// }
|
||||
// else
|
||||
// _am.focusAlertMappingItem(tr);
|
||||
//}).dropdownVal(item.DescriptionId);
|
||||
|
||||
td = $('<td></td>');
|
||||
var divcategory = $('<div class="categorydropdown"></div>');
|
||||
td.append(divcategory);
|
||||
tr.append(td);
|
||||
divcategory.css('width', 200).css('position', 'relative').dropdown(alertMappingDataSource.Categories, {
|
||||
search: true,
|
||||
valueKey: 'ID',
|
||||
textKey: 'Name'
|
||||
}).on('select', function (_e, it) {
|
||||
if (it && it.ID == "") {
|
||||
divcategory.dropdownVal(item.CategoryId);
|
||||
OnAddAlertMappingSource(2);
|
||||
}
|
||||
else
|
||||
_am.focusAlertMappingItem(tr);
|
||||
}).dropdownVal(item.CategoryId);
|
||||
|
||||
td = $('<td class="td_funcs"></td>');
|
||||
// 常规操作
|
||||
var div = $('<div class="general"></div>');
|
||||
div.append($('<a onclick="return false;">' + GetTextByKey("P_PM_DELETE", "Delete") + '</a>').on('click', function (e) { _am.deleteAlertMappingItem.call(this, e, alertmapping) }));
|
||||
td.append(div);
|
||||
div = $('<div class="editing" style="display:none;"></div>');
|
||||
div.append($('<input type="button" value="' + GetTextByKey("P_PM_SAVE", "Save") + '"/>').on('click', function () { _am.saveAlertMappingItem.call(this, alertmapping) }));
|
||||
div.append($('<input type="button" style="margin-left:5px;" value="' + GetTextByKey("P_PM_CANCEL", "Cancel") + '"/>').on('click', _am.cancelAlertMappingSave));
|
||||
td.append(div);
|
||||
tr.append(td);
|
||||
|
||||
tr.data('subctrls', {
|
||||
item: item,
|
||||
divmake: divmake,
|
||||
divmodel: divmodel,
|
||||
divalerttype: divalerttype,
|
||||
//divdesc: divdesc,
|
||||
divcategory: divcategory
|
||||
});
|
||||
return tr;
|
||||
};
|
||||
})();
|
@ -10,23 +10,21 @@ $(function () {
|
||||
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: {
|
||||
ID: it.Id,
|
||||
VIN: it.VIN,
|
||||
Name: it.Name,
|
||||
MakeName: it.MakeName,
|
||||
ModelName: it.ModelName,
|
||||
TypeName: it.TypeName
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
var p = [
|
||||
custrecordid,
|
||||
JSON.stringify(items.map(function (f) { return f.Values.ID; }))
|
||||
JSON.stringify(items.map(function (f) { return f.ID; }))
|
||||
];
|
||||
|
||||
$("#dialogmask").show();
|
||||
@ -34,7 +32,7 @@ $(function () {
|
||||
showmaskbg(false);
|
||||
$("#dialogmask").hide();
|
||||
if (r === 'OK') {
|
||||
grid_dtsm.setData(grid_dtsm.innerSource.concat(items));
|
||||
grid_dtsm.setData(grid_dtsm.source.concat(items));
|
||||
} else {
|
||||
showAlert(r, GetTextByKey("P_UM_ASSETASSIGNMENT", 'Asset Assignment'));
|
||||
}
|
||||
@ -47,8 +45,8 @@ $(function () {
|
||||
|
||||
function OnMachineAdd() {
|
||||
showmaskbg(true);
|
||||
dialogAssets.exceptSource = grid_dtsm.innerSource.map(function (s) {
|
||||
return s.Values.ID;
|
||||
dialogAssets.exceptSource = grid_dtsm.source.map(function (s) {
|
||||
return s.ID;
|
||||
});
|
||||
dialogAssets.showSelector();
|
||||
}
|
||||
@ -68,13 +66,13 @@ function OnManageMachine(u) {
|
||||
|
||||
var title = GetTextByKey("P_UM_ASSETASSIGNMENT", "Asset Assignment");// + " " + jobsite.Name + " " + "Radius_UOM: " + jobsite.Radius_UOM
|
||||
$('#dialog_managemahchine .dialog-title span.title').html(title);
|
||||
$('.machine_maskbg').show();
|
||||
showmaskbg(true);
|
||||
$('#dialog_managemahchine')
|
||||
.attr('init', 1)
|
||||
.css({
|
||||
'top': (document.documentElement.clientHeight - $('#dialog_managemahchine').height()) / 5,
|
||||
'left': (document.documentElement.clientWidth - $('#dialog_managemahchine').width()) / 2
|
||||
}).showDialog();
|
||||
}).showDialogfixed();
|
||||
|
||||
grid_dtsm.setData([]);
|
||||
$('#selectedmachinelist input[type="checkbox"]').prop('checked', false);
|
||||
@ -99,14 +97,8 @@ function GetAssignedMachines() {
|
||||
}
|
||||
|
||||
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);
|
||||
grid_dtsm.setData(data);
|
||||
}
|
||||
|
||||
function OnMachineDeleteSingle(item) {
|
||||
@ -121,22 +113,16 @@ function OnMachineDeleteSingle(item) {
|
||||
if (r !== 'OK') {
|
||||
showAlert(r, GetTextByKey("P_UM_ASSETASSIGNMENT", "Asset Assignment"));
|
||||
} else {
|
||||
for (var i = 0; i < grid_dtsm.innerSource.length; i++) {
|
||||
var s = grid_dtsm.innerSource[i].Values;
|
||||
if (s.ID === item.ID) {
|
||||
grid_dtsm.innerSource.splice(i, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (grid_dtsm.source != null) {
|
||||
for (var j = 0; j < grid_dtsm.source.length; j++) {
|
||||
if (item.ID === grid_dtsm.source[j].Values.ID) {
|
||||
grid_dtsm.source.splice(j, 1);
|
||||
var tmp = grid_dtsm.source;
|
||||
if (tmp != null) {
|
||||
for (var j = 0; j < tmp.length; j++) {
|
||||
if (item.ID === tmp[j].ID) {
|
||||
tmp.splice(j, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
grid_dtsm.reset();
|
||||
grid_dtsm.setData(tmp);
|
||||
}
|
||||
});
|
||||
});
|
||||
@ -144,7 +130,7 @@ function OnMachineDeleteSingle(item) {
|
||||
|
||||
function OnMachineDelete() {
|
||||
showConfirm(GetTextByKey("P_UM_DELETESELECTEDASSET", 'Are you sure you want to delete these selected assets?'), GetTextByKey("P_UM_ASSETASSIGNMENT", "Asset Assignment"), function () {
|
||||
var ids = grid_dtsm.innerSource.filter(function (s) { return s.Values.selected; }).map(function (s) { return s.Values.ID; });
|
||||
var ids = grid_dtsm.source.filter(function (s) { return s.selected; }).map(function (s) { return s.ID; });
|
||||
var params = [
|
||||
custrecordid,
|
||||
JSON.stringify(ids)
|
||||
@ -155,21 +141,17 @@ function OnMachineDelete() {
|
||||
if (r !== 'OK') {
|
||||
showAlert(r, GetTextByKey("P_UM_ASSETASSIGNMENT", "Asset Assignment"));
|
||||
} else {
|
||||
for (var i = grid_dtsm.innerSource.length - 1; i >= 0; i--) {
|
||||
var s = grid_dtsm.innerSource[i].Values;
|
||||
if (s.selected) {
|
||||
grid_dtsm.innerSource.splice(i, 1);
|
||||
}
|
||||
}
|
||||
if (grid_dtsm.source != null) {
|
||||
for (var j = grid_dtsm.source.length - 1; j >= 0; j--) {
|
||||
var l = grid_dtsm.source[j].Values;
|
||||
var tmp = grid_dtsm.source;
|
||||
if (tmp != null) {
|
||||
for (var j = tmp.length - 1; j >= 0; j--) {
|
||||
var l = tmp[j];
|
||||
if (l.selected) {
|
||||
grid_dtsm.source.splice(j, 1);
|
||||
tmp.splice(j, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
grid_dtsm.reset();
|
||||
grid_dtsm.setData(tmp);
|
||||
grid_dtsm.reload(true);
|
||||
}
|
||||
});
|
||||
});
|
||||
@ -177,12 +159,7 @@ function OnMachineDelete() {
|
||||
|
||||
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: 'VIN', caption: GetTextByKey("P_UM_SN", "SN"), valueIndex: 'VIN', css: { 'width': 160, 'text-align': 'left' } },
|
||||
{ name: 'Name', caption: GetTextByKey("P_UM_NAME", "Name"), valueIndex: 'Name', css: { 'width': 160, 'text-align': 'left' } },
|
||||
@ -224,8 +201,9 @@ function InitGridSelectedMachines() {
|
||||
width: 30,
|
||||
align: 'center',
|
||||
sortable: false,
|
||||
isurl: true,
|
||||
text: '\uf00d',
|
||||
resizable: false,
|
||||
type: GridView.ColumnTypes.Icon,
|
||||
text: 'times',
|
||||
events: {
|
||||
onclick: function () {
|
||||
OnMachineDeleteSingle(this);
|
||||
@ -236,15 +214,9 @@ function InitGridSelectedMachines() {
|
||||
},
|
||||
attrs: { 'title': GetTextByKey("P_UM_DELETE", 'Delete') }
|
||||
});
|
||||
grid_dtsm.canMultiSelect = true;
|
||||
grid_dtsm.multiSelect = true;
|
||||
grid_dtsm.columns = columns;
|
||||
grid_dtsm.init();
|
||||
|
||||
grid_dtsm.selectedrowchanged = function (rowindex) {
|
||||
var rowdata = grid_dtsm.source[rowindex];
|
||||
if (rowdata) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -54,13 +54,13 @@ function DoUploadAttachments(fid) {
|
||||
uploadingindex = -1;
|
||||
getAttachments();
|
||||
if (fileupload_errors !== "")
|
||||
showAlert(fileupload_errors, GetTextByKey("P_WO_XXXXX", 'Upload failed'));
|
||||
showAlert(fileupload_errors, GetTextByKey("P_WO_UPLOADFAILED", 'Upload failed'));
|
||||
showloading(false);
|
||||
return;
|
||||
}
|
||||
var file = filesinuploading[uploadingindex];
|
||||
if (file.name.length > 200) {
|
||||
showUplpadingStatus(GetTextByKey("P_WO_XXX", "Attachment name length cannot be greater than 200."));
|
||||
showUplpadingStatus(GetTextByKey("P_WO_ATTACHMENTNAMELENGTHCANNOTBEGREATERTHAN", "Attachment name length cannot be greater than 200."));
|
||||
DoUploadAttachments(fid);
|
||||
return;
|
||||
}
|
||||
@ -95,7 +95,7 @@ function DoUploadAttachments(fid) {
|
||||
}
|
||||
},
|
||||
error: function (err) {
|
||||
showUplpadingStatus(GetTextByKey("P_WO_XXXXX", 'Upload failed'));
|
||||
showUplpadingStatus(GetTextByKey("P_WO_UPLOADFAILED", 'Upload failed'));
|
||||
DoUploadAttachments(fid);
|
||||
}
|
||||
});
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,205 +1,207 @@
|
||||
|
||||
if (typeof manageassetsCtrl !== 'function') {
|
||||
$manageassetsCtrl = function manageassetsCtrl() {
|
||||
this.tmpobj = {
|
||||
};
|
||||
this.wizardCtrl = null;
|
||||
this.vue = null;
|
||||
};
|
||||
function showAssignedAssetsList(data) {
|
||||
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
var dataGrid = window.DataGrid || window['g5-datagrid'];
|
||||
|
||||
$manageassetsCtrl.prototype.getData = function (/*dataObj, tmpdata*/) {
|
||||
return this.vue.source;
|
||||
};
|
||||
|
||||
$manageassetsCtrl.prototype.setData = function (assetData) {
|
||||
if (assetData) {
|
||||
for (var i = 0; i < assetData.length; i++) {
|
||||
var a = assetData[i];
|
||||
a.Selected = false;
|
||||
if (a.Highlight == undefined)
|
||||
a.Highlight = false;
|
||||
}
|
||||
}
|
||||
this.vue.source = assetData ? assetData : [];
|
||||
this.vue.$refs.grid.resize();
|
||||
};
|
||||
|
||||
$manageassetsCtrl.prototype.reload = function () {
|
||||
this.vue.$refs.grid.reload()
|
||||
};
|
||||
|
||||
$manageassetsCtrl.prototype.Init = function (parent, newselected) {
|
||||
var ethis = this;
|
||||
//加载子页面模版
|
||||
parent.load('../template/ManageAssetsCtrl.html?v=8', function () {
|
||||
ethis.vue = new Vue({
|
||||
el: parent.find('.ManageAssetsCtrl')[0],
|
||||
components: {
|
||||
'data-grid': dataGrid
|
||||
},
|
||||
data: {
|
||||
wnd: window.parent,
|
||||
editable: true,
|
||||
columns: [],
|
||||
source: []
|
||||
},
|
||||
computed: {
|
||||
},
|
||||
watch: {
|
||||
source: function (val) {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
cellvaluechanged: function (item, key) {
|
||||
},
|
||||
rowdblclick: function (e) {
|
||||
}
|
||||
}
|
||||
});
|
||||
ethis.vue.columns = createGridColumn(newselected);
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
function createGridColumn(newselected) {
|
||||
var editable = false;
|
||||
var columns = [
|
||||
{
|
||||
key: 'Selected',
|
||||
caption: '',
|
||||
type: dataGrid.COLUMN_TYPE.checkbox,
|
||||
width: 30,
|
||||
align: 'center',
|
||||
sortable: false,
|
||||
orderable: false,
|
||||
enabled: true,
|
||||
resizable: false,
|
||||
allcheck: false,
|
||||
visible: !newselected
|
||||
},
|
||||
{
|
||||
key: 'VIN',
|
||||
caption: GetTextByKey("P_PM_SN", 'SN'),
|
||||
type: dataGrid.COLUMN_TYPE.lable,
|
||||
width: 140,
|
||||
orderable: false,
|
||||
resizable: true,
|
||||
enabled: editable,
|
||||
styleFilter: function (item) {
|
||||
if (item.Highlight)
|
||||
return { 'background-color': 'yellow' };
|
||||
}
|
||||
},
|
||||
{
|
||||
key: 'Name',
|
||||
caption: GetTextByKey("P_PM_NAME", 'Name'),
|
||||
type: dataGrid.COLUMN_TYPE.lable,
|
||||
width: 140,
|
||||
orderable: false,
|
||||
resizable: true,
|
||||
enabled: editable,
|
||||
styleFilter: function (item) {
|
||||
if (item.Highlight)
|
||||
return { 'background-color': 'yellow' };
|
||||
}
|
||||
},
|
||||
{
|
||||
key: 'MakeName',
|
||||
caption: GetTextByKey("P_PM_MAKE", 'Make'),
|
||||
type: dataGrid.COLUMN_TYPE.lable,
|
||||
width: 100,
|
||||
orderable: false,
|
||||
enabled: editable,
|
||||
resizable: true,
|
||||
visible: !newselected,
|
||||
styleFilter: function (item) {
|
||||
if (item.Highlight)
|
||||
return { 'background-color': 'yellow' };
|
||||
}
|
||||
},
|
||||
{
|
||||
key: 'ModelName',
|
||||
caption: GetTextByKey("P_PM_MODEL", 'Model'),
|
||||
type: dataGrid.COLUMN_TYPE.lable,
|
||||
width: 100,
|
||||
orderable: false,
|
||||
resizable: true,
|
||||
enabled: editable,
|
||||
visible: !newselected,
|
||||
styleFilter: function (item) {
|
||||
if (item.Highlight)
|
||||
return { 'background-color': 'yellow' };
|
||||
}
|
||||
},
|
||||
{
|
||||
key: 'EngineHours',
|
||||
caption: GetTextByKey("P_PM_CURRENTHOURS", 'Current Hours'),
|
||||
type: dataGrid.COLUMN_TYPE.lable,
|
||||
width: 100,
|
||||
orderable: false,
|
||||
resizable: true,
|
||||
visible: (scheduletype === "HM" || scheduletype === "PM")
|
||||
},
|
||||
{
|
||||
key: 'StartHours',
|
||||
caption: GetTextByKey("P_PM_STARTINGHOURS", 'Starting Hours'),
|
||||
type: dataGrid.COLUMN_TYPE.input,
|
||||
width: 100,
|
||||
orderable: false,
|
||||
resizable: false,
|
||||
enabled: 'Enabled',
|
||||
visible: (scheduletype === "HM" || scheduletype === "PM")
|
||||
},
|
||||
{
|
||||
key: 'Odometer',
|
||||
caption: GetTextByKey("P_PM_CURRENTODOMETER", 'Current Odometer'),
|
||||
type: dataGrid.COLUMN_TYPE.lable,
|
||||
width: 120,
|
||||
orderable: false,
|
||||
resizable: true,
|
||||
visible: (scheduletype === "RDM" || scheduletype === "ADM")
|
||||
},
|
||||
{
|
||||
key: 'StartOdometer',
|
||||
caption: GetTextByKey("P_PM_STARTODOMETER", 'Start Odometer'),
|
||||
type: dataGrid.COLUMN_TYPE.input,
|
||||
width: 100,
|
||||
orderable: false,
|
||||
resizable: false,
|
||||
enabled: 'Enabled',
|
||||
visible: (scheduletype === "RDM" || scheduletype === "ADM")
|
||||
},
|
||||
{
|
||||
key: 'StartDateString',
|
||||
caption: GetTextByKey("P_PM_PLANSTARTDATE", 'Plan Start Date'),
|
||||
type: dataGrid.COLUMN_TYPE.datepicker,
|
||||
width: 100,
|
||||
orderable: false,
|
||||
resizable: false,
|
||||
enabled: 'Enabled',
|
||||
visible: scheduletype === "TBM"
|
||||
},
|
||||
{
|
||||
key: 'StartIntervalValue',
|
||||
caption: GetTextByKey("P_PM_STARTINTERVAL", 'Start Interval'),
|
||||
type: dataGrid.COLUMN_TYPE.dropdown,
|
||||
source: 'TempIntervals',
|
||||
width: 100,
|
||||
orderable: false,
|
||||
resizable: false,
|
||||
enabled: 'Enabled',
|
||||
visible: (scheduletype === "HM" || scheduletype === "RDM" || scheduletype === "TBM")
|
||||
}
|
||||
];
|
||||
|
||||
return columns;
|
||||
grid_assignedassetdt.setData(data);
|
||||
grid_assignedassetdt.reload();
|
||||
}
|
||||
var grid_assignedassetdt;
|
||||
function InitAssignedAssetsGridData() {
|
||||
grid_assignedassetdt = createGridView('#divScheduleAssets');
|
||||
grid_assignedassetdt.isEditable = true;
|
||||
var list_columns = [
|
||||
{ name: 'Selected', caption: "", valueIndex: 'Selected', type: 3, css: { 'width': 45, 'text-align': 'center' } },
|
||||
{ name: 'VIN', caption: GetTextByKey("P_PM_SN", 'SN'), valueIndex: 'VIN', css: { 'width': 140, 'text-align': 'left' } },
|
||||
{ name: 'Name', caption: GetTextByKey("P_PM_NAME", 'Name'), valueIndex: 'Name', css: { 'width': 140, 'text-align': 'left' } },
|
||||
{ name: 'MakeName', caption: GetTextByKey("P_PM_MAKE", 'Make'), valueIndex: 'MakeName', css: { 'width': 100, 'text-align': 'left' } },
|
||||
{ name: 'ModelName', caption: GetTextByKey("P_PM_MODEL", 'Model'), valueIndex: 'ModelName', css: { 'width': 100, 'text-align': 'left' } },
|
||||
{ name: 'EngineHours', caption: GetTextByKey("P_PM_CURRENTHOURS", 'Current Hours'), valueIndex: 'EngineHours', css: { 'width': 100, 'text-align': 'left' } },
|
||||
{ name: 'StartHours', caption: GetTextByKey("P_PM_STARTINGHOURS", 'Starting Hours'), valueIndex: 'StartHours', css: { 'width': 100, 'text-align': 'left' } },
|
||||
{ name: 'Odometer', caption: GetTextByKey("P_PM_CURRENTODOMETER", 'Current Odometer'), valueIndex: 'Odometer', css: { 'width': 100, 'text-align': 'left' } },
|
||||
{ name: 'StartOdometer', caption: GetTextByKey("P_PM_STARTODOMETER", 'Start Odometer'), valueIndex: 'StartOdometer', css: { 'width': 100, 'text-align': 'left' } },
|
||||
{ name: 'StartDateString', caption: GetTextByKey("P_PM_PLANSTARTDATE", 'Plan Start Date'), valueIndex: 'StartDateString', css: { 'width': 100, 'text-align': 'left' } },
|
||||
{ name: 'StartIntervalValue', caption: GetTextByKey("P_PM_STARTINTERVAL", 'Start Interval'), valueIndex: 'StartIntervalValue', css: { 'width': 100, 'text-align': 'left' } }
|
||||
];
|
||||
var columns = [];
|
||||
var DateColumn = window['lib-ui'].GridDateColumn;
|
||||
// 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;
|
||||
col.allowFilter = list_columns[hd].allowFilter;
|
||||
col.oldFilterValues = col.filterValues;
|
||||
col.styleFilter = function (item) {
|
||||
if (item.Highlight)
|
||||
return { 'background-color': 'yellow' };
|
||||
}
|
||||
}());
|
||||
if (list_columns[hd].type) {
|
||||
col.type = list_columns[hd].type;
|
||||
}
|
||||
|
||||
col.alwaysshow = list_columns[hd].alwaysshow;
|
||||
|
||||
if (col.name === "EngineHours" && ["HM", "PM"].indexOf(scheduletype) < 0) {
|
||||
col.visible = false;
|
||||
continue;
|
||||
}
|
||||
else if (col.name === "Odometer" && ["RDM", "ADM"].indexOf(scheduletype) < 0) {
|
||||
col.visible = false;
|
||||
continue;
|
||||
}
|
||||
else if (col.name === "StartHours") {
|
||||
if (["HM", "PM"].indexOf(scheduletype) < 0) {
|
||||
col.visible = false;
|
||||
continue;
|
||||
}
|
||||
col.type = GridView.ColumnTypes.Input;
|
||||
}
|
||||
else if (col.name === "StartOdometer") {
|
||||
if (["RDM", "ADM"].indexOf(scheduletype) < 0) {
|
||||
col.visible = false;
|
||||
continue;
|
||||
}
|
||||
col.type = GridView.ColumnTypes.Input;
|
||||
}
|
||||
else if (col.name === "StartDateString") {
|
||||
if (["TBM"].indexOf(scheduletype) < 0) {
|
||||
col.visible = false;
|
||||
continue;
|
||||
}
|
||||
col.type = DateColumn;
|
||||
col.onChanged = function (item, value) {
|
||||
item.StartDate = item.StartDateString = DateColumn.formatDate(value);
|
||||
};
|
||||
}
|
||||
else if (col.name === "StartIntervalValue") {
|
||||
if (["HM", "RDM", "TBM"].indexOf(scheduletype) < 0) {
|
||||
col.visible = false;
|
||||
continue;
|
||||
}
|
||||
col.type = GridView.ColumnTypes.Dropdown;
|
||||
col.sourceCache = false;
|
||||
col.source = function (item) {
|
||||
var source = [];
|
||||
if (item.TempIntervals && item.TempIntervals.length > 0) {
|
||||
for (var i = 0; i < item.TempIntervals.length; i++) {
|
||||
var t = item.TempIntervals[i];
|
||||
var kv = { value: '' + t, text: '' + t };
|
||||
source.push(kv);
|
||||
}
|
||||
}
|
||||
return source;
|
||||
};
|
||||
}
|
||||
columns.push(col);
|
||||
}
|
||||
grid_assignedassetdt.multiSelect = true;
|
||||
grid_assignedassetdt.columns = columns;
|
||||
grid_assignedassetdt.init();
|
||||
}
|
||||
|
||||
function showSelectedAssetsList(data) {
|
||||
|
||||
grid_selectedassetdt.setData(data);
|
||||
grid_selectedassetdt.reload();
|
||||
}
|
||||
var grid_selectedassetdt;
|
||||
function InitSelectedAssetsGridData() {
|
||||
grid_selectedassetdt = createGridView('#selectedassets');
|
||||
grid_selectedassetdt.isEditable = true;
|
||||
var list_columns = [
|
||||
{ name: 'VIN', caption: GetTextByKey("P_PM_SN", 'SN'), valueIndex: 'VIN', css: { 'width': 140, 'text-align': 'left' } },
|
||||
{ name: 'Name', caption: GetTextByKey("P_PM_NAME", 'Name'), valueIndex: 'Name', css: { 'width': 140, 'text-align': 'left' } },
|
||||
{ name: 'EngineHours', caption: GetTextByKey("P_PM_CURRENTHOURS", 'Current Hours'), valueIndex: 'EngineHours', css: { 'width': 100, 'text-align': 'left' } },
|
||||
{ name: 'StartHours', caption: GetTextByKey("P_PM_STARTINGHOURS", 'Starting Hours'), valueIndex: 'StartHours', css: { 'width': 100, 'text-align': 'left' } },
|
||||
{ name: 'Odometer', caption: GetTextByKey("P_PM_CURRENTODOMETER", 'Current Odometer'), valueIndex: 'Odometer', css: { 'width': 100, 'text-align': 'left' } },
|
||||
{ name: 'StartOdometer', caption: GetTextByKey("P_PM_STARTODOMETER", 'Start Odometer'), valueIndex: 'StartOdometer', css: { 'width': 100, 'text-align': 'left' } },
|
||||
{ name: 'StartDateString', caption: GetTextByKey("P_PM_PLANSTARTDATE", 'Plan Start Date'), valueIndex: 'StartDateString', css: { 'width': 100, 'text-align': 'left' } },
|
||||
{ name: 'StartIntervalValue', caption: GetTextByKey("P_PM_STARTINTERVAL", 'Start Interval'), valueIndex: 'StartIntervalValue', css: { 'width': 100, 'text-align': 'left' } }
|
||||
];
|
||||
var columns = [];
|
||||
var DateColumn = window['lib-ui'].GridDateColumn;
|
||||
// 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;
|
||||
col.allowFilter = list_columns[hd].allowFilter;
|
||||
col.oldFilterValues = col.filterValues;
|
||||
col.styleFilter = function (item) {
|
||||
if (item.Highlight)
|
||||
return { 'background-color': 'yellow' };
|
||||
}
|
||||
if (list_columns[hd].type) {
|
||||
col.type = list_columns[hd].type;
|
||||
}
|
||||
|
||||
col.alwaysshow = list_columns[hd].alwaysshow;
|
||||
|
||||
if (col.name === "EngineHours" && ["HM", "PM"].indexOf(scheduletype) < 0) {
|
||||
col.visible = false;
|
||||
continue;
|
||||
}
|
||||
else if (col.name === "Odometer" && ["RDM", "ADM"].indexOf(scheduletype) < 0) {
|
||||
col.visible = false;
|
||||
continue;
|
||||
}
|
||||
else if (col.name === "StartHours") {
|
||||
if (["HM", "PM"].indexOf(scheduletype) < 0) {
|
||||
col.visible = false;
|
||||
continue;
|
||||
}
|
||||
col.type = GridView.ColumnTypes.Input;
|
||||
}
|
||||
else if (col.name === "StartOdometer") {
|
||||
if (["RDM", "ADM"].indexOf(scheduletype) < 0) {
|
||||
col.visible = false;
|
||||
continue;
|
||||
}
|
||||
col.type = GridView.ColumnTypes.Input;
|
||||
}
|
||||
else if (col.name === "StartDateString") {
|
||||
if (["TBM"].indexOf(scheduletype) < 0) {
|
||||
col.visible = false;
|
||||
continue;
|
||||
}
|
||||
col.type = DateColumn;
|
||||
col.onChanged = function (item, value) {
|
||||
item.StartDate = item.StartDateString = DateColumn.formatDate(value);
|
||||
};
|
||||
}
|
||||
else if (col.name === "StartIntervalValue") {
|
||||
if (["HM", "RDM", "TBM"].indexOf(scheduletype) < 0) {
|
||||
col.visible = false;
|
||||
continue;
|
||||
}
|
||||
col.type = GridView.ColumnTypes.Dropdown;;
|
||||
col.sourceCache = false;
|
||||
col.source = function (item) {
|
||||
var source = [];
|
||||
if (item.TempIntervals && item.TempIntervals.length > 0) {
|
||||
for (var i = 0; i < item.TempIntervals.length; i++) {
|
||||
var t = item.TempIntervals[i];
|
||||
var kv = { value: '' + t, text: '' + t };
|
||||
source.push(kv);
|
||||
}
|
||||
}
|
||||
return source
|
||||
};
|
||||
}
|
||||
columns.push(col);
|
||||
}
|
||||
grid_selectedassetdt.multiSelect = true;
|
||||
grid_selectedassetdt.columns = columns;
|
||||
grid_selectedassetdt.init();
|
||||
}
|
||||
|
||||
function getIntervalValues(currentValue) {
|
||||
@ -237,7 +239,7 @@ function getIntervalValues(currentValue) {
|
||||
function getMachineTypes() {
|
||||
pmquery('GetMachineTypes', '', function (data) {
|
||||
var types = [];
|
||||
types.push($('<option value="-1">' + GetTextByKey("P_SELECT_ALL","All") + '</option>'));
|
||||
types.push($('<option value="-1">' + GetTextByKey("P_SELECT_ALL", "All") + '</option>'));
|
||||
if (data && data.length > 0) {
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
types.push($('<option></option>').val(data[i].ID).text(data[i].Name));
|
||||
@ -267,7 +269,7 @@ function GetSelectedMachines() {
|
||||
}
|
||||
|
||||
function getMatchSelectedMachines() {
|
||||
var typeid = $('#sel_machine_type').val();
|
||||
var typeid = parseInt($('#sel_machine_type').val());
|
||||
var machinefilter = $('#txt_machine_key').val().toLowerCase();
|
||||
var showallassigned = $('#chk_showallassignedassets').prop('checked');
|
||||
|
||||
@ -311,10 +313,7 @@ function getMatchSelectedMachines() {
|
||||
_showSelectedMachines.push(unMatched[i]);
|
||||
}
|
||||
|
||||
if (assignedassetCtrl) {
|
||||
assignedassetCtrl.setData(_showSelectedMachines);
|
||||
//assignedassetCtrl.reload();
|
||||
}
|
||||
showAssignedAssetsList(_showSelectedMachines);
|
||||
}
|
||||
|
||||
function OnSaveMachines() {
|
||||
@ -326,7 +325,7 @@ function OnSaveMachines() {
|
||||
asset.StartIntervalValue = machine.StartIntervalValue;
|
||||
switch (scheduletype) {
|
||||
case "TBM":
|
||||
asset.StartDate = machine.StartDateString;
|
||||
asset.StartDate = machine.StartDate;
|
||||
if (asset.StartDate == "")
|
||||
asset.StartDate = "1900-01-01";
|
||||
break;
|
||||
@ -351,15 +350,16 @@ function OnSaveMachines() {
|
||||
'Assets': assets
|
||||
};
|
||||
|
||||
var alerttitle = GetTextByKey("P_MA_SAVEASSETS", 'Save Assets');
|
||||
pmquery('SaveMachines', JSON.stringify(item), function (data) {
|
||||
if (!data || data.length == 0) {
|
||||
// success
|
||||
for (var i = 0; i < _ScheduleAssets.length; i++) {
|
||||
_ScheduleAssets[i].unSaved = false;
|
||||
}
|
||||
showAlert(GetTextByKey("P_PM_SAVEASSETLISTSUCCESSFUL", 'Save asset list successful.'));
|
||||
showAlert(GetTextByKey("P_PM_SAVEASSETLISTSUCCESSFUL", 'Save asset list successful.'), alerttitle);
|
||||
} else {
|
||||
showAlert(GetTextByKey("P_PM_FAILEDTOSAVEASSETLIST", 'Failed to save asset list.') + "\n" + data);
|
||||
showAlert(GetTextByKey("P_PM_FAILEDTOSAVEASSETLIST", 'Failed to save asset list.') + "\n" + data, alerttitle);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -400,11 +400,10 @@ function convertOdometer(odometer, odounit) {
|
||||
return Math.round(value);
|
||||
}
|
||||
|
||||
var selectedassetsctrl = undefined;
|
||||
function setNewSelectedAseets(assets) {
|
||||
var newassets = [];
|
||||
for (var i = 0; i < assets.length; i++) {
|
||||
var a = assets[i].Values;
|
||||
var a = assets[i];
|
||||
if (!a.Selected) continue;
|
||||
|
||||
var item = {};
|
||||
@ -414,12 +413,14 @@ function setNewSelectedAseets(assets) {
|
||||
item.Name = a.Name;
|
||||
item.MakeName = a.MakeName;
|
||||
item.ModelName = a.ModelName;
|
||||
item.TypeID = a.TypeID;
|
||||
item.TypeName = a.TypeName;
|
||||
item.EngineHours = a.EngineHours;
|
||||
item.StartHours = a.EngineHours;
|
||||
item.Odometer = convertOdometer(a.Odometer, a.OdometerUnits);
|
||||
item.StartOdometer = item.Odometer;
|
||||
item.OdometerUnits = a.OdometerUnits;
|
||||
item.StartDateString = currentdate;
|
||||
item.StartDate = item.StartDateString = currentdate;
|
||||
item.StartIntervalValue = "";
|
||||
item.Enabled = true;
|
||||
if (scheduletype == "HM" || scheduletype == "RDM") {
|
||||
@ -453,12 +454,13 @@ function setNewSelectedAseets(assets) {
|
||||
'left': (document.documentElement.clientWidth - $('#dialog_machinegroup').width()) / 2
|
||||
}).showDialog();
|
||||
|
||||
selectedassetsctrl.setData(newassets);
|
||||
showSelectedAssetsList(newassets);
|
||||
}
|
||||
|
||||
function OnSetAssetsDialogOK() {
|
||||
for (var i = 0; i < selectedassetsctrl.vue.source.length; i++) {
|
||||
var asset = selectedassetsctrl.vue.source[i];
|
||||
var tempsource = grid_selectedassetdt.source;
|
||||
for (var i = 0; i < tempsource.length; i++) {
|
||||
var asset = tempsource[i];
|
||||
asset.unSaved = true;
|
||||
_ScheduleAssets.push(asset);
|
||||
}
|
||||
@ -500,14 +502,14 @@ function OnRemoveAssets() {
|
||||
msg += assetwillalerts + ".<br/>";
|
||||
msg += GetTextByKey("P_PM_DELTEALERTSYESORNOTIPS", "If you do not want those alerts deleted, select CANCEL and assign appropriate alerts to a maintenance record or work order in asset health prior to deletion/removal.");
|
||||
}
|
||||
|
||||
showConfirm(msg, GetTextByKey("P_PM_REMOVEASSETS", 'Remove Assets'), function (e) {
|
||||
var alerttitle = GetTextByKey("P_PM_REMOVEASSETS", 'Remove Assets');
|
||||
showConfirmOKCancel(msg, alerttitle, function (e) {
|
||||
pmquery('RemovePMAssets', JSON.stringify(item), function (data) {
|
||||
if (!data || data.length == 0) {
|
||||
showAlert(GetTextByKey("P_PM_ASSETSREMOVEDSUCCESSFULLY", 'Assets removed successfully.'));
|
||||
showAlert(GetTextByKey("P_PM_ASSETSREMOVEDSUCCESSFULLY", 'Assets removed successfully.'), alerttitle);
|
||||
GetSelectedMachines();
|
||||
} else {
|
||||
showAlert(GetTextByKey("P_PM_FAILEDTOREMOVEASSETS", 'Failed to remove assets.') + "\n" + data);
|
||||
showAlert(GetTextByKey("P_PM_FAILEDTOREMOVEASSETS", 'Failed to remove assets.') + "\n" + data, alerttitle);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
@ -53,22 +53,51 @@ function addWorkOrderComment(comment) {
|
||||
return;
|
||||
}
|
||||
|
||||
var param = JSON.stringify([workorderid, comment]);
|
||||
param = htmlencode(param);
|
||||
$('#mask_over_bg').show();
|
||||
worequest("AddWorkOrderComment", param, function (data) {
|
||||
$('#mask_over_bg').hide();
|
||||
if (data !== "") {
|
||||
showAlert(data, GetTextByKey("P_WO_ERROR", 'Error'));
|
||||
return;
|
||||
|
||||
var url = 'Maintenance/AddWorkOrder.aspx';
|
||||
var method = 'SendInternalComments';
|
||||
var data = new FormData();
|
||||
data.append('MethodName', method);
|
||||
data.append('WorkorderId', workorderid);
|
||||
data.append('Comment', encodeURIComponent(comment));
|
||||
//data.append('Emails', JSON.stringify(emailaddress));
|
||||
//data.append('Phones', JSON.stringify(phonenumbers));
|
||||
var file = internal?.file;
|
||||
if (file != null) {
|
||||
data.append('Attachment', file);
|
||||
}
|
||||
$.ajax({
|
||||
url: _network.root + url,
|
||||
type: 'POST',
|
||||
dataType: 'json',
|
||||
processData: false,
|
||||
contentType: false,
|
||||
cache: false,
|
||||
data: data,
|
||||
success: function (data) {
|
||||
$('#mask_over_bg').hide();
|
||||
if (data !== "") {
|
||||
showAlert(data, GetTextByKey("P_WO_ERROR", 'Error'));
|
||||
if (typeof internal !== 'undefined') {
|
||||
internal.loading = false;
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (typeof internal !== 'undefined') {
|
||||
internal.text = '';
|
||||
internal.file = null;
|
||||
internal.loading = false;
|
||||
}
|
||||
$('#commentsinputcount').text("0/" + $('#dialog_comments').attr("maxlength"));
|
||||
getComments();
|
||||
},
|
||||
error: function (request, textStatus, errorThrown) {
|
||||
$('#mask_over_bg').hide();
|
||||
if (typeof internal !== 'undefined') {
|
||||
internal.loading = false;
|
||||
}
|
||||
}
|
||||
if (typeof internal !== 'undefined') {
|
||||
internal.text = '';
|
||||
}
|
||||
$('#commentsinputcount').text("0/" + $('#dialog_comments').attr("maxlength"));
|
||||
getComments();
|
||||
}, function (err) {
|
||||
$('#mask_over_bg').hide();
|
||||
});
|
||||
}
|
||||
|
||||
@ -121,34 +150,70 @@ function getCommunications(reset) {
|
||||
function addWorkOrderCommunication() {
|
||||
var pmemails = customer?.contacts;
|
||||
if (pmemails == null || pmemails.length === 0) {
|
||||
if (typeof customer !== 'undefined')
|
||||
customer.loading = false;
|
||||
showAlert(GetTextByKey("P_WO_PLEASEINPUTTHEPHONENUMBEROREMAL", "Please input the phone number or email."), GetTextByKey("P_WO_ERROR", 'Error'));
|
||||
return;
|
||||
}
|
||||
|
||||
var comm = customer?.text;
|
||||
if ($.trim(comm) == "") {
|
||||
if (typeof customer !== 'undefined')
|
||||
customer.loading = false;
|
||||
showAlert(GetTextByKey("P_WO_PLEASEINPUTTHEMESSAGE", "Please input the message."), GetTextByKey("P_WO_ERROR", 'Error'));
|
||||
return;
|
||||
}
|
||||
|
||||
var includeStatusLink = customer?.statusLink;
|
||||
|
||||
var param = JSON.stringify([workorderid, JSON.stringify(pmemails), comm, (includeStatusLink ? "1" : "0")]);
|
||||
param = htmlencode(param);
|
||||
$('#mask_over_bg').show();
|
||||
worequest("AddWorkOrderCommunication", param, function (data) {
|
||||
$('#mask_over_bg').hide();
|
||||
if (data !== "") {
|
||||
showAlert(data, GetTextByKey("P_WO_ERROR", 'Error'));
|
||||
return;
|
||||
|
||||
var url = 'Maintenance/AddWorkOrder.aspx';
|
||||
var method = 'AddWorkOrderCommunication';
|
||||
var data = new FormData();
|
||||
data.append('MethodName', method);
|
||||
data.append('WorkorderId', workorderid);
|
||||
data.append('PMEmails', JSON.stringify(pmemails));
|
||||
data.append('Comment', encodeURIComponent(comm));
|
||||
data.append('IncludeStatusLink', includeStatusLink ? "1" : "0");
|
||||
var file = customer?.file;
|
||||
if (file != null) {
|
||||
data.append('Attachment', file);
|
||||
}
|
||||
$.ajax({
|
||||
url: _network.root + url,
|
||||
type: 'POST',
|
||||
dataType: 'json',
|
||||
processData: false,
|
||||
contentType: false,
|
||||
cache: false,
|
||||
data: data,
|
||||
success: function (data) {
|
||||
$('#mask_over_bg').hide();
|
||||
if (typeof customer !== 'undefined')
|
||||
customer.loading = false;
|
||||
if (data !== "") {
|
||||
showAlert(data, GetTextByKey("P_WO_ERROR", 'Error'));
|
||||
return;
|
||||
}
|
||||
if (typeof customer !== 'undefined') {
|
||||
customer.text = '';
|
||||
customer.file = null;
|
||||
}
|
||||
$('#msginputcount').text("0/" + $('#dialog_communications').attr("maxlength"));
|
||||
getCommunications();
|
||||
},
|
||||
error: function (request, textStatus, errorThrown) {
|
||||
$('#mask_over_bg').hide();
|
||||
if (typeof customer !== 'undefined') {
|
||||
customer.loading = false;
|
||||
}
|
||||
if (request?.readyState == 0) {
|
||||
console.log(request);
|
||||
} else {
|
||||
writelog_ironintel("onAddMessage", url + ".-1." + method + "." + JSON.stringify(param), JSON.stringify(request), textStatus + errorThrown);
|
||||
}
|
||||
}
|
||||
if (typeof customer !== 'undefined') {
|
||||
customer.text = '';
|
||||
}
|
||||
$('#msginputcount').text("0/" + $('#dialog_communications').attr("maxlength"));
|
||||
getCommunications();
|
||||
}, function (err) {
|
||||
$('#mask_over_bg').hide();
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
$(function () {
|
||||
InitContactGridData();
|
||||
if ($("#contactlist").length > 0)//contactlist在AddWorkOrder中使用
|
||||
InitContactGridData();
|
||||
InitICContactGridData();
|
||||
|
||||
$('#sendworkorder_search').bind('input propertychange', function () {
|
||||
@ -24,6 +25,9 @@
|
||||
|
||||
$('#sendicemailpopupdialog').dialog(function () {
|
||||
showmaskbg(false);
|
||||
if (typeof internal !== 'undefined') {
|
||||
internal.loading = false;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@ -37,7 +41,8 @@ function getMachineContacts(assetid) {
|
||||
return;
|
||||
}
|
||||
machineContacts = data;
|
||||
showContactList(true);
|
||||
if (grid_contactdt)//grid_contactdt在AddWorkOrder中使用
|
||||
showContactList(true);
|
||||
showICContactList(true);
|
||||
}, function (err) {
|
||||
});
|
||||
@ -52,31 +57,30 @@ function showContactList(newopen) {
|
||||
for (var i = 0; i < machineContacts.length; i++) {
|
||||
var r = machineContacts[i];
|
||||
|
||||
var fr = { Values: r };
|
||||
if (newopen) {
|
||||
if (assignedto.toLowerCase() === r.IID.toLowerCase())
|
||||
r.Email = true;
|
||||
else
|
||||
r.Email = false;
|
||||
if (assignedto.toLowerCase() === r.IID.toLowerCase())
|
||||
rows.splice(0, 0, fr);
|
||||
rows.splice(0, 0, r);
|
||||
else
|
||||
rows.push(fr);
|
||||
rows.push(r);
|
||||
}
|
||||
else {
|
||||
if (!r.Text && !r.Email) {
|
||||
if (r.DisplayName.toLowerCase().indexOf(filter) >= 0) {
|
||||
if (assignedto.toLowerCase() === r.IID.toLowerCase())
|
||||
rows.splice(0, 0, fr);
|
||||
rows.splice(0, 0, r);
|
||||
else
|
||||
rows.push(fr);
|
||||
rows.push(r);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (assignedto.toLowerCase() === r.IID.toLowerCase())
|
||||
rows.splice(0, 0, fr);
|
||||
rows.splice(0, 0, r);
|
||||
else
|
||||
rows.push(fr);
|
||||
rows.push(r);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -88,12 +92,7 @@ function showContactList(newopen) {
|
||||
|
||||
var grid_contactdt;
|
||||
function InitContactGridData() {
|
||||
grid_contactdt = new GridView('#contactlist');
|
||||
grid_contactdt.lang = {
|
||||
all: GetTextByKey("P_GRID_ALL", "(All)"),
|
||||
ok: GetTextByKey("P_GRID_OK", "OK"),
|
||||
reset: GetTextByKey("P_GRID_RESET", "Reset")
|
||||
};
|
||||
grid_contactdt = createGridView('#contactlist');
|
||||
var list_columns = [
|
||||
{ name: 'DisplayName', caption: GetTextByKey("P_WO_CONTACTNAME", "Contact Name"), valueIndex: 'DisplayName', css: { 'width': 148, 'text-align': 'left' } },
|
||||
{ name: 'ContactTypeName', caption: GetTextByKey("P_WO_CONTACTTYPE", "Contact Type"), valueIndex: 'ContactTypeName', css: { 'width': 148, 'text-align': 'left' } },
|
||||
@ -126,15 +125,9 @@ function InitContactGridData() {
|
||||
};
|
||||
}
|
||||
}
|
||||
grid_contactdt.canMultiSelect = false;
|
||||
grid_contactdt.multiSelect = false;
|
||||
grid_contactdt.columns = columns;
|
||||
grid_contactdt.init();
|
||||
|
||||
grid_contactdt.selectedrowchanged = function (rowindex) {
|
||||
var rowdata = grid_contactdt.source[rowindex];
|
||||
if (rowdata) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function openSendEmail() {
|
||||
@ -197,8 +190,9 @@ function onSendWorkOrder() {
|
||||
}
|
||||
}
|
||||
|
||||
for (var i = 0; i < grid_contactdt.source.length; i++) {
|
||||
var ct = grid_contactdt.source[i].Values;
|
||||
var tempsource = grid_contactdt.source;
|
||||
for (var i = 0; i < tempsource.length; i++) {
|
||||
var ct = tempsource[i];
|
||||
if (ct.Email) {
|
||||
emailaddress.push({ 'Key': ct.IID, 'Value': ct.ID });
|
||||
}
|
||||
@ -228,12 +222,7 @@ function onSendWorkOrder() {
|
||||
|
||||
var grid_iccontactdt;
|
||||
function InitICContactGridData() {
|
||||
grid_iccontactdt = new GridView('#iccontactlist');
|
||||
grid_iccontactdt.lang = {
|
||||
all: GetTextByKey("P_GRID_ALL", "(All)"),
|
||||
ok: GetTextByKey("P_GRID_OK", "OK"),
|
||||
reset: GetTextByKey("P_GRID_RESET", "Reset")
|
||||
};
|
||||
grid_iccontactdt = createGridView('#iccontactlist');
|
||||
var list_columns = [
|
||||
{ name: 'DisplayName', caption: GetTextByKey("P_WO_CONTACTNAME", "Contact Name"), valueIndex: 'DisplayName', css: { 'width': 148, 'text-align': 'left' } },
|
||||
{ name: 'ContactTypeName', caption: GetTextByKey("P_WO_CONTACTTYPE", "Contact Type"), valueIndex: 'ContactTypeName', css: { 'width': 148, 'text-align': 'left' } },
|
||||
@ -266,15 +255,9 @@ function InitICContactGridData() {
|
||||
};
|
||||
}
|
||||
}
|
||||
grid_iccontactdt.canMultiSelect = false;
|
||||
grid_iccontactdt.multiSelect = false;
|
||||
grid_iccontactdt.columns = columns;
|
||||
grid_iccontactdt.init();
|
||||
|
||||
grid_iccontactdt.selectedrowchanged = function (rowindex) {
|
||||
var rowdata = grid_iccontactdt.source[rowindex];
|
||||
if (rowdata) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function showICContactList(newopen) {
|
||||
@ -286,15 +269,15 @@ function showICContactList(newopen) {
|
||||
if (newopen) {
|
||||
r.Text = false;
|
||||
r.Email = false;
|
||||
rows.push({ Values: r });
|
||||
rows.push(r);
|
||||
}
|
||||
else {
|
||||
if (!r.Text && !r.Email) {
|
||||
if (r.DisplayName.toLowerCase().indexOf(filter) >= 0)
|
||||
rows.push({ Values: r });
|
||||
rows.push(r);
|
||||
}
|
||||
else
|
||||
rows.push({ Values: r });
|
||||
rows.push(r);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -340,12 +323,16 @@ function hideSendICEmailPopup() {
|
||||
$('#sendicemailpopupdialog').hide();
|
||||
}
|
||||
|
||||
var icsending = false;
|
||||
function onSendInternalComments() {
|
||||
var comment = internal?.text;
|
||||
if ($.trim(comment) == "") {
|
||||
hideSendICEmailPopup();
|
||||
return;
|
||||
}
|
||||
if (icsending)
|
||||
return;
|
||||
icsending = true;
|
||||
var alerttitle = GetTextByKey("P_WO_SENDINTERNALCOMMENTS", "Send Internal Comments");
|
||||
var emailaddress = [];
|
||||
var otheremailaddressstr = $('#sendic_otheremailaddress').val();
|
||||
@ -375,34 +362,70 @@ function onSendInternalComments() {
|
||||
}
|
||||
}
|
||||
|
||||
for (var i = 0; i < grid_iccontactdt.source.length; i++) {
|
||||
var ct = grid_iccontactdt.source[i].Values;
|
||||
var tempsource = grid_iccontactdt.source;
|
||||
for (var i = 0; i < tempsource.length; i++) {
|
||||
var ct = tempsource[i];
|
||||
if (ct.Email) {
|
||||
emailaddress.push({ 'Key': ct.IID, 'Value': ct.ID });
|
||||
emailaddress.push({ 'Key': ct.IID, 'Value': ct.ID, 'Tag1': ct.DisplayName });
|
||||
}
|
||||
if (ct.Text && (checkPhoneNumber(ct.Mobile) || CheckEmail(ct.Mobile))) {
|
||||
phonenumbers.push({ 'Key': ct.IID, 'Value': ct.Mobile });
|
||||
phonenumbers.push({ 'Key': ct.IID, 'Value': ct.Mobile, 'Tag1': ct.DisplayName });
|
||||
}
|
||||
}
|
||||
|
||||
var param = JSON.stringify([workorderid, comment, JSON.stringify(emailaddress), JSON.stringify(phonenumbers)]);
|
||||
param = htmlencode(param);
|
||||
worequest("SendInternalComments", param, function (data) {
|
||||
if (data !== "") {
|
||||
showAlert(data, GetTextByKey("P_WO_ERROR", 'Error'));
|
||||
return;
|
||||
var url = 'Maintenance/AddWorkOrder.aspx';
|
||||
var method = 'SendInternalComments';
|
||||
var data = new FormData();
|
||||
data.append('MethodName', method);
|
||||
data.append('WorkorderId', workorderid);
|
||||
data.append('Comment', encodeURIComponent(comment));
|
||||
data.append('Emails', JSON.stringify(emailaddress));
|
||||
data.append('Phones', JSON.stringify(phonenumbers));
|
||||
var file = internal?.file;
|
||||
if (file != null) {
|
||||
data.append('Attachment', file);
|
||||
}
|
||||
$.ajax({
|
||||
url: _network.root + url,
|
||||
type: 'POST',
|
||||
dataType: 'json',
|
||||
processData: false,
|
||||
contentType: false,
|
||||
cache: false,
|
||||
data: data,
|
||||
success: function (data) {
|
||||
icsending = false;
|
||||
$('#mask_over_bg').hide();
|
||||
if (data !== "") {
|
||||
showAlert(data, GetTextByKey("P_WO_ERROR", 'Error'));
|
||||
if (typeof internal !== 'undefined') {
|
||||
internal.loading = false;
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (typeof internal !== 'undefined') {
|
||||
internal.text = '';
|
||||
internal.file = null;
|
||||
internal.loading = false;
|
||||
}
|
||||
hideSendICEmailPopup();
|
||||
if (typeof wowidgetobj != 'undefined')
|
||||
wowidgetobj.reloaddata("InternalComments");
|
||||
else
|
||||
getComments();
|
||||
},
|
||||
error: function (request, textStatus, errorThrown) {
|
||||
icsending = false;
|
||||
hideSendICEmailPopup();
|
||||
if (typeof internal !== 'undefined') {
|
||||
internal.loading = false;
|
||||
}
|
||||
if (request?.readyState == 0) {
|
||||
console.log(request);
|
||||
} else {
|
||||
writelog_ironintel("onSendInternalComments", url + ".-1." + method + "." + JSON.stringify(param), JSON.stringify(request), textStatus + errorThrown);
|
||||
}
|
||||
}
|
||||
if (typeof internal !== 'undefined') {
|
||||
internal.text = '';
|
||||
}
|
||||
hideSendICEmailPopup();
|
||||
if (typeof wowidgetobj != 'undefined')
|
||||
wowidgetobj.reloaddata("InternalComments");
|
||||
else
|
||||
getComments();
|
||||
|
||||
}, function (err) {
|
||||
hideSendICEmailPopup();
|
||||
});
|
||||
}
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
1
Site/Maintenance/js/workordertabitems.min.js
vendored
Normal file
1
Site/Maintenance/js/workordertabitems.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
@ -1,6 +1,6 @@
|
||||
var $wowidgetselector = function (id) {
|
||||
this.containerId = id;
|
||||
this.title = GetTextByKey("P_XXX", 'Widgets');
|
||||
this.title = GetTextByKey("P_WO_WIDGETS", 'Widgets');
|
||||
this.companyId = null;;
|
||||
this.forceSingle = false;
|
||||
this.exceptShareAsset = false;
|
||||
@ -15,12 +15,7 @@
|
||||
var __proto = $wowidgetselector.prototype;
|
||||
|
||||
function initWidgetsGrid(parent) {
|
||||
var grid = new GridView(parent);
|
||||
grid.lang = {
|
||||
all: GetTextByKey("P_GRID_ALL", "(All)"),
|
||||
ok: GetTextByKey("P_GRID_OK", "OK"),
|
||||
reset: GetTextByKey("P_GRID_RESET", "Reset")
|
||||
};
|
||||
var grid = createGridView(parent);
|
||||
var styleFilter = function (item) {
|
||||
if (item.Suggested) {
|
||||
return {
|
||||
@ -40,26 +35,49 @@
|
||||
if (item.Suggested)
|
||||
return 'yellow';
|
||||
};
|
||||
var columns = [];
|
||||
columns.push({
|
||||
// checkbox
|
||||
name: 'check',
|
||||
key: 'Visible',
|
||||
width: 45,
|
||||
align: 'center',
|
||||
sortable: false,
|
||||
allcheck: true,
|
||||
type: 3
|
||||
},
|
||||
grid.columns = [
|
||||
{
|
||||
// checkbox
|
||||
name: 'check',
|
||||
key: 'Visible',
|
||||
width: 45,
|
||||
align: 'center',
|
||||
sortable: false,
|
||||
allcheck: true,
|
||||
type: 3
|
||||
},
|
||||
{
|
||||
key: 'WidgetName',
|
||||
caption: 'Name',
|
||||
width: 300,
|
||||
width: 290,
|
||||
styleFilter: styleFilter,
|
||||
bgFilter: bgFilter
|
||||
});
|
||||
//grid.canMultiSelect = true;
|
||||
grid.columns = columns;
|
||||
},
|
||||
{
|
||||
key: 'InBottom',
|
||||
caption: 'Bottom',
|
||||
//captionTooltip: 'Multiple widgets may be placed on the bottom',
|
||||
type: 3,
|
||||
width: 80,
|
||||
enabled: 'Visible',
|
||||
onChanged: function (item) {
|
||||
item.InRight = !item.InBottom;
|
||||
grid.refresh();
|
||||
}
|
||||
},
|
||||
{
|
||||
key: 'InRight',
|
||||
caption: 'Right',
|
||||
//captionTooltip: 'Only one widget may be placed on the right',
|
||||
type: 3,
|
||||
width: 70,
|
||||
enabled: 'Visible',
|
||||
onChanged: function (item) {
|
||||
item.InBottom = !item.InRight;
|
||||
grid.refresh();
|
||||
}
|
||||
}
|
||||
];
|
||||
grid.init();
|
||||
|
||||
this.gridWidgets = grid;
|
||||
@ -75,9 +93,9 @@
|
||||
var content = $('<div class="dialog-content"></div>').appendTo(dialog);
|
||||
|
||||
var labeldiv = $('<div style="margin: 4px 0 0 10px; line-height: 25px"></div>').appendTo(content);
|
||||
$('<span></span>').text(GetTextByKey("P_XXX", 'Which Widgets Should be Displayed?')).appendTo(labeldiv);
|
||||
$('<span></span>').text(GetTextByKey("P_WO_WHICHWIDGETSSHOULDBEDISPLAYED", 'Which Widgets Should be Displayed?')).appendTo(labeldiv);
|
||||
|
||||
this.widgetList = $('<div style="width: 520px; height: 320px; margin: 10px 0 4px"></div>').appendTo(content);
|
||||
this.widgetList = $('<div style="width: 520px; height: 320px; margin: 10px 0 4px; position: relative"></div>').appendTo(content);
|
||||
|
||||
var dialogFunction = $('<div class="dialog-func"></div>').appendTo(dialog);
|
||||
$('<input type="button" value="' + GetTextByKey("P_SELECTASSETS_CANCEL", "Cancel") + '" class="dialog-close" />').appendTo(dialogFunction).css("height", 'unset');
|
||||
@ -132,39 +150,48 @@
|
||||
|
||||
worequest("GetWorkOrderWidgets", "", function (data) {
|
||||
if (typeof data === 'string') {
|
||||
showAlert(GetTextByKey("P_XXX", 'Error'), title);
|
||||
showAlert(GetTextByKey("P_WO_ERROR", 'Error'), title);
|
||||
maskbg.hide();
|
||||
return;
|
||||
}
|
||||
var items = [];
|
||||
for (var i = 0; i < widgetdata.length; i++) {
|
||||
var item = widgetdata[i].Values;
|
||||
var item = widgetdata[i];
|
||||
item.Visible = false;
|
||||
for (var j = 0; j < data.length; j++) {
|
||||
if (item.WidgetId == data[j].WidgetId) {
|
||||
var wd = data[j];
|
||||
if (item.WidgetId == wd.WidgetId) {
|
||||
item.Visible = true;
|
||||
item.InBottom = wd.Position != 1;
|
||||
item.InRight = wd.Position == 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
items.push({ Values: item });
|
||||
if (!item.InBottom && !item.InRight) {
|
||||
item.InBottom = true;
|
||||
}
|
||||
items.push(item);
|
||||
}
|
||||
|
||||
gridWidgets.setData(items);
|
||||
maskbg.hide();
|
||||
}, function () {
|
||||
showAlert(GetTextByKey("P_XXXX", 'Failed to get the work order widget list.'), title);
|
||||
showAlert(GetTextByKey("P_WO_FAILEDTOGETTHEWORKORDERWIDGETLIST", 'Failed to get the work order widget list.'), title);
|
||||
maskbg.hide();
|
||||
});
|
||||
}
|
||||
|
||||
function onOKClick() {
|
||||
var widgets = [];
|
||||
for (var i = 0; i < this.gridWidgets.source.length; i++) {
|
||||
widgets.push(this.gridWidgets.source[i].Values);
|
||||
}
|
||||
|
||||
var _this = this;
|
||||
var alerttitle = GetTextByKey("P_WO_XXX", "Save Widgets");
|
||||
var param = JSON.stringify(widgets);
|
||||
var alerttitle = GetTextByKey("P_WO_SAVEWIDGETS", "Save Widgets");
|
||||
var param = JSON.stringify(this.gridWidgets.source.map(function (w) {
|
||||
return {
|
||||
WidgetId: w.WidgetId,
|
||||
Category: w.Category,
|
||||
Visible: w.Visible,
|
||||
Position: w.InRight ? 1 : 0
|
||||
};
|
||||
}));
|
||||
param = htmlencode(param);
|
||||
worequest("SaveWorkOrderWidgets", param, function (data) {
|
||||
if (data !== 'OK') {
|
||||
@ -188,24 +215,46 @@ var WorkOrderWidget = function () {
|
||||
var _this = this;
|
||||
this.getWorkOrderWidgets = function () {
|
||||
this.workorderwidgets = null;
|
||||
var title = GetTextByKey("P_XXX", 'Widget');
|
||||
var title = GetTextByKey("P_WO_WIDGETS", 'Widget');
|
||||
worequest("GetWorkOrderWidgets", "", function (data) {
|
||||
if (typeof data === 'string') {
|
||||
showAlert(GetTextByKey("P_XXX", 'Error'), title);
|
||||
showAlert(GetTextByKey("P_WO_ERROR", 'Error'), title);
|
||||
return;
|
||||
}
|
||||
for (var w of data) {
|
||||
w.InBottom = w.Position != 1;
|
||||
w.InRight = w.Position == 1
|
||||
}
|
||||
_this.workorderwidgets = data;
|
||||
var display = data?.length > 0 ? 'block' : 'none';
|
||||
$('#workorderspliter').css('display', display);
|
||||
$('#workorderdetail').css('display', display);
|
||||
_this.showWorkOrderWidgets();
|
||||
_this.getWorkOrderContacts(_this.workorderid);
|
||||
setTimeout(function () {
|
||||
$(window).resize();
|
||||
document.querySelector('#workorderdetail').scrollTop = 0;
|
||||
}, 0);
|
||||
$(window).resize();
|
||||
if (data?.length > 0) {
|
||||
var displayBottom = data.find(function (w) { return w.InBottom }) != null ? '' : 'none';
|
||||
var hasRight = data.find(function (w) { return w.InRight }) != null;
|
||||
var displayRight = hasRight ? '' : 'none';
|
||||
$('#workorderspliter').css('display', displayBottom);
|
||||
$('#workorderdetail').css('display', spliterProps.collapsed ? 'none' : displayBottom);
|
||||
$('#workorderspliter_right').css('display', displayRight);
|
||||
var right = $('#workorderdetail_right');
|
||||
right.css('display', spliterProps.collapsed_right ? 'none' : displayRight);
|
||||
if (hasRight) {
|
||||
ui.createTab(right[0]);
|
||||
}
|
||||
_this.showWorkOrderWidgets();
|
||||
if (hasRight) {
|
||||
right.find('.ui-tab-header>.ui-tab-title:first').click();
|
||||
}
|
||||
_this.getWorkOrderContacts(_this.workorderid);
|
||||
setTimeout(function () {
|
||||
document.querySelector('#workorderdetail').scrollTop = 0;
|
||||
}, 0);
|
||||
} else {
|
||||
$('#workorderspliter').css('display', 'none');
|
||||
$('#workorderdetail').css('display', 'none');
|
||||
$('#workorderspliter_right').css('display', 'none');
|
||||
$('#workorderdetail_right').css('display', 'none');
|
||||
}
|
||||
}, function () {
|
||||
showAlert(GetTextByKey("P_XXXX", 'Failed to get the work order widget list.'), title);
|
||||
showAlert(GetTextByKey("P_WO_FAILEDTOGETTHEWORKORDERWIDGETLIST", 'Failed to get the work order widget list.'), title);
|
||||
});
|
||||
}
|
||||
|
||||
@ -218,7 +267,7 @@ var WorkOrderWidget = function () {
|
||||
} else {
|
||||
for (let w of this.workorderwidgets) {
|
||||
if (Object.prototype.hasOwnProperty.call(this.widgets, w.WidgetId)) {
|
||||
this.widgets[w.WidgetId].changewo(this.workorderid, this.assetid, wo);
|
||||
this.widgets[w.WidgetId]?.changewo(this.workorderid, this.assetid, wo);
|
||||
}
|
||||
}
|
||||
this.getWorkOrderContacts(this.workorderid);
|
||||
@ -229,8 +278,7 @@ var WorkOrderWidget = function () {
|
||||
if (this.workorderwidgets != null) {
|
||||
for (let w of this.workorderwidgets) {
|
||||
this.popups[w.WidgetId]?.close(false);
|
||||
if (this.widgets[w.WidgetId] && typeof this.widgets[w.WidgetId].close == 'function')
|
||||
this.widgets[w.WidgetId].close();
|
||||
this.widgets[w.WidgetId]?.close?.();
|
||||
}
|
||||
}
|
||||
this.getWorkOrderWidgets();
|
||||
@ -239,18 +287,21 @@ var WorkOrderWidget = function () {
|
||||
this.onmsgreceived = function (data) {
|
||||
if (this.workorderwidgets != null) {
|
||||
if (data && this.workorderid == data.Message) {
|
||||
var wid = this.workorderid;
|
||||
if (data.Code == "501") {
|
||||
for (let w of this.workorderwidgets) {
|
||||
this.widgets[w.WidgetId].changewo(this.workorderid);
|
||||
if (this.workorderwidgets && this.workorderwidgets.length > 0) {
|
||||
for (let w of this.workorderwidgets) {
|
||||
this.widgets[w.WidgetId]?.changewo(wid);
|
||||
}
|
||||
this.getWorkOrderContacts(this.workorderid);
|
||||
}
|
||||
this.getWorkOrderContacts(this.workorderid);
|
||||
}
|
||||
else if (data.Code == "503" || data.Code == "504" || data.Code == "507") {
|
||||
this.widgets['CustomerCommunication']?.changewo(this.workorderid);
|
||||
this.widgets['CustomerCommunication']?.changewo(wid);
|
||||
this.getWorkOrderContacts(this.workorderid);
|
||||
}
|
||||
else if (data.Code == "505") {
|
||||
this.widgets['InternalComments']?.changewo(this.workorderid);
|
||||
this.widgets['InternalComments']?.changewo(wid);
|
||||
}
|
||||
else if (data.Code == "506") {
|
||||
this.getWorkOrderContacts(this.workorderid);
|
||||
@ -259,23 +310,43 @@ var WorkOrderWidget = function () {
|
||||
{
|
||||
for (let w of this.workorderwidgets) {
|
||||
this.popups[w.WidgetId]?.close(false);
|
||||
if (this.widgets[w.WidgetId] && typeof this.widgets[w.WidgetId].close == 'function')
|
||||
this.widgets[w.WidgetId].close();
|
||||
this.widgets[w.WidgetId]?.close?.();
|
||||
}
|
||||
this.workorderwidgets = null;
|
||||
this.popups = [];
|
||||
this.widgets = [];
|
||||
this.popups = {};
|
||||
this.widgets = {};
|
||||
$('#workorderspliter').css('display', 'none');
|
||||
$('#workorderdetail').css('display', 'none');
|
||||
$(window).resize();
|
||||
}
|
||||
else if (data.Code == "508") {
|
||||
this.widgets['Alerts']?.changewo(wid);
|
||||
}
|
||||
else if (data.Code == "509") {
|
||||
this.widgets['Segments']?.changewo(wid);
|
||||
}
|
||||
else if (data.Code == "510") {
|
||||
this.widgets['Attachments']?.changewo(wid);
|
||||
}
|
||||
else if (data.Code == "511") {
|
||||
this.widgets['Inspections']?.changewo(wid);
|
||||
this.widgets['Attachments']?.changewo(wid);
|
||||
this.widgets['Alerts']?.changewo(wid);
|
||||
}
|
||||
else if (data.Code == "512") {
|
||||
this.widgets['Estimates']?.changewo(wid);
|
||||
}
|
||||
else if (data.Code == "513") {
|
||||
this.widgets['Invoices']?.changewo(wid);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
this.reloaddata = function (widgetid) {
|
||||
if (this.workorderwidgets != null) {
|
||||
this.widgets[widgetid]?.changewo(this.workorderid);
|
||||
var wid = this.workorderid;
|
||||
this.widgets[widgetid]?.changewo(wid);
|
||||
}
|
||||
this.getWorkOrderContacts(this.workorderid);
|
||||
};
|
||||
@ -285,23 +356,28 @@ var WorkOrderWidget = function () {
|
||||
this.defY = 0;
|
||||
this.currentZIndex = 200 + this.workorderwidgets.length;
|
||||
for (let w of this.workorderwidgets) {
|
||||
this.createWidgetDialog(w);
|
||||
if (w.InBottom) {
|
||||
this.createWidgetDialog(w);
|
||||
}
|
||||
if (w.InRight) {
|
||||
this.createWidgetDialog(w, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.saveWorkOrderWidgets = function (widget, layout) {
|
||||
widget.Layout = JSON.stringify(layout);
|
||||
|
||||
var title = GetTextByKey("P_XXX", 'Widget');
|
||||
var title = GetTextByKey("P_WO_WIDGET", 'Widget');
|
||||
worequest('SaveWorkOrderWidgetLayout', JSON.stringify(widget), function (data) {
|
||||
if (data === 'OK') {
|
||||
return;
|
||||
}
|
||||
showAlert(data, title);
|
||||
}, function () {
|
||||
showAlert(GetTextByKey("P_XXXX", 'Failed to save the work order widget layout.'), title);
|
||||
showAlert(GetTextByKey("P_WO_FAILEDTOSAVETHEWORKORDERWIDGETLAYOUT", 'Failed to save the work order widget layout.'), title);
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
this.getWorkOrderContacts = function (woid) {
|
||||
worequest('GetWorkOrderContacts', woid, function (data) {
|
||||
@ -311,75 +387,90 @@ var WorkOrderWidget = function () {
|
||||
}
|
||||
if (_this.workorderwidgets != null) {
|
||||
for (let w of _this.workorderwidgets) {
|
||||
if (_this.widgets[w.WidgetId] && typeof _this.widgets[w.WidgetId].updatecontact == 'function')
|
||||
_this.widgets[w.WidgetId].updatecontact(data);
|
||||
_this.widgets[w.WidgetId]?.updatecontact?.(data);
|
||||
}
|
||||
}
|
||||
}, function () {
|
||||
});
|
||||
};
|
||||
|
||||
this.createWidgetDialog = function (widget) {
|
||||
this.createWidgetDialog = function (widget, right) {
|
||||
const ui = window['lib-ui'];
|
||||
|
||||
let width = $(document.body).width();
|
||||
let layout = widget.Layout;
|
||||
if (!layout || layout === '') {
|
||||
let x = this.defX;
|
||||
let y = this.defY;
|
||||
let left = 10 + 315 * x;
|
||||
if (left + 300 > width) {
|
||||
x = 0;
|
||||
left = 10;
|
||||
y++;
|
||||
this.defY = y;
|
||||
}
|
||||
let top = 10 + 165 * y;
|
||||
if (top >= widgetHeight) {
|
||||
top = widgetHeight - 40;
|
||||
}
|
||||
x++;
|
||||
this.defX = x;
|
||||
layout = { left, top, width: 300, height: 400 };
|
||||
} else {
|
||||
layout = JSON.parse(widget.Layout);
|
||||
if (layout.top >= widgetHeight) {
|
||||
layout.top = widgetHeight - 40;
|
||||
}
|
||||
if (layout.left >= width) {
|
||||
layout.left = width - 10;
|
||||
}
|
||||
}
|
||||
let zIndex = this.currentZIndex--;
|
||||
|
||||
var container = ui.createElement('div', 'class-content');
|
||||
var _this = this;
|
||||
const popup = new ui.Popup({
|
||||
title: widgetdata.find(function (v) { return v.Values.WidgetId == widget.WidgetId })?.Values?.WidgetName,
|
||||
content: container,
|
||||
mask: false,
|
||||
// movable: false,
|
||||
resizable: true,
|
||||
collapsable: true,
|
||||
zIndex,
|
||||
changeZIndex: true,
|
||||
minWidth: 210,
|
||||
minHeight: 200,
|
||||
buttons: [
|
||||
//{
|
||||
// text: 'Loading', trigger: p => {
|
||||
// p.loading = true;
|
||||
// setTimeout(() => p.loading = false, 1000);
|
||||
// return false;
|
||||
// }
|
||||
//},
|
||||
//{ text: 'OK' }
|
||||
],
|
||||
onMoveEnded: function () { _this.saveWorkOrderWidgets(widget, popup.rect) },
|
||||
onResizeEnded: function () { _this.saveWorkOrderWidgets(widget, popup.rect) }
|
||||
});
|
||||
popup.show(document.querySelector('#workorderdetail'));
|
||||
popup.rect = layout;
|
||||
var opts;
|
||||
|
||||
let layout = widget.Layout;
|
||||
if (right) {
|
||||
opts = {
|
||||
title: widgetdata.find(function (v) { return v.WidgetId == widget.WidgetId })?.WidgetName,
|
||||
content: container,
|
||||
mask: false,
|
||||
closable: false,
|
||||
movable: false,
|
||||
resizable: false
|
||||
};
|
||||
} else {
|
||||
let width = $(document.body).width();
|
||||
if (!layout || layout === '') {
|
||||
let x = this.defX;
|
||||
let y = this.defY;
|
||||
let left = 10 + 315 * x;
|
||||
if (left + 300 > width) {
|
||||
x = 0;
|
||||
left = 10;
|
||||
y++;
|
||||
this.defY = y;
|
||||
}
|
||||
let top = 10 + 165 * y;
|
||||
if (top >= spliterProps.widgetHeight) {
|
||||
top = spliterProps.widgetHeight - 40;
|
||||
}
|
||||
x++;
|
||||
this.defX = x;
|
||||
layout = { left, top, width: 300, height: 400 };
|
||||
} else {
|
||||
layout = JSON.parse(widget.Layout);
|
||||
if (layout.top >= spliterProps.widgetHeight) {
|
||||
layout.top = spliterProps.widgetHeight - 40;
|
||||
}
|
||||
if (layout.left >= width) {
|
||||
layout.left = width - 10;
|
||||
}
|
||||
}
|
||||
let zIndex = this.currentZIndex--;
|
||||
|
||||
var _this = this;
|
||||
opts = {
|
||||
title: widgetdata.find(function (v) { return v.WidgetId == widget.WidgetId })?.WidgetName,
|
||||
content: container,
|
||||
mask: false,
|
||||
// movable: false,
|
||||
resizable: true,
|
||||
collapsable: true,
|
||||
zIndex,
|
||||
changeZIndex: true,
|
||||
minWidth: 210,
|
||||
minHeight: 200,
|
||||
onMoveEnded: function () { _this.saveWorkOrderWidgets(widget, popup.rect) },
|
||||
onResizeEnded: function () { _this.saveWorkOrderWidgets(widget, popup.rect) }
|
||||
};
|
||||
}
|
||||
const popup = new ui.Popup(opts);
|
||||
if (right) {
|
||||
var right = document.querySelector('#workorderdetail_right');
|
||||
var header = right.querySelector('.ui-tab-header');
|
||||
header.append(ui.createElement('span', function (span) {
|
||||
span.className = 'ui-tab-title';
|
||||
span.dataset.for = widget.WidgetId;
|
||||
span.innerText = opts.title;
|
||||
}));
|
||||
popup.show(right);
|
||||
popup.container.parentElement.classList.add('ui-tab-page');
|
||||
popup.container.parentElement.dataset.page = widget.WidgetId;
|
||||
} else {
|
||||
popup.show(document.querySelector('#workorderdetail'));
|
||||
popup.rect = layout;
|
||||
}
|
||||
this.popups[widget.WidgetId] = popup;
|
||||
|
||||
let options = {
|
||||
@ -387,7 +478,8 @@ var WorkOrderWidget = function () {
|
||||
canExport: canExport,
|
||||
showloading: function (flag) {
|
||||
popup.loading = flag;
|
||||
}
|
||||
},
|
||||
inwidget: true
|
||||
};
|
||||
let content;
|
||||
switch (widget.WidgetId) {
|
||||
@ -401,11 +493,11 @@ var WorkOrderWidget = function () {
|
||||
onchange: function () {
|
||||
content.customer.statusLink = this.checked;
|
||||
ui.setTooltip(checkLink, this.checked ?
|
||||
GetTextByKey('P_WO_XXXXXX', 'Status Link Included') :
|
||||
GetTextByKey('P_WO_XXXXXX', 'Status Link Excluded'));
|
||||
GetTextByKey('P_WO_STATUSLINKINCLUDED', 'Status Link Included') :
|
||||
GetTextByKey('P_WO_STATUSLINKEXCLUDED', 'Status Link Excluded'));
|
||||
}
|
||||
});
|
||||
ui.setTooltip(checkLink, GetTextByKey('P_WO_XXXXXX', 'Status Link Excluded'));
|
||||
ui.setTooltip(checkLink, GetTextByKey('P_WO_STATUSLINKEXCLUDED', 'Status Link Excluded'));
|
||||
$(checkLink).insertAfter(options.parent.parents('.ui-popup-container').find('.ui-popup-header>.ui-popup-header-title'));
|
||||
break;
|
||||
case 'InternalComments': content = new $wointernal(options); break;
|
||||
@ -415,6 +507,7 @@ var WorkOrderWidget = function () {
|
||||
case 'Inspections': content = new $woinspection(options); break;
|
||||
case 'Estimates': content = new $woestimate(options); break;
|
||||
case 'Invoices': content = new $woinvoice(options); break;
|
||||
case 'CustomerRecordComments': content = new $wocrcomment(options); break;
|
||||
}
|
||||
if (content != null) {
|
||||
this.widgets[widget.WidgetId] = content;
|
||||
|
Reference in New Issue
Block a user