【汇智学堂】-SpringMVC+Mybatis+Spring框架使用入门(垃圾分类商品管理查询功能前端界面)

在这里插入图片描述

<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>

<!DOCTYPE html>
<html>
<head>
	<base href="<%=basePath%>">
		<meta charset="UTF-8">
		<title>后台欢迎页</title>
		<link rel="stylesheet" href="css/reset.css" />
		<link rel="stylesheet" href="css/content.css" />
	    <link rel="stylesheet" href="css/goods.css" />
</head>

	<body marginwidth="0" marginheight="0">

		<div class="container">
			<div class="public-nav">您当前的位置:
				<a class="active">商品管理</a>
			</div>
			<div class="public-content">
				<div class="public-content-header">
					<h3>商品管理</h3>
				</div>
				<div class="public-content-cont">
					<div class="tc-serach">
						<p style="margin-bottom:20px;">商品名称 :
						<input type="text" value="${goodsname}" id="goodsname" name="goodsname" onkeyup="value=value.replace(/[^a-zA-Z\u4e00-\u9fa5_-]/g,'') "onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))" placeholder="请输入汉字和字母" class="goodsname" >
						<button id="goodslike" >查询</button></p>

						<form action="<%=path%>/uploadGoods.do" method="post" id="fm1" enctype="multipart/form-data">
							<input type="file"   name="file" id="file" value="" accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel" style="cursor:pointer;"/>
							<input type="submit"id = "tsubmit" value="导入商品" class="ingoods"/>
							<a href="<%=path %>/addGoods.jsp" target="_self" class="addgoods">手动添加</a>
						</form>

					</div>
					<div class="clearfix"></div>
					<div class="public-content-cont two-col">
						<table class="public-cont-table col-2" >
							<thead>
								<tr>
									<th style="width:5%">商品标示ID</th>
									<th style="width:5%">生产商名称</th>
									<th style="width:10%">生产商ID</th>
									<th style="width:15%">商品名称</th>
									<th style="width:4%">重量</th>
									<th style="width:15%">审核</th>
									<th style="width:15%">操作</th>
									-
								</tr>
							</thead>

							<tbody id="allgoods">
								<c:forEach items="${goodslist}" var="goods" varStatus="st">
									<tr>
										<td>${pagehelper.pageNum*5+st.index-4}</td>
										<td><span style="color:#999">
											<c:choose>
												<c:when test="${goods.g_manufacturerName==1}">海信集团</c:when>
												<c:when test="${goods.g_manufacturerName==2||goods.g_examine==null}">格力集团</c:when>
												<c:when test="${goods.g_manufacturerName==3}">联想集团</c:when>
											</c:choose>
									   </span></td>

										<td>${goods.g_manufacturerId}</td>
										<td>${goods.g_name}</td>
										<td>${goods.g_weight}</td>

										<td><span style="color:#999">
											<c:choose>
												<c:when test="${goods.g_examine==1}">通过</c:when>
												<c:when test="${goods.g_examine==0||goods.g_examine==null}">没通过</c:when>
											</c:choose>
									   </span></td>

										<td>
											<div class="table-fun">
												<a href="<%=path %>/seeoneGoods.do?gid=${goods.g_id}&type=1" target="_self">查看</a>
												<a href="<%=path %>/seeoneGoods.do?gid=${goods.g_id}&type=2" target="_self">编辑</a>
												<a data-id ="${goods.g_id}" class="delet" style="cursor:pointer;">删除</a>
											</div>
										</td>

									</tr>
								</c:forEach>
							</tbody >
						</table>

						<div class="page" >
							<%@ include file="PageFootEea.jsp"%>
						</div>
					</div>
				</div>
			</div>
		</div>

		<script src="<%=request.getContextPath() %>/js/jquery-3.1.1.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="<%=request.getContextPath() %>/js/goods/goods.js" type="text/javascript" charset="utf-8"></script>

		<script type="text/javascript">
            $('.delet').click(function(){
                var gid = $(this).attr('data-id');
                window.parent.myconfirm("是否确认删除?",function(res){
                    if(res === '1'){
                        window.location.href = "<%=path %>/delgoods.do?goodsid="+gid;
                    }
                });
            });
		</script>

	</body>
</html>

猜你喜欢

转载自blog.csdn.net/weixin_39593940/article/details/91125439
今日推荐