<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('装斗报表新增')" />
    <th:block th:include="include :: ztree-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-role-add">
        <div class="row">
            <div class="col-sm-12">
                <div class="form-group">
                    <!--is-required 增加星号 显示为必填-->
                            <label class="col-sm-3 control-label">装斗日期:</label>
                            <div class="col-sm-3">
                                <div class="input-group">
                                    <input name="refillingDate" id="refillingDate" class="styled-input" type="text" maxlength="255" >
                                </div>
                            </div>
                            <label class="col-sm-3 control-label">商品编码:</label>
                            <div class="col-sm-3">
                                <div class="input-group">
                                    <input name="productCode" id="productCode" class="styled-input" type="text" maxlength="255" >
                                </div>
                            </div>
                            <label class="col-sm-3 control-label">商品名称:</label>
                            <div class="col-sm-3">
                                <div class="input-group">
                                    <input name="productName" id="productName" class="styled-input" type="text" maxlength="255" >
                                </div>
                            </div>
                            <label class="col-sm-3 control-label">装斗单号:</label>
                            <div class="col-sm-3">
                                <div class="input-group">
                                    <input name="refillingDocumentNumber" id="refillingDocumentNumber" class="styled-input" type="text" maxlength="255" >
                                </div>
                            </div>
                            <label class="col-sm-3 control-label">生产厂家:</label>
                            <div class="col-sm-3">
                                <div class="input-group">
                                    <input name="manufacturer" id="manufacturer" class="styled-input" type="text" maxlength="255" >
                                </div>
                            </div>
                            <label class="col-sm-3 control-label">批号:</label>
                            <div class="col-sm-3">
                                <div class="input-group">
                                    <input name="batchNumber" id="batchNumber" class="styled-input" type="text" maxlength="255" >
                                </div>
                            </div>
                            <label class="col-sm-3 control-label">装斗数量:</label>
                            <div class="col-sm-3">
                                <div class="input-group">
                                    <input name="refillingQuantity" id="refillingQuantity" class="styled-input" type="text" maxlength="255" >
                                </div>
                            </div>
                            <label class="col-sm-3 control-label">单位:</label>
                            <div class="col-sm-3">
                                <div class="input-group">
                                    <input name="unit" id="unit" class="styled-input" type="text" maxlength="255" >
                                </div>
                            </div>
                            <label class="col-sm-3 control-label">质量状况:</label>
                            <div class="col-sm-3">
                                <div class="input-group">
                                    <input name="qualityStatus" id="qualityStatus" class="styled-input" type="text" maxlength="255" >
                                </div>
                            </div>
                            <label class="col-sm-3 control-label">装斗人:</label>
                            <div class="col-sm-3">
                                <div class="input-group">
                                    <input name="refiller" id="refiller" class="styled-input" type="text" maxlength="255" >
                                </div>
                            </div>
                            <label class="col-sm-3 control-label">复核人:</label>
                            <div class="col-sm-3">
                                <div class="input-group">
                                    <input name="verifier" id="verifier" class="styled-input" type="text" maxlength="255" >
                                </div>
                            </div>
                </div>
            </div>

        </div>
    </form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: ztree-js" />
<script type="text/javascript">

    function submitHandler() {
        if ($.validate.form()) {
            add();
        }
    }

    function add() {
           var refillingDate = $("input[name='refillingDate']").val();
           var productCode = $("input[name='productCode']").val();
           var productName = $("input[name='productName']").val();
           var refillingDocumentNumber = $("input[name='refillingDocumentNumber']").val();
           var manufacturer = $("input[name='manufacturer']").val();
           var batchNumber = $("input[name='batchNumber']").val();
           var refillingQuantity = $("input[name='refillingQuantity']").val();
           var unit = $("input[name='unit']").val();
           var qualityStatus = $("input[name='qualityStatus']").val();
           var refiller = $("input[name='refiller']").val();
           var verifier = $("input[name='verifier']").val();

        $.ajax({
            cache : true,
            type : "POST",
            url : ctx + "kc/skcbbrefillingitems/sKcBbRefillingitemsAdd",
            data : {
                "refillingDate": refillingDate,
                "productCode": productCode,
                "productName": productName,
                "refillingDocumentNumber": refillingDocumentNumber,
                "manufacturer": manufacturer,
                "batchNumber": batchNumber,
                "refillingQuantity": refillingQuantity,
                "unit": unit,
                "qualityStatus": qualityStatus,
                "refiller": refiller,
                "verifier": verifier,
            },
            async : false,
            error : function(request) {
                $.modal.alertError("系统错误");
            },
            success : function(data) {
                $.operate.successCallback(data);
            }
        });
    }
</script>
</body>
</html>
