fix: 上传短信并通知按钮逻辑修改
This commit is contained in:
parent
4110dca428
commit
45aae516b2
@ -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) {
|
||||||
|
|||||||
@ -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>
|
||||||
|
|||||||
BIN
web1/dist 2.zip
BIN
web1/dist 2.zip
Binary file not shown.
@ -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"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user