add.html 12.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" id="form-receiptPreference-add">
        <div class="form-group">
            <label class="col-sm-3 control-label">仓库:</label>
            <div class="col-sm-8">
                <select name="warehouseCode" id="warehouse" class="form-control" th:with="warehouseList=${@WarehouseService.getWarehouse()}">
                    <option th:each="warehouse : ${warehouseList}" th:text="${warehouse['name']}" th:value="${warehouse['code']}"></option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">首选项代码:</label>
            <div class="col-sm-8">
                <input id="code" name="code" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">首选项名字:</label>
            <div class="col-sm-8">
                <input id="name" name="name" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">入库流程:</label>
            <div class="col-sm-8">
                <select id="receiptFlow" name="receivingflow" class="form-control" th:with="statusFlowList=${@StatusFlow.flowList('receivingFlow')}">
                    <option th:each="flow : ${statusFlowList}" th:text="${flow['name']}" th:value="${flow['code']}"></option>
                </select>

            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">自动生成托盘号:</label>
            <div class="col-sm-8">
                <select id="autoAssignLPN" name="autoAssignLPN" class="form-control">
                    <option value="0">自动生成</option>
                    <option value="1">不自动生成</option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">允许超收:</label>
            <div class="col-sm-8">
                <select id="allowOverReceiving" name="allowOverReceiving" class="form-control">
                    <option value="1">允许</option>
                    <option value="0">不允许</option>
                </select>
             </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">允许超收范围:</label>
            <div class="col-sm-8">
                <input id="allowOverReceivingQty" name="allowOverReceivingQty" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">自动定位:</label>
            <div class="col-sm-8">
                <select id="autoLocate" name="autoLocate" class="form-control">
                    <option value="0"></option>
                    <option value="1"></option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">RF显示未收数量:</label>
            <div class="col-sm-8">
                <select id="showOpenQty" name="showOpenQty" class="form-control">
                    <option value="0"></option>
                    <option value="1"></option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">RF组车收货:</label>
            <div class="col-sm-8">
                <input id="groupPutaway" name="groupPutaway" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">人工组盘:</label>
            <div class="col-sm-8">
                <input id="manuallyBuildLPN" name="manuallyBuildLPN" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">定位规则:</label>
            <div class="col-sm-8">
                <select id="locationRule" name="locationRule" class="form-control" th:with="list=${@FilterConfigDetailService.queryFilterConfigDetail('locationRule')}">
                    <option value="">请选择</option>
                    <option th:each="item : ${list}" th:text="${item['description']}" th:value="${item['code']}"></option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">上架规则:</label>
            <div class="col-sm-8">
                <select id="listingRules" name="listingRules" class="form-control" th:with="list=${@FilterConfigDetailService.queryFilterConfigDetail('listingRules')}">
                    <option value="">请选择</option>
                    <option th:each="item : ${list}" th:text="${item['description']}" th:value="${item['code']}"></option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">空库位规则:</label>
            <div class="col-sm-8">
                <select id="emptyLocRule" name="emptyLocRule" class="form-control"
                        th:with="list=${@FilterConfigDetailService.queryFilterConfigDetail('emptyLocRule')}">
                    <option value="">请选择</option>
                    <option th:each="item : ${list}" th:text="${item['description']}" th:value="${item['code']}"></option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">RF逐件收货:</label>
            <div class="col-sm-8">
                <select name="checkinByPiece" class="form-control" type="text" id="checkinByPiece">
                    <option value="0"></option>
                    <option value="-1"></option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">RF自动提交收货:</label>
            <div class="col-sm-8">
                <select id="pieceConfirm" name="pieceConfirm" class="form-control" type="text">
                    <option value="0"></option>
                    <option value="-1"></option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">abc分类:</label>
            <div class="col-sm-8">
                <select id="abcClass" name="allowoverreceiving" class="form-control" type="text">
                    <option value="0"></option>
                    <option value="-1"></option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">保质期(天):</label>
            <div class="col-sm-8">
                <input id="daysToExpire" name="daystoexpire" class="form-control" type="number">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">临期预警:</label>
            <div class="col-sm-8">
                <select id="expiringDays" name="expiringdays" class="form-control" type="text">
                    <option value="0"></option>
                    <option value="-1"></option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">收货预警(天):</label>
            <div class="col-sm-8">
                <input id="minShelfLifeDays" name="minshelflifedays" class="form-control" type="number">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">RF快速上架:</label>
            <div class="col-sm-8">
                <select id="allowQuickPutaway" name="allowquickputaway" class="form-control">
                    <option value="0"></option>
                    <option value="1"></option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">属性模板:</label>
            <div class="col-sm-8">
                <input id="attributeTemplateCode" name="attributetemplatecode" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">快速入库:</label>
            <div class="col-sm-8">
                <select id="usequickcheckin" name="useQuickCheckIn" class="form-control">
                    <option value="0"></option>
                    <option value="1"></option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <div class="form-control-static col-sm-offset-9">
                <button type="submit" class="btn btn-primary">提交</button>
                <button onclick="$.modal.close()" class="btn btn-danger" type="button">关闭</button>
            </div>
        </div>
    </form>
