<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/webpage/include/taglib.jsp"%>
<html>
<head>
    <title>标段信息管理</title>
    <meta name="decorator" content="default"/>
    <script type="text/javascript">
        var validateForm;
        function doSubmit(){//回调函数，在编辑和保存动作时，供openDialog调用提交表单。
            if(validateForm.form()){
                $("#inputForm").submit();
                return true;
            }

            return false;
        }
        $(document).ready(function() {
            validateForm = $("#inputForm").validate({
                submitHandler: function(form){
                    loading('正在提交，请稍等...');
                    form.submit();
                },
                errorContainer: "#messageBox",
                errorPlacement: function(error, element) {
                    $("#messageBox").text("输入有误，请先更正。");
                    if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
                        error.appendTo(element.parent().parent());
                    } else {
                        error.insertAfter(element);
                    }
                }
            });
            laydate.render({
                elem: '#timeOfWinningBid', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎，因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
                event: 'focus' //响应事件。如果没有传入event，则按照默认的click
                ,type: 'date'
            });
            laydate.render({
                elem: '#bidOpeningTime', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎，因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
                event: 'focus' //响应事件。如果没有传入event，则按照默认的click
                ,type: 'date'
            });

            laydate.render({
                elem: '#filingTime', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎，因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
                event: 'focus' //响应事件。如果没有传入event，则按照默认的click
                ,type: 'date'
            });
            laydate.render({
                elem: '#firstAcceptanceTime', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎，因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
                event: 'focus' //响应事件。如果没有传入event，则按照默认的click
                ,type: 'date'
            });
            laydate.render({
                elem: '#finalArchivingTime', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎，因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
                event: 'focus' //响应事件。如果没有传入event，则按照默认的click
                ,type: 'date'
            });
        });
    </script>
