|
@{
|
Layout = null;
|
}
|
|
<!DOCTYPE html>
|
@* 设备位置监控 *@
|
|
<html>
|
<head>
|
<meta name="viewport" content="width=device-width" />
|
@Html.Partial("_Title")
|
|
<link href="~/Theme/Boostrap/bootstrap/css/bootstrap.min.css" rel="stylesheet" />
|
<link href="~/Theme/Boostrap/bootstrap/css/bootstrap-responsive.min.css" rel="stylesheet" />
|
<link href="~/Theme/Boostrap/font-awesome/css/font-awesome.min.css" rel="stylesheet" />
|
<link href="~/Theme/Customer/Index/style.css" rel="stylesheet" />
|
<link href="~/Theme/plugins/jbox-v2.3/jBox/Skins/blue/jbox.css" rel="stylesheet" />
|
<link href="~/Theme/plugins/mmgrid/mmPaginator.css" rel="stylesheet" />
|
<link href="~/Theme/plugins/mmgrid/mmGrid.css" rel="stylesheet" />
|
|
<script src="~/Theme/Js/jquery-1.8.3.min.js"></script>
|
<script src="~/Theme/Boostrap/bootstrap/js/bootstrap.min.js"></script>
|
<script src="~/Theme/plugins/jbox-v2.3/jBox/jquery.jBox-2.3.min.js"></script>
|
<script src="~/Theme/plugins/jbox-v2.3/jBox/i18n/jquery.jBox-zh-CN.js"></script>
|
|
<script src="~/Theme/Js/moment.js"></script>
|
<script src="~/Theme/Js/Common.js"></script>
|
<script src="~/Theme/Js/UICommon.js"></script>
|
<script src="~/Theme/plugins/mmgrid/mmGrid.js"></script>
|
<script src="~/Theme/plugins/mmgrid/mmPaginator.js"></script>
|
<script src="~/Theme/Js/app.js"></script>
|
|
<script src="~/Theme//layuiadmin/layui/layui.js"></script>
|
|
<script src="~/Theme/Customer/Alarm/AlarmIndex.js"></script>
|
<style type="text/css">
|
.btnShow { /* 默认 */
|
width: 75px;
|
height: 50px;
|
cursor: pointer;
|
}
|
|
.zero { /* 0 设备手动: 灰色 */
|
background-color: #808080;
|
Opacity: .8;
|
}
|
|
.one { /* 1 设备自动: 淡蓝色 */
|
background-color: #87CEFA;
|
Opacity: .8;
|
}
|
|
.two { /* 2 设备工作: 绿色 */
|
background-color: #008000;
|
}
|
|
.three { /* 3 设备故障: 红色 */
|
background-color: #FF0000;
|
Opacity: .8;
|
}
|
|
.four { /* 4 设备手动选中: 蓝色 */
|
background-color: #0000FF;
|
Opacity: .8;
|
}
|
|
.locat { /* 储位颜色: 蓝色 */
|
background-color: #5470c6;
|
Opacity: .8;
|
}
|
|
.duoji1button { /* 输送线列按钮样式 */
|
width: 100px;
|
height: 50px;
|
cursor: pointer;
|
}
|
|
.yincang { /* 隐藏 */
|
border-style: none;
|
background-color: #F8F8FF;
|
}
|
</style>
|
</head>
|
<body class="fixed-top">
|
|
<div id="container" class="row-fluid @ViewBag.MenuStatus">
|
<div id="body">
|
<div class="container-fluid">
|
<div class="row-fluid">
|
<div class="span12">
|
<div class="widget box light-grey">
|
<div class="widget-body">
|
<!-- 储位俯视图 -->
|
<div id="tabList" class="row-fluid"></div>
|
@*<div class="row-fluid" id="mypager" style="vertical-align:top;"></div>*@
|
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
|
<script type="text/javascript">
|
$(document).ready(function () {
|
AlarmAjax.ToolBar();
|
});
|
|
//自己创建的工程,这里根据自己的项目进行修改。比如新建的网站,端口号就会和这里的代码不一样
|
var webSocket = new WebSocket("ws://" + window.location.hostname + ":" + window.location.port + "/api/WSChat/Get");//这段代码执行后将会立即发送握手请求
|
var webSocket;
|
//ws.binaryType="blob"; 设定接收到的二进制数据当作blob对待
|
//ws.binaryType="arraybuffer"; 设定接收到的二进制数据当作ArrayBuffer对待
|
|
//建立连接成功后会触发
|
webSocket.onopen = function (e) {
|
|
console.log("ws://" + window.location.hostname + ":" + window.location.port + "/api/WSChat/Get");
|
console.log("设备监控界面已连接WebStocket");
|
//location
|
}
|
|
//收到消息后触发
|
webSocket.onmessage = function (msg) {
|
try {
|
//console.log(msg.data)
|
var list = JSON.parse(msg.data)
|
console.log(list)
|
if (list.Message == "任务更新") {
|
console.log("任务更新重新计算垛机信息 ");
|
//接收到的数据内容在msg的data属性中
|
$(document).ready(function () {
|
AlarmAjax.Task(list.Status, list.RoadwayNo, list.StartLocat, list.EndLocat); //接收到的任务 //任务状态、巷道、起始列、目标列
|
});
|
}
|
else if (list.Message == "垛机实时") {
|
console.log("垛机推送重新计算垛机位置信息 ");
|
//接收到的数据内容在msg的data属性中
|
$(document).ready(function () {
|
AlarmAjax.duoji(list.RoadwayNo, list.Position); //接收到的垛机位置 //巷道或某个垛机、位置
|
});
|
}
|
}
|
catch (e) {
|
//alert(JSON.stringify(e));
|
}
|
}
|
</script>
|
|
<script>
|
layui.config({
|
base: '../../layuiadmin/' //静态资源所在路径
|
}).extend({
|
index: 'lib/index' //主入口模块
|
}).use(['layer'], function () {
|
var layer = layui.layer,
|
$ = layui.$;
|
|
//#region 点击储位btn按钮查看储位上信息
|
var tipsVal;
|
// 1.找到触发的事件对象(绑定全局) 2.事件处理程序
|
$('body').on('click', '.duoji', function () {
|
//console.log(123)
|
var html;
|
var that = this;
|
var list = $(that)[0].value.split('-');
|
console.info(list)
|
//console.log($(that)[0].value)
|
//var className = $(that)[0].className;
|
html = "<p style='word-wrap:break-word;width: 100%;height:100%;line-height:24px;font-size:18px'>";
|
html += "当前巷道:" + list[0];
|
|
if (list[1] == 1) {
|
//html += "<br /> 排:" + "0";
|
html += " <br /> 列:" + "出入库口";
|
//html += "<br /> 层:" + "0";
|
//html += "<br /> 深度:" + "0";
|
}
|
else if (list[1] > 1) {
|
html += "<br /> 排:" + "0";
|
html += " <br /> 列:" + (list[1] - 1);
|
html += "<br /> 层:" + "0";
|
html += "<br /> 深度:" + "0";
|
}
|
|
|
html += "</p > ";
|
tipsVal = layer.tips(html, that, { tips: [1, "rgb(58, 61, 73)"], area: ['200px'], time: 0 });
|
/*if (className == 'btnShow zero') {
|
html = "<p style='word-wrap:break-word;width: 100%;height:100%;line-height:24px;font-size:18px'>储位编码:" + locatNo + "<br/>储位状态:空储位</p>";
|
tipsVal = layer.tips(html, that, { tips: [1, "rgb(58, 61, 73)"], area: ['220px'], time: 0 });
|
} else {
|
var param = {
|
locatNo: locatNo
|
}
|
sendData(IP + "/Sys/GetLocateInfo", param, 'get', function (res) {
|
// console.log(res)
|
if (res.code == 0) {
|
html = "<p style='word-wrap:break-word;width: 100%;height:100%;line-height:24px;font-size:18px;'>";
|
html += "储位编码:" + locatNo;
|
html += "<br/>储位状态:" + res.data.Status;
|
if (res.data.GoodsInfoList != null) {
|
html += "<br/>托盘号: " + res.data.PalletNo;
|
res.data.GoodsInfoList.forEach(item => {
|
html += "<br/><br/>物料编码:" + item.SkuNo;
|
html += "<br/>物料名称:" + item.SkuName;
|
html += "<br/>批次号: " + item.LotNo;
|
html += "<br/>数量: " + item.Qty;
|
if (item.Standard != null) {
|
html += "<br/>物料规格:" + item.Standard;
|
}
|
if (res.data.Status != '2') {
|
html += "<br/>质检状态:" + item.InspectStatus;
|
html += "<br/>有效期:" + item.ExpirationTime;
|
}
|
});
|
html += "</p>"
|
}
|
tipsVal = layer.tips(html, that, { tips: [1, "rgb(58, 61, 73)"], area: ['260px'], time: 0 });
|
} else {
|
layer.msg(res.msg, {
|
icon: 2,
|
time: 2000
|
}, function () { })
|
}
|
});
|
}*/
|
|
});
|
//鼠标移出
|
$('body').on('mouseout', '.duoji', function () {
|
layer.close(tipsVal);
|
});
|
//#endregion
|
});
|
</script>
|
</body>
|
|
</html>
|