自动化立体仓库 - WCS系统
luxiaotao1123
2022-03-09 e72acfec2ea6ac5eefe1484a73fea2d17815601d
# ycq 条码显示 站点点击显示
1个文件已修改
122 ■■■■■ 已修改文件
src/main/webapp/views/console.html 122 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/console.html
@@ -955,7 +955,7 @@
            <div class="body-head">输送线状态</div>
            <div class="state states">
                <span>运输线总数</span>
                <span class="line-ss">45</span>
                <span class="line-ss">48</span>
            </div>
            <div class="button"><span>所有状态</span></div>
            <div class="button item-group">
@@ -1219,80 +1219,65 @@
</body>
</html>
<script>
    var tData = [
        {"time":"2022-02-22 14:24:53","barcode":"80000009"},
        {"time":"2022-02-22 14:24:53","barcode":"80000019"},
        {"time":"2022-02-22 14:24:53","barcode":"80000019"},
        {"time":"2022-02-22 14:24:53","barcode":"80000019"},
        {"time":"2022-02-22 14:24:53","barcode":"80000019"},
        {"time":"2022-02-22 14:24:53","barcode":"80000019"},
        {"time":"2022-02-22 14:24:53","barcode":"80000019"},
        {"time":"2022-02-22 14:24:53","barcode":"80000019"},
        {"time":"2022-02-22 14:24:53","barcode":"80000019"},
        {"time":"2022-02-22 14:24:53","barcode":"80000019"},
        {"time":"2022-02-22 14:24:53","barcode":"80000019"},
        {"time":"2022-02-22 14:24:53","barcode":"80000019"},
        {"time":"2022-02-22 14:24:53","barcode":"80000019"},
        {"time":"2022-02-22 14:24:53","barcode":"80000019"},
        {"time":"2022-02-22 14:24:53","barcode":"80000019"},
        {"time":"2022-02-22 14:24:53","barcode":"80000019"},
        {"time":"2022-02-22 14:24:53","barcode":"80000019"},
        {"time":"2022-02-22 14:24:53","barcode":"80000019"},
        {"time":"2022-02-22 14:24:53","barcode":"80000019"},
        {"time":"2022-02-22 14:24:53","barcode":"80000019"},
        {"time":"2022-02-22 14:24:53","barcode":"80000019"},
        {"time":"2022-02-22 14:24:53","barcode":"80000019"},
        {"time":"2022-02-22 14:24:53","barcode":"80000019"},
        {"time":"2022-02-22 14:24:53","barcode":"80000019"},
        {"time":"2022-02-22 14:24:53","barcode":"80000019"},
    ]
    var tDate1 = []
    var tDate2 = []
    var tDate3 = []
    // function getCodeData(){
    //     $.ajax({
    //         url:baseUrl +'/xgmwcs/console/barcode/output/site',
    //         method:'GET',
    //         success:function (res) {
    //             if(res.code === 200){
    //                 tData = res.data
    //             }
    //         }
    //     })
    // }
    // setInterval(getCodeData(),1000)
    if(tData.length<=5){
        tData1 = tData
    } else if (tData.length<=10){
        tDate1 = tData.slice(0,5)
        tData.splice(0,5)
        tDate2 = tData
    } else if(tData.length<=15){
        tDate1 = tData.slice(0,5)
        tDate2 = tData.slice(6,10)
        tData.splice(0,10)
        tDate3 = tData
    } else {
        tData = tData.slice(-15)
        tDate1 = tData.slice(-15)
        tDate2 = tData.slice(-10)
        tDate3 = tData.slice(-5)
    var tData = []
    var tData1 = []
    var tData2 = []
    var tData3 = []
    function getCodeData(){
        $.ajax({
            url:baseUrl +'/console/barcode/output/site',
            method:'GET',
            success:function (res) {
                if(res.code === 200){
                    tData = eval(res.data);
                    console.log(tData)
                    if(tData.length<=5){
                        tData1 = tData
                    } else if (tData.length<=10){
                        tData1 = tData.slice(0,5)
                        tData.splice(0,5)
                        tData2 = tData
                        console.log(tData2)
                    } else if(tData.length<=15){
                        tData1 = tData.slice(0,5)
                        tData2 = tData.slice(6,10)
                        tData.splice(0,10)
                        tData3 = tData
                        console.log(tData3)
                    } else {
                        tData = tData.slice(-15)
                        tData1 = tData.slice(-15)
                        tData2 = tData.slice(-10)
                        tData3 = tData.slice(-5)
                    }
                }
            }
        })
    }
    setInterval(function () {
        getCodeData();
        renderBarCode();
    }, 1000)
    function renderBarCode() {
        for (var i = 0;i<tDate1.length;i++){
            var str1 = '<li><span>' + tDate1[i].barcode + '</span><span class="right">' + tDate1[i].time + '</span></li>'
        for (var i = 0;i<tData1.length;i++){
            console.log(tData1[i])
            var str1 = '<li><span>' + tData1[i].barcode + '</span><span class="right">' + tData1[i].time + '</span></li>'
            $('#barcode1').append(str1)
        }
        for(var j = 0;j<tDate2.length;j++){
            var str2 = '<li><span>' + tDate2[j].barcode + '</span><span class="right">' + tDate2[j].time + '</span></li>'
        for(var j = 0;j<tData2.length;j++){
            var str2 = '<li><span>' + tData2[j].barcode + '</span><span class="right">' + tData2[j].time + '</span></li>'
            $('#barcode2').append(str2)
        }
        for(var k = 0;k<tDate3.length;k++){
            var str3 = '<li><span>' + tDate3[k].barcode + '</span><span class="right">' + tDate3[k].time + '</span></li>'
        for(var k = 0;k<tData3.length;k++){
            var str3 = '<li><span>' + tData3[k].barcode + '</span><span class="right">' + tData3[k].time + '</span></li>'
            $('#barcode3').append(str3)
        }
    }
    setInterval(renderBarCode(),1000)
</script>
<script type="text/javascript">
    // 弹窗站点信息
@@ -1315,9 +1300,9 @@
                for (var val in res.data) {
                    var find = $("#siteWindow").find(":input[name='" + val + "']");
                    if (find[0].type==='text') {
                        find.val(data[val]);
                        find.val(res.data[val]);
                    } else if (find[0].type === 'checkbox') {
                        find.attr("checked", data[val] === 'Y');
                        find.attr("checked", res.data[val] === 'Y');
                    }
                }
            }
@@ -1414,6 +1399,7 @@
            },
            method: 'POST',
            success: function (res) {
                console.log(res)
                layer.close(index);
                if (res.code === 200){
                    if (res.data.status) {