<!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="serialNumber" id="serialNumber" 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="documentNumber" id="documentNumber" 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="storeName" id="storeName" 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="totalItems" id="totalItems" 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="damageTotal" id="damageTotal" 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="surplusTotal" id="surplusTotal" 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="source" id="source" 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="applicant" id="applicant" 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="applicationTime" id="applicationTime" 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="status" id="status" 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 serialNumber = $("input[name='serialNumber']").val();
           var documentNumber = $("input[name='documentNumber']").val();
           var storeName = $("input[name='storeName']").val();
           var totalItems = $("input[name='totalItems']").val();
           var damageTotal = $("input[name='damageTotal']").val();
           var surplusTotal = $("input[name='surplusTotal']").val();
           var source = $("input[name='source']").val();
           var applicant = $("input[name='applicant']").val();
           var applicationTime = $("input[name='applicationTime']").val();
           var status = $("input[name='status']").val();

        $.ajax({
            cache : true,
            type : "POST",
            url : ctx + "kc/skcknadjustmentdocument/sKcKnAdjustmentdocumentAdd",
            data : {
                "serialNumber": serialNumber,
                "documentNumber": documentNumber,
                "storeName": storeName,
                "totalItems": totalItems,
                "damageTotal": damageTotal,
                "surplusTotal": surplusTotal,
                "source": source,
                "applicant": applicant,
                "applicationTime": applicationTime,
                "status": status,
            },
            async : false,
            error : function(request) {
                $.modal.alertError("系统错误");
            },
            success : function(data) {
                $.operate.successCallback(data);
            }
        });
    }
</script>
</body>
</html>
