fleet-contractor/Site/Inspection/Inspection.aspx
2024-03-26 15:56:31 +08:00

367 lines
15 KiB
Plaintext

<%@ Page Title="" Language="C#" MasterPageFile="~/IronIntelMasterPage.master" AutoEventWireup="true" CodeFile="Inspection.aspx.cs" Inherits="Inspection" %>
<asp:Content ID="Content1" ContentPlaceHolderID="holder_head" runat="Server">
<link href="<%=GetFileUrlWithVersion("../css/split.css")%>" rel="stylesheet" type="text/css" />
<link href="<%=GetFileUrlWithVersion("css/sections.css")%>" rel="stylesheet" type="text/css" />
<link href="<%=GetFileUrlWithVersion("../css/spectrum.css")%>" rel="stylesheet" type="text/css" />
<link href="<%=GetFileUrlWithVersion("../css/tabcontrol.css")%>" rel="stylesheet" />
<link href="<%=GetFileUrlWithVersion("../css/jquery.datetimepicker.css")%>" rel="stylesheet" type="text/css" />
<script src="<%=GetFileUrlWithVersion("../js/spectrum.js")%>"></script>
<script src="<%=GetFileUrlWithVersion("../js/jquery.datetimepicker.full.js")%>"></script>
<%--<script src="<%=GetFileUrlWithVersion("../js/split.js")%>"></script>--%>
<style type="text/css">
.fa {
display: inline-block;
font: normal normal normal 14px/1 FontAwesome;
font-size: inherit;
text-rendering: auto;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.icon-menu {
width: 20px;
height: 20px;
}
.icon-sections::before {
content: '\f03a';
}
.icon-templates::before {
content: '\f0ae';
}
.icon-packages::before {
content: '\f1b3';
}
.icon-report:before {
content: '\f15c';
}
.icon-fuellog::before {
content: '\f52f';
}
.page_title {
font-size: 24px;
}
.settings-line {
line-height: 30px;
padding: 0 20px;
box-sizing: border-box;
}
.settings-line > span {
display: block;
padding: 4px 0;
}
.settings-line > textarea {
box-sizing: border-box;
width: 100%;
height: 70px;
resize: vertical;
}
</style>
<script src="<%=GetFileUrlWithVersion("../js/controls.js")%>" type="text/javascript"></script>
<script data-main="<%=GetFileUrlWithVersion("js/main.js")%>" src="<%=GetFileUrlWithVersion("../js/lib/require-2.3.6.min.js")%>"></script>
<script src="<%=GetFileUrlWithVersion("../js/utility.js")%>" type="text/javascript"></script>
<script type="text/javascript">
var sectiontype = 0;//sectiontype:0 - global,1 - normal
var currenttemplate;//current template in editing
var templatestatus = 0;//templatestatus:0 - draft,1 - published
var templatereadonly = <%=TemplateReadonly ?"true":"false"%>;//published template cannot be edit
var editable = true;
var draggingobj = null;
var IsForesight =<%=IsForesight ?"true":"false"%>;
var IsAdmin =<%=IsAdmin ?"true":"false"%>;
var teamintelligence = false;
var begindate = "<%=BeginDate%>";
var enddate = "<%=EndDate%>";
var ShowTemplate =<%=ShowTemplate ?"true":"false"%>;
var ShowReport =<%=ShowReport ?"true":"false"%>;
var ReportReadonly =<%=ReportReadonly ?"true":"false"%>;
var IsCustomerRecord = <%=IsCustomerRecord ? "true" : "false"%>;
var AllowReassignWorkorders = <%=AllowReassignWorkorders ? "true" : "false"%>;
function inspectionrequest(method, param, callback, error) {
_network.request("Inspection/Inspection.aspx", -1, method, param, callback, error || function (e) {
showAlert('An unknown error occurred. Please refresh page.', 'Query');
});
}
function showRightPopup(state) {
if (state) {
$("#mask_bg_left").show();
$("#right_popup").css("left", $("#set_left").width()).show();
}
else {
$("#mask_bg_left").hide();
$("#right_popup").hide();
}
}
function OnPrint(rid) {
$("#ifdiv").attr('src', "Inspection.aspx?rt=f&t=2&id=" + rid);
if (!$("#ifdiv").data('inited')) {
$("#ifdiv").on('load', function () {
onifload();
}).show();
$("#ifdiv").data('inited', 1);
}
//window.open("Inspection.aspx?rt=f&t=2&id=" + reportid, '_blank');
}
function onifload() {
var iframe = document.getElementById('ifdiv');
iframe.contentWindow.focus();
iframe.contentWindow.print();
}
function openPrintFrame(rid) {
if (navigator.userAgent.indexOf('Firefox') >= 0 ||
navigator.userAgent.indexOf('Opera') >= 0) {
setTimeout(function () {
window.open("Inspection.aspx?rt=f&t=2&id=" + rid + "&team=" + (teamintelligence ? 1 : 0), '_blank');
});
}
else {
var frame = $("<iframe style='display:none;'></iframe>");
$(document.body).after(frame);
frame.attr('src', "Inspection.aspx?rt=f&t=2&id=" + rid);
frame.on('load', function () {
setTimeout(function () {
frame[0].contentWindow.print();
});
setTimeout(function () {
frame.remove();
}, 60000);
});
}
}
function openDownloadFrame(rid) {
setTimeout(function () {
window.open("Inspection.aspx?rt=f&t=1&id=" + rid + "&team=" + (teamintelligence ? 1 : 0), '_blank');
});
}
function createSubMenus(items) {
var maintenancesubmenu = $("#inspectsubmenu").empty();
var ulsubmenus = $('<ul class="lefttitlemenu_ul" style="line-height:32px;"></ul>');
maintenancesubmenu.append(ulsubmenus);
for (var i = 0; i < items.length; i++) {
var item = items[i];
if (!item) continue;
var li = $('<li></li>');
var a = $('<a></a>').append($("<span></span>").text(item.Title));
a.attr('href', '#' + item.ID);
li.append(a);
ulsubmenus.append(li);
}
}
$(function () {
$("#atemplates").click(function (ev) {
if ($('#set_left').prop('isexpanded'))
return;
if ($('.panel_holder.subitems').is(':visible')) {
return;
}
var items = [{ ID: 'templates/0', Title: GetTextByKey("P_DRAFT", "Draft") },
{ ID: 'templates/1', Title: GetTextByKey("P_PUBLISHED", "Published") },
{ ID: 'layouts/0', Title: GetTextByKey("P_LAYOUTS", "Layouts") }];
createSubMenus(items);
var left = $(this).offset().left;
var top = $(ev.target).offset().top - 80;
$('.panel_holder.subitems').css({
'opacity': 0,
'left': 60,
'right': 'auto',
'top': top
}).show().animate({ 'opacity': 1 }, 100);
$('.panel_holder.subitems .trigle').css({
'left': -10,// left - $('.panel_holder.favorites').offset().left,
'right': 'auto',
'top': 3
});
return false;
});
$("#apackages").click(function (ev) {
if ($('#set_left').prop('isexpanded'))
return;
if ($('.panel_holder.subitems').is(':visible')) {
return;
}
var items = [{ ID: 'exportpackages', Title: GetTextByKey("P_IPT_EXPORTPACKAGES", "Export Packages") },
{ ID: 'importpackages', Title: GetTextByKey("P_IPT_IMPORTPACKAGES", "Import Packages") }];
createSubMenus(items);
var left = $(this).offset().left;
var top = $(ev.target).offset().top - 80;
$('.panel_holder.subitems').css({
'opacity': 0,
'left': 60,
'right': 'auto',
'top': top
}).show().animate({ 'opacity': 1 }, 100);
$('.panel_holder.subitems .trigle').css({
'left': -10,// left - $('.panel_holder.favorites').offset().left,
'right': 'auto',
'top': 3
});
return false;
});
$('#nav_temparrow').click(function () {
var flag = !$('#nav_temparrow').prop('isexpanded');
var left_flag = !$('#set_left').prop('isexpanded');
$('#nav_temparrow').stop()
.prop('isexpanded', flag);
if (flag)
$('#set_left').find(".tempdesign").show();
else
$('#set_left').find(".tempdesign").hide();
if (left_flag)
$('#span_tempdesign').hide();
$('#nav_temparrow div').attr('class', 'icn')
.addClass(flag ? 'expand' : 'collapse');
});
$('#nav_temparrow').click();
});
</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="holder_content" runat="Server">
<div id="set_left">
<ul class="ul_menu">
<li id="nav_arrow">
<div class="icn collapse"></div>
</li>
<%if (ShowReport)
{%>
<li class="nav_item" data-module="inspections" data-title-lgid="P_INSPECTIONS"><a href="#inspections">
<div>
<em class="fa icon-menu icon-report"></em>
</div>
<span data-lgid="P_INSPECTIONS">Inspections</span></a>
</li>
<%} %>
<%if (ShowFuelLog)
{%>
<li class="nav_item" data-module="fuellog" data-title-lgid="P_IPT_FUELLOG"><a href="#fuellog">
<div>
<em class="fa icon-menu icon-fuellog"></em>
</div>
<span data-lgid="P_IPT_FUELLOG">Fuel Log</span></a>
</li>
<%} %>
<%if (ShowReport || ShowFuelLog)
{%>
<li style="height: 10px;">
<hr style="background-color: #d8d8d8; border: none; height: 1px;" />
</li>
<%} %>
<%if (ShowGlobalSections || ShowTemplate)
{%>
<li id="nav_temparrow">
<div class="icn expand"></div>
<span id="span_tempdesign" class="subitem" data-lgid="P_TEMPLATEDESIGN" style="margin-left: 15px; font-weight: bold;">Template Design</span>
</li>
<%} %>
<%if (ShowGlobalSections)
{%>
<li class="nav_item tempdesign" data-module="globalsections" data-title-lgid="P_GLOBALSECTIONS"><a href="#globalsections" style="padding-left: 10px;">
<div>
<em class="fa icon-menu icon-sections"></em>
</div>
<span data-lgid="P_GLOBALSECTIONS">Global Sections</span></a>
</li>
<%} %>
<%if (ShowTemplate)
{%>
<li id="litem" class="nav_item tempdesign" data-title-lgid="P_TEMPLATES"><a id="atemplates" style="padding-left: 10px;">
<div>
<em class="fa icon-menu icon-templates"></em>
</div>
<span data-lgid="P_TEMPLATES">Templates</span></a>
</li>
<li class="nav_item subitem tempdesign" data-module="templates/0" data-title-lgid="P_DRAFT" style="height: 32px; line-height: 32px; display: none;"><a href="#templates/0">
<div style="width: 64px;">
</div>
<span style="color: #666;" data-lgid="P_DRAFT">Draft</span></a>
</li>
<li class="nav_item subitem tempdesign" data-module="templates/1" data-title-lgid="P_PUBLISHED" style="height: 32px; line-height: 32px; display: none;"><a href="#templates/1">
<div style="width: 64px;">
</div>
<span style="color: #666;" data-lgid="P_PUBLISHED">Published</span></a>
</li>
<li class="nav_item subitem tempdesign" data-module="layouts/0" data-title-lgid="P_LAYOUTS" style="height: 32px; line-height: 32px; display: none;"><a href="#layouts/0">
<div style="width: 64px;">
</div>
<span style="color: #666;" data-lgid="P_LAYOUTS">Layouts</span></a>
</li>
<%if (!TemplateReadonly && ShowExportPackage)
{%>
<li style="height: 10px;">
<hr style="background-color: #d8d8d8; border: none; height: 1px;" />
</li>
<li class="nav_item" data-title-lgid="P_IPT_PACKAGES"><a id="apackages">
<div>
<em class="fa icon-menu icon-packages"></em>
</div>
<span data-lgid="P_IPT_PACKAGES">Packages</span></a>
</li>
<li class="nav_item subitem" data-module="exportpackages" data-title-lgid="P_IPT_EXPORTPACKAGES" style="height: 32px; line-height: 32px; display: none;"><a href="#exportpackages">
<div style="width: 64px;">
</div>
<span style="color: #666;" data-lgid="P_IPT_EXPORTPACKAGES">Export Packages</span></a>
</li>
<li class="nav_item subitem" data-module="importpackages" data-title-lgid="P_IPT_IMPORTPACKAGES" style="height: 32px; line-height: 32px; display: none;"><a href="#importpackages">
<div style="width: 64px;">
</div>
<span style="color: #666;" data-lgid="P_IPT_IMPORTPACKAGES">Import Packages</span></a>
</li>
<%} %>
<%} %>
</ul>
<div class="hostmask maskbg" style="display: none;"></div>
</div>
<div id="set_right" style="height: 100%; overflow: auto;">
<div class="loading_holder">
<div class="loading_icon icn icn-spin"></div>
</div>
</div>
<div class="panel_holder subitems">
<div id="inspectsubmenu" class="menupanel panel">
</div>
<div class="trigle" style="left: -12px; right: auto;"></div>
<div class="trigle white" style="left: -12px; right: auto;"></div>
</div>
<div id="mask_bg_left" class="maskbg" style="display: none;">
</div>
<div id="right_popup" style="display: none; position: absolute; left: 250px; top: 0; right: 0; bottom: 0; background-color: white; overflow: auto; z-index: 3;">
</div>
<div id="right_popup1" style="display: none; position: absolute; left: 250px; top: 0; right: 0; bottom: 0; background-color: white; overflow: auto; z-index: 3;"></div>
<iframe id="ifdiv" style="position: absolute; top: -9999px; height: 1px; width: 1px; border: 0; display: none; z-index: 3;"></iframe>
<div id="mask_bg" style="display: none;">
<div class="loading c-spin"></div>
</div>
</asp:Content>