Browse Source

Merge remote-tracking branch 'origin/master'

oyq28 8 months ago
parent
commit
5ef51c7c08

+ 7 - 0
imcs-ui/src/api/Dispatch.js

@@ -112,4 +112,11 @@ export default {
       data: {id: id}
     })
   },
+  taskNodeCallback(data){
+    return axiosApi({
+      method: 'POST',
+      url: `/authority/taskNode/taskNodeCallback`,
+      data
+    })
+  },
 }

+ 50 - 3
imcs-ui/src/views/zuihou/dispatchMgr/productLineInfo/Index.vue

@@ -47,10 +47,12 @@
               fixed="right"
               align="center"
               column-key="operation"
-              width="120px">
+              width="210px">
               <template slot-scope="{ row }">
-                <el-button v-if="row.exeStatus === '3' && row.exeResult != '1'" type="danger" @click="resendCommand(row)">指令重发</el-button>
-                <el-button v-if="row.exeStatus === '2'" type="primary"  @click="cancelTaskNodeLog(row)">取消任务</el-button>
+                <el-button v-if="row.exeStatus === '3' && row.exeResult != '1'" size="mini" type="danger" @click="resendCommand(row)">指令重发</el-button>
+                <el-button v-if="row.exeStatus === '2'" type="primary" size="mini"  @click="cancelTaskNodeLog(row)">取消任务</el-button>
+                <el-button v-if="row.exeStatus === '3' && row.exeResult != '1'" type="warning" size="mini"  @click="taskNodeCallback(row)">模拟回调</el-button>
+
                 <el-tooltip
                   class="item"
                   content="解锁库位"
@@ -419,6 +421,51 @@ export default {
         this.$message.info("已取消")
       })
     },
+    // 模拟ccs 设备回调
+    taskNodeCallback(row){
+      var params = {}
+      params.code = '1'
+      params.taskId = row.taskId
+      params.taskNodeId = row.taskNodeId
+
+      this.loading = true;
+      this.$confirm("是否确认模拟回调", this.$t('common.tips'), {
+        confirmButtonText: this.$t('common.confirm'),
+        cancelButtonText: this.$t('common.cancel'),
+        type: 'warning'
+      }).then(() => {
+        //模拟回调接口
+        dispatchMgrApi.taskNodeCallback(params).then((response)=>{
+          const res = response.data;
+          this.loading = false;
+          console.log(response)
+          if(res.isSuccess){
+            // 延迟两秒执行查询功能,因为模拟回调后,下一个任务会进入mq进行执行,所以执行数据会出现几毫秒的延迟,如果立马刷新,会导致数据查询不到
+            setTimeout(() => {
+              this.$message({
+              message:'模拟回调成功',
+              type: "success"
+            });
+              this.getLog();
+            }, 2000);
+          }else{
+            this.$message({
+              message:'模拟回调失败:' + res.msg,
+              type: "error"
+            });
+          }
+        }).catch(e=>{
+          this.loading = false;
+          this.$message({
+            message:'取消指令失败:' + e.message,
+            type: "error"
+          });
+        })
+      }).catch(() => {
+        this.loading = false;
+        this.$message.info("已取消")
+      })
+    },
     unlock(row){
       this.id = row.id
       this.dialogVisible = true