<!doctype html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <title>个体注销</title>
    <th:block th:include="include :: header('个体注销')"/>
    <script src="/Content/JS/jquery.min.js"></script>
    <link rel="stylesheet" type="text/css" href="/gt/gtzx/css/bootstrap.min.css">
    <link rel="stylesheet" type="text/css" href="/gt/gtzx/css/f_css.css">
    <link rel="stylesheet" type="text/css" href="/gt/gtzx/css/style.css">
    <link href="/Content/css/big-window.css" rel="stylesheet"/>
    <link href="/Content/css/alert.css" rel="stylesheet"/>
    <link rel="stylesheet" href="/gt/gtzx/layui/css/layui.css">
    <script src="/gt/gtzx/layui/layui.js"></script>
    <script src="/Content/static/js/public.js"></script>
    <script src="/Content/JS/main.js"></script>
    <!--人脸识别函数-->
    <script src="/Content/JS/Face.js"></script>
    <!--手写签名函数-->
    <script src="/Content/JS/Hand.js"></script>
    <!--拍照-->
    <script src="/Content/JS/Camera.js"></script>
    <!--语音-->
    <script src="/Content/JS/Sound.js"></script>
    <script src="/Content/static/js/sound.js"></script>

    <script src="/gt/gtzx/js/ryphoto.js"></script>

    <style>
        .sbxxtl .input_right5 {
            width: 500px;
        }
    </style>

    <style>
        * {
            margin: 0;
            padding: 0;
        }

        .layui-form {
            margin: 10px 20px;
        }

        .layui-form input {
            border-radius: 10px;

        }

        .layui-form input:focus {
            border: 1px solid #5fb878 !important;
        }

        .boxx {
            display: flex;
        }

        .a, .b, .c, .d {
            flex: 1;
        }

        .layui-form-label {
            width: 185px !important;
        }

        .layui-input-block {
            margin-left: 185px !important;
        }

        .layui-form-label, .layui-input {
            color: #6a676c !important;
        }

        .layui-form-radio * {
            color: #6c676a;
        }

        form div {
            overflow: visible;
        }

    </style>
</head>
<script>
    var score = [[${score}]]
    $(function () {
        function readInfo() {
            m_info = read_info();
            if (m_info) {
                var idInfo = JSON.parse(m_info);//读取身份证
                /*$('#jyzxm').val(idInfo.name);//姓名
                $("#jyzxb").val(idInfo.sex);//性别
                $("#jyzmz").val(idInfo.nation);//民族
                $("#jyzzz").val(idInfo.address);
                $("#sfzjg").val(idInfo.grantdept);
                $('#jyzsfz').val(idInfo.idCardNo);
                */
                $("#operatorIdCardAvatar").val("data:image/jpeg;base64," + idInfo.idImg);
                $("#rzdb_SFZ").attr('src', "data:image/jpeg;base64," + idInfo.idImg);//认证对比-身份证
            }
        }
        gobackIndex()
        readInfo();
    })

    function gobackIndex() {
        layer.msg('该事项已停止提交', {
            icon: 1,
            time: 2000 //2秒关闭（如果不配置，默认是3秒）
        }, function(){
            window.location.href="/"
        });
    }
    //获取输入法
    function imeOpen(eleID) {
        var info = document.getElementById(eleID).value;
        var test = {'info': info, 'ispassword': 0};
        var data = JSON.stringify(test);
        send_command(
            "imewrite",
            data,
            function (receivedData) {
                var data = JSON.parse(receivedData);
                document.getElementById(eleID).value = data.msg;
            }
        );
    }

var  flg= false;
    function HuoquInfo() {
        var regisCode = $("#registrationNumber").val();
        var XyCode = $("#uniformSocialCreditCode").val();

        if (XyCode != "" || regisCode != "") {
            $.ajax({
                url: "/Ytj/zx/getInfo",
                type: "post",
                data: {
                    "XyCode": XyCode,
                    "regisCode": regisCode
                },
                success: function (data) {
                    if (data.code == 0) {
                        var gtgszx = jQuery.parseJSON(data.data);
                        $("#operatorName").val(gtgszx[1].姓名);
                        $("#companyName").val(gtgszx[0].名称);
                        $("#registrationNumber").val(gtgszx[0].注册号);
                        $("#uniformSocialCreditCode").val(gtgszx[0].统一社会信用代码);
                        $("#operatorIdCard").val(gtgszx[1].证件号码);
                        $("#operatorAddress").val(gtgszx[1].住所);
                        $("#operatorZipCode").val(gtgszx[0].邮编);
                        $("#operatorPhone").val(gtgszx[1].移动电话);
                        $("#clearFlg").val(gtgszx[2]);

                        if (gtgszx[0].组成形式 == "个人经营") {
                            $("#organizationType1").next().click();
                            $("#organizationType1").prop("checked", true);
                            $("#organizationType2").prop("checked", false);
                        } else {
                            $("#organizationType2").next().click();
                            $("#organizationType2").prop("checked", true);
                            $("#organizationType1").prop("checked", false);
                        }

                        $("#businessScope").val(gtgszx[0].经营范围);
                        flg=true;
                    } else {
                        layer.msg(data.msg)
                    }
                }
            })
        } else {
            layer.msg("请输入 (注册号) 或 (统一社会信用代码)");
        }
    }

