amoebaUtils.js
3.1 KB
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
import * as fetch from './fetch';
import qs from 'querystring';
const prefix = '/api';
// 客户列表
export const selectCustomerListApi = (params) => {
return fetch.get(`${prefix}/crm/customers?${params}`)
}
/**
*
* 查看详情
*/
export const customerDetailApi = (key_no) => {
return fetch.get(prefix + `/crm/companys/${key_no}`)
}
// /crm/companys/:key_no
// /crm/view-customers/:id
/**
* 查看详情的 基本信息
*/
export const baseInfoApi = (id) => {
return fetch.get(prefix + `/crm/view-customers/${id}?`)
}
/**
* 编辑基本信息
*/
export const editBaseInfoApi = (customer_id, params) => {
return fetch.put(prefix + `/crm/view-customers/${customer_id}`, params)
}
// 放弃
// export const customerOperateApi = (id, data) => {
// // '/crm/customer/' + id
// return fetch.post(prefix + `/crm/customer/${id}/operate`, data)
// }
// 申领
export const applyOperateApi = (id, data) => {
return fetch.post(prefix + `/crm/customer-owners/${id}/apply`, data)
}
// 终止
export const terminateOperateApi = (id, data) => {
return fetch.post(prefix + `/crm/customer-owners/${id}/terminate`, data)
}
// 放弃
export const abandonOperateApi = (id, data) => {
console.log('djjjj', id)
return fetch.post(prefix + `/crm/customer-owners/${id}/abandon`, data)
}
// 白名单
export const whitelistOperateApi = (id, data) => {
return fetch.post(prefix + `/crm/customer-owners/${id}/whitelist`, data)
}
// 黑名单
export const blacklistOperateApi = (id, data) => {
return fetch.post(prefix + `/crm/customer-owners/${id}/blacklist`, data)
}
// 新增客户
export const addNewCustomerApi = (data) => {
return fetch.post(prefix + '/crm/customers', data)
}
// 归属公司
export const selectCompanyApi = () => {
return fetch.get(prefix + '/uaa/myorgs')
}
/**
* 查看详情 --- 联系人
*/
export const getContactsListApi = (id) => {
// get /crm/customers/${id}/contacts
return fetch.get(prefix + `/crm/customers/${id}/contacts`)
}
/**
* 编辑联系人
*/
export const editContactsApi = (customer_id, contact_id, params) => {
// put /crm/customers/${id}/contacts/${customer_id}
return fetch.put(prefix + `/crm/customers/${customer_id}/contacts/${contact_id}`, params)
}
/**
* 新增联系人
*/
export const addContactsApi = (id, params) => {
// post /crm/customers/${id}/contacts
return fetch.post(prefix + `/crm/customers/${id}/contacts`, params)
}
/**
* 企查查
*/
export const searchCompanyApi = (params) => {
return fetch.get(prefix + '/crm/companys?' + qs.stringify(params))
}
/**
* 添加拜访记录
*/
export const addVisitHistoryApi = (data) => {
// crm/v1/customer-comment
return fetch.post(prefix + `/crm/customer-comment`, data)
}
/**
* 请求共享客户
*/
export const shareCustomerApi = (data) => {
return fetch.post(prefix + `/crm/customer-share`, data)
}
/**
* 重新申请
*/
export const reApplicationApi = (id, params) => {
return fetch.pist(prefix + `/crm/v1/customer-owners/${id}/reapply`, params)
}
/**
* 查看详情中的负责人
*/
export const chargePersonApi = (id) => {
return fetch.get(prefix + `/crm/customers/${id}/owners`)
}