<!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>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-demand-edit" th:object="${noticeDemand}">
            <input name="id" th:field="*{id}" type="hidden">
            <div class="form-group" id="memberId">
                <label class="col-sm-3 control-label">会员信息表id：</label>
                <div class="col-sm-8">
                    <input name="memberId" th:field="*{memberId}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group" id="purchaseTitle">
                <label class="col-sm-3 control-label">求购标题：</label>
                <div class="col-sm-8">
                    <input name="purchaseTitle" th:field="*{purchaseTitle}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group" id="summaryOfNeeds">
                <label class="col-sm-3 control-label">需求概要：</label>
                <div class="col-sm-8">
                    <input name="summaryOfNeeds" th:field="*{summaryOfNeeds}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group" id="demandDetails">
                <label class="col-sm-3 control-label">需求详情：</label>
                <div class="col-sm-8">
                    <textarea name="demandDetails" class="form-control" required>[[*{demandDetails}]]</textarea>
                </div>
            </div>
            <div class="form-group" id="contacts">
                <label class="col-sm-3 control-label">联系人：</label>
                <div class="col-sm-8">
                    <input name="contacts" th:field="*{contacts}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group" id="contactNumber">
                <label class="col-sm-3 control-label">联系电话：</label>
                <div class="col-sm-8">
                    <input name="contactNumber" th:field="*{contactNumber}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group" id="releaseTime">
                <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 name="releaseTime" th:value="${#dates.format(noticeDemand.releaseTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
                    </div>
                </div>
            </div>
            <div class="form-group" >
                <label class="col-sm-3 control-label">需求信息状态：</label>
                <div class="col-sm-8">
                    <div class="radio-box">
                        <label class="radio-box"> <input type="radio" th:field="*{status}" name="status" value="0" checked /> 征集中 </label>
                        <label class="radio-box"> <input type="radio" th:field="*{status}" name="status" value="1" /> 已结束 </label>
<!--                        <input type="radio" name="status" value="" required>-->
<!--                        <label th:for="status" th:text="未知"></label>-->
                    </div>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script type="text/javascript">
        var prefix = ctx + "notice/demand";
        $("#form-demand-edit").validate({
            focusCleanup: true
        });

        $("#memberId").attr("style","display:none;");//隐藏div
        $("#purchaseTitle").attr("style","display:none;");//隐藏div
        $("#summaryOfNeeds").attr("style","display:none;");//隐藏div
        $("#demandDetails").attr("style","display:none;");//隐藏div
        $("#contacts").attr("style","display:none;");//隐藏div
        $("#contactNumber").attr("style","display:none;");//隐藏div
        $("#releaseTime").attr("style","display:none;");//隐藏div
        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-demand-edit').serialize());
            }
        }

        $("input[name='releaseTime']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });
    </script>
</body>
</html>