zjf
2023-03-03 26e972196ed6046bcb7fb341be86241c8300fd2b
1
2
3
4
5
6
7
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
// import {
//   crmSettingRecordListAPI
// } from '@/api/clients/common'
import { GetCustomerContacterList } from '@/api/customermanagement/customerManage'
import { mapGetters } from 'vuex'
 
export default {
  data () {
    return {
      /** 记录类型 */
      followTypes: [],
      followType: '',
      wayTypes: [],
      wayType: '',
      contactTypes: [],
      contactType: ''
    }
  },
 
  computed: {
    ...mapGetters([
      'oa'
    ]),
    showOAPermission () {
      // return this.oa
      return true
    }
  },
 
  created () {
    this.getFollowLogType()
    console.log('ccccccccc', this.detail)
    // if (this.detail) {
    //   this.getContact()
    // }
  },
 
  methods: {
    /**
     * 获取详情
     */
    getFollowLogType () {
      this.loading = true
      this.loading = false
      this.followTypes = [
        { type: 0, name: '默认其他' },
        { type: 1, name: '客户' },
        { type: 2, name: '联系人' },
        { type: 3, name: '商机' },
        { type: 4, name: '合同管理' },
        { type: 5, name: '工单' },
        { type: 6, name: '报价单' },
        { type: 7, name: '合同' },
        { type: 8, name: '日程' },
        { type: 9, name: '开票' },
        { type: 10, name: '回款' },
        { type: 11, name: '审批' }
      ]
      this.followType = this.followTypes[0].name
      this.wayTypes = [
        { type: 1, name: '电话' },
        { type: 2, name: '在线沟通' },
        { type: 3, name: '邮件或短信' },
        { type: 4, name: '上门拜访' }
      ]
      this.wayType = this.wayTypes[0].name
      this.wayTypeId = this.wayTypes[0].type
      if (this.crmType === 'business') {
        this.getContact()
      }
    },
    getContact () {
      let params = {
        'PageIndex': 1,
        'PageSize': 9999,
        Id: this.detail.CustomerId
      }
      GetCustomerContacterList(params).then(res => {
        if (res.data.ErrorCode === 200 && res.data.Result !== 0) {
          let dataList = res.data.Result.List || []
          if (res.data.Result.Count > 0) {
            this.contactTypes = dataList.map(item => {
              return {
                type: item.Id,
                name: item.RealName
              }
            })
          } else {
            this.contactTypes = [{type: '',
              name: '暂无数据'}]
          }
          this.contactType = this.contactTypes[0].name
          this.contactTypeId = this.contactTypes[0].type
        } else {
          this.$message.error(res.data.Message)
        }
      })
    }
  },
  deactivated: function () { }
 
}