WorkflowMultiPrintListTab.jsp 44.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 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139

<%@ page language="java" contentType="text/html; charset=UTF-8" %> <!--added by xwj  for td2903  20051019-->
<%@ include file="/systeminfo/init_wev8.jsp" %>
<%@ taglib uri="/WEB-INF/weaver.tld" prefix="wea"%>
<%@ taglib uri="/browserTag" prefix="brow"%>
<%@ page import="weaver.general.IsGovProj" %>
<%@page import="weaver.workflow.workflow.WorkflowVersion"%>
<%@ page import="weaver.workflow.exceldesign.FormTemplateManager" %>
<jsp:useBean id="xssUtil" class="weaver.filter.XssUtil"/>
<jsp:useBean id="rs" class="weaver.conn.RecordSet" scope="page" />
<jsp:useBean id="WfComInfo" class="weaver.workflow.workflow.WorkflowComInfo" scope="page" />
<jsp:useBean id="ResourceComInfo" class="weaver.hrm.resource.ResourceComInfo" scope="page" />
<jsp:useBean id="WorkTypeComInfo" class="weaver.workflow.workflow.WorkTypeComInfo" scope="page"/>
<jsp:useBean id="SearchClause" class="weaver.search.SearchClause" scope="session" />
<%@ include file="/workflow/request/CommonUtils.jsp" %>
<html>
	<head>
		<link href="/css/Weaver_wev8.css" type="text/css" rel="stylesheet"/>
		<script language="javascript" src="/js/weaver_wev8.js"></script>

		<script type="text/javascript">
			jQuery(document).ready(function () {
				$("#topTitle").topMenuTitle({searchFn:onBtnSearchClick});
				$(".topMenuTitle td:eq(0)").html($("#tabDiv").html());
				$("#tabDiv").remove();
			});


			function onBtnSearchClick(){
				var typename=$("input[name='flowTitle']",parent.document).val();
				$("input[name='requestname']").val(typename);
				frmmain.submit();
			}

			function doSearch(){
				if (check_form(frmmain,'')){
					$("input[name$=_value]").each(function (i, e) {
						thisval = $(this).val();
						if (thisval != undefined && thisval != "") {
							var ename = $(this).attr("name");
							var eid = ename.replace("con", "").replace("_value", "");

							var targetelement = $("#con" + eid + "_name");
							var temphtml = "";
							//alert($("#" + ename + "span").children().length);
							$("#" + ename + "span a").each(function () {
								temphtml += " " + $(this).text();
							});
							var checkspan = /^<.*$/;
							if(checkspan.test(temphtml)){
								temphtml=temphtml.replace(/<[^>]+>/g,"");
							}
							if(targetelement.val()==""){
								targetelement.val(temphtml);
							}
						}
					});

					$("input").each(function (i, e) {
						var thisval = $(this).val();
						if (thisval != undefined && thisval != "") {
							var ename = $(this).attr("name");
							var targetelement = $("#" + ename + "_name");

							if(!targetelement) return;
							var temphtml = "";
							$("#" + ename + "span a") && $("#" + ename + "span a").each(function () {
								temphtml += " " + $(this).text();
							});
							var checkspan = /^<.*$/;
							if(checkspan.test(temphtml)){
								temphtml=temphtml.replace(/<[^>]+>/g,"");
							}

							if(targetelement.val()==""){
								targetelement.val(temphtml);
							}
						}
					});

					$('#frmmain').submit();
				}
			}

			jQuery(document).ready(function(){
				//如果指定了流程编号,则加载表单字段作为查询条件

				<%
					String workflowidTemp = request.getParameter("workflowid");
					if(workflowidTemp == null || workflowidTemp.trim().equals("")){
						workflowidTemp = "''";
					}
				%>
				var workflowid = <%=workflowidTemp%>;
				if(workflowid){
					loadFormFieldReady(workflowid, false);
				}

				//给select类型的控件赋值

				<%
					String[] selectes = new String[]{
						"nodetype","requestlevel","creatertype",
						"ismultiprint","nodeid"
					};

					for(int i = 0; i < selectes.length; i++){
						String selectName = selectes[i];
				%>
					$("select[name=<%=selectName%>]").val(<%="'" + request.getParameter(selectName) + "'"%>);  
					$("select[name=<%=selectName%>]").removeAttr('notBeauty');
					beautySelect('select[name=<%=selectName%>]');
				<%
					}
				%>
			});

			/* 加载用户自定义的查询条件 */
			function loadFormFieldReady(workFlowId, needLoadNodes){
				if(needLoadNodes == true){
					return;
				}

				<%
					/*
					* 获取从上一个页面传入的自定义查询条件,将自定义查询条件转换为JSON格式的字符串。

					* 将JSON数据post给WorkflowMultiPrintSearchGenerate.jsp页面,生成自定义查询条件即为赋好值的页面。

					* 以此实现查询的条件的保存,不需要用户再次输入。

					*/
					String[] checkcons = request.getParameterValues("check_con");

					String customJsonString = "{";
					String checkboxes = "'";
					if(checkcons != null){
					  	for(int i = 0; i < checkcons.length; i++){
							String id         = ""+checkcons[i];
							String tmpvalue   = ""+Util.null2String(request.getParameter("con"+id+"_value"));
							String tmpvalue1  = ""+Util.null2String(request.getParameter("con"+id+"_value1"));
							String tmpname    = ""+Util.null2String(request.getParameter("con"+id+"_name"));

							if(!tmpvalue.equals("")){
								customJsonString  += "con"+id+"_value" + ":'" + tmpvalue + "',";	
							} 
							if(!tmpvalue1.equals("")){
								customJsonString  += "con"+id+"_value1" + ":'" + tmpvalue1 + "',";	
							} 
							if(!tmpname.equals("")){
								customJsonString  += "con"+id+"_name" + ":'" + tmpname + "',";	
							} 

							if(!tmpvalue.equals("")){
								checkboxes += (id + ",");
							}
						}
					}

					if(customJsonString.length() > 1){
						customJsonString = customJsonString.substring(0, customJsonString.length() - 1);	
					} 
					customJsonString += "}";

					if(checkboxes.length() > 1){
						checkboxes = checkboxes.substring(0, checkboxes.length() - 1);
					}
					checkboxes += "'"; 

					String nameValueString = "'";
					Enumeration elementNames = (Enumeration) request.getParameterNames();   
				    while(elementNames.hasMoreElements())     {   
				    	String elementName = (String)elementNames.nextElement(); 

				    	if(elementName.startsWith("con") 
				    		&& elementName.endsWith("_value")
				    		&& request.getParameter(elementName) != null 
				    		&& !request.getParameter(elementName).trim().equals("")
				    	){
			    			nameValueString += (elementName + ":" + Util.null2String(request.getParameter(elementName)) + ",");	
				    	}
				    } 
					
					if(nameValueString.length() > 1){
						nameValueString = nameValueString.substring(0, nameValueString.length() - 1);
					}
					nameValueString += "'";

				%>

				var parameter = <%=customJsonString%>;
				parameter['issimple'] = true;
				parameter['workflowid'] = workFlowId;
				parameter['checkboxes'] = <%=checkboxes%>;
				parameter['allValues'] = <%=nameValueString%>;

				jQuery.post(
					'/workflow/request/WorkflowMultiPrintSearchGenerate.jsp',
					parameter,
					function(data){
						jQuery('#formFieldDiv').html(data);

						jQuery('#formFieldDiv').find('select').each(function(i,v){
							beautySelect(jQuery(v));
						});
					}
				);

				if(needLoadNodes == true){
					jQuery.post(
						'/workflow/request/LoadNodesByWorkflow.jsp',
						{
							'workflowid' : workFlowId
						},
						function(data){
							data = (  "<select id='nodeid' name='nodeid'>" 
									+ "<option value='0'></option>"
									+ data
									+ "</select>" );
							$('#nodeidDiv').html(data);
							beautySelect('select[name=nodeid]');
						}
					);
				}
			}
			
			
			/* 加载用户自定义的查询条件 */
			function loadFormField(workFlowId, needLoadNodes){
			    if(workFlowId == <%=workflowidTemp%>){
			    	loadFormFieldReady(workFlowId,true);
			    	return;
			    }
				if(!workFlowId){
					jQuery('#formFieldDiv').html('');

					$('#nodeidDiv').html("<select id='nodeid' name='nodeid'>" 
										 + "<option value='0'></option>" 
										 + "</select>");
					beautySelect('select[name=nodeid]');
					return;
				}

				jQuery.post(
					'/workflow/request/WorkflowMultiPrintSearchGenerate.jsp',
					{
							'workflowid' : workFlowId
					},
					function(data){
						jQuery('#formFieldDiv').html(data);

						jQuery('#formFieldDiv').find('select').each(function(i,v){
							beautySelect(jQuery(v));
						});
					}
				);

				if(needLoadNodes == true){
					jQuery.post(
						'/workflow/request/LoadNodesByWorkflow.jsp',
						{
							'workflowid' : workFlowId
						},
						function(data){
							data = (  "<select id='nodeid' name='nodeid'>" 
									+ "<option value='0'></option>"
									+ data
									+ "</select>" );
							$('#nodeidDiv').html(data);
							beautySelect('select[name=nodeid]');
						}
					);
				}
			}
		</script>
	</head>

