@model Com._9pm2.ClientWeb.Models.UDPModels
@{
    ViewBag.Title = "员工绩效明细";
}

<script src="~/Scripts/ordercommon.js?vn=20180813"></script>
<script src="../../Scripts/userdetailperformance.js?vn=20180813"></script>

<div id="dSearch" class="divSearch">
    <form method="post">
        <div style="width:100%">

            <span> @Html.DropDownList("sWorkFlowNo", new SelectList(Model.DdlWorkFlow, "ItemValue", "ItemText"))<span class="redStar"></span></span>
            @Html.DropDownList("sPaymentStatus", new SelectList(Model.DdlPaymentStatus, "ItemValue", "ItemText"))
            @Html.DropDownList("sUserId", new SelectList(Model.DdlUser, "ItemValue", "ItemText"))
            &nbsp;
            <span>
                交易日期：@Html.TextBox("sTBeginDate", null, new { maxlength = "50", @class = "text-date", placeholder = "" }) ~ @Html.TextBox("sTEndDate", null, new { maxlength = "50", @class = "text-date", placeholder = "" })&nbsp;&nbsp;

            </span>
            <span>
                完成日期：@Html.TextBox("sCBeginDate", null, new { maxlength = "50", @class = "text-date", placeholder = "" }) ~ @Html.TextBox("sCEndDate", null, new { maxlength = "50", @class = "text-date", placeholder = "" })&nbsp;&nbsp;

            </span>

            <button class="btn btn-default" id="btnSearch" onclick="return checkField();">搜索</button>
            <button class="btn btn-default" type="button" id="btnExportExcel">下载(Excel)</button>
        </div>

    </form>
</div>
<div class="error-msg"></div>
<div id="Statement">
    <div class="list" style="overflow:auto">

        <table id="tOrder" style="min-width:1000px;">
            <thead>
                <tr>
                    <th style="width:140px">订单编号</th>
                    <th style="width:120px">交易日期</th>
                    <th style="width:120px">完成日期</th>
                    <th style="width:200px">客户</th>
                    <th style="min-width:200px">订单名称</th>
                    <th style="width:80px">订单状态</th>
                    <th style="width:80px">支付状态</th>
                    <th style="width:80px">金额</th>
                    @foreach (var s in Model.Steps)
                    {
                        <th style="width:80px;">@s.WorkFlowStepName</th>
                    }

                </tr>
            </thead>
            <tbody>
                @foreach (var item in Model.List)
                {
                    <tr id="@item.OrderNo">
                        <td>@item.OrderNo</td>
                        <td>@item.TransactionDate.ToString("yyyy-MM-dd")</td>
                        <td>@(item.CompletionDate.HasValue ? item.CompletionDate.Value.ToString("yyyy-MM-dd") : "") </td>
                        <td>@item.CustomerName</td>
                        <td>@item.OrderName</td>
                        <td>
                            <span id="spanStatus">@item.OrderStatus</span>
                        </td>
                        <td>
                            <span id="spanPaymentStatus">@item.PaymentStatusDescription</span>
                        </td>
                        <td>@Com._9pm2.ClientWeb.Utilities.NFormat.Format(item.Amount)</td>
                        @foreach (var s in item.StepUsers)
                        {
                            <td>@s</td>
                        }

                    </tr>
                }
                @if (Model.List.Count > 0)
                {
                    <tr class="totalTd">
                        <td colspan="2">总计：@string.Format("{0}条记录", Model.TotalCount)</td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td class="oderAmountTotal">@Com._9pm2.ClientWeb.Utilities.NFormat.Format(Model.TotalAmount)</td>
                        @foreach (var s in Model.Steps)
                        {
                            <td></td>
                        }
                    </tr>
                }

            </tbody>
        </table>
    </div>
</div>

@Html.Partial("OrderDetail", Session["LoginUser"] as Com._9pm2.ClientWeb.Models.LoginUser)
<input type="hidden" id="OrderNo" />