<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/webpage/include/taglib.jsp"%>

		<form:form id="subForm" modelAttribute="workContentVisamanage" action="#" method="post" class="form-horizontal">
		<form:hidden path="id"/>
            <div class="form-group layui-row lw12">
            <div class="layui-item layui-col-sm6">
                <label class="layui-form-label"><span class="require-item">*</span>合同名称：</label>
                <div class="layui-input-block with-icon">
                    <sys:gridselectProjcontent url="${ctx}/projectcontentinfo/projectContentData/selectcontent" id="contId" name="contract.id"  value="${workContentVisamanage.contract.id}"  title="选择合同" labelName="contract.name"
                                               labelValue="${workContentVisamanage.contract.name}" cssClass="form-control layui-input required" projectId="${workContentVisamanage.projectId}" type="41" fieldLabels="" fieldKeys="" searchLabel="${fns:urlEncode('合同名称')}" searchKey="" ></sys:gridselectProjcontent>
                </div>
            </div>
            <div class="layui-item layui-col-sm6">
                <label class="layui-form-label"><span class="require-item">*</span>签证类型：</label>
                <div class="layui-input-block">
                    <form:select path="visaType" class="form-control layui-input required">
                        <form:option value="" label=""/>
                        <form:options items="${fns:getMainDictList('content_visa_type')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
                    </form:select>
                </div>
            </div>
            <div class="layui-item layui-col-sm6">
                <label class="layui-form-label"><span class="require-item">*</span>签证日期：</label>
                <div class="layui-input-block">
                    <input class="laydate-icondate form-control layui-input layer-date laydate-icon required" id="visaDate" name="visaDate" value="<fmt:formatDate value="${workContentVisamanage.visaDate}" pattern="yyyy-MM-dd"/>">
                </div>
            </div>
            <div class="layui-item layui-col-sm12 with-textarea">
                <label class="layui-form-label">签证主要内容：</label>
                <div class="layui-input-block">
                    <form:textarea path="visaCtnt" htmlEscape="false" rows="3"    class="form-control layui-area"/>
                </div>
            </div>
        </div>

        <div class="form-group layui-row lw12">
            <div class="form-group-label"><h2>详情信息</h2></div>
            <div class="layui-item layui-col-sm6">
                <label class="layui-form-label"><span class="require-item">*</span>送审金额：</label>
                <div class="layui-input-block">
                    <input name="reviewAmt" htmlEscape="false"  value="<fmt:formatNumber value="${workContentVisamanage.reviewAmt}" pattern="#,##0.00#"/>" onchange="formatNum(this);" class="form-control layui-input required number"/>
                </div>
            </div>
            <div class="layui-item layui-col-sm6">
                <label class="layui-form-label"><span class="require-item">*</span>审定金额：</label>
                <div class="layui-input-block">
                    <input name="setAmt" htmlEscape="false"  value="<fmt:formatNumber value="${workContentVisamanage.setAmt}" pattern="#,##0.00#"/>" onchange="formatNum(this);" class="form-control layui-input required number"/>
                </div>
            </div>
            <div class="layui-item layui-col-sm6">
                <label class="layui-form-label"><span class="require-item">*</span>报送日期：</label>
                <div class="layui-input-block">
                    <input id="subDate" name="subDate" type="text" maxlength="20" class="laydate-icondate form-control layui-input layer-date laydate-icon required"
                           value="<fmt:formatDate value="${workContentVisamanage.subDate}" pattern="yyyy-MM-dd"/>"/>
                </div>
            </div>
            <div class="layui-item layui-col-sm6">
                <label class="layui-form-label"><span class="require-item">*</span>审定日期：</label>
                <div class="layui-input-block">
                    <input id="setDate" name="setDate" type="text" maxlength="20" class="laydate-icondate form-control layui-input layer-date laydate-icon required"
                           value="<fmt:formatDate value="${workContentVisamanage.setDate}" pattern="yyyy-MM-dd"/>"/>
                </div>
            </div>
            <div class="layui-item layui-col-sm6">
                <label class="layui-form-label"><span class="require-item">*</span>计入台账：</label>
                <div class="layui-input-block">
                    <form:select path="inAccount" class="form-control layui-input required">
                        <form:option value="" label=""/>
                        <form:options items="${fns:getDictList('yes_no')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
                    </form:select>
                </div>
            </div>
            <div class="layui-item layui-col-sm6">
                <label class="layui-form-label"><span class="require-item">*</span>计入支付：</label>
                <div class="layui-input-block">
                    <form:select path="inPayment" class="form-control layui-input required">
                        <form:option value="" label=""/>
                        <form:options items="${fns:getDictList('yes_no')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
                    </form:select>
                </div>
            </div>
            <div class="layui-item layui-col-sm12 with-textarea">
                <label class="layui-form-label">备注信息：</label>
                <div class="layui-input-block">
                    <form:textarea path="remarks" htmlEscape="false" rows="3"    class="form-control layui-area"/>
                </div>
            </div>
        </div>
	</form:form>
<script type="text/javascript">
    var validateForm;
    $(document).ready(function() {
        validateForm = $("#subForm").validate({
            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: '#visaDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎，因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
            event: 'focus' //响应事件。如果没有传入event，则按照默认的click
        });
        laydate.render({
            elem: '#subDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎，因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
            event: 'focus' //响应事件。如果没有传入event，则按照默认的click
        });
        laydate.render({
            elem: '#setDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎，因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
            event: 'focus' //响应事件。如果没有传入event，则按照默认的click
        });

    });

    function genDetailStr(){
        var stringify = JSON.stringify($("#subForm").serializeJson());
        return stringify;
    }
</script>