Commit 0fee6a3f by Sweet Zhang

修复删除后收件人抄送人没更新的问题

parent a58b35d4
...@@ -513,10 +513,10 @@ const deleteImportRecord = (importBizId: string) => { ...@@ -513,10 +513,10 @@ const deleteImportRecord = (importBizId: string) => {
type: 'success', type: 'success',
}) })
// 删除成功之后,刷新导入记录列表 // 删除成功之后,刷新导入记录列表
getImportedContacts(emailForm.value.sessionId || '') getImportedContacts(emailForm.value.sessionId || '', 'update')
} else { } else {
ElMessage({ ElMessage({
message: '导入记录删除失败', message: res.msg || '导入记录删除失败',
type: 'error', type: 'error',
}) })
} }
...@@ -529,17 +529,7 @@ const handleImportContacts = (results) => { ...@@ -529,17 +529,7 @@ const handleImportContacts = (results) => {
if (results.data) { if (results.data) {
showImportContacts.value = false showImportContacts.value = false
emailForm.value.sessionId = results.data.data.sessionId || '' emailForm.value.sessionId = results.data.data.sessionId || ''
importContactApi.getEmailContactImportDetail(emailForm.value.sessionId || '').then((res) => { getImportedContacts(emailForm.value.sessionId || '', 'update')
if (res.code === 200) {
emailForm.value.receiveEmail = res.data?.receiveEmails || ''
emailForm.value.ccEmails = res.data?.ccEmails || ''
} else {
ElMessage({
message: res.data.msg || '导入数据失败',
type: 'error',
})
}
})
} }
} }
...@@ -569,7 +559,7 @@ const sendEmail = () => { ...@@ -569,7 +559,7 @@ const sendEmail = () => {
} }
} else { } else {
ElMessage({ ElMessage({
message: '邮件发送失败,请重新提交', message: res.msg || '邮件发送失败,请重新提交',
type: 'error', type: 'error',
}) })
} }
...@@ -595,11 +585,17 @@ const getImportedContacts = (sessionId?: string, type?: string) => { ...@@ -595,11 +585,17 @@ const getImportedContacts = (sessionId?: string, type?: string) => {
importRecords.value = res.data.records || [] importRecords.value = res.data.records || []
// 从导入记录中提取收件人和抄送人 // 从导入记录中提取收件人和抄送人
if (type == 'update') { if (type == 'update') {
emailForm.value.receiveEmail = importRecords.value console.log(importRecords.value)
.map((item) => item.receiveEmail) emailForm.value.receiveEmail =
.join(',') importRecords.value.length > 0
emailForm.value.ccEmails = importRecords.value.map((item) => item.ccEmail).join(',') ? importRecords.value.map((item) => item.receiveEmail || '').join(',')
: ''
emailForm.value.ccEmails =
importRecords.value.length > 0
? importRecords.value.map((item) => item.ccEmail || '').join(',')
: ''
} }
console.log(emailForm.value)
} }
}) })
} }
...@@ -611,7 +607,6 @@ const getImportedContacts = (sessionId?: string, type?: string) => { ...@@ -611,7 +607,6 @@ const getImportedContacts = (sessionId?: string, type?: string) => {
import { ElMessage } from 'element-plus' import { ElMessage } from 'element-plus'
import FileUploadComponent from '@/components/FileUploadComponent.vue' import FileUploadComponent from '@/components/FileUploadComponent.vue'
import { UploadResult } from '@/utils/fileUpload' import { UploadResult } from '@/utils/fileUpload'
import { debug } from 'console'
// 上传成功的文件 // 上传成功的文件
const uploadedFiles = ref<any[]>([]) const uploadedFiles = ref<any[]>([])
......
...@@ -141,7 +141,7 @@ ...@@ -141,7 +141,7 @@
编辑 编辑
</button> </button>
<button <button
@click="deleteRecord(record.id)" @click="deleteRecord(record.importBizId)"
class="px-3 py-1 bg-red-100 text-red-700 rounded-md hover:bg-red-200 transition-colors text-sm" class="px-3 py-1 bg-red-100 text-red-700 rounded-md hover:bg-red-200 transition-colors text-sm"
> >
删除 删除
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment