liulijun
2026-02-25 2b66d4c2dc5b1c00805fa47ba65d9a8d2724ab35
´úÂë¹ÜÀí/WMS/WMSClient/src/extension/taskinfo/task.js
@@ -1,6 +1,5 @@
import http from '@/api/http';
//此js文件是用来自定义扩展业务代码,可以扩展一些自定义页面或者重新配置生成的代码
let extension = {
    components: {
      //查询界面扩展组件
@@ -13,29 +12,12 @@
      modelFooter: ''
    },
    tableAction: '', //指定某张表的权限(这里填写表名,默认不用填写)
    buttons: { view: [], box: [], detail: [] }, //扩展的按钮
  buttons: {
    view: [], box: [], detail: []
  }, //扩展的按钮
    methods: {
       //下面这些方法可以保留也可以删除
      onInit() {  
        let TaskHandCancelBtn = this.buttons.find(x => x.value == 'TaskHandCancel');
      if (TaskHandCancelBtn) {
        TaskHandCancelBtn.onClick = function () {
          let rows = this.$refs.table.getSelected();
          if (rows.length == 0) return this.$error("请选择数据!");
          if (rows.length > 1) return this.$error("请选择一条数据!");
          var param = rows[0].taskNum;
          this.http
            .post("api/Task/TaskCancel?taskNum="+param, "数据处理中...")
            .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 () {
@@ -54,32 +36,6 @@
                .then((x) => {
                    if (x.status) {
                    this.$Message.success('任务手动完成');
                    this.refresh();
                  } else {
                    return this.$error(x.message);
                  }
                });
              });
        }
      }
      let ResendTaskBtn = this.buttons.find(x => x.value == 'ResendTask');
      if (ResendTaskBtn) {
        ResendTaskBtn.onClick = function () {
          this.$confirm("是否确认重新下发任务","重新下发任务警告",{
              confirmButtonText: "确定",
              cancelButtonText: "取消",
              type: "warning",
              center: true,
              }).then(() => {
                let rows = this.$refs.table.getSelected();
                if (rows.length == 0) return this.$error("请选择数据!");
                if (rows.length > 1) return this.$error("请选择一条数据!");
                var param = rows[0].taskNum;
                this.http
                .post("api/Task/ResendTask?taskNum="+param, "")
                .then((x) => {
                    if (x.status) {
                    this.$Message.success('任务重新下发');
                    this.refresh();
                  } else {
                    return this.$error(x.message);
@@ -126,4 +82,3 @@
    }
  };
  export default extension;