Blame view

src/api/car/carInoutManageApi.js 1.05 KB
a3057712   wuxw   完成在场车辆和车辆进出场记录
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
  import request from '@/utils/request'
  import { getCommunityId } from '@/api/community/communityApi'
  
  // 获取停车场区域列表
  export function listParkingAreas(params) {
    return new Promise((resolve, reject) => {
      const communityId = getCommunityId()
      request({
        url: '/parkingArea.listParkingAreas',
        method: 'get',
        params: {
          ...params,
          communityId
        }
      }).then(response => {
        const res = response.data
          resolve(res)
      }).catch(error => {
        reject(error)
      })
    })
  }
  
  // 获取进出场记录列表
  export function listCarInouts(params) {
    return new Promise((resolve, reject) => {
      const communityId = getCommunityId()
      request({
        url: '/iot.getOpenApi',
        method: 'get',
        params: {
          ...params,
          communityId
        }
      }).then(response => {
        const res = response.data
        if (res.code === 0) {
          resolve(res)
        } else {
          reject(new Error(res.msg || '获取进出场记录失败'))
        }
      }).catch(error => {
        reject(error)
      })
    })
  }