wankeda
2025-04-25 724f42c61e81de643ff94256b2ab3661533f5106
´úÂë¹ÜÀí/WMS/WIDESEA_WMSClient/src/extension/taskinfo/task.js
@@ -36,175 +36,176 @@
            });
        }
      }
      this.buttons.splice(1, 0, {
        name: "撤销任务",
        icon: 'md-refresh',
        type: 'primary',
        onClick: function () {
            let rows = this.$refs.table.getSelected();
            if (rows.length == 0) return this.$error("请选择要撤销的任务");
//       this.buttons.splice(1, 0, {
//         name: "撤销任务",
//         icon: 'md-refresh',
//         type: 'primary',
//         onClick: function () {
//             let rows = this.$refs.table.getSelected();
//             if (rows.length == 0) return this.$error("请选择要撤销的任务");
            this.$confirm('确认要撤销已下发的任务吗?', '警告', {
                confirmButtonText: '确定',
                cancelButtonText: '取消',
                type: 'warning',
                center: true
            }).then(() => {
                let data = [];
                let parm = {
                    "data": data,
                    "type": "1"
                }
                var param = rows[0].taskNum;
                this.http
                  .post("api/Task/AGVTaskrevokes?taskNum="+param, "数据处理中...")
                  .then((x) => {
                    if (x.status) {
                      this.$Message.success('任务撤销成功.');
                      this.refresh();
                    } else {
                      return this.$error(x.message);
                    }
                  });
            });
        }
    })
//             this.$confirm('确认要撤销已下发的任务吗?', '警告', {
//                 confirmButtonText: '确定',
//                 cancelButtonText: '取消',
//                 type: 'warning',
//                 center: true
//             }).then(() => {
//                 let data = [];
//                 let parm = {
//                     "data": data,
//                     "type": "1"
//                 }
//                 var param = rows[0].taskNum;
//                 this.http
//                   .post("api/Task/AGVTaskrevokes?taskNum="+param, "数据处理中...")
//                   .then((x) => {
//                     if (x.status) {
//                       this.$Message.success('任务撤销成功.');
//                       this.refresh();
//                     } else {
//                       return this.$error(x.message);
//                     }
//                   });
//             });
//         }
//     })
    this.buttons.splice(1, 0, {
      name: "继续任务",
      icon: 'md-refresh',
      type: 'primary',
      onClick: function () {
          let rows = this.$refs.table.getSelected();
          if (rows.length == 0) return this.$error("请选择要继续的任务");
//     this.buttons.splice(1, 0, {
//       name: "继续任务",
//       icon: 'md-refresh',
//       type: 'primary',
//       onClick: function () {
//           let rows = this.$refs.table.getSelected();
//           if (rows.length == 0) return this.$error("请选择要继续的任务");
          this.$confirm('确认要继续此任务吗?', '警告', {
              confirmButtonText: '确定',
              cancelButtonText: '取消',
              type: 'warning',
              center: true
          }).then(() => {
              let data = [];
              let parm = {
                  "data": data,
                  "type": "1"
              }
              var param = rows[0].taskNum;
              this.http
                .post("api/Task/AGVTaskConts?taskNum="+param, "数据处理中...")
                .then((x) => {
                  if (x.status) {
                    this.$Message.success('继续任务成功.');
                    this.refresh();
                  } else {
                    return this.$error(x.message);
                  }
                });
          });
      }
  })
