CompanyAffixSearch.jsp 18.2 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495

<%@ page language="java" contentType="text/html; charset=UTF-8"%>
<%@ taglib uri="/WEB-INF/weaver.tld" prefix="wea"%>
<%@ include file="/systeminfo/init_wev8.jsp" %>
<jsp:useBean id="rs" class="weaver.conn.RecordSet" scope="page" />
<%@page import="weaver.docs.docs.DocComInfo"%>

<script>
var parentDialog = parent.parent.getDialog(parent);
//var parentWin = parent.parent.getParentWindow(parent.window);
var parentWin = parent.getParentWindow(window);
</script>

<%

	//很关键的一个变量,用于判断后续页面是否开发编辑权限
	//0--只有这个公司的查看权限,没有维护权限
	//1--拥有这个公司查看和维护全县
	//String showOrUpdate = Util.null2String(session.getAttribute("showOrUpdate")+"");
	//搜索策略是针对每一个用户而言的,所以在此屏蔽搜索策略的增、删、改没意义
	
	String method = Util.null2String(request.getParameter("method"));
	//System.out.println("method========="+method);
	String moudel = Util.null2String(request.getParameter("moudel"));
	//System.out.println("moudel========="+moudel);
	String btn =  Util.null2String(request.getParameter("btn"));
	//System.out.println("btn========="+btn);
	String companyid = Util.null2String(request.getParameter("companyid"));
	//System.out.println("companyid========="+companyid);
	String panelTitle="";
	String moudelName = "";
	if("add".equals(method)&&"search".equals(moudel)){
		panelTitle=""+SystemEnv.getHtmlLabelName(30961,user.getLanguage());
		moudelName=""+SystemEnv.getHtmlLabelName(30959,user.getLanguage())+" ";
	}
	if("edit".equals(method)&&"search".equals(moudel)){
		panelTitle=""+SystemEnv.getHtmlLabelName(30962,user.getLanguage());
		moudelName=""+SystemEnv.getHtmlLabelName(30959,user.getLanguage())+" ";
	}
	if("add".equals(method)&&"delivery".equals(moudel)){
		panelTitle=""+SystemEnv.getHtmlLabelName(30963,user.getLanguage());
		moudelName=""+SystemEnv.getHtmlLabelName(30960,user.getLanguage())+" ";
	}
	if("edit".equals(method)&&"delivery".equals(moudel)){
		panelTitle=""+SystemEnv.getHtmlLabelName(30960,user.getLanguage());
		moudelName=""+SystemEnv.getHtmlLabelName(30964,user.getLanguage())+" ";
	}
	
	String searchid = Util.null2String(request.getParameter("searchid"));
	//System.out.println("searchid========="+searchid);
	String filed0="";
	String filed1="";
	String filed2="";
	String filed3="";
	String filed4="";
	String filed5="";
	String filed6="";
	String filed7="";
	String filed8="";
	String filed9="";
	String ship0="";
	String ship1="";
	String ship2="";
	String ship3="";
	String ship4="";
	String ship5="";
	String ship6="";
	String ship7="";
	String ship8="";
	String searchname="";
	if("edit".equals(method)){
		String sql = " select * from CPCOMPANYAFFIXSEARCH where id="+searchid;
		rs.execute(sql);
		if(rs.next()){
			filed0 = Util.null2String(rs.getString("SEARCHFIELD0"));
			filed1 = Util.null2String(rs.getString("SEARCHFIELD1"));
			filed2 = Util.null2String(rs.getString("SEARCHFIELD2"));
			filed3 = Util.null2String(rs.getString("SEARCHFIELD3"));
			filed4 = Util.null2String(rs.getString("SEARCHFIELD4"));
			filed5 = Util.null2String(rs.getString("SEARCHFIELD5"));
			filed6 = Util.null2String(rs.getString("SEARCHFIELD6"));
			filed7 = Util.null2String(rs.getString("SEARCHFIELD7"));
			filed8 = Util.null2String(rs.getString("SEARCHFIELD8"));
			filed9 = Util.null2String(rs.getString("SEARCHFIELD9"));
			ship0 = Util.null2String(rs.getString("SEARCHSHIP0"));
			ship1 = Util.null2String(rs.getString("SEARCHSHIP1"));
			ship2 = Util.null2String(rs.getString("SEARCHSHIP2"));
			ship3 = Util.null2String(rs.getString("SEARCHSHIP3"));
			ship4 = Util.null2String(rs.getString("SEARCHSHIP4"));
			ship5 = Util.null2String(rs.getString("SEARCHSHIP5"));
			ship6 = Util.null2String(rs.getString("SEARCHSHIP6"));
			ship7 = Util.null2String(rs.getString("SEARCHSHIP7"));
			ship8 = Util.null2String(rs.getString("SEARCHSHIP8"));
			searchname = Util.null2String(rs.getString("searchname"));
		}
		//System.out.println(ship0+"   "+ship1+"   "+ship2);
	}
