| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176 |
- /* eslint-disable import/prefer-default-export */
- import HTTPREQUEST from "./http"
- import Taro from "@tarojs/taro";
- // 登录
- export const login = (res) => {
- return new Promise(async (resolve, reject) => {
- Taro.showLoading({
- title: '登录中...',
- })
- try {
- let msg = await HTTPREQUEST.post('/login', {
- username: res.username,
- password: res.password,
- });
- if (msg.data.code == 200) {
- Taro.setStorageSync('token', msg.data.token);
- Taro.hideLoading();
- Taro.showToast({ title: '登录成功', icon: 'success' })
- resolve(msg);
- } else {
- Taro.hideLoading();
- Taro.showToast({ title: msg.data.msg, icon: 'none' })
- reject();
- }
- } catch (err) {
- Taro.showToast({ title: '系统错误,请稍后重试', icon: 'none' });
- Taro.hideLoading();
- reject();
- // console.log(err,'login')
- }
- })
- }
- // 获取用户信息
- export const getInfo = (postData = {}) => {
- return HTTPREQUEST.get('/getInfo', postData)
- }
- // 存储openId
- export const setOpenId = (postData = {}) => {
- return HTTPREQUEST.get('/system/weChat/getOpenId', postData)
- }
- // 项目列表
- export const getProjectList = (postData = {}) => {
- return HTTPREQUEST.get('/api/project/list', postData)
- }
- // 新增项目
- export const projectAdd = (postData = {}) => {
- return HTTPREQUEST.get('/api/project/add', postData)
- }
- // 新增研发日志(打卡)
- export const recordAdd = (postData = {}) => {
- return HTTPREQUEST.post('/api/project/addRecord', postData)
- }
- // 查询打卡剩余时间
- export const myDuration = (postData = {}) => {
- return HTTPREQUEST.get('/api/project/myDuration', postData)
- }
- // 研发日志列表
- export const listRecord = (postData = {}) => {
- return HTTPREQUEST.get('/api/project/listRecord', postData)
- }
- // 研发日志详情
- export const recordDetails = (postData = {}) => {
- return HTTPREQUEST.get('/api/project/recordDetails', postData)
- }
- // 研发日志审核
- export const examineRecord = (postData = {}) => {
- return HTTPREQUEST.post('/api/project/examineRecord', postData)
- }
- // 查询客户订单
- export const getOrderByUid = (postData = {}) => {
- return HTTPREQUEST.get('/api/admin/release/selectOrderByUid', postData)
- }
- export const getUserByName = (postData = {}) => {
- return HTTPREQUEST.get('/api/admin/customer/getUserByNames', postData)
- }
- export const getadminByName = (postData = {}) => {
- return HTTPREQUEST.get('/api/admin/customer/listAdminByName', postData)
- }
- export const addPublicRelease = (postData = {}) => {
- return HTTPREQUEST.post('/api/admin/release/addPublicRelease', postData)
- }
- //获取最近打卡信息
- export const getPunchClockInfo = (postData = {}) => {
- return HTTPREQUEST.get('/api/admin/release/getMyNewPublic', postData)
- }
- export const getPublicReleaseList = (postData = {}) => {
- return HTTPREQUEST.get('/api/admin/release/listPublicRelease', postData)
- }
- export const publicReleaseClockIn = (postData = {}) => {
- return HTTPREQUEST.post('/api/admin/release/publicReleaseClockIn', postData)
- }
- // 公出审批
- export const examinePublicRelease = (isSuperior = true, postData = {}) => {
- return HTTPREQUEST.post(isSuperior ? '/api/admin/release/examinePublicRelease' : '/api/admin/release/MarketersExamine', postData)
- }
- //获取外出公出详情
- export const getReleasetDails = (postData = {}) => {
- return HTTPREQUEST.get('/api/admin/release/dtails', postData)
- }
- //获取公出日志
- export const getListPublicReleaseLog = (postData = {}) => {
- return HTTPREQUEST.get('/api/admin/release/listPublicReleaseLog', postData)
- }
- //修改公出申请
- export const updatePublicRelease = (postData = {}) => {
- return HTTPREQUEST.post('/api/admin/release/updatePublicRelease', postData)
- }
- //外出未读
- export const getPublicReleaseUnread = (postData = {}) => {
- return HTTPREQUEST.get('/api/admin/notice/publicReleaseUnread', postData)
- }
- //获取知道部门作息时间
- export const getWorkingHours = (postData = {}) => {
- return HTTPREQUEST.get('/api/admin/department/workingHours/get', postData)
- }
- //获取部门作息列表
- export const getWorkingHoursList = (postData = {}) => {
- return HTTPREQUEST.get('/api/admin/department/workingHours/list', postData)
- }
- //获取微信参数
- export const getWxConfig = (postData = {}) => {
- return HTTPREQUEST.get('/open/getWxConfig', postData)
- }
- //测试
- export const test = (postData = {}) => {
- return HTTPREQUEST.get('/open/getVCode', postData)
- }
- //技术协单驳回
- export const techReject = (postData = {}) => {
- return HTTPREQUEST.post('/api/admin/release/techReject', postData)
- }
- //新增协单助力
- export const addAssistant = (postData = {}) => {
- return HTTPREQUEST.post('/api/admin/release/addAssistant', postData)
- }
- //删除协单助力
- export const deleteAssistant = (postData = {}) => {
- return HTTPREQUEST.post('/api/admin/release/deleteAssistant', postData)
- }
- //修改公出地址
- export const updateLocation = (postData = {}) => {
- return HTTPREQUEST.post('/api/admin/release/updateLocation', postData)
- }
|