user.html 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Cache-Control" content="no-store" />
  5. <meta http-equiv="Pragma" content="no-cache" />
  6. <meta http-equiv="Expires" content="-1" />
  7. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  8. <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  9. <title>人员管理</title>
  10. <script type="text/javascript" src="../../scripts/jquery-1.8.3.js"></script>
  11. <link rel="stylesheet" type="text/css" href="../../themes/icon.css">
  12. <script type="text/javascript" src="../../scripts/jquery.easyui.js"></script>
  13. <script type="text/javascript" src="../../scripts/easyui-lang-zh_CN.js"></script>
  14. <script type="text/javascript"
  15. src="../../scripts/jquery.validate.rules.generate.js"></script>
  16. <script type="text/javascript" src="../../scripts/config.js"></script>
  17. <script type="text/javascript" src="../../scripts/comment.js"></script>
  18. <script type="text/javascript" src="../../scripts/utils.js"></script>
  19. <script type="text/javascript" src="../../scripts/init.js"></script>
  20. <script type="text/javascript" src="../../scripts/jquery.edatagrid.js"></script>
  21. </head>
  22. <body>
  23. <script type="text/javascript">
  24. //准备加载本地和远程数据,为Grid选择框准备数据
  25. var roleList=[]; //角色列表数据
  26. // var deptList=[]; //机构名称列表数据
  27. var deptMap=new MapUtils();
  28. $(function(){
  29. sextypeData = getListData('sextype');
  30. usertyppData = getListData('usertype');
  31. //以下不直接返回List,不需要isList=1参数,直接加载使用,以下方式可以检测通讯故障
  32. syncAjaxCall('SYSROLE01','proNames=roleid&orderBy=roleid',function(data){
  33. if(data){
  34. roleList = data.rows;
  35. }
  36. });
  37. syncAjaxCall('GENERALD01','proNames=deptType&orderBy=id&rows=-1&deptType=1',function(data){
  38. if(data){
  39. // deptList=data.rows;
  40. for(i=0;i<data.rows.length;++i){
  41. deptMap.put(data.rows[i].deptCode,data.rows[i].deptName);
  42. }
  43. }
  44. var timeOut = setTimeout(function(){
  45. doSearch();
  46. clearTimeout(timeOut);
  47. }, 500);
  48. });
  49. doSearch(0)
  50. });
  51. </script>
  52. <table id="dg" style="width: 98%; height: 512px" toolbar="#toolbar"
  53. pagination="true" idField="userid" rownumbers="true"
  54. fitColumns="false" singleSelect="true">
  55. <thead>
  56. <tr>
  57. <th field="ck" align="center" data-options="checkbox:true" width="5"></th>
  58. <th field="userid" align="left"
  59. data-options="editor:valiBoxEtr(true,'',8,64)" sortable="true"
  60. width="130">用户编码</th>
  61. <th field="username" align="left"
  62. data-options="editor:valiBoxEtr(false,'',2,16)" sortable="true"
  63. width="130">用户名称</th>
  64. <!-- <th field="orgname" align="left"
  65. data-options="formatter:function(value,row,index){ return orgFmt(value)},editor:comboBox_Etr1(deptList,'deptCode','deptName')" sortable="true"
  66. width="130">机构名称</th> -->
  67. <th field="usersex" align="center"
  68. data-options="formatter:dataFmt('sexType'),editor:comboBoxEtr('sexType')"
  69. sortable="true" width="80">性别</th>
  70. <th field="usertype" align="center"
  71. data-options="formatter:dataFmt('userType'),editor:comboBoxEtr('userType')"
  72. sortable="true" width="80">人员类型</th>
  73. <th field="userdnflag" align="center"
  74. data-options="formatter:dataFmt('boolType'),editor:comboBoxEtr('boolType')"
  75. sortable="true" width="60">需要DN</th>
  76. <th field="userdn" align="center"
  77. data-options="editor:valiBoxEtr(false,'',0,512)" sortable="true"
  78. width="100">用户DN</th>
  79. <!--<th field="roleids" align="left"-->
  80. <!--data-options="formatter:listFmt(roleList,'roleid','name'),editor:comboGridEtr(roleList,'roleid','name')"-->
  81. <!--sortable="true" width="130">角色列表</th>-->
  82. <th field="roleids" align="left"
  83. data-options="formatter:listFmt(roleList,'roleid','name'),editor:comboGridEtr(roleList,'roleid','name')"
  84. sortable="true" width="130">角色列表</th>
  85. <th field="usertelnum" align="center"
  86. data-options="editor:valiBoxEtr(false,'vBaseTelephone'),formatter:function(value){return cardFmt(value);}"
  87. sortable="true" width="80">电话</th>
  88. <th field="usermobnub" align="center"
  89. data-options="editor:valiBoxEtr(false,'vBaseMobile'),formatter:function(value){return cardFmt(value);}"
  90. sortable="true" width="80">手机</th>
  91. <th field="nickname" align="left" sortable="true" width="80"
  92. editor="text">昵称</th>
  93. <th field="useremail" align="left"
  94. data-options="editor:valiBoxEtr(false,'email')" sortable="true"
  95. width="100">Email地址</th>
  96. <th field="userdesc" align="left" sortable="true" width="120"
  97. editor="text">用户描述</th>
  98. </tr>
  99. </thead>
  100. </table>
  101. <div id="toolbar">
  102. <a href="#" class="easyui-linkbutton" iconCls="icon-search"
  103. plain="true" onclick="doSearch(0)">查询</a>
  104. <a href="javascript:void(0)" class="easyui-linkbutton"
  105. iconCls="icon-add" plain="true"
  106. onclick="javascript:$('#dg').edatagrid('addRow')">新增</a> <a
  107. href="javascript:void(0)" class="easyui-linkbutton"
  108. iconCls="icon-save" plain="true"
  109. onclick="javascript:$('#dg').edatagrid('saveRow')">保存</a> <a
  110. href="javascript:void(0)" class="easyui-linkbutton"
  111. iconCls="icon-undo" plain="true"
  112. onclick="javascript:$('#dg').edatagrid('cancelRow')">恢复</a> <a
  113. href="javascript:void(0)" class="easyui-linkbutton"
  114. iconCls="icon-remove" plain="true"
  115. onclick="javascript:$('#dg').edatagrid('destroyRow')">删除</a> <a
  116. href="javascript:void(0)" class="easyui-linkbutton"
  117. iconCls="icon-edit" plain="true"
  118. onclick="javascript:{resetPassword();}">密码重置</a> <a
  119. href="javascript:void(0)" class="easyui-linkbutton"
  120. iconCls="icon-reload" plain="true"
  121. onclick="javascript:$('#dg').datagrid('reload')">刷新</a> <a href="#"
  122. class="easyui-linkbutton" plain="true"
  123. data-options="iconCls:'icon-excel',plain:true" onclick="doSearch(1)">导出</a>
  124. </div>
  125. <script type="text/javascript">
  126. //页面加载调用
  127. $(function(){
  128. // doSearch();//角色列表要先获取在加载数据
  129. });
  130. function doSearch(download){
  131. var systemType = "service";//$('#systembox').combobox('getValue');
  132. //区别于查询还是下载
  133. if(download==1){
  134. downloadExcel('#dg','用户信息查询','SYSUSER01','proNames=userid&rows=-1&channelNo='+systemType);
  135. }else{
  136. $('#dg').edatagrid({
  137. url: getUrl('SYSUSER01','channelNo='+systemType),
  138. saveUrl: getUrl('SYSUSER02','proNames=userid&channelNo='+systemType),
  139. updateUrl: getUrl('SYSUSER03','proNames=userid&channelNo='+systemType),
  140. destroyUrl: getUrl('SYSUSER04','proNames=userid&channelNo='+systemType),
  141. striped:true,
  142. pagination: true,
  143. pageSize: 15,//每页显示的记录条数,默认为10
  144. pageList: [10, 15,25, 50,100],//可以设置每页记录条数的列表
  145. loadFilter: function (data){
  146. loadFilterError(data);
  147. return data;
  148. }
  149. });
  150. }
  151. }
  152. function resetPassword(){
  153. var systemType = "service";//$('#systembox').combobox('getValue');
  154. $('#passwordForm').form('clear');
  155. var row = $('#dg').datagrid('getSelected');
  156. if (row){
  157. var params = 'usercode='+row.userid +'&channelNo='+systemType;
  158. syncAjaxCall('HM0004',params,function(data){
  159. if(!data)return;
  160. if(data.returnCode=='000000000'){
  161. $.messager.alert('系统提示','恭喜您,您的密码重置成功!','info');
  162. }
  163. },function(data){
  164. $.messager.alert('系统错误','错误码:['+data.returnCode+'],错误信息:['+data.returnMsg+'].','error');
  165. });
  166. }else{
  167. $.messager.alert('系统错误','请选中需要重置密码用户的所在行!','error');
  168. }
  169. };
  170. function orgFmt(orgNo) {
  171. var orgName = deptMap.get(orgNo);
  172. if(orgName){
  173. return orgName;
  174. }else{
  175. return orgNo;
  176. }
  177. }
  178. </script>
  179. </body>
  180. </html>