<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <!DOCTYPE html> <html> <head> <title>物料信息</title> <style> /* 整体页面布局和样式 */ body { font-family: Arial, sans-serif; background-color: #f4f4f4; background-image: url('img.jpg'); /* 添加背景图片 */ background-size: cover; /* 使背景图片覆盖整个页面 */ background-position: center; /* 背景图片居中 */ background-repeat: no-repeat; /* 不重复背景图片 */ } h1 { text-align: center; color: #f5e9e9; } form { background-color: #fff; padding: 20px; border-radius: 5px; box-shadow: 0 0 5px rgba(0, 0, 0, 0.1); width: 400px; margin: 0 auto; } label { display: block; margin-bottom: 5px; font-weight: bold; } input[type="text"], input[type="number"], select { width: 100%; padding: 8px; margin-bottom: 15px; border: 1px solid #ccc; border-radius: 3px; } button { background-color: #007BFF; color: #fff; padding: 10px 15px; border: none; border-radius: 3px; cursor: pointer; display: block; /* Ensures button is a block element */ margin: 0 auto; /* Centers the button */ } button:hover { background-color: #0056b3; } /* 结果展示区域样式 */ .result-section { margin-top: 20px; background-color: #fff; padding: 20px; border-radius: 5px; box-shadow: 0 0 5px rgba(0, 0, 0, 0.1); width: 400px; margin: 0 auto; } h2 { color: #ece5e5; } p { margin: 5px 0; } </style> </head> <body> <h1>物料信息</h1> <form method="post" action="processMaterial.jsp"> <label for="material_id">物料 ID</label> <input type="text" id="material_id" name="material_id" required> <label for="material_name">物料名称</label> <input type="text" id="material_name" name="material_name" required> <label for="unit">单位</label> <input type="text" id="unit" name="unit" required> <label for="stock_quantity">库存数量</label> <input type="number" id="stock_quantity" name="stock_quantity" value="0" required> <label for="safety_stock">安全库存</label> <input type="number" id="safety_stock" name="safety_stock" value="0" required> <label for="last_inventory_date">上次盘点日期</label> <input type="text" id="last_inventory_date" name="last_inventory_date"> <label for="supplier_id">供应商 ID</label> <input type="text" id="supplier_id" name="supplier_id" required> <label for="remarks">备注</label> <input type="text" id="remarks" name="remarks"> <button type="submit">提交</button> </form> <%-- 结果展示部分 --%> <% String materialId = request.getParameter("material_id"); String materialName = request.getParameter("material_name"); String unit = request.getParameter("unit"); String stockQuantity = request.getParameter("stock_quantity"); String safetyStock = request.getParameter("safety_stock"); String lastInventoryDate = request.getParameter("last_inventory_date"); String supplierId = request.getParameter("supplier_id"); String remarks = request.getParameter("remarks"); if (materialId != null) { %> <div class="result-section"> <h2>输入结果</h2> <p><strong>物料 ID:</strong> <%= materialId %></p> <p><strong>物料名称:</strong> <%= materialName %></p> <p><strong>单位:</strong> <%= unit %></p> <p><strong>库存数量:</strong> <%= stockQuantity %></p> <p><strong>安全库存:</strong> <%= safetyStock %></p> <p><strong>上次盘点日期:</strong> <%= lastInventoryDate != null ? lastInventoryDate : "无" %></p> <p><strong>供应商 ID:</strong> <%= supplierId %></p> <p><strong>备注:</strong> <%= remarks != null ? remarks : "无" %></p> </div> <% } %> </body> </html>
标签:物料,27,5px,color,2024.9,border,周五,background,margin From: https://www.cnblogs.com/Sunyiran/p/18441393