fix: 统一日期时间显示为秒级格式并修正文件上传响应解析逻辑

This commit is contained in:
Wei_佳 2025-11-27 22:38:11 +08:00
parent 7ded549269
commit 1c493965d0
7 changed files with 35 additions and 23 deletions

View File

@ -76,10 +76,10 @@ const columns = [
{ {
title: '提交时间', title: '提交时间',
key: 'submitted_at', key: 'submitted_at',
width: 140, width: 180,
align: 'center', align: 'center',
render(row) { render(row) {
return formatDate(row.submitted_at) return formatDate(row.submitted_at, 'YYYY-MM-DD HH:mm:ss')
}, },
}, },
{ {

View File

@ -72,7 +72,7 @@ const renderTicketType = (type) => {
const columns = [ const columns = [
{ title: 'ID', key: 'id', width: 60, align: 'center', render(row) { return row?.receipt?.id || '' } }, { title: 'ID', key: 'id', width: 60, align: 'center', render(row) { return row?.receipt?.id || '' } },
{ title: '凭证时间', key: 'submitted_at', width: 120, align: 'center', render(row) { return formatDate(row.submitted_at) } }, { title: '凭证时间', key: 'submitted_at', width: 180, align: 'center', render(row) { return formatDate(row.submitted_at, 'YYYY-MM-DD HH:mm:ss') } },
{ title: '公司名称', key: 'company_name', width: 160, align: 'center', ellipsis: { tooltip: true } }, { title: '公司名称', key: 'company_name', width: 160, align: 'center', ellipsis: { tooltip: true } },
{ title: '公司税号', key: 'tax_number', width: 160, align: 'center', ellipsis: { tooltip: true } }, { title: '公司税号', key: 'tax_number', width: 160, align: 'center', ellipsis: { tooltip: true } },
{ title: '手机号', key: 'phone', width: 120, align: 'center' }, { title: '手机号', key: 'phone', width: 120, align: 'center' },

View File

@ -104,7 +104,7 @@ const columns = [
width: 180, width: 180,
ellipsis: { tooltip: true }, ellipsis: { tooltip: true },
render(row) { render(row) {
return row.created_at ? formatDate(row.created_at) : '-' return row.created_at ? formatDate(row.created_at, 'YYYY-MM-DD HH:mm:ss') : '-'
}, },
}, },
// { // {
@ -175,7 +175,7 @@ async function handleViewDetail(row) {
id: row.id, id: row.id,
phone: row.phone, phone: row.phone,
wechat: row.wechat, wechat: row.wechat,
register_time: row.created_at ? formatDate(row.created_at) : '-', register_time: row.created_at ? formatDate(row.created_at, 'YYYY-MM-DD HH:mm:ss') : '-',
notes: row.notes, notes: row.notes,
remaining_count: row.remaining_count, remaining_count: row.remaining_count,
user_type: row.user_type || '-', user_type: row.user_type || '-',

View File

@ -342,8 +342,8 @@ const handleCertificateConfirm = async (data) => {
<p class="detail-meta"> <p class="detail-meta">
<span>手机号{{ detailData?.phone || '-' }}</span> <span>手机号{{ detailData?.phone || '-' }}</span>
<span>微信号{{ detailData?.wechat || '-' }}</span> <span>微信号{{ detailData?.wechat || '-' }}</span>
<span>提交时间{{ formatDate(detailData?.created_at) }}</span> <span>提交时间{{ formatDate(detailData?.created_at, 'YYYY-MM-DD HH:mm:ss') }}</span>
<span>审核时间{{ detailData?.reviewed_at ? formatDate(detailData?.reviewed_at) : '-' }}</span> <span>审核时间{{ detailData?.reviewed_at ? formatDate(detailData?.reviewed_at, 'YYYY-MM-DD HH:mm:ss') : '-' }}</span>
</p> --> </p> -->
</div> </div>
</div> </div>

View File

@ -109,19 +109,19 @@ const columns = [
{ {
title: '提交时间', title: '提交时间',
key: 'created_at', key: 'created_at',
width: 160, width: 180,
align: 'center', align: 'center',
render(row) { render(row) {
return formatDate(row.created_at) return formatDate(row.created_at, 'YYYY-MM-DD HH:mm:ss')
}, },
}, },
{ {
title: '审核时间', title: '审核时间',
key: 'updated_at', key: 'updated_at',
width: 160, width: 180,
align: 'center', align: 'center',
render(row) { render(row) {
return row.updated_at ? formatDate(row.updated_at) : '-' return row.updated_at ? formatDate(row.updated_at, 'YYYY-MM-DD HH:mm:ss') : '-'
}, },
}, },
{ {

View File

@ -1389,17 +1389,17 @@ const heritageOptions = [
] ]
const handleFinish1 = (file) => { const handleFinish1 = (file) => {
let url = JSON.parse(file.event.target.response) let response = JSON.parse(file.event.target.response)
modalForm.patent_certificates.push({ url: url.url, id: file.file.batchId }) modalForm.patent_certificates.push({ url: response.data.url, id: file.file.batchId })
} }
const handleFinish2 = (file) => { const handleFinish2 = (file) => {
let url = JSON.parse(file.event.target.response) let response = JSON.parse(file.event.target.response)
modalForm.pattern_images.push({ url: url.url, id: file.file.batchId }) modalForm.pattern_images.push({ url: response.data.url, id: file.file.batchId })
} }
const handleFinish3 = (file) => { const handleFinish3 = (file) => {
console.log(file) console.log(file)
let url = JSON.parse(file.event.target.response) let response = JSON.parse(file.event.target.response)
modalForm.inheritor_certificates.push({ url: url.url, id: file.file.batchId }) modalForm.inheritor_certificates.push({ url: response.data.url, id: file.file.batchId })
} }
const delete1 = (file) => { const delete1 = (file) => {
const index = modalForm.patent_certificates.findIndex((item) => item.id === file.file.batchId) const index = modalForm.patent_certificates.findIndex((item) => item.id === file.file.batchId)

View File

@ -297,17 +297,29 @@ const message = useMessage()
// //
const isFormValid = computed(() => { const isFormValid = computed(() => {
console.log('isFormValid check:', {
uploadedFile: uploadedFile.value,
invoiceHeader: formModel.invoiceHeader,
invoiceType: formModel.invoiceType
})
return ( return (
uploadedFile.value && !!uploadedFile.value &&
uploadedFile.value.length > 0 && !!formModel.invoiceHeader &&
formModel.invoiceHeader && !!formModel.invoiceType
formModel.invoiceType
) )
}) })
const handleUploadFinish = (file) => { const handleUploadFinish = (file) => {
let url = JSON.parse(file.event.target.response) console.log('handleUploadFinish called:', file)
uploadedFile.value = url.url console.log('response:', file.event?.target?.response)
try {
let response = JSON.parse(file.event.target.response)
console.log('parsed response:', response)
uploadedFile.value = response.data.url
console.log('uploadedFile.value set to:', uploadedFile.value)
} catch (error) {
console.error('Error parsing upload response:', error)
}
} }
const deleteUpload = () => { const deleteUpload = () => {
uploadedFile.value = '' uploadedFile.value = ''