|  |  |  | 
|---|
|  |  |  | </el-table-column> | 
|---|
|  |  |  | <el-table-column show-overflow-tooltip property="durationTime" label="持续时长"> | 
|---|
|  |  |  | </el-table-column> | 
|---|
|  |  |  | <el-table-column property="commandType" label="指令类型"> | 
|---|
|  |  |  | <el-table-column property="commandType$" label="指令类型"> | 
|---|
|  |  |  | </el-table-column> | 
|---|
|  |  |  | <el-table-column property="device" label="设备"> | 
|---|
|  |  |  | </el-table-column> | 
|---|
|  |  |  | 
|---|
|  |  |  | tableSearchParam: { | 
|---|
|  |  |  | task_no: null, | 
|---|
|  |  |  | status: null, | 
|---|
|  |  |  | wrk_no: null | 
|---|
|  |  |  | wrk_no: null, | 
|---|
|  |  |  | barcode: null, | 
|---|
|  |  |  | start_point: null, | 
|---|
|  |  |  | target_point : null | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | commandStep: -1 | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return ''; | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | 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) { | 
|---|
|  |  |  | let wrkNo = row.wrkNo == null ? "" : row.wrkNo | 
|---|
|  |  |  | console.log(wrkNo) | 
|---|
|  |  |  | //查看指令 | 
|---|
|  |  |  | $layui.layer.open({ | 
|---|
|  |  |  | type: 2, | 
|---|
|  |  |  | title: '任务管理', | 
|---|
|  |  |  | maxmin: true, | 
|---|
|  |  |  | area: [top.detailWidth, top.detailHeight], | 
|---|
|  |  |  | shadeClose: true, | 
|---|
|  |  |  | content: '../taskWrk/taskWrk.html?taskNo=' + row.taskNo + "&wrkNo=" + wrkNo, | 
|---|
|  |  |  | success: function(layero, index) {} | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | 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> | 
|---|