作者 niuyongqing

管理员模块

1 -<?php  
2 -/**  
3 - * Created by PhpStorm.  
4 - * User: Administrator  
5 - * Date: 2020/6/24  
6 - * Time: 15:30  
7 - */ 1 +<!DOCTYPE html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd">
  2 +<html>
  3 +<head>
  4 + <meta charset="UTF-8">
  5 + <title>管理员列表</title>
  6 + <link rel="stylesheet" type="text/css" href="/assets/common/css/themes/gray/easyui.css" />
  7 + <link rel="stylesheet" type="text/css" href="/assets/common/css/themes/gray/menu.css" />
  8 + <link rel="stylesheet" type="text/css" href="/assets/common/css/themes/icon.css" />
  9 + <link rel="stylesheet" type="text/css" href="/assets/web/css/jitnry.css" />
  10 + <link rel="stylesheet" type="text/css" href="/assets/web/css/common_car.css" />
  11 + <script type="text/javascript" src="/assets/common/js/jquery.min.1.9.4.js"></script>
  12 + <script type="text/javascript" src="/assets/common/js/jquery.easyui.min.1.9.4.js"></script>
  13 + <script type="text/javascript" src="/assets/common/js/jquery.cookie.1.4.1.js"></script>
  14 + <!-- 插件调用 --->
  15 + <script type="text/javascript" src="/assets/common/js/datagrid-detailview.js"></script>
  16 + <script type="text/javascript" src="/assets/common/locale/easyui-lang-zh_CN.js"></script>
  17 + <!-- 基础 JS 调用 -->
  18 + <script type="text/javascript" src="/assets/web/js/src/easyui.base.js"></script>
  19 + <script type="text/javascript" src="/assets/web/js/src/allCity.js"></script>
  20 + <style>
  21 + #fm>div {
  22 + width: 100%;
  23 + display: flex;
  24 + justify-content: space-around;
  25 + margin: 10px 0;
  26 + }
  27 + #fm>div input{
  28 + width: 180px;
  29 + }
  30 + </style>
  31 +</head>
  32 +<body style="margin-bottom: 54px;">
  33 +<div class="easyui-layout" data-options="fit:true">
  34 + <div data-options="split:false,region:'west',collapsible:true,footer:'#win_base_org_form_footer'" title="管理员列表" id="saveBox" style="width:100%;">
  35 + <div class="easyui-panel" style="width:100%;max-width:100%;padding: 5px 5px">
  36 + <div style="margin-bottom:5px;">
  37 + <a id="name_add_but" href="#" data-options="iconCls:'icon-add'" class="my_but" style="vertical-align: middle;">新增</a>
  38 + </div>
  39 + </div>
  40 + <table id="dg" style="width: 100%; height: 100%"
  41 + data-options="rownumbers:true,singleSelect:true,pagination:true,toolbar:'#tb'">
8 42
9 -namespace app\products\controller;  
10 -use app\web\controller\BaseController; 43 + </table>
11 44
12 -use think\Db;  
13 -use think\Request; 45 + <div id="tb" style="padding:5px;height:auto">
  46 + <div>
  47 + 推送结果:
  48 + <input class="easyui-combobox" style="width:125px" name="materialname" id="materialname"
  49 + data-options="valueField:'id',
  50 + textField:'text',
  51 + data:
  52 + [{ 'id':0,
  53 + 'text':'全部' ,
  54 + selected:true
  55 + },{ 'id':1,
  56 + 'text':'成功' ,
  57 + },{
  58 + 'id':2,
  59 + 'text':'失败'
  60 + }] ,panelHeight:'auto'
  61 + "/>
  62 + 地区:
  63 + <input class="easyui-combobox" style="width:125px" name="type" id="new_type"
  64 + data-options="valueField:'id',
  65 + textField:'text',
  66 + data:
  67 + [
  68 + { 'id':0,
  69 + 'text':'全部' ,
  70 + selected:true
  71 + },{ 'id':1,
  72 + 'text':'湖南省内' ,
  73 + },{ 'id':2,
  74 + 'text':'湖南省外' ,
  75 + }] ,panelHeight:'auto'
  76 + "/>
  77 + 起始时间: <input class="easyui-datebox" id='start' name='start' style="width:180px">
  78 + 截止时间: <input class="easyui-datebox" id='end' name='end' style="width:180px">
  79 + <!-- 电话: <input class="easyui-numberbox" type="text" id='phone' name='phone'>-->
  80 + <a href="#" class="easyui-linkbutton" id="search_buttn" iconCls="icon-search">搜索</a>
  81 + <a id="derive_btn" href="/products/fu_ji_tong/to_excel" class="easyui-linkbutton" style="height:28px" data-options="iconCls:'icon-undo'">导出</a>
  82 + </div>
  83 + </div>
  84 + </div>
  85 +</div>
