基于javaweb+jsp的小区物业管理系统
2021/12/7 1:17:07
本文主要是介绍基于javaweb+jsp的小区物业管理系统,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
基于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">×</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">×</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">×</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">×</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
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明
登录、注册、退出、用户模块、公告模块、投诉模块、房产模块、业主模块、车位模块的增删改查管理
这篇关于基于javaweb+jsp的小区物业管理系统的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-11-23Springboot应用的多环境打包入门
- 2024-11-23Springboot应用的生产发布入门教程
- 2024-11-23Python编程入门指南
- 2024-11-23Java创业入门:从零开始的编程之旅
- 2024-11-23Java创业入门:新手必读的Java编程与创业指南
- 2024-11-23Java对接阿里云智能语音服务入门详解
- 2024-11-23Java对接阿里云智能语音服务入门教程
- 2024-11-23JAVA对接阿里云智能语音服务入门教程
- 2024-11-23Java副业入门:初学者的简单教程
- 2024-11-23JAVA副业入门:初学者的实战指南