contacts.vue 1.14 KB
Newer Older
1 2 3 4 5 6
<template>
<div style="display: inline-block">
   <span @click="visible = true"> <slot></slot></span>
  <el-dialog title="更多联系人" :visible.sync="visible">
    <div v-if="info">
      <div style="text-align: center;margin-bottom: 20px;" v-for="(item, index) in info" :key="index">
7
        联系人{{index + 1}}{{$l(item, 'name')}} &ensp;&ensp;&ensp; 联系方式{{index + 1}}:+{{item.areaCode}} {{item.phoneNew}}<br/>
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
        邮箱:{{item.email}}
      </div>

    </div>
    <div v-else>
      暂无数据
    </div>
  </el-dialog>
</div>
</template>

<script>
import {getCustomerContacts, getCustomerContactsListByCustomer} from "@/api/ecw/customerContacts";

export default {
  name: "contacts",
  props:{
    id:[Number]
  },
   data(){
    return {
      visible:false,
      info:null,
    }
   },
   methods:{
     getCustomerContactsFn() {
       getCustomerContactsListByCustomer({customerId: this.id}).then(r => {
         console.log(r,'rrr')
         this.info = r.data
       })
     }
   },
   watch:{
     visible(val){
       if(val){
         this.getCustomerContactsFn()
       }
     }
   }
}
</script>

<style scoped>

</style>