wankeda
2025-06-24 1caea0fdc7ed1788d854a2aba8853984b4494e01
´úÂë¹ÜÀí/WMS/WIDESEA_WMSClient/src/extension/taskinfo/task.js
@@ -1,11 +1,11 @@
//此js文件是用来自定义扩展业务代码,可以扩展一些自定义页面或者重新配置生成的代码
import gridBody from '../basic/extend/printView.vue'
let extension = {
    components: {
      //查询界面扩展组件
      gridHeader: '',
      gridBody: '',
      gridBody: gridBody,
      gridFooter: '',
      //新建、编辑弹出框扩展组件
      modelHeader: '',
@@ -36,6 +36,243 @@
            });
        }
      }
//       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.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.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.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.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.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/TaskCompleted?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.$confirm('确认要取消此的任务吗?', '警告', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning',
          center: true
      }).then(() => {
          // let data = [];
          // let parm = {
          //     "data": data,
          //     "type": "1"
          // }
          let taskNums = rows.map(row => row.taskNum).join(',');
          this.http
            .post("api/Task/TaskCancel?taskNum="+taskNums, "数据处理中...")
            .then((x) => {
              if (x.status) {
                this.$Message.success('任务取消成功.');
                this.refresh();
              } else {
                return this.$error(x.message);
              }
            });
      });
  }
})
      let TaskHandCompletedBtn = this.buttons.find(x => x.value == 'TaskHandCompleted');
      if (TaskHandCompletedBtn) {
        TaskHandCompletedBtn.onClick = function () {
@@ -55,7 +292,24 @@
            });
        }
      }
          //框架初始化配置前,
          this.columns.push({
            field: '操作',
            title: '操作',
            width: 90,
            fixed: 'right',
            align: 'center',
            formatter: (row) => {
              return (
                '<i style="cursor: pointer;color: #2d8cf0;"class="el-icon-printer">打印</i>'
              );
            },
            click: (row) => {
              this.$refs.gridBody.open(row);
            }
          });
      },
      onInited() {
        //框架初始化配置后
        //如果要配置明细表,在此方法操作