guoshilong
2022-09-20 519b2befd64b3922a19a28e8c6eb8d988d1cd701
src/views/eventgm/eventgm.vue
@@ -18,6 +18,19 @@
               @size-change="sizeChange"
               @refresh-change="refreshChange"
               @on-load="onLoad">
      <template slot-scope="{type,size,row,index}" slot="menuBtn">
        <el-dropdown-item icon="el-icon-check" :size="size" :type="type"
                          :disabled="row.state >= 1"
                          @click.native="createOrder">生成维修工单</el-dropdown-item>
        <!--divided 是一个划分线-->
        <el-dropdown-item divided icon="el-icon-error" :size="size" :type="type"
                          :disabled="row.state >= 2"
                          @click.native="handleDisposal(row)">拒绝</el-dropdown-item>
      </template>
      <template slot-scope="{type,size,row,index}" slot="menu">
        <el-button icon="el-icon-edit" :size="size" :type="type" :disabled="row.state >= 1" @click="$refs.crud.rowEdit(row,index)">编 辑</el-button>
        <el-button icon="el-icon-delete" :size="size" :type="type" :disabled="row.state >= 1" @click="$refs.crud.rowDel(row,index)">删 除</el-button>
      </template>
      <template slot="menuLeft">
        <el-button type="danger"
                   size="small"
@@ -26,9 +39,6 @@
                   v-if="permission.eventgm_delete"
                   @click="handleDelete">删 除
        </el-button>
      </template>
      <template slot="menuLeft">
        <el-button icon="el-icon-check" type="success" size="small" @click="handleDisposal">事件处置</el-button>
      </template>
    </avue-crud>
@@ -170,6 +180,9 @@
              "latitude": this.form.latitude
            }
          });
        } else {
          this.form.source = 'WEB'
          this.form.state = '0'
        }
        done();
      },
@@ -209,20 +222,13 @@
          this.selectionClear();
        });
      },
      handleDisposal() {
        if (this.selectionList.length === 0) {
          this.$message.warning("请选择至少一条数据");
          return;
        }
        if (this.selectionList.length > 1) {
          this.$message.warning("请选择一条数据");
          return;
        }
      handleDisposal(row) {
        this.disposalVisible = true
        this.$nextTick(() => {
          this.$refs.disposal.init(this.ids)
          this.$refs.disposal.init(row)
        })
      }
      },
      createOrder(){}
    }
  };
</script>