unionShareOrdersMonthList.html 6.35 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('CPS联盟管理', 'CPS联盟用户'));
    </script>
    <form id="searchForm" method="post" accept-charset="utf-8">
        <div style="margin-left: 10px;margin-top: 10px">
            <label>用户ID:</label>
            <input class="easyui-textbox" id="uid" name="uid"/>
            <label>用户代码:</label>
            <input class="easyui-textbox" id="alias" name="alias"/>
            <label>用户类型:</label>
            <input class="easyui-combobox" id="type" name="type"
                   data-options="valueField: 'value',
		                        textField: 'label',
		                        data: [{
			                      label: '联盟用户',
			                      value: '1'
		                          },{
			                      label: '马甲用户',
			                      value: '2'
		                          }]">
            </input>
            <label>查询月份:</label>
            <input class="easyui-textbox" id="beginDate" name="beginDate" data-options="prompt:'格式:201808'"/>~&nbsp;&nbsp;
            <input class="easyui-textbox" id="endDate" name="endDate" data-options="prompt:'格式:201808'"/>
            <a id="searchBtn" style="margin-left: 20px" class="easyui-linkbutton btn-primary" data-options="iconCls:'icon-more'">查询</a>
            <a id="importButton" style="margin-left: 20px" class="easyui-linkbutton btn-primary" data-options="iconCls:'icon-more'">导入马甲数据</a>
            <a id="randomButton" 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="userListTable"></table>
    </div>
</div>
<script type="text/javascript">
    $(function () {

        $("#userListTable").myDatagrid({
            fit: true,
            fitColumns: true,
            nowrap: false,
            url: contextPath + "/UnionShareRest/queryUnionShareOrdersMonthList",
            method: 'POST',
            loadFilter: function (data) {
            	var temp = defaultLoadFilter(data);
                temp=null==temp?[]:temp;
                temp.rows = temp.list;
                return temp;
            },
            columns: [[{
                title: "ID",
                field: "id",
                width: 200,
                align: "center",
            }, {
                title: "用户UID",
                field: "uid",
                width: 200,
                align: "center"
            }, {
                title: "用户代码",
                field: "alias",
                width: 200,
                align: "center"
            }, {
                title: "昵称",
                field: "nickname",
                width: 200,
                align: "center"
            }, {
                title: "头像",
                field: "image",
                width: 200,
                align: "center",
                formatter : function(value, rowData, rowIndex) {
                    var newData = JSON.stringify(rowData);
                    var imgstr="<a href='"+rowData.image+"'><img src='"+rowData.image+"' height='78px;' width='59px;' /></a>";
                    return imgstr;
                }
            }, {
                title: "年月",
                field: "date",
                width: 200,
                align: "center"
            }, {
                title: "预估收入",
                field: "amount",
                width: 200,
                align: "center"
            }, {
                title: "订单数",
                field: "orderNum",
                width: 200,
                align: "center"
            }
            ]],
            cache: false,
            pagination: true,
            pageSize: 10,
            idField: "id",
            singleSelect: false,
            onLoadSuccess: function (data) {

            }
        });


        $("#searchBtn").linkbutton({
            iconCls : "icon-search",
            onClick : function() {
            	var beginDate = $("#beginDate").val();
            	var endDate = $("#endDate").val();
            	var reg = /^\d{6}$/;
            	if((beginDate !='' && !reg.test(beginDate)) || (endDate !='' && !reg.test(endDate))){
            		alert("时间格式错误!");
            		return;
            	}
            	$("#userListTable").datagrid("load", {
            		uid:$("#uid").val(),
                    alias:$("#alias").val(),
                    beginDate: beginDate,
                    endDate: endDate,                 
                    type :$("#type").combobox('getValue'),
                });
            }
        });
        
        $("#importButton").linkbutton({
            text: "导入马甲数据",
            iconCls: "icon-add",
            onClick: function () {
                batchImportDialog();
            }
        });

        $("#randomButton").linkbutton({
            onClick : function() {
                $.get(contextPath + "/UnionShareRest/addVirtual", function (res) {
                    $.messager.progress("close");
                    if (res.code == 200) {
                        $.messager.show({
                            title: "提示",
                            msg: "将于早上八点增加马甲用户的预估收入",
                            height: 120
                        });
                    } else {
                        $.messager.alert("失败", res.message, "error");
                    }
                }, "json");
            }
        });
        
        function batchImportDialog() {
            var div = $("<div id='batchImportDialogDiv'>").appendTo($(document.body));
            $(div).myDialog({
                width: "600px",
                height: "60%",
                href: contextPath + "/html/unionshare/unionShareOrdersMonthImport.html",
                modal: true,
                collapsible: true,
                cache: false
            });
        }

    });
</script>
</body>
</html>