<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <title>营业执照正本打印</title>
    <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

   <script src="/Content/static/js/jquery-2.0.3.min.js"></script>
    <script src="/Content/static/bootstrap/js/bootstrap.min.js"></script>
    <script src="/Content/JS/Print.js"></script>
    <script src="/Content/JS/A4Print.js"></script>
    <script src="/Content/JS/main.js"></script>
    <script src="/Content/static/js/public.js"></script>

    <script type="text/javascript">
        var JingYingCard = GetQuery('jyCord');//身份证号
        var BSID = GetQuery('BSID');//身份证号
        $(function () {
            GetGrid();
            $("#XinYongCode").html("0987654321");
                    var myDate = new Date();
                    myDate.getYear();        //获取当前年份(2位)
                    myDate.getFullYear();    //获取完整的年份(4位,1970-????)
                    myDate.getMonth();       //获取当前月份(0-11,0代表1月)
                    myDate.getDate();        //获取当前日(1-31)
                    myDate.getDay();         //获取当前星期X(0-6,0代表星期天)
                    myDate.getTime();        //获取当前时间(从1970.1.1开始的毫秒数)
                    myDate.getHours();       //获取当前小时数(0-23)
                    myDate.getMinutes();     //获取当前分钟数(0-59)
                    myDate.getSeconds();     //获取当前秒数(0-59)
                    myDate.getMilliseconds();    //获取当前毫秒数(0-999)
                    myDate.toLocaleDateString();     //获取当前日期
                    var mytime = myDate.toLocaleTimeString();     //获取当前时间
                    myDate.toLocaleString();        //获取日期与时间

                    $("#Nian").html(myDate.getFullYear());
                    $("#Yue").html(myDate.getMonth() + 1);
                    $("#Ri").html(myDate.getDate());
        });

//加载数据
        function GetGrid() {

            $.ajax({
                type: 'GET',
                contentType: 'application/json',
                url: '/Ytj/Printer/Printing?BSID=' + BSID + '&jyCord=' + JingYingCard+"&bs=3",
                dataType: 'json',
                success: function (json) {
                    var data=json.data;

                    $("#XinYongCode").html(data.xinyongcode);
                    $("#JingYingRen").html(data.jingyingren);
                    //$("#zwzh").html(item.NsXzq + "" + item.Zwzh + "" + item.MingChengHangYe + "" + item.ZuZhiXingShi);
                    if (data.zwzh == "***") {
                        $("#zwzh").html(data.zwzh);
                    } else {
                        $("#zwzh").html(data.nsxzq + "" + data.zwzh + "" + data.mingchenghangye + "" + data.zuzhixingshi);
                    }
                    $("#ScZtType").html(data.sczttype);
                    $("#JingYingChangSuo").html(data.jingyingchangsuo);
                    $("#ZuChengXingShi").html(data.zuchengxingshi);
                    $("#ShenQingDate").html(ZhuanTime(data.zhucetime));
                    $("#JingYingFanWei").html(data.jingyingfanwei);
                    $("#ErWeiMaBase64").html("<img src=\"data:image/png;base64," + data.erweimabase64 + "\" style=\"width:360px;height:360px;\"/>");


                    var myDate = new Date();
                    myDate.getYear();        //获取当前年份(2位)
                    myDate.getFullYear();    //获取完整的年份(4位,1970-????)
                    myDate.getMonth();       //获取当前月份(0-11,0代表1月)
                    myDate.getDate();        //获取当前日(1-31)
                    myDate.getDay();         //获取当前星期X(0-6,0代表星期天)
                    myDate.getTime();        //获取当前时间(从1970.1.1开始的毫秒数)
                    myDate.getHours();       //获取当前小时数(0-23)
                    myDate.getMinutes();     //获取当前分钟数(0-59)
                    myDate.getSeconds();     //获取当前秒数(0-59)
                    myDate.getMilliseconds();    //获取当前毫秒数(0-999)
                    myDate.toLocaleDateString();     //获取当前日期
                    var mytime = myDate.toLocaleTimeString();     //获取当前时间
                    myDate.toLocaleString();        //获取日期与时间

                    $("#Nian").html(myDate.getFullYear());
                    $("#Yue").html(myDate.getMonth() + 1);
                    $("#Ri").html(myDate.getDate());
                },
                error: function () {
                    $("#XinYongCode").html("123456789000");
                    alert("页面加载失败");
                }
            });


        }
        function GetQuery(key) {
            var search = location.search.slice(1); //得到get方式提交的查询字符串
            var arr = search.split("&");
            for (var i = 0; i < arr.length; i++) {
                var ar = arr[i].split("=");
                if (ar[0] == key) {
                    if (unescape(ar[1]) == 'undefined') {
                        return "";
                    } else {
                        return unescape(ar[1]);
                    }
                }
            }
            return "";
        }

        function ZhuanTime(Time) {
            var date = new Date(Time);
            var result, year, month, day;
            year = date.getYear() + 1900;
            month = date.getMonth() + 1;
            day = date.getDate();

            result = year + "年" + month + "月" + day + "日";
            return result;
        }


        function compileStr(code) { //对字符串进行加密         
            var c = String.fromCharCode(code.charCodeAt(0) + code.length);
            for (var i = 1; i < code.length; i++) {
                c += String.fromCharCode(code.charCodeAt(i) + code.charCodeAt(i - 1));
            }
            return escape(c);
        }


        function uncompileStr(code) {       //对字符串进行解密  
            code = unescape(code);
            var c = String.fromCharCode(code.charCodeAt(0) - code.length);
            for (var i = 1; i < code.length; i++) {
                c += String.fromCharCode(code.charCodeAt(i) - c.charCodeAt(i - 1));
            }
            return c;
        }
     </script>
    <style>
        .fontSize {
        font-size:20px;
        font-family:黑体;
        }
    </style>
