<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/webpage/include/taglib.jsp"%>
<form:form id="subForm" modelAttribute="workContentPriceadjust" 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">
                <form:input path="name" htmlEscape="false" readonly="true" class="form-control layui-input required"/>
            </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 htmlEscape="false" readonly="true" class="form-control layui-input" value="${fns:getMainDictLabel(workContentPriceadjust.type, 'content_price_adjust_type','' )}"/>
            </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="content" htmlEscape="false" rows="3" readonly="true" class="form-control "/>
            </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="${workContentPriceadjust.reviewAmt}" pattern="#,##0.00#"/>" readonly="true"  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="${workContentPriceadjust.setAmt}" pattern="#,##0.00#"/>" readonly="true"  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 htmlEscape="false" readonly="true" class="form-control layui-input" value="<fmt:formatDate value="${workContentPriceadjust.reviewDate}" 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 htmlEscape="false" readonly="true" class="form-control layui-input" value="<fmt:formatDate value="${workContentPriceadjust.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">
                <input htmlEscape="false" readonly="true" class="form-control layui-input" value="${fns:getDictLabel(workContentPriceadjust.inAccount,'yes_no' ,'' )}"/>
            </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 htmlEscape="false" readonly="true" class="form-control layui-input" value="${fns:getDictLabel(workContentPriceadjust.inPayment,'yes_no' ,'' )}"/>
            </div>
        </div>
    </div>
</form:form>
<script type="text/javascript">
    var validateForm;
    $(document).ready(function() {
        validateForm = $("#subForm").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: '#reviewDate', //目标元素。由于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>