This commit is contained in:
2023-05-30 17:34:56 +08:00
parent e728c66786
commit 9da1c4cf30
194 changed files with 10680 additions and 9060 deletions

View File

@ -1,6 +1,7 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/Maintenance/MaintenanceBase.master" AutoEventWireup="true" CodeFile="WorkOrderMaintenance.aspx.cs" Inherits="Maintenance_WorkOrderMaintenance" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
<link href="<%=GetFileUrlWithVersion("css/maintenance.css")%>" rel="stylesheet" />
<style type="text/css">
::-ms-clear, ::-ms-reveal {
display: none;
@ -31,31 +32,6 @@
height: 60px;
}
.dialog-content table td.label {
width: unset;
text-align: right;
padding-right: 10px;
line-height: 24px;
height: 24px;
vertical-align: middle;
}
.dialog-content table td input,
.dialog-content table td textarea {
width: 300px;
border: 1px solid #a9a9a9;
height: 18px;
padding: 1px;
}
.dialog-content table td select {
width: 403px;
}
.dialog-content table td input[type="checkbox"] {
border: none;
}
#dialogdatatb td {
padding-top: 30px;
}
@ -130,6 +106,66 @@
overflow: unset;
text-overflow: unset;
}
.ui-popup-mask .ui-popup-container .ui-popup-body .class-content {
overflow: auto;
height: 100%;
}
.ui-popup-mask .ui-popup-container .ui-popup-body .class-content > .comm {
border: none;
height: 100%;
margin-left: 0;
width: initial;
}
.ui-popup-mask .ui-popup-container .ui-popup-body .class-content > .comm .title-bar {
display: none;
}
.ui-popup-mask .ui-popup-container .ui-popup-header > label {
flex: 0 0 auto;
margin: 0 4px;
box-sizing: border-box;
cursor: pointer;
width: 30px;
height: 30px;
background-color: #fff;
border-radius: 15px;
display: flex;
align-items: center;
justify-content: center;
transition: background-color .2s
}
.ui-popup-mask .ui-popup-container .ui-popup-header > label > svg {
fill: #333;
width: 14px;
height: 14px;
transition: opacity .2s
}
.ui-popup-mask .ui-popup-container .ui-popup-header > label:hover {
background-color: rgba(255, 255, 255, .6)
}
.ui-popup-mask .ui-popup-container .ui-popup-header > label:hover > svg {
opacity: .6
}
.ui-popup-mask .ui-popup-container .ui-popup-header > label.disabled {
cursor: default;
opacity: .6
}
.ui-popup-mask .ui-popup-container .ui-popup-header > label.disabled:hover {
background-color: #fff
}
.ui-popup-mask .ui-popup-container .ui-popup-header > label.disabled:hover > svg {
opacity: 1;
opacity: initial
}
</style>
<link href="<%=GetFileUrlWithVersion("../css/panel.css")%>" rel="stylesheet" />
@ -146,6 +182,9 @@
<script src="<%=GetFileUrlWithVersion("../js/editableselect.js")%>" type="text/javascript"></script>
<script src="<%=GetFileUrlWithVersion("../js/gridlayout.js")%>" type="text/javascript"></script>
<script src="<%=GetFileUrlWithVersion("js/manageworkorder.js")%>" type="text/javascript"></script>
<script src="<%=GetFileUrlWithVersion("js/workordersendemail.js")%>" type="text/javascript"></script>
<script src="<%=GetFileUrlWithVersion("js/workordertabitems.js")%>" type="text/javascript"></script>
<script src="<%=GetFileUrlWithVersion("js/workorderwidgets.js")%>" type="text/javascript"></script>
<script type="text/javascript">
var workOrders = [];
var workOrderStatus = [];
@ -157,17 +196,42 @@
var assetid = "<%=AssetID %>";
var gridLayoutID = "WorkOrder";
var IsCustomerRecordAllow = <%=IsCustomerRecordAllow ?"true":"false"%>;
var HasCustomerRecord = <%=HasCustomerRecord ?"true":"false"%>;
var IsAdmin =<%=IsAdmin ?"true":"false"%>;
var IsAdvisor =<%=IsAdvisor ?"true":"false"%>;
var AllowReopenWorkorders = <%=AllowReopenWorkorders ?"true":"false"%>;
var AllowWorkOrderSurveys = <%=AllowWorkOrderSurveys ?"true":"false"%>;
var AllowCommunicate =<%=AllowCommunicate ?"true":"false"%>;
var AllowInspection =<%=AllowInspection ?"true":"false"%>;
var AllowCustomer =<%=AllowCustomer ?"true":"false"%>;
var WOReadOnly = <%=WOReadOnly ?"true":"false"%>;
var CRReadOnly =<%=CRReadOnly ?"true":"false"%>;
var COMMReadOnly = <%=COMMReadOnly ?"true":"false"%>;
var AllowReassignWorkorders = <%=AllowReassignWorkorders ?"true":"false"%>;
var AllowDeleteAtta = <%=AllowDeleteAtta ?"true":"false"%>;
var WorkorderParams = {};
var wowidgetobj = null;
var widgetdata = [];
if (AllowCommunicate) {
widgetdata.push({ Values: { Category: 'WorkOrder', WidgetId: 'CustomerCommunication', WidgetName: GetTextByKey('P_WO_CUSTOMERCOMMUNICATION', 'Customer Communication'), Visible: false } });
}
widgetdata.push({ Values: { Category: 'WorkOrder', WidgetId: 'InternalComments', WidgetName: GetTextByKey('P_WO_INTERNALCOMMENTS', 'Internal Comments'), Visible: false } },
{ Values: { Category: 'WorkOrder', WidgetId: 'Alerts', WidgetName: GetTextByKey('P_WO_ALERTS', 'Alerts'), Visible: false } },
{ Values: { Category: 'WorkOrder', WidgetId: 'Segments', WidgetName: GetTextByKey('P_WO_SEGMENTS', 'Segments'), Visible: false } },
{ Values: { Category: 'WorkOrder', WidgetId: 'Attachments', WidgetName: GetTextByKey('P_WO_ATTACHMENTS', 'Attachments'), Visible: false } });
if (AllowInspection) {
widgetdata.push({ Values: { Category: 'WorkOrder', WidgetId: 'Inspections', WidgetName: GetTextByKey('P_WO_INSPECTIONS', 'Inspections'), Visible: false } });
}
if (AllowCustomer) {
widgetdata.push(
{ Values: { Category: 'WorkOrder', WidgetId: 'Estimates', WidgetName: GetTextByKey('P_WO_ESTIMATES', 'Estimates'), Visible: false } },
{ Values: { Category: 'WorkOrder', WidgetId: 'Invoices', WidgetName: GetTextByKey('P_WO_INVOICES', 'Invoices'), Visible: false } });
}
var MSGWebSocketURL = "<%=MSGWebSocketURL%>";
var nowDate = new DateFormatter().formatDate(new Date("<%=NowDate %>"), 'm/d/Y');
var currentdate = "<%=NowDate %>";
const ui = window['lib-ui'];
function worequest(method, param, callback, error) {
_network.request("Maintenance/WorkOrderMaintenance.aspx", -1, method, param, callback, error || function (e) {
@ -176,6 +240,13 @@
});
}
function crrequest(method, param, callback, error) {
_network.request("Maintenance/AddCustomerRecord.aspx", -1, method, param, callback, error || function (e) {
showmaskbg(false, true);
showAlert(GetTextByKey('P_UM_PAGEERROR', 'An unknown error occurred. Please refresh page.'), GetTextByKey('P_UM_QUERY', 'Query'));
});
}
function alertrequest(method, param, callback, error) {
_network.request("Maintenance/AlertsManagement.aspx", -1, method, param, callback, error || function (e) {
showmaskbg(false, true);
@ -195,6 +266,17 @@
});
}
function getWorkorderParams() {
worequest("GetWorkorderParams", null, function (data) {
if (!data || typeof (data) === "string") {
return;
}
WorkorderParams = data;
}, function (err) {
});
}
function OnDelete() {
var index = grid_dt.selectedIndex;
if (index < 0) {
@ -893,12 +975,14 @@
var filters = JSON.stringify(p);
filters = htmlencode(filters);
setCookie("WorkOrderFilters_" + CID, filters);
setCookie("WorkOrderFilters_" + CID, "1");//filters太长在cookie中会丢失此处只存标识,filters存在localStorage中
window.localStorage["WorkOrderFilters_" + CID] = filters;
}
function getTempFilters() {
var p = getCookie("WorkOrderFilters_" + CID);
if (!p) return false;
p = window.localStorage["WorkOrderFilters_" + CID];
try {
var data = JSON.parse(htmldecode(decodeURIComponent(p)));
@ -925,12 +1009,15 @@
//*********************************End Detault**************************************************//
var dialogWidgets;
$(function () {
setPageTitle(GetTextByKey("P_WORKORDER", "Work Order"), true);
$('.iconlayout').on('click', function (ev) {
CreateLayoutMenus(ev.target, gridLayoutID, grid_dt);
return false;
});
//manageWorkorderCtrl = new $manageWorkorderCtrl();
//manageWorkorderCtrl.Init($("#workorderlist"));
InitGridData();
@ -938,8 +1025,21 @@
InitGridAvailableMachines();
InitGridSelectedMachines();
dialogWidgets = new $wowidgetselector('dialog_widgets');
dialogWidgets.onDialogClosed = function () {
showmaskbg(false);
};
dialogWidgets.onOK = function (source) {
wowidgetobj && wowidgetobj.reloadWidgets();
};
$("#spWdigets").click(function () {
showmaskbg(true);
dialogWidgets.showSelector();
});
showmaskbg(true);
getWorkorderParams();
//GetContacts();
//GetStatus();
//GetAssetGroups();
@ -1241,6 +1341,25 @@
}
}
var loadingCount = 0;
function showLoading() {
loadingCount++;
if (window.parent && typeof window.parent.onmaskbg == 'function') {
window.parent.onmaskbg(true, true);
}
$("#dialogattmask").show();
}
function hideLoading() {
loadingCount--;
if (loadingCount === 0) {
$("#dialogattmask").hide();
if (window.parent && typeof window.parent.onmaskbg == 'function') {
window.parent.onmaskbg(false, true);
}
}
}
var _websocket;
function openmsgwebsocket() {
_websocket = new $websocket(MSGWebSocketURL);
@ -1255,6 +1374,8 @@
else if (data.Code == "502")//delete
removeWorkOrderItem(data.Message);
wowidgetobj?.onmsgreceived(data);
if ($("#dialog_workorder").is(":visible")) {
var fn = document.getElementById("iframeworkorder").contentWindow["onmsgreceived"];
if (fn)
@ -1266,12 +1387,15 @@
</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
<div id="recordcontent" style="padding: 0px; margin: 0px; min-width: 1600px;">
<div id="recordcontent" style="padding: 0px; margin: 0px; min-width: 1650px;">
<div class="page_title">
<span data-lgid="P_WORKORDER">Work Order</span>
<span class="sbutton iconexit" style="<%=InDialog?"": "display:none;"%>; float: right; font-size: 14px; margin-right: 15px; cursor: pointer;" onclick="OnExit();">
<label data-lgid="P_WO_EXIT">Exit</label>
</span>
<%if (AllowWorkOrderConfiguration)
{%>
<span class="sbutton iconcog" style="float: right; font-size: 14px; margin-right: 15px; cursor: pointer;" onclick="openWOStatus();">
<span class="sbutton iconcog" style="float: right; font-size: 14px; cursor: pointer;" onclick="openWOStatus();">
<label data-lgid="P_WO_WORKORDERCONFIGURATION">Work Order Configuration</label></span> <%}%>
<div style="clear: both;"></div>
</div>
@ -1300,20 +1424,24 @@
<option value="1" data-lgid="P_WO_XXXXXX">Completed Work Orders Only</option>
<option value="-1" data-lgid="P_WO_XXXXXX">Active & Completed Work Orders</option>
</select>
<span class="sbutton iconsave" onclick="onSaveDefault();" style="margin-left: 8px; padding-right: 0;" data-title-lgid="P_WO_SAVELOCATIONANDDEPARTMENTSEARCH" title="Save Location, Department, Advisor and Order type Search"></span>
</div>
<div class="function_title">
<span class="sbutton iconadd" onclick="OnAdd();" data-lgid="P_WO_ADD">Add</span>
<span class="sbutton iconedit" onclick="OnEdit();" data-lgid="P_WO_EDIT">Edit</span>
<span class="sbutton iconrefresh" onclick="OnRefresh();" data-lgid="P_WO_REFRESH">Refresh</span>
<span id="spExport" class="sbutton iconexport" onclick="OnExport();" data-lgid="P_UTILITY_EXPORTTOEXCEL">Export to Excel</span>
<span class="sbutton iconexit" onclick="OnExit();" style="<%=InDialog?"": "display:none;"%>" data-lgid="P_WO_EXIT">Exit</span>
<span class="sbutton iconlayout iconmenu" data-lgid="P_MR_LAYOUT">Layout</span>
<span class="sbutton iconfilter" onclick="OnResetPivots();" data-lgid="P_JS_XXX">Reset Pivots</span>
<span id="spWdigets" class="sbutton iconwidget" data-lgid="P_JS_XXX">Widgets</span>
</div>
<div class="clear"></div>
<div id="workorderlist"></div>
<div id="workorderdetail"></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_alerts" style="display: none;">
<div class="dialog-title"><span class="title" data-lgid="P_WO_MANAGEALERTS">Manage Alerts</span><em class="dialog-close"></em></div>
@ -1488,6 +1616,43 @@
</div>
</div>
<div class="dialog" id="sendicemailpopupdialog" style="display: none; width: 485px;">
<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;">
<tr>
<td 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>
<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>
</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>
</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>
</tr>
</table>
</div>
<div class="dialog-func">
<input type="button" value="Cancel" data-lgid="P_WO_CANCEL" class="dialog-close" tabindex="153" />
<input type="button" onclick="onSendInternalComments();" value="OK" data-lgid="P_WO_OK" tabindex="152" />
<div class="clear"></div>
</div>
</div>
<div class="dialog" id="dialog_workorder" style="display: none; height: 100%; border-bottom: 0; border-top: 0;">
<%--<div class="dialog-title"><span class="title">Add Work Order</span></div>--%>
<iframe id="iframeworkorder" style="width: 100%; height: 100%; display: block; border: none;"></iframe>
@ -1505,5 +1670,10 @@
<div class="maskbg" style="display: none;"></div>
</div>
<div id="dialogattmask" class="maskbg" style="display: none;">
<%-- 放到最后 Widget中上传WorkOrder附件是使用--%>
<div class="loading c-spin"></div>
<lable class="lable_attuploadname"></lable>
</div>
</asp:Content>