| <!DOCTYPE html> | 
| <html lang="en"> | 
|   | 
| <head> | 
|     <meta charset="UTF-8"> | 
|     <title>硫化罐设备</title> | 
|     <link rel="stylesheet" href="../../static/css/element.css"> | 
|     <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> | 
|   | 
| <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="region" label="区域"> | 
|                 </el-table-column> | 
|                 <el-table-column property="jarCode" label="代号"> | 
|                 </el-table-column> | 
|                 <el-table-column property="jarErr" 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" 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="item" highlight-current-row max-height="350" style="width: 100%"> | 
|                             <el-table-column property="jarId" 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="模式"> | 
|                                     <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].jarErr }} | 
|                                 </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 | 
|                 }, | 
|                 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, | 
|                 item: [] | 
|             }, | 
|             created() { | 
|                 this.init() | 
|             }, | 
|             watch: { | 
|   | 
|             }, | 
|             methods: { | 
|                 historicalTasks(){ | 
|                     let that = this | 
|                     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.item = res.data | 
|                                 console.log(that.item) | 
|                             } | 
|                         }); | 
|                     } | 
|   | 
|                 }, | 
|                 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) | 
|                 }, | 
|                 handleRowClick(row, col, event) { | 
|                     var that = this | 
|                     const index = that.tableData.indexOf(row) | 
|                     that.currentRow = row; | 
|                     that.currentIndex = index | 
|                     that.currentTitle = row.jarNo + "号硫化罐" | 
|                     that.formParam.rgvNo = row.rgvNo | 
|                     that.enableIn = row.inEnable == "Y" ? true : false | 
|                     that.enableOut = row.outEnable == "Y" ? true : false | 
|   | 
|                     $.ajax({ | 
|                         url: baseUrl + "/basJarMast/JatId/auth", | 
|                         headers: { | 
|                             'token': localStorage.getItem('token') | 
|                         }, | 
|                         data: { | 
|                             id: row.jarNo | 
|                         }, | 
|                         success: function (res) { | 
|                             that.item = res.data | 
|                             console.log(that.item) | 
|                         } | 
|                     }); | 
|                 }, | 
|                 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> |