servers.js 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267
  1. /* eslint-disable import/prefer-default-export */
  2. import HTTPREQUEST from "./http"
  3. import Taro from "@tarojs/taro";
  4. //登录
  5. export const login = (res) => {
  6. return new Promise(async (resolve, reject) => {
  7. Taro.showLoading({
  8. title: '登录中...',
  9. })
  10. try {
  11. let msg = await HTTPREQUEST.post('/managesignin', {
  12. mobile: res.username,
  13. password: res.password,
  14. remeber: false
  15. });
  16. if (msg.error.length === 0) {
  17. Taro.setStorageSync('token', msg.token);
  18. Taro.setStorageSync('userInfor', msg.data);
  19. Taro.hideLoading();
  20. Taro.showToast({ title: '登录成功', icon: 'success' })
  21. resolve(msg);
  22. } else {
  23. Taro.hideLoading();
  24. Taro.showToast({ title: msg.error[0].message, icon: 'none' })
  25. reject();
  26. }
  27. } catch (err) {
  28. Taro.showToast({ title: '系统错误,请稍后重试', icon: 'none' });
  29. Taro.hideLoading();
  30. reject();
  31. }
  32. })
  33. }
  34. // 查询客户订单
  35. export const getOrderByUid = (postData = {}) => {
  36. return HTTPREQUEST.get('/api/admin/release/selectOrderByUid', postData)
  37. }
  38. export const getUserByName = (postData = {}) => {
  39. return HTTPREQUEST.get('/api/admin/customer/getUserByNames', postData)
  40. }
  41. export const getadminByName = (postData = {}) => {
  42. return HTTPREQUEST.get('/api/admin/customer/listAdminByName', postData)
  43. }
  44. export const addPublicRelease = (postData = {}) => {
  45. return HTTPREQUEST.post('/api/admin/release/addPublicRelease', postData)
  46. }
  47. export const setOpenId = (postData = {}) => {
  48. return HTTPREQUEST.post('/api/admin/setOpenId', postData)
  49. }
  50. //获取最近打卡信息
  51. export const getPunchClockInfo = (postData = {}) => {
  52. return HTTPREQUEST.get('/api/admin/release/getMyNewPublic', postData)
  53. }
  54. export const getPublicReleaseList = (postData = {}) => {
  55. return HTTPREQUEST.get('/api/admin/release/listPublicRelease', postData)
  56. }
  57. export const publicReleaseClockIn = (postData = {}) => {
  58. return HTTPREQUEST.post('/api/admin/release/publicReleaseClockIn', postData)
  59. }
  60. // 公出审批
  61. export const examinePublicRelease = (isSuperior = 1, postData = {}) => {
  62. return HTTPREQUEST.post(isSuperior == 1
  63. ? '/api/admin/release/examinePublicRelease' : isSuperior == 2
  64. ? '/api/admin/release/marketersExamine' : isSuperior == 3
  65. ? '/api/admin/release/techExamine' : isSuperior == 4 && '/api/admin/release/assistExamine', postData)
  66. }
  67. //获取外出公出详情
  68. export const getReleasetDails = (postData = {}) => {
  69. return HTTPREQUEST.get('/api/admin/release/dtails', postData)
  70. }
  71. //获取公出日志
  72. export const getListPublicReleaseLog = (postData = {}) => {
  73. return HTTPREQUEST.get('/api/admin/release/listPublicReleaseLog', postData)
  74. }
  75. //修改公出申请
  76. export const updatePublicRelease = (postData = {}) => {
  77. return HTTPREQUEST.post('/api/admin/release/updatePublicRelease', postData)
  78. }
  79. //外出未读
  80. export const getPublicReleaseUnread = (postData = {}) => {
  81. return HTTPREQUEST.get('/api/admin/notice/publicReleaseUnread', postData)
  82. }
  83. //获取知道部门作息时间
  84. export const getWorkingHours = (postData = {}) => {
  85. return HTTPREQUEST.get('/api/admin/department/workingHours/get', postData)
  86. }
  87. //获取部门作息列表
  88. export const getWorkingHoursList = (postData = {}) => {
  89. return HTTPREQUEST.get('/api/admin/department/workingHours/list', postData)
  90. }
  91. //获取微信参数
  92. export const getWxConfig = (postData = {}) => {
  93. return HTTPREQUEST.get('/open/getWxConfig', postData)
  94. }
  95. //测试
  96. export const test = (postData = {}) => {
  97. return HTTPREQUEST.get('/open/getVCode', postData)
  98. }
  99. //技术协单驳回
  100. export const techReject = (postData = {}) => {
  101. return HTTPREQUEST.post('/api/admin/release/techReject', postData)
  102. }
  103. //新增协单助力
  104. export const addAssistant = (postData = {}) => {
  105. return HTTPREQUEST.post('/api/admin/release/addAssistant', postData)
  106. }
  107. //删除协单助力
  108. export const deleteAssistant = (postData = {}) => {
  109. return HTTPREQUEST.post('/api/admin/release/deleteAssistant', postData)
  110. }
  111. //修改公出地址
  112. export const updateLocation = (postData = {}) => {
  113. return HTTPREQUEST.post('/api/admin/release/updateLocation', postData)
  114. }
  115. // 技术公出发起情况
  116. export const checkOrderNoDuration = (postData = {}) => {
  117. return HTTPREQUEST.get('/api/admin/release/checkOrderNoDuration', postData)
  118. }
  119. // 限定项目客户情况
  120. export const getRestrictProjectUser = (postData = {}) => {
  121. return HTTPREQUEST.get('/api/restrict/Project/getRestrictProjectUser', postData)
  122. }
  123. // 未审核查询
  124. export const getAssistUnaudited = (postData = {}) => {
  125. return HTTPREQUEST.get('/api/admin/release/unaudited', postData)
  126. }
  127. // 新增意见协单
  128. export const publicAssistAdvice = (postData = {}) => {
  129. return HTTPREQUEST.post('/api/admin/publicAssistAdvice/add', postData)
  130. }
  131. // 查看协单公出意见
  132. export const publicAssistAdviceList = (postData = {}) => {
  133. return HTTPREQUEST.get('/api/admin/publicAssistAdvice/list', postData)
  134. }
  135. // 获取我的客户列表
  136. export const selectMyUser = (postData = {}) => {
  137. return HTTPREQUEST.get('/api/admin/customer/selectMyUser', postData)
  138. }
  139. // 客户信息详情
  140. export const selectMyUserDetails = (postData = {}) => {
  141. return HTTPREQUEST.get('/api/admin/customer/selectMyUserDetails', postData)
  142. }
  143. // 客户档案详情
  144. export const queryByUidAll = (notRequired = false, postData = {}) => {
  145. return HTTPREQUEST.get(notRequired ? '/api/admin/userArchives/superQueryByUidAll' : '/api/admin/userArchives/queryByUidAll', postData)
  146. }
  147. // 企业公出情况
  148. export const getPublicList = (notRequired = false, postData = {}) => {
  149. return HTTPREQUEST.get(notRequired ? '/api/admin/customer/selectPublicReleaseList' : '/api/admin/customer/getPublicReleaseList', postData)
  150. }
  151. // 修改客户信息
  152. export const updateUserDate = (type = 0, postData = {}) => {
  153. return HTTPREQUEST.post((type == 0 || type == 5) ? '/api/admin/customer/updateUserDate' : '/api/admin/userArchives/update', postData)
  154. }
  155. // 修改客户信息
  156. export const updateUser = (postData = {}) => {
  157. return HTTPREQUEST.post('/api/admin/interview/updateUser', postData);
  158. }
  159. // 新增联系人
  160. export const addOneContact = (postData = {}) => {
  161. return HTTPREQUEST.post('/api/admin/customer/addOneContact', postData)
  162. }
  163. // 联系人列表
  164. export const findCustomerContacts = (postData = {}) => {
  165. return HTTPREQUEST.get('/api/admin/customer/findCustomerContacts', postData)
  166. }
  167. // 主联系人设置
  168. export const updateMainContact = (postData = {}) => {
  169. return HTTPREQUEST.get('/api/admin/customer/updateMainContact', postData)
  170. }
  171. // 分享限时查询
  172. export const limitUser = (postData = {}) => {
  173. return HTTPREQUEST.post('/api/admin/release/limitUser', postData)
  174. }
  175. // 项目列表
  176. export const getBusinessProjectByName = (postData = {}) => {
  177. return HTTPREQUEST.get('/api/admin/order/getBusinessProjectByName', postData)
  178. }
  179. // 公出补充
  180. export const addSupplement = (postData = {}) => {
  181. return HTTPREQUEST.post('/api/admin/release/addSupplement', postData)
  182. }
  183. // 上级评价详情
  184. export const getUserSuperEvaluate = (postData = {}) => {
  185. return HTTPREQUEST.get('/api/admin/userSuperEvaluate/list', postData)
  186. }
  187. // 上级填写评价
  188. export const addUserSuperEvaluate = (postData = {}) => {
  189. return HTTPREQUEST.post('/api/admin/userSuperEvaluate/add', postData)
  190. }
  191. // 是否完成客户档案
  192. export const checkUserArchives = (postData = {}) => {
  193. return HTTPREQUEST.get('/api/admin/release/checkUserArchives', postData)
  194. }
  195. // 公司名称验证
  196. export const checkUserName = (postData = {}) => {
  197. return HTTPREQUEST.get('/api/admin/customer/checkUserName', postData)
  198. }
  199. // 新增客户
  200. export const addCustomer = (postData = {}) => {
  201. return HTTPREQUEST.post('/api/admin/customer/addCustomer', postData)
  202. }
  203. // 新增渠道
  204. export const addChannel = (postData = {}) => {
  205. return HTTPREQUEST.post('/api/admin/customer/addChannel', postData)
  206. }
  207. // 是否最大客户数判断
  208. export const queryUserMax = (postData = {}) => {
  209. return HTTPREQUEST.get('/api/admin/customer/queryUserMax', postData)
  210. }
  211. // 新增客户面谈项目
  212. export const addProject = (postData = {}) => {
  213. return HTTPREQUEST.post('/api/admin/userInterviewProject/add', postData)
  214. }
  215. // 查询面谈客户项目
  216. export const queryProjectList = (postData = {}) => {
  217. return HTTPREQUEST.get('/api/admin/userInterviewProject/list', postData)
  218. }
  219. // 删除客户面谈项目
  220. export const delProject = (id, postData = {}) => {
  221. return HTTPREQUEST.get('/api/admin/userInterviewProject/delete?id='+id, postData)
  222. }