14 86
15 -class Role extends BaseController  
16 -{  
17 87
18 - public function user_management(){ 88 +<div id="win" class="easyui-dialog" title="提示" style="width: 800px; padding: 10px 20px; height: auto" closed="true" buttons="#dlg-buttons">
  89 + <form id="fm" name="frm" method="post" style="margin-top: 20px; margin-left: 20px;">
  90 + <table style="padding: 10px 20px;" cellspacing="10">
  91 + <tr>
  92 + <td>登录账号:</td>
  93 + <td><input class="easyui-textbox" type="text" name="username" id="username" /></td>
  94 + <input class="easyui-textbox" id="user_id" name="user_id" type="hidden">
  95 + </tr>
  96 + <tr>
  97 + <td>登录密码:</td>
  98 + <td><input class="easyui-textbox" type="text" name="password" id="password" /></td>
  99 + </tr>
  100 + <tr>
  101 + <td>用户名称:</td>
  102 + <td><input class="easyui-textbox" type="text" name="name" id="name" /></td>
  103 + </tr>
  104 + <tr>
  105 + <td>性别:</td>
  106 + <td><input id="statusId" name="sex" class="easyui-switchbutton" data-options="onText:'男',offText:'女'" style="height:30px"></td>
  107 + </tr>
  108 + <tr>
  109 + <td>电话:</td>
  110 + <td><input class="easyui-textbox" type="text" name="phone" id="phone" /></td>
  111 + </tr>
  112 + <tr>
  113 + <td>所属机构:</td>
  114 + <td>
  115 + <input id="cc1" name="mechanism" class="easyui-combobox" data-options="
  116 + valueField: 'id',
  117 + textField: 'mechanismName',
  118 + url: '/products/role/getMechanism',
  119 + onSelect: function(rec){
  120 + var url = '/products/role/getDepartment?id='+rec.id;
  121 + $('#cc2').combobox('reload', url);
  122 + var url1 = '/products/role/generateNumber?id='+rec.id;
  123 + $('#personalNumber').textbox('reload', url1);
  124 + }">
19 125
20 - return $this->fetch();  
21 - }  
22 - //获取用户列表  
23 - public function getUsers(){  
24 -  
25 - //$org_id = session('organization.org_id');  
26 - $list= Db::table('sos_user_role')->select()->toArray();  
27 -  
28 - $type=['','试用期','正式员工','已离职'];  
29 - foreach($list as $key=>$val ){  
30 - $list[$key]['sex']=$val['sex'] == 1? '男' : '女';  
31 - //所属机构  
32 - if($val['mechanism'] != 0){  
33 - $mechanism= Db::table('sos_user_mechanism')->field('mechanismName')->where('id',$val['mechanism'])->find();  
34 - }  
35 - $list[$key]['mechanism']=$val['mechanism'] == 0? '男' : $mechanism['mechanismName'];  
36 - //所属部门  
37 - if($val['department'] != 0){  
38 - $department= Db::table('sos_user_department')->field('departmentName')->where('id',$val['department'])->find();  
39 - }  
40 - $list[$key]['department']=$val['department'] == 0? '男' : $department['departmentName'];  
41 - $list[$key]['status']=$type[$val['status']]; 126 + </td>
  127 + </tr>
  128 + <tr>
  129 + <td>所属部门:</td>
  130 + <td><input id="cc2" class="easyui-combobox" name="department" data-options="valueField:'id',textField:'departmentName'"></td>
  131 + </tr>
  132 + <tr>
  133 + <td>个人编号:</td>
  134 + <td><input class="easyui-textbox" type="text" name="personalNumber" id="personalNumber" data-options="valueField:'id',textField:'departmentName'"/></td>
  135 + </tr>
  136 + <tr>
  137 + <td>入职时间:</td>
  138 + <td><input class="easyui-datebox" name="entryTime" id="entryTime" /></td>
  139 + </tr>
  140 + <tr>
  141 + <td>离职时间:</td>
  142 + <td><input class="easyui-datebox" name="quitTime" id="quitTime" /></td>
  143 + </tr>
  144 + <tr>
  145 + <td>当前状态:</td>
  146 + <td><input class="easyui-combobox" style="width:160px" name="status" id="status"
  147 + data-options="valueField:'id',
  148 + textField:'text',
  149 + data:
  150 + [{ 'id':0,
  151 + 'text':'请选择' ,
  152 + selected:true
  153 + },{ 'id':1,
  154 + 'text':'试用期' ,
  155 + },{ 'id':2,
  156 + 'text':'正式员工' ,
  157 + },{
  158 + 'id':3,
  159 + 'text':'已离职'
  160 + }] ,panelHeight:'auto'
  161 + "/></td>
  162 + </tr>
42 163
43 - $list[$key]['entryTime']=date('Y-m-d H:i:s',$val['entryTime']);  
44 - $list[$key]['quitTime']=$val['quitTime'] == ''? '' : date('Y-m-d H:i:s',$val['entryTime']); 164 + <div id="dlg-buttons" style="display: block">
  165 + <a id="confirm" href="javascript:void(0)" class="easyui-linkbutton c6" iconcls="icon-ok" onclick="submitForm()" style="width: 90px">提交</a>
  166 + <a href="javascript:void(0)" class="easyui-linkbutton" iconcls="icon-cancel" onclick="javascript:$('#win').dialog('close')" style="width: 90px">取消</a>
  167 + </div>
45 168
46 - }  
47 169
  170 + </table>
  171 + </form>
  172 +</div>
48 173
49 174
50 - $result["total"] =count($list);  
51 - $result['rows']=$list;  
52 - echo json_encode($result);  
53 - }  
54 - // 添加用户 175 +</body>
  176 +<tbody id="html_table"></tbody>
  177 +<script type="text/javascript" src="/assets/web/js/src/common_fu.js"></script>
55 178
56 - public function store(Request $request)  
57 - {  
58 - $data = $request->post(); 179 +<script>
59 180
60 - $validate = new UserValidate();  
61 - $err_msg = $validate->scene("add")->check($data); 181 + //下拉框搜索
  182 + init_datagrid('/products/role/getUsers', 0);
62 183
63 - if ($err_msg) {  
64 - return json($this->renderError($validate->getError())); 184 + //下拉框搜索
  185 +
  186 +
  187 + $('#search_buttn').bind('click', function() {
  188 +
  189 + var _data = $('#dg').data('datagrid'); // 拿到datagrid初始化的数据缓存
  190 + if(_data && _data.options){
  191 + _data.options.pageNumber = 1; // 修改缓存
65 } 192 }
  193 + $.data($('#dg')[0], 'datagrid', _data); // 把修改写回去
66 194
67 - $res = json_decode(curlPost($this->getUrl('add'), $data),true);  
68 195
69 - if ($res['code'] == self::SUCCESS_CODE) {  
70 - return json($this->renderSuccess()); 196 + var result=$('#materialname').combobox('getValue');
  197 + var new_type=$('#new_type').combobox('getValue');
  198 + var start = $("#start").val();
  199 + var end = $("#end").val();
  200 + var phone = $("#phone").val();
  201 + if(phone.length>0){
  202 + if(phone.length!=11){
  203 + $.messager.alert('检索手机号','手机号格式错误,请重新输入');
  204 + return false;
  205 + }
71 } 206 }
  207 + var result = {
  208 + result,
  209 + new_type,
  210 + start,
  211 + end,
  212 + phone
  213 + }
  214 + // console.log(result);return false;
  215 + init_datagrid('/products/role/getUsers', result);
  216 + });
  217 +
72 218
73 - return json($res); 219 + function init_datagrid(data_url, res) {
74 220
  221 + //表头字段
  222 + var arr_columns = dg_columns();
  223 + $("#dg").datagrid({
  224 + rownumbers:true,
  225 + singleSelect:true,
  226 + pagination:true,
  227 + url:data_url,
  228 + queryParams: res,
  229 + method:'post',
  230 + columns: [arr_columns],
  231 + loadMsg: '正在加载数据',
  232 + emptyMsg: '列表为空',
  233 + });
  234 + }
  235 + function dg_columns() {
  236 + var arr = new Array();
  237 + arr.push({
  238 + field: 'username',
  239 + title: '登录账号',
  240 + width: 120,
  241 + align: 'center'
  242 + });
  243 + arr.push({
  244 + field: 'name',
  245 + title: '用户名称',
  246 + width: 80,
  247 + align: 'center'
  248 + });
  249 + arr.push({
  250 + field: 'sex',
  251 + title: '性别',
  252 + width: 80,
  253 + align: 'center'
  254 + });
  255 + arr.push({
  256 + field: 'phone',
  257 + title: '电话',
  258 + width: 150,
  259 + align: 'center'
  260 + });
  261 + arr.push({
  262 + field: 'mechanism',
  263 + title: '所属机构',
  264 + width: 200,
  265 + align: 'center'
  266 + });
  267 + arr.push({
  268 + field: 'department',
  269 + title: '所属部门',
  270 + width: 150,
  271 + align: 'center'
  272 + });
  273 + arr.push({
  274 + field: 'personalNumber',
  275 + title: '人员编号',
  276 + width: 200,
  277 + align: 'center'
  278 + });
  279 + arr.push({
  280 + field: 'status',
  281 + title: '当前状态',
  282 + width: 150,
  283 + align: 'center'
  284 + });
  285 + arr.push({
  286 + field: 'entryTime',
  287 + title: '入职时间',
  288 + width: 200,
  289 + align: 'center'
  290 + });
  291 + arr.push({
  292 + field: 'quitTime',
  293 + title: '离职时间',
  294 + width: 200,
  295 + align: 'center'
  296 + });
  297 + arr.push({
  298 + field: 'id',
  299 + title: '操作',
  300 + width: 90,
  301 + align: 'center',
  302 + formatter:formatOper
  303 + });
  304 + // console.log(arr)
  305 + return arr;
  306 + }
  307 + //操作框
  308 + function formatOper(val, row, index) {
  309 + return '<a href="javascript:void(0)" onclick="showUser(' + val + ')">编辑</a>';
75 } 310 }
76 - //修改用户  
77 - public function edit(Request $request){  
78 - $data = $request->post();  
79 - if($data['id']){  
80 - $data['uid'] = $data['id'];  
81 - }  
82 311
83 - $validate = new UserValidate();  
84 - $err_msg = $validate->scene("update")->check($data); 312 + //添加
  313 + $('#name_add_but').linkbutton({
  314 + onClick: function () {
85 315
86 - if ($err_msg) {  
87 - return json($this->renderError($validate->getError())); 316 + addFile();
88 } 317 }
  318 + });
  319 + function addFile(){
  320 + $('#win').dialog({
  321 + title: '新增',
  322 + width: 800,
  323 + height: "auto",
  324 + top:20,
  325 + closed: false,//显示对话框
  326 + cache: false,
  327 + modal: true
  328 + });
  329 + }
  330 + //修改
  331 + function showUser(row){
  332 + if(row){
  333 + // alert(row);
  334 + var id=row;
  335 + var result = {
  336 + id
  337 + }
  338 + $("#win").dialog("open").dialog("setTitle","人员信息修改");
89 339
90 - $res = json_decode(curlPost($this->getUrl('edit'), $data),true); 340 + //ajax请求数据
  341 + $.ajax({
  342 + type: "post",
  343 + data: result,
  344 + async: false,
  345 + url: "/products/role/getUsers",
  346 + success: function(data) {
  347 + var arr = JSON.parse(data);
91 348
92 - if ($res['code'] == self::SUCCESS_CODE) {  
93 - return json($this->renderSuccess());  
94 - } 349 + console.log(arr.rows[0]);
95 350
96 - return json($res); 351 + $('#user_id').textbox('setValue',arr.rows[0].user_id);
97 352
98 - }  
99 - //删除用户  
100 - public function del(Request $request){  
101 - $data = $request->get(); 353 + $('#username').textbox('setValue',arr.rows[0].username);
  354 + $('#password').textbox('setValue',arr.rows[0].password);
  355 + $('#name').textbox('setValue',arr.rows[0].name);
  356 + $('#personalNumber').textbox('setValue',arr.rows[0].personalNumber);
  357 + //
  358 + if(arr.rows[0].sex == "男") {
  359 + $('#statusId').switchbutton('check');
  360 + }else {
  361 + $('#statusId').switchbutton('uncheck');
  362 + }
  363 + $('#phone').textbox('setValue',arr.rows[0].phone);
  364 + $('#entryTime').textbox('setValue',arr.rows[0].entryTime);
  365 + $('#quitTime').textbox('setValue',arr.rows[0].quitTime);
102 366
103 - if (empty($data['id']) && $data['id'] !== 0) {  
104 - return json($this->renderError("删除失败!"));  
105 - }  
106 - $res = json_decode(curlPost($this->getUrl("del"),['uid'=>$data['id']]),true); 367 + $('#materialname').combobox('setValue', $('#materialname option')[2].value);
107 368
108 - if ($res['code'] != self::SUCCESS_CODE) {  
109 - return json($res); 369 +
  370 + },
  371 + error:function(data){
  372 + console.log(data)
  373 + }
  374 + });
110 } 375 }
  376 + }
111 377
112 - return json($this->renderSuccess()); 378 + function submitForm(){
  379 + $('#fm').form('submit', {
  380 + url:'/products/role/user_add',
  381 + onSubmit: function(){
  382 + console.log($(this))
  383 + // do some check
  384 + // return false to prevent submit;
  385 + },
  386 + success:function(data){
  387 + console.log(data);
  388 + return false;
  389 + var arr = JSON.parse(data);
  390 + $.messager.alert("提示", arr.msg);
  391 + $('#dg').datagrid('reload');
  392 + // console.log(data);
  393 + //$.messager.alert('',msg);
  394 + //console.log(data);
  395 + //alert(data)
  396 + }
  397 + });
  398 + $('#win').dialog({
  399 + closed: true, // 隱藏列表
  400 + });
113 } 401 }
114 -}  
  402 +
  403 +
  404 +
  405 +</script>
  406 +</html>
