choosePickStack.html 11.1 KB
<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="row-fluid">
            <div class="row">
                <h1 class="col-md-3 col-md-offset-1">选择出库托盘信息
                </h1>
            </div>
            <div class="row">
                <h4 class="col-md-3 col-md-offset-1" style="color: red;">点击对应码垛类型图片赋值</h4>
            </div>
            <div class="row select-info">
                <div class="col-md-3 col-md-offset-1">
                    <!-- 组盘输入区 -->
                    <div class="row select-info">
                        <div class="row">
                            <div class="col-md-3">
                                <img src="../img/icon/101.png" value="101" alt="">
                            </div>
                            <div class="col-md-3">
                                <img src="../img/icon/102.png" value="102" alt="">
                            </div>
                            <div class="col-md-3">
                                <img src="../img/icon/103.png" value="103" alt="">
                            </div>
                            <div class="col-md-3">
                                <img src="../img/icon/104.png" value="104" alt="">
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-3">
                                <img src="../img/icon/105.png" value="105" alt="">
                            </div>
                            <div class="col-md-3">
                                <img src="../img/icon/106.png" value="106" alt="">
                            </div>
                            <div class="col-md-3">
                                <img src="../img/icon/107.png" value="107" alt="">
                            </div>
                            <div class="col-md-3">
                                <img src="../img/icon/108.png" value="108" alt="">
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-3">
                                <img src="../img/icon/109.png" value="109" alt="">
                            </div>
                            <div class="col-md-3">
                                <img src="../img/icon/110.png" value="110" alt="">
                            </div>
                            <div class="col-md-3">
                                <img src="../img/icon/111.png" value="111" alt="">
                            </div>
                            <div class="col-md-3">
                                <img src="../img/icon/112.png" value="112" alt="">
                            </div>
                        </div>
                    </div>
                </div>
                <div class="col-md-3">
                    <div class="row select-info">
                        <form  class="form-horizontal m" id="form-shipment-container">
                            <div class="row">
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">托盘垛型:</label>
                                    <div class="col-sm-8">
                                        <select name="stackType" id="stackType" class="form-control" th:with="containerStackType=${@dict.getType('container_stack_type')}" disabled="false">
                                            <option th:each="cst : ${containerStackType}" th:text="${cst['dictLabel']}" th:value="${cst['dictValue']}">
                                        </select>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">托盘高度:</label>
                                    <div class="col-sm-8">
                                        <select name="woodenPalletHeight" id="woodenPalletHeight" class="form-control" th:with="containerHeight=${@dict.getType('container_height')}">
                                            <option value="">请选择</option>
                                            <option th:each="height : ${containerHeight}" th:text="${height['dictLabel']}" th:value="${height['dictValue']}">
                                        </select>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <div class="form-control-static col-sm-offset-9">
                                        <button type="submit" class="btn btn-primary">提交</button>
                                    </div>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
                <div class="col-md-3">
                    <div class="row select-info">
                        <div class="row">
                            <div class="col-md-4">
                                <img src="../img/icon/201.png" value="201" alt="">
                            </div>
                            <div class="col-md-4">
                                <img src="../img/icon/202.png" value="202" alt="">
                            </div>
                            <div class="col-md-4">
                                <img src="../img/icon/203.png" value="203" alt="">
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-4">
                                <img src="../img/icon/204.png" value="204" alt="">
                            </div>
                            <div class="col-md-4">
                                <img src="../img/icon/205.png" value="205" alt="">
                            </div>
                            <div class="col-md-4">
                                <img src="../img/icon/206.png" value="206" alt="">
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-4">
                                <img src="../img/icon/207.png" value="207" alt="">
                            </div>
                            <div class="col-md-4">
                                <img src="../img/icon/208.png" value="208" alt="">
                            </div>
                            <div class="col-md-4">
                                <img src="../img/icon/209.png" value="209" alt="">
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <h1 class="col-md-3 col-md-offset-1">当前出库托盘信息</h1></h1>
            </div>
            <div class="row select-info">
                <div class="col-md-3 col-md-offset-4">
                    <div class="row select-info">
                        <form  class="form-horizontal m" th:object="${container}">
                            <div class="row">
                                <div class="form-group">
                                    <div class="col-sm-8  col-md-offset-5">
                                        <img id="currentImg" th:src="${currentImg}" name="currentImg"/>
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">托盘垛型:</label>
                                    <div class="col-sm-8">
                                        <select name="stackType" class="form-control" th:with="containerStackType=${@dict.getType('container_stack_type')}" disabled="false"  th:field="*{stackType}" >
                                            <option th:each="cst : ${containerStackType}" th:text="${cst['dictLabel']}" th:value="${cst['dictValue']}" th:selected="${stackType == cst.dictValue}">
                                        </select>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">托盘高度:</label>
                                    <div class="col-sm-8">
                                        <select name="woodenPalletHeight" class="form-control" th:with="containerHeight=${@dict.getType('container_height')}" disabled="false"  th:field="*{woodenPalletHeight}" >
                                            <option value="">请选择</option>
                                            <option th:each="height : ${containerHeight}" th:text="${height['dictLabel']}" th:value="${height['dictValue']}"th:selected="${woodenPalletHeight == height.dictValue}">
                                        </select>
                                    </div>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<div th:include="include :: footer"></div>
<script th:inline="javascript">

    $(function(){

    })

    function load(){

    }

    $(".row img").click(function(){
        let stackType = $(this).attr("value");
        $("#stackType").val(stackType);
        $("#stackType").select(stackType);
    })

    $("#form-shipment-container").validate({
        submitHandler: function(from){
            let stackType = $("#stackType").val();
            let woodenPalletHeight = $("#woodenPalletHeight").val();
            let data = {"stackType":stackType,"code":"SHIPMENT_CONTAINER0001","woodenPalletHeight":woodenPalletHeight};
            $.ajax({
                cache : true,
                type : "POST",
                url : ctx + "config/container/editSaveByCode",
                data : data,
                async : false,
                error : function(request) {
                    $.modal.alertError("请求失败!");
                },
                success : function(result) {
                    console.log(result)
                    console.log(data)
                    if(result.code === 200){
                        console.log("in")
                        changChoose(data);
                    }
                    $.operate.saveSuccess(result);
                }
            });
        }
    });

    function changChoose(data){
        let img = "../img/icon/"+data.stackType+".png";
        let woodenPalletHeight = data.woodenPalletHeight;
        $('[name="stackType"]').val(data.stackType);
        $('[name="woodenPalletHeight"]').val(data.woodenPalletHeight);
        $("#currentImg").attr("src",img);
    }

</script>
</body>
</html>