<!doctype html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <title>设立</title>
    <link rel="stylesheet" type="text/css" href="/Content/css/bootstrap.min.css">
    <link rel="stylesheet" type="text/css" href="/Content/css/f_cssdz.css">
    <link rel="stylesheet" type="text/css" href="/Content/css/style.css">
    <link href="/Content/css/chuan.css" rel="stylesheet"/>
    <!--材料上传样式-->
    <link href="/Content/css/big-window.css" rel="stylesheet"/>
    <link href="/Content/css/alert.css" rel="stylesheet"/>
    <script src="/Content/Scripts/jquery/jquery-1.8.2.min.js"></script>
    <script src="/Content/Scripts/jquery/jQuery.md5.js"></script>
    <link href="/Content/css/learunui-login.css" rel="stylesheet"/>
    <script src="/Content/Scripts/cookie/jquery.cookie.js"></script>
    <script src="/Content/JS/main.js"></script>
    <script src="/Content/static/js/public.js"></script>
    <script src="/Content/JS/position.data.min.js"></script>
    <script src="/Content/JS/jquery.position.select.js" type="text/javascript"></script>
    <script src="/Content/JS/layer.js"></script>
    <script src="/Content/Scripts/jquery.signalR-1.1.4.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>
    <!--语音-->
    <link href="/Content/css/qh.css" rel="stylesheet"/>
    <script src="/Content/gsJS/rzdb.js"></script>
    <!--人证对比div-->
    <script src="/Content/gsJS/sccl.js"></script>
    <!--上传材料div-->
    <script src="/Content/static/js/sound.js"></script>
    <script src="/Content/JS/alert.js"></script>
    <!--弹出提示-->
    <script src="/Content/JS/alert.min.js"></script>
    <!--弹出提示-->
    <script src="/Content/Scripts/layer-v3.1.1/layer/layer.js"></script>
    <!--承诺书弹框-->
    <link href="/Content/css/checkbox_radio_font.css" rel="stylesheet"/>
    <!--单选按钮、多选按钮-->
    <style>
        .sbxxtl .input_right5 {
            width: 500px;
        }

        .weui_mask {
            position: fixed;
            z-index: 1;
            width: 100%;
            height: 780px;
            top: 240px;
            left: 0;
            background: rgba(0, 0, 0, .6);
        }

        .weui_toast {
            position: fixed;
            z-index: 3;
            width: 15em;
            min-height: 150px;
            top: 556px;
            left: 50%;
            margin-left: -7em;
            background: rgba(40, 40, 40, 0.75);
            text-align: center;
            border-radius: 5px;
            color: #FFFFFF;
            padding-top: 30px;
        }

        .weui_toast_content {
            margin: 15px 0 15px;
        }

        input:-ms-input-placeholder {
            color: #bdbdbd;
        }

        .table-rzdb > tbody > tr > td {
            padding: 6px;
            line-height: 1;
            vertical-align: middle;
        }
    </style>
</head>
<script>
    var conn = $.connection("http://220.195.3.181:9089/myconnection");
    //var conn = $.hubConnection();

    //var hub = conn.createHubProxy("rateHub");
    conn.start().done({jsonp: true});

    function aaa() {
        conn.start().done(function (data) {
            var msg = "123";
            conn.send(msg);//发送给服务器
        });
        //conn.received(function (data) {
        //    $("#rec").append("<li>系统返回值： " + data + "</li>")
        //});
	}
