sync
This commit is contained in:
@ -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;">
|
||||
|
Reference in New Issue
Block a user