From 25da8d06d481458e8ca6771dafc0e8aef1e24863 Mon Sep 17 00:00:00 2001 From: weipengfei <2187978347@qq.com> Date: Thu, 14 Sep 2023 15:11:56 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=E4=BB=BB=E5=8A=A1=E6=8F=90?= =?UTF-8?q?=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/task.js | 2 +- subpkg/otherTask/otherTask.vue | 36 ++++++++++++++++++---------------- 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/api/task.js b/api/task.js index b982545..9488848 100644 --- a/api/task.js +++ b/api/task.js @@ -39,5 +39,5 @@ export const taskOtherTaskDetail = (data) => oahttp.get('/task/other_task_detail /** * 任务:提交其他任务 */ -export const taskOtherTaskUpload = (data) => oahttp.post('/task/commit', data) +export const taskOtherTaskCommit = (data) => oahttp.post('/task/cimmit_other_task', data) diff --git a/subpkg/otherTask/otherTask.vue b/subpkg/otherTask/otherTask.vue index e8dccef..153b0c4 100644 --- a/subpkg/otherTask/otherTask.vue +++ b/subpkg/otherTask/otherTask.vue @@ -14,24 +14,25 @@ 详情描述 - 添加附件 - + - + + - - - + + + @@ -41,7 +42,7 @@ } from "@/api/file.js" import { taskOtherTaskDetail, - taskOtherTaskUpload + taskOtherTaskCommit } from "@/api/task.js" import { Toast } from "../../libs/uniApi"; export default { @@ -66,41 +67,42 @@ import { Toast } from "../../libs/uniApi"; computed: { // 占位长度 placeholderLength() { + if(this.other.is_commit==1) return this.fileList.length % 3 == 0 ? 0 : 3 - this.fileList.length % 3; return (this.fileList.length + 1) % 3 == 0 ? 0 : 3 - (this.fileList.length + 1) % 3; } }, methods: { + // 初始化 initDetail() { taskOtherTaskDetail({ id: this.task_id }).then((res) => { this.task_info = res.data; this.other = res.data?.extend?.other; + res.data?.extend?.other?.annex ? this.fileList = res.data?.extend?.other?.annex : null; }) }, async submit(){ - console.log('提交'); if(this.other.note.trim()=='')return Toast('详情描述不能为空'); - await taskOtherTaskUpload({ + await taskOtherTaskCommit({ id: this.task_id, - extend: { - other: { - note: this.other.note, - annex: this.other.annex - } - } + note: this.other.note, + annex: this.fileList }); this.other.is_commit = 1; Toast('提交成功') }, + showToast(str){ + Toast(str) + }, chooseFile() { uni.chooseImage({ sizeType: ['compressed'], success: async (res) => { for (let item of res.tempFiles) { - let res = await upLoadImage({ + let ul = await upLoadImage({ filePath: item.path, name: 'file' }); - this.fileList.push(res.data.uri); + this.fileList.push(ul.data.uri); } // this.fileList = [...this.fileList, res.tempFiles] }