<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ChargeForm.aspx.cs" Inherits="Medical.MBusiness.SysCharge.ChargeForm" %>

<!DOCTYPE html>
<html>
<head>
    <title></title>
    <link href="../../css/style.css" rel="stylesheet" type="text/css" />
    <style>
        #tbInfo th{text-align:right;vertical-align:bottom}
        #tbInfo td{text-align:left; vertical-align:bottom; padding-left:5px; color:#666; height:30px; border-bottom:1px solid #ccc}
        #tbCost td{border: 1px solid #ccc;text-align:center;color:#666; height:30px}
    </style>

   <script src="../../Scripts/jquery-1.7.2.min.js" type="text/javascript"></script>
<%--   <object id='BS_TdBjq' style="left:0px;top:0px;height:0px;width:0px" classid='clsid:BC4BADC2-DE01-4416-98D4-C25215A921FF'></object>   --%>
</head>
<body>
    <fieldset>
        <legend style="text-align:center">处方信息</legend>
        <table id="tbInfo">
            <tr>
                <th>处方编号</th>
                <td><span runat="server" id="wNum"></span></td>
                <th>姓名</th>
                <td><span runat="server" id="wName"></span></td>
                <th>开具日期</th>
                <td><span runat="server" id="wDate"></span></td>
                <th>医生</th>
                <td><span runat="server" id="wDoctor"></span></td>
            </tr>
            <tr>
                <th>诊断</th>
                <td colspan='7'><span runat="server" id="wDiagnosis"></span></td>
            </tr>
        </table>
    </fieldset>
    <fieldset>
        <legend style="text-align:center">费用信息</legend>
        <table id="tbCost">
            <tr>
                <td>类别</td>
                <td colspan='2'>药品费</td>
                <td rowspan='2'>一般诊疗费</td>
                <td rowspan='2'>床位费</td>
                <td rowspan='2'>检验费</td>
                <td colspan='4'>检查费</td>
                <td colspan='2'>治疗费</td>
                <td rowspan='2'>手术费</td>
                <td rowspan='2'>其他</td>
            </tr>
            <tr>
                <td>项目</td>
                <td>西药</td>
                <td>中药</td>
                <td>心电图</td>
                <td>B超</td>
                <td>X线</td>
                <td>其他</td>
                <td>西医治疗费</td>
                <td>中医治疗费</td>
            </tr>
            <tr>
                <td>金额</td>
                <td><span id="cWesternDrug" runat="server"></span></td>
                <td><span id="cChineseDrug" runat="server"></span></td>
                <td><span id="cGeneral" runat="server"></span></td>
                <td><span id="cObserve" runat="server"></span></td>
                <td><span id="cInspection" runat="server"></span></td>
                <td><span id="cECG" runat="server"></span></td>
                <td><span id="cBScan" runat="server"></span></td>
                <td><span id="cXRay" runat="server"></span></td>
                <td><span id="cIOther" runat="server"></span></td>
                <td><span id="cWesternCure" runat="server"></span></td>
                <td><span id="cChineseCure" runat="server"></span></td>
                <td><span id="cOperation" runat="server"></span></td>
                <td><span id="cOther" runat="server"></span></td>
            </tr>
            <tr>
                <td colspan='5'>合计：<span id="Span1" runat="server"></span></td>
                <td colspan='5'>应收合计：<span id="cReceivable" runat="server"></span></td>
                <td colspan='5'>实收：<span id="cReal" runat="server"></span></td>
            </tr>
        </table>
    </fieldset>
    <fieldset>
        <legend style="text-align:center">收费找零</legend>
        <div style="text-align:center; padding:10px 0px;">
            收费金额：<input type="text" id="iMoney" />
            <input type="button" class="pt-button active" id="btnChange"  value="找零" />
            找零金额：<span class="pt-tip" id="iChange">0.00</span>元
        </div>
    </fieldset>
    <div class="pt-padding" style="text-align:center">
        <input type="button" id="btnConfirm" class="pt-button active"  value="收款确认" />
        <input type="button" id="btnClose" class="pt-button active" value="关闭" />
    </div>
    <script>
        (function() {
            var isOffer = true, key = "<%=key %>", type = "<%=type %>";
            function init() {
                if (type == "view") {
                    $("#btnConfirm").hide();
                }
//                if (isOffer) {
//                    BS_TdBjq.BS_dsbdll(0, "W");
//                    BS_TdBjq.BS_dsbdll(0, "&C11姓名:" + $("#wName").text() + " 自费$");
//                    BS_TdBjq.BS_dsbdll(0, $("#cReceivable").text() + "J");
//                }
                bindEvents();
            }
            function bindEvents() {
                $("#btnChange").click(function() {
                    var money = $("#iMoney").val();
                    if (money && isOffer) {
                        var change = money * 1 - $("#cReceivable").text() * 1
                        $("#iChange").text(change.toFixed(2));
//                        BS_TdBjq.BS_dsbdll(0, money + "Y");
//                        BS_TdBjq.BS_dsbdll(0, change + "Z");
                    }
                });
                $("#btnClose").click(function() {
                    top.art.dialog.close("Charge_Form");
                });
                $("#btnConfirm").click(function() {
                    $.get("ChargeForm.aspx", { action: "confirm", key: key }, function(data) {
                        if (parseInt(data, 10) > 0) {
                            top.showTipsMsg('收费确认操作成功!', 0, 3000);
                            top.art.dialog.close("Charge_Form");
                        } else {
                            top.showTipsMsg("操作失败!", 1, 4000);
                        }
                    });
                });
            }
            init();
        })();
    </script>
</body>
</html>
