分支自 SuZhouGuanHong/TaiYuanTaiZhong

dengjunjie
2024-01-16 a0f3b5aa29fa51ac9d61b1cf56a5b34624a780cd
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
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
var i = 1;
var j = 1;
// 页面对象
 
//输送线
function Cline(task_no, task_state, address, tray_nbr, number, fromaddress) {
    this.task_no = task_no;//任务号
    this.task_state = task_state;//任务类型
    this.address = address;//目的地址
    this.tray_nbr = tray_nbr;//托盘条码
    this.number = number;
    this.fromaddress = fromaddress;
}
//AGV到位
function AGV_Arrive(arrive, run, leave) {
    this.arrive = arrive;//AGV到位  
    this.run = run;//接货运行
    this.leave = leave;//允许离开
}
//堆垛机
function Stacker(switch_online, switch_manual, task_no, row, col, layer, fault_code, state, number) {
    this.switch_online = switch_online;//开关在线                      
    this.switch_manual = switch_manual;//开关手动
    this.task_no = task_no;//任务序列号
    this.row = row;//排
    this.col = col;//列
    this.layer = layer;//层
    this.fault_code = fault_code;//故障码
    this.state = state;
    this.number = number;
}
//穿梭板                
function STV(power, online_state, running_state, unusual_state, standby, task_no, row, rol, layer, current_face, change_track_begin, change_track_begin_complete, change_track_end, chage_track_end_complete) {
    this.power = power;//电量
    this.online_state = online_state;//联机状态
    this.running_state = running_state;//运行状态
    this.unusual_state = unusual_state;//异常状态
    this.standby = standby;//待机状态
    this.task_no = task_no;//任务号
    this.row = row;//当前列(行)
    this.rol = rol;//当前层
    this.layer = layer;//轨道顺序号(列)
    this.current_face = current_face;//当前面
    this.change_track_begin = change_track_begin;//换轨开始
    this.change_track_begin_complete = change_track_begin_complete;//换轨开始完成
    this.change_track_end = change_track_end;//换轨结束
    this.chage_track_end_complete = chage_track_end_complete;//换轨结束完成
}
 
//输送线
var cline_1001 = new Cline();//输送线1001
var cline_1002 = new Cline();//输送线1002
var cline_1005 = new Cline();//输送线1005
var cline_1006 = new Cline();//输送线1006
var cline_1010 = new Cline();//输送线1010
 
//AGV到位
var agv_arrive_1 = new AGV_Arrive();
var agv_arrive_2 = new AGV_Arrive();
//堆垛机
var stacker_1 = new Stacker();//堆垛机_1
var stacker_2 = new Stacker();//堆垛机_2
//穿梭板
var stv_3 = new STV();
var stv_4 = new STV();
var stv_5 = new STV();
 
// 页面对象
 
var interval = null;
$(function () {
    $('#ConveyorLine_1001').click(function () {
        $.ajax({
            type: "post",
            url: "/AJAX/OPCServiceOperation.ashx",
            data: { action: "StartProcess" },
            async: false,
            success: function (msg) {
 
 
            }
        });
    });
 
    //$('[data-toggle="popover"]').popover();
});
 
$(function () {
    $('#start-system').click(function () {
        if (i % 2 == 0) {
            // 关闭服务
            //$(".monitoring-area ul li").css("background", "#DADADA");
            //$("#conveyerline_1001").css("background", "#DADADA");
            $('#start-system').html("开启服务");
            $("#start-system").css("background", "#00FF90");
            //clearInterval(interval);
            CloseOpcServer()
        } else {
            // 开启服务
            //$(".monitoring-area ul li").css("background", "#90EE90");
            //$("#conveyerline_1001").css("background", "#90EE90");
            $('#start-system').html("关闭服务");
            $("#start-system").css("background", "#FF6A00");
 
            StartOpcServer();
            //interval = setInterval(GetData, 2000);
        }
        i++;
    });
    //$('[data-toggle="popover"]').popover();
});
 
