@using PantheonRA.BackOffice;
@using PantheonRA.BackOffice.Models;
@using PantheonRA.WebApi.Contracts;
@using PantheonRA.WebApi.Contracts.Enums;

@model PantheonRA.WebApi.Contracts.PaWoExRegOper

@{
    ViewBag.Title = Loc.WOEditOperation;
    Model.CalendarQId = ViewBag.CalendarId;
    var _isMobile = Request.Browser.IsMobileDevice;

    List<string> workers = new List<string>();
    if (Model.Worker != null)
    {
        workers = Model.Worker.Split(',').Select(x => x.Trim()).ToList();
    }

    PaWoExItemResources WoExItemResurce = Model.WoExItem != null ? Model.WoExItem.WoExItemResources.FirstOrDefault(x => x.ResursID.Trim() == Model.ResursID.Trim()) : null;
    int resourceQID = WoExItemResurce.QId;

    double PlanQty = (Model.WoExItem != null) && (WoExItemResurce != null) ? (double)Model.WoExItem.WoEx.PlanQty * WoExItemResurce.ExecutionPerc / 100 : 0;
    double PlanTime = (Model.WoExItem != null) && (WoExItemResurce != null) ? WoExItemResurce.CTime : 0;
    double DoneQty = (Model.WoExItem != null) && (Model.WoExItem.WoExItemWork != null) ? (double)Model.WoExItem.WoExItemWork.Where(x => x.ResursID.Trim() == Model.ResursID.Trim()).Sum(p => p.Qty) : 0;
    double DoneTime = (Model.WoExItem != null) && (Model.WoExItem.WoExItemWork != null) ? (double)Model.WoExItem.WoExItemWork.Where(x => x.ResursID.Trim() == Model.ResursID.Trim()).Sum(p => p.Time) : 0;

    double RestQty = PlanQty - DoneQty;

    TimeSpan _planTime = TimeSpan.FromHours(PlanTime);
    var PlanTimeStr = Math.Floor(_planTime.TotalHours).ToString("00") + ":" + _planTime.Minutes.ToString("00") + ":" + _planTime.Seconds.ToString("00");

    TimeSpan _doneTime = TimeSpan.FromHours(DoneTime);
    var DoneTimeStr = Math.Floor(_doneTime.TotalHours).ToString("00") + ":" + _doneTime.Minutes.ToString("00") + ":" + _doneTime.Seconds.ToString("00");

    string ProductUM = Model.WoExItem != null ? Model.WoExItem.WoEx.UM : String.Empty;
    string timeUM = Model.WoExItem != null ? Model.WoExItem.UM : String.Empty;

    var _progressValue = _doneTime > _planTime ? 100 : ((_doneTime.TotalMilliseconds + Model.Milliseconds) / _planTime.TotalMilliseconds) * 100;
    var _progressPerc = _doneTime > _planTime ? "100%" : (((_doneTime.TotalMilliseconds + Model.Milliseconds) / _planTime.TotalMilliseconds) * 100).ToString("N0") + "%";

    var _class = _progressValue > 100 ? "bg-c-red" : "bg-c-green";

    var icon = String.Empty;
    var color = String.Empty;

    switch (Model.EventType)
    {
        case WorkRegEventType.OperationStart:
            icon = "fad fa-lg fa-play";
            color = "#7EAF3F";
            break;
        case WorkRegEventType.OperationPause:
            icon = "fad fa-lg fa-pause-circle";
            color = "goldenrod";
            break;
        case WorkRegEventType.OperationContinue:
            icon = "fad fa-lg fa-play-circle";
            color = "#7EAF3F";
            break;
        case WorkRegEventType.OperationEnd:
            icon = "fad fa-lg fa-stop-circle";
            color = "#BB5534";
            break;

        default:
            icon = "fa fa-clock-o";
            color = "#faaf14";
            break;
    }
}

