<%@ 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"
            });
        });

        function save() {
            var b = check();
            if (!b) {
                jp.error("请正确填写信息");
                return false;
            }
            jp.loading();
            jp.post("${ctx}/managementcenter/activiti/EngAmountSave", $("#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 civilWorks = $('#civilWorks').val();
            var civilMaterials = $('#civilMaterials').val();
            var civilUnit = $('#civilUnit').val();
                if (civilWorks == "") {
                    flag = false;
                }
                if (civilMaterials == "") {
                    flag = false;
                }
                if (civilUnit == "") {
                    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="engineeringAmount" action="" method="post"
                               class="form-horizontal">
                        <form:hidden path="id"/>
                        <form:hidden path="reserveProjectName"/>
                        <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="civilWorks" path="civilWorks"
                                                cssClass="form-control" placeholder="形式不能为空"/>
                                </td>
                                <td class="width-15 active"><label class="pull-right">物料信息：</label></td>
                                <td class="width-35">
                                    <form:input id="civilMaterials" path="civilMaterials"
                                                cssClass="form-control" placeholder="物料信息不能为空"/>
                                </td>
                            </tr>
                            <tr>
                                <td class="width-15 active"><label class="pull-right"> 数量：</label></td>
                                <td class="width-35">
                                    <form:input id="civilUnit" path="civilUnit"
                                                cssClass="form-control" placeholder="数量不能为空"/>
                                </td>
                            </tr>
                            </tbody>
                        </table>
                    </form:form>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
</html>