function MouseUp() {
    __doPostBack('Button_Query', "");
}
 
function __doPostBack(eventTarget, eventArgument) {
    if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
        theForm.__EVENTTARGET.value = eventTarget;
        theForm.__EVENTARGUMENT.value = eventArgument;
        theForm.submit();
    }
}
 
function AddNewOpcDetail() {
    openDlg("WebForm_ADDOPCDetails.aspx", { title: "新增", width: 850, height: 400 }, function (result) {
        if (!result) {
            // document.location = document.location
            return;
        }
    });
}
function AddNewOpcSCDetail() {
    openDlg("WebForm_ADDOPCSCDetails.aspx", { title: "新增", width: 850, height: 400 }, function (result) {
        if (!result) {
            // document.location = document.location
            return;
        }
    });
}
//重置穿梭板
function ResetSTV() {
    var stvno = $('#STVNO').val();
    var hang = $('#hang').val();
    var ceng = $('#ceng').val();
    alert(stvno + " " + hang + " " + ceng);
}
//开启OPC服务
function StartOpcServer() {
    $.ajax({
        type: "post",
        url: "/AJAX/OPCServiceOperation.ashx",
        data: { action: "StartOrCloseOpcServer", q0: 1 },
        async: false,
        success: function (msg) {
 
            if (msg.length > 0) {
                ShowMessage("开始服务失败:" + msg);
            }
            else {
                ShowMessage("开始服务成功!");
                interval = setInterval(GetPLCData, 1000);
            }
        }
    });
}
//获取PLC数据
function GetPLCData() {
    GetLineInfo();
    GetStackInfo();
}
//获取输送线数据
function GetLineInfo() {
 
    $.ajax({
        type: "post",
        url: "/AJAX/GetConveyorLineInfo.ashx",
        data: { action: "GetConveyorLineProcess" },
        async: false,
        success: function (msg) {
 
            var json = JSON.parse(msg);
            for (var i = 0; i < json.length; i++) {
                var clineCon = new Cline();
                var controlNmae = "ConveyorLine_";
                var controlTableNmae = "ShowTable_";
                clineCon.number = json[i].Number;
                clineCon.task_no = json[i].TaskNumber;
                clineCon.tray_nbr = json[i].PalletNo;
                clineCon.address = json[i].ToAdresss;
                clineCon.fromaddress = json[i].FromAddress;
                controlNmae += clineCon.number;
                controlTableNmae += clineCon.number;
 
                $('#' + controlNmae).html(clineCon.task_no);
                if (clineCon.task_no > 0) {
                    $('#' + controlNmae).css("background", "#FFFF00");
                }
                else {
                    $('#' + controlNmae).css("background", "#FFFFFF");
                }
 
                $('#' + controlNmae).popover({
                    trigger: 'click', //触发方式
                    title: "输送机:" + clineCon.number,//设置 弹出框 的标题
                    html: true, // 为true的话,data-content里就能放html代码了
                    placement: 'top',
                    content: ContentMethod(controlTableNmae, clineCon),//这里可以直接写字符串,也可以 是一个函数,该函数返回一个字符串
                    container: 'body'
                });
 
                $('#' + controlTableNmae + " tr:nth-child(2) td:nth-child(1)").html(clineCon.task_no);
                $('#' + controlTableNmae + " tr:nth-child(2) td:nth-child(2)").html(clineCon.number);
                $('#' + controlTableNmae + " tr:nth-child(2) td:nth-child(3)").html(clineCon.address);
                $('#' + controlTableNmae + " tr:nth-child(2) td:nth-child(4)").html(clineCon.tray_nbr);
            }
 
        }
    });
}
//获取堆垛机数据
function GetStackInfo() {
     
    for (var i = 1; i <= 4; i++) {
        for (var p = 1; p <= 8; p++) {
            var controlNmae = "Stack_line";
            controlNmae += i + "_" + p;
            $('#' + controlNmae).css("background", "#FFFFFF");
            $('#' + controlNmae).html(p);
        }
    }
 
    $.ajax({
        type: "post",
        url: "/AJAX/GetStackInfo.ashx",
        data: { action: "GetStackInfoProcess" },
        async: false,
        success: function (msg) {
 
            var json = JSON.parse(msg);
            for (var i = 0; i < json.length; i++) {
                var stack = new Stacker();
                var controlNmae = "Stack_line";
                var controlTableNmae = "ShowTable";
                stack.task_no = json[i].StackTaskNo;
                stack.row = json[i].StackLine;
                stack.col = json[i].StackColumn;
                stack.layer = json[i].StackLayer;
                stack.state = json[i].StackState_Execution;
                stack.number = json[i].SCNumber;
 
                controlNmae += stack.row + "_" + stack.col;
                controlTableNmae += stack.row + "_" + stack.col;
 
                $('#' + controlNmae).html(stack.task_no);
                $('#' + controlNmae).css("background", "#FFFF00");
 
                if (stack.state == "0")
                {
                    $('#Stack_State_' + stack.number).html("已完成");
                }
                else
                    $('#Stack_State_' + stack.number).html("正在执行");
              
                $('#Stack_TaskNo_' + stack.number).html(stack.task_no);
                $('#Stack_Line_' + stack.number).html(stack.row); 
                $('#Stack_Column_' + stack.number).html(stack.col);
                $('#Stack_Layer_' + stack.number).html(stack.layer);
                $('#Stack_Number_' + stack.number).html(stack.number);
                $('#' + controlNmae).popover({
                    trigger: 'click', //触发方式
                    title: "堆垛机:" + stack.task_no,//设置 弹出框 的标题
                    html: true, // 为true的话,data-content里就能放html代码了
                    placement: 'top',
                    content: ContentMethod(controlTableNmae, stack),//这里可以直接写字符串,也可以 是一个函数,该函数返回一个字符串
                    container: 'body'
                });
 
 
                $('#' + controlTableNmae + " tr:nth-child(2) td:nth-child(1)").html(stack.task_no);
                $('#' + controlTableNmae + " tr:nth-child(2) td:nth-child(2)").html(stack.row);
                $('#' + controlTableNmae + " tr:nth-child(2) td:nth-child(3)").html(stack.col);
                $('#' + controlTableNmae + " tr:nth-child(2) td:nth-child(4)").html(stack.layer);
            }
 
        }
    });
}
 
