@model string
<div class="current-location">
    <ul>
        <li class="left"><i class="glyphicon glyphicon-home"></i><a href="javascript:void(0)" onclick="location.href=location.href">订单管理</a></li>
        <li class="right"><a href="javascript:void(0)" onclick="LoadData()" title="刷新"><span class="glyphicon glyphicon-refresh"></span></a></li>
    </ul>
</div>
<div class="main">
    <div class="control-group clearfix">
        <div class="btn-group left">
            <button type="button" class="btn btn-default btn-sm ui-selectInvert">反选</button>
            <div class="btn-group btn-group-sm">
                <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
                    菜单<span class="caret"></span>
                </button>
                <ul class="dropdown-menu" role="menu">
                    <li><a href="javascript:void(0)" class="ui-setField" data-custom-params="url:'@Url.Action("SetField")',setField:'pay_state',setValue:'1'">转为已付款</a></li>
                    <li><a href="javascript:void(0)" class="ui-setField" data-custom-params="url:'@Url.Action("SetField")',setField:'pay_state',setValue:'0'">转为未付款</a></li>
                    <li class="divider"></li>
                    <li><a href="javascript:void(0)" class="ui-setField" data-custom-params="url:'@Url.Action("SetField")',setField:'send_state',setValue:'1'">转为已确认</a></li>
                    <li><a href="javascript:void(0)" class="ui-setField" data-custom-params="url:'@Url.Action("SetField")',setField:'send_state',setValue:'0'">转为未确认</a></li>
                    <li class="divider"></li>
                    <li><a href="javascript:void(0)" class="ui-deleteMultiple" data-custom-params="url:'@Url.Action("Delete")'">删除</a></li>
                </ul>
            </div>
        </div>
        <div class="right form-inline form-group-sm controls">
            <select id="sended" class="form-control ui-queryString option_jj">
                <option value="">所有订单</option>
                <option value="nopay">未付款</option>
                <option value="nosend">未确认</option>
            </select>
            <select id="order" class="form-control ui-queryString option_jj">
                <option value="thedate desc">按提交时间↓</option>
                <option value="thedate asc">按提交时间↑</option>
            </select>
            <input type="text" id="startdate" maxlength="19" style="width:105px" placeholder="开始日期" onclick="laydate({istime:true,format:'YYYY-MM-DD'})" class="laydate-icon form-control ui-queryString">
            <input type="text" id="Enddate" maxlength="19" style="width:105px" placeholder="结束日期" onclick="laydate({istime:true,format:'YYYY-MM-DD'})" class="laydate-icon form-control ui-queryString">
            <select id="sended" class="form-control ui-queryString option_jj ui-setName">
                <option value="order_id">订单号</option>
                <option value="username">会员名</option>
            </select>
            <input type="text" class="form-control ui-queryString ui-keyword" placeholder="请输入关键词" style="width:110px;"/>
            <button type="button" class="btn btn-default btn-sm ui-queryString-search">确定</button>
            <span class="help-block"></span>
        </div>
    </div>
    <table border=0 cellpadding=0 cellspacing=0 width=100% class="table table-bordered" id="tb_list">
        <thead><tr>
            <td align="center" style="width:30px;"><input type="checkbox" title="选择" class="ui-selectInvert" data-custom-params="isReverse:false"></td>
            <td align="center">订单号</td>
            <td align="center">会员名</td>
            <td align="center">订单总额</td>
            <td align="center">订购日期</td>
            <td align="center">付款状态</td>
            <td align="center">订单确认</td>
            <td align="center">操作员</td>
            <td align="center">操作</td>
        </tr>
        <tr class="item" id="item_{id}">
            <td align="center"><input type="checkbox" id="id" name="id" value="{id}"></td>
            <td align=left>{order_id}</td>
            <td align="center">
                <span class="ui-convertTextById Member" data-custom-params="url:'@Url.Action("GetFieldByIds", "Member")',textField:'username'">{uid}</span>
            </td>
            <td align="center">￥{lb_TotalAmount}</td>
            <td align="center">{thedate}</td>
            <td align="center" class="pay_state">{pay_state}</td>
            <td align="center" class="send_state">{send_state}</td>
            <td align="center">
                <span class="ui-convertTextById operator" data-custom-params="url:'@Url.Action("GetFieldByIds", "Member")',textField:'username'">{operator}</span>
            </td>
            <td align="center">
                <div class="btn-group btn-group-sm">
                    <a href="javascript:void(0)" class="btn btn-default btn-sm ui-dialog" data-custom-params="title:'查看详细信息',url:'@Url.Action("OrderInfo")?username={username}',width:'80%',height:'95%',target:'_self'">查看</a>
                    <a href="javascript:void(0)" class="btn btn-default btn-sm ui-deleteSingle" data-custom-params="url:'@Url.Action("Delete")',id:'{id}'">删除</a>
                </div>
            </td>
        </tr>

    </table>
</div>

<script type="text/javascript">
    function LoadData()
    {
        var url = "@Url.Action("PageListData")"
        $("#tb_list").ListBind(url, {callBack: "LoadedInit" });
        ConvertText($(".Member"));
        ConvertText($(".operator"));
        
        Replace(".pay_state", "未付款", "已付款")
        Replace(".send_state", "未确认", "已确认")
    }
    LoadData();
</script>