123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382 |
- <%@page contentType="text/html" pageEncoding="UTF-8"%>
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
- <title>用户信息表</title>
- <!--框架必需start-->
- <%@include file="../../include.jsp" %>
- <!--框架必需end-->
- <script type="text/javascript" src="../../../scripts/qui/libs/js/tree/ztree/ztree.js"></script>
- <link href="../../../scripts/qui/libs/js/tree/ztree/ztree.css" rel="stylesheet" type="text/css" />
- <script type="text/javascript" src = "/nwyj/scripts/business/am/org/maintenance/orgSel.js"></script>
- <script type="text/javascript" src="/nwyj/scripts/freamwork/com/sinosoft/system/md5/md5.js"></script>
- <script type="text/javascript" src="/nwyj/scripts/business/em/report/objOperate.js"></script>
- </head>
- <body>
- <div style="height: 50px;background: #F8F8F8;" align="center">
- <a href="/nwyj/page/system/user/User_List.jsp">
- <img id="back" align="left" alt="返回" title="返回" src="/nwyj/images/temp/back.png" />
- </a>
- <font style="font-weight: bold;font-size: 20px;line-height: 45px;" class="titleShow" id="userEditTitle"></font>
- </div>
- <form id="UserInfoForm" >
- <table class="tableStyle" formMode="line"">
- <input id="ROLE_ID" name="ROLE_ID" type="hidden"/>
- <input id="ROLE_ID_NAME" name="ROLE_ID_NAME" type="hidden"/>
- <tr><td colspan="4" align="right"><input value="保存" id="save" type="button"/> <input id="cancel" value="重置" type="button"/></tr>
- <tr style="display: none;">
- <td><input type="hidden" id="objectID" name="objectID"
- required="true" /></td>
- </tr>
- <tr>
- <td width="15%"><span class="star">*</span>登录名:</td>
- <td width="35%"><input name="LOGIN_NAME" id="LOGIN_NAME" type="text" maxlength="60" class="validate[required]" /></td>
- <td width="15%"><span class="star">*</span>显示名称:</td>
- <td width="35%"><input name="REAL_NAME" id="REAL_NAME" type="text" maxlength="60" class="validate[required]" /></td>
- </tr>
- <tr>
- <td width="15%"><span class="spanMsg star">*</span>密码:</td>
- <td width="35%"><input name="PASSWORD" id="PASSWORD" type="password" maxlength="20"
- class="validate[functionCall[required,funcvalidate|* 请安要求设置密码]]" ></br><span >密码必须从字符、数字、符号中至少选择两种进行组合设置8-20位</span></td>
- <td width="15%"><span class="spanMsg star">*</span>确认密码:</td>
- <td width="35%"><input type="password" id = "PASSWORD2" maxlength="20"
- class="validate[confirm[PASSWORD]]" ></br><span id="pwdErr" style="display: none;"></span></td>
- </tr>
- <tr>
- <td width="15%"><span class="spanMsg star">*</span>所属单位:</td>
- <td width="35%">
- <div id="DEPT_ID" ></div>
- </td>
- <td width="15%">用户应急角色:</td>
- <!-- <td width="35%"><select name="ROLE_ID" id="ROLE_ID" prompt="请选择" ></select></td> -->
- <td width="35%"><div class="selectTree" id="ROLE_ID_SHOW" multiMode="true" noGroup="true" ></div>
- </td>
- </tr>
- <tr>
- <td width="15%">性别:</td>
- <td width="35%">
- <input type="radio" id="female-1" name="GENDER" value="0" /><label for="female-1" class="hand">女</label>
- <input type="radio" id="male-1" name="GENDER" checked="checked" value="1" /><label for="male-1" class="hand">男</label>
- </td>
- <td width="15%">Email:</td>
- <td width="35%"><input name="EMAIL" type="text" maxlength="30"class="validate[custom[email]]" ></td>
-
- </tr>
- <tr>
- <td width="15%">座机电话号码:</td>
- <td width="35%"><input name="OFFICE_PHONE" type="text" maxlength="15"class=" validate[custom[onlyNumber]],length[0,15]" /></td>
- <td width="15%">手机:</td>
- <td width="35%"><input name="MOBILE" type="text" maxlength="11" /></td>
- </tr>
-
- <!-- <tr>
- <td width="15%">Email:</td>
- <td width="35%"><input name="EMAIL_880" type="text" maxlength="30" style="width:90%" class="validate[custom[email]]" ></td>
- </tr>
- <tr>
- <td width="15%">描述:</td>
- <td width="35%" colspan="3" >
- <textarea name="DESCRIPTION_880" style="width:98%"></textarea>
- </td>
- </tr> -->
- </table>
- </form>
- <%
- String objectId = request.getParameter("objectId") == null ? "" : request.getParameter("objectId");
- %>
- <script type="text/javascript">
- $('#back').bind('click',function(){
- $('#frmright',window.parent.document).attr('src',$.pathname()+"/page/system/user/User_List.jsp");
- });
- var flagAdd_Edit = "";
- var fd_id="";
- var resetValue = {};
-
- $(function(){
-
- $("#LOGIN_NAME").focus();
-
- $("#PASSWORD2").on("click",function(){
- $("#pwdErr").hide();
- });
- //$("#LOGIN_NAME").css("width","80px");
- // 绑定表单提交按钮和重置按钮
- $("#save").bind("click", function() {
- submitInfo();
- });
-
- $("#cancel").bind("click", function() {
- reset_input();
- });
-
- $("#goback").bind("click", function() {
- goBack();
- });
- //给下拉框赋值--常量表中的
- /* $("#ROLE_ID").initCanstSelect('BM_EMERGENCY_ROLE'); */
-
- $.post('/nwyj/ws/sys/UserRoleRelService/getRoleSelect1',function(data){
- $("#ROLE_ID_SHOW").attr("data",JSON.stringify(data));
- $("#ROLE_ID_SHOW").render();
- }, "json");
-
-
-
- //加载部门组件
- $("#DEPT_ID").OrgSel();
-
- var iframe = window.parent.document.getElementById("frmright");
- var iframeUrl = iframe.src;
-
- // 根据地址信息进行判断是新增 还是修改
- if ((iframeUrl).indexOf('?') > -1) {
- $(".spanMsg").hide();
- //修改
- flagAdd_Edit = "edit";
- $("#userEditTitle").html("修改用户信息");
- //设置登录名的样式
- $loginName = $("#LOGIN_NAME");
- $loginName.attr("readOnly",true);
-
-
-
- fd_id = (iframeUrl).split('?')[1];
- var params = {objectID : fd_id};
- $.ajax({
- url : $.pathname() + '/ws/sys/UserService/getDataById/',
- type : 'post',
- timeout : 15000,
- data : params,
- dataType : 'json',
- success : function(data){
- //alert(JSON.stringify(data))
-
- data = removeNull(data);
-
-
-
- $('#UserInfoForm').ajaxWrite({data:data});
- resetValue = data;
- $("#show_DEPT_ID").val(data.DEPT_NAME);
- $("#DEPT_ID").val(data.DEPT_ID);
- //$("#ROLE_ID_SHOW").attr("selectedValue",data.ROLE_ID);
- //$("#ROLE_ID_SHOW").render();
- },
- error : function(e){
- $.messager.alert('系统提示信息', '访问服务失败!', 'error');
- }
- });
-
- }else{
-
- //设置登录名的样式
- $loginName = $("#LOGIN_NAME");
- var ajaxClass = "validate[ajax["+$.pathname()+"/ws/sys/UserService/validateLoginName/|* 用户名已存在!]]";
- $loginName.addClass(ajaxClass);
- //新增
- flagAdd_Edit = "add";
- $("#userEditTitle").html("新增新用户");
-
-
- }
-
-
- /*var url = $.pathname() + '/ws/sys/constantService/getQuiConstantByName/';
-
- $TYPE_880 =$('select[name=TYPE_880]');
- $.post(url,{name:'BM$_UserType'},function(result){
- //赋给data属性
- $TYPE_880.data("data",result);
- $TYPE_880.render();
- },"json");
-
- $USE_STATE_880 =$('select[name=USE_STATE_880]');
- $.post(url,{name:'BM$_YesNo'},function(result){
- //赋给data属性
- $USE_STATE_880.data("data",result);
- $USE_STATE_880.render();
- },"json")
-
- $VEDIO_STATE_880 =$('select[name=VEDIO_STATE_880]');
- $.post(url,{name:'BM$_YesNo'},function(result){
- //赋给data属性
- $VEDIO_STATE_880.data("data",result);
- $VEDIO_STATE_880.render();
-
- },"json") ; */
- });
- //自定义密码验证规则
- function funcvalidate(){
- var patt= /(?!^(\d+|[a-zA-Z]+|[~!@#$%^&*?]+)$)^[\w~!@#$%\^&*?]{8,20}$/g;
- var pwd = $("input[name=PASSWORD]").val();
-
- if(patt.test(pwd)){
- return false;
- }
- return true;
- }
- // 设定新增与修改的界面和方法 --点击保存按钮后触发事件
- function submitInfo() {
- var pwd1 = $("#PASSWORD").val();
- var pwd2 = $("#PASSWORD2").val();
- if(pwd1!=pwd2){
- $("#pwdErr").addClass("star").text("密码输入不一致,请重新输入").css("font-size","14px").show();
- return;
- }
- addValidate();
-
- };
- // 新增表单验证
- function addValidate() {
- var valid = $("#UserInfoForm").validationEngine({
- returnIsValid : true
- });
- if (valid == true) {
- addfn();
- } else {
- top.Dialog.alert('表单填写不正确,请按要求填写!');
- }
- }
- // 修改表单验证
- function editValidate() {
- if($("#PASSWORD").val()==""){
- //设置密码样式
- $loginName = $("#PASSWORD");
- $loginName.attr("class","");
- $loginName2 = $("#PASSWORD2");
- $loginName2.attr("class","");
-
- }
- var valid = $("#UserInfoForm").validationEngine({
- returnIsValid : true
- });
-
- if (valid == true) {
- editfn();
- } else {
- top.Dialog.alert('表单填写不正确,请按要求填写!');
- }
- }
- // 修改事件
- function editfn() {
-
- $form = $("#UserInfoForm");
- //多角色
- $("#ROLE_ID").val($("#ROLE_ID_SHOW").attr("relValue"));
-
- $("#ROLE_ID_NAME").val($("#ROLE_ID_SHOW").attr("relText"));
- //新增用户前台md5加密
- var md5passWord=md5($("#PASSWORD").val());
- $("#PASSWORD").val(md5passWord);
- var formValue = $form.serialize();
- var url = $.pathname() + "/ws/sys/UserService/update/";
- $.ajax({
- url : url,
- type : "post",
- timeout : 60000,
- data : formValue,
- dataType : "json",
- async : false,
- success : function(data) {
- if (data.success == "true") {
- top.Dialog.alert("修改成功");
- goBack();
- }
- if (data.success == "false") {
- top.Dialog.alert("修改失败");
- }
- },
- error : function() {
- top.Dialog.alert("修改失败,稍后再试...");
- }
- });
- };
- // 新增事件
- function addfn() {
- $form = $("#UserInfoForm");
- //多角色
- $("#ROLE_ID").val($("#ROLE_ID_SHOW").attr("relValue"));
- $("#ROLE_ID_NAME").val($("#ROLE_ID_SHOW").attr("relText"));
- //新增用户前台md5加密
- var md5passWord=md5($("#PASSWORD").val());
- $("#PASSWORD").val(md5passWord);
- var formValue = $form.serialize();
- var url = $.pathname() + "/ws/sys/UserService/create/";
- $.ajax({
- url : url,
- type : "post",
- timeout : 60000,
- data : formValue,
- dataType : "json",
- async : false,
- success : function(data) {
- if (data.success == "true") {
- top.Dialog.alert("新增成功");
- goBack();
- }
- if (data.success == "false") {
- top.Dialog.alert("新增失败");
- }
- },
- error : function() {
- top.Dialog.alert("新增失败,稍后再试...");
- }
- });
- };
- // 返回按钮 返回到外部机构列表
- function goBack() {
- var url = $.pathname() + '/page/system/user/User_List.jsp';
- window.parent.document.getElementById("frmright").setAttribute("src", url);
- }
- // 重置按钮
- function reset_input() {
- if (fd_id!="") {
- var url = $.pathname() + '/page/system/user/UserEdit.jsp?'+fd_id;
- window.parent.document.getElementById("frmright")
- .setAttribute("src", url);
- }else{
- var url = $.pathname() + '/page/system/user/UserEdit.jsp';
- window.parent.document.getElementById("frmright")
- .setAttribute("src", url);
- }
- /* $("#LIAISON_NAME_210").val(resetValue.LIAISON_NAME_210);
- $("#PHONE_210").val(resetValue.PHONE_210);
- $("#ORG_TYPE_210").resetValue();
- $("#ORG_ADDRESS_210").val(resetValue.ORG_ADDRESS_210);
- $("#CODE_210").val(resetValue.CODE_210);
- $("#LANDLINE_210").val(resetValue.LANDLINE_210);
- $("#FAX_210").val(resetValue.FAX_210);
- $("#EMAIL_210").val(resetValue.EMAIL_210);
- $("#SITE_210").val(resetValue.SITE_210);
- // 重置联动部门
- $("#LINK_DEPT_210").attr("relValue", Dname);
- $("#LINK_DEPT_210").attr("relText", DnameShow);
- $("#LINK_DEPT_210").find("input:text").val(DnameShow);
- // 重置联动联系人
- $("#LINK_MAN_210").attr("relValue", Lname);
- $("#LINK_MAN_210").attr("relText", LnameShow);
- $("#LINK_MAN_210").find("input:text").val(LnameShow); */
- }
-
-
- </script>
- </body>
|