%>

<script type="text/javascript">
	jQuery(document).ready(function(){
		var have_value="";
		if("<%=method%>"=="edit"){
			jQuery("#field0").val("<%=filed0%>");
			if("<%=filed0%>"!=""){have_value=0;}
			jQuery("#field1").val("<%=filed1%>");
			if("<%=filed1%>"!=""){have_value=1;}
			jQuery("#field2").val("<%=filed2%>");
			if("<%=filed2%>"!=""){have_value=2;}
			jQuery("#field3").val("<%=filed3%>");
			if("<%=filed3%>"!=""){have_value=3;}
			jQuery("#field4").val("<%=filed4%>");
			if("<%=filed4%>"!=""){have_value=4;}
			jQuery("#field5").val("<%=filed5%>");
			if("<%=filed5%>"!=""){have_value=5;}
			jQuery("#field6").val("<%=filed6%>");
			if("<%=filed6%>"!=""){have_value=6;}
			jQuery("#field7").val("<%=filed7%>");
			if("<%=filed7%>"!=""){have_value=7;}
			jQuery("#field8").val("<%=filed8%>");
			if("<%=filed8%>"!=""){have_value=8;}
			jQuery("#field9").val("<%=filed9%>");
			if("<%=filed9%>"!=""){have_value=9;}
		
			jQuery("#andor").find("tr:eq(0)").find("td").find("a:eq(1)").text("<%=ship0%>");
			jQuery("#andor").find("tr:eq(1)").find("td").find("a:eq(1)").text("<%=ship1%>");
			jQuery("#andor").find("tr:eq(2)").find("td").find("a:eq(1)").text("<%=ship2%>");
			jQuery("#andor").find("tr:eq(3)").find("td").find("a:eq(1)").text("<%=ship3%>");
			jQuery("#andor").find("tr:eq(4)").find("td").find("a:eq(1)").text("<%=ship4%>");
			jQuery("#andor").find("tr:eq(5)").find("td").find("a:eq(1)").text("<%=ship5%>");
			jQuery("#andor").find("tr:eq(6)").find("td").find("a:eq(1)").text("<%=ship6%>");
			jQuery("#andor").find("tr:eq(7)").find("td").find("a:eq(1)").text("<%=ship7%>");
			jQuery("#andor").find("tr:eq(8)").find("td").find("a:eq(1)").text("<%=ship8%>");

			
			/**
			jQuery("#ship0").val("<%=ship0%>");
			jQuery("#ship1").val("<%=ship1%>");
			
			jQuery("#ship2").val("<%=ship2%>");
			jQuery("#ship3").val("<%=ship3%>");

			jQuery("#ship4").val("<%=ship4%>");
			jQuery("#ship5").val("<%=ship5%>");
			jQuery("#ship6").val("<%=ship6%>");
			jQuery("#ship7").val("<%=ship7%>");
			jQuery("#ship8").val("<%=ship8%>");
			**/
			if(have_value>0){
					for(var i=0;i<=have_value;i++){
						jQuery("#field"+i).removeClass("OInput3").addClass("OInput2").attr("disabled",false);
						if(i>=1){
							//jQuery("#ship"+(i-1)).attr("disabled","");
							jQuery("#ship"+(i-1)).selectbox("enable");
						}
					}
			}
			jQuery("#searchname").val("<%=searchname%>");
			jQuery("button[issave]").attr("issave","F");
			searchMethod("search");
		}
	});
	
	function checkMust(_save){
		var ischecked = false;
		if(_save=="search&save"){
			if(jQuery("#searchname").val()=="")alert("<%=SystemEnv.getHtmlLabelName(15859,user.getLanguage())%>");
			else ischecked = true;
		}else{
			ischecked = true;
		}
		return ischecked;
	}
	
	function searchMethod(_save){
		if(checkMust(_save)){
		var searchcondition="?companyid=<%=companyid%>";
		searchcondition+="&field0="+jQuery("#field0").val();
		searchcondition+="&field1="+jQuery("#field1").val();
		searchcondition+="&field2="+jQuery("#field2").val();
		searchcondition+="&field3="+jQuery("#field3").val();
		searchcondition+="&field4="+jQuery("#field4").val();
		searchcondition+="&field5="+jQuery("#field5").val();
		searchcondition+="&field6="+jQuery("#field6").val();
		searchcondition+="&field7="+jQuery("#field7").val();
		searchcondition+="&field8="+jQuery("#field8").val();
		searchcondition+="&field9="+jQuery("#field9").val();
		searchcondition+="&ship0="+jQuery("#ship0").val();
		searchcondition+="&ship1="+jQuery("#ship1").val();
		searchcondition+="&ship2="+jQuery("#ship2").val();
		searchcondition+="&ship3="+jQuery("#ship3").val();
		searchcondition+="&ship4="+jQuery("#ship4").val();
		searchcondition+="&ship5="+jQuery("#ship5").val();
		searchcondition+="&ship6="+jQuery("#ship6").val();
		searchcondition+="&ship7="+jQuery("#ship7").val();
		searchcondition+="&ship8="+jQuery("#ship8").val();
		var _searchid="<%=searchid%>";
		/* if(jQuery("button[issave]").attr("issave")=="F"){
			_searchid=$("#searchid").val();
		} */
		var o4params = {
			method:_save,
			isadd:jQuery("button[issave]").attr("issave"),
			companyid:"<%=companyid%>",
			searchname:encodeURI(jQuery("#searchname").val()),
			moudel:"<%=moudel%>",
			searchid:_searchid,
			field0:encodeURI(jQuery("#field0").val()),
			field1:encodeURI(jQuery("#field1").val()),
			field2:encodeURI(jQuery("#field2").val()),
			field3:encodeURI(jQuery("#field3").val()),
			field4:encodeURI(jQuery("#field4").val()),
			field5:encodeURI(jQuery("#field5").val()),
			field6:encodeURI(jQuery("#field6").val()),
			field7:encodeURI(jQuery("#field7").val()),
			field8:encodeURI(jQuery("#field8").val()),
			field9:encodeURI(jQuery("#field9").val()),
			ship0:encodeURI(jQuery("#ship0").val()),
			ship1:encodeURI(jQuery("#ship1").val()),
			ship2:encodeURI(jQuery("#ship2").val()),
			ship3:encodeURI(jQuery("#ship3").val()),
			ship4:encodeURI(jQuery("#ship4").val()),
			ship5:encodeURI(jQuery("#ship5").val()),
			ship6:encodeURI(jQuery("#ship6").val()),
			ship7:encodeURI(jQuery("#ship7").val()),
			ship8:encodeURI(jQuery("#ship8").val())
		};

		jQuery.post("/cpcompanyinfo/action/CPManageOperate.jsp",o4params,function(data){
			jQuery("#frame2affixlist")[0].src="CompanyAffixList.jsp"+searchcondition;
			//jQuery("#frame2affixlist").attr("src","CompanyAffixList.jsp"+searchcondition);
			if(_save=="search&save"){
				//jQuery("button[issave]").attr("issave","F");
				//alert("<%=SystemEnv.getHtmlLabelNames("83551",user.getLanguage())%>");
				//jQuery("#searchid").val(data);
				parentWin.reflush2List();
				parentDialog.close();
				//window.parent.parent.location.reload();
			}
		});
		}
	}
	/*更改input text 状态*/
	function changBoxStatus(i,j){
		if(jQuery("#field"+i).val()!="" && jQuery("#ship"+i).attr("disabled")){
			jQuery("#field"+j).removeClass("OInput3").addClass("OInput2").attr("disabled",false);
			//jQuery("#ship"+i).attr("disabled",false);
			jQuery("#ship"+i).selectbox("enable");
		}
	}
	
	
