From d88b3434fbd31632cb0ff57c151e0ea95cf0267e Mon Sep 17 00:00:00 2001 From: hflllll Date: Thu, 4 Sep 2025 19:29:00 +0800 Subject: [PATCH] =?UTF-8?q?'=E4=BF=AEBUG'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- subPages/home/repairSubmit.vue | 14 +++++++++----- subPages/repair/maintainSubmit.vue | 11 +++++++++-- utils/upload.js | 4 ++-- 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/subPages/home/repairSubmit.vue b/subPages/home/repairSubmit.vue index a944d6b..372f02c 100644 --- a/subPages/home/repairSubmit.vue +++ b/subPages/home/repairSubmit.vue @@ -251,7 +251,7 @@ @@ -436,14 +436,18 @@ export default { uni.showToast({ title: '请选择故障紧急程度', icon: 'none' }) return } - // if (!this.malfunctionStatus) { - // uni.showToast({ title: '请选择故障情况', icon: 'none' }) - // return - // } + if (!this.malfunctionImage.length) { + uni.showToast({ title: '请上传故障图片', icon: 'none' }) + return + } if (!this.malfunctionDesc.trim()) { uni.showToast({ title: '请填写故障情况描述', icon: 'none' }) return } + if (!this.firstDate.trim()) { + uni.showToast({ title: '请选择故障首次发生时间', icon: 'none' }) + return + } // 提交数据 const formData = { diff --git a/subPages/repair/maintainSubmit.vue b/subPages/repair/maintainSubmit.vue index c06d1cc..12e4be5 100644 --- a/subPages/repair/maintainSubmit.vue +++ b/subPages/repair/maintainSubmit.vue @@ -524,14 +524,21 @@ export default { }) return } + }else { + } const tempData = {...this.processData} + delete tempData.costDetails const tempDataList = [...this.processData.costDetails] + if (this.processData.isExpend === '1') { + tempData.expenseList = tempDataList.map(item => `${item.name},${item.quantity},${item.amount}`).join(';') + }else { + delete tempData.expenseList + } const submitRes = await this.$api.exhibit.addRepair({ id: this.id, ...tempData, - amount: this.amount, - expenseList: tempDataList.map(item => `${item.name},${item.quantity},${item.amount}`).join(';') + amount: this.amount }) if (submitRes.code === 200) { diff --git a/utils/upload.js b/utils/upload.js index 2b8ce49..f4f3b6d 100644 --- a/utils/upload.js +++ b/utils/upload.js @@ -131,7 +131,7 @@ const chooseAndUpload = async () => { } // 显示加载提示 - uni.showLoading({ title: '上传到OSS中...' }) + uni.showLoading({ title: '上传中...' }) // 上传文件到OSS const uploadResult = await uploadImage(file) @@ -139,7 +139,7 @@ const chooseAndUpload = async () => { uni.hideLoading() if (uploadResult.success) { - uni.showToast({ title: 'OSS上传成功', icon: 'success' }) + uni.showToast({ title: '上传成功!', icon: 'success' }) return uploadResult } else { uni.showToast({ title: uploadResult.error, icon: 'error' })