e158181fb05bc14213ce5d24d91932ab.php 12.7 KB
<?php if (!defined('THINK_PATH')) exit(); /*a:1:{s:56:"E:\WWW\sos\public/../application/web\view\role\index.php";i:1623205037;}*/ ?>
<!DOCTYPE html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd">
<html>
<head>
    <meta charset="UTF-8">
    <title>管理员列表</title>
    <link rel="stylesheet" type="text/css" href="/assets/common/css/themes/gray/easyui.css" />
	<link rel="stylesheet" type="text/css" href="/assets/common/css/themes/gray/menu.css" />
    <link rel="stylesheet" type="text/css" href="/assets/common/css/themes/icon.css" />
	<link rel="stylesheet" type="text/css" href="/assets/web/css/jitnry.css" />
	<link rel="stylesheet" type="text/css" href="/assets/web/css/common_car.css" />
    <script type="text/javascript" src="/assets/common/js/jquery.min.1.9.4.js"></script>
	<script type="text/javascript" src="/assets/common/js/jquery.easyui.min.1.9.4.js"></script>
    <script type="text/javascript" src="/assets/common/js/jquery.cookie.1.4.1.js"></script>
	<!-- 插件调用 --->
	<script type="text/javascript" src="/assets/common/js/datagrid-detailview.js"></script>
	<script type="text/javascript" src="/assets/common/locale/easyui-lang-zh_CN.js"></script>
	<!-- 基础 JS 调用 -->
	<script type="text/javascript" src="/assets/web/js/src/easyui.base.js"></script>
	<script type="text/javascript" src="/assets/web/js/src/allCity.js"></script>
    <style>
        #fm>div {
            width: 100%;
            display: flex;
            justify-content: space-around;
            margin: 10px 0;
        }
        #fm>div input{
            width: 180px;
        }
    </style>
</head>
<body style="margin-bottom: 54px;">
	<div class="easyui-layout" data-options="fit:true">
        <div data-options="split:false,region:'west',collapsible:true,footer:'#win_base_org_form_footer'" title="管理员列表" id="saveBox" style="width:100%;">
            <table id="dg"  style="width: 100%; height: 100%"
                   data-options="rownumbers:true,singleSelect:true,pagination:true,toolbar:'#tb'">

            </table>

            <div id="tb" style="padding:5px;height:auto">
                <div>
                    推送结果:
                    <input class="easyui-combobox" style="width:125px" name="materialname" id="materialname"
                           data-options="valueField:'id',
                                            textField:'text',
                                            data:
                                        [{ 'id':0,
                                            'text':'全部' ,
                                            selected:true
                                        },{ 'id':1,
                                            'text':'成功' ,
                                        },{
                                            'id':2,
                                            'text':'失败'
                                        }] ,panelHeight:'auto'
                            "/>
                    地区:
                    <input class="easyui-combobox" style="width:125px" name="type" id="new_type"
                           data-options="valueField:'id',
                                            textField:'text',
                                            data:
                                        [
                                        { 'id':0,
                                            'text':'全部' ,
                                            selected:true
                                        },{ 'id':1,
                                            'text':'湖南省内' ,
                                        },{ 'id':2,
                                            'text':'湖南省外' ,
                                        }] ,panelHeight:'auto'
                            "/>
                    起始时间: <input class="easyui-datebox"  id='start' name='start' style="width:180px">
                    截止时间: <input class="easyui-datebox" id='end' name='end' style="width:180px">
                    电话: <input class="easyui-numberbox" type="text" id='phone' name='phone'>
                    <a href="#" class="easyui-linkbutton" id="search_buttn" iconCls="icon-search">搜索</a>
                    <a id="derive_btn" href="/products/fu_ji_tong/to_excel"  class="easyui-linkbutton" style="height:28px" data-options="iconCls:'icon-undo'">导出</a>
                </div>
            </div>
        </div>
	</div>


    <div id="win" class="easyui-dialog" title="提示"  style="width: 800px; padding: 10px 20px; height: auto" closed="true" buttons="#dlg-buttons">
        <form id="fm" name="frm" method="post" style="margin-top: 20px; margin-left: 20px;">
            <table style="padding: 10px 20px;" cellspacing="10">
                <tr>
                    <td>登录账号:</td>
                    <td><input class="easyui-textbox" type="text" name="name" id="old_name" /></td>
                    <input class="easyui-textbox" id="prize_id" name="prize_id" type="hidden">
                </tr>
                <tr>
                    <td>登录密码:</td>
                    <td><input class="easyui-textbox" type="text" name="name" id="old_name" /></td>
                </tr>
                <tr>
                    <td>用户名称:</td>
                    <td><input class="easyui-textbox" type="text" name="name" id="old_name" /></td>
                </tr>
                <tr>
                    <td>个人编号:</td>
                    <td><input  class="easyui-textbox" type="number" name="probability" id="old_probability" /></td>
                </tr>
                <tr>
                    <td>性别:</td>
                    <td><input class="easyui-textbox" type="text" name="name" id="old_name" /></td>
                </tr>
                <tr>
                    <td>电话:</td>
                    <td><input class="easyui-textbox" type="text" name="name" id="old_name" /></td>
                </tr>
                <tr>
                    <td>所属机构:</td>
                    <td><input class="easyui-textbox" type="number" name="number" id="old_number" /></td>
                </tr>
                <tr>
                    <td>所属部门:</td>
                    <td><input  class="easyui-textbox" type="number" name="probability" id="old_probability" /></td>
                </tr>
                <tr>
                    <td>入职时间:</td>
                    <td><input  class="easyui-textbox" type="number" name="probability" id="old_probability" /></td>
                </tr>
                <tr>
                    <td>离职时间:</td>
                    <td><input  class="easyui-textbox" type="number" name="probability" id="old_probability" /></td>
                </tr>
                <tr>
                    <td>当前状态:</td>
                    <td><input  class="easyui-textbox" type="number" name="probability" id="old_probability" /></td>
                </tr>

                <div id="dlg-buttons" style="display: block">
                    <a id="confirm" href="javascript:void(0)" class="easyui-linkbutton c6" iconcls="icon-ok" onclick="submitForm()" style="width: 90px">提交</a>
                    <a href="javascript:void(0)" class="easyui-linkbutton" iconcls="icon-cancel" onclick="javascript:$('#win').dialog('close')" style="width: 90px">取消</a>
                </div>


            </table>
        </form>
    </div>


