<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <title th:text="行政审批局企业业务自助终端"></title>
    <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

    <link href="/Content/css/f_css.css" rel="stylesheet" />
    <link href="/Content/css/style.css" rel="stylesheet" />
    <script src="/Content/Scripts/jquery/jquery-1.8.2.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>

<!--    <link rel="stylesheet" href="/Content/Alert/css/common.css">-->
    <th:block th:include="include :: header('下拉框')" />
    <th:block th:include="include :: select2-css" />
    <th:block th:include="include :: bootstrap-select-css" />
    <link rel="stylesheet" type="text/css" href="/ajax/libs/layer/theme/default/layer.css">
    <link rel="stylesheet" type="text/css" href="/ajax/libs/layer/theme/moon/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>
    <script src="/ajax/libs/layui/layui.js"></script>
    <script src="/ajax/libs/layer/layer.min.js"></script>

<style>
input:disabled{color:#232323}
</style>

    <script type="text/javascript">
      var JingYingCard = GetQuery('JingYingCard');//身份证号
        //  var JingYingCard = "142635198302151018";
       var BSID = GetQuery('BSID');
       //JingYingCard = "142635198302151018";
       //BSID = "6f4c3aec-ff21-43ab-909f-22c056aa76a8";
        $(function () {
            // 判断是否已存在，如果已存在则直接显示
            GetGrid();

        });
      function selKzChange() {
          switch ($("#selKZ").val()) {
              case '石家庄高新区鹏程刻字社':
                  $("#CompanyAddress").html("地址:高新区天山大街69号 <br> 联系方式:13673180781")
                  $("#KzCompanyPhone").val("13673180781")
                  break;
              case '石家庄市鸿昌印章制作中心':
                  $("#CompanyAddress").html("地址:桥西区建国路666号西雅小区6号商铺，桥西地税对面 <br> 联系方式:13001886507")
                  $("#KzCompanyPhone").val("13001886507")
                  break;
              case '宝玺石家庄市印章制作有限公司':
                  $("#CompanyAddress").html("地址:石家庄高新区长江大道26号 <br> 联系方式:15131191999")
                  $("#KzCompanyPhone").val("15131191999")
                  break;
              case '石家庄高新区晓丹文印部':
                  $("#CompanyAddress").html("地址:天山大街与槐安路交叉口西北角 <br> 联系方式:13803375107")
                  $("#KzCompanyPhone").val("13803375107")
                  break;
              case '石家庄市博鳌印章制作有限公司高新区分公司':
                  $("#CompanyAddress").html("地址:高新区长江大道26号 <br> 联系方式:15369137096")
                  $("#KzCompanyPhone").val("15369137096")
                  break;
              case '石家庄平舆印章制作有限公司':
                  $("#CompanyAddress").html("地址:石家庄高新区珠峰大街218号水榭花都33号106底商 <br> 联系方式:17692121758")
                  $("#KzCompanyPhone").val("17692121758")
                  break;
              default:
                  $("#CompanyAddress").html("")
                  break;
          }
      }
        //加载数据
        function GetGrid() {
            $.ajax({
                type: 'Post',
                contentType: 'application/json',
                url: 'GetFormData_ChengNuoShu?BSID=' + BSID + '&JingYingCard=' + JingYingCard,
                dataType: 'json',
                success: function (json) {
                    var data=json.data;
                    if (json.code==0) {
                        $("#ShenqingName").val(data.qyname);
                        $("#ShenqingPhone").val(data.qylxdh);
                        $("#RenName").val(data.frname);
                        $("#id").val(data.id);
                        var a = data.createdate.slice(0,10).split("-");
                        a = a[0] + "年" + a[1] + "月" + a[2] + "日";
                        //alert(a);
                        $("#ShenHeDate").html(a);
                        // $("#QianMing").html("<img src=\"" + data[i].lqrqianming+ "\" style=\"width:160px;height:80px;\"/>");
                    } else {
                        alert("没有找到信息")
                        window.location.href=""
                    }

                },
                error: function () {
                    alert("页面加载失败");
                }
            });
        }


        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 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 printweb(BSID) {
            var Url = getRootPath_web();
            var path = "";

            if (BSID == "1") {//打印正本A3
                $("#printA").attr("disabled", true);
                path = Url + "/GtgshPrint/PrintForm?JingYingCard=" + compileStr(JingYingCard);
            }
            else if (BSID == "0") {//打印副本A4
                $("#printB").attr("disabled", true);
                path = Url + "/GtgshPrint/PrintForm_F?JingYingCard=" + compileStr(JingYingCard);
            }
            updatePrint(BSID);
            var printurlChoiceTray = {
                "url": path,
                "ChoiceTray": 0,
                "isdouble": 0,
                "ChoicePaper": BSID
            };
            var data = JSON.stringify(printurlChoiceTray);

            send_command(
                "printUrl",
                path,
                function (receivedData) {
                    var dialog = jqueryAlert({
                        'style': 'wap',
                        'icon': '/Content/Alert/img/right.png',
                        'content': '开始打印...',
                        'closeTime': 2000,
                    })
                });
        }




        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 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 getRadioVal(name) {
            var result;
            var radio = document.getElementsByName(name);
            for (var i = 0; i < radio.length; i++) {
                if (radio[i].checked) {
                    result = radio[i].value;
                }
            }
            return result;
        }
    </script>



    <style>
	.qian img{width:200px;}
    .chengnuo{padding:50px; font-size:24px;line-height:50px;letter-spacing:3px;overflow:hidden;}
	.chengnuo li{width:100%;}
    </style>

</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;">
            <input hidden="hidden" id="ShenqingPhone">
            <input hidden="hidden" id="KzCompanyPhone">
            <input hidden="hidden" id="RenName">
            <input hidden="hidden" id="id">
            <input hidden="hidden" id="KzCompanyName">
            <div class="chengnuo">
                <ul style="list-style: none">
                    <li>
                        <h2 align="center">承诺书</h2>
                    </li>
                    <li><span style="border-bottom: 1px solid #666;"th:text="${city}+'行政审批局企业业务自助终端'"></span></li>
                    <li style="text-indent: 2em;">
                        <input style="width: 300px; border: 0; background: none; border-bottom: 1px solid #666; font-size: 24px;" disabled="true" id="ShenqingName" name="ShenqingName"/>（企业）郑重承诺：工商部门已告知相关审批事项和审批部门。在领取营业执照后，我（本企业）将及时到审批部门办理审批手续，在取得行政审批前不从事相关经营活动。如有超出登记经营范围从事后置审批事项经营的需要，也将先行办理经营范围变更登记和相应的审批手续，未取得相关审批之前不从事相关经营活动。</li>
<!--                    <li class="tr qian" style="padding-top: 40px;">签名：<div id="QianMing" style="width:160px;height:80px;float:right"></div></li>-->
                    <li class="tr" style="padding-right: 3em;padding-top:60px;">
                         <label id="ShenHeDate"></label>
                    </li>
                    <li style="text-indent: 2em; padding-top: 50px;">备注：签名人员应为法定代表人（拟任法定代表人、负责人、经营者）或者其委托代理人。</li>
                </ul>
                <div style="text-align: center;">
                    <label>
                        <input type="checkbox" name="check" id="check" onclick="CheckAgree(this.checked)" style="zoom:200%;"/><b style="lin-height: 10px;">&nbsp;我已阅读</b></label></div>
                <div style="text-align: center;">
                    <input id="btn_part1" name="btn_part1" type="button" class="btn_Lei btn_x" disabled="disabled" value="同 意" onclick="TprintIndex()"/>
                </div>
            </div>
        </div>
    </div>
    <div style="position: absolute; right: 5%; bottom: 30px;">
        <span class="fl dao" id="agree_btn">本页将在60秒后返回首页</span>
        <a class="btn-fan fl" onclick="goBack()">上一步</a>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: select2-js" />
    <th:block th:include="include :: bootstrap-select-js" />
    <script>
        function CheckAgree(c) {
            var obj = document.getElementById('btn_part1');
            if (c) {
                obj.disabled = false;
                obj.className = "btn_Lei btn_x";




            }
            else {
                obj.disabled = true;
                obj.href = "javascript:void(0)";
                var dialog = jqueryAlert({
                    'style': 'wap',
                    'icon': '/Content/Alert/img/warning.png',
                    'content': '选中“我已阅读”复选框方可进行打印',
                    'closeTime': 2000,
                })
            }
        }

         function TprintIndex() {
             $.modal.loading("正在提交，请稍后。");
             window.location = "/Ytj/qyPrint/PrintLr?BSID=" + BSID + "&JingYingCard=" + JingYingCard;
             /*layer.open({
                 type: 1
                 , title: '请选择刻章公司' //不显示标题栏
                 , closeBtn: false
                 , area: ['700px', '600px']
                 , shade: 0.8
                 , id: 'LAY_layuipro' //设定一个id，防止重复弹出
                 , btn: ['确定', '取消']
                 , btnAlign: 'c'
                 , moveType: 1 //拖拽模式，0或者1
                 , content:'<div class="form-group">\n' +
                     '                            <label class="font-noraml" style="font-size: 24px">刻章公司</label>\n' +
                     '                            <select class="form-control" style="height: 55px;font-size: 24px" id="selKZ" onchange="selKzChange()"> \n' +
                     '                            \t<option style="height: 30px;font-size: 24px" selected  value="">--请选择刻章公司--</option>\n' +
                     '                            \t<option style="height: 30px;font-size: 24px" value="石家庄高新区鹏程刻字社">石家庄高新区鹏程刻字社</option>\n' +
                     '                            \t<option style="height: 30px;font-size: 24px"  value="宝玺石家庄市印章制作有限公司">宝玺石家庄市印章制作有限公司</option>\n' +
                     '                            \t<option style="height: 30px;font-size: 24px"  value="石家庄高新区晓丹文印部">石家庄高新区晓丹文印部</option>\n' +
                     '                            \t<option style="height: 30px;font-size: 24px"  value="石家庄市博鳌印章制作有限公司高新区分公司">石家庄市博鳌印章制作有限公司高新区分公司</option>\n' +
                     '                            \t<option style="height: 30px;font-size: 24px"  value="石家庄平舆印章制作有限公司">石家庄平舆印章制作有限公司</option>\n' +
                     '                            \t<option style="height: 30px;font-size: 24px"  value="石家庄市鸿昌印章制作中心">石家庄市鸿昌印章制作中心</option>\n' +
                     '                            </select><span class="help-block m-b-none"  style="font-size: 25px"id="CompanyAddress"></span>\n' +
                     '                        </div>'
                 , success: function (layero) {

                 },btn1:function () {

                     if($("#selKZ").val()==""){
                         layer.msg("请选择刻章公司")
                         return false
                     }else {
                         var companyPhone=$("#ShenqingPhone").val()
                         var companyName=$("#ShenqingName").val()
                         var KzCompanyName=$("#KzCompanyName").val()
                         var RenName=$("#RenName").val()
                         var KzCompanyPhone=$("#KzCompanyPhone").val()
                         var formData =new FormData();
                         formData.append("companyPhone",companyPhone)
                         formData.append("companyName",companyName)
                         formData.append("KzCompanyPhone",KzCompanyPhone)
                         formData.append("KzCompanyPhone",KzCompanyPhone)
                         formData.append("RenName",RenName)
                         formData.append("id",$("#id").val())
                         $.ajax({
                             url:'/Ytj/qyPrint/sendMsgToCompany',
                             type:'post',
                             data:formData,
                             processData: false,        // 告诉jQuery不要去处理发送的数据
                             contentType: false,        // 告诉jQuery不要去设置Content-Type请求头
                             success:function (data) {
                                if(data.code==0){
                                    var JiaMiJingYingCard = JingYingCard;
                                    var JiaMiBSID = BSID;
                                    window.location = "/Ytj/qyPrint/PrintLr?BSID=" + JiaMiBSID + "&JingYingCard=" + JiaMiJingYingCard;
                                }
                             }
                         })
                     }





                 }
             })*/

        }


    </script>

    <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";
                checkLeave();
                location.href = "/Ytj/qyPrint";

            }
            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() {

            history.go(-1);
        }
    </script>
</body>
</html>
