#
luxiaotao1123
2020-08-15 538496d2361fb5cd6ab2a48f609a37b5cbfb5e4d
src/main/webapp/views/crn.html
@@ -11,6 +11,7 @@
    <link rel="stylesheet" type="text/css" href="../static/css/crn.css">
    <script type="text/javascript" src="../static/js/jquery/jquery-3.3.1.min.js"></script>
    <script type="text/javascript" src="../static/js/common.js"></script>
    <script type="text/javascript" src="../static/js/layer/layer.js"></script>
    <style>
    </style>
@@ -38,18 +39,15 @@
            <thead>
                <tr>
                    <th>堆垛机</th>
                    <th>任务号</th>
                    <th>模式</th>
                    <th>状态</th>
                    <th>报警</th>
                    <th>有物</th>
                    <th>列</th>
                    <th>层</th>
                    <th>货叉位置</th>
                    <th>列坐标</th>
                    <th>层坐标</th>
                    <th>完成</th>
                    <th>任务号</th>
                    <th>状态</th>
                    <th>报警码</th>
                    <th>载货台位置</th>
                </tr>
            </thead>
            <tbody>
@@ -80,6 +78,13 @@
</div>
<!-- 手动操作 -->
<div class="crn-operation">
    <!-- 遮罩层 -->
    <div class="crn-operation-shade">
        <span class="crn-operation-shade-span">
            WCS 系统运行中,请停止后操作
        </span>
    </div>
    <!-- 设备任务选择 -->
    <div class="task-select">
@@ -177,6 +182,7 @@
        getCrnStateInfo();
        initCrnMsgTable();
        getCrnMsgInfo();
        operatorBlockShow();
    });
    // 数据更新
    setInterval(function () {
@@ -186,7 +192,21 @@
    },1000);
    setInterval(function () {
        getSiteOutput();
        operatorBlockShow();
    },500);
    // 判断手动操作模块是否可用
    function operatorBlockShow() {
        if (parent.systemRunning) {
            $('.crn-operation').css("opacity", "0.5");
            $('.crn-operation-shade').show();
            $('.crn-operation-shade-span').show();
        }  else {
            $('.crn-operation').css("opacity", "1");
            $('.crn-operation-shade').hide();
            $('.crn-operation-shade-span').hide();
        }
    }
    // 获取堆垛机执行中的命令
    function getCommandLog() {
@@ -201,14 +221,13 @@
                        $("#crn"+commands[i].crnNo).val(commands[i].command);
                    }
                } else if (res.code === 403) {
                    top.location.href = baseUrl + "/login";
                    window.location.href = baseUrl + "/login";
                } else {
                    alert(res.msg);
                }
            }
        })
    }
    // 堆垛机信息表获取 ---- 表一
    function getCrnStateInfo() {
@@ -227,21 +246,18 @@
                    for (var i=1;i<=table.length;i++){
                        var tr = tableEl.find("tr").eq(i);
                        setVal(tr.children("td").eq(0), table[i-1].crnNo);
                        setVal(tr.children("td").eq(1), table[i-1].type);
                        setVal(tr.children("td").eq(2), table[i-1].warn);
                        setVal(tr.children("td").eq(3), table[i-1].loading);
                        setVal(tr.children("td").eq(4), table[i-1].bay);
                        setVal(tr.children("td").eq(5), table[i-1].lev);
                        setVal(tr.children("td").eq(6), table[i-1].forkOffset);
                        setVal(tr.children("td").eq(7), table[i-1].bayCoor);
                        setVal(tr.children("td").eq(8), table[i-1].levCoor);
                        setVal(tr.children("td").eq(9), table[i-1].complete);
                        setVal(tr.children("td").eq(10), table[i-1].workNo);
                        setVal(tr.children("td").eq(11), table[i-1].status);
                        setVal(tr.children("td").eq(12), table[i-1].warnCode);
                        setVal(tr.children("td").eq(1), table[i-1].workNo);
                        setVal(tr.children("td").eq(2), table[i-1].statusType);
                        setVal(tr.children("td").eq(3), table[i-1].status);
                        setVal(tr.children("td").eq(4), table[i-1].warn);
                        setVal(tr.children("td").eq(5), table[i-1].loading);
                        setVal(tr.children("td").eq(6), table[i-1].bay);
                        setVal(tr.children("td").eq(7), table[i-1].lev);
                        setVal(tr.children("td").eq(8), table[i-1].forkOffset);
                        setVal(tr.children("td").eq(9), table[i-1].liftPos);
                    }
                } else if (res.code === 403){
                    top.location.href = baseUrl+"/login";
                    window.location.href = baseUrl+"/login";
                }  else {
                    alert(res.msg);
                }
@@ -277,7 +293,7 @@
                        setVal(tr.children("td").eq(9), table[i-1].command);
                    }
                } else if (res.code === 403){
                    top.location.href = baseUrl+"/login";
                    window.location.href = baseUrl+"/login";
                }  else {
                    alert(res.msg);
                }
@@ -313,70 +329,70 @@
    // 入库
    function put() {
        http.post(baseUrl+"/crn/operator/put", getReqParam(), function (res) {
            alert(res.msg);
            layer.msg(res.msg);
        });
    }
    // 出库
    function take() {
        http.post(baseUrl+"/crn/operator/take", getReqParam(), function (res) {
            alert(res.msg);
            layer.msg(res.msg);
        });
    }
    // 库位转移
    function stockMove() {
        http.post(baseUrl+"/crn/operator/stockMove", getReqParam(), function (res) {
            alert(res.msg);
            layer.msg(res.msg);
        });
    }
    // 站到站
    function siteMove() {
        http.post(baseUrl+"/crn/operator/siteMove", getReqParam(), function (res) {
            alert(res.msg);
            layer.msg(res.msg);
        });
    }
    // 坐标移动
    function coorMove() {
        http.post(baseUrl+"/crn/operator/coorMove", getReqParam(), function (res) {
            alert(res.msg);
            layer.msg(res.msg);
        });
    }
    // 回原点
    function bacOrigin() {
        http.post(baseUrl+"/crn/operator/bacOrigin", getReqParam(), function (res) {
            alert(res.msg);
            layer.msg(res.msg);
        });
    }
    // 任务完成
    function taskComplete() {
        http.post(baseUrl+"/crn/operator/taskComplete", getReqParam(), function (res) {
            alert(res.msg);
            layer.msg(res.msg);
        });
    }
    // 暂停
    function pause() {
        http.post(baseUrl+"/crn/operator/pause", getReqParam(), function (res) {
            alert(res.msg);
            layer.msg(res.msg);
        });
    }
    // 启动
    function boot() {
        http.post(baseUrl+"/crn/operator/boot", getReqParam(), function (res) {
            alert(res.msg);
            layer.msg(res.msg);
        });
    }
    // 清除命令
    function clearCommand() {
        http.post(baseUrl+"/crn/operator/clearCommand", getReqParam(), function (res) {
            alert(res.msg);
            layer.msg(res.msg);
        });
    }
@@ -390,7 +406,7 @@
                if (res.code === 200) {
                    crnOutput(res.data);
                } else if (res.code === 403) {
                    top.location.href = baseUrl + "/login";
                    window.location.href = baseUrl + "/login";
                } else {
                    alert(res.msg);
                }
@@ -416,9 +432,6 @@
        var html = "";
        for (var i = 0; i < line; i ++){
            html += " <tr>\n" +
                "       <td></td>\n" +
                "       <td></td>\n" +
                "       <td></td>\n" +
                "       <td></td>\n" +
                "       <td></td>\n" +
                "       <td></td>\n" +