ICode9

精准搜索请尝试: 精确搜索
首页 > 编程语言> 文章详细

基于javaweb+jsp的小区物业管理系统

2021-12-06 23:02:38  阅读:118  来源: 互联网

标签:物业管理 javaweb edit find vo jsp modal 投诉 id


基于javaweb+jsp的小区物业管理系统

JavaWeb JavaBean JSP MVC MySQL Tomcat JavaScript

基础JSP+Servlet或JSP+SSM(Spring、SpringMVC、MyBatis)框架或JSP+SSM+Maven(pom.xml)框架…均可

开发工具:idea或eclipse或myeclipse

部分代码实现JSP

</script>
    $('#modal-info').on('show.bs.modal', function (event) {
        let button = $(event.relatedTarget);
        let id = button.data('id');
        let modal = $(this);
        $.ajax({
            url: 'complaintGet?id=' + id,
            type: "get",
            success: function (voString) {
                let vo = eval('(' + voString + ')');
                modal.find('#info-complaintName').text(vo.complaintName);
                modal.find('#info-complaintText').text(vo.complaintText);
                modal.find('#info-complaintOwner').text(vo.complaintOwner);
                modal.find('#info-complaintTime').text(vo.complaintTime);
                modal.find('#info-complaintStatus').text(vo.complaintStatus);
            }
        })
    })
    function searchList() {
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-line btn-rect btn-default" data-dismiss="modal">取消</button>
                    <button type="submit" class="btn btn-line btn-rect btn-default">提交</button>
                </div>
            </form>
        </div>
    </div>
</div>

<!-- info -->
<div class="modal fade" id="modal-info" tabindex="-1" role="dialog"
     aria-labelledby="myModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <form>
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">&times;</span>
                    </button>
    }
    //编辑表单提交之前进行检查,如果return false,则不允许提交
    function editCheck() {
        //根据ID获取值
        if (document.getElementById("edit-complaintName").value.trim().length == 0) {
            alert("主题不能为空");
            return false;
        }
        if (document.getElementById("edit-complaintOwner").value.trim().length == 0) {
            alert("投诉人不能为空");
            return false;
        }
        if (document.getElementById("edit-complaintTime").value.trim().length == 0) {
            alert("投诉时间不能为空");
            return false;
        }
        return true;
                                <button class="btn btn-line btn-rect btn-danger btn-sm" data-id="${vo.id}"
                                        data-toggle="modal" data-target="#modal-info">详情
                                </button>
                                <button class="btn btn-line btn-rect btn-primary btn-sm"
                                                <c:if test="${loginUser.userType != '管理员'}">disabled="disabled" title="没有权限!!!"</c:if>
                                        data-id="${vo.id}"
                                        data-toggle="modal" data-target="#modal-edit">编辑
                                </button>
                                <button class="btn btn-line btn-rect btn-warning btn-sm" <c:if test="${loginUser.userType != '管理员'}">disabled="disabled" title="没有权限!!!"</c:if> data-id="${vo.id}"
                                        data-toggle="modal" data-target="#modal-delete">删除
                                </button>
                            </th>
                        </tr>
            </div>
            <br>
            <br>
            <div class="table-responsive">
                <table class="table table-striped table-hover">
                    <thead>
                    <tr>
                            <th>主题</th>
                            <th>投诉人</th>
                            <th>投诉时间</th>
                            <th>处理状态</th>
                        <th style="text-align: center;">操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <c:forEach items="${list}" var="vo">
                        <tr>
                <td>${vo.complaintName}</td>
                <td>${vo.complaintOwner}</td>
                <td>${vo.complaintTime}</td>
                <td>${vo.complaintStatus}</td>
<%@ page contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>投诉 管理</title>
    <link rel="stylesheet" href="css/bootstrap.css">
    <link rel="stylesheet" href="css/main.css">
    <script src="js/jquery-3.5.1.js"></script>
    <script src="js/bootstrap.js"></script>
</head>

<body>
    <div class="container-fluid">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
                <span class="sr-only">小区物业管理系统</span> <span class="icon-bar"></span>
                <span class="icon-bar"></span> <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="#">小区物业管理系统</a>
        </div>
        <div id="navbar" class="navbar-collapse collapse">
            <ul class="nav navbar-nav navbar-right">
                <li><a href="#">欢迎:<span style="color: yellow">${loginUser.username}</span></a></li>
                <li><a href="authLogout">退出</a></li>
            </ul>
        </div>
    </div>
</nav>

<div class="container-fluid">
    <div class="row">
        <div class="col-sm-3 col-md-2 sidebar">
<script>
    $('#modal-delete').on('show.bs.modal', function (event) {
        let button = $(event.relatedTarget);
        let id = button.data('id');
        let modal = $(this);
        modal.find('#delete-id').val(id);
    })

    $('#modal-edit').on('show.bs.modal', function (event) {
        let button = $(event.relatedTarget);
        let id = button.data('id');
        let modal = $(this);
                        </tr>
                    </table>
                    <br>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-line btn-rect btn-default" data-dismiss="modal">关闭</button>
                </div>
            </form>
        </div>
    </div>
</div>

<!-- edit -->
<div class="modal fade" id="modal-edit" tabindex="-1" role="dialog"
     aria-labelledby="myModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
                <div class="modal-footer">
                    <button type="button" class="btn btn-line btn-rect btn-default" data-dismiss="modal">取消</button>
                    <button type="submit" class="btn btn-line btn-rect btn-default">提交</button>
                </div>
            </form>
        </div>
    </div>
</div>

<!-- delete -->
<div class="modal fade" id="modal-delete" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <form action="complaintDelete">
                <div class="modal-header">
            url: 'complaintGet?id=' + id,
            type: "get",
            success: function (voString) {
                let vo = eval('(' + voString + ')');
                        modal.find('#edit-id').val(vo.id);
                        modal.find('#edit-complaintName').val(vo.complaintName);
                        modal.find('#edit-complaintText').val(vo.complaintText);
                        modal.find('#edit-complaintOwner').val(vo.complaintOwner);
                        modal.find('#edit-complaintTime').val(vo.complaintTime);
                        for (let val of "已处理/待处理".split('/')) {
                            if (val == vo.complaintStatus) {
                                modal.find('#edit-complaintStatus_' + vo.complaintStatus).prop("checked", true);
                            } else {
                                modal.find('#edit-complaintStatus_' + vo.complaintStatus).removeAttr("checked");
                            }
                        };
            }
        })
                    </tbody>
                </table>
            </div>
            <div style="float: right;padding-right: 10px;color: #515151;"><jsp:include page="split.jsp"/></div>
        </div>
    </div>
</div>

<!-- add -->
<div class="modal fade" id="modal-add" tabindex="-1" role="dialog"
     aria-labelledby="myModalLabel">
    <div class="modal-dialog" role="document">
                        <label for="edit-complaintOwner" class="control-label">投诉人:</label>
                        <input type="text" class="form-control" name="complaintOwner" id="edit-complaintOwner">
                    </div>
                    <div class="form-group">
                        <label for="edit-complaintTime" class="control-label">投诉时间:</label>
                        <input type="text" class="form-control" name="complaintTime" id="edit-complaintTime">
                    </div>
                    <div class="form-group">
                        <label class="control-label">处理状态:</label>
                               <input name="complaintStatus" id="edit-complaintStatus_已处理" type="radio" value="已处理"/>已处理
                               <input name="complaintStatus" id="edit-complaintStatus_待处理" type="radio" value="待处理"/>待处理
                    </div>
                    <div class="form-group hidden">
                        <label for="edit-createTime" class="control-label">创建时间:</label>
                        <input type="text" class="form-control" name="createTime" id="edit-createTime">
                    </div>
                    </div>
                    <div class="form-group">
                        <label for="add-complaintOwner" class="control-label">投诉人:</label>
                        <input type="text" class="form-control" name="complaintOwner" id="add-complaintOwner">
                    </div>
                    <div class="form-group">
                        <label for="add-complaintTime" class="control-label">投诉时间:</label>
                        <input type="text" class="form-control" name="complaintTime" id="add-complaintTime">
                    </div>
                    <div class="form-group">
                        <label class="control-label">处理状态:</label>
                        <input name="complaintStatus" id="add-complaintStatus_已处理" type="radio" value="已处理" checked="checked"/>已处理
                        <input name="complaintStatus" id="add-complaintStatus_待处理" type="radio" value="待处理"/>待处理
                </div>
                <div class="modal-body">
                    <table class="table table-striped table-hover" style="font-size: 15px;">
                        <tr>
                            <td style="width: 15%;">主题:</td>
                            <td><b id="info-complaintName"></b></td>
                        </tr>
                        <tr>
                            <td style="width: 15%;">详细情况:</td>
                            <td><b id="info-complaintText"></b></td>
                        </tr>
                        <tr>
                            <td style="width: 15%;">投诉人:</td>
                            <td><b id="info-complaintOwner"></b></td>
                        </tr>
                        <tr>
                            <td style="width: 15%;">投诉时间:</td>
                            <td><b id="info-complaintTime"></b></td>
                        </tr>
                        <tr>
                            <td style="width: 15%;">处理状态:</td>
                        <span aria-hidden="true">&times;</span>
                    </button>
                    <h4 class="modal-title">删除投诉 </h4>
                </div>
                <div class="modal-body">
                    确认要删除该投诉 记录吗?
                    <div class="form-group hidden">
                        <label class="control-label">(hidden)</label>
                        <input type="hidden" class="form-control" name="action" value="delete">
                        <input type="text" class="form-control" name="id" id="delete-id">
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-line btn-rect btn-default" data-dismiss="modal">取消</button>
                    <button type="submit" class="btn btn-line btn-rect btn-warning">删除</button>
                </div>
            </form>
        </div>
    </div>
</div>

                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">&times;</span>
                    </button>
                    <h4 class="modal-title">更新投诉 </h4>
                </div>
                <div class="modal-body">
                    <div class="form-group hidden">
                        <label class="control-label">(hidden)</label>
                        <input type="text" class="form-control" name="action" value="edit">
                        <input type="text" readonly class="form-control" name="id" id="edit-id">
                    </div>
                    <div class="form-group">
                        <label for="edit-complaintName" class="control-label">主题:</label>
                        <input type="text" class="form-control" name="complaintName" id="edit-complaintName">
                    </div>
                    <div class="form-group">
                        <label for="edit-complaintText" class="control-label">详细情况:</label>
                        <textarea style="height: 100px;" class="form-control" name="complaintText" id="edit-complaintText"></textarea>
                    </div>
            <jsp:include page="menu.jsp">
                <jsp:param value="active" name="Complaint_active"/>
            </jsp:include>
        </div>
        <br>
        <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
            <div class="row">
                <div class="col-sm-7">
                    <div class="input-group">
                        <input class="form-control" type="hidden" id="searchColumn" name="searchColumn" value="complaint_name"/>
                        <input class="form-control" type="text" id="search_keyword" name="search_keyword" placeholder="主题"/> <span class="input-group-btn"><button class="btn btn-line btn-rect btn-info" type="button" onclick="searchList()">搜索</button></span>
                    </div>
                </div>
                <div class="col-sm-5">
                    <button type="button" <c:if test="${loginUser.userType != '管理员'}">disabled="disabled" title="没有权限!!!"</c:if> class="btn btn-line btn-rect btn-default" data-toggle="modal" data-target="#modal-add">添加投诉 
                    </button>
    }
    //增加表单提交之前进行检查,如果return false,则不允许提交
    function addCheck() {
        //根据ID获取值
        if (document.getElementById("add-complaintName").value.trim().length == 0) {
            alert("主题不能为空");
            return false;
        }
        if (document.getElementById("add-complaintOwner").value.trim().length == 0) {
            alert("投诉人不能为空");
            return false;
        }
        if (document.getElementById("add-complaintTime").value.trim().length == 0) {
            alert("投诉时间不能为空");
            return false;
        }
            <form action="complaintAdd" onsubmit="return addCheck()">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal"
                            aria-label="Close">
                        <span aria-hidden="true">&times;</span>
                    </button>
                    <h4 class="modal-title" id="myModalLabel">增加投诉 </h4>
                </div>
                <div class="modal-body">
                    <div class="form-group hidden">
                        <label class="control-label">(hidden)</label>
                        <input type="text" class="form-control" name="action" value="add">
                    </div>
                    <div class="form-group">
                        <label for="add-complaintName" class="control-label">主题:</label>
                        <input type="text" class="form-control" name="complaintName" id="add-complaintName">
                    </div>
                    <div class="form-group">
                        <label for="add-complaintText" class="control-label">详细情况:</label>

Java代码:略

运行环境

Java≥6、Tomcat≥7.0、MySQL≥5.5

开发工具

idea/eclipse/MyEclipse

技术框架

JavaWeb JavaBean JSP MVC MySQL Tomcat JavaScript

基础JSP+Servlet或JSP+SSM(Spring、SpringMVC、MyBatis)框架或JSP+SSM+Maven(pom.xml)框架…均可

开发工具:idea或eclipse或myeclipse

适用

课程设计,大作业,毕业设计,项目练习,学习演示等

功能说明

登录、注册、退出、用户模块、公告模块、投诉模块、房产模块、业主模块、车位模块的增删改查管理

v.mp4_20210507_115650.500

v.mp4_20210507_115659.280

v.mp4_20210507_115704.140

v.mp4_20210507_115724.029

v.mp4_20210507_115732.299

v.mp4_20210507_115751.759

v.mp4_20210507_115757.559

v.mp4_20210507_115814.609

v.mp4_20210507_115818.309

v.mp4_20210507_115836.120

v.mp4_20210507_115847.059

v.mp4_20210507_115900.670

document

标签:物业管理,javaweb,edit,find,vo,jsp,modal,投诉,id
来源: https://blog.csdn.net/javayms/article/details/121758300

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有