</script>

<jsp:include page="/systeminfo/commonTabHead.jsp">
<jsp:param name="mouldID" value="cpcompany"/>
<jsp:param name="navName" value="<%=panelTitle %>"/>
</jsp:include>

<table id="topTitle" cellpadding="0" cellspacing="0">
	<tr>
		<td>
		</td>
		<td class="rightSearchSpan" style="text-align:right; ">
			<!--<input type="text" class="" id="searchname"  maxlength="20" onblur="displayimg(this)" /> -->
			<input type="button" value="<%=SystemEnv.getHtmlLabelNames("527",user.getLanguage())%>" class="e8_btn_top" onclick="searchMethod('search');"/>
			<input type="button" value="<%=SystemEnv.getHtmlLabelNames("86",user.getLanguage())%>" class="e8_btn_top" onclick="searchMethod('search&save');"/>
			<input type="button" value="<%=SystemEnv.getHtmlLabelNames("15504",user.getLanguage())%>" class="e8_btn_top" onclick="cleanMes();"/>
		</td>
	</tr>
</table>
				
	<wea:layout>
		<wea:group context='<%=SystemEnv.getHtmlLabelName(1361,user.getLanguage())%>'>
			<wea:item attributes="{'isTableList':'true'}">
			<table  border="0" align="center" cellpadding="0" cellspacing="0" class="ListStyle">
				<tr>
					<td colspan="2">
						<span><%=moudelName %></span>
							<input type="text" id="searchname" tabindex="0" style="width:324px"  maxlength="20"  onblur="displayimg(this)"/><img src="images/O_44_wev8.jpg" class="ML5" style="margin-bottom: -3px;<%if("edit".equals(method)){out.println("display:none");} %>"  />
					<!-- 	<button class="BtnLM" type="button" style="margin-left:15px;padding-top: -5px" onclick="searchMethod('search')">  <%=SystemEnv.getHtmlLabelName(30947,user.getLanguage())%></button>
					<button class="BtnLM" type="button" onclick="searchMethod('search&save')" issave="T">  <%=SystemEnv.getHtmlLabelName(86,user.getLanguage())%></button>
					--></td>
				</tr> 
			</table>
		 </wea:item>
		</wea:group>	
	  </wea:layout> 
	<wea:layout>
		<wea:group context='<%=SystemEnv.getHtmlLabelNames("2095",user.getLanguage())%>'>
		<wea:item attributes="{'isTableList':'true'}">
			<table border="0" align="center" cellpadding="0" id="andor" cellspacing="0" class="ListStyle">
				<tr>
					<td>
						<%=SystemEnv.getHtmlLabelName(30965,user.getLanguage())%> <input type="text" style="width:218px" id="field0"  tabindex="1"  onblur="changBoxStatus(0,1,this);"/>
						<select class="OSelect MT3 MLeft8" style="width:70px" name="ship0" id="ship0" disabled="disabled">
						<option value="and">
							and
						</option>
						<option value="or">
							or
						</option>
					</select>
					</td>
					</tr>  	
				<tr>
					<td >
						<%=SystemEnv.getHtmlLabelName(30966,user.getLanguage())%> <input type="text" id="field1" style="width:218px"  tabindex="2" class="OInput3 BoxW90" disabled="disabled"  onblur="changBoxStatus(1,2,this);"/>
						<select class="OSelect MT3 MLeft8" style="width:70px"  id="ship1"    disabled="disabled">
						<option value="and">
							and
						</option>
						<option value="or">
							or
						</option>
					</select>
					</td>
				</tr>
				<tr>
					<td>
						<%=SystemEnv.getHtmlLabelName(30967,user.getLanguage())%> <input type="text" id="field2"  style="width:218px" tabindex="3" class="OInput3 BoxW90" disabled="disabled" onblur="changBoxStatus(2,3,this);"/>
						<select class="OSelect MT3 MLeft8" style="width:70px" id="ship2" disabled="disabled">
						<option value="and">
							and
						</option>
						<option value="or">
							or
						</option>
					</select>
					</td>
					</tr>  	
				<tr>
					<td >
						<%=SystemEnv.getHtmlLabelName(30968,user.getLanguage())%> <input type="text" id="field3"  style="width:218px" tabindex="4" class="OInput3 BoxW90" disabled="disabled" onblur="changBoxStatus(3,4,this);" />
						<select class="OSelect MT3 MLeft8" style="width:70px" id="ship3" disabled="disabled">
						<option value="and">
							and
						</option>
						<option value="or">
							or
						</option>
					</select>
					</td>
				</tr>
				<tr>
					<td >
						<%=SystemEnv.getHtmlLabelName(30969,user.getLanguage())%> <input type="text" id="field4"  style="width:218px" tabindex="5" class="OInput3 BoxW90" disabled="disabled" onblur="changBoxStatus(4,5,this);" />
						<select class="OSelect MT3 MLeft8" style="width:70px" id="ship4" disabled="disabled">
						<option value="and">
							and
						</option>
						<option value="or">
							or
						</option>
					</select>
					</td>
					</tr>  	
				<tr>
					<td>
						<%=SystemEnv.getHtmlLabelName(30970,user.getLanguage())%> <input type="text" id="field5"  style="width:218px" tabindex="6" class="OInput3 BoxW90" disabled="disabled" onblur="changBoxStatus(5,6,this);" />
						<select class="OSelect MT3 MLeft8" style="width:70px" id="ship5" disabled="disabled">
						<option value="and">
							and
						</option>
						<option value="or">
							or
						</option>
					</select>
					</td>
				</tr>
				<tr>
					<td  >
						<%=SystemEnv.getHtmlLabelName(30971,user.getLanguage())%> <input type="text" id="field6" style="width:218px"  tabindex="7"
						class="OInput3 BoxW90" disabled="disabled" onblur="changBoxStatus(6,7,this);" />
						<select class="OSelect MT3 MLeft8" id="ship6" style="width:70px" disabled="disabled">
						<option value="and">
							and
						</option>
						<option value="or">
							or
						</option>
					</select>
					</td>
					</tr>  	
				<tr>
					<td  >
						<%=SystemEnv.getHtmlLabelName(30972,user.getLanguage())%> <input type="text"  style="width:218px" id="field7"  tabindex="8"
						class="OInput3 BoxW90" disabled="disabled" onblur="changBoxStatus(7,8,this);" />
						<select class="OSelect MT3 MLeft8" style="width:70px" id="ship7" disabled="disabled">
						<option value="and">
							and
						</option>
						<option value="or">
							or
						</option>
					</select>
					</td>
				</tr>
				<tr>
					<td  >
						<%=SystemEnv.getHtmlLabelName(30973,user.getLanguage())%> <input type="text" id="field8"  style="width:218px" tabindex="9"
						class="OInput3 BoxW90" disabled="disabled" onblur="changBoxStatus(8,9,this);" />
						<select class="OSelect MT3 MLeft8"  style="width:70px" id="ship8" disabled="disabled">
						<option value="and">
							and
						</option>
						<option value="or">
							or
						</option>
					</select>
					</td>
					</tr>  	
				<tr>
					<td >
						<%=SystemEnv.getHtmlLabelName(30974,user.getLanguage())%> <input type="text" id="field9"  style="width:218px" tabindex="10"
						class="OInput3 BoxW90"  disabled="disabled"/> &nbsp;&nbsp;
						<!-- <button class="BtnLM" type="button"   onclick="cleanMes()"> <%=SystemEnv.getHtmlLabelName(15504,user.getLanguage())%> </button> -->
					</td>
				</tr>
			</table>
		</wea:item>
		
	</wea:group>
	</wea:layout>
		
		
	<wea:layout>
		<wea:group context='<%=SystemEnv.getHtmlLabelName(30956,user.getLanguage())%>'>
			<wea:item attributes="{'isTableList':'true'}">
				<iframe id="frame2affixlist" width="574px" height="70" frameborder=no >
			
				</iframe>
			</wea:item>
		</wea:group>
