<%@ page language="C#" autoeventwireup="true" inherits="SB_admin_N47_Project_N47_Project_Select_Single, App_Web_gdfbc0dd" %>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>操作</title>
    <script type="text/javascript" language="javascript" src="<%=ResolveUrl("~/SB/control/easy_ui/jquery.min.js?v=1")%>"></script>
    <script type="text/javascript" language="javascript" src="<%=ResolveUrl("~/SB/control/easy_ui/jquery.easyui.min.js?v=1")%>"></script>
    <script type="text/javascript" language="javascript" src="<%=ResolveUrl("~/SB/control/easy_ui/locale/easyui-lang-zh_CN.js?v=1")%>"></script>
    <script type="text/javascript" language="javascript" src="<%=ResolveUrl("~/SB/control/easy_ui/jquery.load.js?v=1")%>"></script>
    <script type="text/javascript" language="javascript" src="<%=ResolveUrl("~/SB/control/easy_ui/jquery.json.js?v=1")%>"></script>
    <script type="text/javascript" language="javascript" src="<%=ResolveUrl("~/SB/control/easy_ui/jquery.easyui.validtor.js?v=1")%>"></script>
    <script type="text/javascript" language="javascript" src="<%=ResolveUrl("~/SB/control/js/PageDialog.js?v=1")%>"></script>
    <link rel="stylesheet" type="text/css" href="<%=ResolveUrl("~/SB/control/easy_ui/themes/bootstrap/easyui.css?v=1")%>" />
    <link rel="stylesheet" type="text/css" href="<%=ResolveUrl("~/SB/control/easy_ui/themes/icon.css?v=1")%>" />
    <link rel="stylesheet" type="text/css" href="<%=ResolveUrl("~/SB/control/easy_ui/load.css?v=1")%>" />
    <link rel="stylesheet" type="text/css" href="<%=ResolveUrl("~/SB/control/css/main.css?v=1")%>" />
    <script language="javascript" type="text/javascript">
       var currentMenuKey = null;
       function query(){
	        $("#dataview").datagrid("load",{
			p_name: $("#qp_name").val(),
			p_customer: $("#qp_customer").val()
			});
   	   }
   	   
   	   $(function(){
   	        $("body").css("visibility","visible"); 
   	   });
   	   
   </script>
   
</head>
<body class="easyui-layout" style="visibility:hidden">
    <div region="center" border="false">
        <table id="dataview">
            <thead>
                <tr>  
					<th field="ck" checkbox="true"></th>
	                    <th field="id" width="60" formatter='OperFormat'>操作</th>
						<th field="p_index" width="70" >项目编号</th>
						<th field="p_name" width="150" formatter='nameFormat'>项目名称</th>
						<th field="p_customer" width="150" >客户</th>
						<th field="p_notPlan" width="50" formatter='p_notPlanFormat'>未安排</th>
						<th field="p_march" width="50" formatter='p_marchFormat'>进行中</th>
						<th field="p_complete" width="50" formatter='p_completeFormat'>已完成</th>
						<th field="p_depart" width="150" >部门(客户)</th>
						<th field="p_linkman" width="150" >联系人</th>
						<th field="p_tel" width="150" >联系电话</th>
						<th field="p_qq" width="150" >QQ</th>
						<th field="p_contact" width="150" >其他联系方式</th>
						<th field="p_address" width="150" >地址</th>
						
						<th field="p_program" width="150" >设计稿</th>
						<th field="p_production" width="150" >制作稿</th>
						<th field="p_materiel" width="150" >物料完成</th>
						<th field="p_dispatch" width="150" >配送完成</th>
						
			            <th field="p_spe" width="150" >规格</th>
			            <th field="p_quantity" width="150" >数量</th>
			            <th field="p_unitPrice" width="150" >单价</th>
			          
			            <th field="p_sumPrice" width="150" >总价格</th>
			            
			             <th field="p_unit" width="100" >单位</th>
			              
			            <th field="p_material" width="150" >材料</th>
						<th field="p_internalMaterial" width="150" >内页用纸</th>
						<th field="p_outMaterial" width="150" >外部用纸</th>
						<th field="p_technology" width="150" >其他工艺</th>
						<th field="p_binding" width="150" >拆装工艺</th>
						<th field="p_orderTakers" width="150" >接单人员</th>
						<th field="p_uid" width="150" >项目创建人员</th>
						<th field="p_cdate" width="150" >创建日期</th>
						
                        <th field="p_note" width="150" >备注</th>
				</tr>
            </thead>
        </table>
    </div>
    <div id="toolbar" style="height:25px">
<%--        <a id="printDelivery" class="easyui-linkbutton" iconcls="icon-remove" plain="true" onclick="SelectList()">生成发货单</a><br />--%>
        项目名称 ：<input id="qp_name" name="name" type="text" maxlength="255" onkeydown= "if(event.keyCode==13)query()"/>
	
        <a class="easyui-linkbutton" iconcls="icon-search" plain="true" onclick="query()">查询 </a>
        <a class="easyui-linkbutton" iconcls="icon-book" plain="true" onclick="$('#dataview').datagrid('load',{})">全部显示</a>
    </div>
    
    
</body>

<script language="javascript" type="text/javascript">

$(function(){
    $("#dataview").datagrid({
        toolbar:"#toolbar",
        fit:true,
        idfield:"id",
        border:false,
        pageSize:30,
        resizable:true,
        pagination:true,
        rownumbers:false,
        url:"N47_Project_Dataview.aspx",
        onLoadSuccess:function(){ $('#dataview').datagrid("unselectAll"); }
    });
});

function nameFormat(value,row,index){
    if(row.isCreate){
        return "<IMG SRC='edit.png' />"+value;
    }
    return value;
}

function OperFormat(value,row,index){
      return "<a href='javascript:void(0)' onclick=\"selectItem('"+index+"')\" >选择</a>";
}

function p_notPlanFormat(value,row,index){
return "<input type='checkbox'  "+ (value?"checked='checked'":"")+" onclick=\"return false;\"  />";
}function p_marchFormat(value,row,index){
return "<input type='checkbox'  "+ (value?"checked='checked'":"")+" onclick=\"return false;\"  />";
}function p_completeFormat(value,row,index){
return "<input type='checkbox'  "+ (value?"checked='checked'":"")+" onclick=\"return false;\"  />";
}

function selectItem(index){

    var row = $("#dataview").datagrid("selectRow",index).datagrid("getSelected");
    

    window.opener.selectProject(row.id,row.p_name,row.p_spe,row.p_quantity,row.p_material,row.p_internalMaterial,row.p_outMaterial,row.p_technology,row.p_binding);
    window.close();
}

</script>

</html>