wbm_edit.jsp 4.9 KB
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: lenovo
  Date: 2019/3/15
  Time: 16:24
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<html>
<head>
    <title>Title</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link href="<%=basePath %>resource/css/base.css" rel="stylesheet">
    <link href="<%=basePath %>resource/css/basic_info.css" rel="stylesheet">
    <link rel="stylesheet" href="<%=basePath %>resource/easyui/uimaker/easyui.css">
    <link href="<%=basePath %>resource/css/form.css" rel="stylesheet">
    <link rel="stylesheet" href="<%=basePath %>resource/css/form.css">
    <script type="text/javascript" src="<%=basePath %>resource/easyui/jquery.min.js"></script>
    <script type="text/javascript" src="<%=basePath %>resource/validate/jquery.validate.js"></script>
    <script type="text/javascript" src="<%=basePath %>resource/validate/validate-extends.js"></script>

    <script type="text/javascript" src="<%=basePath %>resource/js/tools.js"></script>
    <!-- validate 验证中英文 -->
    <script type="text/javascript" src="<%=basePath %>resource/validate/jquery.validate-${pageContext.response.locale}.js"></script>
</head>
<body>
<div class="container">
    <div class="content">
        <form class="from-control" id="form">
            <input type="hidden" id="id" name="id" value="${manifest.id }">
            <div></div>
            <div>
                <table class="kv-table">
                    <tbody>
                        <div>
                            <tr class="kv-content" >
                                <td style="background-color: #EBEDF4; color: black;" class="kv-label" colspan="6"><spring:message code="wbm.loginName"/></td>
                                <td style="background-color: #EBEDF4; color: black;" class="kv-label" colspan="1">
                                    <%--<select id="user_update" required>--%>
                                        <%--<c:forEach var="user" items="${userList}">--%>
                                            <%--<option id = "${user.id}">${user.loginaccount}</option>--%>
                                        <%--</c:forEach>--%>
                                    <%--</select>--%>
                                        <input type="text" id = "loginaccount" name = "loginacciunt" value="${wbm.loginaccount}" required="required">
                                </td>
                                <td style="background-color: #EBEDF4; color: black;" class="kv-label" colspan="4">
                                    <button type="button"  class="layui-btn layui-btn-sm layui-icon layui-icon-user" id="subbtn">
                                        <i class="fa fa-trash hidden" aria-hidden="true"></i>提交
                                    </button>
                                </td>
                            </tr>
                            <%--<tr class="kv-content" style="float:left">--%>
                                <%--<td style="background-color: #EBEDF4; color: black;" class="kv-label" colspan="2">--%>
                                     <%----%>
                                <%--</td>--%>
                            <%--</tr>--%>
                        </div>
                    </tbody>
                </table>
            </div>
        </form>
    </div>
</div>

<script type="text/javascript">


    $("#subbtn").on("click",function () {
        var userId = "";
        console.log("success");

        var loginaccount = $("#loginaccount").val();
        var idss = $('#user_update>option:selected');
        idss.val(function(){
            userId = (this.id);
        });

        var ids = $("#id").val();
            $.ajax({
                type : 'POST',
                // contentType: 'application/json; charset=UTF-8',
                data : {
                    "ids" : ids,
                    "userId" : userId,
                    "loginaccount":loginaccount
                },
                url :"<%=basePath%>wbm/userUpdate",
                success : function(data) {
                    console.log(data)
                    if (data.status != 200) {
                        alert("该账号不存在");
                    }else {
                        // parent.reLoad();
                        alert("修改成功");
                        window.parent.location.reload();
                        var index = parent.layer.getFrameIndex(window.name); // 获取窗口索引
                        parent.layer.close(index);
                    }
                }
            });
    })


</script>
</body>
</html>