基于javaweb+jsp的企業物資管理系統
JavaWeb JavaBean JSP MVC MySQL Tomcat JavaScript idea eclipse MyEclipse Servlet SSM Maven …
部分代碼實作JSP
//提交之前進行檢查,如果return false,則不允許提交
function check() {
//根據ID獲取值
if (document.getElementById("suppliesName").value.trim().length == 0) {
alert("名稱不能為空!");
return false;
}
if (document.getElementById("suppliesNo").value.trim().length == 0) {
alert("編號不能為空!");
return false;
}
if (document.getElementById("suppliesType").value.trim().length == 0) {
alert("類別不能為空!");
return false;
}
if (document.getElementById("suppliesCount").value.trim().length == 0) {
alert("庫存數量不能為空!");
return false;
<%@ 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" type="text/css" href="css/index.css"/>
</head>
<body>
<jsp:include page="menu.jsp"/>
<div class="index-content">
<div class="index-content-operation">
<a class="info-detail">物資 詳情</a>
if (document.getElementById("suppliesName").value.trim().length == 0) {
alert("名稱不能為空!");
return false;
}
if (document.getElementById("suppliesNo").value.trim().length == 0) {
alert("編號不能為空!");
return false;
}
if (document.getElementById("suppliesType").value.trim().length == 0) {
alert("類別不能為空!");
return false;
}
if (document.getElementById("suppliesCount").value.trim().length == 0) {
alert("庫存數量不能為空!");
return false;
}
if (document.getElementById("suppliesFactory").value.trim().length == 0) {
alert("供應商不能為空!");
return false;
<table class="index-content-table-add">
<tr>
<td width="12%">名稱:</td><td><input class="index-content-table-td-add" type="text" id="suppliesName" name="suppliesName" value=""/></td>
</tr>
<tr>
<td width="12%">編號:</td><td><input class="index-content-table-td-add" type="text" id="suppliesNo" name="suppliesNo" value=""/></td>
</tr>
<tr>
<td width="12%">類別:</td><td><input class="index-content-table-td-add" type="text" id="suppliesType" name="suppliesType" value=""/></td>
</tr>
<tr>
<td width="12%">庫存數量:</td><td><input class="index-content-table-td-add" type="text" id="suppliesCount" name="suppliesCount" value=""/></td>
</tr>
<tr>
<td width="12%">供應商:</td><td><input class="index-content-table-td-add" type="text" id="suppliesFactory" name="suppliesFactory" value=""/></td>
</tr>
<tr>
<td width="12%">入庫日期:</td><td><input class="index-content-table-td-add" type="text" id="suppliesDate" name="suppliesDate" value=""/></td>
</div>
<br>
<table class="table table-striped table-hover table-bordered">
<thead>
<tr class="index-content-table-th">
<th>名稱</th>
<th>編號</th>
<th>類別</th>
<th>庫存數量</th>
<th>供應商</th>
<th>入庫日期</th>
<th>操作</th>
</tr>
</thead>
<c:forEach items="${list}" var="vo">
<tr class="index-content-table-td">
<td>${vo.suppliesName}</td>
<td>${vo.suppliesNo}</td>
<td>${vo.suppliesType}</td>
<td>${vo.suppliesCount}</td>
<td>${vo.suppliesFactory}</td>
<td>${vo.suppliesDate}</td>
<td>
<button class="btn btn-rect btn-grad btn-danger btn-sm" style="padding: 0px 1px;" onclick="window.location.href='SuppliesServlet?action=get&id=${vo.id}'">詳情</button>
<button class="btn btn-rect btn-grad btn-primary btn-sm" style="padding: 0px 1px;"
<c:if test="${loginUser.userType != '管理員'}">disabled="disabled" title="沒有權限!!!"</c:if>
<tr>
<td>入庫日期:<b>${vo.suppliesDate}</b></td>
</tr>
<tr>
<td>備注:<b>${vo.suppliesText}</b></td>
</tr>
</table>
<br>
<button type="button" class="btn btn-rect btn-grad btn-danger btn-sm" onclick="javascript:history.back(-1);">回傳</button>
</form>
</div>
</body>
</html>
<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>物資 管理</title>
<link rel="stylesheet" type="text/css" href="css/index.css"/>
</head>
<body>
<jsp:include page="menu.jsp"/>
<div class="index-content">
<div class="index-content-operation">
<a class="info-detail">物資 管理</a>
<br>
<br>
</div>
<br>
<div class="index-content-operation">
<button class="btn btn-rect btn-grad btn-success btn-sm" <c:if test="${loginUser.userType != '管理員'}">disabled="disabled" title="沒有權限!!!"</c:if> οnclick="window.location.href='supplies_add.jsp'">添加</button>
<%@ 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" type="text/css" href="css/index.css"/>
</head>
<body>
<jsp:include page="menu.jsp"/>
<div class="index-content">
<div class="index-content-operation">
<a class="info-detail">添加物資 </a>
<br>
<br>
</div>
<br>
if (document.getElementById("suppliesFactory").value.trim().length == 0) {
alert("供應商不能為空!");
return false;
}
if (document.getElementById("suppliesDate").value.trim().length == 0) {
alert("入庫日期不能為空!");
return false;
}
return true;
}
</script>
</html>
<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
if (document.getElementById("suppliesDate").value.trim().length == 0) {
alert("入庫日期不能為空!");
return false;
}
return true;
}
</script>
</html>
<%@ 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" type="text/css" href="css/index.css"/>
</head>
<br>
</div>
<br>
<form>
<table class="index-content-table-add" style="font-size: 18px;">
<tr>
<td>名稱:<b>${vo.suppliesName}</b></td>
</tr>
<tr>
<td>編號:<b>${vo.suppliesNo}</b></td>
</tr>
<tr>
<td>類別:<b>${vo.suppliesType}</b></td>
</tr>
<tr>
<td>庫存數量:<b>${vo.suppliesCount}</b></td>
</tr>
<tr>
<td>供應商:<b>${vo.suppliesFactory}</b></td>
<jsp:include page="menu.jsp"/>
<div class="index-content">
<div class="index-content-operation">
<a class="info-detail">修改物資 </a>
<br>
<br>
</div>
<br>
<form action="SuppliesServlet?action=edit" method="post" onsubmit="return check()">
<input type="hidden" id="id" name="id" value="${vo.id}"/>
<table class="index-content-table-add">
<tr>
<td width="12%">名稱:</td><td><input class="index-content-table-td-add" type="text" id="suppliesName" name="suppliesName" value="${vo.suppliesName}"/></td>
</tr>
<tr>
<td width="12%">編號:</td><td><input class="index-content-table-td-add" type="text" id="suppliesNo" name="suppliesNo" value="${vo.suppliesNo}"/></td>
</tr>
<tr>
<td width="12%">類別:</td><td><input class="index-content-table-td-add" type="text" id="suppliesType" name="suppliesType" value="${vo.suppliesType}"/></td>
</tr>
<button class="btn btn-rect btn-grad btn-danger btn-sm" style="padding: 0px 1px;" <c:if test="${loginUser.userType != '管理員'}">disabled="disabled" title="沒有權限!!!"</c:if> οnclick="if(window.confirm('將要洗掉:${vo.suppliesName}?'))window.location.href='SuppliesServlet?action=delete&id=${vo.id}'">洗掉</button>
</td>
</tr>
</c:forEach>
</tbody>
</table>
<div style="float: right;padding-right: 10px;color: #515151;"><jsp:include page="split.jsp"/></div>
</div>
</body>
<script>
function searchList() {
window.location.href = "SuppliesServlet?action=list&searchColumn="+document.getElementById("searchColumn").value+"&keyword=" + document.getElementById("search_keyword").value;
}
</script>
<td width="12%">庫存數量:</td><td><input class="index-content-table-td-add" type="text" id="suppliesCount" name="suppliesCount" value="${vo.suppliesCount}"/></td>
</tr>
<tr>
<td width="12%">供應商:</td><td><input class="index-content-table-td-add" type="text" id="suppliesFactory" name="suppliesFactory" value="${vo.suppliesFactory}"/></td>
</tr>
<tr>
<td width="12%">入庫日期:</td><td><input class="index-content-table-td-add" type="text" id="suppliesDate" name="suppliesDate" value="${vo.suppliesDate}"/></td>
</tr>
<tr>
<td width="12%">備注:</td><td><textarea id="suppliesText" name="suppliesText" style="width: 60%; height: 100px;padding: 0px 17px;" placeholder="請輸入內容......">${vo.suppliesText}</textarea></td>
</tr>
</table>
<br>
<br>
<br>
<button type="submit" class="btn btn-rect btn-grad btn-success btn-sm">提交</button> <button type="button" class="btn btn-rect btn-grad btn-danger btn-sm" onclick="javascript:history.back(-1);">取消</button>
</form>
</div>
</body>
<tr>
<td width="12%">備注:</td><td><textarea id="suppliesText" name="suppliesText" style="width: 60%; height: 100px;padding: 0px 17px;" placeholder="請輸入內容......"></textarea></td>
</tr>
</table>
<br>
<br>
<br>
<button type="submit" class="btn btn-rect btn-grad btn-success btn-sm">提交</button> <button type="button" class="btn btn-rect btn-grad btn-danger btn-sm" onclick="javascript:history.back(-1);">取消</button>
</form>
</div>
</body>
<script type="text/javascript">
//提交之前進行檢查,如果return false,則不允許提交
function check() {
運行環境
Java≥6、Tomcat≥7.0、MySQL≥5.5
開發工具
idea/eclipse/MyEclipse
技術框架
JavaWeb JavaBean JSP MVC MySQL Tomcat JavaScript idea eclipse MyEclipse Servlet SSM Maven …
適用
課程設計,大作業,畢業設計,專案練習,學習演示等
功能說明
登錄、注冊、退出、用戶模塊、公告模塊、物資模塊的增刪改查管理






轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/317887.html
標籤:其他
