<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Check_Plans.aspx.cs" Inherits="eFrameWork.Application.Check_Plans" %>
<%@ Import Namespace="EKETEAM.FrameWork" %>
<script>
    function check_contrast(PlanID) {
        var url = "Check/Check_Contrast.aspx?AppItem=" + AppItem + "&PlanID=" + PlanID;

        layer.open({
            type: 2,
            skin: 'layui-layer-rim', //加上边框
            title: "数据对比",
            maxmin: false,
            shadeClose: true, //点击遮罩关闭层
            area: ['500px', '400px'],
            content: url,
            success: function (layero, index) { arrLayerIndex.push(index); },
            cancel: function (index, layero) { arrLayerIndex.pop(); },
            end: function (index) { arrLayerIndex.pop(); }
        });
    };
    function check_import(PlanID) {

        var url = "Check/Check_Import.aspx?AppItem=" + AppItem + "&PlanID=" + PlanID;

        layer.open({
            type: 2,
            skin: 'layui-layer-rim', //加上边框
            title: "Excel导入",
            maxmin: false,
            shadeClose: true, //点击遮罩关闭层
            area: ['1000px', '65%'],
            content: url,
            success: function (layero, index) { arrLayerIndex.push(index); },
            cancel: function (index, layero) { arrLayerIndex.pop(); },
            end: function (index) { arrLayerIndex.pop(); }
        });
    };

</script>


<div class="nav">您当前位置：<a href="Default.aspx">首页</a> -> 采集计划<%if( Action.Value == "" && model.Power["add"].ToString()=="true"){%><a id="btn_add" style="float:right;margin-top:10px;" class="button" href="<%=eform.getAddURL()%>"><span><i class="add">添加</i></span></a><%}%></div>