</head>
<body class="hideScroll">
<form:form id="inputForm" modelAttribute="bidInformation" action="${ctx}/project/bidInformation/save" method="post" class="form-horizontal">
    <form:hidden path="id"/>
    <sys:message content="${message}"/>
    <table class="table table-bordered  table-condensed dataTables-example dataTable no-footer">
        <tbody>
        <tr>
            <td class="width-15 active"><label class="pull-right">项目名称<font color="red">*</font>：</label></td>
            <td class="width-85" colspan="3">
                <form:input path="project.projectName" htmlEscape="false" readonly="true" class="form-control required"/>
            </td>
        </tr>

        <tr>
            <td class="width-15 active"><label class="pull-right">项目编号：</label></td>
            <td class="width-35">
                <form:input path="project.projectNumber" htmlEscape="false" readonly="true" class="form-control"/>
            </td>
            <td class="width-15 active"><label class="pull-right">项目负责人：</label></td>
            <td class="width-35">
                <form:input path="workprojectgroup.leader" htmlEscape="false" readonly="true" class="form-control "/>
            </td>
        </tr>

        <tr>

            <td class="width-15 active"><label class="pull-right">开标时间：</label></td>
            <td class="width-35">
                <input id="bidOpeningTime" name="bidOpeningTime" type="text" maxlength="20" class="laydate-icondate form-control layer-date input-sm"
                       value="${bidInformation.bidOpeningTime}"/>
            </td>
            <td class="width-15 active"><label class="pull-right">中标通知书编号<font color="red">*</font>：</label></td>
            <td class="width-35">
                <form:input path="winningBidNumber" htmlEscape="false" readonly="true" class="form-control required"/>
            </td>
        </tr>

        <tr>
            <td class="width-15 active"><label class="pull-right">中央投资网是否上传：</label></td>
            <td class="width-35">
                <input type="radio" name="centralInvestmentOnline" ${bidInformation.centralInvestmentOnline==1?"checked":""}>是
                <input type="radio" name="centralInvestmentOnline" ${bidInformation.centralInvestmentOnline==0?"checked":""}>否
            </td>
            <td class="width-15 active"><label class="pull-right">中标通知书发放时间：</label></td>
            <td class="width-35">
                <input id="timeOfWinningBid" name="timeOfWinningBid" type="text" maxlength="20" class="laydate-icondate form-control layer-date input-sm"
                       value="${bidInformation.timeOfWinningBid}"/>
            </td>
        </tr>

        <tr>
            <td class="width-15 active"><label class="pull-right">招标人是否承存档：</label></td>
            <td class="width-35">
                <input type="radio" name="tendereeArchives" ${bidInformation.tendereeArchives==1?"checked":""}>是
                <input type="radio" name="tendereeArchives" ${bidInformation.tendereeArchives==0?"checked":""}>否
            </td>
            <td class="width-15 active"><label class="pull-right">备案时间：</label></td>
            <td class="width-35">
                <input id="filingTime" name="filingTime" type="text" maxlength="20" class="laydate-icondate form-control layer-date input-sm"
                       value="${bidInformation.filingTime}"/>
            </td>
        </tr>

        <tr>
            <td class="width-15 active"><label class="pull-right">纸质归档：</label></td>
            <td class="width-35">
                <input type="radio" name="paperArchiving" ${bidInformation.paperArchiving==1?"checked":""}>是
                <input type="radio" name="paperArchiving" ${bidInformation.paperArchiving==0?"checked":""}>否
            </td>
            <td class="width-15 active"><label class="pull-right">首次接收时间：</label></td>
            <td class="width-35">
                <input id="firstAcceptanceTime" name="firstAcceptanceTime" type="text" maxlength="20" class="laydate-icondate form-control layer-date input-sm"
                       value="${bidInformation.firstAcceptanceTime}"/>
            </td>
        </tr>

        <tr>
            <td class="width-15 active"><label class="pull-right"></label></td>
            <td class="width-35"></td>
            <td class="width-15 active"><label class="pull-right">最终归档时间：</label></td>
            <td class="width-35">
                <input id="finalArchivingTime" name="finalArchivingTime" type="text" maxlength="20" class="laydate-icondate form-control layer-date input-sm"
                       value="${bidInformation.finalArchivingTime}"/>
            </td>
        </tr>
        </tbody>
        <tbody>
        <tr>

            <td colspan="4">
                <div>
                    <table id="contentTable" class="table table-striped table-bordered table-hover table-condensed dataTables-example dataTable">
                        <thead>
                        <tr>
                            <th  class="sort-column ordernumber">序号</th>
                            <th  class="sort-column name">名称</th>
                            <th  class="sort-column number">数量</th>
                            <th  class="sort-column pageNumber">页码</th>
                            <th  class="sort-column remarks">备注</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <c:forEach items="${archivedirectoryList}" var="archivedirectory">
                            <tr>
                                <td>${archivedirectory.seq}</td>
                                <td>${archivedirectory.name}</td>
                                <td>${archivedirectory.number}</td>
                                <td>${archivedirectory.remarks}</td>
                                <td>${archivedirectory.pageNumber}</td>
                                <td>
                                    <shiro:hasPermission name="project:archivedirectory:view">
                                        <a href="javascript:void(0)" onclick="openDialogView('附件信息', '${ctx}/project/archivedirectory/forms?id=${archivedirectory.id}','80%','80%')" class="btn btn-info btn-xs" ><i class="fa fa-search-plus"></i> 查看</a>
                                    </shiro:hasPermission>
                                </td>
                            </tr>
                        </c:forEach>
                        </tbody>
                    </table>
                </div>
            </td>
        </tr>
        </tbody>
        <br>
        <tbody>
        <tr>
            <td colspan="8">
                <div style="height: 100px">
                    <br>
                    附件上传&nbsp;&nbsp;&nbsp;
                    <a href="javascript:void(0)" onclick="openDialogView('附件信息', '${ctx}/project/bidInformation/form?id=${archivedirectory.id}','80%','80%')" class="btn btn-info btn-xs" ><i class="fa fa-plus"></i> 添加附件</a>
                </div>
            </td>
        </tr>
        </tbody>
    </table>
</form:form>
</body>
</html>