@model Com._9pm2.ClientWeb.Model.UserPerformanceReport
@{
    ViewBag.Title = "员工工作量";
}
<script src="../../Scripts/userperformance.js?vn=20180813"></script>
<style>
    th, td {
        height: 24px;
        padding-left: 5px !important;
    }
    h3 {
        border-bottom: 2px solid #3c8dbc;
        padding-bottom: 10px;
        margin-top: 0;
    }

    h4 {
        margin-top: 20px;
    }

    .list {
        margin-bottom: 20px;
        padding: 10px 10px 10px 10px;
        background-color: white;
        box-sizing: border-box;
    }
</style>

<div class="callout callout-warning lead ">提示：包含统计协作者时，订单金额和毛利会出现重复统计</div>
<form method="post">
    <div class="divSearch" id="dSearch">
        <div>
            @Html.TextBox("CBeginDate", null, new { maxlength = "50", @class = "text-date", placeholder = "完工日期" }) ~ @Html.TextBox("CEndDate", null, new { maxlength = "50", @class = "text-date", placeholder = "完工日期" })&nbsp;&nbsp;
            @Html.TextBox("TBeginDate", null, new { maxlength = "50", @class = "text-date", placeholder = "交易日期" }) ~ @Html.TextBox("TEndDate", null, new { maxlength = "50", @class = "text-date", placeholder = "交易日期" })&nbsp;&nbsp;
            @Html.CheckBox("CalCooperator") 包含统计协作者
            <button class="btn btn-default" id="btnSearch" onclick="return search()">搜索</button>
        </div>
    </div>
</form>

@if (Model.Groups.Count == 0)
{
    <div id="chart-no-data">很抱歉，此时间段无数据。</div>
}


@foreach (var group in Model.Groups)
{
    <div class="list">
        <h3>@group.WorkFlowName</h3>

        @foreach (var subGroup in group.SubGroups)
        {
            <h4>@subGroup.StepName</h4>

            <table id="tReport">
                <thead>
                    <tr>
                        <th style="width:15%">员工姓名</th>
                        <th style="width:25%">订单数量</th>
                        <th style="width:30%">订单金额</th>
                        <th style="width:30%">订单毛利（需要核算订单成本）</th>
                    </tr>
                </thead>
                <tbody>

                    @foreach (var d in subGroup.Items)
                    {
                        <tr>
                            <td>@d.UserName</td>
                            <td>@d.Number &nbsp;（@string.Format("{0:P}", d.NumberPercent)）</td>
                            <td>@d.Amount &nbsp;（@string.Format("{0:P}", d.AmountPercent)）</td>
                            <td>@d.Profit &nbsp;（@string.Format("{0:P}", d.ProfitPercent)）</td>
                        </tr>
                    }

                </tbody>
            </table>

        }
    </div>
}
 