AgvOperate.html 3.92 KB
<!DOCTYPE HTML>
<html  lang="zh" xmlns:th="http://www.thymeleaf.org">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body>
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-receiving-add">
        <div class="form-group" style="transform: scale(1.1, 1.1);">
            <label class="col-sm-3 control-label">站台选择:</label>
            <div class="col-sm-8">
                <div class="radio radio-info radio-inline">
                    <input type="radio" id="task1" name="task" value="1" checked="checked" class="radio_select">
                    <label for="task1">1号站台</label>
                </div>
                <div class="radio radio-danger radio-inline">
                    <input type="radio" id="task2" name="task" value="2">
                    <label for="task2">2号站台</label>
                </div>
            </div>
        </div>
        <div class="form-group" style="transform: scale(1.1, 1.1);">
            <label class="col-sm-3 control-label">任务类型:</label>
            <div class="col-sm-8">
                <div class="radio radio-info radio-inline">
                    <input type="radio" id="taskType1" name="taskType" value="1" checked="checked" class="radio_select">
                    <label for="taskType1">整盘入库</label>
                </div>
                <div class="radio radio-danger radio-inline">
                    <input type="radio" id="taskType2" name="taskType" value="2">
                    <label for="taskType2">补充入库</label>
                </div>
            </div>
        </div>
        <div class="form-group">
            <div class="form-control-static col-sm-offset-9">
                <input type="button" onclick="typeSubmit()" class="btn btn-primary" value="提交">
                <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 + "receipt/AgvReceiving";

    function typeSubmit() {
        let id=$("input[name='task']:checked").val();
        let code=window.parent.$("#code").val();
        let containerCode=window.parent.$("#re_con").val();
        let materialCode=$("#re_code").val();
        let taskType=$("input[name='taskType']:checked").val();
        if (code === "" || containerCode === "" || materialCode === "") {
            $.modal.msgWarning("主单号、容器编码、物料编码不能为空!")
        }
        else if (id === '1') {
            $.ajax({
                url:prefix+'/TaskAssignsOne',
                type:'post',
                data:{
                    code:code,
                    containerCode:containerCode,
                    materialCode:materialCode,
                    taskType:taskType
                },
                success:function (res) {
                    if (res.code === 200) {
                        $.modal.msgSuccess(res.msg);
                        $.modal.close();
                    }
                    else {
                        $.modal.msgError(res.msg);
                    }
                }
            })
        }
        else if (id === '2') {
            $.ajax({
                url:prefix+'/TaskAssignsTwo',
                type:'post',
                data:{
                    code:code,
                    containerCode:containerCode,
                    materialCode:materialCode,
                    taskType:taskType
                },
                success:function (res) {
                    if (res.code === 200) {
                        $.modal.msgSuccess(res.msg);
                        $.modal.close();
                    }
                    else {
                        $.modal.msgError(res.msg);
                    }
                }
            })
        }
    }
</script>
</body>
</html>