@model Com._9pm2.ClientWeb.Models.MyOrders
@{
    ViewBag.Title = "已处理订单";
}

<div class="callout callout-success lead ">提示：负责的步骤已处理完成，处于流转中的未完工订单。显示最近50条纪录。</div>

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

<div class="divSearch">
    <form method="post" action="/MySpace/ProcessedOrder">
        @Html.DropDownList("sWorkFlow", new SelectList(Model.DdlWorkFlow, "ItemValue", "ItemText"))
        @Html.DropDownList("sStatus", new SelectList(Model.DdlStatus, "ItemValue", "ItemText"))
        <div class="div-search-select2">
            @Html.DropDownList("sCustomerNo", new SelectList(Model.DdlCustomer, "ItemValue", "ItemText"))
        </div>
        <button class="btn btn-default">搜索</button>
    </form>
</div>

<div class="list">
    <table id="tOrder">
        <thead>
            <tr>
                <th style="width:100px">交易日期</th>
                <th style="min-width:100px">客户</th>
                <th>订单名称</th>
                <th>明细</th>
                <th style="min-width:80px">订单状态</th>
                <th style="min-width:100px">流程</th>
                <th style="min-width: 60px">
                    附件
                </th>
                <th style="width:100px">操作</th>
            </tr>
        </thead>
        <tbody class="spanTbody">
            @{
                int j = 0;

                foreach (var item in Model.InvolvedgOrders)
                {
                    int i = 0;

                    string className = j % 2 == 0 ? "odd" : "even";

                    foreach (var o in item.Details)
                    {
                        if (i == 0)
                        {
                            <tr id="@item.OrderNo" class="@className">

                                <td rowspan="@item.Details.Count">
                                    @item.TransactionDate.ToString("yyyy-MM-dd")
                                </td>
                                <td rowspan="@item.Details.Count">
                                    @Html.DisplayFor(modelItem => item.CustomerShortName)
                                </td>

                                <td>@o.OrderName</td>

                                <td>
                                    <b>@o.CategoryName</b>
                                    @o.DetailText@(string.IsNullOrEmpty(o.Memo) ? "" : " 备注: " + o.Memo)
                                </td>

                                <td rowspan="@item.Details.Count">
                                    @item.StatusDescription
                                </td>

                                <td rowspan="@item.Details.Count">
                                    @Html.DisplayFor(modelItem => item.WorkFlowName)
                                    <input type="hidden" value="@item.WorkFlowNo" />
                                </td>


                                <td class="td-img" rowspan="@item.Details.Count">
                                    @if (item.AttachmentNumber > 0)
                                    {
                                        <img src="~/Images/grid/x.png" />
                                    }
                                </td>
                                <td rowspan="@item.Details.Count" class="td-last text-center">
                                    <a href="javascript:void(0);" onclick="ShowAttachment('@item.OrderNo')">上传附件</a>

                                </td>
                            </tr>
                        }
                        else
                        {
                            <tr id="@item.OrderNo" class="@className">
                                <td>@o.OrderName</td>
                                <td>
                                    <b>@o.CategoryName</b>
                                    @o.DetailText@(string.IsNullOrEmpty(o.Memo) ? "" : " 备注: " + o.Memo)
                                </td>

                            </tr>
                        }

                        i++;
                    }

                    j++;
                }
            }

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

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