<div class="wrapper wrapper-content">
    <div class="tabs-container">
        @Html.Partial("~/Views/Shared/_TabNavigation.cshtml", new TabNavigationViewModel
        {
           Tabs = new List<NavigationtabViewModel>
           {
                new NavigationtabViewModel(
                    Loc.ServiceDNList,
                    Url.Action("Index", "Service"),
                    Html.IsActive("Index", "Service"),
                    !CurrentUser.CanAccess(Permissions.PRODUCTION)),

                new NavigationtabViewModel(
                    Loc.WOProcessing_IssueMat,
                    Url.Action("WorkOrderMaterials", "Service", new { key = Model.AcKey}),
                    Html.IsActive("WorkOrderMaterials", "Service") || Html.IsActive("IssuingMaterial", "Service"),
                    !CurrentUser.CanAccess(Permissions.PRODUCTION)),

                new NavigationtabViewModel(
                    Loc.Tools,
                    Url.Action("ServicesTools", "Service", new { key = Model.AcKey}),
                    Html.IsActive("ServicesTools", "Service"),
                    !CurrentUser.CanAccess(Permissions.PRODUCTION)),

                new NavigationtabViewModel(
                    Loc.WOProcessing_CompletedWork,
                    Url.Action("WorkOrderOperations", "Service", new { key = Model.AcKey}),
                    Html.IsActive("WorkOrderOperations", "Service"),
                    !CurrentUser.CanAccess(Permissions.PRODUCTION)),

                new NavigationtabViewModel(
                    Loc.WorkRegistration,
                    null,
                    Html.IsActive("InputCompletedWork", "Service"),
                    !CurrentUser.CanAccess(Permissions.PRODUCTION)),
            }
        })

        @Html.HiddenFor(model => model.AcKey)
        @Html.HiddenFor(model => model.AnNo)
        @Html.HiddenFor(model => model.Ident)
        @Html.HiddenFor(model => model.UM)
        @Html.HiddenFor(model => model.EventType)
        @Html.HiddenFor(model => model.EventTypeCaption)
        @Html.HiddenFor(model => model.EventTime)
        @Html.HiddenFor(model => model.BeginTime)
        @Html.HiddenFor(model => model.Descr)
        @Html.HiddenFor(model => model.UM)
        @Html.HiddenFor(model => model.ResursID)
        @Html.HiddenFor(model => model.ParentWorker)
        @Html.HiddenFor(model => model.Priority)
        @Html.HiddenFor(model => model.CalendarQId)
        @Html.HiddenFor(model => model.Shift)
        @Html.HiddenFor(model => model.QId)
        @Html.HiddenFor(model => model.WoExItem.QId)
        @Html.HiddenFor(model => model.WoExItem.WoEx.PlanQty)
        @Html.HiddenFor(model => model.WoExItem.Variant)
        @Html.HiddenFor(model => model.UsedTime)

        @Html.Hidden("id-0", Model.WoExItem.WoEx.Ident)
        @Html.Hidden("quantity-0", 0)
        @Html.Hidden("serialNo-0", Model.WoExItem.WoEx.SerialNo)
        @Html.Hidden("serialNoType-0", "X")

        <div class="tab-content">
            <div class="row buttons-tabbed @(_isMobile ? "hidden" : "")">

                @Html.Partial("~/Views/Shared/_FormButtons.cshtml", new FormButtonsViewModel
               {
                   BackUrl = Url.Action("WorkOrderOperations", "Service", new { @key = Model.AcKey, @type = ViewBag.ProdType })
               })

            </div>

            <div class="row document-head  @(_isMobile ? "d-head-m-b-10" : "")">

                @* Operation *@
                <div class="col-sm-3 col-xs-4 document-head-disabled-input">
                    <div class="form-group">
                        @Html.LabelFor(model => model.Ident, Loc.Operation, new { @class = "control-label m-t-xs" })
                        @Html.TextBoxFor(model => model.Ident, new { @id = "ident", @class = "form-control" })
                    </div>
                </div>

                @* AcKey *@
                <div class="col-sm-3 col-xs-4 document-head-disabled-input">
                    <div class="form-group">
                        @Html.LabelFor(model => model.AcKey, Loc.Key, new { @class = "control-label m-t-xs" })
                        <input id="acKeyDisplay" class="form-control" type="text" value=" @Model.KeyView">
                    </div>
                </div>

                @* Position *@
                <div class="col-sm-3 col-xs-4 document-head-disabled-input">
                    <div class="form-group">
                        @Html.LabelFor(model => model.AnNo, Loc.Position, new { @class = "control-label m-t-xs" })
                        @Html.TextBoxFor(model => model.AnNo, new { @id = "no", @class = "form-control" })
                    </div>
                </div>

                @* Finish task *@
                @if (!_isMobile)
                {
                    <div class="col-sm-3 col-xs-4">
                        <div class="form-group">
                            <label class="control-label">@Loc.FinishTask</label>
                            <div class="hw-switch-m-l m-t-3">
                                <input type="checkbox" class="js-switch timeRecordsSwitch" id="finishOperation" />
                            </div>
                        </div>
                    </div>
                }

            </div>

            <div class="divided-content">
                <div class="divided-content-main @(_isMobile ? "divided-content-full no-padding" : "")">
                    <div class="project-list">
                        <div class="row form-horizontal col-lg-6 col-md-10" style="min-width:50vw">
                            <div class="card-work-reg-card col-xs-6">

                                @* Used / Planned time *@
                                <div class="card progress-card card-work-reg">
                                    <div class="card-header">
                                        <h3 class="card-title"><i class="fas fa-clock text-primary fa-lg m-r-sm"></i>@Loc.UsedTime/@Loc.Planned</h3>
                                    </div>
                                    <div id="stopwatch-card" class="card-body text-center m-t-md">
                                        <h3 style="color: @color">
                                            <i class="@icon fa-lg m-r-xs @(Model.EventType.IsEmpty() ? "hidden" : String.Empty)" style="color: @color;"></i>
                                            <span id="element">
                                                <span id="doneTime" style="font-size: 18px" class="@(!Model.EventType.IsEmpty() ? "hidden" : String.Empty)" onclick="editTime(this)">@DoneTimeStr</span>
                                            </span>
                                            <span id="stopwatch-div" class="@(Model.EventType.IsEmpty() ? "hidden" : String.Empty)">
                                                <span style="font-size: 18px" id="stopwatch" class="stopwatch">00:00:00</span>
                                            </span>
                                            <span id="planTime" style="font-size: 18px">/@PlanTimeStr</span>
                                        </h3>
                                    </div>
                                    <div class="m-t-md">
                                        <div class="progress">
                                            <div id="progress-bar" class="progress-bar @_class" style="width:@_progressPerc" aria-valuenow="@_progressValue" aria-valuemin="0" aria-valuemax="100"></div>
                                        </div>
                                    </div>
                                </div>

                            </div>

                            @if (!_isMobile)
                            {
                                @* Date *@
                                <div class="card-work-reg-card col-xs-6">
                                    <div class="card card-work-reg ">
                                        <div class="card-header">
                                            <h3 class="card-title"><i class="far fa-calendar-alt text-primary fa-lg m-r-sm"></i>@Loc.Date</h3>
                                        </div>
                                        <div class="card-body">
                                            <div class="input-group input-group-lg">
                                                <span class="input-group-addon"><i class="far fa-calendar alt"></i></span>
                                                @Html.TextBoxFor(model => model.Date, new { @id = "Date", @class = "form-control datepicker input-lg text-center", @type = "text", @Value = @DateTime.Now.Date.ToString(Loc.DateFormat) })
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            }

                            @* Good peices *@
                            <div class="card-work-reg-card col-xs-4">
                                <div class="card card-work-reg">
                                    <div class="card-header">
                                        <h3 class="card-title"><i class="fas fa-thumbs-up text-primary fa-lg m-r-sm"></i>@Loc.WOOperationGoodPcs</h3>
                                    </div>

                                    <div class="card-body">
                                        <div class="input-group input-group-lg">
                                            <span class="input-group-btn">
                                                <button id="b_dGoodPcs" type="button" class="btn btn-plus-minus"><i class="fa fa-minus fa-lg  text-primary"></i></button>
                                            </span>
                                            <input type="number" id="finished" required class="form-control col-md-8 text-center input-lg" onblur="changeQty(this.id, 'K')" autocomplete="off" min="0" />
                                            <span class="input-group-btn">
                                                <button id="b_iGoodPcs" type="button" class="btn btn-plus-minus"><i class="fa fa-plus fa-lg text-primary"></i></button>
                                            </span>
                                        </div>

                                        <div class="m-t-sm">
                                            <span>@Loc.Missing: <span class="font-bold">@(RestQty > 0 ? RestQty.ToString("0.###") : "0")</span></span>
                                            <span class="pull-right">@Loc.Planned: <span class="font-bold">@PlanQty.ToString("0.###")</span> </span>
                                        </div>
                                    </div>
                                </div>
                            </div>

                            @* Repair peices *@
                            <div class="card-work-reg-card  col-xs-4">
                                <div class="card card-work-reg">
                                    <div class="card-header">
                                        <h3 class="card-title"><i class="fas fa-wrench  text-primary fa-lg m-r-sm"></i>@Loc.WOOperationRepairPcs</h3>
                                    </div>

                                    <div class="card-body">
                                        <div class="input-group input-group-lg">
                                            <span class="input-group-btn">
                                                <button id="b_dRepairQty" type="button" class="btn btn-plus-minus"><i class="fa fa-minus fa-lg text-primary"></i></button>
                                            </span>
                                            <input type="number" id="repair" required class="form-control col-md-8 text-center input-lg" autocomplete="off" min="0" />
                                            <span class="input-group-btn">
                                                <button id="b_iRepairQty" type="button" class="btn btn-plus-minus"><i class="fa fa-plus fa-lg text-primary"></i></button>
                                            </span>
                                        </div>
                                    </div>
                                </div>
                            </div>

                            @* Scrap peices *@
                            <div class="card-work-reg-card  col-xs-4">
                                <div class="card card-work-reg">
                                    <div class="card-header">
                                        <h3 class="card-title"><i class="fas fa-times text-primary fa-lg m-r-sm"></i>@Loc.WOOperationScrapPcs </h3>
                                    </div>

                                    <div class="card-body">
                                        <div class="input-group input-group-lg">
                                            <span class="input-group-btn">
                                                <button id="b_dScrapPcs" type="button" class="btn btn-plus-minus"><i class="fa fa-minus fa-lg text-primary"></i></button>
                                            </span>
                                            <input type="number" id="scrap" required class="form-control col-md-8 text-center input-lg" onblur="changeQty(this.id, 'P')" autocomplete="off" min="0" />
                                            <span class="input-group-btn">
                                                <button id="b_iScrapPcs" type="button" class="btn btn-plus-minus"><i class="fa fa-plus fa-lg text-primary"></i></button>
                                            </span>
                                        </div>
                                    </div>
                                </div>
                            </div>

                            @if (_isMobile)
                            {
                                @* Date *@
                                <div class="col-xs-12 card-work-reg-card">
                                    <div class="card card-work-reg ">
                                        <div class="card-header">
                                            <h3 class="card-title"><i class="far fa-calendar-alt text-primary fa-lg m-r-sm"></i>@Loc.Date</h3>
                                        </div>

                                        <div class="card-body">
                                            <input id="Date" type="date" name="Date" class="input-lg text-center col-xs-12" value="@DateTime.Now.Date.ToString("yyyy-MM-dd")">
                                        </div>
                                    </div>
                                </div>
                            }

                            @* Note *@
                            <div class="card-work-reg-card @(_isMobile ? "hidden" : "")  col-xs-6">
                                <div class="card card-work-reg ">
                                    <div class="card-header">
                                        <h3 class="card-title"><i class="fas fa-comment text-primary fa-lg m-r-sm"></i>@Loc.Note</h3>
                                    </div>
                                    <div class="card-body">
                                        <textarea class="form-control" id="Note" name="Note" rows="3" maxlength="500"></textarea>
                                    </div>
                                </div>
                            </div>

                            @* Image *@
                            <div class="card-work-reg-card  col-xs-6">
                                <div class="card card-work-reg ">
                                    <div class="card-body text-center" style="height:100%">
                                        <img id="image" src="@ImageHelper.GetImageThumbnail(Model.WoExItem.WoEx.Picture, 200) " />
                                        <i id="noImage" class='fal fa-image fa-3x text-muted hidden' style='opacity:0.5'></i>
                                    </div>
                                </div>
                            </div>

                        </div>
                    </div>
                </div>
                <div class="divided-content-side" style="@(_isMobile ? "margin-top:-10px" : "margin-top:-22px")">
                    <div class="tabs-container">
                        <ul class="nav nav-tabs horizontal-menu" id="tabNav">
                            <li class="active divided-tab-1" id="homeTab">
                                <a id="tabCaption" data-toggle="tab" href="#item-options" class="local-tab">
                                    <span>@(_isMobile ? Loc.AdditionalSettings : Loc.WorkHistory)</span>
                                    <i class="far fa-times pull-right fa-lg text-muted btn-close-side-panel"></i>
                                </a>
                            </li>
                        </ul>
                    </div>
                    <div class="tab-content" id="sideNavBar">
                        <div id="item-options" class="tab-pane @(!_isMobile ? "hidden" : "")">
                            <div class="form-horizontal additonal-options">
                                @if (!PantheonRA.BackOffice.CurrentUser.CanAccess(Permissions.PRODUCTION))
                                {
                                    @* Work history *@
                                    <div class="row border-bottom p-l-10" id="work-history">
                                        <a data-toggle="tab" href="#work-reg-history">
                                            <h3 class="text-default"><i class="fas fa-history text-primary p-r-sm"></i>@Loc.WorkHistory</h3>
                                        </a>
                                    </div>
                                }

                                @* Note *@
                                <div class="row border-bottom p-l-10" id="note">
                                    <a data-toggle="tab" href="#note-div">
                                        <h3 class="text-default" data-toggle="tab"><i class="fas fa-comment text-primary p-r-sm"></i>@Loc.Note</h3>
                                    </a>
                                </div>

                                @* Materials for operation *@
                                <div class="row border-bottom p-l-10" id="operation-materials">
                                    <a data-toggle="tab" href="#materials-for-operations">
                                        <h3 class="text-default" data-toggle="tab"><i class='far fa-newspaper text-primary p-r-sm'></i>@Loc.MaterialsForOperation</h3>
                                    </a>
                                </div>

                                @* Confirm receive *@
                                <div class="row border-bottom p-l-10 hidden" id="confirm-receiving">
                                    <a data-toggle="tab">
                                        <h3 class="text-default" data-toggle="tab">
                                            <i class="fa fa-dolly text-primary p-r-sm"></i>@Loc.WOReceiving_ConfirmReceive
                                            <span class="hw-switch-m-l pull-right">
                                                <input type="checkbox" class="js-switch timeRecordsSwitch" id="confirmReceive" />
                                            </span>
                                        </h3>
                                    </a>
                                </div>

                                @* Finish task *@
                                <div class="row border-bottom p-l-10" id="finish-task">
                                    <a data-toggle="tab">
                                        <h3 class="text-default" data-toggle="tab">
                                            <i class="fa fa-check text-primary p-r-sm"></i>@Loc.FinishTask
                                            <span class="hw-switch-m-l pull-right">
                                                <input type="checkbox" class="js-switch timeRecordsSwitch" id="finishOperation" />
                                            </span>
                                        </h3>
                                    </a>
                                </div>

                            </div>
                        </div>

                        @* WoExItemWork table *@
                        <div id="work-reg-history" class="tab-pane m-l-n-sm m-r-n-sm  fade in active">
                            <table id="woExRegOperExp" data-grid-id="WoExRegOperExp" data-url="@Url.Action("WoExItemWork", "Service")" class="list-table">
                                <thead>
                                    <tr>
                                        <th>@Loc.Worker</th>
                                        <th>@Loc.TaBegin</th>
                                        <th class="dt-center">@Loc.Duration</th>
                                        <th>@Loc.StateOfPieces</th>
                                        <th>@Loc.Note</th>
                                    </tr>
                                </thead>
                            </table>
                        </div>

                        @* Note textarea *@
                        <div id="note-div" class="tab-pane @(!_isMobile ? "hidden" : "")">
                            <div class="form-horizontal m-t-lg">
                                <textarea class="form-control col-xs-10 input-lg" id="NoteOper" name="NoteOper" rows="6"></textarea>
                            </div>
                        </div>

                        @* MaterialsForOperationList table *@
                        <div id="materials-for-operations" class="tab-pane m-l-n-sm m-r-n-sm @(!_isMobile ? "hidden" : "")">
                            <table id="mainGridMaterials" data-grid-id="work-order-items" data-url="@Url.Action("MaterialsForOperationList", "Service")" class="card">
                                <thead style="display:none">
                                </thead>
                            </table>
                        </div>

                        @* Close button *@
                        <button type="button" class="btn btn-rounded btn-back btn-close-side-panel @(!_isMobile ? "hidden" : "")">
                            <i class="fas fa-chevron-left"></i>
                        </button>

                        @* Back button *@
                        <button type="button" class="btn btn-rounded btn-back btn-back-to-menu hidden">
                            <i class="fas fa-chevron-left"></i>
                        </button>

                    </div>
                </div>
            </div>
        </div>

        <div class="row document-footer @(_isMobile ? "hidden" : string.Empty)">

            @* Issued / Planned quantity *@
            <div class="col-lg-2 col-md-3 col-sm-4 document-head-disabled-input hidden-xs" title="@Loc.Total">
                <div class="form-group">
                    <label>@Loc.IssuedQty / @Loc.Planned</label><br />
                    <span class="timerecords-footer-left-span">@DoneQty.ToString("0.###")/@PlanQty.ToString("0.###") @ProductUM</span>
                </div>
            </div>

            @* Used / Planned time *@
            <div class="col-lg-2 col-md-3 col-sm-4 document-head-disabled-input hidden-xs">
                <div class="form-group">
                    <label>@Loc.UsedTime / @Loc.Planned</label><br />
                    <span class="timerecords-footer-left-span">@DoneTimeStr/@PlanTimeStr @timeUM</span>
                </div>
            </div>

            @* Worker *@
            <div class="col-md-2 col-xs-4" title="@Loc.Worker">
                <div class="form-group input-group-lg">
                    <label>@Loc.Worker</label><br />
                    <select id="Worker" name="Worker" class="form-control selectpicker @(!Model.EventType.IsEmpty() || Model.Worker == ViewBag.CurrentUser ? "hidden" : String.Empty) ">
                        @foreach (var item in workers)
                        {
                            <option value="@item"> @item </option>
                        }
                    </select>
                    <span class="timerecords-footer-left-span @(Model.EventType.IsEmpty() && (Model.Worker != ViewBag.CurrentUser) ? "hidden" : String.Empty)">@Model.Worker</span>
                </div>
            </div>
            @if (!_isMobile)
            {
                @Html.Partial("~/Views/Manufacturing/_WorkRegistrationButtons.cshtml", Model)
            }
        </div>
        @if (_isMobile)
        {
            @Html.Partial("~/Views/Manufacturing/_WorkRegistrationButtons.cshtml", Model)
        }
    </div>
