Blame view

src/api/inspection/inspectionPlanApi.js 3.64 KB
1d73dc48   wuxw   继续晚上巡检功能
1
2
3
4
5
  import request from '@/utils/request'
  import { getCommunityId } from '@/api/community/communityApi'
  
  // 获取字典数据
  export function getDict(dictType, state) {
cbeb361b   wuxw   v1.9 巡检功能修复一些显示的bug
6
7
8
9
10
11
12
13
14
15
16
17
    return new Promise((resolve, reject) => {
      request({
        url: '/dict.listDict',
        method: 'get',
        params: { dictType, state }
      }).then(response => {
        const res = response.data
        resolve(res)
      }).catch(error => {
        reject(error)
      })
    })
1d73dc48   wuxw   继续晚上巡检功能
18
19
20
21
  }
  
  // 查询巡检计划列表
  export function listInspectionPlans(params) {
cbeb361b   wuxw   v1.9 巡检功能修复一些显示的bug
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
    return new Promise((resolve, reject) => {
      request({
        url: '/inspectionPlan.listInspectionPlans',
        method: 'get',
        params: {
          ...params,
          communityId: getCommunityId()
        }
      }).then(response => {
        const res = response.data
        resolve(res)
      }).catch(error => {
        reject(error)
      })
    })
1d73dc48   wuxw   继续晚上巡检功能
37
38
39
40
  }
  
  // 更新巡检计划状态
  export function updateInspectionPlanState(data) {
cbeb361b   wuxw   v1.9 巡检功能修复一些显示的bug
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
    return new Promise((resolve, reject) => {
      request({
        url: '/inspectionPlan.updateInspectionPlanState',
        method: 'post',
        data: {
          ...data,
          communityId: getCommunityId()
        }
      }).then(response => {
        const res = response.data
        resolve(res)
      }).catch(error => {
        reject(error)
      })
    })
1d73dc48   wuxw   继续晚上巡检功能
56
57
58
59
  }
  
  // 删除巡检计划
  export function deleteInspectionPlan(data) {
cbeb361b   wuxw   v1.9 巡检功能修复一些显示的bug
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
    return new Promise((resolve, reject) => {
      request({
        url: '/inspectionPlan.deleteInspectionPlan',
        method: 'post',
        data: {
          ...data,
          communityId: getCommunityId()
        }
      }).then(response => {
        const res = response.data
        resolve(res)
      }).catch(error => {
        reject(error)
      })
    })
1d73dc48   wuxw   继续晚上巡检功能
75
76
77
78
  }
  
  // 更新巡检计划
  export function updateInspectionPlan(data) {
cbeb361b   wuxw   v1.9 巡检功能修复一些显示的bug
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
    return new Promise((resolve, reject) => {
      request({
        url: '/inspectionPlan.updateInspectionPlan',
        method: 'post',
        data: {
          ...data,
          communityId: getCommunityId()
        }
      }).then(response => {
        const res = response.data
        resolve(res)
      }).catch(error => {
        reject(error)
      })
    })
1d73dc48   wuxw   继续晚上巡检功能
94
95
96
97
  }
  
  // 查询巡检路线列表
  export function listInspectionRoutes(params) {
cbeb361b   wuxw   v1.9 巡检功能修复一些显示的bug
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
    return new Promise((resolve, reject) => {
      request({
        url: '/inspectionRoute.listInspectionRoutes',
        method: 'get',
        params: {
          ...params,
          communityId: getCommunityId()
        }
      }).then(response => {
        const res = response.data
        resolve(res)
      }).catch(error => {
        reject(error)
      })
    })
1d73dc48   wuxw   继续晚上巡检功能
113
114
115
116
  }
  
  // 查询巡检计划员工
  export function listInspectionPlanStaffs(params) {
cbeb361b   wuxw   v1.9 巡检功能修复一些显示的bug
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
    return new Promise((resolve, reject) => {
      request({
        url: '/inspection.listInspectionPlanStaffs',
        method: 'get',
        params: {
          ...params,
          communityId: getCommunityId()
        }
      }).then(response => {
        const res = response.data
        resolve(res)
      }).catch(error => {
        reject(error)
      })
    })
1d73dc48   wuxw   继续晚上巡检功能
132
133
134
135
  }
  
  // 查询组织树
  export function listOrgTree() {
cbeb361b   wuxw   v1.9 巡检功能修复一些显示的bug
136
137
138
139
140
141
142
143
144
145
146
147
148
149
    return new Promise((resolve, reject) => {
      request({
        url: '/org.listOrgTree',
        method: 'get',
        params: { 
          communityId: getCommunityId() 
        }
      }).then(response => {
        const res = response.data
        resolve(res)
      }).catch(error => {
        reject(error)
      })
    })
1d73dc48   wuxw   继续晚上巡检功能
150
151
152
153
  }
  
  // 根据组织ID查询员工
  export function listStaffsByOrgId(params) {
cbeb361b   wuxw   v1.9 巡检功能修复一些显示的bug
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
    return new Promise((resolve, reject) => {
      request({
        url: '/query.staff.infos',
        method: 'get',
        params: {
          ...params,
          communityId: getCommunityId()
        }
      }).then(response => {
        const res = response.data
        resolve(res)
      }).catch(error => {
        reject(error)
      })
    })
1d73dc48   wuxw   继续晚上巡检功能
169
  }