@using PantheonRA.WebApi.Contracts

@model PaWoEx

<div class="wrapper wrapper-content">
    <div class="tabs-container">
        @Html.Partial("_ProcessingTabNavigation")
        <div class="tab-content">
            @Html.HiddenFor(model => model.AcKey)
            <div class="row document-head d-head-m-b-0">
                <div class="col-xs-6 document-head-disabled-input">
                    <div class="form-group">
                        @Html.LabelFor(model => model.AcKey, Loc.Number, new { @class = "control-label m-t-xs" })
                        <input class="form-control" id="acKeyDisplay" disabled="disabled" type="text" value=" @Model.KeyView">
                    </div>
                </div>
                <div class="col-xs-6 document-head-disabled-input">
                    <div class="form-group">
                        @Html.Label(Loc.Product, new { @class = "control-label" })
                        <input type="text" disabled="disabled" class="form-control" style="overflow:hidden;text-overflow:ellipsis" id="ident" value="@Model.Ident - @Model.Name" />
                    </div>
                </div>
            </div>

            <div class="divided-content">
                <div class="divided-content-full no-padding">

                    <div class="document-list-no-footer">
                        <table id="mainGridProcessing" data-grid-id="work-order-items" data-url="@Url.Action("WorkOrderItemList", "Manufacturing")" class="card">
                            <thead style="display:none">
                            </thead>
                        </table>
                    </div>

                        <a href="@Url.Action("Index", "Manufacturing", new { type = ViewBag.ProdType })" id="back" class="btn btn-light btn-rounded btn-back m-l-sm">
                            <i class="fas fa-chevron-left"></i>
                        </a>
                        <a href="@Url.Action("Receive", "Manufacturing", new { @id = Model.AcKey, type = ViewBag.ProdType })" id="receiving" class="btn btn-success pull-right btn-rounded btn-receiving">
                            <i class="fa fa-dolly"></i><span class="m-l-xs">@Loc.Receive</span>
                        </a>

                </div>

            </div>
        </div>

    </div>
</div>

<input type="hidden" id="itemType" value="@ViewBag.ItemType" />
<input type="hidden" id="prodType" value="@ViewBag.ProdType" />
<input type="hidden" id="operationCaption" value="@Loc.Operation" />
<input type="hidden" id="materialCaption" value="@Loc.MaterialEnum" />
<input type="hidden" id="operationStart" value="@Loc.OperationStart" />
<input type="hidden" id="operationPause" value="@Loc.OperationPause" />
<input type="hidden" id="operationContinue" value="@Loc.OperationContinue" />
<input type="hidden" id="operationEnd" value="@Loc.OperationEnd" />
<input type="hidden" id="workRegistration" value="@Loc.WorkRegistration" />
<input type="hidden" id="materialsForOperation" value="@Loc.MaterialsForOperation" />
<input type="hidden" id="operMatURL" value="@Url.Action("MaterialsForOperationList", "Manufacturing")" />
<input type="hidden" id="operRegURL" value="@Url.Action("GetActiveWoExRegOper", "Manufacturing")" />

@section pageScripts{
    @Scripts.Render("~/bundles/manufacturing")
    <script>
        $(document).ready(function () {
            if ($("#itemType").val() === "S") {
                initializeWorkOrderOperationsMobile();
            }
            else {
                initializeWorkOrderMaterialsMobile();
            }

        });
    </script>

}
