Added functionality to attach files to corrective actions
This commit is contained in:
parent
09543b8474
commit
15ce48e7a5
Binary file not shown.
Binary file not shown.
@ -334,6 +334,10 @@ namespace Fab2ApprovalSystem.Controllers
|
||||
return Json(caDMO.GetCAAttachmentsList(caNo, Functions.CASectionMapper(GlobalVars.CASection.D2)).ToDataSourceResult(request));
|
||||
}
|
||||
|
||||
public ActionResult Attachment_Read([DataSourceRequest] DataSourceRequest request, int caNO)
|
||||
{
|
||||
return Json(caDMO.GetCAAttachmentsList(caNO, "").ToDataSourceResult(request), JsonRequestBehavior.AllowGet);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
|
@ -431,6 +431,47 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel-body bg-warning">
|
||||
<div class="form-group">
|
||||
<label class="control-label">Affected Documents:</label>
|
||||
<div class="col-sm-12">
|
||||
|
||||
|
||||
|
||||
@(Html.Kendo().Grid<Fab2ApprovalSystem.Models.CA_Attachment>()
|
||||
.Name("Attachments")
|
||||
.Columns(columns =>
|
||||
{
|
||||
columns.Bound(a => a.ID).Visible(false);
|
||||
columns.Bound(a => a.CANo).Visible(false);
|
||||
columns.Bound(a => a.FileGUID).Visible(false);
|
||||
columns.Bound(a => a.FileName);
|
||||
columns.Bound(a => a.UploadedByName);
|
||||
columns.Bound(a => a.UploadDateTime).Format("{0:MM/dd/yy hh:mm:ss}");
|
||||
columns.Command(command => command.Custom("View").Click("DownloadCAAttachment"));
|
||||
columns.Command(command => command.Custom("Delete").Click("DeleteCAAttachment"));
|
||||
|
||||
})
|
||||
|
||||
.Sortable()
|
||||
.HtmlAttributes(new { style = "height:300px; width:100%; font-size: 10px", Readonly = "Readonly" })
|
||||
.DataSource(dataSource => dataSource
|
||||
.Ajax()
|
||||
//.Batch(false)
|
||||
.ServerOperation(false)
|
||||
.Events(events => events.Error("error_handler"))
|
||||
.Model(model =>
|
||||
{
|
||||
model.Id(p => p.ID);
|
||||
})
|
||||
.PageSize(50)
|
||||
.Read(read => read.Action("Attach_Read", "CorrectiveAction", new { caNO = Model.CANo }))
|
||||
.Destroy(destroy => destroy.Action("DeleteCAAttachment", "CorrectionAction"))
|
||||
)
|
||||
)
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="D0ScrollPoint"></div>
|
||||
<div class="panel panel-default" style="font-size: 10px">
|
||||
@ -2733,7 +2774,7 @@
|
||||
|
||||
return message;
|
||||
}
|
||||
|
||||
|
||||
$('#CATypeList').on('change', function () {
|
||||
HideAllSections();
|
||||
|
||||
@ -3245,7 +3286,7 @@
|
||||
$('#cover-spin').show(0);
|
||||
var data = ReturnModelObject();
|
||||
var confirmationMessage = "Submit " + section + " completion for approval?";
|
||||
|
||||
|
||||
if (!confirm(confirmationMessage)) {
|
||||
$('#' + section + 'Completed').prop('checked', false);
|
||||
if (section == 'D5D6D7') {
|
||||
@ -3317,7 +3358,7 @@
|
||||
else {
|
||||
alert(result);
|
||||
if (result.indexOf("Validation initiated") >= 0) {
|
||||
|
||||
|
||||
var url = '@Url.Action("Edit", "CorrectiveAction", new { issueID = "__id__" })';
|
||||
url = url.replace('amp;', '');
|
||||
window.location.href = url.replace('__id__', "@Model.CANo");
|
||||
@ -3399,7 +3440,7 @@
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
|
||||
return false;
|
||||
|
||||
|
||||
@ -3914,8 +3955,30 @@
|
||||
grid.dataSource.read("@Model.CANo");
|
||||
}
|
||||
|
||||
function DeleteCAAttachment(e) {
|
||||
e.preventDefault();
|
||||
if (confirm("Are you sure you want to delete this Attachment?")) {
|
||||
var dataItem = this.dataItem($(e.currentTarget).closest("tr"));
|
||||
var fileName = dataItem.FileGUID;
|
||||
var attachmentID = dataItem.ID;
|
||||
|
||||
|
||||
$.ajax({
|
||||
url: "/CorrectiveAction/DeleteCAAttachment",
|
||||
type: "POST",
|
||||
datatype: "json",
|
||||
data: {
|
||||
attachmentID: attachmentID
|
||||
},
|
||||
success: function (data) {
|
||||
var grid = $("#Attachments").data("kendoGrid");
|
||||
grid.dataSource.read("@Model.CANo");
|
||||
},
|
||||
error: function (result) {
|
||||
alert("Failed " + result);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function DeleteD2CAAttachment(e) {
|
||||
e.preventDefault();
|
||||
@ -4116,7 +4179,7 @@
|
||||
var grid = $("#D5D6CorrectivetActions").data("kendoGrid");
|
||||
grid.dataSource.read($("@Model.CANo").val());
|
||||
$("#D5D6CorrectiveActionForm").modal("hide");
|
||||
|
||||
|
||||
|
||||
},
|
||||
error: function (result) {
|
||||
|
@ -318,6 +318,46 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel-body bg-warning">
|
||||
<div class="form-group">
|
||||
<label class="control-label">Affected Documents:</label>
|
||||
<div class="col-sm-12">
|
||||
|
||||
|
||||
|
||||
@(Html.Kendo().Grid<Fab2ApprovalSystem.Models.CA_Attachment>()
|
||||
.Name("files")
|
||||
.Columns(columns =>
|
||||
{
|
||||
columns.Bound(a => a.ID).Visible(false);
|
||||
columns.Bound(a => a.CANo).Visible(false);
|
||||
columns.Bound(a => a.FileGUID).Visible(false);
|
||||
columns.Bound(a => a.FileName);
|
||||
columns.Bound(a => a.UploadedByName);
|
||||
columns.Bound(a => a.UploadDateTime).Format("{0:MM/dd/yy hh:mm:ss}");
|
||||
columns.Command(command => command.Custom("View").Click("DownloadCAAttachment"));
|
||||
//columns.Command(command => command.Custom("Delete").Click("DeleteD4CAAttachment"));
|
||||
|
||||
})
|
||||
|
||||
.Sortable()
|
||||
.HtmlAttributes(new { style = "height:300px; width:100%; font-size: 10px", Readonly = "Readonly" })
|
||||
.DataSource(dataSource => dataSource
|
||||
.Ajax()
|
||||
//.Batch(false)
|
||||
.ServerOperation(false)
|
||||
.Events(events => events.Error("error_handler"))
|
||||
.Model(model =>
|
||||
{
|
||||
model.Id(p => p.ID);
|
||||
})
|
||||
.PageSize(50)
|
||||
.Read(read => read.Action("Attach_Read", "CorrectiveAction", new { caNO = Model.CANo }))
|
||||
)
|
||||
)
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel panel-default" style="font-size: 10px">
|
||||
<div class="panel-body bg-danger">
|
||||
|
@ -25,18 +25,18 @@
|
||||
{
|
||||
|
||||
columns.Bound(l => l.CANo)
|
||||
.ClientTemplate("<a href='/CorrectiveAction/Edit?IssueID=#=CANo#'>#=formatIssueID(CANo)#</a>").Width("50px");
|
||||
.ClientTemplate("<a href='/CorrectiveAction/Edit?IssueID=#=CANo#'>#=formatIssueID(CANo)#</a>");
|
||||
|
||||
columns.Bound(l => l.CASource).Width("100px");
|
||||
columns.Bound(l => l.RequestorName).Title("Requestor").Width("250px");
|
||||
columns.Bound(l => l.D1AssigneeName).Title("Assignee").Width("100px");
|
||||
columns.Bound(l => l.IssueDate).Format("{0:MM/dd/yy}").Width("100px");
|
||||
columns.Bound(l => l.CATitle).Width("150px");
|
||||
columns.Bound(l => l.StatusName).Width("50px");
|
||||
columns.Bound(l => l.PendingApprovers).Width("100px");
|
||||
columns.Bound(l => l.PendingAIOwners).Width("100px").Title("Action Item Owners");
|
||||
columns.Bound(l => l.D8DueDate).Format("{0:MM/dd/yy}").Width("100px");
|
||||
columns.Bound(l => l.ClosedDate).Format("{0:MM/dd/yy}").Width("100px");
|
||||
columns.Bound(l => l.CASource);
|
||||
columns.Bound(l => l.RequestorName).Title("Requestor");
|
||||
columns.Bound(l => l.D1AssigneeName).Title("Assignee");
|
||||
columns.Bound(l => l.IssueDate).Format("{0:MM/dd/yy}");
|
||||
columns.Bound(l => l.CATitle);
|
||||
columns.Bound(l => l.StatusName);
|
||||
columns.Bound(l => l.PendingApprovers);
|
||||
columns.Bound(l => l.PendingAIOwners).Title("Action Item Owners");
|
||||
columns.Bound(l => l.D8DueDate).Format("{0:MM/dd/yy}");
|
||||
columns.Bound(l => l.ClosedDate).Format("{0:MM/dd/yy}");
|
||||
columns.Template(t => { }).HeaderTemplate("").ClientTemplate(@"<a href='javascript: void(0)' class='abutton delete' onclick='deleteRowCA(this)' title='button delete'>button delete</a>");
|
||||
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user