</head>
<body>
<div id="myPrintArea" style="height:1000px;">
  <div id="content" style="margin-top:500px;margin-left:150px;">
        <div style="margin-left:300px;" class="fontSize"><strong>统一社会信用代码</strong>&nbsp;&nbsp;<span id="XinYongCode"></span></div>

    <table cellspacing="0" class="fontSize" align="center" border="0" style="margin-bottom:20px;width:99% ">
        <tr>
        <td style="height:50px;width:120px;"><strong>经&nbsp;营&nbsp;者</strong></td>
        <td align="left"><span id="JingYingRen"></span></td>
       </tr>

      <tr>
        <td style="height:50px;"><strong>名&nbsp;&nbsp;&nbsp;&nbsp;称</strong></td>
        <td align="left"><span id="zwzh"></span></td>
      </tr>

      <tr>
        <td style="height:50px;"><strong>类&nbsp;&nbsp;&nbsp;&nbsp;型</strong></td>
        <td align="left"><span id="ScZtType"></span></td>
      </tr>

        <tr>
        <td style="height:50px;"><strong>经营场所</strong></td>
        <td align="left"><span id="JingYingChangSuo"></span></td>
       </tr>

       <tr>
        <td style="height:50px;"><strong>组成形式</strong></td>
        <td align="left"><span id="ZuChengXingShi"></span></td>
       </tr>

       <tr>
        <td style="height:50px;"><strong>注册日期</strong></td>
        <td align="left"><span id="ShenQingDate"></span></td>
       </tr>

         <tr>
        <td style="height:50px;"><strong>经营范围</strong></td>
        <td align="left"><div style="width:600px;"><span id="JingYingFanWei"></span></div></td>
       </tr>
    </table>

     <div style="margin-top:150px;"><div id="ErWeiMaBase64"></div></div>

      <div><span id="Nian"></span></div>
      <div><span id="Yue"></span></div>
      <div><span id="Ri"></span></div>
  </div>
</div>

</body>
</html>
