dengjunjie
2024-11-06 36230cd4dd0ebe5d21eede3eff6216908f7f7a8e
ÏîÄ¿´úÂë/WMS/WIDESEA_WMSClient/src/extension/basic/roadwayInfo.js
@@ -17,16 +17,54 @@
  methods: {
    //下面这些方法可以保留也可以删除
    onInit() {
      //设置编辑表单标签宽度
     this.boxOptions.labelWidth=160;
     //查询表单标签宽度
     this.labelWidth=160;
      let enableBtn = this.buttons.find(x => x.value == 'Enable');
      if (enableBtn) {
        enableBtn.onClick = function () {
          this.$message.success('自定义按钮点击事件');
          let rows = this.$refs.table.getSelected();
          if (rows.length == 0) return this.$error("请选择巷道!");
          let keys = rows.map(x => {
            return x[this.table.key];
          });
          if (!keys || keys.Length == 0) return this.$error("未获取到巷道信息!");
          this.$confirm("是否确认要启用巷道?", "提示", {
            confirmButtonText: "确认",//确认按钮文字更换
            cancelButtonText: "取消",//取消按钮文字更换
            showClose: true,//是否显示右上角关闭按钮
            type: "warning",//提示类型 success:成功/info:信息/warning:警告/error:报错
          }).then(() => {
            this.http.post("api/RoadwayInfo/RoadwayEnableStatus" , keys, "正在启用巷道....").then(x => {
              if (!x.status) return this.$error(x.message);
              this.$success("启用巷道成功!");
              this.refresh();
            });
          })
        }
      }
      let disableBtn = this.buttons.find(x => x.value == 'Disable');
      if (disableBtn) {
        disableBtn.onClick = function () {
          this.$message.success('自定义按钮点击事件');
          let rows = this.$refs.table.getSelected();
          if (rows.length == 0) return this.$error("请选择巷道!");
          let keys = rows.map(x => {
            return x[this.table.key];
          });
          if (!keys || keys.Length == 0) return this.$error("未获取到巷道信息!");
          this.$confirm("是否确认要禁用巷道?", "提示", {
            confirmButtonText: "确认",//确认按钮文字更换
            cancelButtonText: "取消",//取消按钮文字更换
            showClose: true,//是否显示右上角关闭按钮
            type: "warning",//提示类型 success:成功/info:信息/warning:警告/error:报错
          }).then(() => {
            this.http.post("api/RoadwayInfo/RoadwayDisableStatus" , keys, "正在禁用巷道....").then(x => {
              if (!x.status) return this.$error(x.message);
              this.$success("禁用巷道成功!");
              this.refresh();
            });
          })
        }
      }
    },