channelUserList.html 11.1 KB
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8"/>
    <title>Yoho!Buy运营平台</title>
    <script src="/union/js/include.js"></script>
    <script src="/union/js/ajaxfileupload.js"></script>
</head>
<body class="easyui-layout" fit="true">
<div region="north" style="padding-bottom: 35px; height: auto;">
    <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">
        <form id="searchForm" method="post" accept-charset="utf-8">
        <input id="channelSourceCombobox" name="channelSource" class="easyui-combobox" data-options="
		valueField: 'id',
		editable: false,
		textField: 'text',
		data: [
            { id: '', text: '选择泛渠道来源' },
            { id: '5', text: '淘宝B店订单' },
            { id: '8', text: '淘宝C店订单' },
            { id: '9', text: '淘宝LAL店订单' },
            { id: '10', text: '一号店订单' },
            { id: '11', text: '京东订单' },
            { id: '12', text: '京东闪购店' },
            { id: '13', text: '京东LAL闪购店' },
            { id: '14', text: '物色' },
            { id: '15', text: 'bj天猫店' },
            { id: '16', text: 'intotherainbow旗舰店' },
            { id: '23', text: '苏宁' }
        ]"/>
        <input id="channelOrderCodeText" name="channelOrderCode" class="easyui-textbox" data-options="prompt:'泛渠道订单号'"/>
        <input name="beginChannelOrderTime" class="easyui-datetimebox" data-options="editable: false,showSeconds:false,prompt:'泛渠道订单开始时间'">
        <input name="endChannelOrderTime" class="easyui-datetimebox" data-options="editable: false,showSeconds:false,prompt:'泛渠道订单结束时间'">
        <input name="uid" class="easyui-textbox" data-options="prompt:'有货 UID'"/>
        <input name="hasUid" class="easyui-combobox" data-options="
		valueField: 'id',
		editable: false,
		textField: 'text',
		data: [
            { id: '', text: '是否有货会员' },
            { id: '1', text: '是' },
            { id: '0', text: '否' }
        ]"/>
        <input name="hasYHOrder" class="easyui-combobox" data-options="
		valueField: 'id',
		editable: false,
		textField: 'text',
		data: [
            { id: '', text: '是否存在有货订单' },
            { id: '1', text: '是' },
            { id: '0', text: '否' }
        ]"/>
        <input name="yhOrderCode" class="easyui-textbox" data-options="prompt:'有货订单号'"/>
        <input name="beginYHOrderTime" class="easyui-datetimebox" data-options="editable: false,showSeconds:false,prompt:'有货订单开始时间'">
        <input name="endYHOrderTime" class="easyui-datetimebox" data-options="editable: false,showSeconds:false,prompt:'有货订单结束时间'">
        <input name="unionCode" class="easyui-textbox" data-options="prompt:'渠道号'"/>
        <input name="userChannel" class="easyui-combobox" data-options="
		valueField: 'id',
		editable: false,
		textField: 'text',
		data: [
            { id: '', text: '注册终端' },
            { id: '0', text: 'PC' },
            { id: '1', text: 'WAP' },
            { id: '3', text: 'IOS' },
            { id: '4', text: 'Android' }
        ]"/>
        <input name="beginRegisterTime" class="easyui-datetimebox" data-options="editable: false,showSeconds:false,prompt:'注册开始时间'">
        <input name="endRegisterTime" class="easyui-datetimebox" data-options="editable: false,showSeconds:false,prompt:'注册结束时间'">
        <input name="beginSmsTime" class="easyui-datetimebox" data-options="editable: false,showSeconds:false,prompt:'短信发送开始时间'">
        <input name="endSmsTime" class="easyui-datetimebox" data-options="editable: false,showSeconds:false,prompt:'短信发送结束时间'">
        <a id="searchButton" class="easyui-linkbutton btn-info" data-options="iconCls:'icon-search'">查询</a>
        <a id="allButton" style="margin-left: 20px" class="easyui-linkbutton btn-primary" data-options="iconCls:'icon-more'">全部</a>
        <a id="exportButton" style="margin-left: 20px" class="easyui-linkbutton btn-primary" data-options="iconCls:'icon-more'">导出</a>
        <a id="exportAllButton" style="margin-left: 20px" class="easyui-linkbutton btn-primary" data-options="iconCls:'icon-more'">全部导出</a>
        <a id="createGroupButton" style="margin-left: 20px" class="easyui-linkbutton btn-primary" data-options="iconCls:'icon-more'">创建分组</a>
    </div>
    </form>
</div>
<div region="center">
    <div style="margin-left: 30px;margin-top: 20px; height: 500px;">
        <table id="consultTable"></table>
    </div>
</div>

