feat: 最新代码提交

This commit is contained in:
小屁孩 committed 2026-02-09 18:59:34 +08:00
1 parent ab983e5dd6
commit 07fbbdd2a5
1 file changed
+10 -1
@@ -31,7 +31,7 @@
<!-- 上传区域 -->
<div class="upload-section">
<p class="section-label">{{ t('invoices.dialog.uploadLabel') }}</p>
<el-upload class="invoice-uploader" drag action="#" :auto-upload="false" v-model:file-list="form.fileList">
<el-upload class="invoice-uploader" drag action="#" :auto-upload="false" v-model:file-list="form.fileList" accept=".pdf" :before-upload="beforeUpload">
<el-icon class="el-icon--upload"><upload-filled /></el-icon>
<div class="el-upload__text">
<span class="upload-link">{{ t('invoices.dialog.uploadDraggerText').split(' / ')[0] }}</span> / {{
@@ -101,6 +101,15 @@ const handleClose = () => {
// Reset form if needed
}
const beforeUpload = (file: File) => {
const isPDF = file.type === 'application/pdf' || file.name.endsWith('.pdf')
if (!isPDF) {
ElMessage.error('只能上传PDF格式的文件')
return false
}
return true
}
const handleSubmit = () => {
console.log('handleSubmit clicked, fileList:', form.fileList)
if (form.fileList.length === 0) {