//关闭OPC服务
function CloseOpcServer() {
    $.ajax({
        type: "post",
        url: "/AJAX/OPCServiceOperation.ashx",
        data: { action: "StartOrCloseOpcServer", q0: 0 },
        async: false,
        success: function (msg) {
            if (msg.length > 0) {
                ShowMessage("关闭服务失败:" + msg);
            }
 
        }
    });
}
 
function GetData() {
 
    $.ajax({
        type: "post",
        url: "/AJAX/RequestOperation/RequestOperation_2.ashx",
        data: { action: "GetData" },
        async: false,
        success: function (msg) {
            if (msg.length > 0) {
                var json = JSON.parse(msg);
                for (var i = 0; i < json.length; i++) {
                    if (json[i].GroupName == "Cn0") {
 
 
                        // 巷道1001
                        if (json[i].ItemNo == "Item01") {
                            cline_1001.task_no = json[i].ItemValue;
                        }
                        if (json[i].ItemNo == "Item02") {
                            cline_1001.task_state = json[i].ItemValue;
                        }
                        if (json[i].ItemNo == "Item04") {
                            cline_1001.address = json[i].ItemValue;
                        }
                        if (json[i].ItemNo == "Item05") {
                            cline_1001.tray_nbr = json[i].ItemValue;
                        }
                        // 巷道1002
                        if (json[i].ItemNo == "Item07") {
                            cline_1002.task_no = json[i].ItemValue;
                        }
                        if (json[i].ItemNo == "Item08") {
                            cline_1002.task_state = json[i].ItemValue;
                        }
                        if (json[i].ItemNo == "Item10") {
                            cline_1002.address = json[i].ItemValue;
                        }
                        if (json[i].ItemNo == "Item11") {
                            cline_1002.tray_nbr = json[i].ItemValue;
                        }
                        // 巷道1005
                        if (json[i].ItemNo == "Item13") {
                            cline_1005.task_no = json[i].ItemValue;
                        }
                        if (json[i].ItemNo == "Item14") {
                            cline_1005.task_state = json[i].ItemValue;
                        }
                        if (json[i].ItemNo == "Item16") {
                            cline_1005.address = json[i].ItemValue;
                        }
                        if (json[i].ItemNo == "Item17") {
                            cline_1005.tray_nbr = json[i].ItemValue;
                        }
                        // 巷道1006
                        if (json[i].ItemNo == "Item19") {
                            cline_1006.task_no = json[i].ItemValue;
                        }
                        if (json[i].ItemNo == "Item20") {
                            cline_1006.task_state = json[i].ItemValue;
                        }
                        if (json[i].ItemNo == "Item22") {
                            cline_1006.address = json[i].ItemValue;
                        }
                        if (json[i].ItemNo == "Item23") {
                            cline_1006.tray_nbr = json[i].ItemValue;
                        }
                        // 巷道1010
                        if (json[i].ItemNo == "Item25") {
                            cline_1010.task_no = json[i].ItemValue;
                        }
                        if (json[i].ItemNo == "Item26") {
                            cline_1010.task_state = json[i].ItemValue;
                        }
                        if (json[i].ItemNo == "Item28") {
                            cline_1010.address = json[i].ItemValue;
                        }
                        if (json[i].ItemNo == "Item29") {
                            cline_1010.tray_nbr = json[i].ItemValue;
                        }
                        // 1001 AGV到位
                        if (json[i].ItemNo == "Item34") {
                            agv_arrive_1.arrive = json[i].ItemValue;
                        }
                        if (json[i].ItemNo == "Item36") {
                            agv_arrive_1.run = json[i].ItemValue;
                        }
                        if (json[i].ItemNo == "Item37") {
                            agv_arrive_1.leave = json[i].ItemValue;
                        }
                        // 1002 AGV到位
                        if (json[i].ItemNo == "Item35") {
                            agv_arrive_2.arrive = json[i].ItemValue;
                        }
                        if (json[i].ItemNo == "Item38") {
                            agv_arrive_2.run = json[i].ItemValue;
                        }
                        if (json[i].ItemNo == "Item39") {
                            agv_arrive_2.leave = json[i].ItemValue;
                        }
                    }
                    if (json[i].GroupName == "Cn1") {
                        //堆垛机_1
                        if (json[i].ItemNo == "Item04") {
                            stacker_1.switch_online = json[i].ItemValue;
                        }
                        if (json[i].ItemNo == "Item06") {
                            stacker_1.switch_manual = json[i].ItemValue;
                        }
                        if (json[i].ItemNo == "Item29") {
                            stacker_1.task_no = json[i].ItemValue;
                        }
                        if (json[i].ItemNo == "Item11") {
                            stacker_1.row = json[i].ItemValue;
                        }
                        if (json[i].ItemNo == "Item09") {
                            stacker_1.col = json[i].ItemValue;
                        }
                        if (json[i].ItemNo == "Item10") {
                            stacker_1.layer = json[i].ItemValue;
                        }
                        if (json[i].ItemNo == "Item12") {
                            stacker_1.fault_code = json[i].ItemValue;
                        }
                    }
                    if (json[i].GroupName == "Cn2") {
                        //堆垛机_2
                        if (json[i].ItemNo == "Item04") {
                            stacker_2.switch_online = json[i].ItemValue;
                        }
                        if (json[i].ItemNo == "Item06") {
                            stacker_2.switch_manual = json[i].ItemValue;
                        }
                        if (json[i].ItemNo == "Item29") {
                            stacker_2.task_no = json[i].ItemValue;
                        }
                        if (json[i].ItemNo == "Item11") {
                            stacker_2.row = json[i].ItemValue;
                        }
                        if (json[i].ItemNo == "Item09") {
                            stacker_2.col = json[i].ItemValue;
                        }
                        if (json[i].ItemNo == "Item10") {
                            stacker_2.layer = json[i].ItemValue;
                        }
                        if (json[i].ItemNo == "Item12") {
                            stacker_2.fault_code = json[i].ItemValue;
                        }
                    }
                    if (json[i].GroupName == "Cn3") {
                        //3号穿梭板 
                        if (json[i].ItemNo == "Item30") {
                            stv_3.power = json[i].ItemValue;
                        }
                        if (json[i].ItemNo == "Item15") {
                            stv_3.online_state = json[i].ItemValue;
                        }
                        if (json[i].ItemNo == "Item23") {
                            stv_3.running_state = json[i].ItemValue;
                        }
                        if (json[i].ItemNo == "Item25") {
                            stv_3.unusual_state = json[i].ItemValue;
                        }
                        if (json[i].ItemNo == "Item33") {
                            stv_3.standby = json[i].ItemValue;
                        }
                        if (json[i].ItemNo == "Item34") {
                            stv_3.task_no = json[i].ItemValue;
                        }
                        if (json[i].ItemNo == "Item28") {
                            stv_3.row = json[i].ItemValue;
                        }
                        if (json[i].ItemNo == "Item29") {
                            stv_3.rol = json[i].ItemValue;
                        }
                        if (json[i].ItemNo == "Item04") {
                            stv_3.layer = json[i].ItemValue;
                        }
                        if (json[i].ItemNo == "Item31") {
                            stv_3.current_face = json[i].ItemValue;
                        }
                        if (json[i].ItemNo == "Item10") {
                            stv_3.change_track_begin = json[i].ItemValue;
                        }
                        if (json[i].ItemNo == "Item19") {
                            stv_3.change_track_begin_complete = json[i].ItemValue;
                        }
                        if (json[i].ItemNo == "Item11") {
                            stv_3.change_track_end = json[i].ItemValue;
                        }
                        if (json[i].ItemNo == "Item20") {
                            stv_3.chage_track_end_complete = json[i].ItemValue;
                        }
                    }
                    if (json[i].GroupName == "Cn4") {
                        //4号穿梭板
                        if (json[i].ItemNo == "Item30") {
                            stv_4.power = json[i].ItemValue;
                        }
                        if (json[i].ItemNo == "Item15") {
                            stv_4.online_state = json[i].ItemValue;
                        }
                        if (json[i].ItemNo == "Item23") {
                            stv_4.running_state = json[i].ItemValue;
                        }
                        if (json[i].ItemNo == "Item25") {
                            stv_4.unusual_state = json[i].ItemValue;
                        }
                        if (json[i].ItemNo == "Item33") {
                            stv_4.standby = json[i].ItemValue;
                        }
                        if (json[i].ItemNo == "Item34") {
                            stv_4.task_no = json[i].ItemValue;
                        }
                        if (json[i].ItemNo == "Item28") {
                            stv_4.row = json[i].ItemValue;
                        }
                        if (json[i].ItemNo == "Item29") {
                            stv_4.rol = json[i].ItemValue;
                        }
                        if (json[i].ItemNo == "Item04") {
                            stv_4.layer = json[i].ItemValue;
                        }
                        if (json[i].ItemNo == "Item31") {
                            stv_4.current_face = json[i].ItemValue;
                        }
                        if (json[i].ItemNo == "Item10") {
                            stv_4.change_track_begin = json[i].ItemValue;
                        }
                        if (json[i].ItemNo == "Item19") {
                            stv_4.change_track_begin_complete = json[i].ItemValue;
                        }
                        if (json[i].ItemNo == "Item11") {
                            stv_4.change_track_end = json[i].ItemValue;
                        }
                        if (json[i].ItemNo == "Item20") {
                            stv_4.chage_track_end_complete = json[i].ItemValue;
                        }
                    }
                    if (json[i].GroupName == "Cn5") {
                        //5号穿梭板
                        if (json[i].ItemNo == "Item30") {
                            stv_5.power = json[i].ItemValue;
                        }
                        if (json[i].ItemNo == "Item15") {
                            stv_5.online_state = json[i].ItemValue;
                        }
                        if (json[i].ItemNo == "Item23") {
                            stv_5.running_state = json[i].ItemValue;
                        }
                        if (json[i].ItemNo == "Item25") {
                            stv_5.unusual_state = json[i].ItemValue;
                        }
                        if (json[i].ItemNo == "Item33") {
                            stv_5.standby = json[i].ItemValue;
                        }
                        if (json[i].ItemNo == "Item34") {
                            stv_5.task_no = json[i].ItemValue;
                        }
                        if (json[i].ItemNo == "Item28") {
                            stv_5.row = json[i].ItemValue;
                        }
                        if (json[i].ItemNo == "Item29") {
                            stv_5.rol = json[i].ItemValue;
                        }
                        if (json[i].ItemNo == "Item04") {
                            stv_5.layer = json[i].ItemValue;
                        }
                        if (json[i].ItemNo == "Item31") {
                            stv_5.current_face = json[i].ItemValue;
                        }
                        if (json[i].ItemNo == "Item10") {
                            stv_5.change_track_begin = json[i].ItemValue;
                        }
                        if (json[i].ItemNo == "Item19") {
                            stv_5.change_track_begin_complete = json[i].ItemValue;
                        }
                        if (json[i].ItemNo == "Item11") {
                            stv_5.change_track_end = json[i].ItemValue;
                        }
                        if (json[i].ItemNo == "Item20") {
                            stv_5.chage_track_end_complete = json[i].ItemValue;
                        }
                    }
                }
                // 输送线监控
                monitoringConveyerLineInfo("#conveyerline_1001", cline_1001);
                monitoringConveyerLineInfo("#conveyerline_1002", cline_1002);
                monitoringConveyerLineInfo("#conveyerline_1005", cline_1005);
                monitoringConveyerLineInfo("#conveyerline_1006", cline_1006);
                monitoringConveyerLineInfo("#conveyerline_1010", cline_1010);
 
                // 堆垛机监控
                $('#stacker_1 li').eq(0).css("background", "red");
 
                j++;
                if (j >= 10000) {
                    j = 2;
                }
            }
        }
    });
}
//判断当前输送节点上的情况
function monitoringConveyerLineInfo(equipment_id, obj) {
    var str = equipment_id.substring(equipment_id.length - 4);
    if ("0" != obj.task_no && "" != obj.task_no && null != obj.task_no) {
        $(equipment_id).css("background", "yellow");
        if (j == 1) {
            $(equipment_id).popover({
                trigger: 'click', //触发方式
                title: "输送机:" + str,//设置 弹出框 的标题
                html: true, // 为true的话,data-content里就能放html代码了
                placement: 'top',
                content: ContentMethod(obj),//这里可以直接写字符串,也可以 是一个函数,该函数返回一个字符串
                container: 'body'
            });
        }
    } else {
        $(equipment_id).css("background", "#90EE90");
    }
    //$("#popover973027 table").remove();
    //$("#popover973027 .popover-content").html("11111");
}
// 弹出框返回函数
function ContentMethod(tableID, obj) {
    return '<table class="table table-bordered" id="' + tableID + '">' +
               '<tr><td>任务号</td><td>任务类型</td><td>目的地址</td><td>托盘条码</td></tr>' +
               '<tr><td>' + obj.task_no + '</td><td>' + obj.row + '</td><td>' + obj.col + '</td><td>' + obj.layer + '</td></tr>' +
          //'<tr><td>' + 0 + '</td><td>' + 0 + '</td><td>' + 0 + '</td><td>' + 0 + '</td></tr>' +
           '</table>';
}
 
 
function ShowMessage(msg) {
    alertMsg({ style: 'info', text: '' + msg, title: 'Tip', callback: function () { } }).init()
}