<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="dayaccount_editlist.aspx.cs" Inherits="VA.Modules.JDingMember.consume.dayaccount_editlist" %>

<%@ Import Namespace="System.Data"%>

<!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>    
    <!--#include virtual="/include/css/editlist.aspx"-->
    <link href="/app_themes/<% = webSiteConfig.ThemeName %>/css/edit.css" type="text/css" rel="Stylesheet" />
    <!--#include virtual="/include/js/editlist.aspx"--> 
    <script type="text/javascript"> 
        
        //单条撤销；
        function scx(keyValue) {

            $('#winCX').css("display", "block");
            $('#winCX').window({
                width: 350,
                height: 220,
                modal: true,
                minimizable: false,
                collapsible: false,
                title: '撤销确认'
            });

            $("#hf_BCXKey").val(keyValue);
            $("#span_bcxBizNo").html(keyValue);
        }

        //撤销执行；
        function CXSave() {
            var keyValue = $("#hf_BCXKey").val();
            //singleActWrapper("CX", keyValue, "确定要撤单吗？", "");            
            singleActWrapper("CX", keyValue, "", "");
        }

        //当服务端执行成功时，在弹出操作成功提示后，会执行该方法。
        function doWhenServerActSuc(currActName) {
            if (currActName == "CX") {
                closeWindow();
                window.location.reload(); //重新刷新页面，以便重新计算汇总金额。
            }
        }

        //关闭窗口；
        function closeWindow() {
            $('#winCX').window("close");
        }

        function sviewDetail(rid){            
            openFrameWindow("结账详情", 720, 550, "dayaccountinfo.aspx?rid=" + rid);
        }

        //行双击事件；
        function JTongSmartListTable_trDblclick(trObj) {
            var key = $(trObj.cells[1]).find("input:hidden[name=hfKey]").eq(0).val();

            sviewDetail(key);
            event.stopPropagation();  //阻止事件冒泡，避免行被选中；
        }

        //显示汇总金额；
        function afterDataListLoaded() {
            $("#statBar").html($("#divStatInfo").html());
        }

        $(function () {
            initListPage();
        });
    </script>

</head>
<body>
<!--说明：该页面是以 employee_editlist_nofresh_5.aspx 为原型封装的结果-->
<form id="Form1" method="post" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>

