wlzboy
2026-04-01 c459808efab29dc1b8439fbb90556bdb16f4c88b
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
import request from '@/utils/request'
 
// 任务管理API
export function listTask(query) {
  return request({
    url: '/task/list',
    method: 'get',
    params: query
  })
}
 
export function getTask(taskId) {
  return request({
    url: '/task/' + taskId,
    method: 'get'
  })
}
 
export function addTask(data) {
  return request({
    url: '/task',
    method: 'post',
    data: data
  })
}
 
export function updateTask(data) {
  return request({
    url: '/task',
    method: 'put',
    data: data
  })
}
 
export function deleteTask(taskIds) {
  return request({
    url: '/task/' + taskIds,
    method: 'delete'
  })
}
 
export function assignTask(taskId, data) {
  return request({
    url: '/task/' + taskId + '/assign',
    method: 'put',
    data: data
  })
}
/**
 * 修改任务状态
 * @param {*} taskId 
 * @param {*} data 
 * @returns 
 */
export function changeTaskStatus(taskId, data) {
  return request({
    url: '/task/' + taskId + '/status',
    method: 'put',
    data: data
  })
}
 
// 附件管理API
export function uploadAttachment(taskId, file, category) {
  const formData = new FormData()
  formData.append('file', file)
  if (category) {
    formData.append('category', category)
  }
  return request({
    url: '/task/attachment/upload/' + taskId,
    method: 'post',
    data: formData,
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  })
}
 
export function uploadAttachmentFromWechat(taskId, mediaId, category) {
  return request({
    url: '/task/attachment/uploadFromWechat/' + taskId,
    method: 'post',
    params: {
      mediaId: mediaId,
      category: category
    }
  })
}
 
export function getAttachmentList(taskId) {
  return request({
    url: '/task/attachment/list/' + taskId,
    method: 'get'
  })
}
 
export function deleteAttachment(attachmentId) {
  return request({
    url: '/task/attachment/' + attachmentId,
    method: 'delete'
  })
}
 
// 获取微信AccessToken
export function getWechatAccessToken() {
  return request({
    url: '/wechat/accessToken',
    method: 'get'
  })
}
 
// 统计API
export function getTaskStatistics() {
  return request({
    url: '/task/statistics',
    method: 'get'
  })
}
 
// 获取任务类型列表
export function getTaskTypes() {
  return request({
    url: '/task/types',
    method: 'get'
  })
}
 
// 获取任务状态列表
export function getTaskStatuses() {
  return request({
    url: '/task/statuses',
    method: 'get'
  })
}
 
// 获取我的任务列表
export function getMyTasks() {
  return request({
    url: '/task/my',
    method: 'get'
  })
}
 
// 检查车辆是否有正在进行中的任务
export function checkVehicleActiveTasks(vehicleId) {
  return request({
    url: '/task/vehicle/' + vehicleId + '/active',
    method: 'get'
  })
}
 
// 标记执行人就绪
export function setAssigneeReady(taskId) {
  return request({
    url: '/task/' + taskId + '/assignee/ready',
    method: 'post'
  })
}
 
// 检查任务是否上传了知情同意书
export function checkTaskConsentAttachment(taskId) {
  return request({
    url: '/task/attachment/sync/task/check/' + taskId,
    method: 'post'
  })
}
 
// 检查任务是否重复(根据联系人电话和创建日期)
export function checkTaskDuplicate(phone, createDate) {
  return request({
    url: '/task/checkDuplicate',
    method: 'get',
    params: {
      phone: phone,
      createDate: createDate
    }
  })
}
 
// 同步任务到旧系统(任务编号以T2开头时未同步,结算前自动触发)
export function syncTaskStatus(taskId) {
  return request({
    url: '/task/syncServiceOrder/' + taskId,
    method: 'post'
  })
}