@@ -2,334 +2,306 @@ @@ -2,334 +2,306 @@
2 <html> 2 <html>
3 <head> 3 <head>
4 <meta charset="UTF-8"> 4 <meta charset="UTF-8">
5 - <title>管理员列表</title> 5 + <title>SOS信息综合管理系统</title>
6 <link rel="stylesheet" type="text/css" href="/assets/common/css/themes/gray/easyui.css" /> 6 <link rel="stylesheet" type="text/css" href="/assets/common/css/themes/gray/easyui.css" />
7 - <link rel="stylesheet" type="text/css" href="/assets/common/css/themes/gray/menu.css" /> 7 + <link rel="stylesheet" type="text/css" href="/assets/common/css/themes/gray/menu.css" />
8 <link rel="stylesheet" type="text/css" href="/assets/common/css/themes/icon.css" /> 8 <link rel="stylesheet" type="text/css" href="/assets/common/css/themes/icon.css" />
9 - <link rel="stylesheet" type="text/css" href="/assets/web/css/jitnry.css" />  
10 - <link rel="stylesheet" type="text/css" href="/assets/web/css/common_car.css" /> 9 + <link rel="stylesheet" type="text/css" href="/assets/web/css/jitnry.css" />
11 <script type="text/javascript" src="/assets/common/js/jquery.min.1.9.4.js"></script> 10 <script type="text/javascript" src="/assets/common/js/jquery.min.1.9.4.js"></script>
12 - <script type="text/javascript" src="/assets/common/js/jquery.easyui.min.1.9.4.js"></script> 11 + <script type="text/javascript" src="/assets/common/js/jquery.easyui.min.1.9.4.js"></script>
13 <script type="text/javascript" src="/assets/common/js/jquery.cookie.1.4.1.js"></script> 12 <script type="text/javascript" src="/assets/common/js/jquery.cookie.1.4.1.js"></script>
14 - <!-- 插件调用 --->  
15 - <script type="text/javascript" src="/assets/common/js/datagrid-detailview.js"></script>  
16 - <script type="text/javascript" src="/assets/common/locale/easyui-lang-zh_CN.js"></script>  
17 - <!-- 基础 JS 调用 -->  
18 - <script type="text/javascript" src="/assets/web/js/src/easyui.base.js"></script>  
19 - <script type="text/javascript" src="/assets/web/js/src/allCity.js"></script>  
20 - <style>  
21 - #fm>div {  
22 - width: 100%;  
23 - display: flex;  
24 - justify-content: space-around;  
25 - margin: 10px 0;  
26 - }  
27 - #fm>div input{  
28 - width: 180px;  
29 - }  
30 - </style>  
31 -</head>  
32 -<body style="margin-bottom: 54px;">  
33 - <div class="easyui-layout" data-options="fit:true">  
34 - <div data-options="split:false,region:'west',collapsible:true,footer:'#win_base_org_form_footer'" title="管理员列表" id="saveBox" style="width:100%;">  
35 - <table id="dg" style="width: 100%; height: 100%"  
36 - data-options="rownumbers:true,singleSelect:true,pagination:true,toolbar:'#tb'">  
37 -  
38 - </table>  
39 -  
40 - <div id="tb" style="padding:5px;height:auto">  
41 - <div>  
42 - 推送结果:  
43 - <input class="easyui-combobox" style="width:125px" name="materialname" id="materialname"  
44 - data-options="valueField:'id',  
45 - textField:'text',  
46 - data:  
47 - [{ 'id':0,  
48 - 'text':'全部' ,  
49 - selected:true  
50 - },{ 'id':1,  
51 - 'text':'成功' ,  
52 - },{  
53 - 'id':2,  
54 - 'text':'失败'  
55 - }] ,panelHeight:'auto'  
56 - "/>  
57 - 地区:  
58 - <input class="easyui-combobox" style="width:125px" name="type" id="new_type"  
59 - data-options="valueField:'id',  
60 - textField:'text',  
61 - data:  
62 - [  
63 - { 'id':0,  
64 - 'text':'全部' ,  
65 - selected:true  
66 - },{ 'id':1,  
67 - 'text':'湖南省内' ,  
68 - },{ 'id':2,  
69 - 'text':'湖南省外' ,  
70 - }] ,panelHeight:'auto'  
71 - "/>  
72 - 起始时间: <input class="easyui-datebox" id='start' name='start' style="width:180px">  
73 - 截止时间: <input class="easyui-datebox" id='end' name='end' style="width:180px">  
74 - 电话: <input class="easyui-numberbox" type="text" id='phone' name='phone'>  
75 - <a href="#" class="easyui-linkbutton" id="search_buttn" iconCls="icon-search">搜索</a>  
76 - <a id="derive_btn" href="/products/fu_ji_tong/to_excel" class="easyui-linkbutton" style="height:28px" data-options="iconCls:'icon-undo'">导出</a>  
77 - </div>  
78 - </div>  
79 - </div>  
80 - </div>  
81 -  
82 -  
83 - <div id="win" class="easyui-dialog" title="提示" style="width: 800px; padding: 10px 20px; height: auto" closed="true" buttons="#dlg-buttons">  
84 - <form id="fm" name="frm" method="post" style="margin-top: 20px; margin-left: 20px;">  
85 - <table style="padding: 10px 20px;" cellspacing="10">  
86 - <tr>  
87 - <td>登录账号:</td>  
88 - <td><input class="easyui-textbox" type="text" name="name" id="old_name" /></td>  
89 - <input class="easyui-textbox" id="prize_id" name="prize_id" type="hidden">  
90 - </tr>  
91 - <tr>  
92 - <td>登录密码:</td>  
93 - <td><input class="easyui-textbox" type="text" name="name" id="old_name" /></td>  
94 - </tr>  
95 - <tr>  
96 - <td>用户名称:</td>  
97 - <td><input class="easyui-textbox" type="text" name="name" id="old_name" /></td>  
98 - </tr>  
99 - <tr>  
100 - <td>个人编号:</td>  
101 - <td><input class="easyui-textbox" type="number" name="probability" id="old_probability" /></td>  
102 - </tr>  
103 - <tr>  
104 - <td>性别:</td>  
105 - <td><input class="easyui-textbox" type="text" name="name" id="old_name" /></td>  
106 - </tr>  
107 - <tr>  
108 - <td>电话:</td>  
109 - <td><input class="easyui-textbox" type="text" name="name" id="old_name" /></td>  
110 - </tr>  
111 - <tr>  
112 - <td>所属机构:</td>  
113 - <td><input class="easyui-textbox" type="number" name="number" id="old_number" /></td>  
114 - </tr>  
115 - <tr>  
116 - <td>所属部门:</td>  
117 - <td><input class="easyui-textbox" type="number" name="probability" id="old_probability" /></td>  
118 - </tr>  
119 - <tr>  
120 - <td>入职时间:</td>  
121 - <td><input class="easyui-textbox" type="number" name="probability" id="old_probability" /></td>  
122 - </tr>  
123 - <tr>  
124 - <td>离职时间:</td>  
125 - <td><input class="easyui-textbox" type="number" name="probability" id="old_probability" /></td>  
126 - </tr>  
127 - <tr>  
128 - <td>当前状态:</td>  
129 - <td><input class="easyui-textbox" type="number" name="probability" id="old_probability" /></td>  
130 - </tr> 13 + <!-- 插件调用 --->
  14 + <script type="text/javascript" src="/assets/common/js/datagrid-detailview.js"></script>
  15 + <script type="text/javascript" src="/assets/common/locale/easyui-lang-zh_CN.js"></script>
  16 + <!-- 基础 JS 调用 -->
  17 + <script type="text/javascript" src="/assets/web/js/src/easyui.base.js"></script>
  18 + <script type="text/javascript" src="/assets/web/js/src/common.menu.js"></script>
