|
@@ -5,20 +5,25 @@
|
|
|
<title>组织用户信息</title>
|
|
|
<meta name="decorator" content="default"/>
|
|
|
<style>
|
|
|
- .control-group{
|
|
|
+ .control-group {
|
|
|
width: 100%;
|
|
|
height: 60px;
|
|
|
border-bottom: none;
|
|
|
box-sizing: border-box;
|
|
|
padding: 10px 0;
|
|
|
}
|
|
|
- .control-label{
|
|
|
+
|
|
|
+ .control-label {
|
|
|
width: 100px;
|
|
|
text-align: right;
|
|
|
float: left;
|
|
|
line-height: 40px;
|
|
|
margin-right: 5px;
|
|
|
}
|
|
|
+
|
|
|
+ .red {
|
|
|
+ color: red;
|
|
|
+ }
|
|
|
</style>
|
|
|
</head>
|
|
|
<body>
|
|
@@ -27,50 +32,106 @@
|
|
|
<li><a href="${ctx}/weisha/cmMallUser/getMallUser?organizeId=${cmMallOrganize.id}">后台用户</a></li>
|
|
|
<li class="active"><a href="${ctx}/weisha/cmMallUser/mallUserForm?id=${mallUserInfo.id}&organizeId=${mallUserInfo.organizeId}">${mallUserInfo.id eq null ? "添加" : "编辑"}</a></li>
|
|
|
</ul>
|
|
|
-<form:form id="searchForm" modelAttribute="mallUserInfo" action="${ctx}/weisha/cmMallUser/save" method="post" class="breadcrumb form-search">
|
|
|
- <form:hidden path="organizeId" value="${mallUserInfo.organizeId}" />
|
|
|
+<form:form id="searchForm" modelAttribute="mallUserInfo" action="${ctx}/weisha/cmMallUser/save" method="post"
|
|
|
+ class="breadcrumb form-search">
|
|
|
+ <form:hidden path="id" value="${mallUserInfo.id}"/>
|
|
|
+ <form:hidden path="organizeId" value="${mallUserInfo.organizeId}"/>
|
|
|
<div class="ul-form">
|
|
|
<div class="control-group">
|
|
|
- <label class="control-label">姓名:</label>
|
|
|
+ <label class="control-label"><span class="red">*</span>姓名:</label>
|
|
|
<div class="controls">
|
|
|
- <form:input path="account" class="input-xlarge required" maxlength="11" />
|
|
|
+ <form:input path="account" htmlEscape="false" class="input-xlarge required" maxlength="11"
|
|
|
+ placeholder="最多10个字"/>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="control-group">
|
|
|
- <label class="control-label">手机号:</label>
|
|
|
+ <label class="control-label"><span class="red">*</span>手机号:</label>
|
|
|
<div class="controls">
|
|
|
- <form:input path="accountName" class="input-xlarge required" maxlength="11" />
|
|
|
+ <form:input path="accountName" htmlEscape="false" class="input-xlarge required" maxlength="11" placeholder="请输入手机号"/>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="control-group">
|
|
|
<label class="control-label">状态:</label>
|
|
|
<div class="controls">
|
|
|
<form:select path="status">
|
|
|
- <form:option value="1" label="上线" />
|
|
|
- <form:option value="2" label="下线" />
|
|
|
+ <form:option value="1" label="上线"/>
|
|
|
+ <form:option value="2" label="下线"/>
|
|
|
</form:select>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="control-group">
|
|
|
- <label class="control-label">密码:</label>
|
|
|
+ <label class="control-label"><span class="red">*</span>密码:</label>
|
|
|
<div class="controls">
|
|
|
- <form:input path="password" type="password" id="password" class="input-xlarge required" maxlength="16" />
|
|
|
+ <form:input path="password" htmlEscape="false" type="password" id="password" class="input-xlarge required" maxlength="16"
|
|
|
+ placeholder="请输入8-16字母和数字的组合"/>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="control-group">
|
|
|
- <label class="control-label">确认密码:</label>
|
|
|
+ <label class="control-label"><span class="red">*</span>确认密码:</label>
|
|
|
<div class="controls">
|
|
|
- <form:input path="confirmPassword" type="password" id="confirmPassword" class="input-xlarge required" maxlength="16" />
|
|
|
+ <form:input path="confirmPassword" type="password" id="confirmPassword" class="input-xlarge required"
|
|
|
+ maxlength="16" placeholder="请再次输入密码"/>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="control-group">
|
|
|
- <input id="btnSubmit" class="btn btn-primary" type="button" value="保 存" onclick="userSubmit()"/>
|
|
|
- <input class="btn btn-primary" type="button" value="返回" onclick="history.go(-1)"/>
|
|
|
+ <input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>
|
|
|
+ <input class="btn btn-primary" type="button" value="返回" onclick="history.go(-1)"/>
|
|
|
</div>
|
|
|
<div class="clearfix"></div>
|
|
|
</div>
|
|
|
</form:form>
|
|
|
-<script type="text/javascript">
|
|
|
+<script type="text/javascript">
|
|
|
+ $(document).ready(function () {
|
|
|
+
|
|
|
+ //$("#name").focus();
|
|
|
+ $("#searchForm").validate({
|
|
|
+ submitHandler: function (form) {
|
|
|
+ var account = 0
|
|
|
+ var password = $("#password").val();
|
|
|
+ var confirmPassword = $("#confirmPassword").val();
|
|
|
+ var accountName = $("#accountName").val();
|
|
|
+ debugger
|
|
|
+ $.ajax({
|
|
|
+ type: 'get',
|
|
|
+ dataType: 'json',
|
|
|
+ data:$("#searchForm").serialize(),
|
|
|
+ url: '${ctx}/weisha/cmMallUser/account',
|
|
|
+ async: false,
|
|
|
+ success: function (data) {
|
|
|
+ account = data
|
|
|
+ }
|
|
|
+ });
|
|
|
+ if (account == 0) {
|
|
|
+ top.$.jBox.confirm("用户名已存在,请勿重复添加", '提示');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ // if (password.length >= 8 && password.length <= 16 ) {
|
|
|
+ if (!(/^(?![0-9]+$)(?![a-zA-Z]+$)[A-Za-z0-9]{8,16}$/.test(password))) {
|
|
|
+ top.$.jBox.confirm("请输入正确格式的密码", '提示');
|
|
|
+ return false;
|
|
|
+ // }
|
|
|
+ } else if (!(/^1[3456789][0-9]{9}$/.test(accountName))) {
|
|
|
+ top.$.jBox.confirm("请输入正确的手机号", '提示');
|
|
|
+ return false;
|
|
|
+ } else if (password !== confirmPassword) {
|
|
|
+ top.$.jBox.confirm("两次密码不一致", '提示');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ loading('正在提交,请稍等...');
|
|
|
+ form.submit();
|
|
|
+ },
|
|
|
+ errorContainer: "#messageBox",
|
|
|
+ errorPlacement: function (error, element) {
|
|
|
+ $("#messageBox").text("输入有误,请先更正。");
|
|
|
+ if (element.is(":checkbox") || element.is(":radio") || element.parent().is(".input-append")) {
|
|
|
+ error.appendTo(element.parent().parent());
|
|
|
+ } else {
|
|
|
+ error.insertAfter(element);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
function userSubmit() {
|
|
|
var form = $("#searchForm");
|
|
|
var account = $("#account").val();
|
|
@@ -79,28 +140,28 @@
|
|
|
var accountName = $("#accountName").val();
|
|
|
debugger
|
|
|
if (null == account || "" == account) {
|
|
|
- top.$.jBox.confirm("请输入姓名",'提示');
|
|
|
- return;
|
|
|
+ top.$.jBox.confirm("请输入姓名", '提示');
|
|
|
+ return false;
|
|
|
}
|
|
|
- if (password.length >= 8 && password.length <= 16 ) {
|
|
|
+ if (password.length >= 8 && password.length <= 16) {
|
|
|
if (!(/^(?![0-9]+$)(?![a-zA-Z]+$)[A-Za-z0-9]{8,16}$/.test(password))) {
|
|
|
- top.$.jBox.confirm("请输入正确格式的密码",'提示');
|
|
|
- return;
|
|
|
+ top.$.jBox.confirm("请输入正确格式的密码", '提示');
|
|
|
+ return false;
|
|
|
}
|
|
|
} else {
|
|
|
- top.$.jBox.confirm("请输入正确格式的密码",'提示');
|
|
|
- return;
|
|
|
+ top.$.jBox.confirm("请输入正确格式的密码", '提示');
|
|
|
+ return false;
|
|
|
}
|
|
|
if (!(/^1[3456789][0-9]{9}$/.test(accountName))) {
|
|
|
- top.$.jBox.confirm("请输入正确的手机号",'提示');
|
|
|
- return;
|
|
|
+ top.$.jBox.confirm("请输入正确的手机号", '提示');
|
|
|
+ return false;
|
|
|
}
|
|
|
// debugger
|
|
|
if (password !== confirmPassword) {
|
|
|
- top.$.jBox.confirm("两次密码不一致",'提示');
|
|
|
- return;
|
|
|
+ top.$.jBox.confirm("两次密码不一致", '提示');
|
|
|
+ return false;
|
|
|
}
|
|
|
- form.submit();
|
|
|
+ // form.submit();
|
|
|
}
|
|
|
</script>
|
|
|
</body>
|