<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <title th:text="个体企业执照自助打印终端"></title>
    <th:block th:include="include :: header('自助终端')" />
    <link href="/Content/css/f_css.css" rel="stylesheet"/>
    <link href="/YtjCommon/css/style.css" rel="stylesheet"/>
    <link href="/Content/css/dui.css" rel="stylesheet">
    <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/static/js/icheck.js?v=1.0.2"></script>
    <script src="/Content/static/icheck/demo/js/custom.min.js?v=1.0.2"></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>


    <!--弹出提示框 star-->
    <link rel="stylesheet" href="/Content/Alert/js/SyntaxHighlighter/shCoreDefault.css">
    <link rel="stylesheet" href="/Content/Alert/css/alert.css">
    <link rel="stylesheet" href="/Content/Alert/css/style.css">
    <script src='/Content/Alert/js/SyntaxHighlighter/shCore.js'></script>
    <script src='/Content/Alert/js/SyntaxHighlighter/makeSy.js'></script>
    <script src='/Content/Alert/js/alert.min.js'></script>
    <script src='/Content/Alert/js/alert-api.js'></script>
    <!--弹出提示框 end-->


    <bgsound loop="1" src="../music/cardtips.wav">
        <style>
            .qian img {
                width: 200px;
            }

            .chengnuo {
                padding: 50px;
                font-size: 24px;
                line-height: 50px;
                letter-spacing: 3px;
                overflow: hidden;
            }

            .chengnuo li {
                width: 100%;
            }
        </style>

        <script>
            var htmls = '';
            var PageSize = 10; //每页条数10
            var PageIndex = 1;

            var Count = 0;

            var PageCount = 0;
            var totalPage = 0; //总页数
            var card =GetQuery("jyCord");
            function getRootPath_web() {
                //获取当前网址
                var curWwwPath = window.document.location.href;
                //获取主机地址之后的目录，如： uimcardprj/share/meun.jsp
                var pathName = window.document.location.pathname;
                var pos = curWwwPath.indexOf(pathName);
                //获取主机地址，如： http://localhost:8083
                var localhostPaht = curWwwPath.substring(0, pos);
                //获取带"/"的项目名，如：/uimcardprj
                // var projectName = pathName.substring(0, pathName.substr(1).indexOf('/') + 1);
                return (localhostPaht);
            }


            function opencns(BSID) {
                $.modal.loading("正在加载中，请稍后。");
                //window.location.href = "/GtgshPrint/ChengNuoShu?BSID=" + compileStr(BSID) + "&JingYingCard=" + compileStr(SFZ);
                window.location = "/Ytj/Printer/successlist?jyCord="+card+"&BSID="+BSID;
            }
        function opencn(id) {
            $.modal.loading("正在加载中，请稍后。");
                //window.location.href = "/GtgshPrint/ChengNuoShu?BSID=" + compileStr(BSID) + "&JingYingCard=" + compileStr(SFZ);
                window.location = "/Ytj/Printer/success?bsid="+id;
            }

            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;
            }

            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  backsel(id) {
                $.ajax({
                    "url": "/Ytj/Printer/selback?tid="+id,
                    "type": "get",
                    "dataType": "json",
                    "success": function (json) {
                        if(json.code==301){
                          alert("没有退回信息!")
                        }else {
                            var data= json.data;
                            $("#back1").css("display","block");
                            $("#backSouce").html(data.shenhenote);
                            $("#backTime").html(data.shenhedate);
                        }
                    },"error":function(){
                        alert(json.message)
                    }

                });
            }
            function shut(){
                $("#back1").css("display","none");
            }
        </script>
        </head>

<body>
<header>
    <h2 class="title fl tit-con"th:text="${city}+'个体企业执照自助打印终端'"></h2>
    <a class="fr fan" href="/Ytj/GsYw">返回首页</a>
