http.js 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. import request from './request'
  2. import storage from './storage'
  3. //获取code
  4. export function wxgetCode(params) {
  5. return new Promise((resolve, reject) => {
  6. request.post("/user/session",params).then(result=>{
  7. resolve(result)
  8. }).catch(err=>{
  9. reject(err)
  10. });
  11. })
  12. }
  13. //登录
  14. export function wxLogin(params) {
  15. return new Promise((resolve, reject) => {
  16. request.post("/mini/login",params).then(result=>{
  17. resolve(result)
  18. }).catch(err=>{
  19. reject(err)
  20. });
  21. })
  22. }
  23. //登录用户协议
  24. export function getAgreement(){
  25. return request.get("/system/config/configKey/sys.login.userAgreement")
  26. }
  27. //用户信息
  28. export function getInfoData(){
  29. return request.get("/getInfo")
  30. }
  31. //首页-运维工单
  32. export function getOpsOrderOverview(stationCode){
  33. return request.get("/mini/order/home/opsOrderOverview?stationCode=" + stationCode)
  34. }
  35. //首页-换电站合作者
  36. export function getStationOverview(data){
  37. return request.get(`/mini/station/home/stationOverview?stationName=`+data)
  38. }
  39. //下拉框-获取权限内全部站点
  40. export function getHasStationCodeAndName(){
  41. return request.get("/mini/station/hasStationCodeAndName")
  42. }
  43. //获取供货商列表
  44. export function getSupplierList(params){
  45. return request.post("/mini/supplier/list",params)
  46. }
  47. //获取站点权限内用户下拉框
  48. export function getUserListByStationCode(stationCode){
  49. return request.get("/system/user/getUserListByStationCode?stationCode=" + stationCode)
  50. }
  51. //工单上报
  52. export function addOrder(params){
  53. return request.post("/mini/order/add",params)
  54. }
  55. //工单上报记录
  56. export function getOrderLogList(params){
  57. return request.post("/mini/workOrderLog/table/list",params)
  58. }
  59. //获取运维工单
  60. export function getOrderList(params){
  61. return request.post("/mini/order/table/list",params)
  62. }
  63. //工单详情
  64. export function getOrderDetail(id){
  65. return request.get("/mini/order/detail/getInfo/" + id)
  66. }
  67. //工单处理
  68. export function orderDeal(params){
  69. return request.post("/mini/workOrderLog/add", params)
  70. }
  71. //获取工单处理过程列表
  72. export function getOrderDealList(params){
  73. return request.post("/mini/workOrderLog/getList", params)
  74. }
  75. //我的-我的记录
  76. export function getMyRecord(stationCode){
  77. return request.get("/mini/workOrderLog/mine/myRecord?stationCode=" + stationCode)
  78. }
  79. //查询设备类型
  80. export function getDictType(dictType){
  81. return request.get("/system/dict/data/type/" + dictType)
  82. }
  83. //获取用户经纬度
  84. export function getUserAdress(params){
  85. return request.post("/system/user/address",params)
  86. }
  87. //新增合作者
  88. export function supplierAdd(params){
  89. return request.post("/business/supplier/add",params)
  90. }
  91. //修改合作者
  92. export function supplierEdit(params){
  93. return request.post("/business/supplier/edit",params)
  94. }
  95. //删除合作者
  96. export function supplierDel(data){
  97. return request.get(`/mini/supplier/del?id=${data.id}&stationCode=${data.stationCode}`)
  98. }