fix: bug修改

This commit is contained in:
小屁孩 committed 2026-02-25 21:58:26 +08:00
1 parent 4de1f4d2e7
commit d56dfc2bad
2 files changed
+21 -7

No files matched your search

@@ -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" accept=".pdf" :before-upload="beforeUpload">
<el-upload class="invoice-uploader" drag action="#" :auto-upload="false" v-model:file-list="form.fileList" accept=".pdf" :before-upload="beforeUpload" :on-change="handleFileChange">
<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> / {{
@@ -110,6 +110,21 @@ const beforeUpload = (file: File) => {
return true
}
const handleFileChange = (uploadFile: any, uploadFiles: any[]) => {
const file = uploadFile.raw
if (!file) return
const isPDF = file.type === 'application/pdf' || file.name.endsWith('.pdf')
if (!isPDF) {
ElMessage.error('只能上传PDF格式的文件')
// Remove the invalid file from the list
const index = uploadFiles.findIndex(f => f.uid === uploadFile.uid)
if (index > -1) {
uploadFiles.splice(index, 1)
}
}
}
const handleSubmit = () => {
console.log('handleSubmit clicked, fileList:', form.fileList)
if (form.fileList.length === 0) {
+5 -6
View File
@@ -31,7 +31,7 @@
<div class="form_box">
<el-form-item :label="t('invoices.filter.searchLabel')">
<el-input
v-model="filterForm.keyword"
v-model="filterForm.search"
:placeholder="t('invoices.filter.searchPlaceholder')"
/>
</el-form-item>
@@ -228,7 +228,7 @@ const stats = ref([
])
const filterForm = reactive({
keyword: '',
search: '',
status: '',
dateRange: [] as any[]
})
@@ -271,12 +271,11 @@ const fetchData = async () => {
const params: any = {
page: currentPage.value,
page_size: pageSize.value,
keyword: filterForm.keyword,
search: filterForm.search,
status: filterForm.status
}
if (filterForm.dateRange && filterForm.dateRange.length === 2) {
params.start_date = filterForm.dateRange[0]
params.end_date = filterForm.dateRange[1]
params.apply_date = new Date(filterForm.dateRange[0]).toISOString() + ',' + new Date(filterForm.dateRange[1]).toISOString()
}
const res = await getInvoices(params)
if (res.code === '000000') {
@@ -337,7 +336,7 @@ const handleFilter = () => {
}
const resetFilter = () => {
filterForm.keyword = ''
filterForm.search = ''
filterForm.status = ''
filterForm.dateRange = []
currentPage.value = 1