</header>
<div class="content">
    <div class="bg_white" style="height: 848px;">
        <div class="woo-pcont stpics clr woo-masned" data-wootemp="4" data-subpagenum="1" data-totalunits="24" style="position: relative; visibility: visible; height: 808px; overflow: auto;" id="VoiceList" name="VoiceList">
            <div class="woo co0" data-ht="675" data-idx="0">
            <div class="j" th:each="gtgsyw:${gtgsywList}" style="float: left; margin: 6px;">
                <div class="mbpho" style="height:62px">
                    <a target="_blank" class="a" >
                        <!-- <img src="0.png" data-rootid="" data-iid="" height="150">-->
                        <u class="guo" th:if="${gtgsyw.flg==0||gtgsyw.flg==3}" th:text="审核中"  style="text-decoration: none; margin-top:62px;height:60px;background-color: #efc220" >
                        </u>
                        <u class="guo" th:if="${gtgsyw.flg==1}"th:text="审核通过" style="text-decoration: none;margin-top:62px;height:60px; " >
                        </u>
                        <u class="guo" th:if="${gtgsyw.flg==2}"th:text="审核不通过" style="text-decoration: none;margin-top:62px;height:60px;background:#dc5a5a" >
                        </u>
                    </a>
                </div>

                <div class="wooscr" >
                    <div class="g">
                        <p><strong>个体工商户名称:</strong></p>
                        <p th:text="${gtgsyw.nsxzq}+${gtgsyw.zwzh}+${gtgsyw.mingchenghangye}+${gtgsyw.zuzhixingshi}"></p></div>

                    <div class="g">
                        <p><strong>统一社会信用代码:</strong></p>
                        <p th:text="${gtgsyw.xinyongcode}"></p></div>

                    <div class="g"><strong style="float:left;margin-right:20px ">经营者:</strong>
                        <p th:text="${gtgsyw.jingyingren}"></p>
                    </div>

                    <div class="d" th:if="${gtgsyw.flg==1}">
                        <strong style="float:left;margin-right:20px ">注册日期:</strong><p th:text="${#dates.format(gtgsyw.zhucetime, 'yyyy-MM-dd')}"></p>
                    </div>


                    <div class="e" th:if="${gtgsyw.flg==1}">
                        <a class="btn_dayin" th:if="${gtgsyw.isprint==0||gtgsyw.isprintF==0}" th:onclick="opencns([[${gtgsyw.bsid}]])" >打印</a>
                        <a class="btn_dayin" th:if="${gtgsyw.isprint==1&&gtgsyw.isprintF==1}"  href="#" disabled="true" style="background-color:#bfbfbf;">执照已打印</a>
                    </div>
                    <div class="e" th:if="${gtgsyw.flg==0}">
                        <a class="btn_dayin"  >审核中</a>
                    </div>
                    <div class="e" th:if="${gtgsyw.flg==3}">
                        <a class="btn_dayin"  >审核中</a>
                    </div>
                    <div class="e" th:if="${gtgsyw.flg==2}">
                        <button id="backsel" class="btn btn-w-m btn-danger" th:onclick="'javascript:backsel(\''+${gtgsyw.id}+'\')'"  style="margin:10px 60px; height: 40px;width: 170px;font-size: 20px;"  >退回原因查看</button>
                    </div>

                </div>

            </div>

                <div class="j" th:each="gtgsywp:${GtgsywPrintList}" style="float: left; margin: 6px;">
                <div class="mbpho" style="height:62px">
                    <a target="_blank" class="a" >
                        <u class="guo" th:text="审核通过" style="text-decoration: none;margin-top:62px;height:60px; " >
                        </u>
                    </a>
                </div>

                <div class="wooscr" >
                    <div class="g">
                        <p><strong>个体工商户名称:</strong></p>
                        <p th:text="${gtgsywp.zwzh}"></p></div>

                    <div class="g">
                        <p><strong>统一社会信用代码:</strong></p>
                        <p th:text="${gtgsywp.xinyongcode}"></p></div>

                    <div class="g"><strong style="float:left;margin-right:20px ">经营者:</strong>
                        <p th:text="${gtgsywp.jingyingren}"></p>
                    </div>

                    <div class="d">
                        <strong style="float:left;margin-right:20px ">注册日期:</strong><p th:text="${#dates.format(gtgsywp.zhucetime, 'yyyy-MM-dd')}"></p>
                    </div>
                    <div class="e">
                        <a class="btn_dayin" th:if="${gtgsywp.isprint==0||gtgsywp.isprintF==0}" th:onclick="opencn([[${gtgsywp.bsid}]])" >打印</a>
                        <a class="btn_dayin" th:if="${gtgsywp.isprint==1&&gtgsywp.isprintF==1}"  href="#" disabled="true" style="background-color:#bfbfbf;">执照已打印</a>
                    </div>
                </div>

            </div>

        </div>


            <div id="back1" style="width: 600px;height: 600px; background:#fff; position: absolute;margin:50px 0 0 30% ;display: none;border: 2px solid #cccccc;">
                <div class="j"  style="float: left; margin: 6px;">
                    <div class="mbpho" style="height:62px">
                        <a target="_blank" class="a">
                            <u  style="margin-top:62px;height:60px;width:100%;background: #fb3; text-decoration: none;font-weight:normal; ">退回原因查看
                            </u>
                        </a>
                    </div>
                    <div  style="width: 570px;">
                      <div >
                        <p style="margin:20px 0 8px 10px;"><strong >退回原因:</strong></p>
                        <p id="backSouce"  style="margin:20px 0 8px 10px;"> </p>
                        <p><strong style="margin:20px 0 8px 10px; float: left;">退回时间:</strong></p>
                        <p id="backTime"  style="margin:20px 0 8px 10px;float: right;"></p>
                      </div>
                        <input class="btn btn-w-m btn-danger" type="button" value="关闭" style="margin:20px 235px;" onclick="shut()">
                    </div>

                </div>

            </div>

    </div>
</div>
</div>
<div style="position: absolute; right: 5%; bottom: 10px;"><span class="fl dao" id="agree_btn">本页将在60秒后返回首页</span></div>
<th:block th:include="include :: footer" />
<script>
    var secs = 180;
    //document.agree.agreeb.disabled=true;
    for (var i = 0; i <= secs; i++) {
        window.setTimeout("update(" + i + ")", i * 1000);
    }


    function update(num) {
        if (num == secs) {
            // 超时返回到首页
            // window.href = "../../index.html";
            location.href = "/Ytj/GsYw";

        } else {
            var printnr = secs - num;
            //document.agree.agreeb.value = "本页受理倒计时:" + printnr+"秒！";
            //document.agree.agreeb.innerHTML = "本页受理倒计时:" + printnr+"秒！";

            var testdiv = document.getElementById("agree_btn");
            testdiv.innerHTML = "本页将在" + printnr + "秒后返回首页";
        }
    }

    function showtime(t) {
        document.myform.phone.disabled = true;
        for (i = 0; i <= t; i++) {
            window.setTimeout("update_p(" + i + "," + t + ")", i * 1000);
        }

    }

    function goBack() {
        // window.location.href = "../Home/Index";
       history.go(-1);
    }
</script>
</body>
</html>