//           this.$confirm('确认要继续此任务吗?', '警告', {
//               confirmButtonText: '确定',
//               cancelButtonText: '取消',
//               type: 'warning',
//               center: true
//           }).then(() => {
//               let data = [];
//               let parm = {
//                   "data": data,
//                   "type": "1"
//               }
//               var param = rows[0].taskNum;
//               this.http
//                 .post("api/Task/AGVTaskConts?taskNum="+param, "数据处理中...")
//                 .then((x) => {
//                   if (x.status) {
//                     this.$Message.success('继续任务成功.');
//                     this.refresh();
//                   } else {
//                     return this.$error(x.message);
//                   }
//                 });
//           });
//       }
//   })
  this.buttons.splice(1, 0, {
    name: "完成任务",
    icon: 'md-refresh',
    type: 'primary',
    onClick: function () {
        let rows = this.$refs.table.getSelected();
        if (rows.length == 0) return this.$error("请选择要完成的任务");
//   this.buttons.splice(1, 0, {
//     name: "完成任务",
//     icon: 'md-refresh',
//     type: 'primary',
//     onClick: function () {
//         let rows = this.$refs.table.getSelected();
//         if (rows.length == 0) return this.$error("请选择要完成的任务");
        this.$confirm('确认要完成此任务吗?', '警告', {
            confirmButtonText: '确定',
            cancelButtonText: '取消',
            type: 'warning',
            center: true
        }).then(() => {
            let data = [];
            let parm = {
                "data": data,
                "type": "1"
            }
            var param = rows[0].taskNum;
            this.http
              .post("api/Task/AGVTaskEnds?taskNum="+param, "数据处理中...")
              .then((x) => {
                if (x.status) {
                  this.$Message.success('完成任务成功.');
                  this.refresh();
                } else {
                  return this.$error(x.message);
                }
              });
        });
    }
})
//         this.$confirm('确认要完成此任务吗?', '警告', {
//             confirmButtonText: '确定',
//             cancelButtonText: '取消',
//             type: 'warning',
//             center: true
//         }).then(() => {
//             let data = [];
//             let parm = {
//                 "data": data,
//                 "type": "1"
//             }
//             var param = rows[0].taskNum;
//             this.http
//               .post("api/Task/AGVTaskEnds?taskNum="+param, "数据处理中...")
//               .then((x) => {
//                 if (x.status) {
//                   this.$Message.success('完成任务成功.');
//                   this.refresh();
//                 } else {
//                   return this.$error(x.message);
//                 }
//               });
//         });
//     }
// })
this.buttons.splice(1, 0, {
  name: "暂停任务",
  icon: 'md-refresh',
  type: 'primary',
  onClick: function () {
      let rows = this.$refs.table.getSelected();
      if (rows.length == 0) return this.$error("请选择要暂停的任务");
// this.buttons.splice(1, 0, {
//   name: "暂停任务",
//   icon: 'md-refresh',
//   type: 'primary',
//   onClick: function () {
//       let rows = this.$refs.table.getSelected();
//       if (rows.length == 0) return this.$error("请选择要暂停的任务");
      this.$confirm('确认要暂停此任务吗?', '警告', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning',
          center: true
      }).then(() => {
          let data = [];
          let parm = {
              "data": data,
              "type": "1"
          }
          var param = rows[0].taskNum;
          this.http
            .post("api/Task/AGVTaskSuspends?taskNum="+param, "数据处理中...")
            .then((x) => {
              if (x.status) {
                this.$Message.success('任务暂停成功.');
                this.refresh();
              } else {
                return this.$error(x.message);
              }
            });
      });
  }
})
//       this.$confirm('确认要暂停此任务吗?', '警告', {
//           confirmButtonText: '确定',
//           cancelButtonText: '取消',
//           type: 'warning',
//           center: true
//       }).then(() => {
//           let data = [];
//           let parm = {
//               "data": data,
//               "type": "1"
//           }
//           var param = rows[0].taskNum;
//           this.http
//             .post("api/Task/AGVTaskSuspends?taskNum="+param, "数据处理中...")
//             .then((x) => {
//               if (x.status) {
//                 this.$Message.success('任务暂停成功.');
//                 this.refresh();
//               } else {
//                 return this.$error(x.message);
//               }
//             });
//       });
//   }
// })
this.buttons.splice(1, 0, {
  name: "恢复任务",
  icon: 'md-refresh',
  type: 'primary',
  onClick: function () {
      let rows = this.$refs.table.getSelected();
      if (rows.length == 0) return this.$error("请选择要恢复的任务");
// this.buttons.splice(1, 0, {
//   name: "恢复任务",
//   icon: 'md-refresh',
//   type: 'primary',
//   onClick: function () {
//       let rows = this.$refs.table.getSelected();
//       if (rows.length == 0) return this.$error("请选择要恢复的任务");
      this.$confirm('确认要恢复此的任务吗?', '警告', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning',
          center: true
      }).then(() => {
          let data = [];
          let parm = {
              "data": data,
              "type": "1"
          }
          var param = rows[0].taskNum;
          this.http
            .post("api/Task/AGVTaskRecoverys?taskNum="+param, "数据处理中...")
            .then((x) => {
              if (x.status) {
                this.$Message.success('任务恢复成功.');
                this.refresh();
              } else {
                return this.$error(x.message);
              }
            });
      });
  }
})
//       this.$confirm('确认要恢复此的任务吗?', '警告', {
//           confirmButtonText: '确定',
//           cancelButtonText: '取消',
//           type: 'warning',
//           center: true
//       }).then(() => {
//           let data = [];
//           let parm = {
//               "data": data,
//               "type": "1"
//           }
//           var param = rows[0].taskNum;
//           this.http
//             .post("api/Task/AGVTaskRecoverys?taskNum="+param, "数据处理中...")
//             .then((x) => {
//               if (x.status) {
//                 this.$Message.success('任务恢复成功.');
//                 this.refresh();
//               } else {
//                 return this.$error(x.message);
//               }
//             });
//       });
//   }
// })
this.buttons.splice(1, 0, {
  name: "手动完成任务",
  icon: 'md-refresh',