wlzboy
2026-03-31 61c4c3f45e4257e2e7662f033e2719e62366c632
app/api/task.js
@@ -26,7 +26,7 @@
export function updateTask(data) {
  return request({
    url: '/task/' + data.taskId,
    url: '/task',
    method: 'put',
    data: data
  })
@@ -46,7 +46,12 @@
    data: data
  })
}
/**
 * 修改任务状态
 * @param {*} taskId
 * @param {*} data
 * @returns
 */
export function changeTaskStatus(taskId, data) {
  return request({
    url: '/task/' + taskId + '/status',
@@ -56,11 +61,14 @@
}
// 附件管理API
export function uploadAttachment(taskId, file) {
export function uploadAttachment(taskId, file, category) {
  const formData = new FormData()
  formData.append('file', file)
  if (category) {
    formData.append('category', category)
  }
  return request({
    url: '/task/' + taskId + '/attachment',
    url: '/task/attachment/upload/' + taskId,
    method: 'post',
    data: formData,
    headers: {
@@ -69,10 +77,36 @@
  })
}
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'
  })
}
@@ -107,3 +141,39 @@
    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
    }
  })
}