<html>
<head>
<meta http-equiv=content-language content=zh-cn>
<meta http-equiv=content-type content="text/html; charset=gb2312">
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7">
<style>
 td { padding:2px 5px 2px 5px;}
</style>
<LINK href="../CSS/Base.css" type=text/css rel=stylesheet>
<link href="../CSS/Common.css" rel="stylesheet" type="text/css"/>
<link href="../CSS/SurveyList.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../JS/Browser.js.php"></script>
<LINK href="../CSS/Window.css" type=text/css rel=stylesheet>
<script type="text/javascript" src="../JS/Common.js.php"></script>
<script type="text/javascript" src="../JS/Window.js.php"></script>
<script type="text/javascript" src="../JS/Jquery.min.js.php"></script>
<script type="text/javascript" src="../JS/Jquery.notification.js.php"></script>
<link type="text/css" rel="stylesheet" href="../CSS/Notification.css" />
<script type="text/javascript" src="../JS/CheckQuestion.js.php"></script>
<script>
function checkall(form) 
{
	if( form.all.checked )
	{
		for(var i = 0;i < form.elements.length-1; i++) 
		{
			var e = form.elements[i];
			if( ! e.disabled )	e.checked = true;
		}
	}
	else
	{
		for(var i = 0;i < form.elements.length-1; i++) 
		{
			var e = form.elements[i];
			if( ! e.disabled )	e.checked = false;
		}
    }
}
function refreshParent() {
   //window.location.replace(window.location.href);
   window.location.reload(true);
}
function gId(_sId){
	return document.getElementById(_sId);
}
function checkSelectUser()
{
	var strErr = "操作要求必须先选择一个或多个任务！";
	objField = document.Check_Form.taskID;
	if( typeof objField != 'undefined' )
	{
		if( objField.length == null )
		{
			if (! objField.disabled && objField.checked) return true;
			else
			{
				document.Check_Form.all.focus();
				$.notification(strErr);
				return false;
			}
		}
		else
		{
			for (i=0;i<objField.length;i++){
				if ( ! objField[i].disabled && objField[i].checked) return true;
			}
			document.Check_Form.all.focus();
			$.notification(strErr);
			return false;
		}
	}
	else
	{
		$.notification(strErr);
		return false;
	}
}
function checkUserAction( actionValue )
{
	if ( checkSelectUser() && CheckListNoSelect(gId('tran_administratorsID'),"选中任务的执行人") ) 
	{
		gId('formAction').value = actionValue;
		gId('Check_Form').submit();
	}
}
function cancelUserAction( actionValue )
{
	if ( checkSelectUser() ) 
	{
		gId('formAction').value = actionValue;
		gId('Check_Form').submit();
	}
}
var http_request = false;
function AjaxDataListRequest(url)
{
	http_request = false;
	if(window.ActiveXObject){
		try{ http_request = new ActiveXObject("Msxml2.XMLHTTP");}
		catch (e){ try{ http_request = new ActiveXObject("Microsoft.XMLHTTP");} catch (e) {}
		}
	}
	else if(window.XMLHttpRequest){
		http_request = new XMLHttpRequest();
		if (http_request.overrideMimeType){ http_request.overrideMimeType('text/xml');}
	}	
	if (!http_request){ alert("Cannot create an XMLHTTP instance");return false;}
	http_request.onreadystatechange = function() {
	  if( http_request.readyState == 4 && http_request.status == 200) {
			 var theRtn = http_request.responseText.split('######');
			 if( theRtn[0] == 'false' )
			 {
				  $.notification(theRtn[1]);
				  gId('t_userGroupID_text').focus();
			 }
			 else
			 {
				$("#t_userGroupID_container").html(theRtn[1]);
			    gId('SearchUsersSubmit').value = '清空';
			 }
		}
	}
	http_request.open('GET', url, true);
	http_request.send(null);
}
function AjaxInitRequest(url)
{
	http_request = false;
	if(window.ActiveXObject){
		try{ http_request = new ActiveXObject("Msxml2.XMLHTTP");}
		catch (e){ try{ http_request = new ActiveXObject("Microsoft.XMLHTTP");} catch (e) {}
		}
	}
	else if(window.XMLHttpRequest){
		http_request = new XMLHttpRequest();
		if (http_request.overrideMimeType){ http_request.overrideMimeType('text/xml');}
	}	
	if (!http_request){ alert("Cannot create an XMLHTTP instance");return false;}
	http_request.onreadystatechange = function() {
	  if( http_request.readyState == 4 && http_request.status == 200) {
			 var theRtn = http_request.responseText;
			 $("#t_userGroupID_container").html(theRtn);
			 gId('SearchUsersSubmit').value = '清空';
		}
	}
	http_request.open('GET', url, true);
	http_request.send(null);
}
function checkUserSubmit(groupId)
{
	if( document.getElementById('t_userGroupID') == null )
	{
		if(Trim(gId('t_userGroupID_text').value) == '' )
		{
			$.notification("输入节点名中的关键字获得可选择的节点列表!");
			gId('t_userGroupID_text').focus();
		}
		else
		{
			AjaxDataListRequest("../System/AjaxUserNodes.php?projectOwner={projectOwner}&surveyID={surveyID}&t_name="+Trim(gId('t_userGroupID_text').value));		
		}
	}
	else
	{
		gId('t_userGroupID_container').innerHTML = "<input name=\"t_userGroupID_text\" id=\"t_userGroupID_text\" size=30>";
		gId('SearchUsersSubmit').value = '检索';
	}
}
function Init()
{
	if( {t_userGroupID} != '' )
	{
		AjaxInitRequest("../System/AjaxShowUserNode.php?t_userGroupID={t_userGroupID}");
	}
}
</script>
<script type="text/javascript" src="../JS/Loading.js.php"></script>
<meta content="mshtml 6.00.3790.0" name=generator></head>
<body oncontextmenu="return false" style="background-color:#244d8f;" onload="javascript:Init();">
<div style="line-height:10px">&nbsp;</div>
<div id="menu">
<span style="float:left;padding-left:26px;"><div class="navmenu">我的问卷 &raquo; {surveyTitle}</div></span>
  <span style="float:right">
  <ul><li><a href="ShowMain.php">我的问卷</a></li>
	  <li style="display:{isAdmin6}"><a href="ShowSurveyList.php?Action=Edit&surveyID={surveyID}">属性</a></li>
	  <li style="display:{isDeployStat}"><a href="GetSurveyCode.php?Action=Edit&surveyID={surveyID}">分发</a></li>
	  <li><a href="ShowSurveyList.php?Action=EditUser&surveyID={surveyID}">用户</a></li>
	  <li class="current" style="display:{haveTask}"><a href="{taskURL}">任务</a></li>
	  <li style="display:{havePlan}"><a href="{planURL}">计划</a></li>
  </ul></span>
