feat: 在证书审核弹窗中增加短信通知功能并调整发票发送状态字段
This commit is contained in:
parent
fd07c81d4b
commit
dc218e3d0e
@ -68,4 +68,5 @@ export default {
|
|||||||
request.post(`/valuations/${data.valuation_id || data.id}/reject`, { admin_notes: data.admin_notes }),
|
request.post(`/valuations/${data.valuation_id || data.id}/reject`, { admin_notes: data.admin_notes }),
|
||||||
updateValuationNotes: (data = {}) =>
|
updateValuationNotes: (data = {}) =>
|
||||||
request.put(`/valuations/${data.valuation_id || data.id}/admin-notes`, { admin_notes: data.admin_notes }),
|
request.put(`/valuations/${data.valuation_id || data.id}/admin-notes`, { admin_notes: data.admin_notes }),
|
||||||
|
sendSmsReport: (data = {}) => request.post('/sms/send-report', data),
|
||||||
}
|
}
|
||||||
|
|||||||
@ -296,6 +296,7 @@ async function handleInvoiceConfirm(formData) {
|
|||||||
subject: formData.email, // 用户要求 subject 传 email
|
subject: formData.email, // 用户要求 subject 传 email
|
||||||
body: formData.content, // 映射 content -> body
|
body: formData.content, // 映射 content -> body
|
||||||
file_url: formData.attachments, // 映射 attachments -> file_url
|
file_url: formData.attachments, // 映射 attachments -> file_url
|
||||||
|
status:'success'
|
||||||
}
|
}
|
||||||
|
|
||||||
let res = await api.sendInvoice(payload)
|
let res = await api.sendInvoice(payload)
|
||||||
|
|||||||
@ -15,6 +15,7 @@ import {
|
|||||||
|
|
||||||
import { getToken } from '@/utils/auth/token'
|
import { getToken } from '@/utils/auth/token'
|
||||||
import { generateReport } from '@/utils/report'
|
import { generateReport } from '@/utils/report'
|
||||||
|
import api from '@/api'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
visible: {
|
visible: {
|
||||||
@ -188,6 +189,25 @@ const handlePreview = (file) => {
|
|||||||
// 图片文件返回 true,让 NUpload 使用内置预览
|
// 图片文件返回 true,让 NUpload 使用内置预览
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 短信通知
|
||||||
|
const handleSmsNotify = async () => {
|
||||||
|
try {
|
||||||
|
const phone = props.certificateData?.detailData?.user_phone
|
||||||
|
if (!phone) {
|
||||||
|
message.error('缺少手机号,无法发送短信')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
message.loading('正在发送短信...')
|
||||||
|
await api.sendSmsReport({
|
||||||
|
phone: phone
|
||||||
|
})
|
||||||
|
message.success('短信发送成功')
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error)
|
||||||
|
message.error('短信发送失败')
|
||||||
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@ -255,7 +275,10 @@ const handlePreview = (file) => {
|
|||||||
<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 v-else type="primary" @click="handleConfirm">
|
||||||
确定
|
确定
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user