index.js 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290
  1. import {
  2. get,
  3. put,
  4. putJ,
  5. postJ
  6. } from "@/utils/request";
  7. import Vue from "vue";
  8. //获取客户
  9. export async function contactPage(query, loding = true) {
  10. const res = await get(
  11. Vue.prototype.apiUrl + `/eom/contact/page`, query, loding
  12. );
  13. if (res.code == 0) {
  14. return res.data;
  15. }
  16. return Promise.reject(new Error(res.message));
  17. }
  18. //根据多个ID查询分类详情系信息
  19. export async function getInfoByIds(id) {
  20. const res = await get(Vue.prototype.apiUrl + `/main/categoryLevel/getByIds/${id}`);
  21. if (res.code == 0) {
  22. return res.data;
  23. }
  24. return Promise.reject(new Error(res.message));
  25. }
  26. import request from '@/utils/request';
  27. /**
  28. * 获取客户信息详情
  29. */
  30. export async function contactDetail(id) {
  31. const res = await get(Vue.prototype.apiUrl + `/eom/contact/getById/${id}`, {});
  32. if (res.code == 0) {
  33. return res.data;
  34. }
  35. return Promise.reject(new Error(res.message));
  36. }
  37. /**
  38. * 更新客户信息
  39. */
  40. export async function contactSave(data) {
  41. let api = data.base.id ? putJ : postJ
  42. const res = await api(Vue.prototype.apiUrl + `/eom/contact/` + (data.base.id ? 'update' : 'save'), data);
  43. if (res.code == 0) {
  44. return res.data;
  45. }
  46. return Promise.reject(new Error(res.message));
  47. }
  48. /**
  49. * 发布动态
  50. */
  51. export async function updateContactDynamics(data) {
  52. const res = await putJ(Vue.prototype.apiUrl + '/eom/contact/updateContactDynamics', data);
  53. if (res.code == 0) {
  54. return res.data;
  55. }
  56. return Promise.reject(new Error(res.message));
  57. }
  58. /**
  59. * 回复动态
  60. */
  61. export async function updateContactComment(data) {
  62. const res = await putJ(Vue.prototype.apiUrl + '/eom/contact/updateContactComment', data);
  63. if (res.code == 0) {
  64. return res.data;
  65. }
  66. return Promise.reject(new Error(res.message));
  67. }
  68. // /**
  69. // * 客户证书资质信息分页
  70. // */
  71. // export async function contactQcPackPageAPI(params) {
  72. // const res = await request.get(`/main/professionCertification/selectByRelationIdAndType`, { params });
  73. // if (res.data.code == 0) {
  74. // return res.data.data;
  75. // }
  76. // return Promise.reject(new Error(res.data.message));
  77. // }
  78. // /**
  79. // * 新增客户证书资质信息
  80. // */
  81. // export async function contactQcPackSaveAPI(data) {
  82. // const res = await request.post(`/main/professionCertification/save`, data);
  83. // if (res.data.code == 0) {
  84. // return res.data.data;
  85. // }
  86. // return Promise.reject(new Error(res.data.message));
  87. // }
  88. // /**
  89. // * 修改客户证书资质信息
  90. // */
  91. // export async function contactQcPackUpdateAPI(data) {
  92. // const res = await request.put(`/main/professionCertification/update`, data);
  93. // if (res.data.code == 0) {
  94. // return res.data.data;
  95. // }
  96. // return Promise.reject(new Error(res.data.message));
  97. // }
  98. // /**
  99. // * 获取客户证书资质信息详情
  100. // */
  101. // export async function contactQcPackDetailAPI(id) {
  102. // const res = await request.get(`/main/professionCertification/getById/${id}`, {});
  103. // if (res.data.code == 0) {
  104. // return res.data.data;
  105. // }
  106. // return Promise.reject(new Error(res.data.message));
  107. // }
  108. // /**
  109. // * 删除客户证书资质包
  110. // */
  111. // export async function contactQcPackDeleteAPI(data) {
  112. // const res = await request.delete(`/main/professionCertification/delete`, { data });
  113. // if (res.data.code == 0) {
  114. // return res.data.data;
  115. // }
  116. // return Promise.reject(new Error(res.data.message));
  117. // }
  118. // /**
  119. // * 提交客户证书资质信息 开启流程
  120. // */
  121. // export async function contactQcSubmit(data) {
  122. // const res = await request.post(`/bpm/ProfessionCertification/submit`, data);
  123. // if (res.data.code == 0) {
  124. // return res.data.data;
  125. // }
  126. // return Promise.reject(new Error(res.data.message));
  127. // }
  128. /**
  129. * 删除事项
  130. */
  131. export async function contactDelete(data) {
  132. const res = await postJ(Vue.prototype.apiUrl + '/eom/contact/delete', data);
  133. if (res.code == 0) {
  134. return res.data;
  135. }
  136. return Promise.reject(new Error(res.message));
  137. }
  138. // /**
  139. // * 获取客户分类树
  140. // */
  141. // export async function contactTypeTree(data) {
  142. // const res = await request.get(`/main/categoryLevel/getTreeByPid/${data.type}`);
  143. // if (res.data.code == 0) {
  144. // return res.data;
  145. // }
  146. // return Promise.reject(new Error(res.data.message));
  147. // }
  148. // /**
  149. // * 更新用户状态
  150. // */
  151. // export async function updateStatus(id, status) {
  152. // const res = await request.get(`/eom/contact/updateStatus?id=` + id + '&status=' + status);
  153. // if (res.data.code == 0) {
  154. // return res.data;
  155. // }
  156. // return Promise.reject(new Error(res.data.message));
  157. // }
  158. // /**
  159. // * 指派
  160. // */
  161. export async function assign(data) {
  162. const res = await postJ(Vue.prototype.apiUrl + '/eom/contact/assign', data);
  163. if (res.code == 0) {
  164. return res.data;
  165. }
  166. return Promise.reject(new Error(res.message));
  167. }
  168. // /**
  169. // * 释放
  170. // */
  171. export async function free(data) {
  172. const res = await postJ(Vue.prototype.apiUrl + '/eom/contact/free', data);
  173. if (res.code == 0) {
  174. return res.data;
  175. }
  176. return Promise.reject(new Error(res.message));
  177. }
  178. /**
  179. * 申请
  180. */
  181. export async function apply(data) {
  182. const res = await postJ(Vue.prototype.apiUrl + '/bpm/contactlistapply/apply', data);
  183. if (res.code == 0) {
  184. return res.data;
  185. }
  186. return Promise.reject(new Error(res.message));
  187. }
  188. /**
  189. * 查询客户联系人列表
  190. */
  191. export async function getcontactlink(params) {
  192. const res = await get(Vue.prototype.apiUrl + `/eom/contactlink/list/`, params);
  193. if (res.code == 0) {
  194. return res.data;
  195. }
  196. return Promise.reject(new Error(res.message));
  197. }
  198. /**
  199. * 摘要卡片
  200. */
  201. export async function queryContactIdCount(id) {
  202. const res = await get(Vue.prototype.apiUrl + `/eom/contact/queryContactIdCount/` + id);
  203. console.log(res,'ressss')
  204. if (res.code == 0) {
  205. return res.data;
  206. }
  207. return Promise.reject(new Error(res.message));
  208. }
  209. // /**
  210. // * 供应商维护供货产品
  211. // */
  212. // export async function contactProductSaveAPI(data) {
  213. // const res = await request.post('/main/contactproduct/save', data);
  214. // if (res.data.code == 0) {
  215. // return res.data.data;
  216. // }
  217. // return Promise.reject(new Error(res.data.message));
  218. // }
  219. // /**
  220. // * 供应商维护供货产品
  221. // */
  222. // export async function contactProductUpdateAPI(data) {
  223. // const res = await request.post('/main/contactproduct/update', data);
  224. // if (res.data.code == 0) {
  225. // return res.data.data;
  226. // }
  227. // return Promise.reject(new Error(res.data.message));
  228. // }
  229. // /**
  230. // * 通过产品查供应商
  231. // */
  232. // export async function contactQueryByCategoryIdsAPI(data) {
  233. // const res = await request.post('/eom/contact/queryByCategoryIds', data);
  234. // if (res.data.code == 0) {
  235. // return res.data.data;
  236. // }
  237. // return Promise.reject(new Error(res.data.message));
  238. // }
  239. // /**
  240. // * 发布动态
  241. // */
  242. // export async function updateContactDynamics(data) {
  243. // const res = await request.put('/eom/contact/updateContactDynamics', data);
  244. // if (res.data.code == 0) {
  245. // return res.data.data;
  246. // }
  247. // return Promise.reject(new Error(res.data.message));
  248. // }
  249. // /**
  250. // * 回复动态
  251. // */
  252. // export async function updateContactComment(data) {
  253. // const res = await request.put('/eom/contact/updateContactComment', data);
  254. // if (res.data.code == 0) {
  255. // return res.data.data;
  256. // }
  257. // return Promise.reject(new Error(res.data.message));
  258. // }
  259. // /**
  260. // * 摘要卡片
  261. // */
  262. // export async function queryContactIdCount(id) {
  263. // const res = await request.get(`eom/contact/queryContactIdCount/`+id);
  264. // if (res.data.code == 0) {
  265. // return res.data;
  266. // }
  267. // return Promise.reject(new Error(res.data.message));
  268. // }