优化日报模块

This commit is contained in:
hero920103 committed 2026-10-22 00:27:26 +08:00
1 parent 79d5ae6b66
commit 51fd90fc51
17 files changed
+1767 -257

No files matched your search

+30
View File
@@ -25,6 +25,13 @@
</view>
<view class="head-actions">
<text v-if="detail.can_edit" class="action-link" @tap="openEdit">编辑</text>
<text
v-if="detail.can_withdraw"
class="action-link is-warning"
@tap="handleWithdraw"
>
撤销提交
</text>
<text v-if="detail.can_delete" class="action-link is-danger" @tap="handleDelete">
删除
</text>
@@ -138,6 +145,7 @@ import { computed, ref } from 'vue'
import { onLoad, onShow } from '@dcloudio/uni-app'
import {
fetchDailyReportDetail,
withdrawDailyReport,
addDailyReportComment,
deleteDailyReportComment,
deleteDailyReport
@@ -183,6 +191,24 @@ function openEdit() {
})
}
// 撤销提交:退回草稿并留存修改痕迹,改完需重新提交
function handleWithdraw() {
uni.showModal({
title: '撤销提交',
content: '撤销后日报退回草稿,本次提交的内容会留痕,修改完成后需重新提交',
success: async (res) => {
if (!res.confirm) return
try {
await withdrawDailyReport(reportId.value)
uni.showToast({ title: '已撤销提交', icon: 'success' })
await loadDetail()
} catch (e) {
uni.showToast({ title: e?.message || '撤销提交失败', icon: 'none' })
}
}
})
}
function startReply(item) {
replyTo.value = { id: item.id, user_name: item.user_name }
}
@@ -347,6 +373,10 @@ function formatSize(size) {
&.is-danger {
color: $color-danger;
}
&.is-warning {
color: $color-warning;
}
}
.submit-time {