<%
if(Action.Value == "" )
{
%>

<div style="margin:10px;">
<div class="esearchgroup" style="display:none;">
<a href="javascript:;" onfocus="this.blur();" class="cur">所有</a>
<a href="javascript:;" onfocus="this.blur();">已上报</a>
<a href="javascript:;" onfocus="this.blur();">未上报</a>
</div>    
<dl id="eSearchBox" class="ePanel" style="display:none;">
<dt><h1 onclick="showPanel(this);" class="search"><a href="javascript:;" class="cur" onfocus="this.blur();"></a>搜索</h1></dt>
<dd style="display:none;">
<form id="frmsearch" name="frmsearch" method="post" onsubmit="return goSearch(this);" action="<%=elist.getSearchURL()%>">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="eDataView">
<colgroup>
<col width="120" />
<col />
</colgroup>

<tr>
<td class="title">姓名：</td>
<td class="content"><span class="eform"><ev:eSearchControl ID="s3" Name="s3" ControlType="text" Field="XM" Operator="like" FieldName="批次编号" DataType="string" runat="server" /></span></td>
</tr>

<tr>
<td colspan="2" class="title" style="text-align:left;padding-left:125px;">
<a class="button" href="javascript:;" onclick="if(frmsearch.onsubmit()!=false){frmsearch.submit();}"><span><i class="search">搜索</i></span></a>
</td>
</tr>
</table>
</form>
</dd>
</dl>
</div>
<div style="margin:10px;overflow-x:auto;overflow-y:hidden;">

    <asp:Repeater id="eDataTable" runat="server">
<HeaderTemplate>
<table id="eDataTable" class="eDataTable" border="0" cellpadding="0" cellspacing="0" width="100%">
<thead>
<tr>
<td width="60">序号</td>
<td >批次</td>
<td >开始日期</td>
<td >结束日期</td>
<td >已上报</td>
<td >已导入</td>
<td >导入结果</td>
<td >对比</td>
<td >备注</td>
<td >添加时间</td>
<td >操作</td>
</tr>
</thead>
<tbody>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td height="35"><%#Container.ItemIndex+1+((ePageControl1.Page-1) *ePageControl1.PageSize) %> </td>
<td><%# Eval("MC").ToString() %></td>
<td><%# Eval("StartTime","{0:yyyy-MM-dd}").ToString() %></td>
<td><%# Eval("EndTime","{0:yyyy-MM-dd}").ToString() %></td>
<td><asp:Literal id="litPlanCount" runat="server" /></td>
<td><asp:Literal id="litResultCount" runat="server" /></td>
<td><a href="javascript:;" onclick="check_import('<%# Eval("CheckPlanID").ToString() %>');">导入</a></td>
<td><a href="javascript:;" onclick="check_contrast('<%# Eval("CheckPlanID").ToString() %>');">对比</a></td>
<td><%# Eval("BZ").ToString() %></td>
<td><%# Eval("addTime","{0:yyyy-MM-dd HH:mm:ss}").ToString() %></td>
<td><a href="?AppItem=<%=AppItem %>&act=view&id=<%# Eval("CheckPlanID").ToString() %>">查看</a><a href="?AppItem=<%=AppItem %>&act=edit&id=<%# Eval("CheckPlanID").ToString() %>">编辑</a></td>
</tr>
</ItemTemplate>
<FooterTemplate>
 </tbody>
</table>
</FooterTemplate>
</asp:Repeater>

</div>
<asp:Literal ID="LitNoResords" runat="server" />

<div style="margin:10px;">
<ev:ePageControl ID="ePageControl1" PageSize="20" PageNum="9" runat="server" />
</div>


<%
}
else
{
%>

<div style="margin:10px;">
<asp:PlaceHolder ID="eFormControlGroup" runat="server">
<form id="frmaddoredit" name="frmaddoredit" method="post" tar_get="mainform" action="<%=eform.getSaveURL()%>">
<ev:eFormControl ID="f1" Name="f1" ControlType="hidden" Field="BaseName" NotNull="True" DefaultValue="getdate()" FormatString="{0:yyyyMMddHHmmss}" runat="server" />
<input type="hidden" id="<%=Action.ActionName%>" name="<%=Action.ActionName%>" value="save">
<input type="hidden" id="fromurl" name="fromurl" value="<%=eform.FromURL%>">
<input type="hidden" id="<%=eform.primaryKeyName%>" name="<%=eform.primaryKeyName%>" value="<%=eform.ID%>">
<input type="hidden" name="eformdata_<%=ModelID.Replace("-","_")%>" id='eformdata_<%=ModelID.Replace("-","_")%>' value="<%=System.Web.HttpUtility.HtmlEncode(eform.getJson())%>">
</form>
<form id='form_<%=ModelID.Replace("-","_")%>' name="form_<%=ModelID.Replace("-","_")%>" method="post" action="">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="eDataView">
<colgroup>
<col width="120" />
<col />
</colgroup>
<tr>
<td class="title"><%if(Action.Value == "add" || Action.Value == "edit" ){Response.Write("<ins>*</ins>");}%>批次：</td>
<td class="content"><span class="eform"><ev:eFormControl ID="M2_F4" Name="M2_F4" ControlType="text" Field="MC" Width="300px" FieldName="批次" NotNull="True" MaxLength="50" runat="server" /></span></td>
</tr>
<tr>
<td class="title"><%if(Action.Value == "add" || Action.Value == "edit" ){Response.Write("<ins>*</ins>");}%>开始日期：</td>
<td class="content"><span class="eform"><ev:eFormControl ID="M2_F7" Name="M2_F7" ControlType="date" Field="StartTime" DateFormat="yyyy-mm-dd" FormatString="{0:yyyy-MM-dd}" FieldName="开始日期" NotNull="True" DataType="date" runat="server" /></span></td>
</tr>
<tr>
<td class="title"><%if(Action.Value == "add" || Action.Value == "edit" ){Response.Write("<ins>*</ins>");}%>结束日期：</td>
<td class="content"><span class="eform"><ev:eFormControl ID="M2_F10" Name="M2_F10" ControlType="date" Field="EndTime" DateFormat="yyyy-mm-dd" FormatString="{0:yyyy-MM-dd}" FieldName="结束日期" NotNull="True" DataType="date" runat="server" /></span></td>
</tr>
<tr>
<td class="title">备注：</td>
<td class="content"><span class="eform"><ev:eFormControl ID="M2_F9" Name="M2_F9" ControlType="textarea" Field="BZ" FieldName="备注" NotNull="False" runat="server" /></span></td>
</tr>

<tr>
<td colspan="2" class="title"  style="text-align:left;padding-left:100px;padding-top:10px;padding-bottom:10px;">
<%
if(Action.Value == "add" || Action.Value == "edit")
{
%>
<a class="button" href="javascript:;" onclick="packform('<%=ModelID.Replace("-","_")%>');"><span><i class="save"><%=(Action.Value == "add" ? "添加" : "保存")%></i></span></a><%}%>
<a class="button" href="javascript:;" style="margin-left:30px;" onclick="history.back();"><span><i class="back">返回</i></span></a>
</td>
</tr>
</table>
</form>
</asp:PlaceHolder>
</div>
<%}%>