</wea:layout>

<div id="zDialog_div_bottom" class="zDialog_div_bottom">
    <wea:layout needImportDefaultJsAndCss="false">
		<wea:group context=""  attributes="{\"groupDisplay\":\"none\"}">
			<wea:item type="toolbar">
		    	<input type="button" accessKey=T  id=btncancel value="<%="T-"+SystemEnv.getHtmlLabelName(309,user.getLanguage())%>" id="zd_btn_cancle"  class="zd_btn_cancle" onclick="doCancel(this)">
			</wea:item>
		</wea:group>
	</wea:layout>
	<script type="text/javascript">
		jQuery(document).ready(function(){
			resizeDialog(document);
		});
	</script>
</div>
<script type="text/javascript">
function doCancel(){
	parentDialog.close();
	//window.close();
}
</script>


<script type="text/javascript">
	/* 关闭 已打开的面板 */
	function closeMaint4Win()
	{
		jQuery("#<%=btn%>").qtip('hide');
		jQuery("#<%=btn%>").qtip('destroy');
	}
	
	function displayimg(obj){
		if(jQuery.trim(jQuery(obj).val())!=""){
			jQuery(obj).parent().find("img").css("display","none");
			if(jQuery(obj).attr("id")=="companyname"){
				if(jQuery("#method").val()=="add"){
					ishavedLMcompany();
				}
			}
		}else{
			jQuery(obj).parent().find("img").css("display","");
		}
	}
	function cleanMes(){
			  jQuery("#field0").attr("value","");
			  jQuery("#field1").attr("value","");
			  jQuery("#field2").attr("value","");
			  jQuery("#field3").attr("value","");
			  jQuery("#field4").attr("value","");
			  jQuery("#field5").attr("value","");
			  jQuery("#field6").attr("value","");
			  jQuery("#field7").attr("value","");
			  jQuery("#field8").attr("value","");
			  jQuery("#field9").attr("value","");
			  
		
	}
	
				
</script>