#ZH
野心家
2025-05-27 1b9f41e12e3ee8ac8bbc388eab7585300bdab75a
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
<!DOCTYPE html>
<html lang="en">
 
<head>
    <meta charset="UTF-8">
    <title>输送站点设备</title>
    <link rel="stylesheet" href="../../static/wcs/css/element.css">
    <script type="text/javascript" src="../../static/wcs/js/jquery/jquery-3.3.1.min.js"></script>
    <script type="text/javascript" src="../../static/wcs/js/common.js"></script>
    <script type="text/javascript" src="../../static/wcs/js/vue.min.js"></script>
    <script type="text/javascript" src="../../static/wcs/js/element.js"></script>
</head>
 
<body>
    <div id="app" style="display: flex;justify-content: center;flex-wrap: wrap;">
        <div style="width: 100%;">
            <el-table ref="singleTable" :data="tableData" highlight-current-row @row-click="handleRowClick"
                max-height="450" style="width: 100%">
                <el-table-column property="rgvNo" label="小车号">
                </el-table-column>
                <el-table-column property="taskNo" label="工作号">
                </el-table-column>
                <el-table-column property="mode" label="作业模式">
                </el-table-column>
                <el-table-column property="status" label="状态">
                </el-table-column>
                <el-table-column property="rgvPos" label="当前定位值">
                </el-table-column>
                <el-table-column property="rgvPosDestination" label="目标定位置">
                </el-table-column>
                <el-table-column property="loaded" label="探物">
                </el-table-column>
                <el-table-column property="errorRgv" label="提示">
                </el-table-column>
            </el-table>
        </div>
 
        <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">
                        <span>设备调试</span>
                    </div>
                    <div>
                        <el-form :model="formParam" label-position="top" :inline="true" class="demo-form-inline">
                            <el-form-item label="目标定位置">
                                <el-input v-model="formParam.rgvPosDestination" placeholder="目标定位置"></el-input>
                            </el-form-item>
                            <el-form-item label="取货站点">
                                <el-input v-model="formParam.rgvStaNoTake" placeholder="目标站点"></el-input>
                            </el-form-item>
                            <el-form-item label="目标站点">
                                <el-input v-model="formParam.rgvStaNoPut" placeholder="目标站点"></el-input>
                            </el-form-item>
                        </el-form>
                        <div>
                            <el-button @click="requestOperate('take')" type="primary">取货</el-button>
                            <el-button @click="requestOperate('put')" type="primary">放货</el-button>
                            <el-button @click="requestOperate('TakeAndPut')" type="primary">取放货</el-button>
                            <el-button @click="requestOperate('walk')" type="warning">行走</el-button>
                            <el-button @click="requestOperate('del')" type="warning">任务清空</el-button>
                            <el-button @click="requestOperate('delRgvTask')" type="warning">小车强制复位(运行时不要操作,需要配合按钮)</el-button>
                        </div>
                    </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-table ref="singleTable" :data="taskAllData" highlight-current-row @row-click="handleRowClick"
                                      max-height="450" style="width: 100%">
                                <el-table-column property="rgvNo" label="小车号">
                                </el-table-column>
                                <el-table-column property="taskNo" label="工作号">
                                </el-table-column>
                                <el-table-column property="taskStatus" label="作业模式">
                                </el-table-column>
                                <el-table-column property="isRunning" label="状态">
                                </el-table-column>
                                <el-table-column property="targetPosition" label="目标定位置">
                                </el-table-column>
                                <el-table-column property="direction" label="方向">
                                </el-table-column>
                            </el-table>
                        </div>
                    </div>
                </el-card>
            </div>
        </div>
    </div>
    <script>
        var app = new Vue({
            el: '#app',
            data: {
                tableData: [],
                taskAllData: [],
                currentRow: null,
                currentTitle: "未选择设备",
                currentIndex: null,
                formParam: {
                    rgvNo: 0,
                    rgvStaNoTake: 0,
                    rgvStaNoPut: 0,
                    rgvPosDestination: 0
                }
            },
            created() {
                this.init()
            },
            watch: {
 
            },
            methods: {
                init() {
                    this.getTableData()
 
                    setInterval(() => {
                        this.getTableData()
                    }, 1000)
                },
                handleRowClick(row, col, event) {
                    const index = this.tableData.indexOf(row)
                    this.currentRow = row;
                    this.currentIndex = index
                    this.currentTitle = row.rgvNo + "小车"
                    
                    this.formParam.rgvNo = row.rgvNo
                    this.formParam.rgvStaNoTake = row.rgvStaNoTake
                    this.formParam.rgvStaNoPut = row.rgvStaNoPut
                    this.formParam.rgvPosDestination = row.rgvPosDestination
 
                    this.getTaskAllData(index+1)
                },
                getTaskAllData(index) {
                    let that = this;
                    $.ajax({
                        url: baseUrl + "/rgv/task/cache/all",
                        headers: {
                            'token': localStorage.getItem('token')
                        },
                        data: {rgvNo: index},
                        method: 'POST',
                        success: function (res) {
                            that.taskAllData = res.data
                        }
                    });
                },
                getTableData() {
                    let that = this;
                    $.ajax({
                        url: baseUrl + "/rgv/status/all",
                        headers: {
                            'token': localStorage.getItem('token')
                        },
                        data: {},
                        dataType: 'json',
                        contentType: 'application/json;charset=UTF-8',
                        method: 'GET',
                        success: function (res) {
                            that.tableData = res.data
                        }
                    });
                },
                requestOperate(method) {
                    let that = this
                    that.$confirm('此操作存在风险,是否继续','提示',{
                        confirmButtonText: '确定',
                        cancelButtonText: '取消',
                        type: 'warning'
                    }).then(()=>{
                        $.ajax({
                            url: baseUrl + "/rgv/run/"+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'
                                    });
                                }
                            }
                        });
                    })
 
                }
            }
        })
    </script>
</body>
 
</html>