<style>

</style>
<template>
  <div class="Business">
    <div class="add-Enclosure">
      <el-button icon="el-icon-plus" class="crm-btn query-btn crm-btn-mini margin-right0" @click="addBusiness">新建商机
      </el-button>
    </div>
    <el-table v-loading="loading" stripe ref="multipleTable" :data="dataList" tooltip-effect="dark" style="width: 100%"
      row-class-name="font-size-12">
      <el-table-column prop="BusinessName" label="商机名称" show-overflow-tooltip>
        <template slot-scope="scope">
          <p @click="openDetails(scope)" class="font-color-link cp">{{scope.row.BusinessName}}</p>
        </template>
      </el-table-column>
      <el-table-column prop="BudgetPrice" label="商机金额" show-overflow-tooltip>
      </el-table-column>
      <el-table-column prop="CustomerName" label="客户名称" show-overflow-tooltip>
      </el-table-column>
      <el-table-column prop="BusinessStatusStr" label="商机阶段" show-overflow-tooltip>
      </el-table-column>
    </el-table>
  </div>
</template>
<script>
  export default {
    props: ['ID', 'BusinessType'],
    data() {
      return {
        dataList: [],
        loading: false
      };
    },
    watch: {

    },
    mounted() {
      this.GetBusinessList()

    },
    methods: {
      openDetails(scope) {
        this.MsgBus.$emit('busnessDrawerShow', scope.row.ID, 0)
      },
      GetBusinessList() {
        this.apipost('/api/Customer/GetBusinessList', {
          CustomerId: this.ID
        }, res => {
          if (res.data.resultCode == 1) {
            this.dataList = res.data.data
          } else {
            this.$message.error(res.data.message);
          }
        })
      },
      addBusiness() {
        let $this = this
        this.MsgBus.$emit('addBusinessBoxOpen', $this.ID, 0)
      },
      guanlian() {

      },
      jiechuguanlian() {

      },
    }
  }
</script>