<!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-supply-edit" th:object="${noticeSupply}">
            <input name="id" th:field="*{id}" type="hidden">
            <div class="form-group">
                <label class="col-sm-3 control-label">商品类型</label>
                <div class="col-sm-8">
                    <select class="form-control m-b" name="account">
                        <option>清选择</option>
                        <option>柜子</option>
                        <option>桌子</option>
                        <option>椅子</option>
                    </select>
                </div>
            </div>
<!--            <div class="form-group" id="typeId">-->
<!--                <label class="col-sm-3 control-label">关联商品类别表id：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <input name="typeId" th:field="*{typeId}" class="form-control" type="text" required>-->
<!--                </div>-->
<!--            </div>-->
            <div class="form-group">    
                <label class="col-sm-3 control-label">商户名称</label>
                <div class="col-sm-8">
                    <input name="merchantId" th:field="*{merchantId}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">供应信息标题：</label>
                <div class="col-sm-8">
                    <input name="supplyTitle" th:field="*{supplyTitle}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">生产厂家：</label>
                <div class="col-sm-8">
                    <input name="manufacturer" th:field="*{manufacturer}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <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">    
                <label class="col-sm-3 control-label">联系电话：</label>
                <div class="col-sm-8">
                    <input name="telephone" th:field="*{telephone}" class="form-control" type="text" required>
                </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 name="releaseTime" th:value="${#dates.format(noticeSupply.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">
                    <textarea name="picture" class="form-control" required>[[*{picture}]]</textarea>
                </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>
                    </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/supply";
        $("#form-supply-edit").validate({
            focusCleanup: true
        });

        $("#typeId").attr("style","display:none;");//隐藏div
        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-supply-edit').serialize());
            }
        }

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