list.html 5.09 KB
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8"/>
    <title>Yoho!Buy运营平台</title>
    <script src="/ufoPlatform/js/include.js"></script>
</head>
<body class="easyui-layout">
<input type="hidden" id="buyerOrderCode">
<input type="skup" id="skup">
<div region="north" style="height:180px;">
    <script>
        document.write(addHead('打款管理', '列表管理'));
    </script>

    <div style="padding:20px;">
        <label>订单编号:</label>
        <input id="orderCode" type="text" class="easyui-textbox" style="width:150px">

        <label>UID:</label>
        <input id="uid" type="text" class="easyui-textbox" style="width:150px"/>

        <label>手机号:</label>
        <input id="mobile" type="text" class="easyui-textbox" style="width:150px"/>

        <label>订单状态:</label>
        <select id="status" class="easyui-combobox" style="width:100px;"  >
            <option value="">全部状态</option>
            <option value="100">打款成功</option>
            <option value="999">打款失败</option>
        </select>

        <a id="searchBtn" class="btn-info">查询</a>
        <!--<a id="allBtn" class="btn-success">全部</a>-->
    </div>
</div>

<div id="tradeBillsList" region="center">
	<table id="tradeBillsListTable"></table>
</div>
<script>
$(function() {
    $("#status").combobox({
        panelHeight:'auto',
        multiple:false,
    });

	$("#searchBtn").linkbutton({
        iconCls : "icon-search",
        onClick : function() {
            /*if(!$("#orderCode").val()
                && !$("#uid").val()
                && !$("#mobile").val()){
                $.messager.alert("提示","请录入查询条件<br/>[订单编号、UID、手机号]至少选择一个!");
                $("#orderCode").focus();
                return;
            }*/

            $("#tradeBillsListTable").datagrid("load", {
            	status : $("#status").myCombobox("getValue"),
                orderCode : $("#orderCode").val(),
                uid : $("#uid").val(),
                mobile : $("#mobile").val()
            });
        }
    });

    //全部按钮
   /* $("#allBtn").linkbutton({
        iconCls: "icon-import",
        onClick: function () {
            $("#orderCode").textbox('setValue','');
            $("#status").combobox('setValue','');
            //$("#uid").textbox('setValue','');
            $("#mobile").textbox('setValue','');
            $("#orderListTable").datagrid("load", {
            });
        }
    });*/
    
    getTradeBillsList();
});

function getTradeBillsList(){
	$("#tradeBillsListTable").myDatagrid({
        fit: true,
        fitColumns: true,
        striped: true,
        url: contextPath + "/tradeBills/queryTradeBillsList",
        method: 'POST',
        queryParams: {},
        loadFilter: function (data) {
        	var temp = defaultLoadFilter(data);
            temp=null==temp?[]:temp;
            temp.rows = temp.list;
            return temp;
        },

        columns: [[{
            title: "订单编号",
            field: "orderCode",
            width: 30,
            align: "center"
        },{
            title: "打款金额",
            field: "amount",
            width: 30,
            align: "center"
        },{
            title: "用户uid",
            field: "uid",
            width: 30,
            align: "center"
        },{
            title: "用户手机号",
            field: "mobile",
            width: 30,
            align: "center"
        } ,{
            title: "打款时间",
            field: "createTimeStr",
            width: 20,
            align: "center"
        },{
            title: "操作员",
            field: "operatorName",
            width: 20,
            align: "center"
        },{
            title: "订单状态",
            field: "tradeStatus",
            width: 20,
            align: "center",
            formatter: function (value, rowData, rowIndex) {
                if (value == 100) {
                    return "打款成功";
                }else {
                    return "<span style='color: red'>打款失败</span>";
                }
            }
        }, {
            title: "原因",
            field: "tradeStatusDesc",
            width: 20,
            align: "center"
        }, {
            title: "操作",
            field: "asdf",
            width: 40,
            align: "center",
            formatter: function (value, rowData, rowIndex) {
            	if (rowData.tradeStatus != 100) {
                    return "<a role='refundsConfirm' dataId='"+ rowData.id +"' style='margin-left:10px;background-color: #5cb85c !important;'>打款</a>";
                }
            }
        }]],
        cache: false,
        pagination: true,
        //pageSize: 20,
        idField: "id",
        singleSelect: true,
        onLoadSuccess: function (data) {
            $(this).datagrid("getPanel").find("a[role='refundsConfirm']").linkbutton({
                onClick: function () {
                    var id = $(this).attr("dataId");
                    alert("开发中。。");
                }
            });
        }
    });
}

</script>
</body>
</html>