<!-- include 'header' -->
<link rel="stylesheet" href="<?= WEB_SITE_GLOBAL ?>/js/jquery-ui.css" />
<script src="<?= WEB_SITE_GLOBAL ?>/js/jquery-ui.js"></script>

<script src="<?= WEB_SITE_GLOBAL ?>/js/jquery.ui.core.js"></script>
<script src="<?= WEB_SITE_GLOBAL ?>/js/jquery.ui.widget.js"></script>
<script src="<?= WEB_SITE_GLOBAL ?>/js/jquery.ui.position.js"></script>
<script src="<?= WEB_SITE_GLOBAL ?>/js/jquery.ui.autocomplete.js"></script>

<script src="<?= autoTag ?>"></script>

<script type="text/javascript" src="<?= WEB_SITE_GLOBAL ?>/js/bootstrap.min.js"></script>
<script type="text/javascript" src="<?= WEB_SITE_GLOBAL ?>/js/bootstrap-datetimepicker.js" charset="UTF-8"></script>
<script type="text/javascript" src="<?= WEB_SITE_GLOBAL ?>/js/bootstrap-datetimepicker.zh-CN.js" charset="UTF-8"></script>

<link href="<?= WEB_SITE_GLOBAL ?>/css/datepicker.min.css" rel="stylesheet" type="text/css">
<script src="<?= WEB_SITE_GLOBAL ?>/js/datepicker.min.js"></script>
<script src="<?= WEB_SITE_GLOBAL ?>/js/datepicker.zh.js"></script>

<script>
	$(function() {
		<!-- if  isset({{longleDetail.status}})&&{{longleDetail.status}}>=3 -->
		$("#longleStatus_5").attr('disabled',false);
		$("#longleStatus_6").attr('disabled',false);
		$("#longleStatus_8").attr('disabled',false);
		<!-- endif -->

		<!-- if  isset({{longleDetail.status}})&&{{longleDetail.status}}<=2 -->
		$("#longleStatus_5").attr('disabled',true);
		$("#longleStatus_6").attr('disabled',true);
		<!-- endif -->
	})
</script>

