基于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

</html>

<%@ page contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>商品 详情</title>
    <%@ include file="include/head.jsp" %>
</head>
<body>
<div class="container-fluid">
    <ul class="nav nav-tabs">
        <li><a href="GoodServlet?action=list">用户列表</a></li>
        <li class="active"><a href="#">详情</a></li>
    </ul>
    <br/>
    <form class="form-horizontal" role="form" action="#" method="post">
        <input type="hidden" class="form-control" id="id" name="id" value="${vo.id}"/>
        <div class="form-group">
            <label class="col-sm-3 control-label">商品:</label>
            <div class="col-sm-5" style="padding-top: 7px;">
        <div class="form-group">
            <label class="col-sm-3 control-label">商品描述:</label>
            <div class="col-sm-5">
                <textarea rows="3" class="form-control" id="goodText" name="goodText" placeholder="请输入内容......"></textarea>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">入库时间:</label>
            <div class="col-sm-5">
                <input type="text" class="form-control" id="goodTime" name="goodTime">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label"></label>
            <div class="col-sm-5">
                <input type="submit" class="btn btn-rect btn-grad btn-success btn-sm" value="保存">
                <input type="button" class="btn btn-rect btn-grad btn-warning btn-sm" value="返回" onclick="javascript:history.back(-1);">
            </div>
        </div>
    </form>
</div>
<%@ page contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>商品 添加</title>
    <%@ include file="include/head.jsp" %>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        <c:forEach items="${list}" var="vo">
            <tr>
                <td><a href="GoodServlet?action=get&id=${vo.id}">${vo.goodName}</a></td>
                <td>${vo.goodCount}</td>
                <td>${vo.goodPrice}</td>
                <td>${vo.goodType}</td>
                <td>${vo.goodSuppiler}</td>
                <td>${vo.goodTime}</td>
                <td>
        <div class="form-group">
            <label class="col-sm-3 control-label">商品描述:</label>
            <div class="col-sm-5">
                <textarea rows="3" class="form-control" id="goodText" name="goodText" placeholder="请输入内容......">${vo.goodText}</textarea>
            </div>
        </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">入库时间:</label>
                <div class="col-sm-5">
                    <input type="text" class="form-control" id="goodTime" name="goodTime" value="${vo.goodTime}">
                </div>
            </div>
        <div class="form-group">
            <label class="col-sm-3 control-label"></label>
            <div class="col-sm-5">
                <input type="submit" class="btn btn-rect btn-grad btn-success btn-sm" value="保存">
                <input type="button" class="btn btn-rect btn-grad btn-warning btn-sm" value="返回" onclick="javascript:history.back(-1);">
        </div>
    </form>
