<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >

<head>
    <th:block th:include="include :: header('修改待审核')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<style>
    .form-control {
        border-top-right-radius: 10px;
        border-top-left-radius: 10px;
        border-bottom-right-radius: 10px;
        border-bottom-left-radius: 10px;
    }
</style>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-gtgsyw-edit" th:object="${gtgsyw}">
        <input readOnly="true" name="id" th:field="*{id}" type="hidden">
        <input readOnly="true" id="ztree" name="ztree" th:value="${ztree}" type="hidden">

        <div class="form-group">
            <label class="col-sm-3 control-label">申请来源：</label>
            <div class="col-sm-8">
                <input  name="shenqinglaiyuan" th:field="*{shenqinglaiyuan}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">个体工商户名称：</label>
            <div class="col-sm-8">
                <input  readOnly="true" name="gtgsh" th:field=" *{codeName}" class="form-control" type="text">
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label">行政区划-区：</label>
            <div class="col-sm-8">
                <input  name="nsxzq" th:field="*{nsxzq}"  class="form-control" type="text">
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label">字号：</label>
            <div class="col-sm-8">
                <div class="radio-box">
                    <input   id="z1"  type="radio"  name="zwzh" th:value="*{zwzh1}" th:checked="*{zwzh1==zwzh}">
                    <label  value="1" th:for="zwzh" th:text="*{zwzh1}"></label>
                </div>

                <div   class="radio-box">
                    <input id="z2" type="radio"   name="zwzh" th:value="*{zwzh2}" th:checked="*{zwzh2==zwzh}">
                    <label   value="2" th:for="zwzh" th:text="*{zwzh2}"></label>
                </div>
                <div  class="radio-box">
                    <input id="z3" type="radio"  name="zwzh" th:value="*{zwzh3}" th:checked="*{zwzh3==zwzh}">
                    <label  value="3" th:for="zwzh" th:text="*{zwzh3}"></label>
                </div>
            </div>
        </div>

       <div class="form-group">
            <label class="col-sm-3 control-label">名称行业：</label>
            <div class="col-sm-8">
                <input  name="mingchenghangye" th:field="*{mingchenghangye}" class="form-control" type="text">
            </div>
        </div>


        <div class="form-group">
            <label class="col-sm-3 control-label">组织形式：</label>
            <div class="col-sm-8">
                <input  name="zuzhixingshi" th:field="*{zuzhixingshi}" class="form-control" type="text">
            </div>
        </div>




        <div class="form-group">
            <label class="col-sm-3 control-label">行业分类：</label>
            <div class="col-sm-8">
                <div  onclick="selectTrade()">
                    <input class="form-control" name="hangye" autocomplete="off" id="treeName" type="text"  th:field="*{hangye}">
                </div>
            </div>
        </div>

    <!--    <div class="form-group">
            <label class="col-sm-3 control-label">行业：</label>
            <div class="col-sm-8">
                <input  name="hangye" th:field="*{hangye}" class="form-control" type="text">
                <input  name="hangye1" th:field="*{hangye1}" class="form-control" type="text">
                <input  name="hangye2" th:field="*{hangye2}" class="form-control" type="text">
                <input  name="hangye3" th:field="*{hangye3}" class="form-control" type="text">
            </div>
        </div>-->

        <div class="form-group">
            <label class="col-sm-3 control-label">照片采集：</label>
            <div class="col-sm-8">
                <img  style=" height: 168px;width:164px; "  name="qianming" th:src="${gtgsyw.paizhao}" class="form-control" width="40px" height="50px">
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label">身份证头像：</label>
            <div class="col-sm-8">
                <img style=" height: 168px;width:164px; " name="qianming" th:src="'data:image/jpeg;base64,'+${gtgsyw.jingyingcardtouxiang}" class="form-control" >
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">签名：</label>
            <div class="col-sm-8">
                <img  style=" height: 168px;width:164px; "  name="qianming" th:src="${gtgsyw.qianming}" class="form-control" width="40px" height="50px">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">经营人身份证正面：</label>
            <div class="col-sm-8">
                <img  style=" height: 168px;width:164px; "  name="qianming" th:src="${gtgsyw.statusFront}" class="form-control" width="40px" height="50px">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">经营人身份证反面：</label>
            <div class="col-sm-8">
                <img  style=" height: 168px;width:164px; "  name="qianming" th:src="${gtgsyw.statusFan}" class="form-control" width="40px" height="50px">
            </div>
        </div>

        <div class="form-group" th:if="${gtgsyw.oflg}==1">
            <label class="col-sm-3 control-label">打印领取人照片：</label>
            <div class="col-sm-8">
                <img  style=" height: 168px;width:164px; "  name="qianming" th:src="${gtgsyw.lqrpaizhao}" class="form-control" width="40px" height="50px">
            </div>
        </div>
        <div class="form-group" th:if="${gtgsyw.oflg}==1">
            <label class="col-sm-3 control-label">打印领取人签名：</label>
            <div class="col-sm-8">
                <img  style=" height: 168px;width:164px; "  name="qianming" th:src="${gtgsyw.lqrqianming}" class="form-control" width="40px" height="50px">
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label">经营人：</label>
            <div class="col-sm-8">
                <input name="jingyingren" th:field="*{jingyingren}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">身份证号：</label>
            <div class="col-sm-8">
                <input  name="jingyingcard" th:field="*{jingyingcard}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">性别：</label>
            <div class="col-sm-8">
                <div class="radio-box">
                    <input type="radio" name="xingbie" value="1" th:checked="*{xingbie}==男">
                    <label  th:for="sex1" th:text="男"></label>
                </div>
                <div class="radio-box">
                    <input type="radio" name="xingbie" value="2" th:checked="*{xingbie}==女">
                    <label th:for="sex2" th:text="女"></label>
                </div>

            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">民族：</label>
            <div class="col-sm-8">
                <input name="minzhu" th:field="*{minzhu}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">家庭住址：</label>
            <div class="col-sm-8">
                <input  name="jiatingzhuzhi" th:field="*{jiatingzhuzhi}" class="form-control" type="text">
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label">政治面貌：</label>
            <div class="col-sm-8">
                <input  name="zzmm" th:field="*{zzmm}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">文化程度：</label>
            <div class="col-sm-8">
                <input  name="whcd" th:field="*{whcd}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">职业状况：</label>
            <div class="col-sm-8">
                <input  name="zyzk" th:field="*{zyzk}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">是否为党员：</label>
            <div class="col-sm-8">
                <input  name="isdy" th:field="*{dangyuan}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">是否军产：</label>
            <div class="col-sm-8">
                <input  name="isjc" th:field="*{junchan}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">电话：</label>
            <div class="col-sm-8">
                <input  name="jingyingrenphone" th:field="*{jingyingrenphone}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">类 型：</label>
            <div class="col-sm-8">
                <input  name="congyerenshu" th:field="*{sczttype}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">经营场所：</label>
            <div class="col-sm-8">
                <input  name="jingyingchangsuo" th:field="*{jingyingchangsuo}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">组成形式：</label>
            <div class="col-sm-8">
                <input  name="zuchengxingshi" th:field="*{zuchengxingshi}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">注册资金(万元)：</label>
            <div class="col-sm-8">
                <input  name="zijinshue" th:field="*{zijinshue}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">经营范围<a onclick="AddJingYingFW()">补充</a>：</label>

            <div class="col-sm-8">
                <textarea class="form-control" id="jingyingfanwei" name="jingyingfanwei" rows="3"
                          style="resize:none" required >[[*{jingyingfanwei}]]</textarea>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">从业人数：</label>
            <div class="col-sm-8">
                <input name="congyerenshu" th:field="*{congyerenshu}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">申请日期：</label>
            <div class="col-sm-8">
                <div class="input-group date">
                    <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    <input readOnly="true"  th:value="${#dates.format(gtgsyw.shenqingdate, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text" >
                </div>
            </div>
        </div>



    </form>

    <button th:if="${gtgsyw.oflg}==0" id="btn-pass" class="btn btn-success" th:onclick="'javascript:setPass(\''+${gtgsyw.id}+'\')'" style="width: 48%">  <i class="layui-btn"></i>审核通过</button>
    <button th:if="${gtgsyw.oflg}==0" id="btn-pass" class="btn btn-danger" th:onclick="'enable(\''+${gtgsyw.id}+'\')'" style="width: 48%">  <i class="fa fa-edit"></i>不予受理</button>
    <button th:if="${gtgsyw.oflg}==3" id="btn-pass" class="btn btn-success" th:onclick="'javascript:setPass(\''+${gtgsyw.id}+'\')'" style="width: 48%">  <i class="layui-btn"></i>审核通过</button>
    <button th:if="${gtgsyw.oflg}==3" id="btn-pass" class="btn btn-danger" th:onclick="'enable(\''+${gtgsyw.id}+'\')'" style="width: 48%">  <i class="fa fa-edit"></i>不予受理</button>
