|
@@ -0,0 +1,329 @@
|
|
|
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
|
|
+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
|
|
+<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
|
|
|
+<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
|
|
|
+<%
|
|
|
+ String base = pageContext.getServletContext().getContextPath();
|
|
|
+%>
|
|
|
+<!--_meta 作为公共模版分离出去-->
|
|
|
+<!DOCTYPE HTML>
|
|
|
+<html>
|
|
|
+<head>
|
|
|
+ <meta charset="utf-8">
|
|
|
+ <script type="text/javascript">
|
|
|
+ window.UEDITOR_SERVER_URL = '<%=base%>';
|
|
|
+ </script>
|
|
|
+ <meta name="renderer" content="webkit|ie-comp|ie-stand">
|
|
|
+ <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
|
|
+ <meta name="viewport"
|
|
|
+ content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
|
|
|
+ <meta http-equiv="Cache-Control" content="no-siteapp"/>
|
|
|
+ <LINK rel="Bookmark" href="/favicon.ico">
|
|
|
+ <LINK rel="Shortcut Icon" href="/favicon.ico"/>
|
|
|
+
|
|
|
+ <link rel="stylesheet" type="text/css"
|
|
|
+ href="${pageContext.request.contextPath}/static/admin/index/h-ui/css/H-ui.min.css"/>
|
|
|
+ <link rel="stylesheet" type="text/css"
|
|
|
+ href="${pageContext.request.contextPath}/static/admin/index/h-ui.admin/css/H-ui.admin.css"/>
|
|
|
+ <link rel="stylesheet" type="text/css"
|
|
|
+ href="${pageContext.request.contextPath}/static/admin/index/Hui-iconfont/1.0.8/iconfont.css"/>
|
|
|
+ <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/admin/icheck/icheck.css"/>
|
|
|
+ <link rel="stylesheet" type="text/css"
|
|
|
+ href="${pageContext.request.contextPath}/static/admin/index/h-ui.admin/skin/default/skin.css" id="skin"/>
|
|
|
+ <link rel="stylesheet" type="text/css"
|
|
|
+ href="${pageContext.request.contextPath}/static/admin/index/h-ui.admin/css/style.css"/>
|
|
|
+
|
|
|
+ <script type="text/javascript"
|
|
|
+ src="${pageContext.request.contextPath}/static/admin/index/jquery/1.9.1/jquery.min.js"></script>
|
|
|
+ <script type="text/javascript" src="${pageContext.request.contextPath}/static/admin/index/layer/layer.js"></script>
|
|
|
+ <script type="text/javascript"
|
|
|
+ src="${pageContext.request.contextPath}/static/admin/js/jquery.validate.min.js"></script>
|
|
|
+ <script type="text/javascript"
|
|
|
+ src="${pageContext.request.contextPath}/static/admin/js/validate-methods.js"></script>
|
|
|
+ <script type="text/javascript" src="${pageContext.request.contextPath}/static/admin/js/messages_zh.min.js"></script>
|
|
|
+ <script type="text/javascript"
|
|
|
+ src="${pageContext.request.contextPath}/static/admin/icheck/jquery.icheck.min.js"></script>
|
|
|
+ <script src="${pageContext.request.contextPath}/static/admin/manage/js/WdatePicker.js"></script>
|
|
|
+
|
|
|
+ <script type="text/javascript">
|
|
|
+ window.onunload = function() {
|
|
|
+ window.location.href="adminsList.html"
|
|
|
+ };
|
|
|
+ $(function () {
|
|
|
+ $("#sub").click(function () {
|
|
|
+ var loginname = $("#loginname").val();
|
|
|
+ var name = $("#name").val();
|
|
|
+ var telephone = $("#telephone").val();
|
|
|
+ var province = $("#s_province").val();
|
|
|
+ var city = $("#s_city").val();
|
|
|
+ var district = $("#s_county").val();
|
|
|
+ var street = $("#street").val();
|
|
|
+ var bornDate = $("#bornDate").val();
|
|
|
+ var authPhone_reg = /^((13[0-9])|(14[5|7])|(15([0-3]|[5-9]))|(16[0-9])|(17[0-9])|(18[0-9]))\d{8}$|^((13[0-9])|(14[5|7])|(15([0-3]|[5-9]))|(16[0-9])|(17[0-9])|(18[0-9]))\d{8}$|^0\d{2,3}-?\d{7,8}$/;
|
|
|
+ if (loginname == null || loginname == ""){
|
|
|
+ layer.msg("账号不能为空");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (name == null || name == ""){
|
|
|
+ layer.msg("姓名不能为空");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if(telephone == null || telephone == ''){
|
|
|
+ layer.msg("电话不能为空");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if(province == '省'){
|
|
|
+ layer.msg("省份不能为空");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (city ==' - 市'){
|
|
|
+ layer.msg("城市不能为空");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (district==' - 县/区'){
|
|
|
+ layer.msg("区域不能为空");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (street == null || street == ''){
|
|
|
+ layer.msg("街道不能为空");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (bornDate == null || bornDate == ''){
|
|
|
+ layer.msg("出生日期不能为空");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (!(authPhone_reg.test(telephone))) {
|
|
|
+ layer.msg("用户电话不正确~");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ var formData = new FormData();
|
|
|
+ formData.append("id",$("#id").val());//id
|
|
|
+ formData.append("loginname",$("#loginname").val());//账号
|
|
|
+ formData.append("name",$("#name").val());//姓名
|
|
|
+ formData.append("telephone",$("#telephone").val());//电话
|
|
|
+ formData.append("state",$("#state").val());//状态
|
|
|
+ formData.append("province",$("#s_province").val());//省
|
|
|
+ formData.append("city",$("#s_city").val());//市
|
|
|
+ formData.append("district",$("#s_county").val());//区
|
|
|
+ formData.append("street",$("#street").val());//街道
|
|
|
+ formData.append("formatDate",$("#bornDate").val())//出生日期
|
|
|
+
|
|
|
+ $.ajax({
|
|
|
+ type:"POST",
|
|
|
+ url:"adminsUpdates.html",
|
|
|
+ data:formData,
|
|
|
+ dataType:"json",
|
|
|
+ cache: false,
|
|
|
+ async : false,
|
|
|
+ processData: false,
|
|
|
+ contentType: false,
|
|
|
+ success:function (ajax) {
|
|
|
+ if (ajax.is){
|
|
|
+ layer.msg(ajax.msg);
|
|
|
+ layer.alert(ajax.msg, {skin: 'layui-layer-molv', closeBtn: 0, anim: 4}, function () {
|
|
|
+ var index = parent.layer.getFrameIndex(window.name);
|
|
|
+ parent.layer.close(index);
|
|
|
+ });
|
|
|
+
|
|
|
+ } else {
|
|
|
+ layer.msg(ajax.msg);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ });
|
|
|
+ });
|
|
|
+ </script>
|
|
|
+
|
|
|
+ <title>管理员管理</title>
|
|
|
+</head>
|
|
|
+<body>
|
|
|
+<nav class="breadcrumb">
|
|
|
+ <i class="Hui-iconfont"></i> 首页 <span class="c-gray en">></span><a href="javascript:history.go(-1)" title="用户管理">用户管理</a><span class="c-gray en">></span> 添加
|
|
|
+ <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px"
|
|
|
+ href="javascript:location.replace(location.href);" title="刷新"><i class="Hui-iconfont"></i></a>
|
|
|
+</nav>
|
|
|
+<article class="page-container">
|
|
|
+ <form class="form form-horizontal" id="subform">
|
|
|
+
|
|
|
+ <div class="row cl">
|
|
|
+ <label class="form-label col-xs-4 col-sm-1"><span class="c-red">*</span>账号:</label>
|
|
|
+ <div class="formControls col-xs-8 col-sm-9">
|
|
|
+ <input type="text" class="input-text" name="loginname" id="loginname" value="${admins.loginname}">
|
|
|
+ <input type="text" hidden class="input-text" name="id" id="id" value="${admins.id}">
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="row cl">
|
|
|
+ <label class="form-label col-xs-4 col-sm-1">启/禁用:</label>
|
|
|
+ <div class="formControls col-xs-8 col-sm-9">
|
|
|
+ <select name="state" id="state" class="input-text">
|
|
|
+ <c:if test="${admins.state == '0'}">
|
|
|
+ <option value="0" selected>禁用</option>
|
|
|
+ <option value="1" >启用</option>
|
|
|
+ </c:if>
|
|
|
+ <c:if test="${admins.state == '1'}">
|
|
|
+ <option value="0" >禁用</option>
|
|
|
+ <option value="1" selected>启用</option>
|
|
|
+ </c:if>
|
|
|
+ </select>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="row cl">
|
|
|
+ <label class="form-label col-xs-4 col-sm-1"><span class="c-red">*</span>姓名:</label>
|
|
|
+ <div class="formControls col-xs-8 col-sm-9">
|
|
|
+ <input type="text" class="input-text" name="name" id="name" value="${admins.name}">
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="row cl">
|
|
|
+ <label class="form-label col-xs-4 col-sm-1"><span class="c-red">*</span>电话:</label>
|
|
|
+ <div class="formControls col-xs-8 col-sm-9">
|
|
|
+ <input type="text" class="input-text" name="telephone" id="telephone" value="${admins.telephone}">
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="row cl">
|
|
|
+ <label class="form-label col-xs-4 col-sm-1"><span class="c-red">*</span>省,市,区:</label>
|
|
|
+ <div class="formControls col-xs-8 col-sm-9">
|
|
|
+ <select id="s_province" name ="province" onchange="provinceChange(this.value)" style="width: 100px;height: 30px;font-size: 14px">
|
|
|
+
|
|
|
+ <c:forEach items="${province}" var="province">
|
|
|
+ <option value="${province.addrCode}" <c:if test="${province.addrCode == admins.province}">selected="selected"</c:if>>${province.addrName}</option>
|
|
|
+ </c:forEach>
|
|
|
+ </select>
|
|
|
+ <select id="s_city" name ="city" onchange="cityChange(this.value)" style="width: 100px;height: 30px;font-size: 14px">
|
|
|
+ <c:forEach items="${city}" var="city">
|
|
|
+ <option value="${city.addrCode}" <c:if test="${admins.city == city.addrCode}">selected="selected"</c:if> >${city.addrName}</option>
|
|
|
+ </c:forEach>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="s_county" name ="district" style="width: 100px;height: 30px;font-size: 14px">
|
|
|
+ <c:forEach items="${district}" var="district">
|
|
|
+ <option value="${district.addrCode}" <c:if test="${admins.district == district.addrCode}">selected="selected"</c:if> >${district.addrName}</option>
|
|
|
+ </c:forEach>
|
|
|
+ </select>
|
|
|
+ </div>
|
|
|
+ <%-- <div id="show"></div>--%>
|
|
|
+ </div>
|
|
|
+ <div class="row cl">
|
|
|
+ <label class="form-label col-xs-4 col-sm-1"><span class="c-red">*</span>街道:</label>
|
|
|
+ <div class="formControls col-xs-8 col-sm-9">
|
|
|
+ <input type="text" class="input-text" name="street" id="street" value="${admins.street}">
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="row cl" >
|
|
|
+ <label class="form-label col-xs-4 col-sm-1"><span class="c-red">*</span>出生日期:</label>
|
|
|
+ <div class="formControls col-xs-8 col-sm-9">
|
|
|
+ <input type="text" id="bornDate" name="bornDate" value="${admins.formatDate}" onfocus="WdatePicker({ Date:'#F{$dp.$D(\'datemax\')||\'%y-%M-%d\'}' })" class="input-text Wdate" >
|
|
|
+ <input type="text" hidden onfocus="WdatePicker({ minDate:'#F{$dp.$D(\'datemin\')}',maxDate:'%y-%M-%d' })" class="input-text Wdate" style="width:120px;">
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="row cl">
|
|
|
+ <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-1">
|
|
|
+ <button type="button" class="btn btn-primary radius" id="sub" name="admin-role-save"><i class="Hui-iconfont"></i> 提交</button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </form>
|
|
|
+</article>
|
|
|
+
|
|
|
+<!--请在下方写此页面业务相关的脚本-->
|
|
|
+<!-- 百度文本编辑器 引用文件 -->
|
|
|
+<link href="<%=base%>/static/ue/themes/default/css/ueditor.css" type="text/css" rel="stylesheet">
|
|
|
+<script src="<%=base%>/static/ue/ueditor.config.js" type="text/javascript"></script>
|
|
|
+<script src="<%=base%>/static/ue/ueditor.all.js" type="text/javascript"></script>
|
|
|
+<script type="text/javascript" src="<%=base%>/static/ue/lang/zh-cn/zh-cn.js"></script>
|
|
|
+
|
|
|
+<!-- 百度文本编辑器 js -->
|
|
|
+<script type="text/javascript">
|
|
|
+
|
|
|
+ /*根据选择省份展示该省份下的城市*/
|
|
|
+ function provinceChange(provinceVal){
|
|
|
+ $.ajax({
|
|
|
+ type:"POST",
|
|
|
+ url:"listCityByAddrCode.html",
|
|
|
+ data:{"addrCode":provinceVal.toString()},
|
|
|
+ dataType:"json",
|
|
|
+ success:function(ajax){
|
|
|
+ if (ajax.is){
|
|
|
+ $("#s_city").html('<option value=" - 市"> - 市</option>');
|
|
|
+ var str = "";
|
|
|
+ for (var i = 0; i < ajax.data.length; i++){
|
|
|
+ str += '<option value=" '+ajax.data[i].addrCode+' ">'+ajax.data[i].addrName+'</option>';
|
|
|
+ };
|
|
|
+ $("#s_city").append(str);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ /*根据选择城市展示该城市下的区域*/
|
|
|
+ function cityChange(cityVal){
|
|
|
+ $.ajax({
|
|
|
+ type:"POST",
|
|
|
+ url:"listDistrictByAddrCode.html",
|
|
|
+ data:{"addrCode":cityVal.toString()},
|
|
|
+ dataType:"json",
|
|
|
+ success:function(ajax){
|
|
|
+ if (ajax.is){
|
|
|
+ $("#s_county").html('<option value=" - 县/区"> - 县/区</option>');
|
|
|
+ var str = "";
|
|
|
+ for (var i = 0; i < ajax.data.length; i++){
|
|
|
+ str += '<option value=" '+ajax.data[i].addrCode+' ">'+ajax.data[i].addrName+'</option>';
|
|
|
+ };
|
|
|
+ $("#s_county").append(str);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ $(function () {
|
|
|
+ var ue = UE.getEditor('introduction', {
|
|
|
+ //关闭字数统计
|
|
|
+ wordCount: false,
|
|
|
+ toolbars: [['fullscreen', 'source', '|', 'undo', 'redo', '|',
|
|
|
+ 'bold', 'italic', 'underline', 'fontborder', 'strikethrough', 'superscript', 'subscript', 'removeformat', 'formatmatch', 'autotypeset', 'blockquote', 'pasteplain', '|', 'forecolor', 'backcolor', 'insertorderedlist', 'insertunorderedlist', 'selectall', 'cleardoc', '|',
|
|
|
+ 'rowspacingtop', 'rowspacingbottom', 'lineheight', '|',
|
|
|
+ 'customstyle', 'paragraph', 'fontfamily', 'fontsize', '|',
|
|
|
+ 'directionalityltr', 'directionalityrtl', 'indent', '|',
|
|
|
+ 'justifyleft', 'justifycenter', 'justifyright', 'justifyjustify', '|', 'touppercase', 'tolowercase', '|',
|
|
|
+ 'link', 'unlink', 'anchor', '|', 'imagenone', 'imageleft', 'imageright', 'imagecenter', '|',
|
|
|
+ 'insertimage', 'emotion', 'insertvideo', 'attachment', 'map', 'template', 'background', '|',
|
|
|
+ 'horizontal', 'date', 'time', 'spechars', 'wordimage', '|',
|
|
|
+ 'inserttable', 'deletetable', 'insertparagraphbeforetable', 'insertrow', 'deleterow', 'insertcol', 'deletecol', 'mergecells', 'mergeright', 'mergedown', 'splittocells', 'splittorows', 'splittocols', 'charts', '|',
|
|
|
+ 'print', 'preview', 'searchreplace', 'help'
|
|
|
+ ]],
|
|
|
+ //关闭elementPath
|
|
|
+ elementPathEnabled: false,
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
+ var currentBrowserId;
|
|
|
+
|
|
|
+ function browserImage(targetId) {
|
|
|
+ currentBrowserId = targetId;
|
|
|
+ var weboxTemp = $.webox({
|
|
|
+ height: 600,
|
|
|
+ width: 1024,
|
|
|
+ bgvisibel: true,
|
|
|
+ title: '图片管理',
|
|
|
+ iframe: '<%=base%>/admin/image/imgbox.html?' + Math.random()
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ function setImagepath(imgPath) {
|
|
|
+ $('#' + currentBrowserId).val(imgPath);
|
|
|
+ }
|
|
|
+
|
|
|
+ function closeFrame() {
|
|
|
+ $('#locked .span').click();
|
|
|
+ }
|
|
|
+</script>
|
|
|
+
|
|
|
+
|
|
|
+<!--请在下方写此页面业务相关的脚本-->
|
|
|
+<script type="text/javascript">
|
|
|
+</script>
|
|
|
+<!--/请在上方写此页面业务相关的脚本-->
|
|
|
+</body>
|
|
|
+</html>
|