<template>
  <div class="move">
    <el-button type="warning" size="small" style="margin-left:10px" @click="dialogVisible=true" v-if="type == 'more'">批量转移</el-button>
    <p @click="dialogVisible=true" v-else>转移</p>
    <el-dialog title="转移" :visible.sync="dialogVisible" width="500px" :before-close="handleClose">
      <div class="handle">
        <p class="title">团队成员</p>
        <el-select placeholder="请选择转移人" v-model="param.content.sa_agent_hrid" size="small">
          <el-option v-for="(item,index) in teamList" :key="index" :label="item.name" :value="item.sa_agent_hrid">{{item.name}}</el-option>
        </el-select>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button @click="dialogVisible = false" size="small">取 消</el-button>
        <el-button type="primary" @click="followAction" size="small">确 定</el-button>
      </span>
    </el-dialog>
  </div>
</template>

<script>
export default {
  name: '',
  data () {
    return {
      dialogVisible: false,
      param: {
        "classname": "saletool.orderclue.web.orderclue",
        "method": "changeClue",
        "content": {
          "sat_orderclueid": [],
          "sa_agent_hrid": ''
        }
      },
    };
  },
  props: {
    data: {
      type:Array
    },
    type: {
      type:String
    },
    updataList: {
      type:Function
    },
    teamList: {
      type:Array
    }
  },
  computed: {
  },
  watch: {

  },
  created() {
  },
  methods: {
    handleClose () {
      this.dialogVisible = false
    },
    async followAction () {
      this.param.content.sat_orderclueid = this.data
      let res = await this.$api.requested(this.param)
      this.tool.showMessage(res,() => {
        this.dialogVisible = false
        this.$emit('updataList')
        this.param.content.sa_agent_hrid = ''
      })
    }
  }
};
</script>

<style scoped>
.move {
  display: inline-block;
}
/deep/.el-dialog__body {
  padding-bottom: 0;
  display: flex;
  justify-content: space-around;
}
/deep/.el-dialog__footer {
  display: flex;
  justify-content: space-around;
  padding-top: 0;
}
.handle {
  display: flex;
  align-items: center;
}
.handle .title {
  font-size: 14px;
  color: #000000;
  margin-right: 10px;
}
/deep/.el-select {
  width: 300px;
}
</style>
