companyUser.js 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362
  1. import request from '@/utils/request'
  2. import { praseStrEmpty } from "@/utils/common";
  3. // 查询用户列表
  4. export function listUser(query) {
  5. return request({
  6. url: '/company/user/list',
  7. method: 'get',
  8. params: query
  9. })
  10. }
  11. // 查询企微用户列表
  12. export function qwList(query) {
  13. return request({
  14. url: '/company/user/qwList',
  15. method: 'get',
  16. params: query
  17. })
  18. }
  19. export function getList(query) {
  20. return request({
  21. url: '/company/user/getList',
  22. method: 'get',
  23. params: query
  24. })
  25. }
  26. export function getUserList() {
  27. return request({
  28. url: '/company/user/getUserList',
  29. method: 'get'
  30. })
  31. }
  32. export function getQwUserList() {
  33. return request({
  34. url: '/company/user/getQwUserList',
  35. method: 'get'
  36. })
  37. }
  38. export function getQwAllUserList(id) {
  39. return request({
  40. url: '/company/user/getQwAllUserList/'+id,
  41. method: 'get'
  42. })
  43. }
  44. export function getQwMyUserList(id) {
  45. return request({
  46. url: '/company/user/getQwMyUserList/'+id,
  47. method: 'get'
  48. })
  49. }
  50. export function getQwDeptUserList(id) {
  51. return request({
  52. url: '/company/user/getQwDeptUserList/'+id,
  53. method: 'get'
  54. })
  55. }
  56. export function getUserListByDeptId(query) {
  57. return request({
  58. url: '/company/user/getUserListByDeptId',
  59. method: 'get',
  60. params: query
  61. })
  62. }
  63. export function getUserListByDeptIdToQwId(query) {
  64. return request({
  65. url: '/company/user/getUserListByDeptIdToQwId',
  66. method: 'get',
  67. params: query
  68. })
  69. }
  70. export function getAddressBookList(query) {
  71. return request({
  72. url: '/company/user/getAddressBookList',
  73. method: 'get',
  74. params: query
  75. })
  76. }
  77. // 查询用户详细
  78. export function getUser(userId) {
  79. return request({
  80. url: '/company/user/' + praseStrEmpty(userId),
  81. method: 'get'
  82. })
  83. }
  84. // 新增用户
  85. export function addUser(data) {
  86. return request({
  87. url: '/company/user',
  88. method: 'post',
  89. data: data
  90. })
  91. }
  92. //创建二维码
  93. export function addCodeUrl(data) {
  94. return request({
  95. url: '/company/user/addCodeUrl',
  96. method: 'post',
  97. data: data
  98. })
  99. }
  100. // 修改用户
  101. export function updateUser(data) {
  102. return request({
  103. url: '/company/user',
  104. method: 'put',
  105. data: data
  106. })
  107. }
  108. // 删除用户
  109. export function delUser(userIds) {
  110. return request({
  111. url: '/company/user/' + userIds,
  112. method: 'delete'
  113. })
  114. }
  115. // 导出用户
  116. export function exportUser(query) {
  117. return request({
  118. url: '/company/user/export',
  119. method: 'get',
  120. params: query
  121. })
  122. }
  123. // 用户密码重置
  124. export function resetUserPwd(userId, password) {
  125. const data = {
  126. userId,
  127. password
  128. }
  129. return request({
  130. url: '/company/user/resetPwd',
  131. method: 'put',
  132. data: data
  133. })
  134. }
  135. // 用户状态修改
  136. export function changeUserStatus(userId, status) {
  137. const data = {
  138. userId,
  139. status
  140. }
  141. return request({
  142. url: '/company/user/changeStatus',
  143. method: 'put',
  144. data: data
  145. })
  146. }
  147. // 查询用户个人信息
  148. export function getUserProfile() {
  149. return request({
  150. url: '/company/user/profile',
  151. method: 'get'
  152. })
  153. }
  154. // 修改用户个人信息
  155. export function updateUserProfile(data) {
  156. return request({
  157. url: '/company/user/profile',
  158. method: 'put',
  159. data: data
  160. })
  161. }
  162. // 用户密码重置
  163. export function updateUserPwd(oldPassword, newPassword) {
  164. const data = {
  165. oldPassword,
  166. newPassword
  167. }
  168. return request({
  169. url: '/company/user/profile/updatePwd',
  170. method: 'put',
  171. params: data
  172. })
  173. }
  174. // 用户头像上传
  175. export function uploadAvatar(data) {
  176. return request({
  177. url: '/company/user/profile/avatar',
  178. method: 'post',
  179. data: data
  180. })
  181. }
  182. // 下载用户导入模板
  183. export function importTemplate() {
  184. return request({
  185. url: '/company/user/importTemplate',
  186. method: 'get'
  187. })
  188. }
  189. export function getSelectUserList(query) {
  190. return request({
  191. url: '/company/user/getSelectUserList',
  192. method: 'get',
  193. params: query
  194. })
  195. }
  196. /**
  197. * 获取地区
  198. */
  199. export function getCitysAreaList(query) {
  200. return request({
  201. url: '/company/user/getCitysAreaList',
  202. method: 'get',
  203. params: query
  204. })
  205. }
  206. /**
  207. * 批量修改 销售的所属区域(临时的)
  208. */
  209. export function updateCompanyUserAreaList(data) {
  210. return request({
  211. url: '/company/user/updateCompanyUserAreaList',
  212. method: 'post',
  213. data: data
  214. })
  215. }
  216. // 根据名称模糊查询用户列表
  217. export function getCompanyUserListLikeName(params) {
  218. return request({
  219. url: '/company/user/getCompanyUserListLikeName',
  220. method: 'get',
  221. params: params
  222. })
  223. }
  224. // 根据名模糊查询用户列表
  225. export function getCompanyUserListLikeNameByDept(params) {
  226. return request({
  227. url: '/company/user/getCompanyUserListLikeNameDept',
  228. method: 'get',
  229. params: params
  230. })
  231. }
  232. // 查询企业员工信息列表
  233. export function listCompanyUser(query) {
  234. return request({
  235. url: '/company/user/list',
  236. method: 'get',
  237. params: query
  238. })
  239. }
  240. // 查询企业员工信息列表
  241. export function getCompanyUserList(query) {
  242. return request({
  243. url: '/company/user/getCompanyUserList',
  244. method: 'get',
  245. params: query
  246. })
  247. }
  248. //生成域名
  249. export function generateSubDomain(query){
  250. return request({
  251. url: '/company/user/generateSubDomain',
  252. method: 'get',
  253. params: query
  254. })
  255. }
  256. // 设置是否需要单独注册会员
  257. export function setIsRegisterMember(status, data) {
  258. return request({
  259. url: '/company/user/setRegister',
  260. method: 'put',
  261. params: status,
  262. data: data
  263. })
  264. }
  265. // 开关是否允许所有方式注册会员
  266. export function isAllowedAllRegister(status, data) {
  267. return request({
  268. url: '/company/user/allowedAllRegister',
  269. method: 'put',
  270. params: status,
  271. data: data
  272. })
  273. }
  274. // 绑定医生
  275. export function bindDoctorId(data) {
  276. return request({
  277. url: '/company/user/bindDoctorId',
  278. method: 'post',
  279. data: data
  280. })
  281. }
  282. //解绑医生
  283. export function unBindDoctorId(userId) {
  284. return request({
  285. url: '/company/user/unBindDoctorId/'+userId,
  286. method: 'get'
  287. })
  288. }
  289. //批量修改用户的角色
  290. export function updateBatchUserRoles(data) {
  291. return request({
  292. url: '/company/user/updateBatchUserRoles',
  293. method: 'post',
  294. data: data
  295. })
  296. }
  297. // 根据手机号码查询fs_user(完全匹配)
  298. export function queryFsUserByPhone(phone) {
  299. return request({
  300. url: '/company/user/fsUser/queryByPhone',
  301. method: 'get',
  302. params: { phone: phone }
  303. })
  304. }
  305. // 批量绑定用户到员工
  306. export function batchBindCompanyUserId(data) {
  307. return request({
  308. url: '/company/user/batchBindCompanyUserId',
  309. method: 'post',
  310. data: data
  311. })
  312. }
  313. // 查询已绑定的用户
  314. export function getBoundUsers(companyUserId) {
  315. return request({
  316. url: '/company/user/getBoundUsers/' + companyUserId,
  317. method: 'get'
  318. })
  319. }