<body>

	<div class="mainLayout">
		<div class="mainMenu">
			<div class="menuItem">
				<a href="/" class="mLogo">CLD</a>
				<ul>
					<!-- include 'menu' -->
				</ul>
			</div>
		</div>
		<div class="warpContent">
			<div class="contactTab">
				<a class="now" href="#">公共锁库</a>
				<a  href="/statistics">使用统计</a>
				<form class="" action="/searchlongle" method="post">
				
				<div class="searchItem">
					<input type="text" name="search" value="{{search}}" placeholder="输入锁号进行搜索">
					<input type="submit" value="搜索" class="subBtn">
					<input value="新锁" class="subBtn add" type="button" onclick="javascrtpt:window.location.href='/adminlock'">
				</div>
				
				</form>
			</div>	
	  		<div class="lockDatabase fL">
	  			<div class="lockCate">
	  				<form class="" id="LS" action="/keyonline" method="post" style="margin:0">
	  				<!-- <div class="fR"><a href="#" class="button">批量添加锁记录</a></div>  -->
	  				<ul class="cateList">
	  					<li class="clearfix filter">
	  					<select name="year" onchange="longleSub()">
	  					{{dateHtml}}
	  					</select>
	  					<select name="cid" onchange="longleSub()">
	  					<!-- loop category -->
	  					<option <!-- if {{cid}}=={{category' value.cid}} --> selected <!-- endif --> value="{{category' value.cid}}">{{category' value.title}}</option>
	  					<!-- endloop -->
	  					</select>
						<select name="staff" onchange="longleSub()">
							<option value="">负责人</option>
							<!-- loop staffList -->
							<option <!-- if {{staff}}=={{staffList' value.username}} --> selected <!-- endif --> value="{{staffList' value.username}}">{{staffList' value.username}}</option>
							<!-- endloop -->
						</select>
	  					<select name="status" onchange="longleSub()">
	  					<option <!-- if {{status}}==0 --> selected <!-- endif --> value="0">不限</option>
	  					<option <!-- if {{status}}==1 --> selected <!-- endif --> value="1">生成</option>
	  					<option <!-- if {{status}}==2 --> selected <!-- endif --> value="2">接收</option>
	  					<option <!-- if {{status}}==3 --> selected <!-- endif --> value="3">借出</option>
	  					<option <!-- if {{status}}==4 --> selected <!-- endif --> value="4">销售</option>
	  					<option <!-- if {{status}}==5 --> selected <!-- endif --> value="5">升级</option>
	  					<option <!-- if {{status}}==6 --> selected <!-- endif --> value="6">更换</option>
	  					<option <!-- if {{status}}==7 --> selected <!-- endif --> value="7">收回</option>
	  					</select>
	  					<select name="product" onchange="longleSub()">
	  					<option <!-- if {{productName}}=="" --> selected <!-- endif --> value="">不限</option>
	  					<!-- loop product -->
	  					<option <!-- if {{productName}}=={{product' value.title}} --> selected <!-- endif --> value="{{product' value.title}}">{{product' value.title}}</option>
	  					<!-- endloop -->
	  					</select>
	  					</li>
	  					
	  				</ul>
	  				<ul class="lockTableUl">
	  					<li class="clearfix filter"><span>锁号</span><span style="width:18%">产品</span><span>办事处</span><span>出库</span><span>责任人</span><span>状态</span><span>客户</span></li>
	  				</ul>
	  				</form>
	  			</div>
	  			<div class="lockList autoHeightL1">
	  				<ul class="lockTableUl">
	  					<!-- loop longleArray -->
	  					<li class="clearfix"><span><a href="javascript:void(0)" <!-- if {{longleArray' value.status}}!=1 --> id="getLongleLog_{{longle' value.lid}}" <!-- endif --> data="{{longle' value.lid}}">{{longle' value.key_num}}</a></span><span style="width:18%">{{longle' value.product}}</span><span>{{longle' value.category}}</span><span>{{longle' value.make_day}}</span><span><a href="javascript:void(0)" id="getStaffInfo" data="{{longle' value.responsible}}">{{longle' value.responsible}}</a></span><span>{{longle' value.statusT}}</span><span><a href="javascript:void(0)" id="getClientInfo" data="{{longle' value.clientid}}">{{longle' value.client}}</a></span>
	  					</li>
	  					<!-- endloop -->
	  				</ul>
	  			</div>
	  		</div>
	  		<div  class="lockDetil fL">
	  			<div  style="display:none;"  id="clientInfo"></div>
					<div class="contactInfo" style="display:none;" id="staffInfo"></div>
	  			<div id="longleLog" <!-- if empty({{lidKey}}) --> style="display:none;" <!-- endif --> >
					<div  class="header" style="">
	  				<h1 id="longleTitle">{{longleDetail.key_num}}</h1>
	  				<h2>
						<span id="longleResponsible">
							<a href="javascript:void(0)" onclick="getStaffInfo('{{longleDetail.responsible}}')" >{{longleDetail.responsible}}</a>
						</span>
						<span id="longleStatus">
							{{longleDetail.statusT}}/{{longleDetail.product}}
							<!-- if !empty({{longleDetail.version}}) -->
							/({{longleDetail.version}})
							<!-- endif -->
							<!-- if !empty({{longleDetail.alloted_time}}) -->
							期限：{{longleDetail.alloted_time}}
							<!-- endif -->
							<!-- if !empty({{longleDetail.licences}}) -->
							节点：{{longleDetail.licences}}
							<!-- endif -->
							</span>
					</h2>
	  				</div>
	  			<div  class="lockRecord autoHeightR2" >
	  				<!--添加记录按钮-->
	  				<!--<div class="toolItem clearfix">
	  					 <a href="#" class="button">添加记录</a> 
	  				</div> -->
	  				<!--添加记录-->
	  				<div class="toolItem clearfix">
	  				<form name="lock" action="/addDoLockLog" method="post">
	  				<input type="hidden" name="klid" id="klid" ></input>
	  				
	  				<input type="hidden" name="name" id="name" ></input>
	  				<input type="hidden" name="company" id="company" ></input>
	  				
	  				
						  <div class="control-group">
						    <label class="control-label" for="inputEmail">记录类型</label>
						    <div class="controls">
							    <label class="radio inline">
							    	<input type="radio" name="longleStatus" id="longleStatus_3"  value="3" checked>借出
							    </label>
							    <label class="radio inline">
							    	<input type="radio" name="longleStatus" id="longleStatus_4"  value="4">销售
							    </label>
							    <label class="radio inline">
							    	<input type="radio" name="longleStatus" id="longleStatus_9"  value="9">赠送
							    </label>
							    <label class="radio inline">
							    	<input type="radio" name="longleStatus" id="longleStatus_5" disabled="disabled"  value="5">升级
							    </label>
							    <label class="radio inline">
							    	<input type="radio" name="longleStatus" id="longleStatus_6" disabled="disabled"  value="6">更换
							    </label>
							    <label class="radio inline"> <!-- disabled="disabled" -->
							    	<input type="radio" name="longleStatus" id="longleStatus_7"   value="7">收回
							    </label>

								<label class="radio inline" <!-- if empty({{longleDetail.alloted_time}}) --> style="display:none" <!-- endif --> id="alloted" >
									<input type="radio" name="longleStatus" id="longleStatus_10"  value="10">延期
								</label>

							    <label class="radio inline">
							    	<input type="radio" name="longleStatus" id="longleStatus_8"  value="8">备注
							    </label>
						    </div>
						  </div>
	  				<!--添加记录-借锁-->
	  				<div id="longleStatusShow_3">
						  <div class="control-group"  >
						    <label class="control-label" for="inputPassword">借出客户</label>
						    <div class="controls">
						      <span data-placement="right" data-toggle="ctooltip" data-original-title="只允许填写库中存在的客户，若输入客户不存在，请先添加该客户。">
						      <input type="text" name="browseClient" id="tags" data-name='' data-company='' value=""></span>
						    </div>
						  </div>
						  <div class="control-group" style="display:none">
						    <label class="control-label" for="inputPassword">产品</label>
						    <div class="controls">
						      <select name="test-browseProduct">
						      <!-- loop product  -->
						      <option value="{{category' value.title}}">{{category' value.title}}</option>
						      <!-- endloop -->
						      </select>
						    </div>
						  </div>
					</div>
	  				<!--添加记录-销售-->
	  				<div id="longleStatusShow_4" style="display:none;">
						  <div class="control-group">
						    <label class="control-label" for="inputPassword">销售客户</label>
						    <div class="controls">
						      <span data-placement="right" data-toggle="ctooltip" data-original-title="只允许填写库中存在的客户，若输入客户不存在，请先添加该客户。">
						      <input type="text" name="sellClient" data-name='' data-company='' id="tags2" value=""></span>
						    </div>
						  </div>
						  <div class="control-group" style="display:none">
						    <label class="control-label" for="inputPassword">产品</label>
						    <div class="controls">
						      <select name="test-sellProduct"><!-- loop product  -->
						      <option value="{{category' value.title}}">{{category' value.title}}</option>
						      <!-- endloop --></select>
						    </div>
						  </div>
					</div>
					<!--添加记录-赠送-->
	  				<div id="longleStatusShow_9" style="display:none;">
						  <div class="control-group">
						    <label class="control-label" for="inputPassword">赠送客户</label>
						    <div class="controls">
						      <span data-placement="right" data-toggle="ctooltip" data-original-title="只允许填写库中存在的客户，若输入客户不存在，请先添加该客户。">
						      <input type="text" name="giftClient" data-name='' data-company='' id="tags4" value=""></span>
						    </div>
						  </div>
						  
					</div>
	  				<!--添加记录-升级-->
	  				<div id="longleStatusShow_5" style="display:none;">
						  <div class="control-group">
						    <label class="control-label" for="inputPassword">新增产品</label>
						    <div class="controls">
						      <select name="newProduct" id="newProduct">
						      <!-- loop product  -->
						      <option value="{{product' value.title}}">{{product' value.title}}</option>
						      <!-- endloop -->
						      </select>
						    </div>
						  </div>
					</div>
	  				<!--添加记录-更换-->
	  				<div id="longleStatusShow_6" style="display:none;">
						  <div class="control-group">
						    <label class="control-label" for="inputPassword">新锁号</label>
						    <div class="controls">
						      <span data-placement="right" data-toggle="ctooltip" data-original-title="只允许填写库中存在锁号，若输入锁号不存在，请先生成/接收该锁。"><input type="text" name="key_num"  id="tags3" value=""></span>
						    </div>
						  </div>
					</div>

						<!--添加记录-延期-->
						<div class="control-group" id="longleStatusShow_10" style="display:none;">
							<label class="control-label" for="inputPassword">延期时间</label>
							<div class="controls">
								<input class="datepicker-here span3" name="alloted_time" id="alloted_time" placeholder="按时间筛选" type="text" data-language="zh">
							</div>
						</div>
	  				<!--添加记录-备注-->
	  				<div id="longleStatusShow_8" style="display:none;">
						  <div class="control-group">
						    <label class="control-label" for="inputPassword">备注</label>
						    <div class="controls">
						      <textarea id="marks" style="width:95%" rows="5" name="mark" ></textarea>
						    </div>
						  </div>
					</div>
					
	  				<!--添加记录按钮-->
	  				<div class="control-group clearfix">
	  					<span id='LKMSG'></span>
	  					<input type="button" id="QTP" onclick="RLongMsg()" class="button" value="确定添加" />
	  					
	  					<!-- <a href="#" class="button"></a>
	  					<a href="#" class="button btn-gray">取消</a>  -->
	  				</div>
	  				</form>		  				
	  				</div>
	  				<!--记录列表-->
	  				<div id="LongleLogHtml">
						{{longleLogHtml}}

					</div>
					
					
				</div>
				
				</div>
				
	  		</div>
		</div>
	</div>
	<!-- if {{reLongle}}!=0 -->
	<div class="globalNotice">
		<div class="entry clearfix">
			<div class="fR">
				<a class="button" href="/receive">前往</a>
			</div>
			<div class="item">
				<p>{{reLongle}}个锁需要接收</p>
			</div>
		</div>
	</div>
	<!-- endif -->
<script type="text/javascript">autoFlashHeight();</script>	
</body>