servers.js 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  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 ? '/api/admin/release/examinePublicRelease' : isSuperior == 2 ? '/api/admin/release/marketersExamine' : '/api/admin/release/techExamine', postData)
  63. }
  64. //获取外出公出详情
  65. export const getReleasetDails = (postData = {}) => {
  66. return HTTPREQUEST.get('/api/admin/release/dtails', postData)
  67. }
  68. //获取公出日志
  69. export const getListPublicReleaseLog = (postData = {}) => {
  70. return HTTPREQUEST.get('/api/admin/release/listPublicReleaseLog', postData)
  71. }
  72. //修改公出申请
  73. export const updatePublicRelease = (postData = {}) => {
  74. return HTTPREQUEST.post('/api/admin/release/updatePublicRelease', postData)
  75. }
  76. //外出未读
  77. export const getPublicReleaseUnread = (postData = {}) => {
  78. return HTTPREQUEST.get('/api/admin/notice/publicReleaseUnread', postData)
  79. }
  80. //获取知道部门作息时间
  81. export const getWorkingHours = (postData = {}) => {
  82. return HTTPREQUEST.get('/api/admin/department/workingHours/get', postData)
  83. }
  84. //获取部门作息列表
  85. export const getWorkingHoursList = (postData = {}) => {
  86. return HTTPREQUEST.get('/api/admin/department/workingHours/list', postData)
  87. }
  88. //获取微信参数
  89. export const getWxConfig = (postData = {}) => {
  90. return HTTPREQUEST.get('/open/getWxConfig', postData)
  91. }
  92. //测试
  93. export const test = (postData = {}) => {
  94. return HTTPREQUEST.get('/open/getVCode', postData)
  95. }
  96. //技术协单驳回
  97. export const techReject = (postData = {}) => {
  98. return HTTPREQUEST.post('/api/admin/release/techReject', postData)
  99. }
  100. //新增协单助力
  101. export const addAssistant = (postData = {}) => {
  102. return HTTPREQUEST.post('/api/admin/release/addAssistant', postData)
  103. }
  104. //删除协单助力
  105. export const deleteAssistant = (postData = {}) => {
  106. return HTTPREQUEST.post('/api/admin/release/deleteAssistant', postData)
  107. }
  108. //修改公出地址
  109. export const updateLocation = (postData = {}) => {
  110. return HTTPREQUEST.post('/api/admin/release/updateLocation', postData)
  111. }
  112. // 技术公出发起情况
  113. export const checkOrderNoDuration = (postData = {}) => {
  114. return HTTPREQUEST.get('/api/admin/release/checkOrderNoDuration', postData)
  115. }