|
|
@@ -97,6 +97,7 @@
|
|
|
<PagingTable url="/task/item" :where="{ taskId: (selectedRow || {}).id }" ref="phoneTable" height="50vh">
|
|
|
<ElTableColumn prop="id" label="#" width="80" />
|
|
|
<ElTableColumn prop="number" label="号码" min-width="120" />
|
|
|
+ <ElTableColumn prop="sendAt" label="发送时间" :formatter="timeFormatter" align="center" />
|
|
|
<ElTableColumn prop="status" label="状态" align="center">
|
|
|
<template #default="{ row }">
|
|
|
<ElTag v-if="row.status === 'success'" type="success">成功</ElTag>
|
|
|
@@ -248,17 +249,15 @@ async function pause(row) {
|
|
|
|
|
|
async function receipt(row) {
|
|
|
try {
|
|
|
- const response = await http.post(`/task/item/${row.id}/receipt`, {
|
|
|
- responseType: 'blob', // 重要:指定响应类型为blob,以便处理二进制文件
|
|
|
- });
|
|
|
- // 处理成功响应,触发文件下载
|
|
|
- const url = window.URL.createObjectURL(new Blob([response.data]));
|
|
|
- const link = document.createElement('a');
|
|
|
- link.href = url;
|
|
|
- link.setAttribute('download', `${row.name}_回执.xlsx`);
|
|
|
- document.body.appendChild(link);
|
|
|
- link.click();
|
|
|
- document.body.removeChild(link);
|
|
|
+ const response = await http.post(`/task/item/${row.id}/receipt`)
|
|
|
+ const uint8Array = new Uint8Array(response.data)
|
|
|
+ const blob = new Blob([uint8Array], { type: 'application/octet-stream' })
|
|
|
+ const link = document.createElement('a')
|
|
|
+ const blobUrl = URL.createObjectURL(blob)
|
|
|
+ link.href = blobUrl
|
|
|
+ link.download = `${row.name}_回执.xlsx`
|
|
|
+ link.click()
|
|
|
+ window.URL.revokeObjectURL(blobUrl)
|
|
|
} catch (error) {
|
|
|
console.error('Error receipt:', error)
|
|
|
ElMessage.error('获取回执错误,请稍后再试.')
|