<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="q" uri="/query-tags"%>
<%@ include file="/common/meta.jsp"%>
<!-- 批量导入即导入excel页面 -->
<fieldset><legend>车辆信息批量导入</legend>
<div id="saveFormDiv" dojoType="ContentPane" class="formAnswer" layoutAlign="top">
<table id="searchVehicardCollectListTable" width="100%">
<tr>
<td>
<s:form id="searchVehicardCollectListForm" action="queryVehicardCollectList" theme="simple" namespace="/vehicard/open" name="searchVehicardCollectListForm" method="get">
<table class="clsSearchTbl">
<tr>
<td class="clsSearchViewCaption">
车牌号
</td>
<td>
<s:textfield name="qm.platenum" id="qmPlatenum" cssClass="textinput"/>
</td>
<td class="clsSearchViewCaption">
负责人姓名
</td>
<td>
<s:textfield name="qm.personname" id="qmPersonname" cssClass="textinput"/>
</td>
<td class="clsSearchViewCaption">
部门
</td>
<td>
<s:textfield name="qm.organizename" id="qmOrganizename" cssClass="textinput"></s:textfield>
<s:hidden name="qm.orgattachrelacode" id="relacode" />
<s:hidden name="qm.organizeSid" id="organizesidId"/>
<s:hidden name="qm.organizetypecode" id="organizeTypeCode"/>
<s:url id="listBaseOrgUrl" action="selectOrg" namespace="/resource/person"></s:url>
<input type="button" name="selectOrgBu" class="button" value="..." onclick="javascript:popupWindow('selectOrgWin','<s:property value="listBaseOrgUrl"/>','<s:text name="label.orgSelect"/>',800,400);" />
</td>
<td class="clsSearchViewCaption">
车型
</td>
<td>
<s:select name="qm.cartype" id="qmCartype" cssClass="textinput" headerKey="" headerValue="==请选择==" list="#{'小客':'小客','大客':'大客','小货':'小货','大货':'大货','危化品车':'危化品车'}"></s:select>
</td>
<td class="clsSearchViewCaption">
负责人身份证
</td>
<td>
<s:textfield name="qm.idcardnum" id="qmIdcardnum" cssClass="textinput"/>
</td>
</tr>
<tr>
<td class="clsSearchViewCaption">
车卡性质
</td>
<td>
<s:select name="qm.carpro" id="qmCarpro" cssClass="textinput" headerKey="" headerValue="==请选择==" list="#{1:'固定',2:'短期',3:'临时'}"></s:select>
</td>
<td class="clsSearchViewCaption">
使用性质
</td>
<td>
<s:select name="qm.property" id="qmProperty" cssClass="textinput" headerKey="" headerValue="==请选择==" list="#{'办公用车':'办公用车','私人用车':'私人用车'}"></s:select>
</td>
<td class="clsSearchViewCaption">
车卡开卡日期(起)
</td>
<td>
<s:textfield name="qm.validstartdateFrom" id="qmValidstartdateFrom" cssClass="textinput" readonly="true">
<s:param name="value">
<s:date name="qmValidstartdateFrom" format="yyyy-mm-dd"/>
</s:param>
</s:textfield>
<img id="qmValidstartdateFromBtn" src="${pageContext.request.contextPath}/components/calendar/skins/aqua/cal.gif"
border="0" style="cursor: pointer" onmouseover="initCalendar('qmValidstartdateFrom', 'qmValidstartdateFromBtn')">
</td>
<td class="clsSearchViewCaption">
车卡开卡日期(止)
</td>
<td>
<s:textfield name="qm.validstartdateTo" id="qmValidstartdateTo" cssClass="textinput" readonly="true">
<s:param name="value">
<s:date name="qmValidstartdateTo" format="yyyy-mm-dd"/>
</s:param>
</s:textfield>
<img id="qmValidstartdateToBtn" src="${pageContext.request.contextPath}/components/calendar/skins/aqua/cal.gif"
border="0" style="cursor: pointer" onmouseover="initCalendar('qmValidstartdateTo', 'qmValidstartdateToBtn')">
</td>
<td class="clsSearchViewCaption">
车辆颜色
</td>
<td>
<s:textfield name="qm.color" id="qmColor" cssClass="textinput"/>
</td>
</tr>
<tr>
<td class="clsSearchViewCaption" colspan="6"> </td>
<td class="clsSearchViewCaption" align="center" colspan="2">
<input id="queryVehicardCollectBtn" type="button" name="queryVehicardCollectBtn" value="查询" class="button" onclick="postSearchForm('searchVehicardCollectListForm','vehicardCollectListDiv','queryVehicardCollectBtn');"/>
<input type="reset" id="resetBtn" class="button" value="重置" onmouseover="submitButtonMouseOver(this)"/>
</td>
</tr>
</table>
</s:form>
</td>
</tr>
</table>
</div>
</fieldset>
<fieldset style="height:68%;width:100%; overflow:auto;"><legend>查询结果</legend>
<s:div id="vehicardCollectListDiv" theme="ajax" executeScripts="true"></s:div>
</fieldset>
<fieldset><legend>开卡操作:</legend>
<table class="clsSearchTbl" width="100%">
<tr align="left">
<td class="clsSearchViewCaption" width="2%" rowspan="3">意见:</td>
<td class="clsSearchViewCaption" width="5%" rowspan="3">
<textarea rows="4" cols="30" id="openReason" class="textinput" name="openReason"></textarea>
</td>
<td rowspan="3">
<input type="button" name="openVehicard" value="开卡" class="button" onclick="openVehicard();"/>
<input type="button" name="uopenVehicard" value="拒绝" class="button" onclick="uopenVehicard();"/>
</td>
<s:hidden name="qm.limExeSys" id="limExeSys"/>
<td rowspan="3">
<select id="limSystem" multiple="multiple" style="width:200px;height:90;"/>
</td>
<td rowspan="3">
<select id="limgatenum" multiple="multiple" style="width:200px;height:90;"/>
</td>
<td>
<input type="button" id="aplButton2" class="button" onmouseover="this.focus()"
onblur= "selectSystem();"
onclick="javascript:popupWindow('selectExeSysWin','${pageContext.request.contextPath}/vehicard/open/executeSysForOpenVehicard.jsp','选择执行系统',650,400);" value="选择执行系统"/>
<font color="red">*</font><span id="spanSelectExeSys" class="txt_red_star"></span><br>
</td>
<tr>
<td>
<input type="button" class="button" value="删除" onclick="delOptions('limSystem');"/>
</td>
</tr>
<tr>
<td>
<input type="button" class="button" value="添加" onclick="getExecuteSyscode('limSystem');getGateCode('limgatenum');"/>
</td>
</tr>
</tr>
</table>
</fieldset>
<script type="text/javascript">
function openVehicard(){
var sid = '';
var obj = document.getElementsByName("radioBox");
if(obj!=null){
sid=getValueOfRadio(obj);
}else{
alert('请选择一条选项进行操作');
return;
}
if(sid==''){
alert('请选择一条选项进行操作');
return;
}
alert("openVehicard");
}
function uopenVehicard(){
var sid = '';
var obj = document.getElementsByName("radioBox");
if(obj!=null){
sid=getValueOfRadio(obj);
}else{
alert('请选择一条选项进行操作');
return;
}
if(sid==''){
alert('请选择一条选项进行操作');
return;
}
alert("uopenVehicard");
}
getValueOfRadio=function(obj){
radioValue='';
for(i=0;i<obj.length;i++){
if(obj[i].checked){
radioValue=obj[i].value;
}
}
return radioValue;
}
selectAll1 = function(checkFlag){
var transValues;
transValues = document.getElementsByName('checkFlag');
for(i=0;i<transValues.length;i++)
{
var transValue = transValues[i];
if(checkFlag.checked)
{
if(!transValue.checked){
transValue.checked = true;
}
}else{
transValue.checked = false;
}
}
}
function addSelect(select,value,label){
var selectObj = document.getElementById(select);
var option = new Option(label,value);
var options = selectObj.options;
if(options.length > 0){
var addFlag = 0;
for(var i=0; i<options.length; i++){
if(options[i].value != value){
addFlag++;
}
}
if(addFlag == options.length){
selectObj.add(option);
}
}else{
selectObj.add(option);
}
}
function selectExeSids(checkBoxId){
var exeSid="";
var transValues;
transValues = document.getElementsByName(checkBoxId);
for(i=0;i<transValues.length;i++)
{
var transValue = transValues[i];
if(transValue.checked){
exeSid = transValue.value;
var eyeStrs = exeSid.split(",");
addSelect('limSystem',eyeStrs[0],eyeStrs[2]);
addSelect('limgatenum',eyeStrs[0],eyeStrs[1]);
}
}
}
function getExecuteSyscode(select){
var selectObj = document.getElementById(select);
var options = selectObj.options;
var r = 0;
for(var i=0; i<options.length; i++){
r = r|(1<<(options[i].value-1));
}
alert(r.toString(2).split("").reverse().join(""));
}
function getGateCode(select){
var selectObj = document.getElementById(select);
var options = selectObj.options;
var r = 0;
for(var i=0; i<options.length; i++){
r = r|(1<<(options[i].text-1));
}
alert(r.toString(2).split("").reverse().join(""));
}
function delOptions(select){
var selectObj = document.getElementById(select);
var selectObjG = document.getElementById("limgatenum");
do{
var options = selectObj.options;
var optionsG = selectObjG.options;
var sysValue;
for(var i=0; i<options.length; i++){
if(options[i].selected == true){
sysValue = options[i].value;
break;
}
}
for(var j=0; j<optionsG.length; j++){
if(optionsG[j].value == sysValue){
optionsG[j].selected = true;
break;
}
}
selectObjG.remove(selectObjG.selectedIndex);
selectObj.remove(selectObj.selectedIndex);
}while(selectObj.selectedIndex>=0);
}
</script>