</div>

<div class="modal inmodal fade" id="imageModal" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-body text-center">
                @Html.Image(ImageHelper.GetImageThumbnail(Model.WoExItem.WoEx.Picture, 400), "", new { id = "image" })
                <i id="noImage" class='fal fa-image fa-3x text-muted hidden' style='opacity:0.5'></i>
            </div>
            <div class="modal-footer" style="text-align:center !important;">
                <button type="button" class="btn btn-primary  btn-rounded" data-dismiss="modal">@Loc.Close</button>
            </div>
        </div>
    </div>
</div>

<div class="modal inmodal fade" id="note-modal" tabindex="-1" role="dialog" aria-hidden="true" data-new-row="false">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="pn-modal-title">@Loc.Note</h4>
            </div>
            <div class="modal-body">
                <form>
                    <div class="form-group">
                        <textarea class="form-control" id="modalNote" name="modalNote" rows="3" maxlength="500"></textarea>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" id="modalSave" class="btn btn-primary" data-dismiss="modal">@Loc.Save</button>
                <button type="button" id="modalClose" class="btn btn-primary" data-dismiss="modal">@Loc.Close</button>
            </div>
        </div>
    </div>
</div>

@{Html.RenderPartial("~/Views/Shared/Components/_IdentSerialNoModal.cshtml");}