</body>
<tbody id="html_table"></tbody>
<script type="text/javascript" src="/assets/web/js/src/common_fu.js"></script>

<script>

    //下拉框搜索
    init_datagrid('/products/role/getUsers', 0);

    //下拉框搜索


    $('#search_buttn').bind('click', function() {

        var _data = $('#dg').data('datagrid'); // 拿到datagrid初始化的数据缓存
        if(_data && _data.options){
            _data.options.pageNumber = 1; // 修改缓存
        }
        $.data($('#dg')[0], 'datagrid', _data); // 把修改写回去


        var result=$('#materialname').combobox('getValue');
        var new_type=$('#new_type').combobox('getValue');
        var start = $("#start").val();
        var end = $("#end").val();
        var phone = $("#phone").val();
        if(phone.length>0){
            if(phone.length!=11){
                $.messager.alert('检索手机号','手机号格式错误,请重新输入');
                return false;
            }
        }
        var result = {
            result,
            new_type,
            start,
            end,
            phone
        }
        // console.log(result);return false;
        init_datagrid('/products/role/getUsers', result);
    });


    function init_datagrid(data_url, res) {

        //表头字段
        var arr_columns = dg_columns();
        $("#dg").datagrid({
            rownumbers:true,
            singleSelect:true,
            pagination:true,
            url:data_url,
            queryParams: res,
            method:'post',
            columns: [arr_columns],
            loadMsg: '正在加载数据',
            emptyMsg: '列表为空',
        });
    }
    function dg_columns() {
        var arr = new Array();
        arr.push({
            field: 'username',
            title: '登录账号',
            width: 120,
            align: 'center'
        });
        arr.push({
            field: 'name',
            title: '用户名称',
            width: 80,
            align: 'center'
        });
        arr.push({
            field: 'sex',
            title: '性别',
            width: 80,
            align: 'center'
        });
        arr.push({
            field: 'phone',
            title: '电话',
            width: 150,
            align: 'center'
        });
        arr.push({
            field: 'mechanism',
            title: '所属机构',
            width: 200,
            align: 'center'
        });
        arr.push({
            field: 'department',
            title: '所属部门',
            width: 150,
            align: 'center'
        });
        arr.push({
            field: 'personalNumber',
            title: '人员编号',
            width: 200,
            align: 'center'
        });
        arr.push({
            field: 'status',
            title: '当前状态',
            width: 150,
            align: 'center'
        });
        arr.push({
            field: 'entryTime',
            title: '入职时间',
            width: 200,
            align: 'center'
        });
        arr.push({
            field: 'quitTime',
            title: '离职时间',
            width: 200,
            align: 'center'
        });
        arr.push({
            field: 'id',
            title: '操作',
            width: 90,
            align: 'center',
            formatter:formatOper
        });
        // console.log(arr)
        return arr;
    }
    //操作框
    function formatOper(val, row, index) {
        return '<a href="javascript:void(0)" onclick="showUser(' + val + ')">编辑</a>';
    }

    //修改
    function showUser(row){
        $("#win").dialog("open").dialog("setTitle","员工信息修改");

        return false;
        $("[switchbuttonName='111']").switchbutton("uncheck");
        //var row = $("#dg").datagrid("getSelected");//取得选中行
        if(row){
            // alert(row);
            var id=row;
            var result = {
                id
            }
            $("#win").dialog("open").dialog("setTitle","修改奖项");

            //ajax请求数据
            $.ajax({
                type: "post",
                data: result,
                async: false,
                url: "/products/prize/prize_list",
                success: function(data) {
                    var arr = JSON.parse(data);

                    $('#prize_id').textbox('setValue',arr.rows[0].id);
                    $('#old_name').textbox('setValue',arr.rows[0].name);
                    $('#old_number').textbox('setValue',arr.rows[0].number);
                    $('#old_probability').textbox('setValue',arr.rows[0].probability);

                    if(arr.rows[0].display == "已发布") {
                        $('#statusId').switchbutton('check');
                    }else {
                        $('#statusId').switchbutton('uncheck');
                    }
                    $('#imghead').attr("src",arr.rows[0].img);
                    //$('#imghead1').attr("src",arr.rows[0].url);

                    $('#img111').textbox('setValue',arr.rows[0].img);
                    // $('#img222').textbox('setValue',arr.rows[0].url);


                },
                error:function(data){
                    console.log(data)
                }
            });
            //结束

            // $("#am").form("load",row);
            // url = '/web/role/save?id='+row.id;//为update方法准备访问url,注意是全局变量
        }
    }


</script>
</html>