<%@ page language="java" errorPage="/error.jsp" pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE html>
<html>
<head>
<title>服务内容信息</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<!-- bootstrap 3.0.2 -->
<link href="<c:url value='/styles/lib/bootstrap.min.css'/>" rel="stylesheet" type="text/css" />
<link href="<c:url value='/styles/lib/bootstrap-datetimepicker.min.css'/>" rel="stylesheet" type="text/css" />
<link href="<c:url value='/styles/lib/font-awesome.min.css'/>" rel="stylesheet" type="text/css" />
<link href='<c:url value='/styles/lib/ionicons.min.css' />' rel="stylesheet" type="text/css" />
<link href="<c:url value='/styles/lib/datatables/dataTables.bootstrap.css' />" rel="stylesheet" type="text/css" />
<link href="<c:url value='/styles/vehicleClean/home.css'/>" rel="stylesheet" type="text/css" />
<link href="<c:url value='/styles/AdminLTE.css'/>" rel="stylesheet" type="text/css" />
<link href="<c:url value='/scripts/lib/layui/layui.css'/>" rel="stylesheet" type="text/css" />
<script src="${ctx }/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/lib/layui/layui.js'/>"></script>
<script type="text/javascript" src="<c:url value='/scripts/bootstrap.min.js'/>"></script>
<script type="text/javascript" src="<c:url value='/scripts/bootstrap-datetimepicker.min.js'/>"></script>
<script type="text/javascript" src="<c:url value='/scripts/bootstrap-datetimepicker.zh-CN.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/service/serviceTypeInfo.js?vr=5.0'/>"></script>
<script type="text/javascript" src="<c:url value='/scripts/admin/service/serviceProjectAllocation.js?vr=7.6'/>"></script>
<script type="text/javascript" src="<c:url value='/scripts/admin/cjqt.js'/>"></script>
 <style type="text/css">