</div>
</body>
<script type="text/javascript">
    //提交之前进行检查,如果return false,则不允许提交
    function check() {
        //根据ID获取值
        if (document.getElementById("goodName").value.trim().length == 0) {
            alert("商品不能为空!");
            return false;
        }
        if (document.getElementById("goodCount").value.trim().length == 0) {
            alert("数量不能为空!");
<script type="text/javascript">
    //提交之前进行检查,如果return false,则不允许提交
    function check() {
        //根据ID获取值
        if (document.getElementById("goodName").value.trim().length == 0) {
            alert("商品不能为空!");
            return false;
        }
        if (document.getElementById("goodCount").value.trim().length == 0) {
            alert("数量不能为空!");
            return false;
        }
        if (document.getElementById("goodPrice").value.trim().length == 0) {
            alert("价格不能为空!");
            return false;
        }
        if (document.getElementById("goodType").value.trim().length == 0) {
            alert("类型不能为空!");
            return false;
        }
<body>
<div class="container-fluid">
    <ul class="nav nav-tabs">
        <li><a href="GoodServlet?action=list">商品 列表</a></li>
        <li class="active"><a href="#">添加</a></li>
    </ul>
    <br/>
    <form class="form-horizontal" role="form" action="GoodServlet?action=add" method="post" onsubmit="return check()">
        <div class="form-group">
            <label class="col-sm-3 control-label">商品:</label>
            <div class="col-sm-5">
                <input type="text" class="form-control" id="goodName" name="goodName">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">数量:</label>
</head>
<body>
<div class="container-fluid">
    <ul class="nav nav-tabs">
        <li><a href="GoodServlet?action=list">商品 列表</a></li>
        <li class="active"><a href="#">编辑</a></li>
    </ul>
    <br/>
    <form class="form-horizontal" role="form" action="GoodServlet?action=edit" method="post" onsubmit="return check()">
        <input type="hidden" class="form-control" id="id" name="id" value="${vo.id}"/>
        
            <div class="form-group">
                <label class="col-sm-3 control-label">商品:</label>
                <div class="col-sm-5">
                    <input type="text" class="form-control" id="goodName" name="goodName" value="${vo.goodName}">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">数量:</label>
                <div class="col-sm-5">
                    <input type="text" class="form-control" id="goodCount" name="goodCount" value="${vo.goodCount}">
    <br/>
    <form class="form-inline" id="searchForm" action="GoodServlet?action=list" method="post">
        <div class="form-group">
            <input type="text" class="form-control" name="keyword" id="keyword" placeholder="商品">
            <input type="hidden" id="searchColumn" name="searchColumn" value="good_name"/>
        </div>
        <button class="btn btn-rect btn-grad btn-warning btn-sm"><span class="glyphicon glyphicon-search" aria-hidden="true"></span>查询
        </button>
    </form>
    <br/>
    <table class="table table-hover table-bordered">
        <thead>
        <tr>
            <th>商品</th>
            <th>数量</th>
            <th>价格</th>
            <th>类型</th>
            <th>供应商</th>
        }
        if (document.getElementById("goodPrice").value.trim().length == 0) {
            alert("价格不能为空!");
            return false;
        }
        if (document.getElementById("goodType").value.trim().length == 0) {
            alert("类型不能为空!");
            return false;
        }
        if (document.getElementById("goodSuppiler").value.trim().length == 0) {
            alert("供应商不能为空!");
            return false;
        }
        if (document.getElementById("goodTime").value.trim().length == 0) {
            alert("入库时间不能为空!");
            return false;
        }
        return true;
    }
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">数量:</label>
            <div class="col-sm-5" style="padding-top: 7px;">
                ${vo.goodCount}
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">价格:</label>
            <div class="col-sm-5" style="padding-top: 7px;">
                ${vo.goodPrice}
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">类型:</label>
            <div class="col-sm-5" style="padding-top: 7px;">
                ${vo.goodType}
                            class="btn btn-rect btn-grad btn-warning btn-xs"
                            <c:if test="${loginUser.userType != '管理员'}">disabled="disabled" title="没有权限!!!"</c:if>
                             >
                        <span class="glyphicon glyphicon-pencil" aria-hidden="true"></span>
                        编辑
                    </button>
                    <button onclick="if(window.confirm('将要删除:${vo.goodName}?'))window.location.href='GoodServlet?action=delete&id=${vo.id}'"
                            class="btn btn-rect btn-grad btn-success btn-xs"
                            <c:if test="${loginUser.userType != '管理员'}">disabled="disabled" title="没有权限!!!"</c:if> >
                        <span class="glyphicon glyphicon-remove" aria-hidden="true"></span>
                        删除
                    </button>
                </td>
            </tr>
        </c:forEach>
        </tbody>
                <input type="text" class="form-control" id="goodCount" name="goodCount">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">价格:</label>
            <div class="col-sm-5">
                <input type="text" class="form-control" id="goodPrice" name="goodPrice">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">类型:</label>
            <div class="col-sm-5">
                <input type="text" class="form-control" id="goodType" name="goodType">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">供应商:</label>
            <div class="col-sm-5">
                <input type="text" class="form-control" id="goodSuppiler" name="goodSuppiler">
            </div>
    <div style="float: right;padding-right: 10px;color: #515151;"><jsp:include page="split.jsp"/></div>
</div>
</body>
            alert("供应商不能为空!");
            return false;
        }
        if (document.getElementById("goodTime").value.trim().length == 0) {
            alert("入库时间不能为空!");
            return false;
        }
        return true;
    }
</script>
</html>

<%@ page contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>商品 编辑</title>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">价格:</label>
                <div class="col-sm-5">
                    <input type="text" class="form-control" id="goodPrice" name="goodPrice" value="${vo.goodPrice}">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">类型:</label>
                <div class="col-sm-5">
                    <input type="text" class="form-control" id="goodType" name="goodType" value="${vo.goodType}">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">供应商:</label>
                <div class="col-sm-5">
                    <input type="text" class="form-control" id="goodSuppiler" name="goodSuppiler" value="${vo.goodSuppiler}">
                </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">供应商:</label>
            <div class="col-sm-5" style="padding-top: 7px;">
                ${vo.goodSuppiler}
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">商品描述:</label>
            <div class="col-sm-5" style="padding-top: 7px;">
                <textarea rows="3" class="form-control" id="goodText" name="goodText" disabled="disabled">${vo.goodText}</textarea>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">入库时间:</label>
            <div class="col-sm-5" style="padding-top: 7px;">
                ${vo.goodTime}
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-5" style="padding-top: 7px;">
                <input type="button" class="btn btn-rect btn-grad btn-warning btn-sm" value="返回" onclick="javascript:history.back(-1);">
            </div>
        </div>
    </form>
</div>
</body>
</html>

<%@ page contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>商品 管理</title>
    <%@ include file="include/head.jsp" %>
</head>
<body>
<div class="container-fluid">
    <ul class="nav nav-tabs">
        <li class="active"><a href="GoodServlet?action=list">商品 列表</a></li>
        <c:if test="${loginUser.userType == '管理员'}"><li><a href="good_add.jsp">添加</a></li></c:if>

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_20210911_213957.355

v.mp4_20210911_214003.818

v.mp4_20210911_214023.498

v.mp4_20210911_214035.558

v.mp4_20210911_214107.313

v.mp4_20210911_214112.434

v.mp4_20210911_214127.282

v.mp4_20210911_214134.818

v.mp4_20210911_214143.947

v.mp4_20210911_214147.714

v.mp4_20210911_214151.276

v.mp4_20210911_214157.282

v.mp4_20210911_214159.314

document

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
THE END
分享
二维码
< <上一篇
下一篇>>