@section pageScripts{
    @Scripts.Render("~/bundles/services")
    <script>
        $(document).ready(function () {
            initializeWorkRegistrationSvc({
                ok: '@Loc.OK',
                successWorkMsg: '@Loc.SuccessWorkMsg',
                requiedQty: '@Loc.RequiredInput @Loc.UsedTime',
                requiedWorker: '@Loc.RequiredInput @Loc.Worker',
                yes: '@Loc.Yes',
                no: '@Loc.No',
                questionText: '@Loc.FinishOperationTracking',
                notEmployeeText: '@Loc.EmployeeWorkTracking',
                confirm: '@Loc.Confirm',
                cancel: '@Loc.Cancel'
            },
            {
                createEvent: '@Url.Action("WorkReg", "Service")',
                confirmOperWork: '@Url.Action("ConfirmOperWork", "Service")',
                confirmOperation: '@Url.Action("ConfirmOper", "Service")',
                deleteOperWork: '@Url.Action("DeleteOperWork", "Service")'
            },
            {
                resourceQId:@resourceQID,
                prodType: '@ViewBag.ProdType',
                woExDecPlacesOper: '@ViewBag.WoExDecPlacesOper',
            });
        });
    </script>
}

@section pageCss{
    <style>
        input::-webkit-outer-spin-button,
        input::-webkit-inner-spin-button {
            -webkit-appearance: none;
            margin: 0;
        }

        input[type=number] {
            -moz-appearance: textfield;
        }
    </style>
}
