自动化立体仓库 - WMS系统
*
yxFwq
2025-02-25 9c7e5bc10f242b71f3d94e2c700cb7de79feda17
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
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
<!DOCTYPE html>
<html lang="en">
 
<head>
    <meta charset="UTF-8">
    <title>硫化罐设备</title>
    <link rel="stylesheet" href="../../static/css/element.css">
    <link rel="stylesheet" href="../../static/css/element-ui.css">
    <link rel="icon" href="../../static/images/favicon.ico" type="image/x-icon">
    <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script>
    <script type="text/javascript" src="../../static/js/common.js"></script>
    <script type="text/javascript" src="../../static/js/vue.min.js"></script>
    <script type="text/javascript" src="../../static/js/element.js"></script>
</head>
<style scoped>
    .floating-layer {
        position: fixed;
        top: 50%; /* 居中显示 */
        left: 50%; /* 居中显示 */
        transform: translate(-50%, -50%); /* 居中调整 */
        background-color: #fff;
        border: 2px solid #007bff; /* 使用更明显的边框颜色 */
        padding: 20px;
        box-shadow: 0 4px 8px rgba(0,0,0,0.2);
        border-radius: 8px;
        z-index: 1000; /* 确保在其他元素之上 */
        width: 300px; /* 设置固定宽度以保持整洁 */
        text-align: center; /* 内容居中 */
    }
 
    .layer-title {
        margin-bottom: 15px;
        font-size: 18px;
        font-weight: bold;
        color: #007bff; /* 与边框颜色相呼应 */
    }
 
    .radio-list {
        display: flex;
        flex-direction: column;
        align-items: center; /* 单选按钮居中 */
    }
 
    .radio-item {
        margin-bottom: 10px;
        display: flex;
        align-items: center;
        justify-content: center; /* 水平居中 */
        width: 100%; /* 使每个单选按钮项占据整个宽度 */
    }
 
    .radio-button {
        margin-right: 10px;
        transform: scale(1.2); /* 放大单选按钮以使其更加明显 */
    }
 
    .radio-label {
        font-size: 16px;
        cursor: pointer;
        user-select: none;
        color: #333; /* 使用深色调以提高可读性 */
    }
 
    /* 可选的动画效果 */
    .floating-layer {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
        transition: opacity 0.3s, transform 0.3s;
    }
 
    .floating-layer.show {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    /* 您需要在 Vue 中控制 'show' 类的添加和移除 */
</style>
 
<body>
    <div id="app" style="display: flex;justify-content: center;flex-wrap: wrap;">
        <div style="width: 100%;">
            <el-table border ref="singleTable" :data="tableData" highlight-current-row @row-click="handleRowClick"
                max-height="350" style="width: 100%">
                <el-table-column property="jarNo" label="硫化罐">
                </el-table-column>
<!--                <el-table-column property="workNo" label="工作号">-->
<!--                </el-table-column>-->
                <el-table-column property="jarStatus" label="状态">
                </el-table-column>
                <el-table-column property="jarMode" label="模式">
                </el-table-column>
                <el-table-column property="jarTemperature$" label="温度">
                </el-table-column>
                <el-table-column property="jarPressure$" label="压力">
                </el-table-column>
                <el-table-column property="jarCount$" label="最大储量">
                </el-table-column>
                <el-table-column property="jarErr" label="异常代码">
                </el-table-column>
                <el-table-column label="操作">
                    <template>
                        <el-popconfirm
                                confirm-button-text="Yes"
                                cancel-button-text="No"
                                title="确定要修改最大储量吗?请确保罐内数量大于等于修改值!!!"
                                @confirm="confirmEvent"
                                @cancel="cancelEvent"
                        >
                            <template #reference>
                                <el-button>修改最大储量</el-button>
                            </template>
                        </el-popconfirm>
                    </template>
<!--                        <el-button style="" type="primary" plain size="medium" @click="confirmEvent()">修改</el-button>-->
                </el-table-column>
            </el-table>
        </div>
        <template>
            <div v-if="valueUpdate" :class="['floating-layer', { show: showLayer }]">
                <h3 class="layer-title">请选择修改目标值</h3> <!-- 添加标题以提高可读性 -->
                <div class="radio-list">
                    <div
                            v-for="option in optionsUpdate"
                            :key="option.value"
                            class="radio-item"
                    >
                        <input
                                type="radio"
                                :value="option.value"
                                v-model="selectedOption"
                                @change="handleSubmit"
                                class="radio-button"
                        />
                        <label class="radio-label">{{ option.text }}</label>
                    </div>
                </div>
            </div>
        </template>
        <div style="width: 100%;display: flex;justify-content: center;margin-top: 10px;">
            <div style="width: 55%;margin-right: 10px;">
                <el-card class="box-card">
                    <div slot="header" class="clearfix" style="display: flex;justify-content: space-between;align-items: center">
                        <span>硫化库位</span>
                        <el-button style="" type="primary" plain size="medium" @click="historicalTasks()">历史任务</el-button>
                    </div>
                    <div v-if="currentIndex == null">
                        <el-empty description="请选择设备"></el-empty>
                    </div>
                    <div v-else>
                        <el-table border :data="itemMast" highlight-current-row max-height="400" style="width: 100%">
                            <el-table-column property="id" label="序号">
                            </el-table-column>
                            <el-table-column property="jarWrkNo" label="工作号">
                            </el-table-column>
                            <el-table-column property="status$" label="状态">
                            </el-table-column>
                            <el-table-column property="matnr" label="物料码">
                            </el-table-column>
                            <el-table-column property="maktx" label="物料名称">
                            </el-table-column>
                            <el-table-column property="weight" label="重量">
                            </el-table-column>
                        </el-table>
                    </div>
 
                </el-card>
            </div>
            <div style="width: 45%;">
                <el-card class="box-card">
                    <div slot="header" class="clearfix">
                        <span>设备状态</span>
                    </div>
                    <div>
                        <div v-if="currentIndex == null">
                            <el-empty description="请选择设备"></el-empty>
                        </div>
                        <div v-else>
                            <el-descriptions :title="currentTitle" direction="vertical" :column="4" border>
<!--                                <el-descriptions-item label="硫化罐">{{ tableData[currentIndex].jarNo }}-->
<!--                                </el-descriptions-item>-->
                                <el-descriptions-item label="区域">{{ tableData[currentIndex].region }}
                                </el-descriptions-item>
                                <el-descriptions-item label="代号">{{ tableData[currentIndex].jarCode }}
                                </el-descriptions-item>
<!--                                <el-descriptions-item label="模式">-->
<!--                                    <el-tag>{{ tableData[currentIndex].jarMode }}</el-tag>-->
<!--                                </el-descriptions-item>-->
<!--                                <el-descriptions-item label="设备状态">-->
<!--                                    <el-tag>{{ tableData[currentIndex].jarStatus }}</el-tag>-->
<!--                                </el-descriptions-item>-->
                                <el-descriptions-item label="左门">{{ tableData[currentIndex].leftDoor }}
                                </el-descriptions-item>
                                <el-descriptions-item label="右门">{{ tableData[currentIndex].rightDoor }}
                                </el-descriptions-item>
                                <el-descriptions-item label="左门可开">{{ tableData[currentIndex].leftInEnable }}
                                </el-descriptions-item>
                                <el-descriptions-item label="右门可开">{{ tableData[currentIndex].leftOutEnable }}
                                </el-descriptions-item>
                                <el-descriptions-item label="左门可关">{{ tableData[currentIndex].rightInEnable }}
                                </el-descriptions-item>
                                <el-descriptions-item label="右门可关">{{ tableData[currentIndex].rightOutEnable }}
                                </el-descriptions-item>
 
<!--                                <el-descriptions-item label="温度">{{ tableData[currentIndex].jarTemperature$ }}-->
<!--                                </el-descriptions-item>-->
<!--                                <el-descriptions-item label="压力">{{ tableData[currentIndex].jarPressure$ }}-->
<!--                                </el-descriptions-item>-->
<!--                                <el-descriptions-item label="最大储量">{{ tableData[currentIndex].jarCount$ }}-->
<!--                                </el-descriptions-item>-->
<!--                                <el-descriptions-item label="故障代码">{{ tableData[currentIndex].jarErr }}-->
<!--                                </el-descriptions-item>-->
                                <el-descriptions-item label="左门开门状态">{{ tableData[currentIndex].leftDoorOpen }}
                                </el-descriptions-item>
                                <el-descriptions-item label="左门关门状态">{{ tableData[currentIndex].leftDoorClose }}
                                </el-descriptions-item>
                                <el-descriptions-item label="右门开门状态">{{ tableData[currentIndex].rightDoorOpen }}
                                </el-descriptions-item>
                                <el-descriptions-item label="右门关门状态">{{ tableData[currentIndex].rightDoorClose }}
                                </el-descriptions-item>
                                <el-descriptions-item label="最近一次保温时间">{{ tableData[currentIndex].holdingTime }}
                                </el-descriptions-item>
                                <el-descriptions-item label="最近一次开门时间">{{ tableData[currentIndex].openTime }}
                                </el-descriptions-item>
                                <el-descriptions-item label="最近一次关门时间">{{ tableData[currentIndex].closeTime }}
                                </el-descriptions-item>
                            </el-descriptions>
 
                        </div>
                    </div>
                </el-card>
            </div>
        </div>
 
    </div>
    <script>
        var app = new Vue({
            el: '#app',
            data: {
                showLayer: false,
                valueUpdate: false,
                selectedOption: null,
                updateJarNo: null,
                optionsUpdate: [
                    { id: '1', value: '1', text: '1托' },
                    { id: '2', value: '2', text: '2托' },
                    { id: '3', value: '3', text: '3托' },
                    { id: '4', value: '4', text: '4托' },
                    { id: '5', value: '5', text: '5托' },
                    { id: '6', value: '6', text: '6托' },
                    { id: '7', value: '7', text: '7托' },
                    { id: '999', value: '999', text: '取消' },
                ],
                tableData: [],
                currentRow: null,
                currentTitle: "未选择设备",
                currentIndex: null,
                formParam: {
                    rgvNo: null,
                    sourceStaNo: null,
                    sourceRow: 1,
                    sourceBay: 0,
                    sourceLev: 1,
                    staNo: null,
                    row: 1,
                    bay: 0,
                    lev: 1,
                    barcode:null,
                    barcodeType:null,
                    emptyContainer:null
                },
                formParamD: {
                    rgvNo: null,
                    sourceStaNo: null,
                    sourceRow: 1,
                    sourceBay: 0,
                    sourceLev: 1,
                    staNo: null,
                    row: 1,
                    bay: 0,
                    lev: 1,
                    barcode:null,
                    barcodeType:null,
                    emptyContainer:null
                },
                enableIn: false,
                enableOut: false,
                options:[
                    {
                        value:'1',
                        label:'是'
                    },
                    {
                        value:'0',
                        label:'否'
                    }
                ],
                demo: 'X',
                rgvMode: 0,
                itemMast: []
            },
            created() {
                this.init()
            },
            watch: {
                valueUpdate(newVal) {
                    if (newVal) {
                        this.showLayer = true;
                        // 可以在这里添加延时关闭层或其他逻辑
                    }
                },
            },
            methods: {
                historicalTasks(){
                    let that = this
                    that.selectedOption = 0;
                    that.valueUpdate = false;
                    if (that.currentIndex != null){
                        $.ajax({
                            url: baseUrl + "/basJarMastLog/historicalTasks/auth",
                            headers: {
                                'token': localStorage.getItem('token')
                            },
                            data:{
                                id: that.tableData[that.currentIndex].jarNo
                            },
                            success: function (res) {
                                that.itemMast = res.data
                                // console.log(that.itemMast)
                            }
                        });
                    }
 
                },
                staTova(sta,end){
                    let that = this
                    that.$confirm('此操作存在风险,是否继续','提示',{
                        confirmButtonText: '确定',
                        cancelButtonText: '取消',
                        type: 'warning'
                    }).then(()=>{
                        $.ajax({
                            url: baseUrl + "/rgv/rgvDemoTask",
                            headers: {
                                'token': localStorage.getItem('token')
                            },
                            data:{
                                rgvNo : this.formParam.rgvNo,
                                sta : sta,
                                end : end
                            },
                            method: 'Get',
                            success: function (res) {
                                if (res.code == 200) {
                                    that.$message({
                                        message: res.msg,
                                        type: 'success'
                                    });
                                } else {
                                    that.$message({
                                        message: res.msg,
                                        type: 'error'
                                    });
                                }
                            }
                        });
                    })
                },
                init() {
                    this.getTableData()
 
                    setInterval(() => {
                        this.getTableData()
                        // this.demoStatus()
                    }, 1000)
                },
                confirmEvent() {
                    var that = this
                    that.valueUpdate = true;
                },
                cancelEvent() {
                    var that = this
                    that.valueUpdate = false;
                },
                handleSubmit() {
                    if ( this.selectedOption > 998 ){
                        this.selectedOption = 0;
                        this.valueUpdate = false;
                    } else if ( this.selectedOption > 0 ){
                        var that = this
                        if (that.updateJarNo == null){
                            console.log("this.updateJarNo;null;null;null;null;null")
                        } else {
                            $.ajax({
                                url: baseUrl + "/basJar/update/uodate/jar/count/auth",
                                headers: {
                                    'token': localStorage.getItem('token')
                                },
                                data: {
                                    jarCount: that.selectedOption,
                                    jarNo: that.updateJarNo
                                },
                                success: function (res) {
                                    if (res.code == 200) {
                                        that.$message({
                                            message: res.msg,
                                            type: 'success'
                                        });
                                    } else {
                                        that.$message({
                                            message: res.msg,
                                            type: 'error'
                                        });
                                    }
                                }
                            });
                        }
                        this.selectedOption = 0;
                        this.valueUpdate = false;
                    }
                },
                handleRowClick(row, col, event) {
                    var that = this
                    const index = that.tableData.indexOf(row)
                    that.currentRow = row;
                    that.currentIndex = index
                    this.updateJarNo = row.jarNo
                    that.currentTitle = row.jarNo + "号硫化罐"
                    that.formParam.rgvNo = row.rgvNo
                    that.enableIn = row.inEnable == "Y" ? true : false
                    that.enableOut = row.outEnable == "Y" ? true : false
                    this.selectedOption = 0;
                    this.valueUpdate = false;
 
                    $.ajax({
                        url: baseUrl + "/basJarMast/JatId/auth",
                        headers: {
                            'token': localStorage.getItem('token')
                        },
                        data: {
                            id: row.jarNo
                        },
                        success: function (res) {
                            that.itemMast = res.data
                            // console.log(that.itemMast)
                        }
                    });
                },
                getTableData() {
                    let that = this;
                    $.ajax({
                        url: baseUrl + "/table/jar/state",
                        headers: {
                            'token': localStorage.getItem('token')
                        },
                        data: {},
                        dataType: 'json',
                        contentType: 'application/json;charset=UTF-8',
                        method: 'post',
                        success: function (res) {
                            that.tableData = res.data
                        }
                    });
                },
                demoStatus() {
                    let that = this;
                    $.ajax({
                        url: baseUrl + "/rgv/demo/status",
                        data:{
                            rgvNo : this.formParam.rgvNo
                        },
                        headers: {
                            'token': localStorage.getItem('token')
                        },
                        contentType: 'application/json;charset=UTF-8',
                        method: 'get',
                        success: function (res) {
                            // console.log(res)
                            that.demo = res.data.demo
                            that.rgvMode = res.data.rgvMode
                        }
                    });
                },
                initiate(){
                    let that = this
                    that.$confirm('此操作存在风险,是否继续','提示',{
                        confirmButtonText: '确定',
                        cancelButtonText: '取消',
                        type: 'warning'
                    }).then(()=>{
                        $.ajax({
                            url: baseUrl + "/rgv/operator/put",
                            headers: {
                                'token': localStorage.getItem('token')
                            },
                            data: this.formParam,
                            method: 'POST',
                            success: function (res) {
                                if (res.code == 200) {
                                    that.$message({
                                        message: res.msg,
                                        type: 'success'
                                    });
                                } else {
                                    that.$message({
                                        message: res.msg,
                                        type: 'error'
                                    });
                                }
                            }
                        });
                    })
                },
                initiateD(method){
                    let urlS = "/rgv/operator/single/step/three/put";
                    if (method===1){
                        urlS = "/rgv/operator/single/step/one/put";
                    }else if (method === 2){
                        urlS = "/rgv/operator/single/step/two/put";
                    }else if (method === 3){
                        urlS = "/rgv/operator/single/step/three/put";
                    }
                    let that = this
                    that.$confirm('此操作存在风险,是否继续','提示',{
                        confirmButtonText: '确定',
                        cancelButtonText: '取消',
                        type: 'warning'
                    }).then(()=>{
                        $.ajax({
                            url: baseUrl + urlS,
                            headers: {
                                'token': localStorage.getItem('token')
                            },
                            data: this.formParam,
                            method: 'POST',
                            success: function (res) {
                                if (res.code == 200) {
                                    that.$message({
                                        message: res.msg,
                                        type: 'success'
                                    });
                                } else {
                                    that.$message({
                                        message: res.msg,
                                        type: 'error'
                                    });
                                }
                            }
                        });
                    })
                },
                demos(method){
                    let that = this
                    that.$confirm('此操作存在风险,是否继续','提示',{
                        confirmButtonText: '确定',
                        cancelButtonText: '取消',
                        type: 'warning'
                    }).then(()=>{
                        $.ajax({
                            url: baseUrl + "/rgv/demo/status/" + method,
                            headers: {
                                'token': localStorage.getItem('token')
                            },
                            data:{
                                rgvNo : this.formParam.rgvNo
                            },
                            method: 'Get',
                            success: function (res) {
                                if (res.code == 200) {
                                    that.$message({
                                        message: res.msg,
                                        type: 'success'
                                    });
                                } else {
                                    that.$message({
                                        message: res.msg,
                                        type: 'error'
                                    });
                                }
                            }
                        });
                    })
                },
                rgvStatus(method){
                    let that = this
                    that.$confirm('此操作存在风险,是否继续','提示',{
                        confirmButtonText: '确定',
                        cancelButtonText: '取消',
                        type: 'warning'
                    }).then(()=>{
                        $.ajax({
                            url: baseUrl + "/rgv/demo/status/rgvStatus",
                            headers: {
                                'token': localStorage.getItem('token')
                            },
                            data:{
                                rgvNo : this.formParam.rgvNo,
                                status : Number(method)
                            },
                            method: 'Get',
                            success: function (res) {
                                if (res.code == 200) {
                                    that.$message({
                                        message: res.msg,
                                        type: 'success'
                                    });
                                } else {
                                    that.$message({
                                        message: res.msg,
                                        type: 'error'
                                    });
                                }
                            }
                        });
                    })
                },
                requestOperate(method) {
                    let that = this
                    that.$confirm('此操作存在风险,是否继续','提示',{
                        confirmButtonText: '确定',
                        cancelButtonText: '取消',
                        type: 'warning'
                    }).then(()=>{
                        $.ajax({
                            url: baseUrl + "/rgv/operator/" + method,
                            headers: {
                                'token': localStorage.getItem('token')
                            },
                            data: this.formParam,
                            method: 'POST',
                            success: function (res) {
                                if (res.code == 200) {
                                    that.$message({
                                        message: res.msg,
                                        type: 'success'
                                    });
                                } else {
                                    that.$message({
                                        message: res.msg,
                                        type: 'error'
                                    });
                                }
                            }
                        });
                    })
 
                },
                updateEnableInOut(type) {
                    let that = this
                    let param = {}
                    if (type == "in") {
                        param = {
                            inEnable: this.enableIn ? "Y" : "N",
                            rgvNo: this.formParam.rgvNo
                        }
                    } else {
                        param = {
                            outEnable: this.enableOut ? "Y" : "N",
                            rgvNo: this.formParam.rgvNo
                        }
                    }
 
                    $.ajax({
                        url: baseUrl + "/basCrnp/update/auth",
                        headers: {
                            'token': localStorage.getItem('token')
                        },
                        data: param,
                        method: 'POST',
                        success: function (res) {
                            if (res.code == 200) {
                                that.$message({
                                    message: res.msg,
                                    type: 'success'
                                });
                            } else {
                                that.$message({
                                    message: res.msg,
                                    type: 'error'
                                });
                            }
                        }
                    });
                }
            }
        })
    </script>
</body>
 
</html>