<%@ taglib prefix="from" uri="http://www.springframework.org/tags/form" %>
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/webpage/include/taglib.jsp" %>
<html>
<head>
    <title>政策处理上传文件</title>
    <meta name="decorator" content="ani"/>
    <%@include file="/webpage/include/summernote.jsp" %>
    <style type="text/css">
        input::-webkit-input-placeholder {
            color: red !important;
        }

        input::-moz-placeholder { /* Mozilla Firefox 19+ */
            color: red !important;
        }

        input:-moz-placeholder { /* Mozilla Firefox 4 to 18 */
            color: red !important;
        }

        input:-ms-input-placeholder { /* Internet Explorer 10-11 */
            color: red !important;
        }
    </style>
    <script type="text/javascript">
        $(document).ready(function () {
            $('#beginDate').datetimepicker({
                format: "YYYY-MM-DD HH:mm:ss"
            });
            $('#endDate').datetimepicker({
                format: "YYYY-MM-DD HH:mm:ss"
            });
            $('select').change(function () {
                var includeAutomation = $('#includeAutomation').val();
                var policyIssues = $('#policyIssues').val();
                if (includeAutomation == '是') {
                    $('#wayOf').attr('placeholder', '通信方式不能为空');
                } else {
                    $('#wayOf').removeAttr('placeholder');
                }
                if (policyIssues == '是') {
                    $("#processingDescription").attr('placeholder', '政策处理描述不能为空');
                } else {
                    $("#processingDescription").removeAttr('placeholder');
                }
            });
        });

        function save() {
            var b = check();
            if (!b) {
                jp.error("请正确填写信息");
                return false;
            }
            jp.loading();
            jp.post("${ctx}/managementcenter/activiti/conUpdateSave", $("#inputForm").serialize(), function (data) {
                if (data.success) {
                    jp.getParent().refresh();
                    var dialogIndex = parent.layer.getFrameIndex(window.name); //获取窗口索引
                    parent.layer.close(dialogIndex);
                    jp.success(data.msg);
                } else {
                    jp.error(data.msg);
                }
            });
        }

        function check() {
            var flag = true;
            var projectInfo = $('#projectInfo').val();
            var projectMoney = $('#projectMoney').val();
            var processingList = $('#processingList').val();
            var billList = $('#billList').val();
            if (projectInfo == "" || projectMoney == "" || processingList == "" || billList == "") {
                flag = false;
            }
            return flag;
        }
    </script>
</head>
<body>
<div class="wrapper wrapper-content">
    <div class="row">
        <div class="col-md-12">
            <div class="panel panel-primary">
                <div class="panel-body">
                    <form:form id="inputForm" modelAttribute="constructionUpload" action="" method="post"
                               class="form-horizontal">
                        <form:hidden path="id"/>
                        <input id="procInsId" type="hidden" value="${fns:unescapeHtml(construction.procInsId)}">
                        <table class="table table-bordered">
                            <tbody>
                            <tr>
                                <td class="width-15 active"><label class="pull-right"> 储备项目暂定名称：</label></td>
                                <td class="width-35">
                                    <form:input id="reserveProjectName" path="reserveProjectName"
                                                cssClass="form-control" readonly="true"/>
                                </td>
                                <td class="width-15 active"><label class="pull-right">对方信息：</label></td>
                                <td class="width-35">
                                    <form:input id="projectInfo" path="projectInfo"
                                                cssClass="form-control" placeholder="不能为空"/>
                                </td>
                            </tr>
                            <tr>
                                <td class="width-15 active"><label class="pull-right"> 对方金额：</label></td>
                                <td class="width-35">
                                    <from:input id="projectMoney" path="projectMoney" cssClass="form-control"
                                                placeholder="不能为空"/>
                                </td>
                                <td class="width-15 active"><label class="pull-right">政策处理清单：</label></td>
                                <td class="width-35">
                                    <sys:fileUpload path="processingList" fileNumLimit="50" fileSizeLimit="50"
                                                    value="${constructionUpload.processingList}"
                                                    uploadPath="/pick"></sys:fileUpload>
                                </td>
                            </tr>
                            <tr>
                                <td class="width-15 active"><label class="pull-right"> 缴费单：</label></td>
                                <td class="width-35">
                                    <sys:fileUpload path="billList" fileNumLimit="50" fileSizeLimit="50"
                                                    value="${constructionUpload.billList}"
                                                    uploadPath="/pick"></sys:fileUpload>
                                </td>
                            </tr>
                            </tbody>
                        </table>
                    </form:form>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
</html>