<BODY style="overflow:hidden;">
<%@ include file="/systeminfo/RightClickMenuConent_wev8.jsp" %>
<%
RCMenu += "{"+SystemEnv.getHtmlLabelName(197,user.getLanguage())+",javascript:doSearch(),_self}" ;
RCMenuHeight += RCMenuHeightStep ;

RCMenu += "{"+SystemEnv.getHtmlLabelName(26382,user.getLanguage())+",javascript:onMultiPrint(),_self}" ;
RCMenuHeight += RCMenuHeightStep ;

RCMenu += "{"+SystemEnv.getHtmlLabelName(84820,user.getLanguage())+",javascript:onSetPrint(1),_self}";
RCMenuHeight += RCMenuHeightStep ;

RCMenu += "{"+SystemEnv.getHtmlLabelName(84821,user.getLanguage())+",javascript:onSetPrint(0),_self}";
RCMenuHeight += RCMenuHeightStep ;

RCMenu += "{"+SystemEnv.getHtmlLabelName(21533,user.getLanguage())+",javascript:doPrintViewLog(),_self}" ;
RCMenuHeight += RCMenuHeightStep ;


%>
<div id='divshowreceivied' style='background:#FFFFFF;padding:3px;width:100%' valign='top'>
</div>
<FORM id="frmmain" name="frmmain" method="post" action="WorkflowMultiPrintMiddleHandler.jsp">
<input type="hidden" id="fromself" name="fromself" value="1">
<input type="hidden" id="operation" name="operation" value="">
<input type="hidden" id="ismultiprintinput" name="ismultiprintinput" value="">
<input type="hidden" id="multirequestid" name="multirequestid" value="">
<%
int isgoveproj = Util.getIntValue(IsGovProj.getPath(),0);//0:非政务系统,1:政务系统


ArrayList canoperaternode = new ArrayList(); //added by xwj  for td2903  20051019

ArrayList monitorWfList = new ArrayList();

String operation = Util.null2String(request.getParameter("operation"));
if("setprint".equals(operation)){
	int ismultiprintinput = Util.getIntValue(request.getParameter("ismultiprintinput"), -1);
	if(ismultiprintinput==0 || ismultiprintinput==1){
		String multirequestid = Util.null2String(request.getParameter("multirequestid"));
		String sql_tmp = "update workflow_requestbase set ismultiprint="+ismultiprintinput+" where requestid in ("+multirequestid+"0)";
		rs.executeSql(sql_tmp);
	}
}
String monitorWfStrs = "";
String typeId="";
String workflowid = "" ;
String nodetype ="" ;
String fromdate ="" ;
String todate ="" ;
String creatertype ="" ;
String createrid ="" ;
String requestlevel ="" ;
String requestname ="" ;//added xwj for for td2903  20051019
String wfcode = "";
int ismultiprint = -1;
int nodeid = 0;
int operater = 0;
String startDate = "";   //归档日期的开始日期
String endDate = "";     //归档日期的结束日期
String createDate = "";  //创建日期下拉框选择的值
String archiveDate = ""; //归档日期下拉框选择的值

workflowid =  Util.null2String(request.getParameter("workflowid"));
nodetype = Util.null2String(request.getParameter("nodetype"));
fromdate = Util.null2String(request.getParameter("fromdate"));
todate = Util.null2String(request.getParameter("todate"));
typeId = Util.null2String(request.getParameter("typeId"));

creatertype = Util.null2String(request.getParameter("creatertype"));
createrid = Util.null2String(request.getParameter("createrid"));
String createrid1 = Util.null2String(request.getParameter("createrid1"));

requestlevel = Util.null2String(request.getParameter("requestlevel"));
requestname = Util.null2String(request.getParameter("requestname"));//added xwj for for td2903  20051019
wfcode = Util.null2String(request.getParameter("wfcode"));


