<template>
  <div class="move" style="margin-right:10px">
    <el-button size="mini" type="primary" @click="moveBtn">转移</el-button>
    <el-dialog title="转移" append-to-body :visible.sync="dialogVisible" width="500px" :before-close="handleClose">
      <div class="handle">
        <p class="title">团队成员</p>
        <el-select placeholder="请选择转移人" v-model="param.content.sys_enterprise_hrid" size="small">
          <el-option v-for="(item,index) in teamList" :key="index" :label="item.name" :value="item.sys_enterprise_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": [],
          "sys_enterprise_hrid": ''
        }
      },
    };
  },
  props: {
    data: {
      type:Array
    },
    type: {
      type:String
    },
    updataList: {
      type:Function
    },
    teamList: {
      default() {
        return []
      }
    }
  },
  computed: {
  },
  watch: {

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

<style scoped>
.move {
  display: inline-block;
  width: 100%;
}
/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>
