<!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-partymessage-edit" >
        <input readOnly="true" id="id" name="id" th:value="${jdxx.id}" type="hidden" >
        <input readOnly="true" id="a1" name="id" th:value="${jdxx.zzjz}"  type="hidden">
        <input readOnly="true" id="a2" name="id" th:value="${jdxx.zjfs}" type="hidden" >
        <h4 class="form-header h4">党建信息</h4>
        <div class="form-group">
            <label class="col-sm-2 control-label">党建组织：</label>
            <div class="col-sm-4 ">
                    <input   id="party1"  value="1" type="radio"  name="isdangjian" th:checked="${jdxx.isdangjian}==1" onclick="sfczwt()">
                    <label   th:for="zwzh" th:text="有"></label>
                    <input   id="party2"   value="0" type="radio"  name="isdangjian" th:checked="${jdxx.isdangjian}==0" onclick="sfczwt1()">
                    <label   th:for="zwzh" th:text="无"></label>
             
            </div>

            <label class="col-sm-2 control-label">党员标志：</label>
            <div class="col-sm-4">
                <div class="radio-box">
                    <input   id="dangyuan1"  value="1" type="radio"  name="dyflg" th:checked="${jdxx.dyflg}==1" >
                    <label  value="是" th:for="zwzh" th:text="是"></label>
                </div>
                <div   class="radio-box">           <!--th:checked="*{zwzh2==zwzh}"-->
                    <input id="dangyuan2" value="0" type="radio"   name="dyflg" th:checked="${jdxx.dyflg}==0" >
                    <label   value="否" th:for="zwzh" th:text="否"></label>
                </div>
            </div>
        </div>


        <div id="form-conceal" style="display:none;">
            <div class="form-group">
                <label class="col-sm-2 control-label">党组织建制：</label>
                <div class="col-sm-4 ">
                    <select class="form-control" name="zzjz" id="s1">
                        <option th:value="1">请选择</option>
                        <option th:value="2">党委</option>
                        <option th:value="3">党总支</option>
                        <option th:value="4">党支部</option>
                        <option th:value="5">未成立</option>
                    </select>
                </div>
                <label class="col-sm-2 control-label">党组织建制方式：</label>
                <div class="col-sm-4">
                    <select class="form-control" name="zjfs" id="s2">
                        <option th:value="1">请选择</option>
                        <option th:value="2">单独组建</option>
                        <option th:value="3">联合组建</option>
                        <option th:value="4">其他</option>
                    </select>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-2 control-label">党组织建立时间：</label>
                <div class="col-sm-4 ">
                    <input type="text" class="time-input form-control" id="startTime"  name="jldate"th:value="${jdxx.jldate}"/>
                </div>
                <label class="col-sm-2 control-label">党员(预备党员)人数：</label>
                <div class="col-sm-4">
                    <input name="dyrs" class="form-control" type="text" th:value="${jdxx.dyrs}">
                </div>
            </div>


            <div class="form-group">
                <label class="col-sm-2 control-label">组织标志：</label>
                <div class="col-sm-4 ">
                    <!--<input name="tableName" class="form-control" type="text"   >-->
                    <div class="radio-box">
                        <input    type="radio" value="1" name="zzflg"  th:checked="${jdxx.zzflg}==1">
                        <label  value="1" th:for="zwzh" th:text="是" ></label>
                    </div>

                    <div   class="radio-box">
                        <input  type="radio" value="0"  name="zzflg" th:checked="${jdxx.zzflg}==0" >
                        <label   value="0" th:for="zwzh" th:text="否"></label>
                    </div>
                </div>
                <label class="col-sm-2 control-label">书记标志：</label>
                <div class="col-sm-4">
                    <!-- <input name="tableName" class="form-control" type="text"  >-->
                    <div class="radio-box">
                        <input     type="radio" value="1"  name="sjflg" th:checked="${jdxx.sjflg}==1" >
                        <label  value="1" th:for="zwzh" th:text="是"></label>
                    </div>

                    <div   class="radio-box">
                        <input   type="radio"  value="2" name="sjflg" th:checked="${jdxx.sjflg}==0" >
                        <label   value="0" th:for="zwzh" th:text="否"></label>
                    </div>
                </div>
            </div>
        </div>
    </form>
        <br><br>
    <div style="text-align:center">
       <!-- <button id="btn-pass" class="btn btn-danger" th:onclick="'enable()'" style="width: 33%">  <i class="fa fa-edit"></i>保存</button>-->
         <button type="button" th:onclick="'enable()'"class="btn btn-w-m btn-success">保存</button>
    </div>

</div>
<div th:include="include :: footer"></div>

<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />

<script type="text/javascript">
    var prefix = ctx + "company/tenant";

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/partyedit",$('#form-gtgsyw-edit').serialize());
        }
    }
    $(function(){
        var sbtitle = document.getElementById("form-conceal");
        if ($('#party1').is(':checked')) {
            sbtitle.style.display = 'block';
        }
    });


    //退回
    function noaccept(id) {
        auditpass(id);
	}
	function auditpass(id){
        var url= prefix + "/sendback/"+id;
        $.modal.opentuihui("退回", url, '550', '500');
    }

    String.prototype.endWith=function(endStr){
        var d=this.length-endStr.length;
        return (d>=0&&this.lastIndexOf(endStr)==d)
    };


    //编辑保存
    function enable(id) {
        sendback(id);
    }
    function sendback(id) {
            $.operate.save(prefix + "/partyedit",$('#form-partymessage-edit').serialize());
    }

    function sfczwt() {

        var sbtitle = document.getElementById("form-conceal");
        if ($('#party1').is(':checked')) {
            sbtitle.style.display = 'block';
        } else {
            sbtitle.style.display = 'none';
        }
    }
    function sfczwt1(){

        var sbtitle = document.getElementById("form-conceal");
        if ($('#party2').is(':checked')) {
            sbtitle.style.display = 'none';
        } else {
            sbtitle.style.display = 'block';
        }
    }

    onload = function() {
        /*党建组织建制*/
        var jycssy=$("#a1").val();
        document.getElementById("s1").selectedIndex = jycssy-1;
        /*党组织建制方式*/
        var jycssy=$("#a2").val();
        document.getElementById("s2").selectedIndex = jycssy-1;
    }

</script>

</body>
</html>
