<%@ 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: '#openbidTime', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎，因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
                event: 'focus' //响应事件。如果没有传入event，则按照默认的click
            });

            //只做查看时，禁用掉以下标签
            if (${requestScope.disabled.length()>0}) {
                $('input,textarea,select').attr('disabled','disabled');
                if(${requestScope.status eq 'edit'}){
                    $("#depositAmount").removeAttr('disabled');
                    $("#id").removeAttr('disabled');
                }
            }

        });
	</script>
</head>
<body class="hideScroll">
<form:form id="inputForm" modelAttribute="projectDepositManagement" action="${ctx}/project/projectDepositManagement/save" method="post" class="form-horizontal">
	<%--<form:hidden path="id"/>--%>
	<form:input id="id" path="id" htmlEscape="false"  type="hidden"  class="form-control "/>
	<sys:message content="${message}"/>
	<c:set var="id" value="${projectDepositManagement.id}" />
	<table class="table table-bordered  table-condensed dataTables-example dataTable no-footer">
		<tbody>
			<tr>
				<td class="width-15 active"><label class="pull-right">项目名称：</label></td>
				<td class="width-35">
						<%--<input id="projectName" name="projectName" type="text" class="form-control required" value="${projectDepositManagement.projectName}"/>--%>
					<sys:gridselect url="${ctx}/project/project/selectProject" id="projectName" name="projectName"  value="${projectName.id}"  title="选择项目名称" labelName="clientName"
									labelValue="${projectDepositManagement.project.projectName}" cssClass="form-control required" fieldLabels="项目" fieldKeys="projectName" searchLabel="项目名称" searchKey="projectName"></sys:gridselect>
				</td>
				<td class="width-15 active"><label class="pull-right">递交单位：</label></td>
				<td class="width-75"  colspan="3">
					<sys:gridselect url="${ctx}/workprequalification/workPrequalification/selectbiddingCompany" id="clientId" name="clientId"  value="${workPrequalification.biddingCompany.id}"  title="选择招标单位" labelName="clientName"
									labelValue="${projectDepositManagement.clientName}" cssClass="form-control required" fieldLabels="客户" fieldKeys="name" searchLabel="客户名称" searchKey="name" ></sys:gridselect>
				</td>
			</tr>
			<tr>
				<td class="width-15 active"><label class="pull-right">保证金金额：</label></td>
				<td class="width-35">
					<form:input id="depositAmount" path="depositAmount" htmlEscape="false"    class="form-control "/>
				</td>
				<c:if test="${not empty id}">
					<td class="width-15 active"><label class="pull-right">开标时间：</label></td>
					<td class="width-35">
						<input id="openbidTime"  name="beginDate"  type="text" readonly="readonly" maxlength="20" style="width:200px;" class="laydate-icondate form-control layer-date input-sm"
							   value="<fmt:formatDate value="${projectDepositManagement.openbidTime}" pattern="yyyy-MM-dd"/>"/>
					</td>
				</c:if>
			</tr>
		</tbody>
	</table>
</form:form>
</body>
</html>