</div>

<a name="top" href="javascript:void(0);"></a>
<div class="wrap q_clear" id=wrap>
<div>
<div class=content id="tasklist">
<div class=q_clear id=mysurvey><h1>列出数据录入员可执行的回复任务列表</h1><p class=surveynum>[ <span class=red>{totalRecNum}</span> 任务 ]</p><br/></div>
<div id=myname>对于神秘客/暗访/明检等调研对象清楚的调研项目，使用关联客户对象下无子孙节点的节点信息作为任务可分配清单分配给不同的数据录入员执行</div>

<div class="datalist">

<form name="Check_Form" id="Check_Form" style="margin:0;padding:0" method="POST" action="">
<table class=datatable id="datatable" style="border-bottom:0px;" cellspacing=0 cellpadding=0>
  <tr><td colspan=6>
       <span style="float:left">
	   <IMG SRC="../Images/search.gif"> 查找数据录入员：
	    <select name="t_userid" id="t_userid">
			<option value='all'>请选择数据录入员...</option>
			{userList}
		</select>&nbsp;<br/>
	    <span style="display:{isProjectType1}">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;用户节点：<span id="t_userGroupID_container"><input name="t_userGroupID_text" id="t_userGroupID_text" size=30></span>&nbsp;<input name="SearchUsersSubmit" class=inputsubmit type="button" id="SearchUsersSubmit" value="检索" onclick="javascript:checkUserSubmit();"><br/></span>
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;节点情况&nbsp;&nbsp;<input type="submit" class=inputsubmit name="Submit" value="查询"><input name="Action" type="hidden" id="Action" value="querySubmit"></span>
		<span style="float:right;display:{isProjectType1}"><IMG SRC="../Images/excel.gif">&nbsp;<a href="javascript:void(0);" onclick="javascript:showPopWin('{thisURL}&Action=ImportTask', 630, 260, refreshParent, null,'从CSV文件导入任务分配数据')">导入数据</a></span>
	</td></tr>
  <tr class=coltitle>
  <td width=3% noWrap>&nbsp;</td>
  <td width=1% noWrap>&nbsp;</td>
  <td width=20% nowrap>&nbsp;<B>任务名称</B></td>
  <td width=* align=left><B>任务描述</B></td>
  <td width=15% noWrap align=left><strong>执行人</strong></td>
</tr>
<!-- BEGIN TASK -->
<tr onmouseover="this.style.backgroundColor='#DEEFFF'" onmouseout="this.style.backgroundColor='#FFFFFF'"> 
  <td align=center><input name="taskID[]" type="checkbox" id="taskID" value="{taskID}"></td>
  <td width=1% noWrap {bg_color}>&nbsp;</td>
  <td nowrap>{taskName}</td>
  <td align=left>{taskDesc}</td>
  <td align=left nowrap>{taskMan}</td>
</tr>
<!-- END TASK -->
<tr><td width=3% align=center noWrap><input name="all" type="checkbox" id="all" value="all" onclick="checkall(this.form)" style="BACKGROUND-COLOR:#ffffff"></td>
    <td colspan=4>选中的任务分配给执行人：
	   <select name="tran_administratorsID">
		  <option value=''>请选择数据录入员...</option>
		   {input_user_list}
	   </select>
 	   <input name="formAction" id="formAction" type="hidden">
       <input name="TranMembersSubmit" class=inputsubmit type="button" id="TranMembersSubmit" value="开始" onclick="javascript:checkUserAction('SurveyTaskMatchSubmit');" > 
       <input name="CancelTaskSubmit" class=inputsubmit type="button" id="CancelTaskSubmit" value="撤销" onclick="javascript:cancelUserAction('CancelTaskSubmit');" > 
    </td>
</tr>
</table>
<input type="hidden" name="surveyID" id="surveyID" value="{surveyID}">
<input type="hidden" name="surveyTitle" id="surveyTitle" value="{surveyTitle}">
</form>
</div>
<div class=pages>{pagesList}</div>
</div></div></div>
 <script type="text/javascript">setTimeout("closeDialog()",400);adjustMenuWarpSize();</script>
</body></html>
