servers.js 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  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('/login', {
  12. username: res.username,
  13. password: res.password,
  14. });
  15. if (msg.data.code == 200) {
  16. Taro.setStorageSync('token', msg.data.token);
  17. Taro.hideLoading();
  18. Taro.showToast({ title: '登录成功', icon: 'success' })
  19. resolve(msg);
  20. } else {
  21. Taro.hideLoading();
  22. Taro.showToast({ title: msg.data.msg, icon: 'none' })
  23. reject();
  24. }
  25. } catch (err) {
  26. Taro.showToast({ title: '系统错误,请稍后重试', icon: 'none' });
  27. Taro.hideLoading();
  28. reject();
  29. // console.log(err,'login')
  30. }
  31. })
  32. }
  33. // 获取用户信息
  34. export const getInfo = (postData = {}) => {
  35. return HTTPREQUEST.get('/getInfo', postData)
  36. }
  37. // 存储openId
  38. export const setOpenId = (postData = {}) => {
  39. return HTTPREQUEST.get('/system/weChat/getOpenId', postData)
  40. }
  41. // 项目列表
  42. export const getProjectList = (postData = {}) => {
  43. return HTTPREQUEST.get('/api/project/list', postData)
  44. }
  45. // 新增项目
  46. export const projectAdd = (postData = {}) => {
  47. return HTTPREQUEST.get('/api/project/add', postData)
  48. }
  49. // 新增研发日志(打卡)
  50. export const recordAdd = (postData = {}) => {
  51. return HTTPREQUEST.post('/api/project/addRecord', postData)
  52. }
  53. // 查询打卡剩余时间
  54. export const myDuration = (postData = {}) => {
  55. return HTTPREQUEST.get('/api/project/myDuration', postData)
  56. }
  57. // 研发日志列表
  58. export const listRecord = (postData = {}) => {
  59. return HTTPREQUEST.get('/api/project/listRecord', postData)
  60. }
  61. // 研发日志详情
  62. export const recordDetails = (postData = {}) => {
  63. return HTTPREQUEST.get('/api/project/recordDetails', postData)
  64. }
  65. // 研发日志审核
  66. export const examineRecord = (postData = {}) => {
  67. return HTTPREQUEST.post('/api/project/examineRecord', postData)
  68. }
  69. // 查询客户订单
  70. export const getOrderByUid = (postData = {}) => {
  71. return HTTPREQUEST.get('/api/admin/release/selectOrderByUid', postData)
  72. }
  73. export const getUserByName = (postData = {}) => {
  74. return HTTPREQUEST.get('/api/admin/customer/getUserByNames', postData)
  75. }
  76. export const getadminByName = (postData = {}) => {
  77. return HTTPREQUEST.get('/api/admin/customer/listAdminByName', postData)
  78. }
  79. export const addPublicRelease = (postData = {}) => {
  80. return HTTPREQUEST.post('/api/admin/release/addPublicRelease', postData)
  81. }
  82. //获取最近打卡信息
  83. export const getPunchClockInfo = (postData = {}) => {
  84. return HTTPREQUEST.get('/api/admin/release/getMyNewPublic', postData)
  85. }
  86. export const getPublicReleaseList = (postData = {}) => {
  87. return HTTPREQUEST.get('/api/admin/release/listPublicRelease', postData)
  88. }
  89. export const publicReleaseClockIn = (postData = {}) => {
  90. return HTTPREQUEST.post('/api/admin/release/publicReleaseClockIn', postData)
  91. }
  92. // 公出审批
  93. export const examinePublicRelease = (isSuperior = true, postData = {}) => {
  94. return HTTPREQUEST.post(isSuperior ? '/api/admin/release/examinePublicRelease' : '/api/admin/release/MarketersExamine', postData)
  95. }
  96. //获取外出公出详情
  97. export const getReleasetDails = (postData = {}) => {
  98. return HTTPREQUEST.get('/api/admin/release/dtails', postData)
  99. }
  100. //获取公出日志
  101. export const getListPublicReleaseLog = (postData = {}) => {
  102. return HTTPREQUEST.get('/api/admin/release/listPublicReleaseLog', postData)
  103. }
  104. //修改公出申请
  105. export const updatePublicRelease = (postData = {}) => {
  106. return HTTPREQUEST.post('/api/admin/release/updatePublicRelease', postData)
  107. }
  108. //外出未读
  109. export const getPublicReleaseUnread = (postData = {}) => {
  110. return HTTPREQUEST.get('/api/admin/notice/publicReleaseUnread', postData)
  111. }
  112. //获取知道部门作息时间
  113. export const getWorkingHours = (postData = {}) => {
  114. return HTTPREQUEST.get('/api/admin/department/workingHours/get', postData)
  115. }
  116. //获取部门作息列表
  117. export const getWorkingHoursList = (postData = {}) => {
  118. return HTTPREQUEST.get('/api/admin/department/workingHours/list', postData)
  119. }
  120. //获取微信参数
  121. export const getWxConfig = (postData = {}) => {
  122. return HTTPREQUEST.get('/open/getWxConfig', postData)
  123. }
  124. //测试
  125. export const test = (postData = {}) => {
  126. return HTTPREQUEST.get('/open/getVCode', postData)
  127. }
  128. //技术协单驳回
  129. export const techReject = (postData = {}) => {
  130. return HTTPREQUEST.post('/api/admin/release/techReject', postData)
  131. }
  132. //新增协单助力
  133. export const addAssistant = (postData = {}) => {
  134. return HTTPREQUEST.post('/api/admin/release/addAssistant', postData)
  135. }
  136. //删除协单助力
  137. export const deleteAssistant = (postData = {}) => {
  138. return HTTPREQUEST.post('/api/admin/release/deleteAssistant', postData)
  139. }
  140. //修改公出地址
  141. export const updateLocation = (postData = {}) => {
  142. return HTTPREQUEST.post('/api/admin/release/updateLocation', postData)
  143. }