| | |
| | | <script type="text/javascript" src="../static/js/common.js"></script> |
| | | <script type="text/javascript" src="../static/vue/js/vue.min.js"></script> |
| | | <script type="text/javascript" src="../static/vue/element/element.js"></script> |
| | | <style> |
| | | .el-table .success-row { |
| | | background: #b6ff8e; |
| | | } |
| | | </style> |
| | | </head> |
| | | |
| | | <body> |
| | |
| | | </div> |
| | | |
| | | <el-dialog :title="shuttleCommandTitle" :visible.sync="shuttleCommandVisible"> |
| | | <el-table ref="singleTable" :data="shuttleCommandData.assignCommand.commands" style="width: 100%;"> |
| | | <el-table ref="singleTable" :data="shuttleCommandData.assignCommand.commands" style="width: 100%;" :row-class-name="tableRowClassName"> |
| | | <el-table-column property="mode" label="命令类型"> |
| | | </el-table-column> |
| | | <el-table-column property="start" label="起点"> |
| | |
| | | </el-table-column> |
| | | <el-table-column label="操作" width="100"> |
| | | <template slot-scope="scope"> |
| | | <el-button @click="shuttleCommandVisible = false" size="mini">回退指令</el-button> |
| | | <el-button @click="shuttleCommandRollback(scope)" size="mini">回退指令</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | shuttleCommandData: { |
| | | assignCommand: { |
| | | commands: [] |
| | | } |
| | | }, |
| | | commandStep: 0 |
| | | }, |
| | | shuttleCommandWrkNo: null, |
| | | shuttleCommandLabelWidth: '80px', |
| | | shuttleCommandTitle: '' |
| | | }, |
| | |
| | | this.cancelTask(row) |
| | | break; |
| | | case "shuttleCommand": |
| | | this.showShuttleCommand(row) |
| | | this.showShuttleCommand(row.wrkNo) |
| | | break; |
| | | } |
| | | }, |
| | | showShuttleCommand(row){ |
| | | showShuttleCommand(wrkNo){ |
| | | let that = this; |
| | | $.ajax({ |
| | | url: baseUrl + "/shuttle/command/query", |
| | |
| | | 'token': localStorage.getItem('token') |
| | | }, |
| | | data: { |
| | | wrkNo: row.wrkNo |
| | | wrkNo: wrkNo |
| | | }, |
| | | method: 'GET', |
| | | success: function(res) { |
| | |
| | | console.log(res) |
| | | that.shuttleCommandVisible = true; |
| | | that.shuttleCommandData = res.data; |
| | | that.shuttleCommandWrkNo = wrkNo; |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/"; |
| | | } else { |
| | |
| | | // }); |
| | | }); |
| | | }, |
| | | tableRowClassName({row, rowIndex}) { |
| | | if (rowIndex === this.shuttleCommandData.commandStep) { |
| | | return 'success-row'; |
| | | } |
| | | return ''; |
| | | }, |
| | | shuttleCommandRollback(scope) { |
| | | let that = this; |
| | | let idx = scope.$index; |
| | | $.ajax({ |
| | | url: baseUrl + "/shuttle/command/rollback", |
| | | headers: { |
| | | 'token': localStorage.getItem('token') |
| | | }, |
| | | data: { |
| | | wrkNo: that.shuttleCommandWrkNo, |
| | | commandStep: idx |
| | | }, |
| | | method: 'GET', |
| | | success: function(res) { |
| | | if (res.code == 200) { |
| | | that.showShuttleCommand(that.shuttleCommandWrkNo) |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/"; |
| | | } else { |
| | | that.$message({ |
| | | message: res.msg, |
| | | type: 'error' |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | }, |
| | | }) |
| | | </script> |