<div id="pageWrapper" class="pageWrapper">   
    
    <div id="toolBar">    
        <a href="javascript:refresh()" class="jtongui-toolbarbutton" icon="icon-reload">刷新</a>            
        <%--<asp:LinkButton ID="lbnExportToExcel" runat="server" CssClass="jtongui-toolbarbutton" icon="icon-export" OnClick="lbnExportToExcel_Click">导出</asp:LinkButton>--%>

    </div><!--toolBar.END-->   
                     
    <div id="searchBar">
    
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>

        <asp:DropDownList ID="ddlDateRule" runat="server" EnableViewState="false">
        <asp:ListItem Value="" Selected="True">结账日期</asp:ListItem>
        <asp:ListItem Value="1">今天</asp:ListItem>
            <asp:ListItem Value="2">昨天</asp:ListItem>
            <asp:ListItem Value="3">前天</asp:ListItem>
            <asp:ListItem Value="4">近两天</asp:ListItem>
            <asp:ListItem Value="5">近三天</asp:ListItem>
            <asp:ListItem Value="6">近一周</asp:ListItem>
            <asp:ListItem Value="7">近一月</asp:ListItem>
            <asp:ListItem Value="8">上月</asp:ListItem>
            <asp:ListItem Value="9">本月</asp:ListItem>
            <asp:ListItem Value="10">自定义</asp:ListItem>
        </asp:DropDownList>  

        <VACTL:TextBox ID="txtBeginDate" Runat="server"
            EnableViewState="False"
            CssClass="input"
            Width="80px"            
            onfocus="laydate()"
            MaxLength="20" />  
        -      
        <VACTL:TextBox ID="txtEndDate" Runat="server"
            EnableViewState="False"
            CssClass="input"
            Width="80px"            
            onfocus="laydate()"
            MaxLength="20" />        

        <asp:Button ID="btnSearch" runat="server" 
             CssClass="simpleBtn"
             Text="查询" 
             Onclick="btnSearch_Click" />
        
        </ContentTemplate>
        </asp:UpdatePanel>

    </div><!--searchBar.END-->    

    <div id="dataBar">

    <!--MainList.Start-->    
    <div class="jtongui-smartlisttable" id="jtongui-smartlisttable">

    <table cellpadding="3" cellspacing="0" class="tableheader" id="tb1_header" >
    <thead>
    <tr>
        <%--<td style="width:30px;text-align:center;"><input type="checkbox" id="ckb_selectAll"/></td>--%>
        <td style="width:30px;text-align:center;">No.</td>        
        <td style="width:70px;text-align:center;">结账记录ID</td>
        <td style="width:100px;text-align:center;">结账时间</td>        	 	 
        <td style="width:80px;text-align:center;">收款总金额</td>
        <td style="width:80px;text-align:center;">退款总金额</td>
        <td style="width:80px;text-align:center;">优惠总金额</td>  
        <td style="width:80px;text-align:center;">提现总金额</td>                      
        <td style="width:80px;text-align:center;">应交总金额</td>  
        <td style="width:100px;text-align:center;">充值收款合计</td>	         
        <td style="width:100px;text-align:center;">消费收款合计</td>   
        <td style="width:120px;text-align:center;">充次收款合计</td>
        <td style="width:80px;text-align:center;">应交-现金</td>      
        <td style="width:80px;text-align:center;">应交-信用卡</td>      
        <td style="width:80px;text-align:center;">应交-借记卡</td>      
        <td style="width:80px;text-align:center;">应交-支付宝</td>      
        <td style="width:80px;text-align:center;">应交-微信</td>      
        <td style="width:80px;text-align:center;">应交-会员卡</td>      
        <td style="width:80px;text-align:center;">应交-计次卡</td>                             	    
        <td style="width:70px;text-align:center;">操作员</td>      
        <td style="width:100px;text-align:center;">门店</td> 
        <td style="width:30px;text-align:center;">详情</td>                            	    
        <td style="width:30px;text-align:center;">撤销</td>	                          	    
        <td></td>
    </tr>    
    </thead>
    </table>

    <div id="dataBody">
    <asp:Repeater ID="myRepeater" Runat="server" EnableViewState="False"  >
    <HeaderTemplate>    
    <div class="bodyContainer">
    <% = base.ShowNoRecordInfo() %>
    <table cellpadding="3" cellspacing="0" class="tablebody" tbHeader="tb1_header">
    </HeaderTemplate>
    <ItemTemplate>
    <tr>
        <%-- <td style="text-align:center;"><input type="checkbox" name="ckb_dataItem" value="<%# Eval("RID")%>" /></td>--%>
        <td align="center"><%# (base.currPage - 1)*base.PageSize + Container.ItemIndex + 1%></td>        
        <td align="center"><%# Eval("RID")%>
            <input type="hidden" name="hfKey" value="<%# Eval("RID")%>" />
        </td> 
        <td align="center"><%# String.Format("{0:yyyy-MM-dd HH:mm}", Eval("SettleAccount_DateTime"))%></td>        
        <td align="right"><%# Eval("Charge_Amount")%></td>        
        <td align="right"><%# Eval("Refund_Amount")%></td>        
        <td align="right"><%# Eval("Discount_Amount")%></td>        
        <td align="right"><%# Eval("Tx_Amount")%></td>        
        <td align="right"><%# Convert.ToDecimal(Eval("Charge_Amount")) - Convert.ToDecimal(Eval("Refund_Amount")) - Convert.ToDecimal(Eval("Tx_Amount")) %></td>        
        <td align="right"><%# Convert.ToDecimal(Eval("Czsk_Amount")) - Convert.ToDecimal(Eval("Cztk_Amount"))%></td>        
        <td align="right"><%# Convert.ToDecimal(Eval("Xfsk_Amount")) - Convert.ToDecimal(Eval("Xftk_Amount"))%></td>        
        <td align="right"><%# Convert.ToDecimal(Eval("Jckxssk_Amount")) - Convert.ToDecimal(Eval("Jckxstk_Amount"))%></td>        
        <td align="right"><%# Eval("Yj_Cash")%></td> 
        <td align="right"><%# Eval("Yj_MasterCard")%></td>             
        <td align="right"><%# Eval("Yj_DebitCard")%></td>             
        <td align="right"><%# Eval("Yj_Zhifubao")%></td>             
        <td align="right"><%# Eval("Yj_Weixin")%></td>             
        <td align="right"><%# Eval("Yj_Huiyuanka")%></td>             
        <td align="right"><%# Eval("Yj_PointCard")%></td>      
        <td align="center"><%# Eval("Operator_Name")%></td> 
        <td align="center"><%# Eval("Shop_Name")%></td>        
        <td align="center">
            <a href="#" onclick="javascript:sviewDetail('<%# Eval("RID")%>');"><img src="/app_themes/icons/detail.png" alt="详情"/>  </a>
        </td>              	       	     
        <td align="center">
            <%# base.ShowCXIcon(Eval("RID").ToString())%>            
        </td>   
        <td></td>
    </tr>
    </ItemTemplate>
    <FooterTemplate>
    </table>
    </div><!--bodyContainer.END-->        

    <div id="divPagerInfo" style="display:none">
        <%=base.pageInfo%>
    </div>

    <div id="divStatInfo" style="display:none">
        共 <span style="font-weight:bold;"><%=base.RdCnt%></span> 条记录，应交总金额合计：<span style="font-weight:bold;"><%= base.TotalCharges.ToString("F2")%></span>&nbsp;&nbsp;
    </div>

    <input type="hidden" id="hidden_pageCnt" value="<% = base.PageCnt%>" />
    <input type="hidden" id="hidden_rdCnt" value="<% = base.RdCnt%>" />
    <input type="hidden" name="chkNum" value="<%=chkNum%>" />

    </FooterTemplate>
    </asp:Repeater>    
    </div><!--dataBody.END-->

    </div><!--jtongui-smartlisttable.END-->        
    <!--MainList.End-->  

    </div><!--dataBar.END-->

    <div id="statBar">
       
    </div><!--statBar.END-->

    <div id="pagerBar">
       ……
    </div><!--pageNavBar.END-->
    
    <asp:HiddenField runat="server" ID="hfCurrPage" EnableViewState="true" />
    
