import { get, put, putJ, postJ } from "@/utils/request"; import Vue from "vue"; //获取客户 export async function contactPage(query, loding = true) { const res = await get( Vue.prototype.apiUrl + `/eom/contact/page`, query, loding ); if (res.code == 0) { return res.data; } return Promise.reject(new Error(res.message)); } //根据多个ID查询分类详情系信息 export async function getInfoByIds(id) { const res = await get(Vue.prototype.apiUrl + `/main/categoryLevel/getByIds/${id}`); if (res.code == 0) { return res.data; } return Promise.reject(new Error(res.message)); } import request from '@/utils/request'; /** * 获取客户信息详情 */ export async function contactDetail(id) { const res = await get(Vue.prototype.apiUrl + `/eom/contact/getById/${id}`, {}); if (res.code == 0) { return res.data; } return Promise.reject(new Error(res.message)); } /** * 更新客户信息 */ export async function contactSave(data) { let api = data.base.id ? putJ : postJ const res = await api(Vue.prototype.apiUrl + `/eom/contact/` + (data.base.id ? 'update' : 'save'), data); if (res.code == 0) { return res.data; } return Promise.reject(new Error(res.message)); } /** * 发布动态 */ export async function updateContactDynamics(data) { const res = await putJ(Vue.prototype.apiUrl + '/eom/contact/updateContactDynamics', data); if (res.code == 0) { return res.data; } return Promise.reject(new Error(res.message)); } /** * 回复动态 */ export async function updateContactComment(data) { const res = await putJ(Vue.prototype.apiUrl + '/eom/contact/updateContactComment', data); if (res.code == 0) { return res.data; } return Promise.reject(new Error(res.message)); } // /** // * 客户证书资质信息分页 // */ // export async function contactQcPackPageAPI(params) { // const res = await request.get(`/main/professionCertification/selectByRelationIdAndType`, { params }); // if (res.data.code == 0) { // return res.data.data; // } // return Promise.reject(new Error(res.data.message)); // } // /** // * 新增客户证书资质信息 // */ // export async function contactQcPackSaveAPI(data) { // const res = await request.post(`/main/professionCertification/save`, data); // if (res.data.code == 0) { // return res.data.data; // } // return Promise.reject(new Error(res.data.message)); // } // /** // * 修改客户证书资质信息 // */ // export async function contactQcPackUpdateAPI(data) { // const res = await request.put(`/main/professionCertification/update`, data); // if (res.data.code == 0) { // return res.data.data; // } // return Promise.reject(new Error(res.data.message)); // } // /** // * 获取客户证书资质信息详情 // */ // export async function contactQcPackDetailAPI(id) { // const res = await request.get(`/main/professionCertification/getById/${id}`, {}); // if (res.data.code == 0) { // return res.data.data; // } // return Promise.reject(new Error(res.data.message)); // } // /** // * 删除客户证书资质包 // */ // export async function contactQcPackDeleteAPI(data) { // const res = await request.delete(`/main/professionCertification/delete`, { data }); // if (res.data.code == 0) { // return res.data.data; // } // return Promise.reject(new Error(res.data.message)); // } // /** // * 提交客户证书资质信息 开启流程 // */ // export async function contactQcSubmit(data) { // const res = await request.post(`/bpm/ProfessionCertification/submit`, data); // if (res.data.code == 0) { // return res.data.data; // } // return Promise.reject(new Error(res.data.message)); // } /** * 删除事项 */ export async function contactDelete(data) { const res = await postJ(Vue.prototype.apiUrl + '/eom/contact/delete', data); if (res.code == 0) { return res.data; } return Promise.reject(new Error(res.message)); } // /** // * 获取客户分类树 // */ // export async function contactTypeTree(data) { // const res = await request.get(`/main/categoryLevel/getTreeByPid/${data.type}`); // if (res.data.code == 0) { // return res.data; // } // return Promise.reject(new Error(res.data.message)); // } // /** // * 更新用户状态 // */ // export async function updateStatus(id, status) { // const res = await request.get(`/eom/contact/updateStatus?id=` + id + '&status=' + status); // if (res.data.code == 0) { // return res.data; // } // return Promise.reject(new Error(res.data.message)); // } // /** // * 指派 // */ export async function assign(data) { const res = await postJ(Vue.prototype.apiUrl + '/eom/contact/assign', data); if (res.code == 0) { return res.data; } return Promise.reject(new Error(res.message)); } // /** // * 释放 // */ export async function free(data) { const res = await postJ(Vue.prototype.apiUrl + '/eom/contact/free', data); if (res.code == 0) { return res.data; } return Promise.reject(new Error(res.message)); } /** * 申请 */ export async function apply(data) { const res = await postJ(Vue.prototype.apiUrl + '/bpm/contactlistapply/apply', data); if (res.code == 0) { return res.data; } return Promise.reject(new Error(res.message)); } /** * 查询客户联系人列表 */ export async function getcontactlink(params) { const res = await get(Vue.prototype.apiUrl + `/eom/contactlink/list/`, params); if (res.code == 0) { return res.data; } return Promise.reject(new Error(res.message)); } /** * 摘要卡片 */ export async function queryContactIdCount(id) { const res = await get(Vue.prototype.apiUrl + `/eom/contact/queryContactIdCount/` + id); console.log(res,'ressss') if (res.code == 0) { return res.data; } return Promise.reject(new Error(res.message)); } // /** // * 供应商维护供货产品 // */ // export async function contactProductSaveAPI(data) { // const res = await request.post('/main/contactproduct/save', data); // if (res.data.code == 0) { // return res.data.data; // } // return Promise.reject(new Error(res.data.message)); // } // /** // * 供应商维护供货产品 // */ // export async function contactProductUpdateAPI(data) { // const res = await request.post('/main/contactproduct/update', data); // if (res.data.code == 0) { // return res.data.data; // } // return Promise.reject(new Error(res.data.message)); // } // /** // * 通过产品查供应商 // */ // export async function contactQueryByCategoryIdsAPI(data) { // const res = await request.post('/eom/contact/queryByCategoryIds', data); // if (res.data.code == 0) { // return res.data.data; // } // return Promise.reject(new Error(res.data.message)); // } // /** // * 发布动态 // */ // export async function updateContactDynamics(data) { // const res = await request.put('/eom/contact/updateContactDynamics', data); // if (res.data.code == 0) { // return res.data.data; // } // return Promise.reject(new Error(res.data.message)); // } // /** // * 回复动态 // */ // export async function updateContactComment(data) { // const res = await request.put('/eom/contact/updateContactComment', data); // if (res.data.code == 0) { // return res.data.data; // } // return Promise.reject(new Error(res.data.message)); // } // /** // * 摘要卡片 // */ // export async function queryContactIdCount(id) { // const res = await request.get(`eom/contact/queryContactIdCount/`+id); // if (res.data.code == 0) { // return res.data; // } // return Promise.reject(new Error(res.data.message)); // }