210 lines
10 KiB
Plaintext
210 lines
10 KiB
Plaintext
<%@ Page Title="" Language="C#" MasterPageFile="~/JobSite/JobSiteMasterPage.master" AutoEventWireup="true" CodeFile="RequirementChangeHistory.aspx.cs" Inherits="RequirementChangeHistory" %>
|
|
|
|
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
|
|
<style type="text/css">
|
|
</style>
|
|
<link href="<%=GetFileUrlWithVersion("../css/spectrum.css")%>" rel="stylesheet" type="text/css" />
|
|
<script src="../js/spectrum.js?v=1" type="text/javascript"></script>
|
|
<script>
|
|
jobsitequery = function (method, param, callback, error, nolog) {
|
|
_network.request("JobSite/RequirementChangeHistory.aspx?tp=ashx", -1, method, param, callback, error, nolog);
|
|
}
|
|
|
|
var IsReadOnly = <%=IsReadOnly ?"true":"false"%>;
|
|
var IsRequestOnly = <%=IsRequestOnly ?"true":"false"%>;
|
|
|
|
/***************************Jobsites***************************/
|
|
|
|
function showConfirmIndialog(msg, title, fok, fcancel, shownote) {
|
|
$("#dialogmask").show();
|
|
_dialog.showConfirm(msg, title, function (e, notes) {
|
|
$("#dialogmask").hide();
|
|
if (typeof fok === 'function') {
|
|
fok(e, notes);
|
|
}
|
|
}, fcancel || function () {
|
|
$("#dialogmask").hide();
|
|
}, null, null, shownote);
|
|
}
|
|
|
|
function OnRefresh() {
|
|
showloading(true);
|
|
|
|
var jobsites = $('#div_jobsites').dropdownVals() || [];
|
|
var begindate = $('#startdatetxt').val();
|
|
var enddate = $('#enddatetxt').val();
|
|
if (begindate && !$('#startdatetxt').is(':valid')) {
|
|
showAlert(GetTextByKey('P_COMMON_THEDELETEDBEGINDATEISINVALID', "The deleted begin date is invalid."), GetTextByKey("P_FR_ERROR", 'Error'));
|
|
return;
|
|
}
|
|
if (enddate && !$('#enddatetxt').is(':valid')) {
|
|
showAlert(GetTextByKey('P_COMMON_THEDELETEDENDDATEISINVALID', "The deleted end date is invalid."), GetTextByKey("P_FR_ERROR", 'Error'));
|
|
return;
|
|
}
|
|
if (begindate && enddate && begindate > enddate) {
|
|
showAlert(GetTextByKey("P_DELETEDENDDATEMUSTBELATERTHANDELETEDBEGINDATE", "Deleted end date must be later than deleted begin date."), GetTextByKey("P_FR_ERROR", 'Error'));
|
|
return;
|
|
}
|
|
var p = [
|
|
htmlencode(begindate),
|
|
htmlencode(enddate),
|
|
JSON.stringify(jobsites),
|
|
$.trim($('#searchinputtxt').val())
|
|
];
|
|
jobsitequery("GetRequirementHistory", htmlencode(JSON.stringify(p)), function (data) {
|
|
showloading(false);
|
|
if (typeof (data) === "string") {
|
|
showAlert(data, GetTextByKey("P_AM_ERROR", 'Error'));
|
|
return;
|
|
}
|
|
|
|
showRequirementList(data);
|
|
}, function (err) {
|
|
showloading(false);
|
|
});
|
|
}
|
|
|
|
function showRequirementList(data) {
|
|
var rows = [];
|
|
for (var i = 0; i < data.length; i++) {
|
|
var r = data[i];
|
|
for (var j in r) {
|
|
if (j === "BeginDate")
|
|
r[j] = { DisplayValue: r["BeginDateStr"], Value: r[j] };
|
|
else if (j === "EndDate")
|
|
r[j] = { DisplayValue: r["EndDateStr"], Value: r[j] };
|
|
else if (j === "DeletedOn")
|
|
r[j] = { DisplayValue: r["DeletedOnStr"], Value: r[j] };
|
|
}
|
|
rows.push(r);
|
|
}
|
|
|
|
grid_dt.setData(rows);
|
|
grid_dt.refresh();
|
|
}
|
|
|
|
var grid_dt;
|
|
function InitGridData() {
|
|
grid_dt = createGridView('#jobsitelist');
|
|
var list_columns = [
|
|
{ name: 'BeginDate', caption: GetTextByKey("P_JS_BEGINDATE", "Begin Date"), valueIndex: 'BeginDate', css: { 'width': 100, 'text-align': 'left' } },
|
|
{ name: 'EndDate', caption: GetTextByKey("P_JS_ENDDATE", "End Date"), valueIndex: 'EndDate', css: { 'width': 100, 'text-align': 'left' } },
|
|
{ name: 'AssetTypeName', caption: GetTextByKey("P_JS_ASSETTYPE", "Asset Type"), valueIndex: 'AssetTypeName', css: { 'width': 180, 'text-align': 'left' } },
|
|
{ name: 'Quantity', caption: GetTextByKey("P_JS_QUANTITY", "Quantity"), valueIndex: 'Quantity', css: { 'width': 80, 'text-align': 'right' } },
|
|
{ name: 'ScheduledQuantity', caption: GetTextByKey("P_JS_SCHEDULED", "Scheduled"), valueIndex: 'ScheduledQuantity', css: { 'width': 80, 'text-align': 'right' } },
|
|
{ name: 'JobSiteName', caption: GetTextByKey("P_JOBSITE", "Jobsite"), valueIndex: 'JobSiteName', css: { 'width': 200, 'text-align': 'left' } },
|
|
{ name: 'NumberOfDays', caption: GetTextByKey("P_JS_NUMBEROFDAYS", "Number of Days"), valueIndex: 'NumberOfDays', css: { 'width': 120, 'text-align': 'right' } },
|
|
{ name: 'Notes', caption: GetTextByKey("P_JS_NOTES", "Notes"), valueIndex: 'Notes', css: { 'width': 200, 'text-align': 'left' } },
|
|
{ name: 'PointOfContact', caption: GetTextByKey("P_JS_POINTOFCONTACT", "Point Of Contact"), valueIndex: 'PointOfContact', css: { 'width': 200, 'text-align': 'left' } },
|
|
{ name: 'AddedByName', caption: GetTextByKey("P_JS_CREATOR", "Creator"), valueIndex: 'AddedByName', css: { 'width': 150, 'text-align': 'left' } },
|
|
{ name: 'FulfilledByName', caption: GetTextByKey("P_JS_FULFILLEDBY", "Fulfilled By"), valueIndex: 'FulfilledByName', css: { 'width': 150, 'text-align': 'left' } },
|
|
{ name: 'DeletedByName', caption: GetTextByKey("P_JS_DELETEDBY", "Deleted By"), valueIndex: 'DeletedByName', css: { 'width': 150, 'text-align': 'left' } },
|
|
{ name: 'DeletedOn', caption: GetTextByKey("P_JS_DELETEDON", "Deleted On"), valueIndex: 'DeletedOn', css: { 'width': 150, 'text-align': 'left' } },
|
|
{ name: 'DeletedNotes', caption: GetTextByKey("P_JS_DELETIONNOTES", "Deletion Notes"), valueIndex: 'DeletedNotes', css: { 'width': 200, 'text-align': 'left' } }
|
|
|
|
];
|
|
var columns = [];
|
|
// head
|
|
for (var hd in list_columns) {
|
|
var col = {};
|
|
col.name = list_columns[hd].name;
|
|
col.caption = list_columns[hd].caption;
|
|
col.visible = list_columns[hd].visible === false ? false : 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.alwaysshow = list_columns[hd].alwaysshow;
|
|
columns.push(col);
|
|
}
|
|
grid_dt.canMultiSelect = false;
|
|
grid_dt.columns = columns;
|
|
grid_dt.init();
|
|
}
|
|
|
|
function searchEnter(e) {
|
|
if (e.keyCode == 13) {
|
|
OnRefresh();
|
|
}
|
|
}
|
|
|
|
function getJobsitesAndRegions() {
|
|
showmaskbg(true);
|
|
jobsitequery('GetJobsitesAndRegions', '0', function (data) {
|
|
if (typeof (data) === "string") {
|
|
showAlert(data, GetTextByKey("P_AM_ERROR", 'Error'));
|
|
return;
|
|
}
|
|
|
|
alljobsites = data.Jobsites;
|
|
$("#div_jobsites").dropdownSource(data.Jobsites);
|
|
|
|
}, function () {
|
|
showmaskbg(false);
|
|
});
|
|
}
|
|
|
|
$(function () {
|
|
InitGridData();
|
|
getJobsitesAndRegions();
|
|
OnRefresh();
|
|
|
|
$("#div_jobsites").css('width', 120).dropdown([], {
|
|
search: true,
|
|
multiselect: true,
|
|
allowselectall: true,
|
|
textKey: 'Value',
|
|
valueKey: 'Key'
|
|
});
|
|
|
|
$(window).resize(function () {
|
|
$("#jobsitelist").css("height", $(window).height() - $("#jobsitelist").offset().top - 14);
|
|
grid_dt && grid_dt.resize();
|
|
|
|
}).resize();
|
|
|
|
$('#searchinputtxt').keydown(searchEnter);
|
|
|
|
});
|
|
|
|
function searchEnter(e) {
|
|
if (e.keyCode == 13 || e.keyCode == 9) {
|
|
OnRefresh();
|
|
}
|
|
}
|
|
|
|
|
|
</script>
|
|
</asp:Content>
|
|
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
|
|
<div id="contentctrl">
|
|
<div class="page_title" data-lgid="P_JS_DELETEDJOBSITEREQUIREMENTS">Deleted Jobsite Requirements</div>
|
|
<div class="search_bar">
|
|
<input type="password" autocomplete="new-password" style="display: none" />
|
|
<span data-lgid="P_JS_DELETEDBEGINDATE_COLON">Deleted Begin Date:</span>
|
|
<div>
|
|
<input type="date" class="type-date" required min="1900-01-01" id="startdatetxt" autocomplete="off" style="width: 100px; margin-left: 5px;" value="<%=BeginDate %>" />
|
|
</div>
|
|
<span style="margin-left: 10px;" data-lgid="P_JS_DELETEDENDDATE_COLON">Deleted End Date:</span>
|
|
<div>
|
|
<input type="date" class="type-date" required min="1900-01-01" id="enddatetxt" autocomplete="off" style="width: 100px; margin-left: 5px;" value="<%=EndDate %>" />
|
|
</div>
|
|
<input type="text" id="searchinputtxt" autocomplete="off" style="margin-left: 5px; display: none;" />
|
|
<span style="margin-left: 10px;" data-lgid="P_JS_JOBSITES_COLON">Jobsites:</span>
|
|
<div id="div_jobsites"></div>
|
|
<input class="search" type="button" onclick="OnRefresh();" value="Search" data-lgid="P_CM_SEARCH" style="margin-left: 5px;" />
|
|
</div>
|
|
<div class="function_title">
|
|
<span class="sbutton iconrefresh" onclick="OnRefresh();" data-lgid="P_JS_REFRESH"></span>
|
|
<%--<span class="sbutton iconexport" onclick="OnExport();" data-lgid="P_MR_EXPORTTOEXCEL">Export to Excel</span>--%>
|
|
</div>
|
|
<div id="jobsitelist"></div>
|
|
</div>
|
|
<div id="mask_bg" style="display: none;">
|
|
<div class="loading c-spin"></div>
|
|
</div>
|
|
|
|
</asp:Content>
|