servers.js 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  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. // console.log(err,'login')
  32. }
  33. })
  34. }
  35. // 查询客户订单
  36. export const getOrderByUid = (postData = {}) => {
  37. return HTTPREQUEST.get('/api/admin/release/selectOrderByUid', postData)
  38. }
  39. export const getUserByName = (postData = {}) => {
  40. return HTTPREQUEST.get('/api/admin/customer/getUserByNames', postData)
  41. }
  42. export const getadminByName = (postData = {}) => {
  43. return HTTPREQUEST.get('/api/admin/customer/listAdminByName', postData)
  44. }
  45. export const addPublicRelease = (postData = {}) => {
  46. return HTTPREQUEST.post('/api/admin/release/addPublicRelease', postData)
  47. }
  48. export const setOpenId = (postData = {}) => {
  49. return HTTPREQUEST.post('/api/admin/setOpenId', postData)
  50. }
  51. //获取最近打卡信息
  52. export const getPunchClockInfo = (postData = {}) => {
  53. return HTTPREQUEST.get('/api/admin/release/getMyNewPublic', postData)
  54. }
  55. export const getPublicReleaseList = (postData = {}) => {
  56. return HTTPREQUEST.get('/api/admin/release/listPublicRelease', postData)
  57. }
  58. export const publicReleaseClockIn = (postData = {}) => {
  59. return HTTPREQUEST.post('/api/admin/release/publicReleaseClockIn', postData)
  60. }
  61. // 公出审批
  62. export const examinePublicRelease = (isSuperior = 1, postData = {}) => {
  63. return HTTPREQUEST.post(isSuperior == 1 ? '/api/admin/release/examinePublicRelease' : isSuperior == 2 ? '/api/admin/release/marketersExamine' : '/api/admin/release/techExamine', postData)
  64. }
  65. //获取外出公出详情
  66. export const getReleasetDails = (postData = {}) => {
  67. return HTTPREQUEST.get('/api/admin/release/dtails', postData)
  68. }
  69. //获取公出日志
  70. export const getListPublicReleaseLog = (postData = {}) => {
  71. return HTTPREQUEST.get('/api/admin/release/listPublicReleaseLog', postData)
  72. }
  73. //修改公出申请
  74. export const updatePublicRelease = (postData = {}) => {
  75. return HTTPREQUEST.post('/api/admin/release/updatePublicRelease', postData)
  76. }
  77. //外出未读
  78. export const getPublicReleaseUnread = (postData = {}) => {
  79. return HTTPREQUEST.get('/api/admin/notice/publicReleaseUnread', postData)
  80. }
  81. //获取知道部门作息时间
  82. export const getWorkingHours = (postData = {}) => {
  83. return HTTPREQUEST.get('/api/admin/department/workingHours/get', postData)
  84. }
  85. //获取部门作息列表
  86. export const getWorkingHoursList = (postData = {}) => {
  87. return HTTPREQUEST.get('/api/admin/department/workingHours/list', postData)
  88. }
  89. //获取微信参数
  90. export const getWxConfig = (postData = {}) => {
  91. return HTTPREQUEST.get('/open/getWxConfig', postData)
  92. }
  93. //测试
  94. export const test = (postData = {}) => {
  95. return HTTPREQUEST.get('/open/getVCode', postData)
  96. }
  97. //技术协单驳回
  98. export const techReject = (postData = {}) => {
  99. return HTTPREQUEST.post('/api/admin/release/techReject', postData)
  100. }
  101. //新增协单助力
  102. export const addAssistant = (postData = {}) => {
  103. return HTTPREQUEST.post('/api/admin/release/addAssistant', postData)
  104. }
  105. //删除协单助力
  106. export const deleteAssistant = (postData = {}) => {
  107. return HTTPREQUEST.post('/api/admin/release/deleteAssistant', postData)
  108. }
  109. //修改公出地址
  110. export const updateLocation = (postData = {}) => {
  111. return HTTPREQUEST.post('/api/admin/release/updateLocation', postData)
  112. }
  113. // 技术公出发起情况
  114. export const checkOrderNoDuration = (postData = {}) => {
  115. return HTTPREQUEST.get('/api/admin/release/checkOrderNoDuration', postData)
  116. }