fix: 上传短信并通知按钮逻辑修改

This commit is contained in:
若拙_233 2025-12-19 13:57:30 +08:00
parent 4110dca428
commit 45aae516b2
4 changed files with 29 additions and 45 deletions

View File

@ -405,11 +405,10 @@ const handleCertificateConfirm = async (data) => {
report_url: reportUrl?.[0], report_url: reportUrl?.[0],
status: 'success', status: 'success',
} }
console.log('🔥🔥🔥🔥🔥🔥🔥 ~ handleCertificateConfirm ~ payload:', payload)
await api.updateValuation(payload) await api.updateValuation(payload)
$message.success('上传并通知成功') $message.success('上传成功')
certificateModalVisible.value = false certificateModalVisible.value = false
emit('back') // emit('refresh') emit('back') // emit('refresh')
} catch (error) { } catch (error) {

View File

@ -1,15 +1,6 @@
<script setup> <script setup>
import { ref, watch, computed } from 'vue' import { ref, watch, computed } from 'vue'
import { import { NModal, NCard, NButton, NUpload, NText, NImage, NImageGroup, useMessage } from 'naive-ui'
NModal,
NCard,
NButton,
NUpload,
NText,
NImage,
NImageGroup,
useMessage
} from 'naive-ui'
// //
// import { DownloadIcon } from '@vicons/tabler' // import { DownloadIcon } from '@vicons/tabler'
@ -51,8 +42,14 @@ watch(
if (val) { if (val) {
if (props.mode === 'view') { if (props.mode === 'view') {
// //
reportFileList.value = (props.certificateData?.reportFiles || []).map(f => ({ ...f, status: 'finished' })) reportFileList.value = (props.certificateData?.reportFiles || []).map((f) => ({
certificateFileList.value = (props.certificateData?.certificateFiles || []).map(f => ({ ...f, status: 'finished' })) ...f,
status: 'finished',
}))
certificateFileList.value = (props.certificateData?.certificateFiles || []).map((f) => ({
...f,
status: 'finished',
}))
} else { } else {
// //
reportFileList.value = [] reportFileList.value = []
@ -70,16 +67,19 @@ const handleClose = () => {
// //
// //
const handleConfirm = () => { const handleConfirm = () => {
const getFiles = (list) => list.map(f => ({ const getFiles = (list) =>
list
.map((f) => ({
id: f.id, id: f.id,
name: f.name, name: f.name,
url: f.url, url: f.url,
type: f.type type: f.type,
})).filter(f => f.url) }))
.filter((f) => f.url)
emit('confirm', { emit('confirm', {
reportFiles: getFiles(reportFileList.value), reportFiles: getFiles(reportFileList.value),
certificateFiles: getFiles(certificateFileList.value) certificateFiles: getFiles(certificateFileList.value),
}) })
handleClose() handleClose()
} }
@ -154,15 +154,12 @@ const handleCertificateUploadFinish = ({ file, event }) => {
} }
} }
const modalTitle = computed(() => { const modalTitle = computed(() => {
return props.mode === 'upload' ? '上传' : '查看' return props.mode === 'upload' ? '上传' : '查看'
}) })
const isUploadMode = computed(() => props.mode === 'upload') const isUploadMode = computed(() => props.mode === 'upload')
// //
const handleDownloadReport = async () => { const handleDownloadReport = async () => {
try { try {
@ -200,13 +197,14 @@ const handleSmsNotify = async () => {
} }
message.loading('正在发送短信...') message.loading('正在发送短信...')
await api.sendSmsReport({ await api.sendSmsReport({
phone: phone phone: phone,
}) })
message.success('短信发送成功') message.success('短信发送成功')
handleConfirm()
handleClose() handleClose()
emit('confirm', { emit('confirm', {
reportFiles: [], reportFiles: [],
certificateFiles: [] certificateFiles: [],
}) })
} catch (error) { } catch (error) {
console.error(error) console.error(error)
@ -231,9 +229,7 @@ const handleSmsNotify = async () => {
<div class="upload-section"> <div class="upload-section">
<div class="section-header"> <div class="section-header">
<div class="section-title">报告:</div> <div class="section-title">报告:</div>
<NButton text type="primary" @click="handleDownloadReport"> <NButton text type="primary" @click="handleDownloadReport"> 点击下载原版报告 </NButton>
点击下载原版报告
</NButton>
</div> </div>
<div class="upload-content"> <div class="upload-content">
<NUpload <NUpload
@ -275,19 +271,12 @@ const handleSmsNotify = async () => {
</div> </div>
</div> </div>
<template #footer> <template #footer>
<div class="modal-footer"> <div class="modal-footer">
<NButton @click="handleClose">取消</NButton> <NButton @click="handleClose">取消</NButton>
<NButton v-if="isUploadMode" type="primary" @click="handleConfirm"> <NButton v-if="isUploadMode" type="primary" @click="handleConfirm"> 上传 </NButton>
上传 <NButton v-if="isUploadMode" type="primary" @click="handleSmsNotify"> 短信通知 </NButton>
</NButton> <NButton v-else type="primary" @click="handleConfirm"> 确定 </NButton>
<NButton v-if="isUploadMode" type="primary" @click="handleSmsNotify">
短信通知
</NButton>
<NButton v-else type="primary" @click="handleConfirm">
确定
</NButton>
</div> </div>
</template> </template>
</NModal> </NModal>
@ -353,7 +342,6 @@ const handleSmsNotify = async () => {
margin-bottom: 8px; margin-bottom: 8px;
} }
.file-name { .file-name {
font-size: 14px; font-size: 14px;
color: #333; color: #333;
@ -399,7 +387,7 @@ const handleSmsNotify = async () => {
font-size: 12px; font-size: 12px;
line-height: 1; line-height: 1;
border: 2px solid white; border: 2px solid white;
box-shadow: 0 2px 4px rgba(0,0,0,0.1); box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
} }
.remove-button:hover { .remove-button:hover {
@ -429,7 +417,6 @@ const handleSmsNotify = async () => {
display: inline-block; display: inline-block;
} }
/* 底部按钮 */ /* 底部按钮 */
.modal-footer { .modal-footer {
display: flex; display: flex;
@ -437,12 +424,10 @@ const handleSmsNotify = async () => {
gap: 12px; gap: 12px;
} }
/* 响应式调整 */ /* 响应式调整 */
@media (max-width: 768px) { @media (max-width: 768px) {
.certificate-modal { .certificate-modal {
width: 95vw !important; width: 95vw !important;
} }
} }
</style> </style>

Binary file not shown.

View File

@ -897,7 +897,7 @@
</div> </div>
</div> </div>
<div style="display: flex; justify-content: center" ;> <div style="display: flex; justify-content: center">
<div class="retry" @click="gotoHome">返回首页</div> <div class="retry" @click="gotoHome">返回首页</div>
<div <div
class="retry" class="retry"