</script>
<script>
    $(function () {
        // var LX = GetQuery('Lx');//企业类型
        var BSID = GetQuery('BSID');
        $("#bsid").val(BSID);
        GetXzqh();//获取行政区划
        GetHangYe();//获取行业信息
        ////------------读取身份证信息---------------//
        function readInfo() {
            m_info = read_info();
            if (m_info) {
                var idInfo = JSON.parse(m_info);//读取身份证
                $('#wtrsfz').val(idInfo.idCardNo);
            }
        }

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

        //------------------------------//
  /*      $("#zczj").numkeyboard({
           keyboardRadix: 1000,//键盘大小基数
           mainbackground: '#C8BFE7', //主背景色
           menubackground: '#4A81B0', //头背景色
           exitbackground: '#4376A0', //关闭按钮背景色
           buttonbackground: '#ff730e', //键盘背景色
           clickeve: true//是否绑定元素click事件
        });
        //从业人数数字键盘
        $("#cyrs").numkeyboard1({
           keyboardRadix: 1000,//键盘大小基数
           mainbackground: '#C8BFE7', //主背景色
           menubackground: '#4A81B0', //头背景色
           exitbackground: '#4376A0', //关闭按钮背景色
           buttonbackground: '#ff730e', //键盘背景色
           clickeve: true//是否绑定元素click事件
        });*/

        //GetCardUser();
    });

    /*
        function GetCardUser() {
            $.ajax({
                url: "GetUserCard?bsid=" + $("#bsid").val(),
                //url: "GetUserCard?hm=130124198405294513",
                type: "get",
                dataType: 'json',
                data: "{}",
                cache: false,
                success: function (data) {
                    if (data != "" && data != null) {
                        if (data.qyxx.Table.length > 0) {
                            //$("#jyzdh").val(data.djry.Table[0].sjhm);
                        }
                        if (data.djxx.Table.length > 0)
                        {

                        }
                    }
                },
                error: function (XMLHttpRequest, textStatus, errorThrown) {
                    jqueryAlert({
                        'icon': '/Content/images/warning.png',
                        'content': '数据加载失败',
                        'closeTime': 4000,
                    })
                }
            });
        }*/

    function GetXzqh() {
        $.ajax({
            url: "GetQh",
            type: "get",
            dataType: 'json',
            success: function (data) {
                if (data != "" && data != null) {
                    for (var i = 0; i < data.length; i++) {
                        $("#jycsz").append("<option value=\"" + data[i].DataDictionaryDetailId + "\">" + data[i].FullName + "</option>");
                    }
                }
            },
            error: function (XMLHttpRequest, textStatus, errorThrown) {
                jqueryAlert({
                    'icon': '/Content/images/warning.png',
                    'content': '数据加载失败',
                    'closeTime': 4000,
                })
            }
        });
    }

    function GetXc(obj) {
        $.ajax({
            url: "GetQu?pid=" + obj,
            type: "get",
            dataType: 'json',
            success: function (data) {
                if (data != "" && data != null) {
                    $("#jycsc").empty();
                    $("#jycsc").append("<option value=\"\">请选择</option>");
                    for (var i = 0; i < data.length; i++) {
                        $("#jycsc").append("<option value=\"" + data[i].DataDictionaryDetailId + "\">" + data[i].FullName + "</option>");
                    }
                }
            },
            error: function (XMLHttpRequest, textStatus, errorThrown) {
                jqueryAlert({
                    'icon': '/Content/images/warning.png',
                    'content': '数据加载失败',
                    'closeTime': 4000,
                })
            }
        });
    }

    function GetHangYe() {
        $.ajax({
            url: "GetHy",
            type: "get",
            dataType: 'json',
            success: function (data) {

                if (data != "" && data != null) {
                    for (var i = 0; i < data.length; i++) {
                        $("#HY1").append("<option value=\"" + data[i].DataDictionaryDetailId + "\">" + data[i].FullName + "</option>");
                    }
                }
            },
            error: function (XMLHttpRequest, textStatus, errorThrown) {
                jqueryAlert({
                    'icon': '/Content/images/warning.png',
                    'content': '数据加载失败',
                    'closeTime': 4000,
                })
            }
        });
    }

    //var positiondata = "";
    function GetHangYe2(obj) {
        $("#result").val("");
        $("#ccbj").val("0");
        $("#yxmc").html("");
        //$("#zzxxdiv").hide();
        //$("#hymcdiv").hide();
        $.ajax({
            url: "GetChildHy?pid=" + obj,
            type: "get",
            dataType: 'text',
            success: function (data) {
                $("#positionDiv").empty();
                if (data != "" && data != null) {
                    positiondata = data;
                    if ($("#qhzh").val() == "0") {
                        $("#positionDiv").css("margin", "-280px 0 0 -490px");
                    } else {
                        $("#positionDiv").css("margin", "-280px 0 0 -490px");
                    }
                    $("#result").positionSelect({
                        containerId: "positionDiv",
                        className: "big-window",
                        nameId: "result"
                    });
                }
            },
            error: function (XMLHttpRequest, textStatus, errorThrown) {
                jqueryAlert({
                    'icon': '/Content/images/warning.png',
                    'content': '数据加载失败',
                    'closeTime': 4000,
                })
            }
        });
    }

    function GetHangYe3() {
        if ($("#HY1").val() != "") {
            GetHangYe2($("#HY1").val());
        } else {
            jqueryAlert({
                'icon': '/Content/images/warning.png',
                'content': '请先选择行业分类',
                'closeTime': 4000,
            })
        }
    }

    function GetXx(obj) {
        if ($("#result").val() != "") {
            $.ajax({
                url: "GetZzxx?pid=" + encodeURI($("#result").val()),
                type: "get",
                dataType: 'json',
                data: "{}",
                success: function (data) {
                    if (data != "" && data != null) {
                        $("#zzxxdiv").show();
                        $("#zzxx").val("");
                        var str = "<div id=\"blk3\" class=\"blk\">";
                        str += "<div class=\"head\"><div class=\"head-right\"></div></div>";
                        str += "<div class=\"main\">";
                        str += "<ul id=\"zzxxlist\">";
                        $.each(data.Table, function (i, item) {
                            str += "<li><a href=\"javascript:GetName1('" + data.Table[i].FullName + "')\">" + data.Table[i].FullName + "</a></li>";
                        });
                        str += "</ul>";
                        str += "</div>";
                        str += "<div class=\"foot\"><div class=\"foot-right\"></div></div>";
                        str += "</div>";
                        layer.open({
                            type: 1,
                            title: "请选择组织形式",
                            area: ['800px', '400px'],
                            shade: 0,
                            shadeClose: true, //点击遮罩关闭
                            closeBtn: 0,
                            btn: ['关闭'], //只是为了演示
                            yes: function () {
                                layer.close(layer.index);
                            },
                            content: str
                        });
                    }
                },
                error: function (XMLHttpRequest, textStatus, errorThrown) {
                    jqueryAlert({
                        'icon': '/Content/images/warning.png',
                        'content': '数据加载失败',
                        'closeTime': 4000,
                    })
                }
            });
        } else {
            jqueryAlert({
                'icon': '/Content/images/warning.png',
                'content': '请选择行业分类子项',
                'closeTime': 4000,
            })
        }
    }

    function CheckStep() {
        var myReg = /^[\u4e00-\u9fa5]+$/;
        if ($("#hmc").val() == "") {
            jqueryAlert({
                'icon': '/Content/images/warning.png',
                'content': '请先填写中文字号（默认），并选择行业分类',
                'closeTime': 4000,
            });
            return false;
        }
        if ($("#zwzh1").val() == "") {
            jqueryAlert({
                'icon': '/Content/images/warning.png',
                'content': '默认中文字号不能为空',
                'closeTime': 4000,
            });
            return false;
        }
        if ($("#zwzh1").val().length < 2 || $("#zwzh1").val().length > 5) {
            jqueryAlert({
                'icon': '/Content/images/warning.png',
                'content': '默认字号长度为2-5个汉字',
                'closeTime': 4000,
            });
            return false;
        }
        if ($("#zwzh2").val() == "") {
            jqueryAlert({
                'icon': '/Content/images/warning.png',
                'content': '中文字号（备选1）不能为空',
                'closeTime': 4000,
            });
            return false;
        }
        if ($("#zwzh2").val().length < 2 || $("#zwzh2").val().length > 5) {
            jqueryAlert({
                'icon': '/Content/images/warning.png',
                'content': '中文字号（备选1）长度为2-5个汉字',
                'closeTime': 4000,
            });
            return false;
        }
        if ($("#zwzh3").val() == "") {
            jqueryAlert({
                'icon': '/Content/images/warning.png',
                'content': '中文字号（备选2）不能为空',
                'closeTime': 4000,
            });
            return false;
        }
        if ($("#zwzh3").val().length < 2 || $("#zwzh3").val().length > 5) {
            jqueryAlert({
                'icon': '/Content/images/warning.png',
                'content': '中文字号（备选2）长度为2-5个汉字',
                'closeTime': 4000,
            });
            return false;
        }
        //if ($("#zwzh4").val() == "") {
        //    jqueryAlert({
        //        'icon': '/Content/images/warning.png',
        //        'content': '中文字号（备选3）不能为空',
        //        'closeTime': 4000,
        //    })
        //    return false;
        //}
        //if ($("#zwzh4").val().length < 2 || $("#zwzh4").val().length > 5) {
        //    jqueryAlert({
        //        'icon': '/Content/images/warning.png',
        //        'content': '中文字号（备选3）长度为2-5个汉字',
        //        'closeTime': 4000,
        //    })
        //    return false;
        //}
        if (!myReg.test($("#zwzh1").val())) {
            jqueryAlert({
                'icon': '/Content/images/warning.png',
                'content': '中文字号（默认）只能是汉字',
                'closeTime': 4000,
            });
            return false;
        }
        if (!myReg.test($("#zwzh2").val())) {
            jqueryAlert({
                'icon': '/Content/images/warning.png',
                'content': '中文字号（备选1）只能是汉字',
                'closeTime': 4000,
            });
            return false;
        }
        if (!myReg.test($("#zwzh3").val())) {
            jqueryAlert({
                'icon': '/Content/images/warning.png',
                'content': '中文字号（备选2）只能是汉字',
                'closeTime': 4000,
            });
            return false;
        }
        if (!IsTongMing()) {
            return false;
        }
        //if (!myReg.test($("#zwzh4").val())) {
        //    jqueryAlert({
        //        'icon': '/Content/images/warning.png',
        //        'content': '中文字号（备选3）只能是汉字',
        //        'closeTime': 4000,
        //    })
        //    return false;
        //}
        if ($("#HY1").val() == "" || $("#result").val() == "") {
            jqueryAlert({
                'icon': '/Content/images/warning.png',
                'content': '请选择行业分类',
                'closeTime': 4000,
            });
            return false;
        }
        if ($("#hymc").val() == "") {
            jqueryAlert({
                'icon': '/Content/images/warning.png',
                'content': '请选择名称行业',
                'closeTime': 4000,
            });
            return false;
        }
        if ($("#zzxx").val() == "") {
            jqueryAlert({
                'icon': '/Content/images/warning.png',
                'content': '请选择组织形式',
                'closeTime': 4000,
            });
            return false;
        }
        return true;
    }

    function ChooseFw() {
        var a = $("#result").val();
        a = a.split("-");
        $.ajax({
            url: "GetFw?a=" + encodeURI(a[1]),
            type: "get",
            dataType: 'text',
            data: "{}",
            success: function (data) {
                if (data != "" && data != null) {
                    $("#positionDiv1").empty();
                    if (data != "1") {
                        positiondata = data;
                        $("#jyfw").positionSelect({
                            containerId: "positionDiv1",
                            className: "big-window",
                            nameId: "jyfw",
                            maxCount: 99
                        });
                    } else {
                        jqueryAlert({
                            'icon': '/Content/images/warning.png',
                            'content': '未配置经营范围，请手动填写',
                            'closeTime': 4000,
                        })
                    }
                }
            },
            error: function (XMLHttpRequest, textStatus, errorThrown) {
                jqueryAlert({
                    'icon': '/Content/images/warning.png',
                    'content': '数据加载失败',
                    'closeTime': 4000,
                })
            }
        });
    }

    function go_step(flg) {
        if (flg != "3" && flg != "4") {
            $("#returnSY").removeAttr("onclick");
            $("#returnSY").attr("href", "/Ytj/qygsdz");
        }
        if (flg == "1") {
            $("#tpmcxx").addClass("selected");
            //$("#mcxzdiv").show();
            $("#mcxxdiv").show();
            $("#tpqyxx").removeClass("selected");
            $("#qyxxdiv").hide();
        }
        if (flg == "2") {
            if (CheckForm()) {
                $("#tpmcxx").removeClass("selected");
                //$("#mcxzdiv").hide();
                $("#mcxxdiv").hide();
                $("#tprzbd").removeClass("selected");
                $("#rzbddiv").hide();
                $("#tpqyxx").addClass("selected");
                $("#qyxxdiv").show();
            }
        }
        if (flg == "t") {
            SubMit();
        }
    }

    function CheckForm() //表单提交验证
    {
        var reg = /^[0-9]+(\.[0-9]+)?$/;
        //if ($("#hzwh").val() == "") {
        //    jqueryAlert({
        //        'icon': '/Content/images/warning.png',
        //        'content': '请填写预先核准书文号',
        //        'closeTime': 4000,
        //    })
        //    return false;
        //}
/*        if ($("#nh").val() == "") {
            jqueryAlert({
                'icon': '/Content/images/warning.png',
                'content': '请补充完整预先核准书文号',
                'closeTime': 4000,
            });
            return false;
        }
        if ($("#xh").val() == "") {
            jqueryAlert({
                'icon': '/Content/images/warning.png',
                'content': '请补充完整预先核准书文号',
                'closeTime': 4000,
            });
            return false;
        }*/
        $("#hzwh").val("（" + $("#hzlx").val() + "）登记内名预核字【" + $("#nh").val() + "】" + $("#xh").val() + "号");
        if ($("#qymc").val() == "") {
            jqueryAlert({
                'icon': '/Content/images/warning.png',
                'content': '请填写企业名称',
                'closeTime': 4000,
            });
            return false;
        }
        if ($("#qylx").val() == "") {
            jqueryAlert({
                'icon': '/Content/images/warning.png',
                'content': '请选择企业类型',
                'closeTime': 4000,
            });
            return false;
        }
        if ($("#cxbj").val() == "") {
            jqueryAlert({
                'icon': '/Content/images/warning.png',
                'content': '请选择城乡标记',
                'closeTime': 4000,
            });
            return false;
        }
        if ($("#jyqx").val() == "") {
            jqueryAlert({
                'icon': '/Content/images/warning.png',
                'content': '请选择经营期限',
                'closeTime': 4000,
            });
            return false;
        }
        if ($("#jyqx").val() == "有效年" && $("#jynx").val() == "") {
            jqueryAlert({
                'icon': '/Content/images/warning.png',
                'content': '请填写经营年限',
                'closeTime': 4000,
            });
            return false;
        }
        if ($("#zczj").val() == "") {
            jqueryAlert({
                'icon': '/Content/images/warning.png',
                'content': '请填写注册资金',
                'closeTime': 4000,
            });
            return false;
        }
        if (!reg.test($("#zczj").val())) {
            jqueryAlert({
                'icon': '/Content/images/warning.png',
                'content': '资金数额只能输入数字',
                'closeTime': 4000,
            });
            return false;
        }
        if ($("#zczj").val() == "0") {
            jqueryAlert({
                'icon': '/Content/images/warning.png',
                'content': '资金数额不能为0',
                'closeTime': 4000,
            });
            return false;
        }
        if ($("#zscq").val() == "") {
            jqueryAlert({
                'icon': '/Content/images/warning.png',
                'content': '请选择住所产权',
                'closeTime': 4000,
            });
            return false;
        }
        if ($("#zsxz").val() == "") {
            jqueryAlert({
                'icon': '/Content/images/warning.png',
                'content': '请选择住所性质',
                'closeTime': 4000,
            });
            return false;
        }
        var regphone = /^(13[0-9]|14[5-9]|15[0123456789]|166|17[0-8]|18[0-9]|19[8-9])[0-9]{8}$/;
        var phonenum = $('#lxdh').val();
        if (phonenum == '') {
            jqueryAlert({
                'icon': '/Content/images/warning.png',
                'content': '联系电话不能为空',
                'closeTime': 4000,
            });
            return false;
        } else if (regphone.test(phonenum) === false) {
            jqueryAlert({
                'icon': '/Content/images/warning.png',
                'content': '请填写正确的联系电话',
                'closeTime': 4000,
            });
            return false;
        }
        if ($("#cyrs").val() == "") {
            jqueryAlert({
                'icon': '/Content/images/warning.png',
                'content': '请输入从业人数',
                'closeTime': 4000,
            });
            return false;
        }
        if (!reg.test($("#cyrs").val())) {
            jqueryAlert({
                'icon': '/Content/images/warning.png',
                'content': '从业人数只能输入数字',
                'closeTime': 4000,
            });
            return false;
        }
        //if ($("#jycsz").val() == "") {
        //    jqueryAlert({
        //        'icon': '/Content/images/warning.png',
        //        'content': '请选择经营场所所在乡镇',
        //        'closeTime': 4000,
        //    })
        //    return false;
        //}
        //if ($("#jycsc").val() == "") {
        //    jqueryAlert({
        //        'icon': '/Content/images/warning.png',
        //        'content': '请选择经营场所所在村街',
        //        'closeTime': 4000,
        //    })
        //    return false;
        //}
        if ($("#xxdz").val() == "") {
            jqueryAlert({
                'icon': '/Content/images/warning.png',
                'content': '请填写企业住所',
                'closeTime': 2000,
            });
            return false;
        }
        if ($("#result").val() == "") {
            jqueryAlert({
                'icon': '/Content/images/warning.png',
                'content': '请选择行业分类',
                'closeTime': 2000,
            });
            return false;
        }
        if ($("#jyfw").val() == "") {
            jqueryAlert({
                'icon': '/Content/images/warning.png',
                'content': '请填写经营范围',
                'closeTime': 4000,
            });
            return false;
        }


        return true;
    }

    //表单提交验证--党建信息
    function CheckForm_Dj() {
        if ($("#djzz").val() == "") {
            jqueryAlert({
                'icon': '/Content/images/warning.png',
                'content': '请选择是否有党建组织',
                'closeTime': 4000,
            });
            return false;
        }
        if ($("#djzz").val() == "1") {
            if ($("#dzzjz").val() == "") {
                jqueryAlert({
                    'icon': '/Content/images/warning.png',
                    'content': '请选择党组织建制',
                    'closeTime': 4000,
                });
                return false;
            }
            if ($("#zjxx").val() == "") {
                jqueryAlert({
                    'icon': '/Content/images/warning.png',
                    'content': '请选择党组织组建形式',
                    'closeTime': 4000,
                });
                return false;
            }
            if ($("#jlsj").val() == "") {
                jqueryAlert({
                    'icon': '/Content/images/warning.png',
                    'content': '请填写党组织建立时间',
                    'closeTime': 4000,
                });
                return false;
            }
            if ($("#zzbz").val() == "") {
                jqueryAlert({
                    'icon': '/Content/images/warning.png',
                    'content': '请选择组织标志',
                    'closeTime': 4000,
                });
                return false;
            }
            if ($("#sjbz").val() == "") {
                jqueryAlert({
                    'icon': '/Content/images/warning.png',
                    'content': '请选择书记标志',
                    'closeTime': 4000,
                });
                return false;
            }
            if ($("#dyrs").val() == "") {
                jqueryAlert({
                    'icon': '/Content/images/warning.png',
                    'content': '请填写党员人数',
                    'closeTime': 4000,
                });
                return false;
            }
        }
        if ($("#dybz").val() == "") {
            jqueryAlert({
                'icon': '/Content/images/warning.png',
                'content': '请选择党员标志',
                'closeTime': 4000,
            });
            return false;
        }
        return true
    }

    function SubMit() //提交数据
    {
        if (CheckForm()) {
            //var zzHidvalue = "";
            //var a = $("#zhengzhao tr td input[type='checkbox']:checked").length;
            //$('#zhengzhao tr td input[type="checkbox"]:checked').each(function () {
            //    var sfruit = $(this).val();
            //    zzHidvalue += sfruit + ",";
            //});
            //$("#zzHid").val(zzHidvalue);

            //voicezdyStr('保存中，请等待');
            //$("#toast p.weui_toast_content").html("保存中，请等待");
            //$("#toast").show();
            try {
                var url = "SubmitForm";
                $.ajax({
                    "url": url,
                    "data": $("#form1").serialize(),
                    "type": "post",
                    "dataType": "json",
                    "success": function (rtnData) {
                        if (rtnData.code == 0) {
                            //$("#toast").hide();
                            //window.location.href = "../Print/Index?bsm="+$("#bsid").val();
                            if ($("#qylx").val() == "有限责任公司（自然人独资）") {
                                window.location.href = "Ryxinxi?bsid=" + $("#bsid").val() + "&qytype=0";
                            } else if($("#qylx").val() == "个人独资企业"){
                                window.location.href = "Ryxinxi?bsid=" + $("#bsid").val() + "&qytype=2";
                            }else {
                                window.location.href = "Ryxinxi?bsid=" + $("#bsid").val() + "&qytype=1";
                            }
                        } else {
                            $("#toast").hide();
                            jqueryAlert({
                                'icon': '/Content/images/warning.png',
                                'content': '保存失败',
                                'closeTime': 4000,
                            })
                        }
                    }, "error": function () {
                        jqueryAlert({
                            'icon': '/Content/images/warning.png',
                            'content': '保存失败',
                            'closeTime': 4000,
                        })
                    }
                });
            } catch (e) {
                $("#toast").hide();
                jqueryAlert({
                    'icon': '/Content/images/warning.png',
                    'content': '保存失败',
                    'closeTime': 4000,
                });
                return false;
            }
        }
    }

    //获取输入法
    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;
            }
        );
    }

    //数字输入法
    function imeNum(eleID) {
        var info = document.getElementById(eleID).value;
        //info 数字字符串
        //imetype 1是密码，2是身份证，3是数字
        //length 是输入的长度
        var param = {};
        param.info = info;
        param.imetype = 3;
        param.length = 16;
        //console.log(param);
        var data = JSON.stringify(param);
        send_command(
            "ime_number",
            data,
            function (receivedData) {
                var data = JSON.parse(receivedData);
                document.getElementById(eleID).value = data.msg;
            }
        );
    }

    function CloseDive(did) {
        $("#" + did + "").hide();
    }

    function GetGet() {
        if ($("#result").val() != "") {
            $("#ccbj").val("0");
            $("#yxmc").html("");
            $.ajax({
                url: "GetHymc?pid=" + encodeURI($("#result").val()),
                type: "get",
                dataType: 'json',
                data: "{}",
                success: function (data) {
                    if (data != "" && data != null) {
                        $("#hymcdiv").show();
                        $("#hymc").val("");
                        var str = "<div id=\"blk2\" class=\"blk\">";
                        str += "<div class=\"head\"><div class=\"head-right\"></div></div>";
                        str += "<div class=\"main\">";
                        str += "<ul id=\"hymclist\">";
                        $.each(data.Table, function (i, item) {
                            str += "<li><a href=\"javascript:GetName('" + data.Table[i].FullName + "')\">" + data.Table[i].FullName + "</a></li>";
                        });
                        str += "</ul>";
                        str += "</div>";
                        str += "<div class=\"foot\"><div class=\"foot-right\"></div></div>";
                        str += "</div>";
                        layer.open({
                            type: 1,
                            title: "请选择名称行业",
                            area: ['800px', '400px'],
                            shade: 0,
                            shadeClose: true, //点击遮罩关闭
                            closeBtn: 0,
                            btn: ['关闭'], //只是为了演示
                            yes: function () {
                                layer.close(layer.index);
                            },
                            content: str
                        });
                    }
                },
                error: function (XMLHttpRequest, textStatus, errorThrown) {
                    alert("数据加载失败")
                }
            });
        } else {
            jqueryAlert({
                'icon': '/Content/images/warning.png',
                'content': '请选择行业分类子项',
                'closeTime': 4000,
            })
        }
    }

    function sfynx(obj) {
        if (obj.value == "有效年") {
            $("#jynx").css("display", "");
            $("#nn").css("display", "");
        } else {
            $("#jynx").css("display", "none");
            $("#nn").css("display", "none");
        }
    }

    function checkjc(obj) {
        $("#sfjc").val(obj.value);
    }

    function checkdj(obj) {
        if (obj.value == "1") {
            $("#ydjdiv").css("display", "");
        } else {
            $("#ydjdiv").css("display", "none");
        }
        $("#djzz").val(obj.value);
    }

    function checkqt(obj, bq) {
        $("#" + bq + "").val(obj.value);
    }

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

        $.ajax({
            "cache":false,
            "url" : "/Ytj/qygsdz/qyxinxi?card="+$("#wtrsfz").val(),
            "type" : "GET",
            "dataType" : "json",
            "success" : function(json) {
                if(json.code==0){
                    var data= json.data;
                    if(data.qylx=="有限责任公司（自然人独资）"||data.qylx=="个人独资企业") {
                        $("#qymc").val(data.qyname);
                        $("#zczj").val(data.qyzczj);
                        $("#zczj").val(data.qyzczj);
                        $("#lxdh").val(data.qylxdh);
                        $("#yzbm").val(data.qyyoujifs);
                        $("#cyrs").val(data.qycyrs);
                        $("#jyfw").val(data.qyjyfw);
                        $("#frname").val(data.frname);
                        if(data.qylx=="个人独资企业"){
                            $("#qylx2").attr("selected",true);
                            $("#qylx1").attr("selected",false);
                        }else{
                            $("#qylx2").attr("selected",false);
                            $("#qylx1").attr("selected",true);
                        }
                        if (data.qyjyqx == "长期") {
                            $("#jyqx option:eq(0)").attr("selected", "selected");
                        } else {
                            $("#jyqx option:eq(1)").attr("selected", "selected");
                            $("#jynx").val(data.qynx);
                            $("#jynx").css("display", "");
                            $("#nn").css("display", "");
                        }
                        if (data.qyss == "城镇") {
                            $("#cxbj option:eq(1)").attr("selected", "selected");
                        } else {
                            $("#cxbj option:eq(2)").attr("selected", "selected");
                        }
                        if (data.jycscq == "自有") {
                            $("#zscq option:eq(1)").attr("selected", "selected");
                        } else if (data.jycscq == "租赁") {
                            $("#zscq option:eq(2)").attr("selected", "selected");
                        } else if (data.jycscq == "无偿使用") {
                            $("#zscq option:eq(3)").attr("selected", "selected");
                        } else if (data.jycscq == "其他") {
                            $("#zscq option:eq(4)").attr("selected", "selected");
                        }
                        if (data.jycsxz == "住宅") {
                            $("#zsxz option:eq(1)").attr("selected", "selected");
                        } else {
                            $("#zsxz option:eq(2)").attr("selected", "selected");
                        }
                        $("#sfjc").val(data.isjc);
                        $("#nh").val(data.qyhezhun.substring(data.qyhezhun.indexOf("【") + 1, data.qyhezhun.indexOf("】")));
                        $("#xh").val(data.qyhezhun.substring(data.qyhezhun.indexOf("】") + 1, data.qyhezhun.indexOf("号")));


                        $("#xxdz").val(data.qyjycs.substr(11));
                        $("#IsHere").val(1);
                    }
                }
            }
        });
	}

