<!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>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title></title>
    <!--css引用--->
    <link href="../../Content/Default/jquery-ui-1.8.10.custom.css" rel="stylesheet" type="text/css" />
    <link href="../../Content/Default/ui.jqgrid.css" rel="stylesheet" type="text/css" />
    <link href="../../Content/Default/combo.css" rel="stylesheet" type="text/css" />
    <link href="../../Content/Default/combobox.css" rel="stylesheet" type="text/css" />
    <link href="../../Content/style.css" rel="stylesheet" type="text/css" />
    <!--脚本引用-->
    <script src="../../Scripts/lib/jquery-1.4.4.min.js" type="text/javascript"></script>
    <script src="../../Scripts/lib/jquery-ui-1.8.10.custom.min.js" type="text/javascript"></script>
    <script src="../../Scripts/lib/grid.locale-cn.js" type="text/javascript"></script>
    <script src="../../Scripts/lib/jquery.jqGrid.min.js" type="text/javascript"></script>
    <script src="../../Scripts/lib/jquery.layoutpanel.js" type="text/javascript"></script>
    <script src="../../Scripts/lib/jquery.combo_ciho.js" type="text/javascript"></script>
    <script src="../../Scripts/lib/jquery.combobox.js" type="text/javascript"></script>
    <script src="../../Scripts/lib/jquery.autonum.min.js" type="text/javascript"></script>
    <script src="../../Scripts/jsonConvert.js" type="text/javascript"></script>
    <script src="../../Scripts/msg.js" type="text/javascript"></script>
    <script src="../../Scripts/msgBox.js" type="text/javascript"></script>
    <script src="../../Scripts/common.js" type="text/javascript"></script>
    <script src="../../Scripts/02/p0215.js" type="text/javascript"></script>
    <script language="javascript" type="text/javascript">
        var bLoadComplete = false;
        $(function () {
            //转换下拉框控件类型
            $("#cmbDateExtentP0215").combobox();
            $("#cmbCustomerP0215").combobox();
            $("#cmbDrugP0215").combobox();
            $("#cmbZyP0215").combobox();
            addArrowClass();
            inputAndBindData("dateStartTimeP0215", false, null, dateTimeChange_P0215);
            inputAndBindData("dateEndTimeP0215", false, null, dateTimeChange_P0215);

            //页面加载方法
            pageLoad_P0215();

            //采购明细的iframe
            var iHeightDetail = window.parent.document.documentElement.clientHeight; //设定新创建的iframe的高度，宽度
            var strIframeHtml = "";
            strIframeHtml += "<iframe id=\"idIframe-21501\" frameborder=\"0\" scrolling=\"no\" style=\"display:none;width:100%;height:" + iHeightDetail + "\"></iframe>";
            strIframeHtml += "<iframe id=\"idIframe-21502\" frameborder=\"0\" scrolling=\"no\" style=\"display:none;width:100%;height:" + iHeightDetail + "\"></iframe>";
            strIframeHtml += "<iframe id=\"idIframe-21503\" frameborder=\"0\" scrolling=\"no\" style=\"display:none;width:100%;height:" + iHeightDetail + "\"></iframe>";
            $(window.parent.document).find("#tabs").find("#215").append(strIframeHtml);
            //改变窗口大小时，改变表格的高度和宽度。
            window.onresize = function () {
                resizeGrid(strTableP0215, true, false);
                resizeGridScroll(strTableP0215);
            }
            bLoadComplete = true;
        });
        function refreshMyCombobox(strModels) {     //基本资料有更新，刷新combobox
            if ($(window.parent.document).find('#idIframe-21501').length > 0) {
                $(window.parent.document.getElementById("idIframe-21501").contentWindow.document.getElementById("idRefreshCombobox")).val(strModels[0]);
                $(window.parent.document.getElementById("idIframe-21501").contentWindow.document.getElementById("idRefreshCombobox")).click();
            }
            if ($(window.parent.document).find('#idIframe-21502').length > 0) {
                $(window.parent.document.getElementById("idIframe-21502").contentWindow.document.getElementById("idRefreshCombobox")).val(strModels[0]);
                $(window.parent.document.getElementById("idIframe-21502").contentWindow.document.getElementById("idRefreshCombobox")).click();
            }
            if ($(window.parent.document).find('#idIframe-21503').length > 0) {
                $(window.parent.document.getElementById("idIframe-21503").contentWindow.document.getElementById("idRefreshCombobox")).val(strModels[0]);
                $(window.parent.document.getElementById("idIframe-21503").contentWindow.document.getElementById("idRefreshCombobox")).click();
            }
            for (var i = 0; i < strModels.length; i++) {
                var data;

                if (strModels[i] == "Tspxx") {
                    data = getComboboxData(strModels[i] + "2");
                    data.unshift({ dm: "", mc: "全部药品", "selected": true });
                    reLoadCombobox("cmbDrugP0215", data);
                }
                if (strModels[i] == "Tkhxx") {
                    data = getComboboxData(strModels[i] + "2");
                    data.unshift({ dm: "", mc: "全部客户", "selected": true });
                    reLoadCombobox("cmbCustomerP0215", data);
                }
                if (strModels[i] == "TZyxx") {
                    data = getComboboxData(strModels[i] + "2");
                    data.unshift({ "dm": "", "mc": "销售员", "selected": true }, { "dm": "-1", "mc": "其他销售员" });
                    reLoadCombobox("cmbZyP0215", data);
                }
            }
        }
    </script>
</head>
<body>
    <div class="title_bar">
        <div class="topi">
            <div class="column">
                <div id="added">
                    <ul class="topnav">
                        <li><a href="#" onclick="viewDetail_P021503();return false;">往来对账</a>
                            <ul class="addnav">
                                <li><a  onclick="viewDetail_P021501()">销售员分布</a></li>
                                <li><a  onclick="viewDetail_P021502()">药品分布</a></li>
                                <li><a href="#" onclick="toExcelMethod()">导出</a></li>
                            </ul>
                        </li>
                    </ul>
                </div>
                <div class="dedt">
                    <ul>
                        <li>
                            <select id="cmbDateExtentP0215" class="easyui-combobox" style="width: 90px">
                            </select>
                        </li>
                        <li>
                            <input id="dateStartTimeP0215" type="text" style="width: 80px; text-align: center"
                                onchange="dateTimeChange_P0215()" />
                                <font class="text_hx">&nbsp;&nbsp;</font>
                            <input id="dateEndTimeP0215" type="text" style="width: 80px; text-align: center"
                                onchange="dateTimeChange_P0215()" />                                   
                        </li>
                        <li>
                            <select id="cmbCustomerP0215" class="easyui-combobox" style="width: 120px">
                            </select>
                        </li>
                        <li>
                            <select id="cmbDrugP0215" class="easyui-combobox" style="width: 120px">
                            </select>
                        </li>
                        <li>
                            <select id="cmbZyP0215" class="easyui-combobox" style="width: 120px">
                            </select>
                        </li>
                        <li class="unline">
                            <input id="ckbGc" type="checkbox" style="width: 18px; border: 0px" />展开
                        </li>
                        <li class="enter"><a id="btnSearchDataP0215" href="#" onclick="searchDataClick_P0215('0')">
                            查询</a></li>
                    </ul>
                </div>
                <div class="clr">
                </div>
            </div>
            <div>
            </div>
        </div>
        <div class="clr">
        </div>
    </div>
    <div class="mation">
        <div id="divTp0215" class="mation_div">
            <table id="Tp0215">
            </table>
        </div>
    </div>
</body>
</html>