ismultiprint = Util.getIntValue(request.getParameter("ismultiprint"));
nodeid = Util.getIntValue(request.getParameter("nodeid"), 0);
operater = Util.getIntValue(request.getParameter("operater"));

startDate = Util.null2String(request.getParameter("startDate"));
endDate = Util.null2String(request.getParameter("endDate"));
createDate = Util.null2String(request.getParameter("createDate"));
archiveDate = Util.null2String(request.getParameter("archiveDate"));


String newsql=" ";

if(!"".equals(startDate) || !"".equals(endDate)){
	newsql += " and a.currentnodetype = '3' and b.iscomplete = '1'";  //仅查询归档的流程
}
if(!"".equals(startDate)){
	newsql += " and a.lastoperatedate >= '" + startDate + "'";
}
if(!"".equals(endDate)){
	newsql += " and a.lastoperatedate <= '" + endDate + "'";
}

if(!typeId.equals("")){
	newsql+=" and b.workflowtype in ("+typeId+") " ;
}
if(!workflowid.equals("")&&!workflowid.equals("0")){
	String versionwfids = WorkflowVersion.getAllVersionStringByWFIDs(workflowid);
	newsql+=" and a.workflowid in("+versionwfids+")" ;
}

if(!wfcode.equals("")){
	newsql += " and requestmark ='"+wfcode+"'";
}

if(!nodetype.equals("")){
	newsql += " and currentnodetype='"+nodetype+"'";
}
if(!fromdate.equals("")){
	newsql += " and createdate>='"+fromdate+"'";
}

if(!todate.equals("")){
	newsql += " and createdate<='"+todate+"'";
}

 

 if(creatertype.equals("1")){
    if(!createrid.equals("")){
	  newsql += " and creater='"+createrid+"'";
	 
	}
 }else{
	if(!createrid1.equals("")){
	
	  newsql += " and creater='"+createrid+"'";
	 
	  
	}
 }
	

if(!requestlevel.equals("")){
	newsql += " and requestlevel="+requestlevel;
}

if(!requestname.equals("")){
	newsql += " and requestnamenew like '%"+requestname+"%' ";
}

// if(!requestmark.equals("")){
// 	newsql += " and requestmark like '%"+requestmark+"%' ";
// }

if(ismultiprint > -1){
	newsql += " and a.ismultiprint="+ismultiprint;
}

if(nodeid > 0){
	newsql += " and exists (select c.id from workflow_currentoperator c where c.requestid=a.requestid and c.nodeid="+nodeid+" and c.userid="+user.getUID()+") ";
}

if(operater > 0){
	newsql += " and exists (select c.id from workflow_currentoperator c where c.requestid=a.requestid and c.userid="+operater+") ";
}


String CurrentUser = Util.null2String((String)session.getAttribute("RequestViewResource")) ;
String logintype = ""+user.getLogintype();
String userlang = ""+user.getLanguage();
int usertype = 0;

if(CurrentUser.equals("")) {
	CurrentUser = ""+user.getUID();
	if(logintype.equals("2")){
		usertype = 1;
	}
}

newsql += " and a.requestid=b.requestid and b.islasttimes = 1 and userid="+user.getUID()
	   +" and usertype="+usertype+"    and (exists (select 1 from workflow_nodemode n where n.isprint='1' and n.workflowid=b.workflowid and n.nodeid=b.nodeid ) "
       +" or exists (select 1 from workflow_nodehtmllayout f where f.isactive=1 and f.type = '1' and f.workflowid = b.workflowid and f.nodeid = b.nodeid )"
       +" or exists (select 1 from workflow_nodehtmllayout nl,workflow_base wb where nl.nodeid="+FormTemplateManager.getFORMVIRTUALNODEID()+" and wb.id=b.workflowid and nl.formid=wb.formid and nl.isbill=wb.isbill and isactive=1 and type=1)"
	   +")";


if(!"".equals(newsql)){
	newsql = newsql.replaceFirst("and", "");
}
String sqlWhere = " where  " +newsql + "  ";
String orderby =" createdate ,createtime ";
int start=Util.getIntValue(Util.null2String(request.getParameter("start")),1);
int perpage=Util.getIntValue(Util.null2String(request.getParameter("perpage")),10);
String sql="";
int totalcounts = Util.getIntValue(Util.null2String(request.getParameter("totalcounts")),0);

String ops="";
if(operater!=-1)
{
  ops=operater+"";
}

SearchClause.resetClause();
SearchClause.setWhereClause(sqlWhere);
 
