| | |
| | | { key: "dualCrnNo", prop: "dualCrnNo", label: "双工位堆垛机", minWidth: 120, sortable: true, align: "center" }, |
| | | { key: "batch", prop: "batch", label: "批次", minWidth: 120, sortable: true }, |
| | | { key: "batchSeq", prop: "batchSeq", label: "批次序列", width: 100, sortable: true, align: "center" }, |
| | | { key: "sendFailCount", prop: "sendFailCount", label: "失败次数", width: 96, sortable: true, align: "center" }, |
| | | { key: "errorTime$", prop: "errorTime$", label: "失败时间", minWidth: 168, sortable: true }, |
| | | { key: "errorMemo", prop: "errorMemo", label: "失败原因", minWidth: 220, sortable: false, showOverflow: false }, |
| | | { key: "systemMsg", prop: "systemMsg", label: "系统消息", minWidth: 220, sortable: false, showOverflow: false } |
| | | ]; |
| | | |
| | | var MANUAL_ROLLBACK_STATUSES = [6, 106, 506]; |
| | | |
| | | function cloneSearchForm() { |
| | | return { |
| | |
| | | } |
| | | if (command === "cancel") { |
| | | this.cancelTask(row); |
| | | return; |
| | | } |
| | | if (command === "manualRollback") { |
| | | this.manualRollbackTask(row); |
| | | } |
| | | }, |
| | | canManualRollback: function (row) { |
| | | return !!row && MANUAL_ROLLBACK_STATUSES.indexOf(Number(row.wrkSts)) > -1; |
| | | }, |
| | | completeTask: function (row) { |
| | | var vm = this; |
| | |
| | | }); |
| | | }).catch(function () {}); |
| | | }, |
| | | manualRollbackTask: function (row) { |
| | | var vm = this; |
| | | if (!vm.canManualRollback(row)) { |
| | | vm.$message.warning("当前任务不处于待人工回滚状态"); |
| | | return; |
| | | } |
| | | vm.$confirm("确定手动回滚该任务吗?回滚后任务会恢复为待执行状态。", "提示", { |
| | | type: "warning", |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消" |
| | | }).then(function () { |
| | | $.ajax({ |
| | | url: baseUrl + "/openapi/manualRollbackTask", |
| | | contentType: "application/json", |
| | | headers: { token: localStorage.getItem("token") }, |
| | | data: JSON.stringify({ wrkNo: row.wrkNo }), |
| | | method: "POST", |
| | | success: function (res) { |
| | | if (res.code === 200) { |
| | | vm.$message.success("人工回滚成功"); |
| | | vm.loadList(); |
| | | return; |
| | | } |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl + "/"; |
| | | return; |
| | | } |
| | | vm.$message.error(res.msg || "人工回滚失败"); |
| | | }, |
| | | error: function () { |
| | | vm.$message.error("人工回滚失败"); |
| | | } |
| | | }); |
| | | }).catch(function () {}); |
| | | }, |
| | | updateTableHeight: function () { |
| | | var viewport = window.innerHeight || document.documentElement.clientHeight || 860; |
| | | this.tableHeight = Math.max(340, viewport - (this.advancedVisible ? 276 : 222)); |