131 19
132 - <div id="dlg-buttons" style="display: block">  
133 - <a id="confirm" href="javascript:void(0)" class="easyui-linkbutton c6" iconcls="icon-ok" onclick="submitForm()" style="width: 90px">提交</a>  
134 - <a href="javascript:void(0)" class="easyui-linkbutton" iconcls="icon-cancel" onclick="javascript:$('#win').dialog('close')" style="width: 90px">取消</a>  
135 - </div> 20 + <script type="text/javascript">
  21 + var oltTarget, logTarget, logGridTarget;
  22 + var num = 0;
  23 + var iCount;
  24 + $(function () {
  25 + oltTarget = $("#operation_log_txt");
  26 + logTarget = $("#operation_log");
  27 + logGridTarget = $("#operation_log_grid");
136 28
  29 + /* 获得窗口大小 */
  30 + function onResize() {
  31 + logTarget.window({
  32 + left:$(window).width() - 705,
  33 + top:$(window).height() - 425,
  34 + closed:true
  35 + });
  36 + };
  37 + window.onresize = onResize;
  38 + onResize();
137 39
138 - </table>  
139 - </form>  
140 - </div> 40 + /*
  41 + $(document).unbind('.commoditygrid').bind('mousedown.commoditygrid', function(e){
  42 + var p = $(e.target).closest('table.datagrid-btable,div.combo-panel');
  43 + if (p.length) { return; }
  44 + });
  45 + */
141 46
142 47
143 -</body>  
144 -<tbody id="html_table"></tbody>  
145 -<script type="text/javascript" src="/assets/web/js/src/common_fu.js"></script> 48 + // $('#main_tabs').tabs('update', {
  49 + // tab: $('#main_tabs').tabs('getTab', 0),
  50 + // options: {
  51 + // id: 'ClientIndex',
  52 + // title: '客户管理'
  53 + // }
  54 + // });
146 55
147 -<script> 56 + // $('#main_iframe').attr('src','__MODEL__/client/client_list_main');
148 57
149 - //下拉框搜索  
150 - init_datagrid('/products/role/getUsers', 0);  
151 58
152 - //下拉框搜索  
153 59
  60 + //首页默认展示
  61 + $('#main_tabs').tabs('update', {
  62 + tab: $('#main_tabs').tabs('getTab', 0),
  63 + options: {
  64 + id: 'ClientIndex',
  65 + title: '人员管理'
  66 + }
  67 + });
154 68
155 - $('#search_buttn').bind('click', function() { 69 + $('#main_iframe').attr('src','__MODEL__/role/index');
156 70
157 - var _data = $('#dg').data('datagrid'); // 拿到datagrid初始化的数据缓存  
158 - if(_data && _data.options){  
159 - _data.options.pageNumber = 1; // 修改缓存  
160 - }  
161 - $.data($('#dg')[0], 'datagrid', _data); // 把修改写回去  
162 71
163 72
164 - var result=$('#materialname').combobox('getValue');  
165 - var new_type=$('#new_type').combobox('getValue');  
166 - var start = $("#start").val();  
167 - var end = $("#end").val();  
168 - var phone = $("#phone").val();  
169 - if(phone.length>0){  
170 - if(phone.length!=11){  
171 - $.messager.alert('检索手机号','手机号格式错误,请重新输入');  
172 - return false;  
173 - }  
174 - }  
175 - var result = {  
176 - result,  
177 - new_type,  
178 - start,  
179 - end,  
180 - phone  
181 - }  
182 - // console.log(result);return false;  
183 - init_datagrid('/products/role/getUsers', result);  
184 - });  
185 73
  74 + $.h.index.setOperateInfo(null, false);
186 75
187 - function init_datagrid(data_url, res) {  
188 -  
189 - //表头字段  
190 - var arr_columns = dg_columns();  
191 - $("#dg").datagrid({  
192 - rownumbers:true,  
193 - singleSelect:true,  
194 - pagination:true,  
195 - url:data_url,  
196 - queryParams: res,  
197 - method:'post',  
198 - columns: [arr_columns],  
199 - loadMsg: '正在加载数据',  
200 - emptyMsg: '列表为空',  
201 - });  
202 - }  
203 - function dg_columns() {  
204 - var arr = new Array();  
205 - arr.push({  
206 - field: 'username',  
207 - title: '登录账号',  
208 - width: 120,  
209 - align: 'center'  
210 - });  
211 - arr.push({  
212 - field: 'name',  
213 - title: '用户名称',  
214 - width: 80,  
215 - align: 'center'  
216 - });  
217 - arr.push({  
218 - field: 'sex',  
219 - title: '性别',  
220 - width: 80,  
221 - align: 'center'  
222 - });  
223 - arr.push({  
224 - field: 'phone',  
225 - title: '电话',  
226 - width: 150,  
227 - align: 'center'  
228 - });  
229 - arr.push({  
230 - field: 'mechanism',  
231 - title: '所属机构',  
232 - width: 200,  
233 - align: 'center'  
234 - });  
235 - arr.push({  
236 - field: 'department',  
237 - title: '所属部门',  
238 - width: 150,  
239 - align: 'center'  
240 - });  
241 - arr.push({  
242 - field: 'personalNumber',  
243 - title: '人员编号',  
244 - width: 200,  
245 - align: 'center'  
246 - });  
247 - arr.push({  
248 - field: 'status',  
249 - title: '当前状态',  
250 - width: 150,  
251 - align: 'center'  
252 - });  
253 - arr.push({  
254 - field: 'entryTime',  
255 - title: '入职时间',  
256 - width: 200,  
257 - align: 'center' 76 + $("<div class=\"datagrid-mask\"></div>").css({
  77 + display: "none",
  78 + position: "absolute",
  79 + width: "100%",
  80 + height: "100%"
  81 + }).appendTo("#Loading");
  82 + $("<div class=\"loading\"></div>").html("<div><img src='/assets/web/img/loading.gif' style='width:80px;height:80px;'></div><div style='font-size:12px;color:#666;'>正在加载主框架数据……</div>").css({
  83 + position: "relative",
  84 + left: $(window).width() / 2 - $(window).width() * 0.1,
  85 + top: $(window).height() / 2 - 100,
  86 + width: $(window).width() * 0.2
  87 + }).appendTo("#Loading").css({display: "block"});
  88 + setTimeout(function () {
  89 + $("#Loading").fadeOut("normal", function () {
  90 + $(this).remove();
  91 + });
  92 + }, 800)
258 }); 93 });
259 - arr.push({  
260 - field: 'quitTime',  
261 - title: '离职时间',  
262 - width: 200,  
263 - align: 'center'  
264 - });  
265 - arr.push({  
266 - field: 'id',  
267 - title: '操作',  
268 - width: 90,  
269 - align: 'center',  
270 - formatter:formatOper  
271 - });  
272 - // console.log(arr)  
273 - return arr;  
274 - }  
275 - //操作框  
276 - function formatOper(val, row, index) {  
277 - return '<a href="javascript:void(0)" onclick="showUser(' + val + ')">编辑</a>';  
278 - }  
279 -  
280 - //修改  
281 - function showUser(row){  
282 - $("#win").dialog("open").dialog("setTitle","员工信息修改");  
283 -  
284 - return false;  
285 - $("[switchbuttonName='111']").switchbutton("uncheck");  
286 - //var row = $("#dg").datagrid("getSelected");//取得选中行  
287 - if(row){  
288 - // alert(row);  
289 - var id=row;  
290 - var result = {  
291 - id  
292 - }  
293 - $("#win").dialog("open").dialog("setTitle","修改奖项");  
294 94
295 - //ajax请求数据  
296 - $.ajax({  
297 - type: "post",  
298 - data: result,  
299 - async: false,  
300 - url: "/products/prize/prize_list",  
301 - success: function(data) {  
302 - var arr = JSON.parse(data); 95 + $.h.index = {
  96 + refresh : function(e) {
  97 + var objMainTabs = $('#main_tabs');
  98 + var objMainTabsOptions = objMainTabs.tabs('getSelected').panel('options');
  99 + if (objMainTabs.tabs('getTabIndex',objMainTabs.tabs('getSelected')) == 0) {
  100 + $('#main_iframe').attr('src',$('#main_iframe').attr('src'));
  101 + return;
  102 + }
  103 + objMainTabs.tabs('update', {
  104 + tab: objMainTabs.tabs('getSelected'),
  105 + options: {
  106 + title: objMainTabsOptions.title,
  107 + href: objMainTabsOptions.href
  108 + }
  109 + });
  110 + objMainTabs.tabs('getSelected').panel('refresh');
  111 + },
  112 + onCloseAll : function() {
  113 + var objTabs = $('#main_tabs');
  114 + var mTabs = objTabs.tabs('tabs');
  115 + for (var i = 0; i < mTabs.length; i++) {
  116 + if (i == 0) continue;
  117 + objTabs.tabs("close", i);
  118 + }
  119 + },
  120 + sendMainMsg : function(msg) {
  121 + if ($("#main_msg").is(":hidden")) {
  122 + $('#main_msg').html(msg);
  123 + var mainMsgWidth = $('#main_msg').width() / 2;
  124 + $('#main_msg').offset({top:0,left:((document.documentElement.clientWidth || document.body.clientWidth) / 2 - mainMsgWidth)});
  125 + $('#main_msg').show();
  126 + } else {
  127 + $('#main_msg').html('');
  128 + $('#main_msg').offset({top:0,left:0});
  129 + $('#main_msg').hide();
  130 + }
  131 + },
  132 + /**
  133 + * 如果 info 为 null 并且 b 为 false,只读取数组中第一条记录并显示
  134 + * 如果 info 不是 null 并且 b 为 false,只显示信息,不写入数组中
  135 + * 如果 info 不是 null 并且 b 为 true,显示信息,并写入数组中
  136 + */
  137 + setOperateInfo : function(info, b) {
  138 + if (info == null || b) {
  139 + var mCookieData = $.cookie('SysOperateInfo');
  140 + if (!mCookieData) {
  141 + mCookieData = '[]';
  142 + }
  143 + mCookieData = JSON.parse(mCookieData);
303 144
304 - $('#prize_id').textbox('setValue',arr.rows[0].id);  
305 - $('#old_name').textbox('setValue',arr.rows[0].name);  
306 - $('#old_number').textbox('setValue',arr.rows[0].number);  
307 - $('#old_probability').textbox('setValue',arr.rows[0].probability); 145 + if (mCookieData.length >= 10) {
  146 + mCookieData.splice(9, 1);
  147 + }
  148 + /* 为 true 时,写入 Cookie */
  149 + if (b) {
  150 + info.id = mCookieData.length;
  151 + mCookieData.unshift(info);
  152 + $.cookie('SysOperateInfo',JSON.stringify(mCookieData));
  153 + }
  154 + if (info == null) {
  155 + if (mCookieData.length == 0) return;
  156 + info = mCookieData[0];
  157 + }
308 158
309 - if(arr.rows[0].display == "已发布") {  
310 - $('#statusId').switchbutton('check');  
311 - }else {  
312 - $('#statusId').switchbutton('uncheck'); 159 + if (!logTarget.window('options').closed) {
  160 + logGridTarget.datagrid('loadData', mCookieData);
313 } 161 }
314 - $('#imghead').attr("src",arr.rows[0].img);  
315 - //$('#imghead1').attr("src",arr.rows[0].url); 162 + }
316 163
317 - $('#img111').textbox('setValue',arr.rows[0].img);  
318 - // $('#img222').textbox('setValue',arr.rows[0].url); 164 + var strHtml = '<strong>【{R_Module}】【{R_Operate}】:</strong>{R_Content}';
  165 + strHtml = strHtml.replace('{R_Module}',info.module).replace('{R_Operate}',info.operate).replace('{R_Content}',info.content);
  166 + $(oltTarget.children()[0]).html(strHtml);
319 167
  168 + clearInterval(iCount);
  169 + if (info.icon == 'hr-warn' || info.icon == 'hr-error') {
320 170
321 - },  
322 - error:function(data){  
323 - console.log(data) 171 + this.sendMainMsg(strHtml);
  172 + iCount = window.setInterval(txtTwinkle, 1300);
324 } 173 }
325 - });  
326 - //结束  
327 174
328 - // $("#am").form("load",row);  
329 - // url = '__URL__/save?id='+row.id;//为update方法准备访问url,注意是全局变量 175 + if (!$(oltTarget.children()[1]).hasClass(info.icon)) {
  176 + strHtml = "l-btn-icon " + info.icon;
  177 + $(oltTarget.children()[1]).attr("class","l-btn-icon " + info.icon);
  178 + }
  179 + }
  180 + };
  181 + function txtTwinkle() {
  182 + num++;
  183 + if (num == 6) {
  184 + num = 0;
  185 + $.h.index.sendMainMsg(null);
  186 + clearInterval(iCount);
  187 + } else {
  188 + setTimeout("oltTarget.css('color','blue')",500);
  189 + setTimeout("oltTarget.css('color','#000')",800);
  190 + }
330 } 191 }
331 - } 192 + </script>
  193 +</head>
  194 +<body>
  195 +<div id='Loading' style="position:absolute;z-index:1000;top:0px;left:0px;width:100%;height:100%;background-color:#fff;text-align:center;"></div>
  196 +<div class="easyui-layout" data-options="fit:true">
  197 + <div data-options="region:'north',border:false" style="display:flex;justify-content:space-between;height:60px;line-height:60px;overflow:hidden;background-image:linear-gradient(90deg, #dee, #fff);">
  198 + <div style="display:flex;align-items:center;">
  199 + <div slot="header-logo" style="float:left;width:180px;">
  200 + <img src="/assets/web/img/Logo.png" style="margin-left: 20px;height: 30px;">
  201 + </div>
  202 + </div>
  203 + <div style="display:flex;align-items:center;margin-right:5px;">
  204 + <a href="/web/index/loginout" class="easyui-menubutton">退出</a>
  205 + </div>
  206 + <div id="main_msg" style="display:none;position:absolute;top:0;left:50%;transform:translate(-50%,0);height:40px;line-height:30px;font-size:14px;color:#fff;padding:5px 20px;border-radius:0 0 .5em .5em;background-color:rgba(0,0,0,0.5)">~~这是一条提示消息~~</div>
  207 + </div>
  208 + <div data-options="region:'west',split:true,hideCollapsedContent:false,collapsed:false,title:'菜单',dataType:'json'" style="width:180px;min-width:160px;">
  209 + <div class="easyui-menu" data-options="inline:true,fit:true,itemHeight:40" style="border:0px;">
  210 + <!-- <div data-options="iconCls:'icon-cancel'">-->
  211 + <!-- <span>客户管理</span>-->
  212 + <!-- <div style="width:180px;">-->
  213 + <!-- <div data-options="iconCls:'icon-clear'"><b>客户管理</b></div>-->
  214 + <!-- <div data-options="iconCls:'icon-edit'">客户导入</div>-->
  215 + <!-- <div data-options="iconCls:'icon-remove'">客户调配</div>-->
  216 + <!-- <div data-options="iconCls:'icon-save'">数据处理</div>-->
  217 + <!-- <div class="menu-sep"></div>-->
  218 + <!-- <div data-options="iconCls:'icon-cut'">招聘管理</div>-->
  219 + <!-- <div data-options="iconCls:'icon-ok'">下发回收</div>-->
  220 + <!-- <div data-options="iconCls:'icon-no'">故障报修</div>-->
  221 + <!-- </div>-->
  222 + <!-- </div>-->
  223 + <!-- <div class="menu-selected" data-options="iconCls:'hr-loading'">-->
  224 + <!-- <span>我的助手</span>-->
  225 + <!-- <div style="width:180px;">-->
  226 + <!-- <div><b>我的消息</b></div>-->
  227 + <!-- <div>消息提醒</div>-->
  228 + <!-- <div>通话记录</div>-->
  229 + <!-- <div>未接来电</div>-->
  230 + <!-- <div>公告管理</div>-->
  231 + <!-- <div>通讯录</div>-->
  232 + <!-- <div>个人设置</div>-->
  233 + <!-- <div>帮助向导</div>-->
  234 + <!-- </div>-->
  235 + <!-- </div>-->
  236 + <!---->
  237 + <div data-options="iconCls:'icon-reload'">
  238 + <span>转盘抽奖</span>
  239 + <div style="width:180px;">
  240 + <div onclick="$.h.menu.onMenuTurnPrizeManage();"><b>奖项列表</b></div>
  241 + <div onclick="$.h.menu.onMenuTurnPrizeUserManage();"><b>用户列表</b></div>
  242 + <div onclick="$.h.menu.onMenuTurnPrizeRuleManage();"><b>规则设置</b></div>
  243 + </div>
  244 + </div>
  245 + <div data-options="iconCls:'icon-reload'">
  246 + <span>抽奖管理</span>
  247 + <div style="width:180px;">
  248 + <div onclick="$.h.menu.onMenuPrizeManage();"><b>奖项列表</b></div>
  249 + <div onclick="$.h.menu.onMenuPrizeUserManage();"><b>用户列表</b></div>
  250 + <div onclick="$.h.menu.onMenuPrizeRuleManage();"><b>规则设置</b></div>
  251 + </div>
  252 + </div>
  253 + <div data-options="iconCls:'icon-reload'">
  254 + <span>产品管理</span>
  255 + <div style="width:180px;">
  256 + <div onclick="$.h.menu.onMenuProductManage();"><b>产品列表</b></div>
  257 + <div onclick="$.h.menu.onMenuProductOrderManage();"><b>订单列表</b></div>
  258 + </div>
  259 + </div>
  260 + <div data-options="iconCls:'icon-reload'">
  261 + <span>获客管理</span>
  262 + <div style="width:180px;">
  263 + <div onclick="$.h.menu.onMenuFuJiTongManage();"><b>客户列表</b></div>
  264 + </div>
  265 + </div>
  266 +
  267 +
