| <!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> | 
|         </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> |