<%@ page language="C#" autoeventwireup="true" inherits="SB_admin_N47_Project_WordEmployee, App_Web_wkioulim" %>

<!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 runat="server">
    <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">
        $(function(){
            $("body").css("visibility","visible"); 
        });
        function ToggleShow(url,key,obj,column){
 	        var check = $(obj);
            var cval = check.get(0).checked;
            if(!cval){
                $.messager.confirm('确认','你确定要取消完成勾选?',function(r){ 
                        ajaxSetComplete(url,key,obj,column);
                }); 
           }
           else{
                ajaxSetComplete(url,key,obj,column);
           }
        }
        function ajaxSetComplete(url,key,obj,column){
            var check = $(obj);
            $.ajax({
                    type: "POST",
                    url:url,
                    data: {"id":key,"show":check.get(0).checked,"column":column},
                    success: function(data){
                         var result = $.parseJSON(data);
                         if(result.state==1){
                            switch(column){
                                case "it_complete":
                                it_reload();
                                break;
                                case "pr_complete":
                                pr_reload();
                                break;
                                case "pl_complete":
                                pl_reload();
                                break;
                                case "s_complete":
                                s_reload();
                                break;
                            }
                         }else{
                            check.get(0).checked = false;
                            $.messager.show({title: '错误',msg: result.data});
                         }
                    }
                 }); 
                 event.stopPropagation();
                 
                 
        }
        
        
        function deleteItem(url,key,dvName){
             $.messager.confirm('确认','确定要删除选中吗?',function(r){
             if(!r){ return }load("删除中...");
                     $.ajax({
                        type: "POST",
                        url:url,
                        dataType:"json",
                        data: {"deleteKey": key},
                        success: function(data){
                          unload();
                          if(data.state==1){
                              $.messager.show({title: '提示', msg: data.data});
                              $('#'+dvName).datagrid('reload').datagrid("unselectAll");
                          }
                          else{
                             $.messager.alert('错误',data.data,'message');
                          }
                       }
                    });
             });
        }
    </script>