</script>
<body>
<header>
    <h2 class="title fl tit-con"th:text="${city}+'行政审批局企业业务自助终端'"></h2>
    <a id="returnSY" class="fr fan" href="/Ytj/qygsdz">返回首页</a>
</header>
<div class="content">
    <div class="bg_white">
        <div class="step_section" style="width: 1600px;">
            <div class="step_item selected" style="width: 189px;" id="tpmcxx">
                <div class="step_item_icon_arrow"></div>
                企业信息
            </div>
            <div class="step_item  " style="width: 189px;" id="tpqyxx">
                <div class="step_item_icon_arrow"></div>
                党建信息
            </div>
            <div class="step_item" style="width: 189px;" id="tprzbd">
                <div class="step_item_icon_arrow"></div>
                人员信息
            </div>
            <div class="step_item" style="width: 190px;" id="tpqrtj">
                <div class="step_item_icon_arrow"></div>
                确认提交
            </div>
            <div class="step_item" style="width: 190px;" id="blwctj">
                <div class="step_item_icon_arrow"></div>
                办理完成
            </div>
        </div>
        <form id="form1" name="form1">
            <input id="IsHere" name="IsHere" type="hidden" value="0"/>
            <input id="frname" name="frname" type="hidden"/>
            <input id="bsid" name="bsid" type="hidden"/>

            <input id="xxly" name="laiyuan" type="hidden"/>
            <input id="xgflg" name="xgflg" type="hidden" value="0"/>
            <input id="qhzh" name="qhzh" type="hidden" value="0"/>
            <input id="jyzxm" name="jyzxm" type="hidden"/>
            <input id="jyzdh" name="jyzdh" type="hidden"/>
            <input id="jyzxb" name="jyzxb" type="hidden"/>
            <input id="jyzmz" name="jyzmz" type="hidden"/>
            <input id="jyzsr" name="jyzsr" type="hidden"/>
            <input id="jyzzz" name="jyzzz" type="hidden"/>
            <input id="sfzjg" name="sfzjg" type="hidden"/>
            <input id="wtrsfz" name="wtrsfz" type="hidden"/>
            <!--                @*名称信息div*@-->
            <div class="content_960_b" style="border-top: none;" id="mcxxdiv">
                <div class="con_900">
                    <div class="sbxxtl">
                        <div class="sbxxtl_title mb20"><font color="red">提示：填写前，请先到以下网址进行名称核准：http://www.hebscztxyxx.gov.cn:8001/bsdt/passport/loginOuter</font>扫码访问：<img
                                src="/Content/images/ecode.png" width="90px" height="90px"/></div>
                        <div class="form_item">
                            <label class="input_label">预先核准书文号：</label>
                            <div class="input_right" style="width: 430px">
                                <select checktitle="核准书类型" style="width: 57px; height: 44px;" id="hzlx" name="hzlx">
                                    <option value="宁">宁</option>
                                </select><input type="hidden" id="hzwh" name="hzwh" placeholder="（）登记内名预核字【2018】**** 号"
                                                maxlength="30" class="txt" style="width: 357px;">
                                登记内名预核字【<input type="text" id="nh" name="nh" class="txt" style="width: 60px;"
                                               onclick="imeNum('nh')"/>】<input type="text" id="xh" name="xh" class="txt"
                                                                               style="width: 60px;"
                                                                               onclick="imeNum('xh')"/>&nbsp;号
                            </div>
                            <label class="input_label"><span class="fred">*</span>企业名称：</label>
                            <div class="input_right">
                                <input type="text" id="qymc" name="qyname" class="txt" style="width: 357px;"
                                       onclick="imeOpen('qymc')">
                            </div>

                        </div>
                        <div class="form_item">
                            <label class="input_label"><span class="fred">*</span>企业类型：</label>
                            <div class="input_right">
                                <select checktitle="城乡标记" style="width: 357px; height: 44px;" id="qylx" name="qylx" >
                                <option th:if="${type=='grdz'}" style="width: 357px;"readonly="readonly" value="个人独资企业" id="qylx2" >个人独资企业</option>
                                <option th:if="${type=='zrrdz'}" style="width: 357px;"readonly="readonly" id="qylx1" value="有限责任公司（自然人独资）">有限责任公司（自然人独资）</option>
                                </select>
                            </div>
                            <label class="input_label"><span class="fred">*</span>城乡标记：</label>
                            <div class="input_right">
                                <select checktitle="城乡标记" style="width: 357px; height: 44px;" id="cxbj" name="cxbj">
                                    <option value="">请选择</option>
                                    <option value="城镇">城镇</option>
                                    <option value="农村">农村</option>
                                </select>
                            </div>
                        </div>
                        <div class="form_item">
                            <label class="input_label"><span class="fred">*</span>经营年限：</label>
                            <div class="input_right">
                                <select   checktitle="经营年限" style="width: 260px; height: 44px;" onchange="sfynx(this)"
                                        id="jyqx" name="qyjyqx">
                                    <option value="长期">长期</option>
                                    <option value="有效年">有效年</option>
                                </select>
                                <div></div>
                                <input type="text" class="txt" style="width: 57px; display: none" value="20" id="jynx"
                                       name="qynx" onclick="imeNum('jynx')">
                                <b id="nn" style="display: none">年</b>
                            </div>

                            <label class="input_label"><span class="fred">*</span>注册资金：</label>
                            <div class="input_right">
                                <input type="text" class="txt" style="width: 180px;" id="zczj" name="qyzczj"
                                       onclick="imeNum('zczj')">
                                <b>万元</b> <span class="input_info"
                                                style="clear: both; display: none; left: 395px; top: 0px;">注册资本币种为人民币，单位为<b>万元</b>（请填写阿拉伯数字）。
										<p></p>
                                    </span>
                            </div>
                        </div>
                        <div class="form_item">
                            <label class="input_label"><span class="fred">*</span>住所产权：</label>
                            <div class="input_right">
                                <select checktitle="住所产权" style="width: 357px; height: 44px;" id="zscq" name="jycscq">
                                    <option value="">请选择</option>
                                    <option value="自有">自有</option>
                                    <option value="租赁">租赁</option>
                                    <!--  <option value="无偿使用">无偿使用</option>
                                    <option value="其他">其他</option>-->
                                </select>
                            </div>

                            <label class="input_label"><span class="fred">*</span>住所性质：</label>
                            <div class="input_right">
                                <select checktitle="住所性质" style="width: 357px; height: 44px;" id="zsxz" name="zsxz">
                                    <option value="">请选择</option>
                                    <option value="住宅">住宅</option>
                                    <option value="商用">商用</option>
                                </select>
                            </div>
                        </div>
                        <div class="form_item">
                            <label class="input_label"><span class="fred">*</span>联系电话：</label>
                            <div class="input_right">
                                <input type="text" id="lxdh" name="lxdh" class="txt" style="width: 357px;"
                                       onclick="imeNum('lxdh')">
                            </div>

                            <label class="input_label">邮政编码：</label>
                            <div class="input_right">
                                <input type="text" id="yzbm" name="yzbm" class="txt" style="width: 357px;"
                                       value="050000" onclick="imeNum('yzbm')">
                            </div>
                        </div>
                        <div class="form_item">
                            <label class="input_label" style="display: none"><span class="fred">*</span>雇工人数：</label>
                            <div class="input_right" style="display: none">
                                <input type="text" class="txt" style="width: 180px;" id="gyrs" name="gyrs" value="0"/>
                                <b>人</b>
                            </div>
                            <label class="input_label"><span class="fred">*</span>是否军产：</label>
                            <div class="input_right">
                                <label>
                                    <input name="isjc" type="radio" value="0" style="margin-left: 10px;"
                                           onclick="checkjc(this)" checked/><i class="fa fa-2x icon-radio"></i>否</label>
                                <label style="margin-left: 40px;">
                                    <input name="isjc" type="radio" value="1" onclick="checkjc(this)"/><i
                                        class="fa fa-2x icon-radio"></i>是</label>
                                <input type="hidden" name="sfjc" id="sfjc" value="0">
                            </div>
                            <label class="input_label"><span class="fred">*</span>从业人数：</label>
                            <div class="input_right">
                                <input type="text" class="txt" style="width: 180px;" id="cyrs" name="qycyrs"
                                       onclick="imeNum('cyrs')"/>
                                <b>人</b>
                            </div>
                        </div>
                        <div class="form_item">
                            <label class="input_label"><span class="fred">*</span>企业住所：</label>
                            <div class="input_right" style="width: 1200px;">
                                <select checktitle="拟设立市场主体所在地~!" style="width: 118px;" id="xzq" name="xzq">
                                    <option th:value="${city}" th:text="${city}"></option>
                                </select>
                               <!-- <input name="jycsz" class="txt" id="jycsz" placeholder="所在乡镇" style="width:118px;" onchange="imeOpen('jycsz')">
                                </input>
                                <input name="jycsc" class="txt" id="jycsc" placeholder="所在村" style="width:168px;"onchange="imeOpen('jycsz')">
                                </input>-->
                                <input type="text" id="xxdz" name="xxdz" class="txt" style="width: 370px"
                                       onclick="imeOpen('xxdz')" value="" checktitle="住所所在地详细地址!" placeholder="街道/门牌号">
                                <span class="input_info" style="display: none; left: 545px;">请输入住所详细地址</span>
                            </div>
                        </div>
                        <div class="form_item">
                            <label class="input_label"><span class="fred">*</span>行业分类：</label>
                            <div class="input_right" style="width: 1200px;">
                                <select name="HY1" id="HY1" checktitle="行业大类~!" style="width: 357px; height: 44px;"
                                        onchange="GetHangYe2(this.value)">
                                    <option value="">请选择</option>
                                </select>&nbsp;
                                <input type="text" name="result" id="result" value="" checktitle="" maxlength="100"
                                       class="txt" style="width: 457px;" onclick="GetHangYe3()" readonly="true">
                                <div id="positionDiv">
                                </div>
                            </div>
                        </div>
                        <div class="form_item">
                            <label class="input_label"><span class="fred">*</span>经营范围：</label>
                            <div class="input_right" style="width: 1200px;">
                                <textarea style="border: 1px solid #d4d7d9;" rows="2" cols="85"
                                          onclick="imeOpen('jyfw')" id="jyfw" name="qyjyfw"></textarea>
                            </div>
                        </div>
                        <div class="solid_line_top mb30 mt30" style="margin-top: 3px;margin-bottom: 3px;"></div>
                        <div class="form_item">
                            <label class="input_label" style="width: 40%;">&nbsp;</label>
                <!--            <button type="button" class="btn btn-fan fl" onclick="goBack();">上一步</button>-->
                            <button id="mc_nextxq" class="btn_b btn fl" type="button" onclick="go_step('2');">下一步
                            </button>
                        </div>
                    </div>
                </div>
            </div>
            <!--                @*企业信息div*@-->
            <div class="content_960_b" style="display: none; border-top: none;" id="qyxxdiv">
                <div class="con_900">
                    <div class="sbxxtl">
                        <div class="form_item">
                            <label class="input_label">党建组织：</label>
                            <div class="input_right">
                                <label>
                                    <input name="isdangjian" type="radio" value="0" style="margin-left: 10px;"
                                           onclick="checkdj(this)" checked/><i class="fa fa-2x icon-radio"></i>无</label>
                                <label style="margin-left: 40px;">
                                    <input name="isdangjian" type="radio" value="1" onclick="checkdj(this)"/><i
                                        class="fa fa-2x icon-radio"></i>有</label>
                                <input type="hidden" name="djzz" id="djzz" value="0">
                            </div>
                        </div>
                        <!--                            @*有党建组织显示内容*@-->
                        <div style="display: none" id="ydjdiv">
                            <div class="form_item">
                                <label class="input_label">党组织建制：</label>
                                <div class="input_right">
                                    <select style="width: 357px; height: 44px;" id="dzzjz" name="zzjz">
                                        <option value="">请选择</option>
                                        <option value="党委">党委</option>
                                        <option value="党总支">党总支</option>
                                        <option value="党支部">党支部</option>
                                        <option value="未成立">未成立</option>
                                    </select>
                                </div>
                                <label class="input_label">党组织组建方式：</label>
                                <div class="input_right">
                                    <select style="width: 357px; height: 44px;" id="zjxx" name="zjfs">
                                        <option value="">请选择</option>
                                        <option value="单独组建">单独组建</option>
                                        <option value="联合组建">联合组建</option>
                                        <option value="其他">其他</option>
                                    </select>
                                </div>
                            </div>
                            <div class="form_item">
                                <label class="input_label">党组织建立时间：</label>
                                <div class="input_right">
                                    <input type="date" class="txt" style="width: 357px;" id="jlsj" name="jldate" placeholder=""
                                           onclick="imeOpen('jlsj')"/>
                                </div>
                                <label class="input_label">组织标志：</label>
                                <div class="input_right">

                                    <label>
                                        <input name="biaozhi" type="radio" value="0" style="margin-left: 10px;"
                                               onclick="checkqt(this, 'zzbz')" checked/><i
                                            class="fa fa-2x icon-radio"></i>否</label>
                                    <label style="margin-left: 40px;">
                                        <input name="biaozhi" type="radio" value="1" onclick="checkqt(this, 'zzbz')"/><i
                                            class="fa fa-2x icon-radio"></i>是</label>
                                    <input type="hidden" name="zzbz" id="zzbz" value="0">
                                </div>
                            </div>
                            <div class="form_item">
                                <label class="input_label">书记标志：</label>
                                <div class="input_right">

                                    <label>
                                        <input name="shuji" type="radio" value="0" style="margin-left: 10px;"
                                               onclick="checkqt(this, 'sjbz')" checked/><i
                                            class="fa fa-2x icon-radio"></i>否</label>
                                    <label style="margin-left: 40px;">
                                        <input name="shuji" type="radio" value="1" onclick="checkqt(this, 'sjbz')"/><i
                                            class="fa fa-2x icon-radio"></i>是</label>
                                    <input type="hidden" name="sjbz" id="sjbz" value="0">
                                </div>
                                <label class="input_label">党员(预备党员)人数：</label>
                                <div class="input_right">
                                    <input type="text" class="txt" style="width: 357px;" name="dyrs" id="dyrs"
                                           onclick="imeNum('dyrs')"/>
                                    <b>人</b>
                                </div>
                            </div>
                        </div>
                        <!--                            @*有党建组织结束*@-->
                        <div class="form_item">
                            <label class="input_label">党员标志：</label>
                            <div class="input_right">
                                <label>
                                    <input name="dybj" type="radio" value="0" style="margin-left: 10px;"
                                           onclick="checkqt(this, 'dybz')" checked/><i class="fa fa-2x icon-radio"></i>否</label>
                                <label style="margin-left: 40px;">
                                    <input name="dybj" type="radio" value="1" onclick="checkqt(this, 'dybz')"/><i
                                        class="fa fa-2x icon-radio"></i>是</label>
                                <input type="hidden" name="dybz" id="dybz" value="0">
                            </div>
                        </div>
                        <div class="solid_line_top mb30 mt30"></div>
                        <div class="form_item">
                            <label class="input_label" style="width: 40%;">&nbsp;</label>
                            <button type="button" class="btn btn-fan fl" onclick="go_step('1');">上一步</button>
                            <button id="mc_nextxq0" class="btn_b btn fl" type="button" onclick="go_step('t');">下一步
                            </button>
                        </div>
                    </div>
                </div>
            </div>
        </form>
    </div>
</div>
<div style="position: absolute; right: 5%; bottom: 10px;"><span class="fl dao" id="agree_btn">本页将在60秒后返回首页</span></div>

<!--    @*灰色弹出框*@-->
<div id="toast" style="display: none;">
    <div class="weui_mask"></div>
    <div class="weui_toast">
        <img style="width: 40px; height: 40px;" src="/Content/images/loading.gif"/>
        <p class="weui_toast_content">请等待</p>
    </div>
</div>

<script>
    var secs = 3600;
    //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/qygsdz";

        } 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 = "/Ytj/qygsdz";
    }

</script>
</body>
</html>
