<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE html>
<html>
<head>
<title>服务分类管理</title>
<meta
	content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no'
	name='viewport'>
<!-- bootstrap 3.0.2 -->
<link href="<c:url value='/styles/lib/bootstrap.min.css'/>"
	rel="stylesheet" type="text/css" />
<!-- font Awesome -->
<link href="<c:url value='/styles/lib/font-awesome.min.css'/>"
	rel="stylesheet" type="text/css" />
<!-- Ionicons -->
<link href='<c:url value='/styles/lib/ionicons.min.css' />'
	rel="stylesheet" type="text/css" />
<!-- DATA TABLES -->
<link
	href="<c:url value='/styles/lib/datatables/dataTables.bootstrap.css' />"
	rel="stylesheet" type="text/css" />
<!-- Theme style -->
<link href="<c:url value='/styles/AdminLTE.css'/>" rel="stylesheet"
	type="text/css" />
<link
	href="<c:url value='/styles/categories/classify.css'/>"
	rel="stylesheet" type="text/css" />

<script type="text/javascript"
	src="<c:url value='/scripts/lib/jquery-1.8.2.min.js'/>"></script>
<script type="text/javascript" src="<c:url value='/plugin/layer/layer.js'/>"></script>
<script type="text/javascript" src="<c:url value='/scripts/visitor/exif.js'/>"></script>
<script type="text/javascript" src="<c:url value='/scripts/mobileBUGFix.mini.js'/>"></script>
<script type="text/javascript"
	src="<c:url value='/scripts/admin/categories/productCategories.js?v=3.0'/>"></script>
<style type="text/css">
	th {
		text-align: center;
	}
	td {
		height:60px;
		text-align: center;
		vertical-align: middle !important;
	}
	input{
		width:200px;
	}
