fix: 上传短信并通知按钮逻辑修改
This commit is contained in:
parent
4110dca428
commit
45aae516b2
@ -405,11 +405,10 @@ const handleCertificateConfirm = async (data) => {
|
||||
report_url: reportUrl?.[0],
|
||||
status: 'success',
|
||||
}
|
||||
console.log('🔥🔥🔥🔥🔥🔥🔥 ~ handleCertificateConfirm ~ payload:', payload)
|
||||
|
||||
await api.updateValuation(payload)
|
||||
|
||||
$message.success('上传并通知成功')
|
||||
$message.success('上传成功')
|
||||
certificateModalVisible.value = false
|
||||
emit('back') // 或者 emit('refresh') 取决于需求,这里假设返回列表或刷新
|
||||
} catch (error) {
|
||||
|
||||
@ -1,15 +1,6 @@
|
||||
<script setup>
|
||||
import { ref, watch, computed } from 'vue'
|
||||
import {
|
||||
NModal,
|
||||
NCard,
|
||||
NButton,
|
||||
NUpload,
|
||||
NText,
|
||||
NImage,
|
||||
NImageGroup,
|
||||
useMessage
|
||||
} from 'naive-ui'
|
||||
import { NModal, NCard, NButton, NUpload, NText, NImage, NImageGroup, useMessage } from 'naive-ui'
|
||||
// 临时移除图标导入以解决模块解析问题
|
||||
// import { DownloadIcon } from '@vicons/tabler'
|
||||
|
||||
@ -51,8 +42,14 @@ watch(
|
||||
if (val) {
|
||||
if (props.mode === 'view') {
|
||||
// 查看模式,加载已有数据
|
||||
reportFileList.value = (props.certificateData?.reportFiles || []).map(f => ({ ...f, status: 'finished' }))
|
||||
certificateFileList.value = (props.certificateData?.certificateFiles || []).map(f => ({ ...f, status: 'finished' }))
|
||||
reportFileList.value = (props.certificateData?.reportFiles || []).map((f) => ({
|
||||
...f,
|
||||
status: 'finished',
|
||||
}))
|
||||
certificateFileList.value = (props.certificateData?.certificateFiles || []).map((f) => ({
|
||||
...f,
|
||||
status: 'finished',
|
||||
}))
|
||||
} else {
|
||||
// 上传模式,清空数据
|
||||
reportFileList.value = []
|
||||
@ -70,16 +67,19 @@ const handleClose = () => {
|
||||
// 确认操作
|
||||
// 确认操作
|
||||
const handleConfirm = () => {
|
||||
const getFiles = (list) => list.map(f => ({
|
||||
id: f.id,
|
||||
name: f.name,
|
||||
url: f.url,
|
||||
type: f.type
|
||||
})).filter(f => f.url)
|
||||
const getFiles = (list) =>
|
||||
list
|
||||
.map((f) => ({
|
||||
id: f.id,
|
||||
name: f.name,
|
||||
url: f.url,
|
||||
type: f.type,
|
||||
}))
|
||||
.filter((f) => f.url)
|
||||
|
||||
emit('confirm', {
|
||||
reportFiles: getFiles(reportFileList.value),
|
||||
certificateFiles: getFiles(certificateFileList.value)
|
||||
certificateFiles: getFiles(certificateFileList.value),
|
||||
})
|
||||
handleClose()
|
||||
}
|
||||
@ -154,15 +154,12 @@ const handleCertificateUploadFinish = ({ file, event }) => {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
const modalTitle = computed(() => {
|
||||
return props.mode === 'upload' ? '上传' : '查看'
|
||||
})
|
||||
|
||||
const isUploadMode = computed(() => props.mode === 'upload')
|
||||
|
||||
|
||||
// 下载报告
|
||||
const handleDownloadReport = async () => {
|
||||
try {
|
||||
@ -200,13 +197,14 @@ const handleSmsNotify = async () => {
|
||||
}
|
||||
message.loading('正在发送短信...')
|
||||
await api.sendSmsReport({
|
||||
phone: phone
|
||||
phone: phone,
|
||||
})
|
||||
message.success('短信发送成功')
|
||||
handleConfirm()
|
||||
handleClose()
|
||||
emit('confirm', {
|
||||
reportFiles: [],
|
||||
certificateFiles: []
|
||||
certificateFiles: [],
|
||||
})
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
@ -231,9 +229,7 @@ const handleSmsNotify = async () => {
|
||||
<div class="upload-section">
|
||||
<div class="section-header">
|
||||
<div class="section-title">报告:</div>
|
||||
<NButton text type="primary" @click="handleDownloadReport">
|
||||
点击下载原版报告
|
||||
</NButton>
|
||||
<NButton text type="primary" @click="handleDownloadReport"> 点击下载原版报告 </NButton>
|
||||
</div>
|
||||
<div class="upload-content">
|
||||
<NUpload
|
||||
@ -275,19 +271,12 @@ const handleSmsNotify = async () => {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<template #footer>
|
||||
<div class="modal-footer">
|
||||
<NButton @click="handleClose">取消</NButton>
|
||||
<NButton v-if="isUploadMode" type="primary" @click="handleConfirm">
|
||||
上传
|
||||
</NButton>
|
||||
<NButton v-if="isUploadMode" type="primary" @click="handleSmsNotify">
|
||||
短信通知
|
||||
</NButton>
|
||||
<NButton v-else type="primary" @click="handleConfirm">
|
||||
确定
|
||||
</NButton>
|
||||
<NButton v-if="isUploadMode" type="primary" @click="handleConfirm"> 上传 </NButton>
|
||||
<NButton v-if="isUploadMode" type="primary" @click="handleSmsNotify"> 短信通知 </NButton>
|
||||
<NButton v-else type="primary" @click="handleConfirm"> 确定 </NButton>
|
||||
</div>
|
||||
</template>
|
||||
</NModal>
|
||||
@ -353,7 +342,6 @@ const handleSmsNotify = async () => {
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
|
||||
.file-name {
|
||||
font-size: 14px;
|
||||
color: #333;
|
||||
@ -399,7 +387,7 @@ const handleSmsNotify = async () => {
|
||||
font-size: 12px;
|
||||
line-height: 1;
|
||||
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 {
|
||||
@ -429,7 +417,6 @@ const handleSmsNotify = async () => {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
|
||||
/* 底部按钮 */
|
||||
.modal-footer {
|
||||
display: flex;
|
||||
@ -437,12 +424,10 @@ const handleSmsNotify = async () => {
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
|
||||
/* 响应式调整 */
|
||||
@media (max-width: 768px) {
|
||||
.certificate-modal {
|
||||
width: 95vw !important;
|
||||
}
|
||||
|
||||
}
|
||||
</style>
|
||||
|
||||
BIN
web1/dist 2.zip
BIN
web1/dist 2.zip
Binary file not shown.
@ -897,7 +897,7 @@
|
||||
</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"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user