.uploadimg {width: 400px; height: auto;}
.uploadbtns {width: 100%; height: 30px;}
 .uploadimgbtn {position: relative; float: left; width: 80px; height: 30px; background-color: #0eb83a; border-radius: 5px; cursor: pointer;}
.uploadimgbtn span {display: block; width: 100%; height: 30px; text-align: center; line-height: 30px; color: #fff; font-size: 14px; cursor: pointer;}
.uploadimgbtn input {position: absolute; top: 0; left:0; width: 100%; height: 30px; opacity: 0; cursor: pointer;}
.uploadbtns .uploadimgcancel {float: left; width: 80px; height: 28px; border: 1px solid #333; text-align: center; line-height: 28px; text-decoration: none; color: #333; border-radius: 5px; margin-left: 10px;}
.showimg {width: 68px; height: auto; padding: 4px; overflow: hidden; max-height: 100px; margin-top: 10px; background-color: #fff;}
.showimg img {width: 60px;}
.layui-border-box{
	width: 100% !important
}
</style>
<body>
	<input type="hidden" id="funcid" value="${funcid}">
	<input type="hidden" value="${ctx}" id="contextPath">
	<input type="hidden" id="projectId">
	<input type="hidden" id="id">
	<input type="hidden" id="serviceId">
	<input type="hidden" id="actype">
	<input type="hidden" id="visitPrefix" value="${visitPrefix }">
	<input type="hidden" id="serviceStatus" value="${serviceStatus }"/>
	<input type="hidden" id="serviceCategoryJson" value='${serviceCategoryJson }'/>
	<input type="hidden" id="serviceStatusGropTypeJson" value='${serviceStatusGropTypeJson }'/>
	 <div class="bread-wp">
        设置中心 > 校区主页配置
    </div>
		<div class="right-content device-list">
        	<div class="main-content-mode-wp clearfloat email-publish-wp ">
				<form:form id="conditionform" action="${ctx}/service/allocation/serviceProjectAllocationPage?funcid=${funcid}" method="POST">
					<input type="hidden" id="pageNo" name="pageNo" />
					<c:if test="${fn:length(organizationList) > 1}">
              <div class=" part-wp">
                  <span class="search-tips">校区</span>
                  <input class="default-select" name="organizationId" id="organizationId" autocomplete="off" />
                  <span class="select_wrap _hide"></span>
              </div>
          </c:if>
          <c:if test="${fn:length(organizationList) == 1}">
              <input type="hidden" name="organizationId" id="organizationId" value="${organizationList[0].id}" org__id="${organizationList[0].id}" class="single-orgid">
          </c:if>
					<div class="part-wp">
	                    <span class="search-tips">服务名称</span>
	                    <input class="small-input paramValue" name="paramValue" type="text" value="${paramValue}" placeholder="请输入名称" />
	                </div>
	                <div class="part-wp">
	                	<span class="search-tips">服务类型</span>
	                	<select name="serviceType"  class="default-select" id='serviceType'>
	                		<c:forEach items="${serviceGroupType }" var="model">
	                			<c:if test="${model.itemcode != 2}">
	                				<c:choose>
	                					<c:when test="${model.itemcode==serviceType }">
	                						<option value="${model.itemcode }" selected="selected">${model.itemname }</option>
	                					</c:when>
	                					<c:otherwise>
	                						<option value="${model.itemcode }">${model.itemname }</option>
	                					</c:otherwise>
	                				</c:choose>
	                			</c:if>
	                		</c:forEach>
	                	</select>
	                </div>
				</form:form>
				<div class="part-wp">
					<button class="btn btn-red" onclick="showSaveUpdateServiceConfig();">商圈发现</button>
					<perm:hasPermission permCode="pc:setting:project:add">
						<button class="btn btn-red" onclick="manageServiceInfo();">批量上线服务</button>
						<button class="btn btn-white" href="javascript:void(0);"   id="add-btn">新增</button>
					</perm:hasPermission>
					<button class="btn btn-white search-btn" href="javascript:void(0);" id="btn-search" >查询</button>
				</div>
				<table class="layui-hide" id="LAY_table_user" lay-filter="test"></table>
			</div>
		</div>
		<div class="alert-bo" onclick="closeAlert()">
	        <div class="boost-bo">
	            <img src="" alt="">
	        </div>
	    </div>
	    <script type="text/html" id="indexTpl">
	        {{d.LAY_TABLE_INDEX+1}}
		</script>
	<div class="modal fade" id="saveUpdateServiceProjectModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
			<div class="modal-dialog">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
							&times;
						</button>
						<h4 class="modal-title" id="myModalLabel">
							
						</h4>
					</div>
					<div class="modal-body">
						<form class="form-horizontal" role="form">
							<fieldset>
                <legend>服务内容信息</legend>
                <div class="form-group" style="background-color:white;position: relative">
                  <c:if test="${fn:length(organizationList) > 1}">
                    <label class="col-sm-3 control-label" for="serviceNames" style="padding-top:0px;padding-left: 1px;"><span style="color: red;">*</span>校区：</label>
                    <input class="default-select" name="organizationId" id="organizationId" autocomplete="off" type="text"/>
                    <span class="select_wrap _hide" style="left: 26.5%;"></span>
                  </c:if>
                  <c:if test="${fn:length(organizationList) == 1}">
                      <input type="hidden" name="organizationId" id="organizationId" value="${organizationList[0].id}" org__id="${organizationList[0].id}" class="single-orgid">
                  </c:if>
								</div>
								<div class="form-group" style="background-color:white;">
									<label class="col-sm-3 control-label" for="serviceNames" style="padding-top:0px;padding-left: 1px;"><span style="color: red;">*</span>服务名称：</label>
									  <div class="col-sm-3">
                      <label id="serviceNames" style="color: gray;font-size: 14px;font-weight:normal;"></label>
                    </div>
								</div>
								<div class="form-group" style="background-color:white;padding-top: 10px;">
									<label class="col-sm-3 control-label" for="orderNo" style="padding-top:0px;padding-left: 1px;"><span style="color: red;">*</span>服务序号：</label>
									  <div class="col-sm-9">
                      <input class="form-control" id="orderNo"  name="orderNo" type="text" placeholder="请输入服务序号(控制显示的顺序,从大到小)"/>
                    </div>
								</div>
								<div class="form-group" style="background-color:white;padding-top: 10px;">
									<label class="col-sm-3 control-label" for=registerStatus style="padding-top:0px;"><span style="color: red;">*</span>服务状态：</label>
									<div class="col-sm-9" style="padding-left: 20px;">
                    <select name="status"  id="status" class="form-control" style="width: 403px;">
            					<c:forEach items="${serviceStatusGropType }" var="model">
												<option value="${model.itemcode }">${model.itemname }</option>
											</c:forEach>
										</select>
                  </div>
								</div>
								<div class="form-group" style="background-color:white;padding-top: 10px;">
									<label class="col-sm-3 control-label" for=registerStatus style="padding-top:0px;">有效期：</label>
									<div class="col-sm-9" style="padding-left: 20px;">
										<select name="serviceIndate"  id="serviceIndate" class="form-control" style="width: 403px;">
											<option value="">请选择</option>
											<c:forEach items="${serviceIndate }" var="model">
												<option value="${model.itemcode }">${model.itemname }</option>
											</c:forEach>
										</select>
									</div>
								</div>
								<div class="form-group" style="background-color:white;padding-top: 10px;">
									<label class="col-sm-3 control-label" for="orderNo" style="padding-top:0px;padding-left: 1px;"><span style="color: red;">*</span>截止时间：</label>
									<div class="col-sm-3">
										<input id="datetimepicker" readonly="readonly" style="border: 0px;outline:none;cursor: pointer;color: gray;font-size: 14px;font-weight:normal;">
									</div>
									<%--<div class="input-group date form_date col-md-3">
										<input class="form-control" size="16" type="text" value="" readonly>
										<span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span>
									</div>--%>

								</div>
								<div class="form-group" style="background-color:white;padding-top: 10px;">
									<label class="col-sm-3 control-label" for=serviceIcon style="padding-top:0px;">自定义icon：</label>
									<div class="col-sm-9">
										<div class="uploadimg">
											<div class="uploadbtns">
												<label class="uploadimgbtn">
													<input type="hidden" id="serviceIcon" name="serviceIcon"/>
													<input type="file" onchange="selectFileImage(this)" id="fileInput"/>
													<span>上传图片</span>
												</label>
												<a href="javascript:void(0);" class="uploadimgcancel">删除</a>
											</div>
											<div class="customShowimg showimg" style="padding-left: 2px;">
												<img src="${ctx }/images/common/inputImg.png" alt="" />
											</div>
										</div>
									</div>
								</div>

								<%-- <div class="form-group" style="background-color:white;padding-top: 10px;">
									<label class="col-sm-3 control-label" for="orderNo" style="padding-top:0px;padding-left: 1px;"><span style="color: red;">*</span>权限分组：</label>
									<div class="switch switch-small">
										<c:forEach items="${roleGroupType }" var="model">
											<input name="roleGroup" id="check${model.itemcode }" type="checkbox" value="${model.itemcode }" />${model.itemname }
										</c:forEach>
									</div>
								</div> --%>

								<div class="form-group" style="background-color:white;padding-top: 10px;">
									<label class="col-sm-3 control-label" for="orderNo" style="padding-top:0px;padding-left: 1px;"></span>可用用户：</label>
									<div class="switch switch-small">
										<c:forEach items="${roleGroupType }" var="model">
											<input name="roleGroup" id="check${model.itemcode }" type="checkbox" value="${model.itemcode }" />${model.itemname }    
										</c:forEach>
										      <span style="color: red;">   (不勾选只有白名单用户可用)</span>
									</div>
								</div>
								<div class="form-group" style="background-color:white;padding-top: 10px;">
									<label class="col-sm-3 control-label" for="orderNo" style="padding-top:0px;padding-left: 1px;"><span style="color: red;">*</span>权限设置：</label>
									<div class="switch switch-small">
										<input name="permission" id="permission" type="checkbox" value="${model.permission}" />是 （勾选后可针对企业/用户做权限控制）
									</div>
								</div>
							</fieldset>
						</form>
			        </div>
					<div class="modal-footer">
						<a href="javascript:void(0);" title="关闭" data-dismiss="modal" class="btn btn-info" style="float: right;"><span>关闭</span></a>
						<a href="javascript:void(0);" title="提交修改" class="btn btn-success" style="float: right;margin-right: 10px;" id="saves" onclick="saveUpdateServiceProject()"><span>提交修改</span></a>
					</div>
				</div>
			</div>
	</div>
	
	<div class="modal fade" id="saveUpdateModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
			<div class="modal-dialog">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
							&times;
						</button>
						<h4 class="modal-title" id="myModalLabel">
							
						</h4>
					</div>
					<div class="modal-body">
						<form class="form-horizontal" role="form">
							<fieldset>
								<legend>服务内容信息</legend>
								<div class="form-group" style="background-color:white;">
									<label class="col-sm-3 control-label" for="serviceName" style="padding-top:0px;padding-left: 1px;"><span style="color: red;">*</span>服务名称：</label>
									 <div class="col-sm-3">
                             			<input class="form-control" id="serviceName" name="serviceName" type="text" placeholder="请输入服务名称"/>
                         			 </div>
                         			 <label class="col-sm-3 control-label" for="code" style="padding-top:0px;padding-left: 1px;"><span style="color: red;">*</span>服务编码：</label>
									 <div class="col-sm-3">
                             			<input class="form-control" id="code"  name="code" type="text" placeholder="请输入服务编码"/>
                         			 </div>
								</div>
								<div class="form-group" style="background-color:white;padding-top: 10px;">
									<label class="col-sm-3 control-label" for="skipAddress" style="padding-top:0px;"><span style="color: red;">*</span>未认证地址：</label>
									<div class="col-sm-9">
                             			<input class="form-control" id="skipAddress" name="skipAddress" type="text" placeholder="请输入未认证服务跳转地址"/>
                         			 </div>
								</div>
								<div class="form-group" style="background-color:white;padding-top: 10px;">
									<label class="col-sm-3 control-label" for="jumpAddress" style="padding-top:0px;"><span style="color: red;">*</span>已认证地址：</label>
									<div class="col-sm-9">
                             			<input class="form-control" id="jumpAddress" name="jumpAddress" type="text" placeholder="请输入已认证服务跳转地址"/>
                         			 </div>
								</div>
								<div class="form-group" style="background-color:white;padding-top: 10px;">
									<label class="col-sm-3 control-label" for=registerStatus style="padding-top:0px;"><span style="color: red;">*</span>是否注册：</label>
									<div class="col-sm-9" style="padding-left: 20px;">
                             			<select name="registerStatus"  id="registerStatus" class="form-control" style="width: 403px;">
            								<option value="">请选择是否注册</option>
            								<c:forEach items="${registerStatusGroupType }" var="model">
												<option value="${model.itemcode }">${model.itemname }</option>
											</c:forEach>
										</select>
                         			 </div>
								</div>
								<div class="form-group" style="background-color:white;padding-top: 10px;">
									<label class="col-sm-3 control-label" for=linkUrlType style="padding-top:0px;"><span style="color: red;">*</span>跳转类型：</label>
									<div class="col-sm-9" style="padding-left: 20px;">
                             			<select name="linkUrlType"  id="linkUrlType" class="form-control" style="width: 403px;">
            								<option value="">请选择跳转类型</option>
            								<c:forEach items="${jumpGroupType }" var="model">
            									<option value="${model.itemcode }">${model.itemname }</option>
            								</c:forEach>
										</select>
                         			 </div>
								</div>
								<div class="form-group" style="background-color:white;padding-top: 10px;">
									<label class="col-sm-3 control-label" for=serviceType style="padding-top:0px;"><span style="color: red;">*</span>服务类型：</label>
									<div class="col-sm-9" style="padding-left: 20px;">
                             			<select name="serviceType"  id="serviceType" class="form-control" style="width: 403px;">
            								<option value="">请选择服务类型</option>
            								<c:forEach items="${serviceGroupType }" var="model">
            									<option value="${model.itemcode }">${model.itemname }</option>
            								</c:forEach>
										</select>
                         			 </div>
								</div>
								<div class="form-group" style="background-color:white;padding-top: 10px;">
									<label class="col-sm-3 control-label" for=isSignContract style="padding-top:0px;"><span style="color: red;">*</span>是否签约：</label>
									<div class="col-sm-9" style="padding-left: 20px;">
                             			<select name="isSignContract"  id="isSignContract" class="form-control" style="width: 403px;">
            								<option value="">是否签约</option>
            								<c:forEach items="${isSignContractGroupType }" var="model">
            									<option value="${model.itemcode }">${model.itemname }</option>
            								</c:forEach>
										</select>
                         			 </div>
								</div>
								<div class="form-group" style="background-color:white;padding-top: 10px;">
									<label class="col-sm-3 control-label" for=serviceType style="padding-top:0px;"><span style="color: red;">*</span>服务分类：</label>
									<div class="col-sm-9" style="padding-left: 20px;">
										<select name="serviceCategory"  id="serviceCategory" class="form-control" style="width: 403px;">
											<option value="">请选择</option>
											<c:forEach items="${serviceCategory }" var="model">
												<option value="${model.itemcode }">${model.itemname }</option>
											</c:forEach>
										</select>
									</div>
								</div>
								<div class="form-group" style="background-color:white;padding-top: 10px;">
									<label class="col-sm-3 control-label" for=serviceIcon style="padding-top:0px;"><span style="color: red;">*</span>服务图标：</label>
									<div class="col-sm-9">
										<div class="uploadimg">
											<div class="uploadbtns">
                								<label class="uploadimgbtn">
                								<input type="hidden" id="serviceIcon" name="serviceIcon"/>
			                   					 <input type="file" onchange="selectFileImage(this)" id="fileInput"/>
			                   					 <span>上传图片</span>
               				 						</label>
                									<a href="javascript:void(0);" class="uploadimgcancel">删除</a>
           				 					</div>
											<div class="showimg" style="padding-left: 2px;">
					                			<img src="${ctx }/images/common/inputImg.png" alt="" />
					            			</div>
										</div>
									</div>
								</div>
							</fieldset>
						</form>
			        </div>
					<div class="modal-footer">
						<a href="javascript:void(0);" title="关闭" data-dismiss="modal" class="btn btn-info" style="float: right;"><span>关闭</span></a>
						<a href="javascript:void(0);" title="提交修改" class="btn btn-success" style="float: right;margin-right: 10px;" id="save" onclick="saveUpdateServiceTypeInfo()"><span>提交修改</span></a>
					</div>
				</div><!-- /.modal-content -->
			</div><!-- /.modal -->
	</div>


	<div class="modal fade" id="saveUpdateServiceConfigModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
						&times;
					</button>
					<h4 class="modal-title" id="myModalLabel">

					</h4>
				</div>
				<div class="modal-body">
					<form class="form-horizontal" role="form">
						<fieldset>
							<legend>商圈发现</legend>
							<input type="hidden" id="discoverConfig">
							<div class="form-group" style="background-color:white;padding-top: 10px;">
								<label class="col-sm-3 control-label" for=registerStatus style="padding-top:0px;"><span style="color: red;">*</span>页面状态：</label>
								<div class="col-sm-9" style="padding-left: 20px;">
									<select name="discoverIsEnabled"  id="discoverIsEnabled" class="form-control" style="width: 403px;">
										<option value="">请选择</option>
										<option value="1">开启</option>
										<option value="0">关闭</option>
									</select>
								</div>
							</div>
							<div class="form-group" style="background-color:white;padding-top: 10px;">
								<label class="col-sm-3 control-label" for=registerStatus style="padding-top:0px;"><span style="color: red;">*</span>页面名称：</label>
								<div class="col-sm-9" style="padding-left: 20px;">
									<select name="discoverCategory"  id="discoverCategory" class="form-control" style="width: 403px;">
										<option value="">请选择</option>
										<c:forEach items="${discoverCategory }" var="model">
											<option value="${model.itemcode }">${model.itemname }</option>
										</c:forEach>
									</select>
								</div>
							</div>
						</fieldset>
					</form>
				</div>
				<div class="modal-footer">
					<a href="javascript:void(0);" title="关闭" data-dismiss="modal" class="btn btn-info" style="float: right;"><span>关闭</span></a>
					<a href="javascript:void(0);" title="提交修改" class="btn btn-success" style="float: right;margin-right: 10px;" id="save1" onclick="saveUpdateServiceConfig()"><span>提交修改</span></a>
				</div>
			</div><!-- /.modal-content -->
		</div><!-- /.modal -->
	</div>
</body>