</script>
<body>
<header>
    <h2 class="title fl tit-con" style="font-weight: bold"th:text="${city}+'个体企业执照自助打印终端'">行政审批局个体工商户自助终端</h2>
    <a class="fr fan" onclick="duibi(0)" href="/">返回首页</a></header>
<div class="content" style="overflow: visible">
    <div class="bg_white">
        <div class="content_960_b" style=" border-top:none;">
            <div class="con_900">
                <div style="overflow: visible">
                    <div class="popbox_title mb20" style="margin-top:30px;">个体工商户注销登记申请   <a style="color: #ff1515">&nbsp;&nbsp;  提示: 无社会信用代码的，请根据注册号获取信息</a></div>
                    <form class="layui-form" action="" id="frm1">
                        <input type="hidden" name="flag" id="flag" value="0"/>
                        <input type="hidden" name="operatorPhone" id="operatorPhone"/>
                        <input type="hidden" name="operatorIdCardAvatar" id="operatorIdCardAvatar"/>
                        <input type="hidden" name="applyForSource" id="applyForSource"/>
                        <input type="hidden" name="" id="clearFlg"/>
                        <div style="width:100%;float:left;min-height: 600px;overflow: visible" id="operator">

                            <div class="boxx">
                                <div class="a">

                                    <div class="layui-form-item">
                                        <label class="layui-form-label">注册号：</label>
                                        <div class="layui-input-block">
                                            <input type="text" name="registrationNumber" id="registrationNumber"
                                                   onclick="imeOpen('registrationNumber')"    lay-verify="title" autocomplete="off" placeholder=" "
                                                   class="layui-input">
                                        </div>
                                    </div>
                                </div>
                                <div class="b">
                                    <div class="layui-form-item">
                                        <label class="layui-form-label">统一社会信用代码：</label>
                                        <div class="layui-input-block">
                                            <input id="uniformSocialCreditCode" type="text"
                                                   onclick="imeOpen('uniformSocialCreditCode')"   name="uniformSocialCreditCode" lay-verify="title" autocomplete="off"
                                                   placeholder=" " class="layui-input">
                                        </div>
                                    </div>
                                </div>
                                <div class="b">
                                    <button type="button" style="margin-left: 50px"
                                            class="layui-btn layui-btn-normal" onclick="HuoquInfo()"> 点击查询
                                    </button>

                                </div>

                            </div>

                            <div class="boxx">

                                <div class="b">
                                    <div class="layui-form-item">
                                        <label class="layui-form-label">单位名称：</label>
                                        <div class="layui-input-block">
                                            <input type="text" name="companyName" id="companyName" lay-verify="title"
                                                   autocomplete="off" placeholder=" " class="layui-input">
                                        </div>
                                    </div>
                                </div>
                                <div class="a">
                                    <div class="layui-form-item">
                                        <label class="layui-form-label">清税证明文号：</label>
                                        <div class="layui-input-block">
                                            <input type="text" name="clearTaxNumber" id="clearTaxNumber" lay-verify="title"
                                                   onclick="imeOpen('clearTaxNumber')"   autocomplete="off" placeholder=" " class="layui-input">
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <div class="boxx">
                                <div class="a">
                                    <div class="layui-form-item">
                                        <label class="layui-form-label">经营者姓名：</label>
                                        <div class="layui-input-block">
                                            <input type="text" name="operatorName" id="operatorName" lay-verify="title"
                                                   autocomplete="off" placeholder=" " class="layui-input">
                                        </div>
                                    </div>
                                </div>
                                <div class="b">
                                    <div class="layui-form-item">
                                        <label class="layui-form-label">经营者身份证号码：</label>
                                        <div class="layui-input-block">
                                            <input type="text" name="operatorIdCard" id="operatorIdCard"
                                                   lay-verify="title" autocomplete="off" placeholder=" "
                                                   class="layui-input">
                                        </div>
                                    </div>
                                </div>

                            </div>


                            <div class="layui-form-item">
                                <label class="layui-form-label">经营者住所：</label>
                                <div class="layui-input-block">
                                    <input type="text" name="operatorAddress" id="operatorAddress" lay-verify="title"
                                           autocomplete="off" placeholder=" " class="layui-input">
                                </div>

                            </div>


                            <div class="boxx">
                                <div class="a">
                                    <div class="layui-form-item">
                                        <label class="layui-form-label">邮政编码：</label>
                                        <div class="layui-input-block">
                                            <input type="text" name="operatorZipCode" id="operatorZipCode"
                                                   lay-verify="title" autocomplete="off" placeholder=" "
                                                   class="layui-input">
                                        </div>
                                    </div>
                                </div>

                                <div class="b">
                                    <div class="layui-form-item">
                                        <label class="layui-form-label">组成形式：</label>
                                        <div class="layui-input-block">
                                            <input type="radio" name="organizationType" id="organizationType1"
                                                   value="个人经营" title="个人经营">

                                            <input type="radio" name="organizationType" id="organizationType2"
                                                   value="家庭经营" title="家庭经营">

                                        </div>
                                    </div>
                                </div>

                            </div>
                            <div class="layui-form-item layui-form-text">
                                <label class="layui-form-label">经营范围：</label>
                                <div class="layui-input-block">
                                    <textarea style="border-radius: 10px" placeholder="请输入内容" class="layui-textarea"
                                              id="businessScope" name="businessScope"></textarea>
                                </div>
                            </div>
                            <div class="boxx">

                                <div class="a">
                                    <div class="layui-form-item">
                                        <label class="layui-form-label">注销原因：</label>
                                        <div class="layui-input-block">
                                            <select id="cancellationReason" name="cancellationReason"
                                                    th:with="type=${@dict.getType('gtzxCause')}">
                                                <option value="">请选择</option>
                                                <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
                                                        th:value="${dict.dictValue}">
                                                </option>
                                            </select>
                                        </div>

                                    </div>
                                </div>

                                <div class="b">
                                    <div class="layui-form-item">
                                        <label class="layui-form-label">执照是否丢失：</label>
                                        <div class="layui-input-block" >
                                            <input type="radio" name="businessLicenseExist" id="businessLicenseExist1"
                                                   value="是" title="是">
                                            <input type="radio" name="businessLicenseExist" id="businessLicenseExist2"
                                                   value="否" title="否">
                                        </div>
                                    </div>
                                </div>

                            </div>
                            <div style="padding-left:35%;">
                                <a href="javascript:;">
                                    <button type="button" class="btn_b btn fl" style="width:20%"
                                            onclick="submitInfo('0')">上一步
                                    </button>
                                    <button type="button" class="btn_b btn fl" style="width:20%;background: #009688;"
                                            onclick="submitInfo(1)">下一步
                                    </button>
                                </a>
                            </div>
                        </div>
                        <!-- @*人脸拍照、签字div*@-->
                        <div style="width: 1600px; margin: 0 auto; margin-top: 20px;display:none;" id="rzbddiv">

                            <input type="hidden" name="agentName" id="agentName"/>
                            <input type="hidden" name="agentAddress" id="agentAddress"/>
                            <div class="fl col-lg-4" style="background: #a2dfff; padding-bottom: 35px;">
                                <p class="pai_p">身份证件照</p>
                                <img id="rzdb_SFZ" style="width: 140px; height: 196px; margin-left: 61px;"
                                     src="/Content/images/shua.png">
                                <p class="pai_p">拍照照片</p>
                                <img id="rzdb_pai" width="381px" height="240px" style="margin-left: 61px;"
                                     src="/Content/images/pai.png">
                            </div>
                            <div class="fl col-lg-4" style="background: #ffefcc;">
                                <p class="pai_p">拍照</p>
                                <img style="width: 100%; margin: 0 auto; height: 520px; padding: 10px 0;"
                                     src="/Content/images/pai.png">
                                <p class="centerpai">
                                    <input type="button" id="opencamearbutton" value="打开摄像头" onclick="rzdbCamera(0)"
                                           class="btn-chong" style="margin: 0 auto; width: 120px; height: 50px;"/>
                                </p>
                            </div>
                            <div class="fl col-lg-4"
                                 style="background: #a2dfff; padding-left: 0px; padding-right: 0px;">
                                <p class="pai_p" style="text-align:center;"><span id="right_rytype"></span>签字</p>

                                <img id="sxqianming" height="200px" style="width: 100%; margin: 0 auto;"
                                     src="/Content/images/qian.png">
                                <p class="center ">
                                    <input type="button" id="writeopenButton" value="打开签字板" onclick="open_PenSigner()"
                                           class="btn-chong" style="width: 120px; height: 50px;display: none"/>
                                    <input type="button" id="writeclearButton" value="重签" class="btn-chong"
                                           style="width: 120px; height: 50px; display: none;"
                                           onclick="Clean_PenSigner()"/>
                                    <input type="button" id="writeokButton" value="确认" class="btn-chong"
                                           style="width: 120px; height: 50px; display: none;"
                                           onclick="Close_PenSigner1()"/>
                                </p>
                            </div>
                            <input type="hidden" name="operatorPhoto" id="paizhao"/>
                            <input type="hidden" name="operatorSignature" id="QianMing"/>
                            <input type="hidden" name="qmHid" id="qmHid"/>
                            <input type="hidden" name="operatorAfrScore" id="rzduibiScore" value="0"/>

                            <div class="col-md-12 col-lg-12">
                                <div class="form_item">
                                    <label class="input_label fl" style="width: 40%">&nbsp;</label>
                                    <button type="button" class="btn-fan btn  fl" onclick="duibi(2)"
                                            style="width: 15%; border: 0;">上一步
                                    </button>
                                    <button id="mc_nextxq1" class="btn_b btn fl" type="button"
                                            style="width: 15%; border: 0;"
                                            onclick="duibi(3)">下一步
                                    </button>
                                </div>
                            </div>
                        </div>

                        <!-- @*材料上传div*@-->
                        <div style="width: 1600px; margin: 0 auto; display: none;" id="clscdiv">
                            <div style="padding-top: 30px;">
                                <div class="mainContainer fl col-lg-6">
                                    <img style="width: 100%; margin: 0 auto; height: 550px;"
                                         src="/Content/images/sao.png"/>
                                    <p class="tc" style="margin-bottom: 10px;height:50px;">
                                        <input type="button" id="clscPaibutton" value="拍照" class="btn-chong"
                                               style="margin-left: 0; height: 50px; display: none;"/>
                                    </p>
                                </div>
                                <div class="mainContainer col-lg-6">
                                    <style>
                                        .sc{

                                        }

                                        .navContent a{
                                            color: #ffffff;
                                        }
                                        .xz{
                                            color: blue !important;
                                            text-decoration: underline;

                                        }
                                        .xz:hover{
                                            color: blue !important;
                                            text-decoration: underline;
                                        }
                                    </style>
                                    <div class="navContent" id="cltype" style="float: left;background: #9fbf8d;color: #ffffff;width: 260px;min-height: 130px;height: auto;text-align: center;" >
                                        <div  onclick="changeSFZ(1)"  ><a class="sc xz" style="display: block;width: 100%;font-size: 20px;line-height: 50px;" id="sfz_a1"  >身份证正反面</a></div>
                                        <div  onclick="changeSFZ(2)"><a class="sc" style="display: block;width: 100%;font-size: 20px;line-height: 50px;" id="sfz_a2"   >清税证明</a></div>
                                        <div  onclick="changeSFZ(3)"><a class="sc" style="display: block;width: 100%;font-size: 20px;line-height: 50px;" id="sfz_a3"   >营业执照丢失证明</a></div>
                                    </div>

                                    <script>
                                        var btns = document.getElementsByClassName('sc');
                                        for (var i = 0; i < btns.length; i++) {
                                            btns[i].onclick = function() {
                                                for (var i = 0; i < btns.length; i++) {
                                                    btns[i].className = "sc";
                                                }
                                                this.className = "sc xz";
                                            }
                                        }
                                    </script>
                                    <div class="container1" id="clContainer" style=" float: left;width: 500px;height: 550px;background: #9fbf8d;overflow: auto">
                                        <div id="sfz1" class="secondInfo" style="display: block;">
                                            <p style="font-size: 20px;color: #ffffff;line-height: 50px;">已有【<span id="clscRight1_clnum">0</span>】个扫描件</p>
                                            <input type="hidden" id="hid_sfzz" name="operatorIdCardFront">
                                            <input type="hidden" id="hid_sfzf" name="operatorIdCardBack">
                                            <input type="hidden" id="businessLicenseProve" name="businessLicenseProve">
                                            <input type="hidden" id="clearTaxProve" name="clearTaxProve">
                                            <div class="bannerBox" id="clscRight1"></div>
                                        </div>
                                        <div id="cl2" class="secondInfo" style="display: none;">
                                            <p style="font-size: 20px;color: #ffffff;line-height: 50px;">已有【<span id="clscRight2_clnum">0</span>】个扫描件</p>
                                            <div class="bannerBox" id="clscRight2"></div>
                                        </div>
                                        <div id="cl3" class="secondInfo" style="display: none;">
                                            <p style="font-size: 20px;color: #ffffff;line-height: 50px;">已有【<span id="clscRight3_clnum">0</span>】个扫描件</p>

                                            <div class="bannerBox" id="clscRight3"></div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="col-md-12 col-lg-12">
                                <div class="form_item" style="margin-bottom: 30px;">
                                    <label class="input_label fl" style="width: 40%">&nbsp;</label>
                                    <button type="button" class="btn btn-fan fl" onclick="submitInfo(4);">上一步</button>
                                    <button id="mc_nextxq2" class="btn_b btn fl" type="button" onclick="submitInfo(5);">
                                        提交
                                    </button>
                                </div>
                            </div>
                        </div>


                    </form>
                </div>
                <div class="solid_line_top mb30 mt30" style="width: 100%;"></div>

            </div>
        </div>
    </div>
