| | |
| | | </el-dropdown> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column property="id" label="指令编号"> |
| | | <el-table-column property="id" label="#ID"> |
| | | </el-table-column> |
| | | <el-table-column property="wrkNo" label="工作号"> |
| | | </el-table-column> |
| | |
| | | } |
| | | this.getTableData() |
| | | }, |
| | | handleCommand(command, row) { |
| | | switch (command) { |
| | | case "showTask": |
| | | //查看任务 |
| | | this.showTask(row) |
| | | break; |
| | | case "executeCommand": |
| | | //执行指令 |
| | | this.executeCommand(row) |
| | | break; |
| | | case "completeCommand": |
| | | //完成指令 |
| | | this.completeCommand(row) |
| | | break; |
| | | } |
| | | }, |
| | | showTask(row) { |
| | | //查看任务 |
| | | $layui.layer.open({ |
| | | type: 2, |
| | | title: '任务管理', |
| | | maxmin: true, |
| | | area: [top.detailWidth, top.detailHeight], |
| | | shadeClose: true, |
| | | content: '../taskWrk/taskWrk.html?taskNo=' + row.taskNo + "&wrkNo=" + row.wrkNo, |
| | | success: function(layero, index) {} |
| | | }); |
| | | }, |
| | | tableRowClassName({row, rowIndex}) { |
| | | if (rowIndex === this.commandStep) { |
| | | return 'success-row'; |
| | | } |
| | | return ''; |
| | | }, |
| | | executeCommand(row) { |
| | | //执行指令 |
| | | let that = this |
| | | $.ajax({ |
| | | url: baseUrl + "/commandInfo/executeCommand", |
| | | headers: { |
| | | 'token': localStorage.getItem('token') |
| | | }, |
| | | data: { |
| | | id: row.id |
| | | }, |
| | | method: 'POST', |
| | | success: function(res) { |
| | | if (res.code == 200) { |
| | | that.$message({ |
| | | message: "执行成功", |
| | | type: 'success' |
| | | }); |
| | | that.getTableData() |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/"; |
| | | } else { |
| | | that.$message({ |
| | | message: res.msg, |
| | | type: 'error' |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | }, |
| | | completeCommand(row) { |
| | | //完成指令 |
| | | let that = this |
| | | $.ajax({ |
| | | url: baseUrl + "/commandInfo/completeCommand", |
| | | headers: { |
| | | 'token': localStorage.getItem('token') |
| | | }, |
| | | data: { |
| | | id: row.id |
| | | }, |
| | | method: 'POST', |
| | | success: function(res) { |
| | | if (res.code == 200) { |
| | | that.$message({ |
| | | message: "完成成功", |
| | | type: 'success' |
| | | }); |
| | | that.getTableData() |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/"; |
| | | } else { |
| | | that.$message({ |
| | | message: res.msg, |
| | | type: 'error' |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | }) |
| | | </script> |