<template>
  <view class="detail-contacts-about">
    <about-business :list="businessList" :config="getConfigs('business')" class="about-section" />

    <about-file
      v-if="batchId"
      :batch-id="batchId"
      :detail-id="detailId"
      type="crm_contacts"
      class="about-section" />

    <about-operation
      :detail-id="detailId"
      type="crm_contacts"
      class="about-section" />
  </view>
</template>

<script>
  import { QueryBusiness } from 'API/crm/concat'

  import AboutBusiness from '../../components/tabAbout/aboutBusiness.vue'
  import AboutFile from '../../components/tabAbout/aboutFile.vue'
  import AboutOperation from '../../components/tabAbout/aboutOperation.vue'

  export default {
    name: 'DetailContactsAbout',
    components: {
      AboutBusiness,
      AboutFile,
      AboutOperation
    },
    props: {
      detailId: {
        type: [String, Number],
        default: null
      },
      detailData: {
        type: Object,
        default: () => {}
      },
      batchId: {
        type: String,
        default: null
      }
    },
    data() {
      return {
        businessList: [],
      }
    },
    created() {
      this.getList()
    },
    methods: {
      getList() {
        // 获取商机
        let params = {
          contactsId: this.detailId,
          pageType: 0
        }
        QueryBusiness(params).then(response => {
          console.log('businessList: ', response)
          this.businessList = response.list
        })
      },

      getConfigs() {
        return {
          detail: this.detailData,
          type: 'contacts'
        }
      }
    }
  }
</script>

<style scoped lang="scss">

</style>
