From ae478a3d5dab28dd598d39f27429e4a544b15ad2 Mon Sep 17 00:00:00 2001
From: wlzboy <66905212@qq.com>
Date: 星期四, 25 十二月 2025 22:48:06 +0800
Subject: [PATCH] feat:已完成时,检查附件是否上传

---
 app/api/task.js |   78 +++++++++++++++++++++++++++++++++++++--
 1 files changed, 74 insertions(+), 4 deletions(-)

diff --git a/app/api/task.js b/app/api/task.js
index a2891f8..f9c95ba 100644
--- a/app/api/task.js
+++ b/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'
   })
 }
+
+// 妫�鏌ヨ溅杈嗘槸鍚︽湁姝e湪杩涜涓殑浠诲姟
+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
+    }
+  })
+}

--
Gitblit v1.9.1