| | |
| | | <div id="code-decoder-2" class="code-decoder"> |
| | | <span id="code-decoder-data-2" class="code-decoder-data">0</span> |
| | | </div> |
| | | <!-- 磅秤 --> |
| | | <div class="scale" id="scale-1"> |
| | | <button id="scale-data-1">磅秤</button> |
| | | </div> |
| | | |
| | | |
| | | <!----------- 左输送线 ----------> |
| | |
| | | getCrnInfo(); |
| | | getSystemRunningStatus(); |
| | | getBarcodeInfo(); |
| | | getScaleInfo(); |
| | | // 实时访问 |
| | | setInterval(function () { |
| | | getCrnInfo(); |
| | | getSystemRunningStatus(); |
| | | getBarcodeInfo() |
| | | getBarcodeInfo(); |
| | | getScaleInfo(); |
| | | }, 1000); |
| | | setInterval(function () { |
| | | getSitesInfo(); |
| | |
| | | }); |
| | | } |
| | | |
| | | // 磅秤实时数据获取 |
| | | function getScaleInfo(){ |
| | | $.ajax({ |
| | | url: baseUrl+ "/console/latest/data/scale", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | |
| | | if (res.code === 200){ |
| | | var sclaes = res.data; |
| | | for (var i = 0; i < sclaes.length; i++){ |
| | | console.log(sclaes[i].scaleId + ":" + sclaes[i].value) |
| | | $("#scale-data-"+sclaes[i].scaleId).text(sclaes[i].value); |
| | | } |
| | | } else if (res.code === 403){ |
| | | parent.location.href = baseUrl+"/login"; |
| | | } else { |
| | | console.log(res.msg); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | |
| | | // 堆垛机偏移动画 |
| | | function crnAnimate(id, leftVal) { |
| | | switch (id) { |