</div>
<div style="position:absolute;right:5%;bottom:10px;"><span class="fl dao">本页将在300秒后返回首页</span>
    <!--<a  class="btn-fan fl" onclick="duibi('0')" href="/">返回</a> --></div>
<!--<th:block th:include="include :: footer" />-->

<script>


    var info = Get_PCinfo();//获取设备信息
    info = JSON.parse(info);
    $("#applyForSource").val(info.M_Tag);

    function submitInfo(num) {

        if (num == '0') {
            layer.confirm('返回到上一步将丢失本次填写信息,是否返回?', {
                btn: ['确定', '取消'] //按钮
            }, function () {
                window.location.href = "/Ytj/zx"
            }, function () {

            });
        } else if (num == 1) {
            if (!flg){
                layer.msg("请先根据(注册号)或(统一社会信用代码)获取信息")
                return false
            } else if($("#clearFlg").val()=="1"&&$("#clearTaxNumber").val()==""){
                layer.msg("请填写清税文号")
                return false
            }else if ($("#cancellationReason").val() == "") {
                layer.msg("请选择注销原因")
                return false
            }else if (!$("#businessLicenseExist1").prop("checked")&&!$("#businessLicenseExist2").prop("checked")){
                layer.msg("请选择是否丢失执照")
                return false
            }
            rzdbCamera(0)
            $("#operator").css("display", "none");
            $("#rzbddiv").css("display", "block");
        } else if (num == 2) {
            checkLeave();//关闭摄像头
            $("#rzbddiv").css("display", "none");
            $("#operator").css("display", "block");
        } else if (num == 3) {
            if($("#businessLicenseExist1").prop("checked")){
                $("#sfz_a3").show()
            }else {
                $("#sfz_a3").hide()
            }
            if($("#clearTaxNumber").val()==""){
                $("#sfz_a2").hide()
            }else {
                $("#sfz_a2").show()
            }
            changeSFZ("1")
            $("#rzbddiv").css("display", "none");
            $("#clscdiv").css("display", "block");

        } else if (num == 4) {
            checkLeave()
            $("#rzbddiv").css("display", "block");
            $("#clscdiv").css("display", "none");
            $('#opencamearbutton').show();
        } else {
            checkLeave();
            layer.msg('提交中...', {
                icon: 16,
                time : false,
                shade: 0.01
            });
            $.ajax({
                url: "/Ytj/zx/add",
                type: "post",
                data: $("#frm1").serialize(),
                success: function (data) {
                    if (data.code == "0") {

                        window.location.href = "/Ytj/GsYw/sl6";
                    }
                }
            })
        }


    }

</script>

<script>
    layui.use(['form', 'layedit', 'laydate'], function () {
        var form = layui.form
            , layer = layui.layer
            , layedit = layui.layedit
            , laydate = layui.laydate;

        //日期
        laydate.render({
            elem: '#date'
        });
        laydate.render({
            elem: '#date1'
        });
        laydate.render({
            elem: '#date2'
        });
        laydate.render({
            elem: '#date3'
        });
        laydate.render({
            elem: '#date4'
        });
        laydate.render({
            elem: '#date5'
        });
        laydate.render({
            elem: '#date6'
        });
        laydate.render({
            elem: '#date7'
        });
        laydate.render({
            elem: '#date8'
        });
        laydate.render({
            elem: '#date9'
        });

        //创建一个编辑器
        var editIndex = layedit.build('LAY_demo_editor');

        //表单取值
        layui.$('#LAY-component-form-getval').on('click', function () {
            var data = form.val('example');
            alert(JSON.stringify(data));
        });

    });

    function formReset() {
        document.getElementById("frm1").reset();
    }
</script>


</body>
</html>
