addCountDetailChild.html 4 KB
<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m form-inline" id="form-countDetailsChild-add" autocomplete="off">
        <div class="form-group">
            <div class="col-sm-3">
                <label>物料编码:</label>
                <input id="materialCode" class="form-control" th:field="*{cycleCountDetailChild.materialCode}" readonly
                       name="materialCode"
                       type="text">
            </div>
            <div class="col-sm-3">
                <label>物料名称:</label>
                <input id="materialName" class="form-control" th:field="*{cycleCountDetailChild.materialName}" readonly
                       name="materialName"
                       type="text">
            </div>
            <div class="col-sm-3">
                <label>物料单位:</label>
                <input id="materialUnit" class="form-control" th:field="*{cycleCountDetailChild.materialUnit}" readonly
                       name="materialUnit"
                       type="text">
            </div>
            <div class="col-sm-3">
                <label>库存状态:</label>
                <select id="inventorySts" class="form-control" name="qualityStatus">
                    <option value="0">合格</option>
                    <option value="1">不合格</option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-3">
                <label style="width: 65px;">X坐标:</label>
                <input id="locationNoX" class="form-control" name="locationNoX" type="text">
            </div>
            <div class="col-sm-3">
                <label style="width: 65px;">Y坐标:</label>
                <input id="locationNoY" class="form-control" name="locationNoY" type="text">
            </div>
            <div class="col-sm-3">
                <label style="width: 65px;">追溯码:</label>
                <input id="tracingNo" class="form-control" name="tracingNo" type="text">
            </div>
        </div>
        <div class="form-control-static col-sm-offset-6" style="float: right">
            <button type="submit" class="btn btn-primary">提交</button>
            <button onclick="$.modal.close()" class="btn btn-danger" type="button">关闭</button>
        </div>
    </form>
</div>
<div th:include="include::footer"></div>
<script th:inline="javascript">
    let prefix = ctx + "inventory/cycleCountDetail"
    let cycleCountDetailChild = [[${cycleCountDetailChild}]];

    $("#form-countDetailsChild-add").validate({
        rules: {
            locationNoX: {
                required: true,
            },
            locationNoY: {
                required: true
            },
        },
        submitHandler: function () {
            let params = cycleCountDetailChild;
            params.cycleCountDetailChildId = null;
            params.locationNoX = $("#locationNoX").val();
            params.locationNoY = $("#locationNoY").val();
            params.tracingNo = $("#tracingNo").val();
            params.qualityStatus = $("#qualityStatus").val();
            $.modal.loading("正在处理中,请稍后...");
            var config = {
                url: prefix + "/saveCountDetailChild",
                type: "post",
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                data: JSON.stringify(params),
                success: function (result) {
                    $.operate.saveSuccess(result);
                }
            };
            $.ajax(config)
        }
    });
</script>
</body>
<style>
    label {
        float: left;
        line-height: 34px;
    }

    .form-group {
        width: 100%;
    }

    select {
        width: 160px !important;
    }

    input {
        width: 160px !important;
    }
</style>
</html>