</style>	
</head>
<body>
	<input type="hidden" value="${ctx}" id="contextPath">
	<input type="hidden" value="${visitPrefix}" id="visitPrefix">
	<input type="hidden" value="" id="id">
	<input type="hidden" value="" id="parentCode">
	<form:form id="conditionform"
		action="${ctx}/admin/servicePack/productCategoriesList?funcid=${funcid}"
		method="POST" class="form-inline formclass" role="form">
		<div class="form-group entryclass">
			<label>关键字</label> <input type="text" id="paramName" name="paramName"
				placeholder="请输入名称或业务编码查询" value="${paramName }" />
		</div>
		<input type="hidden" id="pageNo" name="pageNo" />
		<div class="form-group entryclass">
			<label>关键字</label> <select name="serviceId">
				<option value="">--请选择--</option>
				<c:forEach items="${serviceGroupType }" var="obj">
					<c:choose>
						<c:when test="${obj.itemcode==serviceId }">
							<option value="${obj.itemcode }" selected="selected">${obj.itemname }</option>
						</c:when>
						<c:otherwise>
							<option value="${obj.itemcode }">${obj.itemname }</option>
						</c:otherwise>
					</c:choose>
				</c:forEach>
			</select>
		</div>
		<div class="classbtn clearfix">
			<input type="button" class="btn btn-default" value="查询"
				onclick="searchProductCategoriesList()" /> <input type="button"
				class="btn btn-success js_topbtn" value="新增一级分类"
				onclick="addProductCategories('0')" />
		</div>
	</form:form>

	<div class="classtable">
		<table class="table table-bordered">
			<thead>
				<tr>
					<th></th>
					<th>分类名称</th>
					<th>ICON图标</th>
					<th>业务编码</th>
					<th>关联服务</th>
					<th>创建时间</th>
					<th>操作</th>
				</tr>
			</thead>
			<c:forEach items="${page.items }" var="model">
				<tbody class="classify">
					<tr>
						<td class="iconarrow"><a href="javascript: void(0);"
							class="arrowdown" id="${model.code }"></a></td>
						<td>${model.name }</td>
						<td ><c:choose>
								<c:when test="${not empty model.iconUrl }">
									<img style="height: 60px;width:80px;"
										src="${visitPrefix }${model.iconUrl }" />
								</c:when>
								<c:otherwise>
								 --
							</c:otherwise>
							</c:choose></td>
						<td>${model.serviceCode }</td>
						<td><c:choose>
								<c:when test="${not empty model.itemname }">
								 ${model.itemname }
							</c:when>
								<c:otherwise>
								 --
							</c:otherwise>
							</c:choose></td>
						<td class="timetd">${model.createTimes }</td>
						<td class="opera"><a href="javascript: void(0);"
							class="btn-small btn-green js_subbtn"
							onclick="addProductCategories(${model.code})">添加子类</a> <a
							href="javascript: void(0);" class="btn-small btn-blue"
							onclick="updateProductCategories('${model.parentCode}','${model.serviceId }','${model.name }','${model.description }','${model.id }','${model.iconUrl }','${model.serviceCode }','')">修改</a>
							<a href="javascript: void(0);"
							class="btn-small btn-red js_removetop"
							onclick="delProductCategories('${model.id }','${model.name}')">删除</a>
						</td>
					</tr>
				</tbody>
			</c:forEach>
		</table>
	</div>

	<div class="btn-page">
		<!-- 页码 -->
		<div align="center" class="pages clearfix">
			<c:forEach items="${page.iterPages }" var="pageNo">
				<c:choose>
					<c:when test="${pageNo == page.currentPage }">
						<span class='current'>${pageNo }</span>
					</c:when>
					<c:when test="${pageNo != null}">
						<a href="javascript:void(0);" onclick='goPage(${pageNo});'>${pageNo}</a>
					</c:when>
					<c:otherwise>
						<em>...</em>
					</c:otherwise>
				</c:choose>
			</c:forEach>
			<strong>共<span
				style="color: black; font-weight: bold; font-size: 16px;">${page.totalCount}</span>条
			</strong> <strong>跳转到第</strong><input type="text" id="gopage"
				style="width: 40px;"
				onkeyup="this.value=this.value.replace(/\D/g,'')"
				onkeypress="this.value=this.value.replace(/\D/g,'')" /><strong>页</strong>
			<a class="btn-sm  btn-primary" href="javascript:goPage('gopage');"
				id='bindBtn'>确定</a>
		</div>
	</div>
	<!-- 一级分类信息管理 -->
	<div class="topcategory js_topclassify">
		<div class="form-horizontal topcategoryform">
			<h3 class="titleform">一级分类信息编辑</h3>
			<div class="form-group" id="serviceIdDiv">
				<label class="col-sm-2">关联服务</label> <select name="serviceId"
					id="serviceId" class="col-sm-10">
					<option value="">暂无</option>
					<c:forEach items="${serviceGroupType }" var="obj">
						<option value="${obj.itemcode }">${obj.itemname }</option>
					</c:forEach>
				</select>
			</div>
			<div class="form-group">
				<label class="col-sm-2">分类名称</label> <input type="text" id="name"
					class="col-sm-10" />
			</div>
			<div class="form-group">
				<label class="col-sm-2">业务编码</label> <input type="text"
					class="col-sm-10" id="serviceCode" />
			</div>
			<div class="form-group" id="orderNoDiv">
				<label class="col-sm-2">排序</label> <input type="text" id="orderNo"
					class="col-sm-10" />
			</div>
			<div class="form-group">
				<label class="col-sm-2">描述</label> <input type="text"
					id="description" class="col-sm-10" />
			</div>
			<div class="form-group">
				<label class="col-sm-2">图标</label>
				<div class="uploadwrap">
					<input type="hidden" value="" id="iconUrl" />
					<div>
						<img alt="" src="" id="img1">
					</div>
					<span>上传图片</span> <input type="file" class="upload"
						onchange="selectFileImage(this)" />
				</div>
				<div class="topcategoryformbtn">
					<input type="button" class="btn btn-gray js_topclose" value="关闭" />
					<input type="button" class="btn btn-default" value="提交"
						onclick="saveProductCategories()" />
				</div>
			</div>
		</div>
	</div>
</body>
</html>