<script type="text/javascript">
    var checkedItems = [];
    $(function () {
        // 列表
        var grid = $("#consultTable");
        grid.myDatagrid({
            fit: true,
            fitColumns: true,
            nowrap: false,
            url: contextPath + "/channel/user_list",
            method: 'POST',
            queryParams: getParams(),
            rownumbers: true,
            idField: "id",
            view: fileview,
            onCheckAll: addcheckItem,
            onCheck: addcheckItem,
            onUncheckAll: removeAllItem,
            onUncheck: removeSingleItem,
            loadFilter: function (data) {
                var temp = defaultLoadFilter(data);
                temp.rows = temp.list;
                return temp;
            },
            columns: [[{
                title: "全选",
                field: "id",
                idField:"id",
                width: 10,
                align: "center",
                checkbox: true
            }, {
                title: "手机号",
                field: "mobile",
                width: 80,
                align: "center"
            }, {
                title: "渠道来源",
                field: "channelSource",
                width: 100,
                align: "center"
            }, {
                title: "泛渠道购买次数",
                field: "channelPurchasesNumber",
                width: 80,
                align: "center"
            }, {
                title: "泛渠道最近订单",
                field: "channelOrderCode",
                width: 170,
                align: "center"
            }, {
                title: "泛渠道最近订单创建时间",
                field: "channelOrderTime",
                width: 80,
                align: "center"
            }, {
                title: "泛渠道订单金额",
                field: "channelOrderAmount",
                width: 80,
                align: "center"
            }, {
                title: "有货 UID",
                field: "uid",
                width: 170,
                align: "center"
            }, {
                title: "有货购买次数",
                field: "yhPurchasesNumber",
                width: 80,
                align: "center"
            }, {
                title: "有货最近订单",
                field: "yhOrderCode",
                width: 80,
                align: "center"
            }, {
                title: "有货最近订单金额",
                field: "yhOrderAmount",
                width: 80,
                align: "center"
            }, {
                title: "有货最近订单创建时间",
                field: "yhOrderTime",
                width: 80,
                align: "center"
            }, {
                title: "渠道号",
                field: "unionCode",
                width: 80,
                align: "center"
            }, {
                title: "注册终端",
                field: "userChannel",
                width: 80,
                align: "center"
            }, {
                title: "注册时间",
                field: "registerTime",
                width: 80,
                align: "center"
            }, {
                title: "短信次数",
                field: "smsNumber",
                width: 80,
                align: "center"
            }, {
                title: "最近一次短信时间",
                field: "smsTime",
                width: 80,
                align: "center"
            }]],
            cache: false,
            pagination: true,
            pageSize: 10,
            pageList: [10],
            idField: "id",
            singleSelect: false,
            checkOnSelect: false
        });

        function getParams() {
            var paramsArray = $("#searchForm").serializeArray();
            console.log(paramsArray);
            var params = {};
            for (var i = 0; i < paramsArray.length; i++ ) {
                params[paramsArray[i].name] = paramsArray[i].value;
            }
            return params;
        }

        $("#searchButton").linkbutton({
            onClick: function () {
                grid.datagrid('reload', getParams());
            }
        });

        $("#allButton").linkbutton({
            onClick: function () {
                window.location.reload();
            }
        });

        $("#exportButton").linkbutton({
            onClick : function() {
                if (checkedItems.length == 0) {
                    $.messager.alert('提示','请选择要导出的数据');
                    return;
                }
                var params = {"ids": checkedItems.toString() };
                window.open(contextPath + "/batch/export.do?type=channelUserServiceImpl&queryConf=" + JSON.stringify(params));
            }
        });

        $("#exportAllButton").linkbutton({
            onClick : function() {
                window.open(contextPath + "/batch/export.do?type=channelUserServiceImpl&queryConf=" + JSON.stringify(getParams()));
            }
        });



    });


    var fileview = $.extend({}, $.fn.datagrid.defaults.view, { onAfterRender: function (target) { isCheckItem(); } });


    function isCheckItem() {
        for (var i = 0; i < checkedItems.length; i++) {
            $("input[type='checkbox'][name='id'][value='"+checkedItems[i]+"']").attr("checked", "checked");
        }
    }

    function findCheckedItem(ID) {
        for (var i = 0; i < checkedItems.length; i++) {
            if (checkedItems[i] == ID) return i;
        }
        return -1;
    }

    function addcheckItem() {
        $("input[type='checkbox'][name='id']:checked").each(function () {
            var k = findCheckedItem($(this).val());
            if (k == -1) {
                checkedItems.push($(this).val());
            }
        });
    }

    function removeAllItem(rows) {
        $("input[type='checkbox'][name='id']").each(function () {
            if (!this.checked) {
                var k = findCheckedItem($(this).val());
                if (k != -1) {
                    checkedItems.splice(k, 1);
                }
            }
        });
    }

    function removeSingleItem(rowIndex, rowData) {
        var k = findCheckedItem(rowData.id);
        if (k != -1) {
            checkedItems.splice(k, 1);
        }
    }

</script>

</body>
</html>