</div>

<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<script type="text/javascript">

    var prefix = ctx + "system/gtgsyw";
    $("#form-gtgsyw-edit").validate({
        focusCleanup: true
    });

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/edit", $('#form-gtgsyw-edit').serialize());
        }
    }


</script>
<script type="text/javascript">
    var prefix = ctx + "system/gtgsyw";
    function setPass(id) {
        auditpass(id);
	}
	function auditpass(id){
        var url= prefix + "/auditpass/"+id;
        $.modal.opentongguo("通过", url, '550', '500');
    }





    function enable(id) {
       sendback(id);
    }
    function sendback(id) {
        var url= prefix + "/sendback/"+id;
        $.modal.opentuihui("退回", url, '550', '500');
		/*   $.modal.openTab("退回", url)*/
	}
    var tree="";
    function selectTraed() {
        var list=$("#ztree").val();
        tree =listToTree(list,0);//调用函数，传入要转换的list数组，和树中顶级元素的pid
        alert("tree:"+tree);
    }

    //list 转成树形json
    function listToTree(list,pid) {
        var ret = [];//一个存放结果的临时数组
        alert();
        for(var i in list) {
            if(list.get(i).pid == pid) {//如果当前项的父id等于要查找的父id，进行递归

                list[i].children = listToTree(list, list[i].id);
                ret.push(list[i]);//把当前项保存到临时数组中
            }
        }
        return ret;//递归结束后返回结果
    }

    function selectTrade() {
        var url ="/system/gtgsyw/selectDept";
        var options = {
            title: '选择行业',
            width: "380",
            url: url,
            callBack: doSubmit
        };
        $.modal.openOptions(options);
    }

    function doSubmit(index, layero) {
        var treeObj = layero.find("iframe")[0].contentWindow.$._tree,
            nodes = treeObj.getCheckedNodes(true),
            treeNames = [],
            treeIds = [];
        for (var i = 0; i < nodes.length; i++) {
            if (nodes[i].name != "制造业" &&
                nodes[i].name != "县委" &&
                nodes[i].name != "部门" &&
                nodes[i].name != "乡政") {
                treeNames.push(nodes[i].name);
                treeIds.push(nodes[i].id);
            }
        }
        $("#treeName").val(treeNames);
        layer.close(index);
    }




    function AddJingYingFW() {
        var jingying = $("#jingyingfanwei").val();
        $("#jingyingfanwei").val(jingying + "（依法须经批准的项目，经相关部门批准后方可开展经营活动）");
    }


</script>




</body>
</html>
