<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="EInvoiceSellsManage.aspx.cs" Inherits="M_Main.ChargesNew.EInvoiceSellsManage" %>

<!DOCTYPE html>
<html>
<head id="Head1" runat="server">
    <title></title>
    <script src="../jscript/jquery-1.11.3.min.js"></script>
    <script src="../jscript/jquery.tool.js" type="text/javascript"></script>
    <script src="../jscript/JSClient.js" type="text/javascript"></script>
    <link rel="stylesheet" type="text/css" href="../Jscript-Ui/jquery-easyui-1.4.4/themes/default/easyui.css">
    <link rel="stylesheet" type="text/css" href="../Jscript-Ui/jquery-easyui-1.4.4/themes/icon.css">
    <script type="text/javascript" src="../Jscript-Ui/jquery-easyui-1.4.4/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="../Jscript-Ui/jquery-easyui-1.4.4/locale/easyui-lang-zh_CN.js"></script>
    <link rel="stylesheet" type="text/css" href="../Jscript-Ui/jquery-easyui-1.4.4/demo/demo.css">
    <script src="../jscript/Dialog.js" type="text/javascript"></script>
    <link href="../css/button.css" type="text/css" rel="stylesheet" />
    <script src="../jscript/Dialog.js" type="text/javascript"></script>
    <style type="text/css">
        body {
            margin: 0px;
            margin-top: 0px;
            overflow: hidden;
            background-color: #ffffff;
            padding: 5px;
        }

        .Container {
            width: 100%;
            height: auto;
            margin-top: 5px;
            font-size: 12px;
            font-family: 微软雅黑;
        }

            .Container ul {
                margin: 0px auto;
                clear: both;
            }

                .Container ul .InputTitle {
                    list-style-type: none;
                    float: left;
                    text-align: center;
                    margin-bottom: 10px;
                    min-height: 22px;
                    line-height: 22px;
                    width: 120px;
                    text-align: right;
                }

                .Container ul .Content {
                    list-style-type: none;
                    float: left;
                    text-align: left;
                    margin-bottom: 10px;
                    width: 60%;
                }

            .Container .Content textarea {
                width: 99%;
                height: 50px;
                padding-left: 2px;
                resize: none;
            }


            .Container ul .Submit {
                list-style-type: none;
                text-align: center;
                padding-top: 4px;
                width: 80%;
                height: 40px;
            }


            .Container .Content input {
                width: 99%;
                border: 1px solid #cccccc;
                height: 22px;
                padding-left: 2px;
            }
    </style>
