| <!DOCTYPE html> | 
| <html lang="en"> | 
|   | 
| <head> | 
|     <meta charset="UTF-8"> | 
|     <title>RGV设备</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 border ref="singleTable" :data="tableData" highlight-current-row @row-click="handleRowClick" | 
|                 max-height="350" style="width: 100%"> | 
|                 <el-table-column property="rgvNo" label="RGV号"> | 
|                 </el-table-column> | 
|                 <el-table-column property="workNo1" label="工作号"> | 
|                 </el-table-column> | 
|                 <el-table-column property="statusType" label="模式"> | 
|                 </el-table-column> | 
|                 <el-table-column property="status" label="任务状态"> | 
|                 </el-table-column> | 
|                 <el-table-column property="walkPos" label="设备状态"> | 
|                 </el-table-column> | 
|                 <el-table-column property="barcode" 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.sourceStaNo" placeholder="源站/源库位"></el-input>--> | 
| <!--                            </el-form-item>--> | 
|                             <el-form-item label="源排"> | 
|                                 <el-input v-model="formParam.sourceRow" placeholder="排"></el-input> | 
|                             </el-form-item> | 
|                             <el-form-item label="源列"> | 
|                                 <el-input v-model="formParam.sourceBay" placeholder="列"></el-input> | 
|                             </el-form-item> | 
|                             <el-form-item label="源层"> | 
|                                 <el-input v-model="formParam.sourceLev" placeholder="层"></el-input> | 
|                             </el-form-item> | 
|                         </el-form> | 
|   | 
|                         <div> | 
|                             <el-button @click="requestOperate('auto')" type="warning">联机</el-button> | 
|                             <el-button @click="requestOperate('restoreTask')" type="warning">恢复联机任务</el-button> | 
|                             <el-button @click="requestOperate('compTask')" type="warning">强制完成任务</el-button> | 
|                             <br/> | 
|                             <br/> | 
|                             <el-button @click="requestOperate('stop')" type="warning">远程急停</el-button> | 
| <!--                            <el-button @click="requestOperate('noStop')" type="warning">取消急停</el-button>--> | 
|                             <el-button @click="requestOperate('reset')" 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-descriptions :title="currentTitle" direction="vertical" :column="4" border> | 
|                                 <el-descriptions-item label="RGV">{{ tableData[currentIndex].rgvNo }} | 
|                                 </el-descriptions-item> | 
|                                 <el-descriptions-item label="工作号"> | 
|                                     {{ tableData[currentIndex].workNo1 }} | 
|                                 </el-descriptions-item> | 
|                                 <el-descriptions-item label="模式"> | 
|                                     <el-tag>{{ tableData[currentIndex].statusType }}</el-tag> | 
|                                 </el-descriptions-item> | 
|                                 <el-descriptions-item label="任务状态"> | 
|   | 
|                                         <el-tag>{{ tableData[currentIndex].status}}</el-tag> | 
|   | 
|   | 
|                                 </el-descriptions-item> | 
|                                 <el-descriptions-item label="设备状态"> | 
|                                     <el-tag>{{ tableData[currentIndex].walkPos }}</el-tag> | 
|                                 </el-descriptions-item> | 
|                                 <el-descriptions-item label="故障代码">{{ tableData[currentIndex].warnCode }} | 
|                                 </el-descriptions-item> | 
|                                 <el-descriptions-item label="故障描述">{{ tableData[currentIndex].alarm }} | 
|                                 </el-descriptions-item> | 
|                                 <el-descriptions-item label="源站">{{ tableData[currentIndex].staNo }} | 
|                                 </el-descriptions-item> | 
|                                 <el-descriptions-item label="目标站">{{ tableData[currentIndex].sourceStaNo }} | 
|                                 </el-descriptions-item> | 
|                             </el-descriptions> | 
|                         </div> | 
|                     </div> | 
|                 </el-card> | 
|             </div> | 
|         </div> | 
|     </div> | 
|     <script> | 
|         var app = new Vue({ | 
|             el: '#app', | 
|             data: { | 
|                 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 | 
|                 }, | 
|                 enableIn: false, | 
|                 enableOut: false, | 
|                 options:[ | 
|                     { | 
|                         value:'1', | 
|                         label:'是' | 
|                     }, | 
|                     { | 
|                         value:'0', | 
|                         label:'否' | 
|                     } | 
|                 ] | 
|             }, | 
|             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 + "号RGV" | 
|                     this.formParam.rgvNo = row.rgvNo | 
|                     this.enableIn = row.inEnable == "Y" ? true : false | 
|                     this.enableOut = row.outEnable == "Y" ? true : false | 
|                 }, | 
|                 getTableData() { | 
|                     let that = this; | 
|                     $.ajax({ | 
|                         url: baseUrl + "/rgv/table/rgv/state", | 
|                         headers: { | 
|                             'token': localStorage.getItem('token') | 
|                         }, | 
|                         data: {}, | 
|                         dataType: 'json', | 
|                         contentType: 'application/json;charset=UTF-8', | 
|                         method: 'post', | 
|                         success: function (res) { | 
|                             that.tableData = res.data | 
|                         } | 
|                     }); | 
|                 }, | 
|                 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> |