userCoupon.html 3.82 KB
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8"/>
    <title>Yoho!Buy运营平台</title>
    <script src="/ufoPlatform/js/include.js"></script>
    <script src="/ufoPlatform/js/ajaxfileupload.js"></script>
</head>
<body class="easyui-layout" fit="true">
<div region="north" style="height: 230px">
    <script>
        document.write(addHead('用户用券查询', ''));
    </script>
    <style>
        .div_search input {
            margin-top: 20px;
        }

        .div_search .textbox {
            margin-top: 20px;
        }

        .div_search .easyui-linkbutton {
            margin-top: 20px;
        }
    </style>
    <div style="margin-left: 30px;" class="div_search">
        <input id="couponCode" type="text">
        <input id="uid" type="text">
        <a id="searchLinkButton" class="easyui-linkbutton btn-info" data-options="iconCls:'icon-search'">筛选</a>
    </div>
</div>
<div region="center">
    <div style="margin-left: 30px;margin-top: 20px;height: 660px">
        <table id="couponTable"></table>
    </div>
</div>

<script type="text/javascript">
    $(function () {
        $("#uid").textbox({
            prompt: "UID"
        });
        $("#couponCode").textbox({
            prompt: "单券号"
        });
        $("#couponTable").myDatagrid({
            fit: true,
            fitColumns: true,
            nowrap: false,
            url: contextPath + "/coupon/queryUserCouponList",
            method: 'POST',
            loadFilter: function (data) {
                var temp = defaultLoadFilter(data);
                temp.rows = temp.list;
                return temp;   //couponAmount
            },
            columns: [[{
                title: "UID",
                field: "uid",
                width: 40,
                align: "center"
            },{
                title: "优惠券ID",
                field: "couponId",
                width: 40,
                align: "center"
            },{
                title: "单券号",
                field: "couponCode",
                width: 100,
                align: "center"
            },{
                title: "订单号",
                field: "orderCode",
                width: 80,
                align: "center"
            }, {
                title: "优惠券名称",
                field: "couponName",
                width: 40,
                align: "center"
            },{
                title: "使用期限",
                field: "limitTime",
                width: 80,
                align: "center"
            }, {
                title: "状态",
                field: "statusValue",
                width: 50,
                align: "center",
                formatter: function (value, rowData) {
                    return value == 1 ? '已使用' : '未使用';
                }
            }]],
            cache: false,
            pagination: true,
            pageSize: 10,
            pageList: [10],
            idField: "id",
            singleSelect: false,
            checkOnSelect: false,
            onLoadSuccess: function () {}
        });


        // 搜索
        $("#searchLinkButton").linkbutton({
            onClick: function () {
                var param = getParams();
                $("#couponTable").myDatagrid("load", param);
            }
        });

        /**
         * 提取出搜索参数
         */
        function getParams() {
            var uid = $('#uid').textbox('getText');
            var couponCode = $('#couponCode').textbox('getText');
            var param = {};
            if (undefined !== uid && null !== uid && "" !== uid) {
                param.uid = uid;
            }
            if (undefined !== couponCode && null !== couponCode && "" !== couponCode) {
                param.couponCode = couponCode;
            }
            return param;
        }
    });


</script>

</body>
</html>