</div>
<div th:include="include::footer"></div>
<script type="text/javascript">
    var prefix = ctx + "config/receiptPreference";
    $("#form-receiptPreference-add").validate({
        rules:{
            code:{
                required: true,
            },
            name:{
                required: true,
            },
            autoAssignLPN:{
                required: true,
            },
            allowOverReceiving:{
                required: true,
            },
            allowOverReceivingQty:{
                required: true,
            },
            autoLocate: {
                required: true,
            },
            showOpenQty: {
                required: true,
            },
            groupPutaway: {
                required: true,
            },
            manuallyBuildLPN: {
                required: true,
            },
            checkinByPiece: {
                required: true,
            },
            pieceConfirm: {
                required: true,
            },
            allowQuickPutaway: {
                required: true,
            }
        },
        submitHandler: function(form) {
            var tableValue = $.common.getTableValue("#form-receiptPreference-add");
            tableValue = formValueReplace(tableValue, "allowOverReceiving",  $("#allowOverReceiving option:selected").val());
            tableValue = formValueReplace(tableValue, "receivingFlow", $("#receivingFlow option:selected").val());
            tableValue = formValueReplace(tableValue, "autoAssignLPN", $("#autoAssignLPN option:selected").val());
            tableValue = formValueReplace(tableValue, "autoLocate", $("#autoLocate option:selected").val());
            tableValue = formValueReplace(tableValue, "showOpenQty", $("#showOpenQty option:selected").val());
            tableValue = formValueReplace(tableValue, "locationRule", $("#locationRule option:selected").val());
            tableValue = formValueReplace(tableValue, "emptyLocRule", $("#emptyLocRule option:selected").val());
            tableValue = formValueReplace(tableValue, "useQuickCheckIn", $("#useQuickCheckIn option:selected").val());
            tableValue = formValueReplace(tableValue, "allowQuickPutaway", $("#allowQuickPutaway option:selected").val());
            tableValue = formValueReplace(tableValue, "warehousecode", $("#allowQuickPutaway option:selected").val());
            $.operate.save(prefix + "/add", tableValue);
        }


    });
    $(function () {
        $.ajax({
            url: "../getWarehouseByUserCode",
            type: 'post',
            dataType: "json",
            data: {
                username: [[${@permission.getPrincipalProperty('id')}]]
            },
            success: function (value) {
                // console.log(value.data);
                $("#warehouse").contents().remove();
                if (value != null && value.data.length >= 1)
                    for (var i = 0; i < value.data.length; i++) {
                        $('<option value=' + value.data[i].id + ' code=' + value.data[i].code + '>' + value.data[i].name + '</option>').appendTo('#warehouse');
                    }
            }
        })
    });
</script>
</body>
</html>