Added HttpException class for missing HttpException for net8 Wrapped HttpContext.Session, GetJsonResult, IsAjaxRequest and GetUserIdentityName in controllers for net8 Added AuthenticationService to test Fab2ApprovalMKLink code for net8 Compile conditionally flags to debug in dotnet core
1292 lines
55 KiB
Plaintext
1292 lines
55 KiB
Plaintext
@model Fab2ApprovalSystem.Models.LTLotTravelerHeaderViewModel
|
|
@{
|
|
ViewBag.Title = "LotTravelerUpdate";
|
|
}
|
|
@{
|
|
Layout = "_LotTravelerLayout.cshtml";
|
|
}
|
|
<link rel="stylesheet" href="/Content/kendo/kendo.blueopal.min.css" />
|
|
<style>
|
|
.k-header .k-link {
|
|
text-align: center;
|
|
}
|
|
.k-grid tbody tr td {
|
|
vertical-align: top;
|
|
}
|
|
</style>
|
|
|
|
<body onload="StartTimers();" onmousemove="ResetTimers();" onkeydown="ResetTimers();">
|
|
@using (Html.BeginForm())
|
|
{
|
|
<input type="hidden" id="LTWorkRequestID" value="@Model.LTWorkRequestID" />
|
|
<input type="hidden" id="LTLotTravRevID" value="@Model.LotTravRevID" />
|
|
<input type="hidden" id="ReturnURL" value="@Url.Action("LotTravelerUpdate", "LotTraveler", new { ltLotID = Model.ID })" />
|
|
|
|
@Html.AntiForgeryToken()
|
|
<div class="panel panel-default" style="font-size: 10px">
|
|
<div class="panel-body bg-warning">
|
|
<div class="row">
|
|
<div class="col-sm-12 text-center">
|
|
<label id="RevNumber" style="font-size: large; font-weight: bold; color: blue; font-family: 'Times New Roman'">
|
|
Fab2 Electronic Lot Traveler - Lot# @Model.LotNumber Rev @Model.LotTravCurrentRevision
|
|
</label>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="panel panel-default" style="font-size: 10px">
|
|
<div class="panel-body bg-warning">
|
|
<div class="row">
|
|
<div class="col-sm-12">
|
|
<input type="button" value="Print PDF" class="btn btn-warning btn-xs" id="PrintTravelerPDF" style="font-size: 10px;" />
|
|
<input type="button" value="Back to Work Request" class="btn btn-warning btn-xs" id="BackToRequestID" style="font-size: 10px" />
|
|
|
|
<label class="control-label">Lot Numbers:</label>
|
|
@(Html.Kendo().DropDownList()
|
|
.Name("LotList")
|
|
.BindTo(new SelectList(ViewBag.LotList, "LotID", "LotNumber"))
|
|
.OptionLabel("Select")
|
|
)
|
|
<input type="button" value="Display Traveler" class="btn btn-warning btn-xs" id="GetTraveler" style="font-size: 10px" />
|
|
|
|
<label class="control-label">Revisions:</label>
|
|
@(Html.Kendo().DropDownList()
|
|
.Name("Revisions")
|
|
.DataTextField("RevisionNumber")
|
|
.DataValueField("ID")
|
|
.OptionLabel("Select")
|
|
)
|
|
<input type="button" value="Display Revision" class="btn btn-warning btn-xs" id="GetRevision" style="font-size: 10px" />
|
|
|
|
<input type="button" value="Revision History" class="btn btn-warning btn-xs" id="RevisionHistoryData" style="font-size: 10px" />
|
|
|
|
@if (Model.TravelerClosedDate == null)
|
|
{
|
|
|
|
<input type="button" value="Close Traveler" class="btn btn-warning btn-xs" id="CloseTraveler" style="font-size: 10px" />
|
|
}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="panel panel-default" style="font-size: 10px">
|
|
<div class="panel-body bg-warning">
|
|
<div class="row">
|
|
<div class="col-sm-2">
|
|
<div class="row">
|
|
<div class="col-sm-3">
|
|
<label class="control-label pull-right">SWR #:</label>
|
|
</div>
|
|
<div class="col-sm-9">
|
|
@Html.TextBoxFor(model => model.SWRNumber, new { @class = "k-textbox", Readonly = "Readonly", style = "background-color:lightblue" })
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-sm-2">
|
|
<div class="row">
|
|
<div class="col-sm-3">
|
|
<label class="control-label pull-right">Last Update:</label>
|
|
</div>
|
|
<div class="col-sm-9">
|
|
@Html.TextBoxFor(model => model.LastUpdate, new { id = "txtLastUpdate", @class = "k-textbox", Readonly = "Readonly", style = "background-color:lightblue" })
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-sm-2">
|
|
<div class="row">
|
|
<div class="col-sm-3">
|
|
<label class="control-label pull-right">Title</label>
|
|
</div>
|
|
<div class="col-sm-9">
|
|
@Html.TextBoxFor(model => model.Title, new { @class = "k-textbox", Readonly = "Readonly" })
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-sm-2">
|
|
<div class="row">
|
|
<div class="col-sm-3">
|
|
<label class="control-label pull-right">Closed Reason:</label>
|
|
</div>
|
|
<div class="col-sm-9">
|
|
@Html.TextBoxFor(model => model.TravelerClosedReason, new { @class = "k-textbox", Readonly = "Readonly", style = "background-color:lightblue" })
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-sm-2">
|
|
<div class="row">
|
|
<div class="col-sm-3">
|
|
<label class="control-label pull-right">Closed By:</label>
|
|
</div>
|
|
<div class="col-sm-9">
|
|
@Html.TextBoxFor(model => model.TravelerClosedBy, new { @class = "k-textbox", Readonly = "Readonly", style = "background-color:lightblue" })
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
<div class="col-sm-2">
|
|
<div class="row">
|
|
<div class="col-sm-3">
|
|
<label class="control-label pull-right">Closed Date:</label>
|
|
</div>
|
|
<div class="col-sm-9">
|
|
@Html.TextBoxFor(model => model.TravelerClosedDate, new { @class = "k-textbox", Readonly = "Readonly", style = "background-color:lightblue" })
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-sm-2">
|
|
<div class="row">
|
|
<div class="col-sm-3">
|
|
<label class="control-label pull-right">Originator:</label>
|
|
</div>
|
|
<div class="col-sm-9">
|
|
@Html.TextBoxFor(model => model.Originator, new { @class = "k-textbox", Readonly = "Readonly", style = "background-color:lightblue" })
|
|
@if (GlobalVars.IsAdminValueNotNull(Session))
|
|
{
|
|
<a href="javascript:undefined" id="lnkReassignOriginator" class="linkbutton edit" title="Re-assign Originator"></a>
|
|
}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-sm-2">
|
|
<div class="row">
|
|
<div class="col-sm-3">
|
|
<label class="control-label pull-right">Updated By:</label>
|
|
</div>
|
|
<div class="col-sm-9">
|
|
@Html.TextBoxFor(model => model.LastUpdatedBy, new { id = "txtUpdatedBy", @class = "k-textbox", Readonly = "Readonly", style = "background-color:lightblue" })
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-sm-2">
|
|
<div class="row">
|
|
<div class="col-sm-3">
|
|
<label class="control-label pull-right">WIP PN#:</label>
|
|
</div>
|
|
<div class="col-sm-9">
|
|
@Html.TextBoxFor(model => model.WIPPartNumber, new { @class = "k-textbox", Readonly = "Readonly" })
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-sm-2">
|
|
<div class="row">
|
|
<div class="col-sm-3">
|
|
<label class="control-label pull-right">Part Desc:</label>
|
|
</div>
|
|
<div class="col-sm-9">
|
|
@Html.TextBoxFor(model => model.PartDescription, new { @class = "k-textbox", Readonly = "Readonly", style = "background-color:lightblue;width:100%" })
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-sm-2">
|
|
<div class="row">
|
|
<div class="col-sm-3">
|
|
<label class="control-label pull-right">Base Flow:</label>
|
|
</div>
|
|
<div class="col-sm-9">
|
|
@Html.TextBoxFor(model => model.BaseFlow, new { id = "txtProcessFlow", @class = "k-textbox", Readonly = "Readonly", style = "background-color:lightblue" })
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-sm-2">
|
|
<div class="row">
|
|
<div class="col-sm-3">
|
|
<label class="control-label pull-right">ITAR:</label>
|
|
</div>
|
|
<div class="col-sm-9">
|
|
@Html.TextBoxFor(model => model.IsITAR, new { @class = "k-textbox", Readonly = "Readonly", style = "background-color:lightblue" })
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-sm-1">
|
|
<label class="control-label pull-right">Purpose Of Lot/Change Description:</label>
|
|
</div>
|
|
<div class="col-sm-11">
|
|
@Html.TextAreaFor(model => model.PurposeOfRequest, 5, 100, new { @class = "k-textbox", Readonly = "Readonly", style = "width:100%" })
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="panel panel-default" style="font-size: 10px">
|
|
<!-- NEW PANEL ===============================================================-->
|
|
<div class="panel-body bg-info">
|
|
<h5>
|
|
<font style="color:crimson; font-weight:bold">
|
|
OLHold Steps - Completed
|
|
</font>
|
|
<a class="btn btn-xs pull-right alert-danger" id="aSection2" role="button" data-toggle="collapse" href="#collapseSection2" aria-expanded="true" aria-controls="collapseExample">
|
|
Expand/Collpase
|
|
</a>
|
|
|
|
</h5>
|
|
</div>
|
|
<div class="collapse" id="collapseSection2">
|
|
|
|
<div class="panel-body bg-warning">
|
|
<div class="col-sm-offset-0">
|
|
|
|
|
|
@(Html.Kendo().Grid<Fab2ApprovalSystem.Models.LTLotTravelerHoldSteps>()
|
|
.Name("CompletedTasks")
|
|
.Columns(columns =>
|
|
{
|
|
columns.Bound(a => a.ID).Visible(false);
|
|
columns.Bound(a => a.LotTravelerRevisionID).Visible(false);
|
|
columns.Bound(a => a.Location).Width("50px");
|
|
columns.Bound(a => a.OperSequence).Width("50px");
|
|
columns.Bound(a => a.Operation).Width("50px");
|
|
columns.Bound(a => a.OperationDescription).Width("100px");
|
|
columns.Bound(a => a.ChangeInstructions).ClientTemplate("#=changeNewLine(ChangeInstructions)#").Width("250px");
|
|
columns.Bound(a => a.FileNames).ClientTemplate("#=buildLinks(FileNames, SWRNumber)#").Width("100px");
|
|
columns.Bound(a => a.ExecutionTaskComments).ClientTemplate("#=changeNewLine(ExecutionTaskComments)#").Width("250px");
|
|
columns.Bound(a => a.SignedOffByName).Width("50px");
|
|
columns.Bound(a => a.SignOffTime).Format("{0:MM/dd/yy hh:mm:ss}").Width("50px");
|
|
columns.Bound(a => a.Completed).ClientTemplate("<input type='checkbox' disabled #= Completed ? checked='checked':'' # class='chkbx' />").Width("50px");
|
|
})
|
|
.Events(e => e.DataBound("onHoldStepsDataBound"))
|
|
.Sortable()
|
|
.Scrollable()
|
|
.HtmlAttributes(new { style = "height:250; width:100%; font-size: 10px" })
|
|
.DataSource(dataSource => dataSource
|
|
.Ajax()
|
|
.ServerOperation(false)
|
|
|
|
.Model(model =>
|
|
{
|
|
model.Id(p => p.ID);
|
|
})
|
|
.PageSize(50)
|
|
.Read(read => read.Action("GetLotTravHoldStepsCompleted", "LotTraveler", new { LotID = Model.ID }))
|
|
)
|
|
|
|
)
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="panel panel-default" style="font-size: 10px">
|
|
<!-- NEW PANEL ===============================================================-->
|
|
<div class="panel-body bg-info">
|
|
<h5>
|
|
<font style="color:crimson; font-weight:bold">
|
|
OLHold Steps - Pending
|
|
</font>
|
|
<a class="btn btn-xs pull-right alert-danger" id="aSection3" role="button" data-toggle="collapse" href="#collapseSection3" aria-expanded="true" aria-controls="collapseExample">
|
|
Expand/Collpase
|
|
</a>
|
|
|
|
</h5>
|
|
</div>
|
|
<div class="collapse" id="collapseSection3">
|
|
<div class="panel-heading">
|
|
<table cellspacing="50" cellpadding="50" border="0" width="100%">
|
|
<tr>
|
|
<td width="10%">
|
|
<button class="btn btn-warning btn-xs" data-toggle="modal" id="addHoldStep" style="font-size:x-small; color:black">
|
|
Add Hold
|
|
</button>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="panel-body bg-warning">
|
|
<div class="col-sm-offset-0">
|
|
|
|
@(Html.Kendo().Grid<Fab2ApprovalSystem.Models.LTLotTravelerHoldSteps>()
|
|
.Name("HoldSteps")
|
|
.Columns(columns =>
|
|
{
|
|
columns.Bound(a => a.ID).Visible(false);
|
|
columns.Bound(a => a.LotTravelerRevisionID).Visible(false);
|
|
columns.Bound(a => a.Location).Width("50px");
|
|
columns.Bound(a => a.OperSequence).Width("50px");
|
|
columns.Bound(a => a.Operation).Width("50px");
|
|
columns.Bound(a => a.OperationDescription).Width("100px");
|
|
columns.Bound(a => a.ChangeInstructions).ClientTemplate("#=changeNewLine(ChangeInstructions)#").Width("250px");
|
|
columns.Bound(a => a.FileNames).ClientTemplate("#=buildLinks(FileNames, SWRNumber)#").Width("100px");
|
|
columns.Bound(a => a.ExecutionTaskComments).ClientTemplate("#=changeNewLine(ExecutionTaskComments)#").Width("250px");
|
|
columns.Bound(a => a.SignedOffByName).Width("50px");
|
|
columns.Bound(a => a.SignOffTime).Format("{0:MM/dd/yy hh:mm:ss}").Width("50px");
|
|
columns.Bound(a => a.Completed).ClientTemplate("<input type='checkbox' disabled #= Completed ? checked='checked':'' # class='chkbx' />").Width("50px");
|
|
columns.Command(c => c.Custom("Upload File").Click("UploadHoldStepAttachment")).Width("70px");
|
|
columns.Command(c => c.Custom("Edit").Click("EditHoldStep")).Width("50px");
|
|
columns.Command(c => c.Custom("Delete").Click("DeleteHoldStep")).Width("50px");
|
|
|
|
})
|
|
.Events(e => e.DataBound("onHoldStepsDataBound"))
|
|
.Sortable()
|
|
.Scrollable()
|
|
.HtmlAttributes(new { style = "height:250; width:100%; font-size: 10px" })
|
|
.DataSource(dataSource => dataSource
|
|
.Ajax()
|
|
.ServerOperation(false)
|
|
|
|
.Model(model =>
|
|
{
|
|
model.Id(p => p.ID);
|
|
})
|
|
.PageSize(50)
|
|
.Read(read => read.Action("GetLotTravHoldStepsPending", "LotTraveler", new { LotID = Model.ID }))
|
|
)
|
|
)
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
}
|
|
|
|
<div class="modal fade" id="timeout" tabindex="0" role="dialog" aria-hidden="true" data-backdrop="static">
|
|
<div class="modal-dialog modal-lg" style="width:500px;">
|
|
<div class="modal-content">
|
|
<div class="modal-header" style="background-color: #fce0a3;">
|
|
<h3 class="modal-title">Page About To Timeout</h3>
|
|
</div>
|
|
<div class="modal-body" style="background-color: crimson; font-size: 20px; color:white">
|
|
You will be automatically be redirected to Special Request List page in 1 minute.<br />
|
|
To remain on this page please close this window or press the ESC key.
|
|
</div>
|
|
<div class="modal-footer" style="background-color: #fce0a3; ">
|
|
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="modal fade" id="AddHoldStepForm" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" data-backdrop="static">
|
|
<div class="modal-dialog">
|
|
<div class="modal-content" style="width: 800px">
|
|
<div class="modal-header">
|
|
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
|
<h4 class="modal-title" id="myModalLabel">Hold Step Attributes:</h4>
|
|
</div>
|
|
<div class="modal-body">
|
|
<div class="row">
|
|
<div class="col-sm-2">
|
|
<div class="control-group">
|
|
<label for="BaseFlow">Base Flow:</label>
|
|
<div class="controls k-textbox" style="width:100px; font-size: 10px">
|
|
<input type="text" class="form-control" id="txtBaseFlow" disabled="disabled">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-sm-2">
|
|
<div class="control-group">
|
|
<label for="Location">Location:</label>
|
|
<div class="controls">
|
|
@(Html.Kendo().DropDownList()
|
|
.Name("BaseFlowLocations")
|
|
.DataTextField("Location")
|
|
.DataValueField("Location")
|
|
.HtmlAttributes(new { style = "width:100px;font-size: 10px" })
|
|
.Events(e => e.Select("LocationsOnSelect")
|
|
)
|
|
.OptionLabel("Select Location")
|
|
|
|
)
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-sm-2">
|
|
<div class="control-group">
|
|
<label for="Operation">Operation:</label>
|
|
<div class="controls">
|
|
@(Html.Kendo().DropDownList()
|
|
.Name("BaseFlowOperations")
|
|
.DataTextField("Operation")
|
|
.DataValueField("OperationDesc")
|
|
.HtmlAttributes(new { style = "width:100px;font-size: 10px" })
|
|
.Events(e => e.Select("OperationsOnSelect"))
|
|
.OptionLabel("Select Operation")
|
|
|
|
)
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-sm-6">
|
|
<div class="control-group">
|
|
<label for="Description">Description:</label>
|
|
<div class="controls k-textbox" style="width:365px; font-size: 10px">
|
|
<input type="text" class="form-control" id="txtOperationDesc" style="font-size: 10px" disabled="disabled">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="control-group">
|
|
<div class="col-sm-12">
|
|
<label for="Instructions">Instructions:</label>
|
|
<textarea class="form-control" rows="15" id="ChangeInstructions" style="font-size: 10px"></textarea>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
|
|
<button type="button" class="btn btn-primary" id="SaveHoldStep">Save</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="modal fade" id="WinHoldStepRevisionComments" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" data-backdrop="static">
|
|
<div class="modal-dialog">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
|
<h4 class="modal-title" id="myModalLabel">Enter Revision Comments:</h4>
|
|
<h5> <font style="color:red">You have trigerred a Revision of this document, Please enter the revision comments</font> </h5>
|
|
</div>
|
|
<div class="modal-body">
|
|
<textarea class="form-control" rows="3" id="revisionHoldStepComments"></textarea>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
|
|
<button type="button" class="btn btn-primary" id="submitHoldStepRevisionComments">Save</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="modal fade" id="RevisionHistoryWin" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" data-backdrop="static">
|
|
<div class="modal-dialog">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h4 class="modal-title" id="myModalLabel">Revision History</h4>
|
|
</div>
|
|
<div class="modal-body">
|
|
@(Html.Kendo().Grid<Fab2ApprovalSystem.Models.RevisionHistory>()
|
|
.Name("RevisionHistory")
|
|
.Columns(columns =>
|
|
{
|
|
columns.Bound(a => a.ID).Visible(false);
|
|
columns.Bound(a => a.RevisionedBy);
|
|
columns.Bound(a => a.Comments);
|
|
columns.Bound(a => a.RevisionCreateDate).Format("{0:MM/dd/yy hh:mm:ss}");
|
|
|
|
})
|
|
|
|
.Sortable()
|
|
.Scrollable()
|
|
.HtmlAttributes(new { style = "height:300px; width:100%; font-size: 12px" })
|
|
.DataSource(dataSource => dataSource
|
|
.Ajax()
|
|
.ServerOperation(false)
|
|
.Model(model =>
|
|
{
|
|
model.Id(p => p.ID);
|
|
})
|
|
.PageSize(50)
|
|
.Read(read => read.Action("GetLotTravelerRevisionHistory", "LotTraveler", new { lotID = Model.ID }))
|
|
)
|
|
)
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="modal fade" id="WinHoldStepAttRevComments" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" data-backdrop="static">
|
|
<div class="modal-dialog">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
|
<h4 class="modal-title" id="myModalLabel">Enter Revision Comments:</h4>
|
|
<h5> <font style="color:red">You have trigerred a Revision of this document, Please enter the revision comments</font> </h5>
|
|
</div>
|
|
<div class="modal-body">
|
|
<textarea class="form-control" rows="3" id="revisionHoldStepAttComments"></textarea>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
|
|
<button type="button" class="btn btn-primary" id="submitHoldStepAttRevComments">Save</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="modal fade" id="AddLTHoldStepAttachmentFormRevision" data-url='@Url.Action("GetLotTravHoldStepRevision")' tabindex="0" role="dialog" aria-hidden="true" data-backdrop="static">
|
|
<div class="modal-dialog modal-lg">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
|
<h4 class="modal-title" id="myModalLabel">Upload Attachments for the Hold Step:</h4>
|
|
</div>
|
|
<div class="modal-body" id="LTHoldStepAttachmentContainer">
|
|
@Html.Partial("_LotTravHoldStepAttachRev", Model.LTLotTravelerHoldStep)
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
<div class="modal fade" id="WinCloseTraveler" tabindex="0" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" data-backdrop="static">
|
|
<div class="modal-dialog">
|
|
<div class="modal-content" style="width:400px; height:250px">
|
|
<div class="modal-header">
|
|
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
|
<h5 class="modal-title" id="myModalLabel">Select the Reason for closing the Traveler:</h5>
|
|
</div>
|
|
<div class="modal-body" id="CloseReasonContainer" style="width:100px; height:100px">
|
|
<div class="row">
|
|
<div class="col-sm-12">
|
|
<div class="control-group">
|
|
<label for="Reason">Reason:</label>
|
|
<div class="controls" style="width:200px; font-size: 10px">
|
|
<div id="ex" class="k-content">
|
|
@(Html.Kendo().DropDownList()
|
|
.Name("CloseReason")
|
|
.DataTextField("Text")
|
|
.DataValueField("Value")
|
|
.BindTo(new List<SelectListItem>() {
|
|
new SelectListItem() {
|
|
Text = "Select",
|
|
Value = "Select"
|
|
},
|
|
|
|
new SelectListItem() {
|
|
Text = "Scrap",
|
|
Value = "Scrap"
|
|
},
|
|
new SelectListItem() {
|
|
Text = "Invalid",
|
|
Value = "Invalid"
|
|
},
|
|
new SelectListItem() {
|
|
Text = "Complete",
|
|
Value = "Complete"
|
|
}
|
|
|
|
})
|
|
.Value("1")
|
|
.HtmlAttributes(new { style = "width:100px;" })
|
|
)
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
|
|
<button type="button" class="btn btn-primary" id="submitCloseReason">Save</button>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
</body>
|
|
|
|
@Html.Partial("_LTReassignOriginator")
|
|
|
|
<script type="text/javascript">
|
|
var holdStepOperation;
|
|
var currentHoldStepID;
|
|
var currentLotTravRevisionID = $("#LTLotTravRevID").val();
|
|
var newSession = true;
|
|
var currTravRev = '@Model.LotTravCurrentRevision';
|
|
$(document).ready(function () {
|
|
|
|
|
|
$('#collapseSection3').collapse({
|
|
toggle: true
|
|
})
|
|
|
|
var url = "/LotTraveler/GetLotTravRevisions";
|
|
$.ajax({
|
|
url: url,
|
|
type: "GET",
|
|
datatype: "json",
|
|
data: {
|
|
ltLotID: '@Model.ID'
|
|
},
|
|
success: function (data) {
|
|
$("#Revisions").data("kendoDropDownList").dataSource.data(data);
|
|
},
|
|
error: function (result) {
|
|
alert("Failed " + result);
|
|
}
|
|
});
|
|
|
|
})
|
|
|
|
function onHoldStepsDataBound(arg) {
|
|
var myElem = document.getElementById('trParentHeader');
|
|
if (myElem == null) {
|
|
$("#HoldSteps").find("th.k-header").parent().before("<tr id='trParentHeader'> <th align='center' colspan='3' class='k-header' style='color:red'></th> <th align='center' colspan='2' class='k-header' style='font-size:12px;color:red'><strong>Change Instructions/File </strong></th> </th> <th align='center' colspan='4' class='k-header' style='font-size:12px;color:red'><strong>Execution </strong></th></tr>");
|
|
}
|
|
}
|
|
|
|
function buildLinks(fileNames, swrNumber) {
|
|
var template = "";
|
|
|
|
//var fileName = 4;
|
|
|
|
//alert(workRequestID);
|
|
|
|
if (fileNames != null) {
|
|
var tempValue = fileNames.split(',');
|
|
for (var i = 0; i < tempValue.length; i++) {
|
|
var tempValue2 = tempValue[i].split('~');
|
|
|
|
var fileName = tempValue2[0];
|
|
var fileGuid = tempValue2[1];
|
|
|
|
var tempFile = fileName.split('.');
|
|
var fileExtension = tempFile[tempFile.length - 1];
|
|
|
|
//template += "<a href='@GlobalVars.AttachmentUrl" + "LotTraveler/" + swrNumber + "/" + fileGuid + "." + fileExtension + "'>" + fileName + "</a><BR>" + " ";
|
|
template += "<a href='/LotTraveler/DownloadFile?fileGuid=" + fileGuid + "&swrNumber=" + @Model.SWRNumber + "&typeOfDoc=2" + "'>" + fileName + "</a><BR>" + " ";
|
|
|
|
}
|
|
|
|
}
|
|
return template;
|
|
}
|
|
|
|
$("#addHoldStep").on('click', function (e) {
|
|
e.preventDefault();
|
|
var holdStepGrid = $('#HoldSteps').data('kendoGrid');
|
|
|
|
//var dataSource = holdStepGrid.dataSource;
|
|
//dataSource.add({ ID: 11, Location: 'Location1', Operation: 'Op1', OperationDescription: 'OpDesc', ChangeInstructions: 'ChangeIns', FileNames: '#=buildLinks("FileNames", "1")#', TaskComments: 'TaskComments', SignedOffByName: 'SignedOffByName', SignOffTime: 'SignOffTime', Completed: false });
|
|
//dataSource.sync();
|
|
|
|
holdStepOperation = "Add";
|
|
displayAddHoldStepForm();
|
|
return false;
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
var displayAddHoldStepForm = function () {
|
|
|
|
var url = "/LotTraveler/GetBaseFlowLocations";
|
|
$.ajax({
|
|
url: url,
|
|
type: "GET",
|
|
datatype: "json",
|
|
data: {
|
|
baseFlow: $("#txtProcessFlow").val()
|
|
},
|
|
success: function (data) {
|
|
$("#BaseFlowLocations").data("kendoDropDownList").dataSource.data(data);
|
|
$("#txtBaseFlow").val($("#txtProcessFlow").val());
|
|
$("#AddHoldStepForm").modal('show');
|
|
|
|
},
|
|
error: function (result) {
|
|
alert("Failed " + result);
|
|
}
|
|
});
|
|
}
|
|
|
|
|
|
$("#SaveHoldStep").on("click", function (e) {
|
|
e.preventDefault();
|
|
|
|
var errorMsg = "";
|
|
|
|
var newbaseFlowLocation = $("#BaseFlowLocations").data("kendoDropDownList").value();
|
|
|
|
var newtempValue = $("#BaseFlowOperations").data("kendoDropDownList").text().split('-');
|
|
//var newbaseFlowOperation = $("#BaseFlowOperations").data("kendoDropDownList").dataItem().OperCode;
|
|
//var newbaseFlowOperationSeq = $("#BaseFlowOperations").data("kendoDropDownList").dataItem().SeqCode;
|
|
var newbaseFlowOperation = $.trim(newtempValue[0]);
|
|
var newbaseFlowOperationSeq = $.trim(newtempValue[1]);
|
|
|
|
|
|
var newbaseFlowOperDesc = $("#txtOperationDesc").val();
|
|
var newchangeInstructions = $("#ChangeInstructions").val();
|
|
|
|
var vgrid = $("#HoldSteps").data("kendoGrid");
|
|
//Getting grid items
|
|
var items = vgrid.dataSource.data();
|
|
|
|
for (i = 0; i < items.length; i++) {
|
|
var item = items[i];
|
|
|
|
var existinglocationOperation = $.trim(item.Location) + $.trim(item.Operation);
|
|
var existingOperation = $.trim(item.Operation);
|
|
var existingSeq = $.trim(item.OperSequence);
|
|
|
|
if ((existinglocationOperation == $.trim(newbaseFlowLocation) + $.trim(newbaseFlowOperation)) &&
|
|
currentHoldStepID != item.ID) {
|
|
alert("The Location and Operation Combination has already been entered");
|
|
return
|
|
}
|
|
|
|
//if (newbaseFlowLocation == $.trim(item.Location) && (currentHoldStepID != item.ID)) {
|
|
// if (parseInt(newbaseFlowOperationSeq) <= existingSeq) {
|
|
// alert("The Operation has already been passed in the Mfg process");
|
|
// return;
|
|
// }
|
|
//}
|
|
|
|
}
|
|
|
|
|
|
if (newbaseFlowLocation == "Select Location")
|
|
errorMsg = "Location, ";
|
|
|
|
if (newbaseFlowOperation == "Select Operation" || newbaseFlowOperation == '')
|
|
errorMsg = errorMsg + "Operation, ";
|
|
|
|
if (newchangeInstructions.length <= 0)
|
|
errorMsg = errorMsg + "Instructions, ";
|
|
|
|
if (errorMsg != '') {
|
|
alert(errorMsg + 'needs to be entered before saving ');
|
|
|
|
}
|
|
else {
|
|
// save
|
|
$("#AddHoldStepForm").modal('hide');
|
|
if (newSession) {
|
|
newSession = false;
|
|
$("#WinHoldStepRevisionComments").modal("show");
|
|
}
|
|
else {
|
|
//var newbaseFlowLocation = $("#BaseFlowLocations").data("kendoDropDownList").value();
|
|
//var newbaseFlowOperation = $("#BaseFlowOperations").data("kendoDropDownList").text();
|
|
//var newbaseFlowOperDesc = $("#txtOperationDesc").val();
|
|
//var newchangeInstructions = $("#ChangeInstructions").val();
|
|
|
|
var holdStepItem = {
|
|
ID: currentHoldStepID,
|
|
Location: newbaseFlowLocation,
|
|
OperSequence: newbaseFlowOperationSeq,
|
|
Operation: newbaseFlowOperation,
|
|
OperationDescription: newbaseFlowOperDesc,
|
|
ChangeInstructions: newchangeInstructions,
|
|
LotTravelerRevisionID: currentLotTravRevisionID,
|
|
LTLotID: "@Model.ID",
|
|
RevisionComments: $("#revisionHoldStepComments").val()
|
|
}
|
|
|
|
var urlString;
|
|
if (holdStepOperation == "Update")
|
|
urlString = '/LotTraveler/UpdateLotTravHoldStepRevision';
|
|
else if (holdStepOperation == "Add")
|
|
urlString = '/LotTraveler/InsertLotTravHoldStepRevision';
|
|
|
|
|
|
$.ajax({
|
|
url: urlString,
|
|
type: "POST",
|
|
contentType: "application/json; charset=utf-8",
|
|
data: JSON.stringify(holdStepItem),
|
|
success: function (data) {
|
|
|
|
if (data != '@GlobalVars.SUCCESS') {
|
|
alert(data);
|
|
$('#submitHoldStepRevisionComments').attr("disabled", false);
|
|
}
|
|
else {
|
|
$("#AddHoldStepForm").modal('hide');
|
|
var grid = $("#HoldSteps").data("kendoGrid");
|
|
grid.dataSource.read('@Model.ID');
|
|
}
|
|
|
|
|
|
},
|
|
error: function (result) {
|
|
alert("Failed " + result);
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
}
|
|
})
|
|
|
|
|
|
$('#submitHoldStepRevisionComments').on('click', function (e) {
|
|
e.preventDefault();
|
|
$('#submitHoldStepRevisionComments').attr("disabled", true);
|
|
|
|
var newbaseFlowLocation = $("#BaseFlowLocations").data("kendoDropDownList").value();
|
|
|
|
var newtempValue = $("#BaseFlowOperations").data("kendoDropDownList").text().split('-');
|
|
//var newbaseFlowOperation = $("#BaseFlowOperations").data("kendoDropDownList").dataItem().OperCode;
|
|
//var newbaseFlowOperationSeq = $("#BaseFlowOperations").data("kendoDropDownList").dataItem().SeqCode;
|
|
var newbaseFlowOperation = $.trim(newtempValue[0]);
|
|
var newbaseFlowOperationSeq = $.trim(newtempValue[1]);
|
|
|
|
var newbaseFlowOperDesc = $("#txtOperationDesc").val();
|
|
var newchangeInstructions = $("#ChangeInstructions").val();
|
|
|
|
//alert(newbaseFlowOperationSeq);
|
|
|
|
var holdStepItem = {
|
|
ID: currentHoldStepID,
|
|
Location: newbaseFlowLocation,
|
|
OperSequence: newbaseFlowOperationSeq,
|
|
Operation: newbaseFlowOperation,
|
|
OperationDescription: newbaseFlowOperDesc,
|
|
ChangeInstructions: newchangeInstructions,
|
|
LotTravelerRevisionID: currentLotTravRevisionID,
|
|
LTLotID: "@Model.ID",
|
|
RevisionComments: $("#revisionHoldStepComments").val()
|
|
|
|
}
|
|
|
|
|
|
//alert(currentLotTravRevisionID);
|
|
holdStepItem.RevisionComments = $("#revisionHoldStepComments").val();
|
|
|
|
var urlString;
|
|
if (holdStepOperation == "Update")
|
|
urlString = '/LotTraveler/UpdateLotTravHoldStepRevision';
|
|
else if (holdStepOperation == "Add")
|
|
urlString = '/LotTraveler/InsertLotTravHoldStepRevision';
|
|
else if (holdStepOperation == "Delete")
|
|
urlString = '/LotTraveler/DeleteLotTravHoldStepRevision';
|
|
|
|
|
|
$.ajax({
|
|
type: "Post",
|
|
url: urlString,
|
|
type: "POST",
|
|
contentType: "application/json; charset=utf-8",
|
|
data: JSON.stringify(holdStepItem),
|
|
success: function (data) {
|
|
|
|
if (data != '@GlobalVars.SUCCESS') {
|
|
alert(data);
|
|
$('#submitHoldStepRevisionComments').attr("disabled", false);
|
|
newSession = true;
|
|
}
|
|
else {
|
|
$("#WinHoldStepRevisionComments").modal("hide");
|
|
var grid = $("#HoldSteps").data("kendoGrid");
|
|
grid.dataSource.read('@Model.ID');
|
|
|
|
// update the header and the Revision
|
|
urlString = '/LotTraveler/GetLotTravelerHeader'
|
|
$.ajax({
|
|
type: "Post",
|
|
url: urlString,
|
|
type: "GET",
|
|
contentType: "application/json; charset=utf-8",
|
|
data: { ltLotID: '@Model.ID' },
|
|
success: function (data) {
|
|
// update the header and the Revision
|
|
//alert(data.LastUpdate);
|
|
currTravRev = data.LotTravCurrentRevision
|
|
$("#txtUpdatedBy").val(data.LastUpdatedBy);
|
|
$("#txtLastUpdate").val((formatJSONDate(data.LastUpdate)))
|
|
$("#RevNumber").text("Fab2 Electronic Lot Traveler - Lot#" + data.LotNumber + " Rev " + data.LotTravCurrentRevision)
|
|
$("#RevNumber").css("color", "blue");
|
|
|
|
|
|
var url = "/LotTraveler/GetLotTravRevisions";
|
|
$.ajax({
|
|
url: url,
|
|
type: "GET",
|
|
datatype: "json",
|
|
data: {
|
|
ltLotID: '@Model.ID'
|
|
},
|
|
success: function (data) {
|
|
$("#Revisions").data("kendoDropDownList").dataSource.data(data);
|
|
|
|
},
|
|
error: function (result) {
|
|
alert("Failed " + result);
|
|
}
|
|
});
|
|
},
|
|
error: function (result) {
|
|
alert("Failed " + result);
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
},
|
|
error: function (result) {
|
|
alert("Failed " + result);
|
|
}
|
|
|
|
});
|
|
|
|
})
|
|
|
|
|
|
function LocationsOnSelect(e) {
|
|
//alert(e.item);
|
|
var dataItem = this.dataItem(e.item.index());
|
|
var url = "/LotTraveler/GetBaseFlowOperations";
|
|
$.ajax({
|
|
url: url,
|
|
type: "GET",
|
|
datatype: "json",
|
|
data: {
|
|
baseFlow: $("#txtProcessFlow").val(),
|
|
location: dataItem.Location
|
|
},
|
|
success: function (data) {
|
|
$("#BaseFlowOperations").data("kendoDropDownList").dataSource.data(data);
|
|
$("#txtOperationDesc").val('');
|
|
},
|
|
error: function (result) {
|
|
alert("Failed " + result);
|
|
}
|
|
});
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
function OperationsOnSelect(e) {
|
|
var dataItem = this.dataItem(e.item.index());
|
|
$("#txtOperationDesc").val(dataItem.Operation + ' ' + dataItem.OperationDesc);
|
|
}
|
|
|
|
|
|
function DeleteHoldStep(e) {
|
|
e.preventDefault();
|
|
|
|
var dataItem = this.dataItem($(e.currentTarget).closest("tr"));
|
|
currentHoldStepID = dataItem.ID;
|
|
currentLotTravRevisionID = dataItem.LotTravelerRevisionID
|
|
|
|
var newbaseFlowLocation = dataItem.Location;
|
|
var newbaseFlowOperation = dataItem.Operation;
|
|
var newbaseFlowOperDesc = dataItem.OperationDescription;
|
|
var newchangeInstructions = dataItem.ChangeInstructions;
|
|
|
|
|
|
|
|
var holdStepItem = {
|
|
ID: currentHoldStepID,
|
|
Location: newbaseFlowLocation,
|
|
Operation: newbaseFlowOperation,
|
|
OperationDescription: newbaseFlowOperDesc,
|
|
ChangeInstructions: newchangeInstructions,
|
|
LotTravelerRevisionID: currentLotTravRevisionID,
|
|
LTLotID: "@Model.ID",
|
|
RevisionComments: $("#revisionHoldStepComments").val()
|
|
|
|
}
|
|
|
|
|
|
|
|
if (confirm('Are you sure you want to delete this Hold Step?')) {
|
|
holdStepOperation = "Delete";
|
|
|
|
if (newSession) {
|
|
newSession = false;
|
|
$("#WinHoldStepRevisionComments").modal("show");
|
|
}
|
|
else {
|
|
|
|
var urlString = '/LotTraveler/DeleteLotTravHoldStepRevision';
|
|
$.ajax({
|
|
url: urlString,
|
|
type: "POST",
|
|
contentType: "application/json; charset=utf-8",
|
|
data: JSON.stringify(holdStepItem),
|
|
success: function (data) {
|
|
var grid = $("#HoldSteps").data("kendoGrid");
|
|
grid.dataSource.read('@Model.ID');
|
|
|
|
|
|
},
|
|
error: function (result) {
|
|
alert("Failed " + result);
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
function EditHoldStep(e) {
|
|
e.preventDefault();
|
|
holdStepOperation = "Update";
|
|
|
|
var dataItem = this.dataItem($(e.currentTarget).closest("tr"));
|
|
currentHoldStepID = dataItem.ID;
|
|
currentLotTravRevisionID = dataItem.LotTravelerRevisionID
|
|
|
|
var location = dataItem.Location;
|
|
var operation = dataItem.Operation + '-' + dataItem.OperSequence;
|
|
var operationDescription = dataItem.OperationDescription;
|
|
var newchangeInstructions = dataItem.ChangeInstructions;
|
|
|
|
//alert(currentHoldStepID);
|
|
displayAddHoldStepForm();
|
|
//set the selected location
|
|
var locationList = $("#BaseFlowLocations").data("kendoDropDownList");
|
|
locationList.value(location);
|
|
|
|
// set the selected operation
|
|
var url = "/LotTraveler/GetBaseFlowOperations";
|
|
$.ajax({
|
|
url: url,
|
|
type: "GET",
|
|
datatype: "json",
|
|
data: {
|
|
baseFlow: $("#txtProcessFlow").val(),
|
|
location: location
|
|
},
|
|
success: function (data) {
|
|
$("#BaseFlowOperations").data("kendoDropDownList").dataSource.data(data);
|
|
var operationList = $("#BaseFlowOperations").data("kendoDropDownList");
|
|
operationList.text(operation);
|
|
},
|
|
error: function (result) {
|
|
alert("Failed " + result);
|
|
}
|
|
});
|
|
|
|
$("#txtOperationDesc").val(operationDescription);
|
|
$("#ChangeInstructions").val(newchangeInstructions);
|
|
}
|
|
|
|
|
|
$("#GetRevision").on('click', function (e) {
|
|
e.preventDefault();
|
|
var revid = $("#Revisions").data("kendoDropDownList").text();
|
|
|
|
if (revid != "Select") {
|
|
var url = '@Url.Action("LotTravelerReadonly", "LotTraveler", new { ltLotID = "__id__", revisionNumber = "__revID__" })';
|
|
url = url.replace('__revID__', revid);
|
|
url = url.replace('amp;', '');
|
|
window.location.href = url.replace('__id__', '@Model.ID');
|
|
}
|
|
else {
|
|
alert('Please select a Revision Number');
|
|
}
|
|
})
|
|
|
|
$("#GetTraveler").on('click', function (e) {
|
|
e.preventDefault()
|
|
var lotid = $("#LotList").data("kendoDropDownList").value();
|
|
|
|
var url = '@Url.Action("LotTravelerUpdate", "LotTraveler", new { ltLotID = "__id__" })';
|
|
url = url.replace('amp;', '');
|
|
window.location.href = url.replace('__id__', lotid);
|
|
|
|
|
|
})
|
|
|
|
|
|
function formatJSONDate(jsonDate) {
|
|
//var newDate = dateFormat(jsonDate, "mm/dd/yyyy");
|
|
|
|
var jsondateString = jsonDate.substr(6);
|
|
var current = new Date(parseInt(jsondateString));
|
|
var month = current.getMonth() + 1;
|
|
var day = current.getDate();
|
|
var year = current.getFullYear();
|
|
var hr = current.getHours();
|
|
var min = current.getMinutes();
|
|
var sec = current.getSeconds();
|
|
var date = day + "/" + month + "/" + year + " " + hr + ":" + min + ":" + sec
|
|
return date;
|
|
}
|
|
|
|
function changeNewLine(text) {
|
|
if (text != null) {
|
|
var regexp = new RegExp('\n', 'g');
|
|
return text.replace(regexp, '<br>');
|
|
}
|
|
else
|
|
return '';
|
|
}
|
|
|
|
|
|
$("#PrintTravelerPDF").on('click', function (e) {
|
|
e.preventDefault();
|
|
var url = '@Url.Action("DisplayLotTravlerPdf", "LotTraveler", new { ltLotID = "__id__", revisionNumber = "__revid__" })';
|
|
url = url.replace("__revid__", currTravRev)
|
|
window.open(url.replace('__id__', '@Model.ID', '_blank'));
|
|
})
|
|
|
|
|
|
$("#BackToRequestID").on('click', function (e) {
|
|
|
|
e.preventDefault();
|
|
var url = '@Url.Action("Edit", "LotTraveler", new { IssueID = "__id__"})';
|
|
window.location.href = url.replace('__id__', $("#LTWorkRequestID").val());
|
|
})
|
|
|
|
|
|
$('#RevisionHistoryData').on('click', function (e) {
|
|
|
|
e.preventDefault();
|
|
|
|
$("#RevisionHistoryWin").modal('show');
|
|
var grid = $("#RevisionHistory").data("kendoGrid");
|
|
grid.dataSource.read('@Model.ID');
|
|
|
|
|
|
return false;
|
|
})
|
|
|
|
|
|
function UploadHoldStepAttachment(e) {
|
|
e.preventDefault();
|
|
|
|
var dataItem = this.dataItem($(e.currentTarget).closest("tr"));
|
|
currentHoldStepID = dataItem.ID;
|
|
//alert(newSession);
|
|
if (newSession) {
|
|
$("#WinHoldStepAttRevComments").modal('show');
|
|
}
|
|
else {
|
|
var url = $('#AddLTHoldStepAttachmentFormRevision').data('url');
|
|
url = url + '?ltHoldStepID=' + currentHoldStepID;
|
|
$.ajax({
|
|
url: url,
|
|
type: "GET",
|
|
datatype: "json",
|
|
success: function (data) {
|
|
|
|
$('#LTHoldStepAttachmentContainer').html(data);
|
|
$("#AddLTHoldStepAttachmentFormRevision").modal('show')
|
|
|
|
var grid = $("#LTHoldStepAttachments").data("kendoGrid");
|
|
grid.dataSource.read();
|
|
},
|
|
error: function (result) {
|
|
alert("Failed " + result);
|
|
}
|
|
});
|
|
|
|
}
|
|
}
|
|
|
|
|
|
$("#submitHoldStepAttRevComments").on('click', function () {
|
|
|
|
$("#WinHoldStepAttRevComments").modal('hide');
|
|
var url = $('#AddLTHoldStepAttachmentFormRevision').data('url');
|
|
url = url + '?ltHoldStepID=' + currentHoldStepID;
|
|
$.ajax({
|
|
url: url,
|
|
type: "GET",
|
|
datatype: "json",
|
|
success: function (data) {
|
|
|
|
$('#LTHoldStepAttachmentContainer').html(data);
|
|
$("#AddLTHoldStepAttachmentFormRevision").modal('show')
|
|
|
|
},
|
|
error: function (result) {
|
|
alert("Failed " + result);
|
|
}
|
|
});
|
|
|
|
})
|
|
|
|
|
|
$(window).bind("beforeunload", function () {
|
|
//return confirm("Do you really want to close?");
|
|
var url;
|
|
$.ajax({
|
|
url: "/LotTraveler/ReleaseLockOnLotTravelerUpdateDoc",
|
|
type: "GET",
|
|
datatype: "json",
|
|
data: {
|
|
lotID: ("@Model.ID")
|
|
},
|
|
success: function () {
|
|
},
|
|
error: function (result) {
|
|
alert("Failed " + result);
|
|
}
|
|
});
|
|
|
|
|
|
})
|
|
|
|
|
|
$("#CloseTraveler").on('click', function (e) {
|
|
e.preventDefault();
|
|
if (confirm("Are you sure you want to close the Traveler")) {
|
|
$("#WinCloseTraveler").modal('show');
|
|
}
|
|
})
|
|
|
|
$("#submitCloseReason").on('click', function (e) {
|
|
e.preventDefault();
|
|
|
|
var reasonvalue = $("#CloseReason").data("kendoDropDownList").value();
|
|
if (reasonvalue == "Select") {
|
|
alert("Please select a reason before closing the travaler")
|
|
|
|
return;
|
|
}
|
|
|
|
$.ajax({
|
|
url: "/LotTraveler/CloseTraveler",
|
|
type: "GET",
|
|
datatype: "json",
|
|
contentType: "application/json; charset=utf-8",
|
|
data: {
|
|
ltLotID: ("@Model.ID"),
|
|
reason: $("#CloseReason").data("kendoDropDownList").value()
|
|
},
|
|
success: function (data) {
|
|
|
|
if (data == "C") {
|
|
alert("Lot Traveler successfully Closed")
|
|
$("#WinCloseTraveler").modal('hide');
|
|
var url = '@Url.Action("LotTravelerReadonly", "LotTraveler", new { ltLotID = "__id__", revisionNumber = "-1" })';
|
|
url = url.replace('amp;', '');
|
|
window.location.href = url.replace('__id__', '@Model.ID');
|
|
}
|
|
else
|
|
alert("Cannot close the traveler as the lot is not closed in SPN");
|
|
|
|
},
|
|
error: function (result) {
|
|
alert("Failed " + result);
|
|
$("#WinCloseTraveler").modal('hide');
|
|
}
|
|
});
|
|
})
|
|
|
|
|
|
|
|
|
|
@*function IdleTimeout() {
|
|
//window.location = logoutUrl;
|
|
var url = '@Url.Action("SpecialWorkRequest", "Home")';
|
|
window.location.href = url;
|
|
|
|
}*@
|
|
|
|
</script>
|