|
|
/*
|
|
|
* @Descripttion:
|
|
|
* @version:
|
|
|
* @Author: Cynthiar
|
|
|
* @Date: 2021-11-17 11:56:56
|
|
|
* @LastEditors: Lone
|
|
|
* @LastEditTime: 2021-12-14 20:25:42
|
|
|
*/
|
|
|
// import Axios from '../utils/axios-util-customer'
|
|
|
import Axios, {DEFAULT_GET} from '../utils/axios-util'
|
|
|
|
|
|
// console.log('mail-api打印', Axios);
|
|
|
//info: mail文档地址:
|
|
|
let BASE_PARAMS = {
|
|
|
"caller": "crm-web",
|
|
|
"requestId": "uuid",
|
|
|
"traceId": "uuid"
|
|
|
};
|
|
|
|
|
|
let custBase = 'api/customer/';
|
|
|
export default {
|
|
|
saveImportCustomerInfo: params => { //保存导入的客户资料数据接口
|
|
|
BASE_PARAMS.param = params;
|
|
|
// for (let key in params) {
|
|
|
// BASE_PARAMS[key] = params[key];
|
|
|
// };
|
|
|
return Axios.POST(custBase + 'cus/saveImportCustomerInfo', BASE_PARAMS);
|
|
|
},
|
|
|
getCustomerList: params => { //获取客戶聯絡人列表-傳入pageNum(頁)pageSize(筆數)
|
|
|
//console.log("接口处的------------------params",params)
|
|
|
let tempParams = {
|
|
|
"caller": "crm-web",
|
|
|
"pageNum": params.page.currentPage,
|
|
|
"pageSize": params.page.pageSize,
|
|
|
"param": {
|
|
|
"name": ""
|
|
|
},
|
|
|
"requestId": "uuid",
|
|
|
"sorts": [{
|
|
|
"desc": true,
|
|
|
"key": ""
|
|
|
}],
|
|
|
"traceId": "uuid"
|
|
|
}
|
|
|
return Axios.POST(custBase + 'cus/queryPageList', tempParams);
|
|
|
},
|
|
|
queryCustomerById: params => { //查詢客戶聯絡人ById
|
|
|
return Axios.POST(custBase + 'cus/queryCustomerById', params);
|
|
|
},
|
|
|
addCustomer: params => { //新增客戶聯絡人
|
|
|
let updateParams = {
|
|
|
"caller": "crm-web",
|
|
|
"param": params,
|
|
|
"requestId": "uuid",
|
|
|
"traceId": "uuid"
|
|
|
}
|
|
|
//console.log("updateParams", updateParams)
|
|
|
return Axios.POST(custBase + 'cus/addCustomer', updateParams);
|
|
|
},
|
|
|
updateCustomerInfo: params => { //修改客戶聯絡人
|
|
|
let updateParams = {
|
|
|
"caller": "crm-web",
|
|
|
"param": params,
|
|
|
"requestId": "uuid",
|
|
|
"traceId": "uuid"
|
|
|
}
|
|
|
return Axios.POST(custBase + 'cus/updateCustomerInfo', updateParams);
|
|
|
},
|
|
|
deleteCustomerByIds: params => { //刪除客戶聯絡人
|
|
|
let updateParams = {
|
|
|
"caller": "crm-web",
|
|
|
"param": {
|
|
|
"ids": params
|
|
|
},
|
|
|
"requestId": "uuid",
|
|
|
"traceId": "uuid"
|
|
|
}
|
|
|
//console.log("updateParams", updateParams)
|
|
|
return Axios.POST(custBase + 'cus/deleteCustomerByIds', updateParams);
|
|
|
},
|
|
|
//查询客户详情页明细信息
|
|
|
queryCustomerDetail: params => { //刪除客戶聯絡人
|
|
|
let updateParams = {
|
|
|
"caller": "crm-web",
|
|
|
"param": {
|
|
|
"customerId": parseInt(params.id),
|
|
|
"name": ""
|
|
|
},
|
|
|
"requestId": "uuid",
|
|
|
"traceId": "uuid"
|
|
|
}
|
|
|
//console.log("updateParams", updateParams)
|
|
|
return Axios.POST(custBase + 'cus/queryCustomerDetail', updateParams);
|
|
|
},
|
|
|
//分页查询客户时间线信息 /cus/
|
|
|
queryCustomerTimelinePageList: params => {
|
|
|
let updateParams = {
|
|
|
"caller": "crm-web",
|
|
|
"pageNum": 1,
|
|
|
"pageSize": 100,
|
|
|
"param": {
|
|
|
"customerId": parseInt(params.customerId),
|
|
|
"search": "all"
|
|
|
},
|
|
|
"requestId": "uuid",
|
|
|
"sorts": [{
|
|
|
"desc": true,
|
|
|
"key": ""
|
|
|
}],
|
|
|
"traceId": "uuid"
|
|
|
}
|
|
|
//console.log("updateParams", updateParams)
|
|
|
return Axios.POST(custBase + 'cus/queryCustomerTimelinePageList', updateParams);
|
|
|
},
|
|
|
//分页查询客户计划中的活动信息
|
|
|
queryCustomerPlanActivityPageList: params => {
|
|
|
let updateParams = {
|
|
|
"caller": "crm-web",
|
|
|
"pageNum": 1,
|
|
|
"pageSize": 100,
|
|
|
"param": {
|
|
|
"customerId": parseInt(params.customerId),
|
|
|
"name": ""
|
|
|
},
|
|
|
"requestId": "uuid",
|
|
|
"sorts": [{
|
|
|
"desc": true,
|
|
|
"key": ""
|
|
|
}],
|
|
|
"traceId": "uuid"
|
|
|
}
|
|
|
//console.log("updateParams", updateParams)
|
|
|
return Axios.POST(custBase + 'cus/queryCustomerPlanActivityPageList', updateParams);
|
|
|
},
|
|
|
addCustomerNote: params => { //新增客户笔记
|
|
|
let updateParams = {
|
|
|
"caller": "crm-web",
|
|
|
"param": {
|
|
|
"content": params.content,
|
|
|
"customerId": parseInt(params.customerId),
|
|
|
"noteType": params.noteType
|
|
|
},
|
|
|
"requestId": "uuid",
|
|
|
"traceId": "uuid"
|
|
|
}
|
|
|
//console.log("addCustomerNote updateParams", updateParams)
|
|
|
return Axios.POST(custBase + 'note/addCustomerNote', updateParams);
|
|
|
},
|
|
|
editCustomerNote: params => { //修改客户笔记
|
|
|
console.log("修改客户笔记 Params", params)
|
|
|
let editParams = {
|
|
|
"caller": "crm-web",
|
|
|
"param": {
|
|
|
"content": params.content,
|
|
|
"customerId": parseInt(params.customerId),
|
|
|
"noteId": params.noteId,
|
|
|
"noteType": params.noteType
|
|
|
},
|
|
|
"requestId": "uuid",
|
|
|
"traceId": "uuid"
|
|
|
}
|
|
|
//console.log("修改客户笔记 editParams", editParams);
|
|
|
return Axios.POST(custBase + 'note/editCustomerNote', editParams);
|
|
|
},
|
|
|
deleteCustomerNote: params => { //刪除客户笔记
|
|
|
let updateParams = {
|
|
|
"caller": "crm-web",
|
|
|
"param": {
|
|
|
"noteId": parseInt(params.noteId)
|
|
|
},
|
|
|
"requestId": "uuid",
|
|
|
"traceId": "uuid"
|
|
|
}
|
|
|
//console.log("params", params)
|
|
|
//console.log("updateParams", updateParams)
|
|
|
return Axios.POST(custBase + 'note/deleteCustomerNote', updateParams);
|
|
|
},
|
|
|
addCustomerActivity: params => { ///activity/addCustomerActivity 新增客户活动
|
|
|
console.log("addCustomerActivity params", params)
|
|
|
let updateParams = {
|
|
|
"caller": "crm-web",
|
|
|
"param": {
|
|
|
"subject": params.subject,
|
|
|
"activityTypeId": parseInt(params.activityTypeId),
|
|
|
"busyFlag": parseInt(params.busyFlag),
|
|
|
"companyId": parseInt(params.companyId),
|
|
|
"dealId": parseInt(params.dealId),
|
|
|
"done": params.done,
|
|
|
"location": params.location,
|
|
|
"locationGeocoded": params.locationGeocoded,
|
|
|
"ownerUser": parseInt(params.ownerUser),
|
|
|
"planStartTime": params.start,
|
|
|
"planEndTime": params.end,
|
|
|
"publicDescription": params.publicDescription,
|
|
|
"activityNote": params.subject,
|
|
|
"activityParticipants": [
|
|
|
// {
|
|
|
// "customerId":parseInt(params.customerId),
|
|
|
// "customerName": "我的客户",
|
|
|
// "isCreate": false
|
|
|
// }
|
|
|
],
|
|
|
// "activityVisitors": [
|
|
|
// {
|
|
|
// "customerId": 66,
|
|
|
// "email": "655323@qq.com"
|
|
|
// }
|
|
|
// ]
|
|
|
},
|
|
|
"requestId": "uuid",
|
|
|
"traceId": "uuid"
|
|
|
}
|
|
|
//console.log("addCustomerNote updateParams", updateParams)
|
|
|
return Axios.POST(custBase + 'activity/addCustomerActivity', updateParams);
|
|
|
},
|
|
|
deleteCustomerActivity: params => { //activity/deleteCustomerActivity 删除客户活动
|
|
|
//console.log("deleteCustomerActivity params", params)
|
|
|
let updateParams = {
|
|
|
"caller": "crm-web",
|
|
|
"param": {
|
|
|
"activityId": parseInt(params.activityId)
|
|
|
},
|
|
|
"requestId": "uuid",
|
|
|
"traceId": "uuid"
|
|
|
}
|
|
|
//console.log("updateParams", updateParams)
|
|
|
return Axios.POST(custBase + 'activity/deleteCustomerActivity', updateParams);
|
|
|
},
|
|
|
editCustomerActivity: params => { ///activity/editCustomerActivity 编辑客户活动
|
|
|
//alert("editCustomerActivity")
|
|
|
//console.log("editCustomerActivity Params", params)
|
|
|
let updateParams = {
|
|
|
"caller": "crm-web",
|
|
|
"param": {
|
|
|
"activityId": parseInt(params.activityId),
|
|
|
"subject": params.subject,
|
|
|
"activityTypeId": parseInt(params.activityTypeId),
|
|
|
"busyFlag": parseInt(params.busyFlag),
|
|
|
//"companyId":parseIn(params.companyId),
|
|
|
//"dealId":parseIn(params.dealId),
|
|
|
"done": params.done,
|
|
|
"location": params.location,
|
|
|
"locationGeocoded": params.locationGeocoded,
|
|
|
"ownerUser": parseInt(params.ownerUser),
|
|
|
"planStartTime": params.start,
|
|
|
"planEndTime": params.end,
|
|
|
"publicDescription": params.publicDescription,
|
|
|
"activityNote": params.subject,
|
|
|
"activityParticipants": [{
|
|
|
"customerId": parseInt(params.customerId),
|
|
|
"customerName": "我的客户",
|
|
|
"isCreate": false
|
|
|
}],
|
|
|
// "activityVisitors": [
|
|
|
// {
|
|
|
// "customerId":parseIn() 66,
|
|
|
// "email": "655323@qq.com"
|
|
|
// }
|
|
|
// ]
|
|
|
},
|
|
|
"requestId": "uuid",
|
|
|
"traceId": "uuid"
|
|
|
}
|
|
|
//console.log("editCustomerActivity updateParams", updateParams)
|
|
|
return Axios.POST(custBase + 'activity/editCustomerActivity', updateParams);
|
|
|
},
|
|
|
queryListByBizTypeCode: params => { ////bizTag/queryListByBizTypeCode 查询基础配置业务类型
|
|
|
//console.log("queryListByBizTypeCode Params", params)
|
|
|
let updateParams = {
|
|
|
"caller": "crm-web",
|
|
|
"param": {
|
|
|
"bizTypeCode": "customer",
|
|
|
"relationBizId": [
|
|
|
|
|
|
]
|
|
|
},
|
|
|
"requestId": "uuid",
|
|
|
"traceId": "uuid"
|
|
|
}
|
|
|
//console.log("editCustomerActivity updateParams", updateParams)
|
|
|
return Axios.POST(custBase + 'bizTag/queryListByBizTypeCode', updateParams);
|
|
|
},
|
|
|
queryComPageList: params => { //分页查询组织列表//http://52.221.25.56:9240/company/queryComPageList分页查询组织列表
|
|
|
//console.log("queryComPageList params",params)
|
|
|
let updateParams = {
|
|
|
"caller": "crm-web",
|
|
|
"pageNum": params.page.currentPage,
|
|
|
"pageSize": params.page.pageSize,
|
|
|
"param": {
|
|
|
"name": ""
|
|
|
},
|
|
|
"requestId": "uuid",
|
|
|
"sorts": [{
|
|
|
"desc": true,
|
|
|
"key": ""
|
|
|
}],
|
|
|
"traceId": "uuid"
|
|
|
}
|
|
|
//console.log("updateParams", updateParams)
|
|
|
return Axios.POST(custBase + 'company/queryComPageList', updateParams);
|
|
|
},
|
|
|
addCompany: params => { //新增组织/company/addCompany 新增组织
|
|
|
//console.log("addCompany params",params);
|
|
|
let updateParams = {
|
|
|
"caller": "crm-web",
|
|
|
"param": {
|
|
|
"address": params.address,
|
|
|
"email": params.email,
|
|
|
"latitude": params.latitude,
|
|
|
"longitude": params.longitude,
|
|
|
"name": params.name,
|
|
|
"owner_user": parseInt(params.owner_user),
|
|
|
"phone": params.phone,
|
|
|
"remark": params.remark,
|
|
|
//"partner_id": 1,
|
|
|
"update_user": 0,
|
|
|
"create_user": 0,
|
|
|
"gmt_create": "2021-11-25 14:00:00",
|
|
|
"gmt_modified": "2021-11-25 14:00:00",
|
|
|
},
|
|
|
"requestId": "uuid",
|
|
|
"traceId": "uuid"
|
|
|
};
|
|
|
//console.log("updateParams", updateParams);
|
|
|
return Axios.POST(custBase + 'company/addCompany', updateParams);
|
|
|
},
|
|
|
updateCompanyInfo: params => { //修改组织/company/updateCompanyInfo更新组织信息
|
|
|
//console.log("updateCompanyInfo params", params)
|
|
|
let updateParams = {
|
|
|
"caller": "crm-web",
|
|
|
"param": {
|
|
|
"id": parseInt(params.id),
|
|
|
"address": params.address,
|
|
|
"email": params.email,
|
|
|
"latitude": params.latitude,
|
|
|
"longitude": params.longitude,
|
|
|
"name": params.name,
|
|
|
"owner_user": parseInt(params.owner_user),
|
|
|
"phone": params.phone,
|
|
|
"remark": params.remark,
|
|
|
//"partner_id": 1,
|
|
|
"update_user": 0,
|
|
|
"create_user": 0,
|
|
|
"gmt_create": "2021-11-25 14:00:00",
|
|
|
"gmt_modified": "2021-11-25 14:00:00",
|
|
|
},
|
|
|
"requestId": "uuid",
|
|
|
"traceId": "uuid"
|
|
|
}
|
|
|
//console.log("updateParams", updateParams)
|
|
|
return Axios.POST(custBase + 'company/updateCompanyInfo', updateParams);
|
|
|
},
|
|
|
deleteCompanyByIds: params => { ///company/deleteCompanyByIds删除组织信息
|
|
|
//console.log("deleteCompanyByIds params", params)
|
|
|
let updateParams = {
|
|
|
"caller": "crm-web",
|
|
|
"param": {
|
|
|
//"ids": [0]
|
|
|
"ids": params
|
|
|
},
|
|
|
"requestId": "uuid",
|
|
|
"traceId": "uuid"
|
|
|
}
|
|
|
//console.log("updateParams", updateParams)
|
|
|
return Axios.POST(custBase + 'company/deleteCompanyByIds', updateParams);
|
|
|
},
|
|
|
queryActivityPageList: params => { //activity/queryActivityPageList 分页查询活动列表
|
|
|
//console.log("queryComPageList params",params)
|
|
|
let updateParams = {
|
|
|
"caller": "crm-web",
|
|
|
"pageNum": params.page.currentPage,
|
|
|
"pageSize": params.page.pageSize,
|
|
|
"param": {
|
|
|
"name": ""
|
|
|
},
|
|
|
"requestId": "uuid",
|
|
|
"sorts": [{
|
|
|
"desc": true,
|
|
|
"key": ""
|
|
|
}],
|
|
|
"traceId": "uuid"
|
|
|
}
|
|
|
//console.log("updateParams", updateParams)
|
|
|
return Axios.POST(custBase + 'activity/queryActivityPageList', updateParams);
|
|
|
},
|
|
|
//activity/queryActivityTypes 查询活动类型列表
|
|
|
|
|
|
///activity/queryCustomerActivityDetail 查询客户活动详情
|
|
|
|
|
|
addBrowseRecord: params => { //新增浏览纪录
|
|
|
let updateParams = {
|
|
|
"caller": "crm-web",
|
|
|
"param": params,
|
|
|
"requestId": "uuid",
|
|
|
"traceId": "uuid"
|
|
|
}
|
|
|
//console.log("updateParams", updateParams)
|
|
|
return Axios.POST(custBase + 'browseRecord/addBrowseRecord', updateParams);
|
|
|
},
|
|
|
|
|
|
selectBrowseRecordList: params => { //查询浏览纪录
|
|
|
let updateParams = {
|
|
|
"caller": "crm-web",
|
|
|
"param": params,
|
|
|
"requestId": "uuid",
|
|
|
"traceId": "uuid"
|
|
|
}
|
|
|
//console.log("updateParams", updateParams)
|
|
|
return Axios.POST(custBase + 'browseRecord/selectBrowseRecordList', updateParams);
|
|
|
},
|
|
|
|
|
|
getActivityList:()=>{
|
|
|
return Axios.DEFAULT_GET('/mock/activity/getActivityList')
|
|
|
}
|
|
|
}
|
|
|
|