<%@ page import="com.alibaba.fastjson.JSON" %>
<%@ page import="com.jeeplus.modules.workcontent.entity.WorkContentContprogram" %>
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/webpage/include/taglib.jsp"%>

<form:form id="subForm" modelAttribute="workContentContprogram" 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">
                <input htmlEscape="false" readonly="true" class="form-control layui-input" <c:forEach items="${fns:getDictList('content_contract_type')}" var="item">
                    <c:set var="typename" value="content_contract_type_${item.value}"></c:set>
                    <c:forEach items="${fns:getDictList(typename)}" var="item2">
                        <c:if test="${workContentContprogram.contCate eq item2.value}">value="${item2.label}"</c:if>
                    </c:forEach>
                </c:forEach>/>
            </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(workContentContprogram.contAttr, 'content_contract_attr', '')}"/>
            </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(workContentContprogram.priceType, 'content_contract_price_type', '')}"/>
            </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(workContentContprogram.bidType, 'content_bidding_type', '')}"/>
            </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">与其他合约关系：</label>
            <div class="layui-input-block with-icon">
                <input htmlEscape="false" readonly="true" class="form-control layui-input" value="${workContentContprogram.otherProgram.name}"/>
            </div>
        </div>
        <div class="layui-item layui-col-sm12 with-textarea">
            <label class="layui-form-label"><span class="require-item">*</span>合同范围：</label>
            <div class="layui-input-block">
                <form:textarea path="scope" htmlEscape="false" rows="3" readonly="true" class="form-control required "/>
            </div>
        </div>
        <div class="layui-item layui-col-sm12 with-textarea">
            <label class="layui-form-label"><span class="require-item">*</span>界面的处理：</label>
            <div class="layui-input-block">
                <form:textarea path="inteface" htmlEscape="false" rows="3"  readonly="true"  class="form-control required "/>
            </div>
        </div>
    </div>
</form:form>
    <script type="text/javascript">
        var validateForm;
        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);
                }
            }
        });
        function genDetailStr(){
            return JSON.stringify($("#subForm").serializeJson());
        }
    </script>