<div class="main">
    <form class="form-horizontal form form-group-sm ui-validForm" action="@Url.Action()" method="post">
        <div class="control-group">
            <label class="control-label">签收留言</label>
            <div class="controls">
                <input type="text" value="" class="form-control" id="sign_remark" name="sign_remark" dataType="*" nullMsg:'请填写签名留言!" style="width:80%" />
                <span class="help-block"></span>
            </div>
        </div>
        <div class="control-group">
            <label class="control-label">开始日期</label>
            <div class="controls">
                <span id="start_date" name="start_date">&nbsp;</span>
                <span class="help-block"></span>
            </div>
        </div>
        <div class="control-group">
            <label class="control-label">结束日期</label>
            <div class="controls">
                <span id="end_date" name="end_date" >&nbsp;</span>
                <span class="help-block"></span>
            </div>
        </div>
        <div class="control-group">
            <label class="control-label"></label>
            <div class="controls form-inline">
                <div id="box_sign" style="display:none">
                    <input type="hidden" id="thedate" name="thedate" value="@DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")" />
                    <input type="hidden" id="id" name="id" value="@Request.QueryString["id"]" />
                    <button type="button" class="btn btn-primary btn-sm ui-pagePost" data-custom-params="url:'@Url.Action()',callBack:'PostRefreshBack'" id="bt_submit">签收</button>
                    <button type="button" class="btn btn-default btn-sm ui-closeDialog">关闭</button>
                </div>
                <span class="help-block" id="sign_tishi"></span>
            </div>
        </div>
    </form>
</div>
<script type="text/javascript">
    //绑定数据
    var id = Request("id");
    var $sign_remark = $("#sign_remark")
    if (id != "") {
        var data = @Html.Raw(Model??"null");
        $(".form").FormBind(data);
        var endDate = $("#end_date").text();
        var nowDate = $("#thedate").val();
        endDate = new Date(endDate.replace(/-/g, '/'));
        nowDate = new Date(nowDate.replace(/-/g, '/'));
        if(nowDate>=endDate)
        {
            $("#box_sign").hide();
            $("#sign_tishi").text("签收已经结束！");
        }
        else {
            $("#box_sign").show();
        }
    }
</script>