%>
		<TABLE class=Shadow>
		<tr>
		<td valign="top">
			<table id="topTitle" cellpadding="0" cellspacing="0">
				<tr>
					<td>
					</td>
					<td class="rightSearchSpan" style="text-align:right; width:500px!important">
						<input type="button" value="<%=SystemEnv.getHtmlLabelName(26382,user.getLanguage())%>" class="e8_btn_top" onclick="onMultiPrint()"/>
						<input type="button" value="<%=SystemEnv.getHtmlLabelName(84820,user.getLanguage())%>" class="e8_btn_top" onclick="onSetPrint(1)"/>	&nbsp;&nbsp;&nbsp;
						<input type="button" value="<%=SystemEnv.getHtmlLabelName(84821,user.getLanguage())%>" class="e8_btn_top" onclick="onSetPrint(0)"/>	&nbsp;&nbsp;&nbsp;
						<input type="button" value="<%=SystemEnv.getHtmlLabelName(21533,user.getLanguage())%>" class="e8_btn_top" onclick="doPrintViewLog()"/>&nbsp;&nbsp;&nbsp;
						<input type="text" class="searchInput" name="flowTitle" value="<%=requestname%>"/>
						&nbsp;&nbsp;&nbsp;
						<span id="advancedSearch" class="advancedSearch"><%=SystemEnv.getHtmlLabelName(21995,user.getLanguage())%></span>
						<span title="<%=SystemEnv.getHtmlLabelName(83721,user.getLanguage())%>" class="cornerMenu"></span>
					</td>
				</tr>
			</table>
			
			<div id="tabDiv" >
				<span id="hoverBtnSpan" class="hoverBtnSpan">
				<span><%=SystemEnv.getHtmlLabelName(26382,user.getLanguage())%></span>
				</span>
			</div>
			<!-- bpf start 2013-10-29 -->
			<div class="advancedSearchDiv" id="advancedSearchDiv">	
		        <wea:layout type="4col" attributes="{'expandAllGroup':'true'}">
			    	<wea:group context='<%=SystemEnv.getHtmlLabelName(32905,user.getLanguage())%>'>
			    		<!-- 类型 -->
				    	<wea:item><%=SystemEnv.getHtmlLabelName(33234,user.getLanguage())%></wea:item>
						<wea:item>
							<brow:browser viewType="0" name="typeId"
								browserValue='<%=typeId%>'
								browserUrl="/systeminfo/BrowserMain.jsp?url=/workflow/workflow/WorkTypeBrowser.jsp"
								onPropertyChange="changeFlowType()"
								hasInput="true" isSingle="true" hasBrowser="true"
								isMustInput="1" completeUrl="/data.jsp?type=worktypeBrowser"
								browserDialogWidth="600px"
								browserSpanValue='<%=WorkTypeComInfo.getWorkTypename(typeId)%>'></brow:browser>
						</wea:item>	
						
					    <!-- 工作流 -->
				    	<wea:item><%=SystemEnv.getHtmlLabelName(259,user.getLanguage())%></wea:item>
					    <wea:item>
						    <brow:browser onPropertyChange="loadFormField(jQuery('#workflowid').val(),true)" id='workflowid' name="workflowid" viewType="0"   hasBrowser="true" hasAdd="false" getBrowserUrlFn="getFlowWindowUrl" isMustInput="1" isSingle="true" hasInput="true" completeUrl="/data.jsp?type=workflowBrowser" width='80%' browserValue='<%=workflowid%>' browserSpanValue='<%=WfComInfo.getWorkflowname(workflowid)%>'/> 				  	
					    </wea:item>
				  
				    	<!-- 流程编号 -->
				    	<wea:item ><%=SystemEnv.getHtmlLabelName(19502,user.getLanguage())%></wea:item>
				    	<wea:item >
				    		<input type="text" name="wfcode" style='width:80%;' value='<%=wfcode%>'>
				    	</wea:item>
				    	
				    	<!-- 打印状态 -->
						<wea:item ><%=SystemEnv.getHtmlLabelName(27044,user.getLanguage())%></wea:item >
						<wea:item >
					        <select id="ismultiprint" name="ismultiprint" >
								<option value="-1"></option>
								<option value="0" <%if(ismultiprint==0){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(27045,user.getLanguage())%></option>
								<option value="1" <%if(ismultiprint==1){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(27046,user.getLanguage())%></option>
							</select>
						</wea:item>
						
						<!-- 创建人 -->
						<wea:item><%=SystemEnv.getHtmlLabelName(882,user.getLanguage())%></wea:item >
						<wea:item>			
							<span style="float:left;">
							  <select  name=creatertype id="creatertype" onChange="onChangeUserType(this.value)">
								  <%if(isgoveproj==0){%>
								  <option value="1"  <%if(creatertype.equals("1")){%>selected<%} %> ><%=SystemEnv.getHtmlLabelName(362,user.getLanguage())%></option>
								  <option value="2"  <%if(creatertype.equals("2")){%>selected<%} %>><%=SystemEnv.getHtmlLabelName(136,user.getLanguage())%></option>
							  <%}else{%>
							   	  <option value="1"  <%if(creatertype.equals("1")){%>selected<%} %>><%=SystemEnv.getHtmlLabelName(20098,user.getLanguage())%></option>
							  <%}%>
							  </select>
							  </span>
							  <span id="crmAndHrm" style="">
							   <span id="hrm" >
									<brow:browser viewType="0" name="createrid" browserValue='<%=createrid%>' 
									 browserOnClick="onShowCreater('createridspan','createrid')"
									 hasInput="true" isSingle="true" hasBrowser = "true" isMustInput='1'
									 completeUrl="/data.jsp" linkUrl="javascript:openhrm($id$)" width="49%"
									 browserSpanValue='<%=ResourceComInfo.getResourcename(createrid)%>'></brow:browser>
								</span>
							   <span id="crm" style="display:none">
									<brow:browser viewType="0" name="createrid1" browserValue='<%=createrid1%>' 
									 browserOnClick="onShowCreater('createrid1span','createrid1')"
									 hasInput="true" isSingle="true" hasBrowser = "true" isMustInput='1'
									 completeUrl="/data.jsp?type=7" linkUrl="#" width="49%"
									 browserSpanValue='<%=ResourceComInfo.getResourcename(createrid1)%>'></brow:browser>
								</span>
					  		</span>	
						</wea:item>
						
						<!-- 创建日期 -->
					    <wea:item ><%=SystemEnv.getHtmlLabelName(722,user.getLanguage())%></wea:item >
				    	<wea:item >
				    		<%-- 
				            <button type="button"  class="calendar" id="SelectDate"  onclick="gettheDate(fromdate,fromdatespan)"></button>
							<span id="fromdatespan" ><%=fromdate%></span>
							<span id="fromdatespanimg"></span>
							&nbsp;-&nbsp;
							<button type="button"  class="calendar" id="SelectDate2" onclick="gettheDate(todate,todatespan)"></button>
							<span id="todatespan"><%=todate%></span>
							<input type="hidden" name="fromdate" value="<%=fromdate%>" />
							<input type="hidden" name="todate" value="<%=todate%>" />
				    		--%>
				    		<span class="wuiDateSpan" selectId="createDate" selectValue="<%=createDate%>">
							<input name="fromdate" value="<%=fromdate%>"  type="hidden" class="wuiDateSel">
							<input name="todate" value="<%=todate%>"  type="hidden" class="wuiDateSel">
							</span>
						</wea:item>
			    	</wea:group>
				     <wea:group context='<%=SystemEnv.getHtmlLabelName(32843,user.getLanguage())%>'>
				     	<!-- 流程标题 -->
				    	<wea:item ><%=SystemEnv.getHtmlLabelName(26876,user.getLanguage())%></wea:item>
				    	<wea:item >
				    		<input type="text" name="requestname" style='width:80%;' value="<%=requestname%>">
				    	</wea:item>
				    	
				    	<!-- 紧急程度 -->
				    	<wea:item><%=SystemEnv.getHtmlLabelName(15534,user.getLanguage())%></wea:item>
				    	<wea:item>
				    		<select name="requestlevel">
								<option value="">&nbsp;</option>
								<option value="0" <%if(requestlevel.equals("0")){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(225,user.getLanguage())%></option>
								<option value="1" <%if(requestlevel.equals("1")){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(15533,user.getLanguage())%></option>
								<option value="2" <%if(requestlevel.equals("2")){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(2087,user.getLanguage())%></option>
							</select>
				    	</wea:item>		
				    						
						<!-- 节点类型 -->
				    	<wea:item><%=SystemEnv.getHtmlLabelName(15536,user.getLanguage())%></wea:item>
				    	<wea:item>
				          	<select name="nodetype" >
								<option value="">&nbsp;</option>
								<option value="0" <%if(nodetype.equals("0")){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(125,user.getLanguage())%></option>
								<option value="1" <%if(nodetype.equals("1")){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(142,user.getLanguage())%></option>
								<option value="2" <%if(nodetype.equals("2")){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(725,user.getLanguage())%></option>
								<option value="3" <%if(nodetype.equals("3")){%>selected<%}%>><%=SystemEnv.getHtmlLabelName(251,user.getLanguage())%></option>
							</select>
						</wea:item>	
						
						<!-- 节点处理人 -->
				    	<wea:item ><%=SystemEnv.getHtmlLabelName(26033,user.getLanguage())%></wea:item >
						<wea:item >   
				        <brow:browser viewType="0" name="operater" browserValue='<%=operater+""%>' 
										browserUrl="/systeminfo/BrowserMain.jsp?url=/hrm/resource/ResourceBrowser.jsp"
										hasInput="true" isSingle="true" hasBrowser = "true" isMustInput='1'
										completeUrl="/data.jsp" linkUrl="javascript:openhrm($id$)" 
										browserSpanValue='<%=ResourceComInfo.getResourcename(operater+"")%>'></brow:browser>
						</wea:item >
											
						<!-- 节点 -->
						<wea:item ><%=SystemEnv.getHtmlLabelName(15586,user.getLanguage())%></wea:item >
						<wea:item >
							<div id="nodeidDiv">
					         	<select id="nodeid" name="nodeid" notBeauty="true">
									<option value="0"></option>
									<%
										if(!workflowid.trim().equals("")){
										    rs.execute("select f.nodeid, n.nodename from workflow_flownode f left join workflow_nodebase n on f.nodeid=n.id where f.workflowid="+workflowid+" order by f.nodetype, f.nodeid");
											while(rs.next()){
												out.println("<option value='"+Util.getIntValue(rs.getString(1), 0)+"'>"
												+Util.null2String(rs.getString(2))
												+"</option>");
											}
										}
									%>
								</select>
							</div>
						</wea:item >
						<%--归档时间 --%>
						<wea:item ><%=SystemEnv.getHtmlLabelName(3000,user.getLanguage())%></wea:item >
						<wea:item>
						<span class="wuiDateSpan" selectId="archiveDate" selectValue="<%=archiveDate%>">
						<input name="startDate" value="<%=startDate%>"  type="hidden" class="wuiDateSel">
						<input name="endDate" value="<%=endDate%>"  type="hidden" class="wuiDateSel">
						</span>
						</wea:item>
				    </wea:group>
				    <wea:group context="">
				    	<wea:item type="toolbar">
						    <input class="e8_btn_submit" type="submit" value="<%=SystemEnv.getHtmlLabelName(82529,user.getLanguage())%>" class="e8_btn_submit" onclick="doSearch()"/>
							<span class="e8_sep_line">|</span>
					        <input  class="e8_btn_cancel" type="button" value="<%=SystemEnv.getHtmlLabelName(32694,user.getLanguage())%>" class="e8_btn_cancel" id="cancel"/>
				    	</wea:item>
				    </wea:group>
				</wea:layout>
				<div id="formFieldDiv"></div>
			</div>	

			<input name="start" type="hidden" value="<%=start%>">
			<input type="hidden" name="multiRequestIds" value="">
			<input type="hidden" name="multiSubIds" id="multiSubIds" value="">
			<input type="hidden" name="flag" id="flag" value="">
			<input type="hidden" name="requestidvalue" id="requestidvalue" value="">
			<input type="hidden" name="pageId" id="pageId" value="<%= PageIdConst.WF_REQUEST_WORKFLOWMULTIPRINTLISTTAB%>"/>

<%
String tableString = "";
if(perpage <2) perpage=10;								 
String backfields = " a.requestid, a.currentnodeid, a.createdate, a.createtime,a.lastoperatedate, a.lastoperatetime,a.creater, a.creatertype, a.workflowid, a.requestname, a.status, a.requestlevel, a.ismultiprint,b.receivedate,b.receivetime ";
String fromSql  = " workflow_requestbase a,workflow_currentoperator b";

String isNeed = (String) request.getAttribute("CustomSearch_IsNeed");

if(isNeed != null){
	String _requestIdList = (String)request.getAttribute("CustomSearch_RequestIdList");
	if(_requestIdList != null && !_requestIdList.trim().equals("")){
		sqlWhere += (" and exists ( " + _requestIdList + " and d.requestid=a.requestid) ");
	}
}

//System.out.println("select " + backfields + " from " + fromSql+ sqlWhere) ;
//out.println("fromSql:" + fromSql);
//out.println("sqlWhere:" + sqlWhere);




// if(hasFieldClause == true) sqlWhere += fieldsql;
String para2="column:requestid+"+CurrentUser+"+"+logintype+"+"+userlang;
String para11="column:requestname+"+"("+"column:requestid+"+")";
String para1="column:requestid+column:workflowid+column:viewtype+0+"+user.getLanguage();
String para4=userlang+"+"+user.getUID();
String para3="column:workflowid+"+CurrentUser+"+"+logintype;
tableString = "<table instanceid=\"workflowRequestListTable\" tabletype=\"checkbox\" pagesize=\""+PageIdConst.getPageSize(PageIdConst.WF_REQUEST_WORKFLOWMULTIPRINTLISTTAB,user.getUID())+"\" >"+
		"	<sql backfields=\""+backfields+"\" sqlform=\""+fromSql+"\" sqlwhere=\""+Util.toHtmlForSplitPage(sqlWhere)+"\"  sqlorderby=\""+orderby+"\"  sqlprimarykey=\"a.requestid\" sqlsortway=\"Desc\" sqlisdistinct=\"true\" />"+
		"		<head>"+
		"			<col width=\"22%\" text=\"" + SystemEnv.getHtmlLabelName(1334, user.getLanguage()) + "\" column=\"requestname\" orderkey=\"requestname\" transmethod=\"weaver.general.WorkFlowTransMethod.getWfNewLink\"  otherpara=\""+para1+"\" />"+
		"			<col width=\"10%\" text=\""+SystemEnv.getHtmlLabelName(259,user.getLanguage())+"\" column=\"workflowid\" orderkey=\"a.workflowid,a.requestname\" transmethod=\"weaver.workflow.workflow.WorkflowComInfo.getWorkflowname\" />"+
		"			<col width=\"8%\" text=\""+SystemEnv.getHtmlLabelName(882,user.getLanguage())+"\" column=\"creater\" orderkey=\"creater\" otherpara=\"column:creatertype\" transmethod=\"weaver.general.WorkFlowTransMethod.getWFSearchResultName\" />"+
		"			<col width=\"12%\" text=\""+SystemEnv.getHtmlLabelName(1339,user.getLanguage())+"\" column=\"createdate\"  orderkey=\"createdate,createtime\" otherpara=\"column:createtime\" transmethod=\"weaver.general.WorkFlowTransMethod.getWFSearchResultCreateTime\" />"+
		"			<col width=\"8%\" display=\"false\" text=\""+SystemEnv.getHtmlLabelName(27044,user.getLanguage())+"\" column=\"ismultiprint\" orderkey=\"a.ismultiprint\" otherpara=\""+user.getLanguage()+"\" transmethod=\"weaver.general.WorkFlowTransMethod.getIsmultiprintStr\" />"+
		"			<col width=\"8%\" display=\"false\" text=\""+SystemEnv.getHtmlLabelName(15534,user.getLanguage())+"\" column=\"requestlevel\"  orderkey=\"a.requestlevel\" transmethod=\"weaver.general.WorkFlowTransMethod.getWFSearchResultUrgencyDegree\" otherpara=\""+user.getLanguage()+"\"/>"+
		"			<col width=\"12%\" display=\"false\" text=\""+SystemEnv.getHtmlLabelName(17994,user.getLanguage())+"\" column=\"receivedate\" orderkey=\"b.receivedate,b.receivetime\" otherpara=\"column:receivetime\" transmethod=\"weaver.general.WorkFlowTransMethod.getWFSearchResultCreateTime\" />"+
		"			<col width=\"8%\" display=\"false\" text=\""+SystemEnv.getHtmlLabelName(1335,user.getLanguage())+"\" column=\"status\" orderkey=\"status\" />"+
		"		</head>"+
		"</table>";
%>
		<table width="100%" cellspacing=0 height=94%>
			<tr>
				<td valign="top">  
					<wea:SplitPageTag  tableString='<%=tableString%>'  mode="run" />
				</td>
			</tr>
		</table>
		</td>
		</tr>
		</TABLE>
</form>
<%@ include file="/systeminfo/RightClickMenu_wev8.jsp" %>


<script type="text/javascript">
	
	function onShowCreater(tdname,inputename){
	var userType = jQuery("#creatertype").val();
	var datas=null;
	//var iTop = (window.screen.availHeight-30-550)/2+"px"; //获得窗口的垂直位置;
	//var iLeft = (window.screen.availWidth-10-550)/2+"px"; //获得窗口的水平位置;
	
	var url = "";
	if (userType == "1" ) {
	    //datas = window.showModalDialog("/systeminfo/BrowserMain.jsp?url=/hrm/resource/ResourceBrowser.jsp","","dialogTop="+iTop+";dialogLeft="+iLeft+";dialogHeight=550px;dialogWidth=550px;");
	    url = "/systeminfo/BrowserMain.jsp?url=/hrm/resource/ResourceBrowser.jsp";
	} else  {
	    //datas = window.showModalDialog("/systeminfo/BrowserMain.jsp?url=/CRM/data/CustomerBrowser.jsp","","dialogTop="+iTop+";dialogLeft="+iLeft+";dialogHeight=550px;dialogWidth=550px;");
	    url = "/systeminfo/BrowserMain.jsp?url=/CRM/data/CustomerBrowser.jsp";
	}
	var dialogurl = url;
	var dialog = new window.top.Dialog();
	dialog.currentWindow = window;
	dialog.callbackfunParam = null;
	dialog.URL = dialogurl;
	dialog.callbackfun = function (paramobj, datas) {
		if (datas) {
		    if (datas.id!=""){
		    	var name = "<a href='#"+datas.id+"'>"+datas.name+"</a>";
		    	if(userType=="1"){
		    		name = wrapshowhtml("<a href='javascript:openhrm("+datas.id+")' onclick='javascript:pointerXY(event);'>"+datas.name+"</a>", datas.id);
		    	}
		        jQuery("#"+tdname).html(name);
		        jQuery("#"+inputename).val(datas.id);
			}
		    else{
		        jQuery("#"+tdname).html("");
		        jQuery("#"+inputename).val("");
		    }
		    hoverShowNameSpan(".e8_showNameClass");
		    try {
				eval(jQuery("#inputename").attr('onpropertychange'));
			} catch (e) {
			}
			try {
				eval(jQuery("#inputename__").attr('onpropertychange'));
			} catch (e) {
			}
		}
	};
	dialog.Title = "<%=SystemEnv.getHtmlLabelName(18214,user.getLanguage())%>";
	dialog.Width = 550 ;
	dialog.Height = 600;
	dialog.Drag = true;
	//dialog.maxiumnable = true;
	dialog.show();
}
function uescape(url){
	return escape(url);
}
	function doPrintViewLog(){
		if(window.top.Dialog){
			diag_vote = new window.top.Dialog();
		} else {
			diag_vote = new Dialog();
		}
		diag_vote.currentWindow = window;
		diag_vote.Width = 800;
		diag_vote.Height = 550;
		diag_vote.Modal = true;
		diag_vote.maxiumnable = true;
		diag_vote.Title = "<%=SystemEnv.getHtmlLabelName(21533,user.getLanguage())%>";
	   
		 
		diag_vote.URL = "/workflow/request/WorkflowLogNew.jsp?requestid=&printtypes=2&workflowid2=<%=workflowid%>&multitype=1&wheresql=<%=xssUtil.put(sqlWhere) %>";
		diag_vote.show();
	}


	function onChangeResource(tdname,inputename){
		var tmpval = $GetEle("creatertype").value;
		var tempurl1 = "";
		if (tmpval == "0") {
			tempurl1 = "/systeminfo/BrowserMain.jsp?url=/hrm/resource/ResourceBrowser.jsp";
		}else {
			tempurl1 = "/systeminfo/BrowserMain.jsp?url=/CRM/data/CustomerBrowser.jsp";
		}
		disModalDialog(tempurl1,$G(tdname), $G(inputename), false);		
	}

	function disModalDialog(url, spanobj, inputobj, need, curl) {
		var id = window.showModalDialog(url, "",
				"dialogWidth:550px;dialogHeight:550px;" + "dialogTop:" + (window.screen.availHeight - 30 - parseInt(550))/2 + "px" + ";dialogLeft:" + (window.screen.availWidth - 10 - parseInt(550))/2 + "px" + ";");
		if (id != null) {
			if (wuiUtil.getJsonValueByIndex(id, 0) != "") {
				if (curl != undefined && curl != null && curl != "") {
					spanobj.innerHTML = "<A href='" + curl
							+ wuiUtil.getJsonValueByIndex(id, 0) + "'>"
							+ wuiUtil.getJsonValueByIndex(id, 1) + "</a>";
				} else {
					spanobj.innerHTML = wuiUtil.getJsonValueByIndex(id, 1);
				}
				inputobj.value = wuiUtil.getJsonValueByIndex(id, 0);
			} else {
				spanobj.innerHTML = need ? "<IMG src='/images/BacoError_wev8.gif' align=absMiddle>" : "";
				inputobj.value = "";
			}
		}
	}

	function OnChangePage(start){
			document.frmmain.start.value = start;
			//if(check_form(document.weaver,'fromdate'))
			document.frmmain.submit();
	}

	var showTableDiv  = document.getElementById('divshowreceivied');
	var oIframe = document.createElement('iframe');
	function showreceiviedPopup(content){
		showTableDiv.style.display='';
		var message_Div = document.createElement("div");
		 message_Div.id="message_Div";
		 message_Div.className="xTable_message";
		 showTableDiv.appendChild(message_Div);
		 var message_Div1  = document.getElementById("message_Div");
		 message_Div1.style.display="inline";
		 message_Div1.innerHTML=content;
		 var pTop= document.body.offsetHeight/2+document.body.scrollTop-50;
		 var pLeft= document.body.offsetWidth/2-50;
		 message_Div1.style.position="absolute"
		 message_Div1.style.top=pTop;
		 message_Div1.style.left=pLeft;

		 message_Div1.style.zIndex=1002;

		 oIframe.id = 'HelpFrame';
		 showTableDiv.appendChild(oIframe);
		 oIframe.frameborder = 0;
		 oIframe.style.position = 'absolute';
		 oIframe.style.top = pTop;
		 oIframe.style.left = pLeft;
		 oIframe.style.zIndex = message_Div1.style.zIndex - 1;
		 oIframe.style.width = parseInt(message_Div1.offsetWidth);
		 oIframe.style.height = parseInt(message_Div1.offsetHeight);
		 oIframe.style.display = 'block';
	}

	function onMultiPrint(){
		var multirequestid = _xtable_CheckedCheckboxId();
		//alert(multirequestid);
		if(multirequestid!=null && multirequestid!=""){
			var redirectUrl = "/workflow/multiprint/MultiPrintGroups.jsp?multirequestid="+multirequestid;
			var width = screen.availWidth-10 ;
			var height = screen.availHeight-50 ;
			var szFeatures = "top=0," ;
			szFeatures +="left=0," ;
			szFeatures +="width="+width+"," ;
			szFeatures +="height="+height+"," ;
			szFeatures +="directories=no," ;
			szFeatures +="status=yes,toolbar=no,location=no," ;
			szFeatures +="menubar=no," ;
			szFeatures +="scrollbars=yes," ;
			szFeatures +="resizable=yes" ; //channelmode
			//window.open(redirectUrl,"",szFeatures) ;
			jQuery.post("/workflow/multiprint/MultiPrintGroups.jsp",{multirequestid : multirequestid },function(_data){
				_data = eval("(" + _data + ")");
				var modereqids = _data.modereqids;
				if(!!modereqids && modereqids.length > 0){
					var redirectUrl = "/workflow/multiprint/MultiPrintMode.jsp?multirequestid=" + modereqids;
					window.open(redirectUrl,"",szFeatures) ;
				}

				var htmlreqids = _data.htmlreqids;
				if(!!htmlreqids && typeof htmlreqids == "object"){
					for(_key in htmlreqids){
						var redirectUrl = "/workflow/multiprint/MultiPrintRequest.jsp?multirequestid=" + htmlreqids[_key];
						window.open(redirectUrl,"",szFeatures) ;
					}
				}
			});
		}else{
		 top.Dialog.alert("<%=SystemEnv.getHtmlLabelName(26427,user.getLanguage())%>");
		}
	}

	function onSetPrint(ismultiprint){
		document.getElementById("ismultiprintinput").value = ismultiprint;
		var multirequestid = _xtable_CheckedCheckboxId();
		if(multirequestid != null && multirequestid != ""){
			document.getElementById("multirequestid").value = multirequestid;
			document.getElementById("operation").value = "setprint";
			$('#frmmain').submit();
		}else{
			 top.Dialog.alert("<%=SystemEnv.getHtmlLabelName(26427,user.getLanguage())%>");
		}
	}

	function onShowBrowser(id,url,tmpindex) {
		var url = url + "?selectedids=" + $G("con" + id + "_value").value;
		disModalDialog(url, $G("con" + id + "_valuespan"), $G("con" + id + "_value"), false);
		$G("con" + id + "_name").value = $G("con" + id + "_valuespan").innerHTML;

		if ($G("con" + id + "_value").value == ""){
		    document.getElementsByName("check_con")[tmpindex * 1].checked = false;
		} else {
		    document.frmmain.check_con[tmpindex*1].checked = true
		    document.getElementsByName("check_con")[tmpindex * 1].checked = true;
		}
	}

	function onShowBrowser2(id, url, type1, tmpindex) {
				var tmpids = "";
				var dlgurl = "";
				if (type1 == 8) {
					tmpids = $G("con" + id + "_value").value;
					dlgurl = url + "?projectids=" + tmpids;
				} else if (type1 == 9) {
					tmpids = $G("con" + id + "_value").value;
					dlgurl = url + "?documentids=" + tmpids;
				} else if (type1 == 1) {
					tmpids = $G("con" + id + "_value").value;
					dlgurl = url + "?resourceids=" + tmpids;
				} else if (type1 == 4) {
					tmpids = $G("con" + id + "_value").value;
					dlgurl = url + "?selectedids=" + tmpids + "&resourceids=" + tmpids
				} else if (type1 == 16) {
					tmpids = $G("con" + id + "_value").value;
					dlgurl = url + "?resourceids=" + tmpids;
				} else if (type1 == 7) {
					tmpids = $G("con" + id + "_value").value;
					dlgurl = url + "?resourceids=" + tmpids;
				} else if (type1 == 142) {
					tmpids = $G("con" + id + "_value").value;
					dlgurl = url + "?receiveUnitIds=" + tmpids;
				} else {
				    tmpids = $G("con" + id + "_value").value;
					dlgurl = url + "?resourceids=" + tmpids;
				}
				
				var dialog = new window.top.Dialog();
				dialog.currentWindow = window;
				dialog.callbackfunParam = null;
				dialog.URL = dlgurl;
				dialog.callbackfun = function (paramobj, id1) {
					if (id1 != null) {
						resourceids = wuiUtil.getJsonValueByIndex(id1, 0);
						resourcename = wuiUtil.getJsonValueByIndex(id1, 1);
						if (wuiUtil.getJsonValueByIndex(id1, 0) != "") {
							resourceids = resourceids.replace(',','');
							resourcename = resourcename.replace(',','');
	
							$G("con" + id + "_valuespan").innerHTML = wrapshowhtml(resourcename, resourceids);
							jQuery("input[name=con" + id + "_value]").val(resourceids);
							jQuery("input[name=con" + id + "_name]").val(resourcename);
						} else {
							$G("con" + id + "_valuespan").innerHTML = "";
							$G("con" + id + "_value").value = "";
							$G("con" + id + "_name").value = "";
						}
					}
					if ($G("con" + id + "_value").value == "") {
	
						document.getElementsByName("check_con")[tmpindex * 1].checked = false;
					} else {
						document.getElementsByName("check_con")[tmpindex * 1].checked = true;
					}
					hoverShowNameSpan(".e8_showNameClass");
					try {
						jQuery("#"+ "con" + id + "_value").attr('onpropertychange');
					} catch (e) {
					}
					try {
						jQuery("#"+ "con" + id + "_value" + "__").attr('onpropertychange');
					} catch (e) {
					}
				};
				dialog.Title = "<%=SystemEnv.getHtmlLabelName(18214,user.getLanguage())%>";
				dialog.Width = 550 ;
				dialog.Height = 600;
				dialog.Drag = true;
				dialog.show();
			}

	function onShowWorkFlowSerach(inputname, spanname) {

		retValue = window
				.showModalDialog("/systeminfo/BrowserMain.jsp?url=/workflow/workflow/WorkflowBrowser.jsp?sqlwhere=<%=xssUtil.put(" where isvalid='1' ")%> ");
		temp = $G(inputname).value;
		if(retValue != null) {
			if (wuiUtil.getJsonValueByIndex(retValue, 0) != "0" && wuiUtil.getJsonValueByIndex(retValue, 0) != "") {
				$G(spanname).innerHTML = wuiUtil.getJsonValueByIndex(retValue, 1);
				$G(inputname).value = wuiUtil.getJsonValueByIndex(retValue, 0);
				
				if (temp != wuiUtil.getJsonValueByIndex(retValue, 0)) {
					$G("frmmain").action = "WFCustomSearchBySimple.jsp";
					$G("frmmain").submit();
					enablemenuall();
				}
			} else {
				$G(inputname).value = "";
				$G(spanname).innerHTML = "";
				$G("frmmain").action = "WFSearch.jsp";
				$G("frmmain").submit();

			}
		}
	}
	
	function getFlowWindowUrl(){
			//return "/systeminfo/BrowserMain.jsp?url=/workflow/workflow/WorkflowTypeBrowser.jsp?typeid=" + $G("typeId").value;
			return "/systeminfo/BrowserMain.jsp?url=/workflow/workflow/WFTypeBrowser.jsp";
	}
	
	function enablemenuall()
	{
		for (a=0;a<window.frames["rightMenuIframe"].document.all.length;a++)
				{
				window.frames["rightMenuIframe"].document.all.item(a).disabled=true;
		}
		//window.frames["rightMenuIframe"].event.srcElement.disabled = true;
	}
	function changelevel(obj,tmpindex){

	    if(obj.value!=""){
	 		document.getElementsByName("check_con")[tmpindex * 1].checked = true;
	    }else{
	        document.getElementsByName("check_con")[tmpindex * 1].checked = false;
	    }
	}
	function changelevel1(obj1,obj,tmpindex){

	    if(obj.value!=""||obj1.value!=""){
	 		document.getElementsByName("check_con")[tmpindex * 1].checked = true;
	    }else{
	       document.getElementsByName("check_con")[tmpindex * 1].checked = false;
	    }
	}
	function onSearchWFQTDate(spanname,inputname,inputname1,tmpindex){
		var oncleaingFun = function(){
			  $(spanname).innerHTML = '';
			  $(inputname).value = '';
	          if($(inputname).value==""&&$(inputname1).value==""){
	              document.getElementsByName("check_con")[tmpindex * 1].checked = false;
	          }
			}
			var language=readCookie("languageidweaver");
			if(language==8)
				languageStr ="en";
			else if(language==9)
				languageStr ="zh-tw";
			else
				languageStr ="zh-cn";
			WdatePicker({lang:languageStr,el:spanname,onpicked:function(dp){
				var returnvalue = dp.cal.getDateStr();$dp.$(inputname).value = returnvalue;
				document.getElementsByName("check_con")[tmpindex * 1].checked = true;
			},oncleared:oncleaingFun});
	}
	function onSearchWFQTTime(spanname,inputname,inputname1,tmpindex){
	    var dads  = document.all.meizzDateLayer2.style;
	    setLastSelectTime(inputname);
		var th = spanname;
		var ttop  = spanname.offsetTop;
		var thei  = spanname.clientHeight;
		var tleft = spanname.offsetLeft;
		var ttyp  = spanname.type;
		while (spanname = spanname.offsetParent){
			ttop += spanname.offsetTop;
			tleft += spanname.offsetLeft;
		}
		dads.top  = (ttyp == "image") ? ttop + thei : ttop + thei + 22;
		dads.left = tleft;
		outObject = th;
		outValue = inputname;
		outButton = (arguments.length == 1) ? null : th;
		dads.display = '';
		bShow = true;
	    CustomQuery=1;
	    outValue1 = inputname1;
	    outValue2=tmpindex;
	}

	function getajaxurl(typeId){
		var url = "";
		if(typeId==12|| typeId==4||typeId==57||typeId==7 || typeId==18 
			|| typeId==164 || typeId== 194 || typeId==23 || typeId==26 
			|| typeId==3 || typeId==8 || typeId==135 || typeId== 65 
			|| typeId==9 || typeId== 89 || typeId==87 || typeId==58 
			|| typeId==59){
			url = "/data.jsp?type=" + typeId;			
		} else if(typeId==1 || typeId==165 || typeId==166 || typeId==17){
			url = "/data.jsp";
		} else {
			url = "/data.jsp?type=" + typeId;
		}
		url = "/data.jsp?type=" + typeId;	
	    return url;
	}
	function changeFlowType() {
		//_writeBackData('workflowid', 1, {id:'',name:''});
	}
</script>
<script language="javascript" src="/js/datetime_wev8.js"></script>
<script language="javascript" defer="defer" src="/js/JSDateTime/WdatePicker_wev8.js"></script>
<script language="javascript" src="/js/selectDateTime_wev8.js"></script>
</body>
</html>