bklLiudl
2024-07-23 675b8bcc4a3630d95e3d0b97d933e63442075ecb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
 
@{
    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/>托盘号:&nbsp;&nbsp;&nbsp;&nbsp;" + res.data.PalletNo;
                                res.data.GoodsInfoList.forEach(item => {
                                    html += "<br/><br/>物料编码:" + item.SkuNo;
                                    html += "<br/>物料名称:" + item.SkuName;
                                    html += "<br/>批次号:&nbsp;&nbsp;&nbsp;&nbsp;" + item.LotNo;
                                    html += "<br/>数量:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + 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>