</head>
<body style="overflow-y: auto;">
    <form id="frmForm" runat="server">

        <div class="Container">
            <ul>
                <li class="InputTitle">项目名称：</li>
                <li class="Content">
                    <input id="CommName" name="CommName" class="easyui-validatebox" style="border: 1px solid #cccccc;" disabled="disabled" runat="server" />
                </li>
            </ul>
            <ul>
                <li class="InputTitle">费用科目：</li>
                <li class="Content">
                    <textarea id="CostName" name="CostName" class="easyui-validatebox" runat="server" data-options="required:true" style="border: 1px solid #cccccc;" onclick="SelCost();"></textarea>
                </li>
            </ul>
            <ul>
                <li class="InputTitle">税控类别：</li>
                <li class="Content">
                    <asp:DropDownList ID="VATType" runat="server">
                        <asp:ListItem Text="百旺税控盘" Value="1" />
                        <asp:ListItem Text="航天金税盘" Value="2" />
                    </asp:DropDownList>
                </li>
            </ul>
            <ul>
                <li class="InputTitle">税控盘编号：</li>
                <li class="Content">
                    <input id="skpbh" name="skpbh" runat="server" class="easyui-validatebox " value="" data-options="required:true" />
                </li>
            </ul>
            <ul>
                <li class="InputTitle">开票终端标识：</li>
                <li class="Content">
                    <input id="skpkl" name="skpkl" runat="server" type="text" />

                </li>
            </ul>
            <ul style="display: none;">
                <li class="InputTitle">数字证书密码：</li>
                <li class="Content">
                    <input id="keypwd" name="keypwd" runat="server" type="text" />
                </li>
            </ul>
            <ul>
                <li class="InputTitle">销货单位识别号：</li>
                <li class="Content">
                    <input id="xhdwsbh" name="xhdwsbh" runat="server" class="easyui-validatebox " data-options="required:true" />
                </li>
            </ul>
            <ul>
                <li class="InputTitle">销货单位名称：</li>
                <li class="Content">
                    <input id="xhdwmc" name="xhdwmc" runat="server" class="easyui-validatebox " data-options="required:true" />
                </li>
            </ul>
            <ul>
                <li class="InputTitle">销货单位地址电话：</li>
                <li class="Content">
                    <input id="xhdwdzdh" name="xhdwdzdh" runat="server" class="easyui-validatebox " data-options="required:true" />
                </li>
            </ul>
            <ul>
                <li class="InputTitle">销货单位银行帐号：</li>
                <li class="Content">
                    <input id="xhdwyhzh" name="xhdwyhzh" runat="server" class="easyui-validatebox " data-options="required:true">
                </li>
            </ul>
            <ul>
                <li class="InputTitle">专票限额：</li>
                <li class="Content">
                    <input id="SpecialTicketAmount" name="SpecialTicketAmount" runat="server" class="easyui-validatebox " data-options="required:true">
                </li>
            </ul>
            <ul>
                <li class="InputTitle">普票限额：</li>
                <li class="Content">
                    <input id="GeneralTicketAmount" name="GeneralTicketAmount" runat="server" class="easyui-validatebox " data-options="required:true">
                </li>
            </ul>
            <ul style="display: none;">
                <li class="InputTitle">电子发票限额：</li>
                <li class="Content">
                    <input id="EInvoiceAmount" name="EInvoiceAmount" runat="server" class="easyui-validatebox " data-options="required:true">
                </li>
            </ul>
            <ul>
                <li class="Submit">
                    <input type="button" class="button" value="保存" runat="server" id="BtnSave" />
                </li>
            </ul>
        </div>
        <input type="hidden" id="CommID" name="CommID" runat="server" />
        <input type="hidden" id="CorpCostID" name="CorpCostID" runat="server" />
        <input type="hidden" id="OpType" name="OpType" value="edit" runat="server" />
        <input type="hidden" id="ID" name="ID" runat="server" />


        <script type="text/javascript">
            //选择费用科目
            function SelCost() {

                HDialog.Open('700', '450', "../dialogNew/MultiCorpCommCostDlg.aspx" + "?Ram=" + Math.random() + "&CommID=" + $("#CommID").val(), '收费项目选择', false,
                    function (_data) {
                        if (_data != "") {//**获得返回 刷新
                            var varObjects = _data.split("\t");
                            var str = 'CommID=' + $('#CommID').val();
                            str += '&CorpCostID=' + varObjects[5];

                            $.tool.DataGet('EInvoiceManage', 'CheckSellsCost', str,
                                function Init() {
                                },
                                function callback(_Data) {
                                    if (_Data == "false") {
                                        $("#CorpCostID").val("");
                                        $("#CostName").val("");
                                        HDialog.Info("当前项目费用科目重复!");
                                    }
                                    else {
                                        $("#CorpCostID").val(varObjects[5]);
                                        $("#CostName").val(varObjects[1]);
                                    }
                                },
                                function completeCallback() {
                                },
                                function errorCallback() {
                                });
                        }
                    });
            }

            //更新
            $("#BtnSave").click(function () {
                Update();
            });

            function Update() {
                $.tool.DataPost('EInvoiceManage', 'SaveEInvoiceSells', $('#frmForm').serialize(),
                    function Init() {
                    },
                    function callback(_Data) {
                        if (_Data == "true") {
                            HDialog.Info('保存成功');
                            HDialog.Close("true");
                        }
                        else {
                            HDialog.Info('保存失败');
                        }
                    },
                    function completeCallback() {
                    },
                    function errorCallback() {
                    });
            }

            function SelectVatttype(strSelectValue) {
                $('#VATType').val(strSelectValue);
            }


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