</div>

<!--项目明细-->
<div id="winDetail" style="display:none;"></div>

<!--撤单详情窗口-->
<div id="winCX" style="display:none;">

    <div style="width:300px;padding:10px;margin:auto;">

    <div class="centerFormTitle">
        <h1>撤销确认</h1>
    </div>

    <table cellspacing="0" cellpadding="3" class="editTable" style="margin:auto;">    
    <tr>
    <td class="th" style="width:120px;">被撤结账记录ID：</td>
    <td>   
        <span id="span_bcxBizNo" style="font-weight:bold;"></span> 
        <input type="hidden" id="hf_BCXKey" name="hf_BCXKey" />
    </td>
    </tr>    
   <%-- <tr>
    <td class="th">撤单原因：</td>
    <td>    
        <asp:DropDownList ID="ddlCXReason" runat="server" EnableViewState="false">
        <asp:ListItem Value="客户要求" Selected="True">客户要求</asp:ListItem>
        <asp:ListItem Value="操作失误">操作失误</asp:ListItem>
        <asp:ListItem Value="其它原因">其它原因</asp:ListItem>
        </asp:DropDownList>  
    </td>
    </tr>--%>
    <tr>
    <td colspan="2" class="footer">
        <input type="button" id="btnCXBill" class="btn" style="width:80px" onclick="CXSave()" value="撤销" />
        <input type="button" id="btnClose" class="btn" style="width:80px" onclick="closeWindow()" value="关闭" />
    </td>
    </tr>
    </table>

    </div>

</div> 

</form>
</body>
</html> 