332 268
333 269
334 -</script> 270 + <div data-options="iconCls:'icon-reload'">
  271 + <span>管理员</span>
  272 + <div style="width:180px;">
  273 + <div onclick="$.h.menu.onMenuRoleManage();"><b>人员管理</b></div>
  274 + <div onclick="$.h.menu.onMenuMechanismManage();"><b>机构管理</b></div>
  275 + </div>
  276 + </div>
  277 + <div data-options="iconCls:'icon-reload'">
  278 + <span>二级菜单</span>
  279 + <div style="width:180px;">
  280 + <div onclick="$.h.menu.onMenuDepartmentManage();"><b>部门管理</b></div>
  281 + <div onclick="$.h.menu.onMenuPersonnelManage();"><b>人员管理</b></div>
  282 + </div>
  283 + </div>
  284 + <div data-options="iconCls:'icon-reload'">
  285 + <span>编号规则</span>
  286 + <div style="width:180px;">
  287 + <div onclick="$.h.menu.onMenuNumberManage();"><b>编号列表</b></div>
  288 + </div>
  289 + </div>
  290 + </div>
  291 + </div>
  292 + <div data-options="region:'center',border:false" style="overflow:hidden;">
  293 + <div id="main_tabs" class="easyui-tabs" data-options="fit:true,border:true,tools:'#tab-tools',tabWidth:120">
  294 + <div style="overflow:hidden;padding:4px;">
  295 + <iframe id="main_iframe" style="width:100%;height:100%;border:0px;overflow:hidden;"></iframe>
  296 + </div>
  297 + </div>
  298 + <div id="tab-tools" style="border-right:0px;">
  299 + <a class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-clear',onClick:$.h.index.onCloseAll" title="关闭所有"></a>
  300 + <a class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-reload',onClick:$.h.index.refresh" title="刷新当前"></a>
  301 + </div>
  302 + </div>
  303 + <div data-options="region:'east',split:true,hideCollapsedContent:false,collapsed:true,title:'快捷',dataType:'json',href:'/web/index/quick_menu'" style="width:100px;min-width:100px;"></div>
  304 +</div>
  305 +
  306 +</body>
335 </html> 307 </html>