</head>
<body style=" visibility:hidden">

        <div>
        <script language="javascript" type="text/javascript">
        function it_OperFormat(value,row,index){
            var str ='';
            str += row.isEdit ? "<a href='javascript:void(0)' onclick=\"it_editItem('"+value+"')\">编辑</a>&nbsp;|&nbsp;":"<span>编辑</sapn>&nbsp;|&nbsp;";
            str +=  row.isDelete ? "<a href='javascript:void(0)' onclick=\"it_delete('"+value+"')\">删除</a>":"<span>删除</sapn>";
            return str;
        }
        function it_completeFormat(value,row,index){
            return "<input type='checkbox'  "+ ($.trim(value)=="True"?"checked='checked'":"") +
            " onclick=\"it_Show('"+row.id+"',this,'it_complete')\"  "+(row.isEdit?"":'disabled="disabled"')+"  />";
        }
        function it_Show(key,obj,column){
            
            ToggleShow("N47_ImageText/N47_ImageText_SetShow.aspx",key,obj,column);
            
        }
        function it_editItem(key){
            ShowDialog("edit","N47_ImageText/N47_ImageText_Edit.aspx?id="+key,600,300,100,100);
        }
        function it_reload(){
            $('#it_dataview').datagrid('reload');
        }
        function it_delete(key){
            deleteItem("N47_ImageText/N47_ImageText_Delete.aspx",key,'it_dataview');
        }
        </script>
            <fieldset>
                <legend>图文人员<span style="color:red">(如果您已完成工作请勾选并设置工作备注)</span></legend>
                <table id="it_dataview" class="easyui-datagrid" title="图文人员" style="width: 890px; height: 175px"
                    data-options="nowrap:false,rownumbers:true,collapsible:true,url:'N47_ImageText/N47_ImageText_Dataview.aspx?pid=<%=pid %>'">
                    <thead>
                        <tr>
                            <th field="it_complete" width="30" formatter='it_completeFormat'>完成</th>
                            <th field="id" width="80" formatter='it_OperFormat'>操作</th>
						    <th field="it_pid" width="150" >项目</th>
						    <th field="it_uid" width="80" >所属人员</th>
						    <th field="it_date" width="136" >完成日期</th>
						    <th field="it_note" width="300" >备注</th>
			                
                        </tr>
                    </thead>
                </table>
            </fieldset>
            <fieldset>
                <legend>摄影人员<span style="color:red">(如果您已完成工作请勾选并设置工作备注)</span></legend>
               <script language="javascript" type="text/javascript">
                function pr_OperFormat(value,row,index){
                    var str ='';
                    str += row.isEdit ? "<a href='javascript:void(0)' onclick=\"pr_editItem('"+value+"')\">编辑</a>&nbsp;|&nbsp;":"<span>编辑</sapn>&nbsp;|&nbsp;";
                    str +=  row.isDelete ? "<a href='javascript:void(0)' onclick=\"pr_delete('"+value+"')\">删除</a>":"<span>删除</sapn>";
                    return str;
                }
                function pr_completeFormat(value,row,index){
                    return "<input type='checkbox'  "+ ($.trim(value)=="True"?"checked='checked'":"") +
                    " onclick=\"pr_Show('"+row.id+"',this,'pr_complete')\" "+(row.isEdit?"":'disabled="disabled"')+" />";
                }
                function pr_Show(key,obj,column){
                    ToggleShow("N47_Photographer/N47_Photographer_SetShow.aspx",key,obj,column);
                   
                }
                function pr_editItem(key){
                    ShowDialog("edit","N47_Photographer/N47_Photographer_Edit.aspx?id="+key,600,300,100,100);
                }
                function pr_reload(){
                    $('#pr_dataview').datagrid('reload');
                }
                function pr_delete(key){
                    deleteItem("N47_Photographer/N47_Photographer_Delete.aspx",key,'pr_dataview');
                }
                </script>
                
                
                <table id="pr_dataview" class="easyui-datagrid" title="摄影人员" style="width: 890px; height: 175px"
                    data-options="nowrap:false,rownumbers:true,collapsible:true,url:'N47_Photographer/N47_Photographer_Dataview.aspx?pid=<%=pid %>'">
                    <thead>
                        <tr>
                            <th field="pr_complete" width="30" formatter='pr_completeFormat'>完成</th>
                             <th field="id" width="80" formatter='pr_OperFormat'>操作</th>
						    <th field="pr_pid" width="150" >项目</th>
						    <th field="pr_uid" width="80" >所属人员</th>
						    <th field="pr_number" width="70" >摄影数量</th>
						    <th field="pr_date" width="136" >完成日期</th>
				
						    <th field="pr_note" width="300" >备注</th>
						   
                        </tr>
                    </thead>
                </table>
            </fieldset>
            <fieldset>
                <legend>设计人员<span style="color:red">(如果您已完成工作请勾选并设置工作备注)</span></legend>
                <script language="javascript" type="text/javascript">
                function pl_OperFormat(value,row,index){
	                var str ='';
                    str += row.isEdit ? "<a href='javascript:void(0)' onclick=\"pl_editItem('"+value+"')\">编辑</a>&nbsp;|&nbsp;":"<span>编辑</sapn>&nbsp;|&nbsp;";
                    str +=  row.isDelete ? "<a href='javascript:void(0)' onclick=\"pl_delete('"+value+"')\">删除</a>":"<span>删除</sapn>";
                    return str;
                }
                function pl_completeFormat(value,row,index){
               
                    return "<input type='checkbox'  "+ ($.trim(value)=="True"?"checked='checked'":"") +
                    " onclick=\"pl_Show('"+row.id+"',this,'pl_complete')\" "+(row.isEdit?"":'disabled="disabled"')+"  />";
                }
                function pl_Show(key,obj,column){
                    ToggleShow("N47_Planner/N47_Planner_SetShow.aspx",key,obj,column);
                   
                }
                function pl_editItem(key){
                    ShowDialog("edit","N47_Planner/N47_Planner_Edit.aspx?id="+key,600,300,100,100);
                }
                function pl_reload(){
                    $('#pl_dataview').datagrid('reload');
                }
                function pl_delete(key){
                    deleteItem("N47_Planner/N47_Planner_Delete.aspx",key,'pl_dataview');
                }
                </script>
                
                <table id="pl_dataview" class="easyui-datagrid" title="设计人员" style="width: 890px; height: 175px"
                    data-options="nowrap:false,rownumbers:true,collapsible:true,url:'N47_Planner/N47_Planner_Dataview.aspx?pid=<%=pid %>'">
                    <thead>
                        <tr>
                            <th field="pl_complete" width="30" formatter='pl_completeFormat'>完成</th>
                            <th field="id" width="80" formatter='pl_OperFormat'>操作</th>
						    <th field="pl_pid" width="150" >项目</th>
						    <th field="pl_uid" width="80" >所属人员</th>
						    <th field="pl_date" width="136" >完成日期</th>
			
						    <th field="pl_note" width="300" >备注</th>
			              
                        </tr>
                    </thead>
                </table>
            </fieldset>
            <fieldset>
                <legend>制作人员<span style="color:red">(如果您已完成工作请勾选并设置工作备注)</span></legend>
               <script language="javascript" type="text/javascript">
                function s_OperFormat(value,row,index){
	                var str ='';
                    str += row.isEdit ? "<a href='javascript:void(0)' onclick=\"s_editItem('"+value+"')\">编辑</a>&nbsp;|&nbsp;":"<span>编辑</sapn>&nbsp;|&nbsp;";
                    str +=  row.isDelete ? "<a href='javascript:void(0)' onclick=\"s_delete('"+value+"')\">删除</a>":"<span>删除</sapn>";
                    return str;
                }
                function s_completeFormat(value,row,index){
                    return "<input type='checkbox'  "+ ($.trim(value)=="True"?"checked='checked'":"") +
                    " onclick=\"s_Show('"+row.id+"',this,'s_complete')\" "+(row.isEdit?"":'disabled="disabled"')+" />";  
                }
                function s_Show(key,obj,column){
                    ToggleShow("N47_Servicer/N47_Servicer_SetShow.aspx",key,obj,column);
                   
                }
                function s_editItem(key){
                    ShowDialog("edit","N47_Servicer/N47_Servicer_Edit.aspx?id="+key,600,300,100,100);
                }
                function s_reload(){
                    $('#s_dataview').datagrid('reload');
                }
                function s_delete(key){
                    deleteItem("N47_Servicer/N47_Servicer_Delete.aspx",key,'s_dataview');
                }
                </script>
                
                <table id="s_dataview" class="easyui-datagrid" title="制作人员" style="width: 890px; height: 175px"
                    data-options="nowrap:false,rownumbers:true,collapsible:true,url:'N47_Servicer/N47_Servicer_Dataview.aspx?pid=<%=pid %>'">
                    <thead>
                        <tr>
                            <th field="s_complete" width="30" formatter='s_completeFormat'>完成</th>
                            <th field="id" width="80" formatter='s_OperFormat'>操作</th>
						    <th field="s_pid" width="150" >项目</th>
						    <th field="s_uid" width="80" >所属人员</th>
						    <th field="s_date" width="136" >完成日期</th>
			
						    <th field="s_note" width="300" >备注</th>
			                
                        </tr>
                    </thead>
                </table>
            </fieldset>
      
        </div>

</body>
</html>
