wxc 2 years ago
parent
commit
ede34d366a
  1. 5
      src/views/work/Query.vue
  2. 8
      src/views/work/components/MailCheck.vue

5
src/views/work/Query.vue

@ -242,7 +242,10 @@ const refreshCheckAll = () => {
const outputSelectedMail = () => {
console.log("outputSelectedMail", solveCheckBox.value);
axios.post('/lan-api/api/work/export', solveCheckBox.value, {
const data = solveCheckBox.value.map((item: any) => item.id)
console.log("data", data)
axios.post('/lan-api/api/work/export', data, {
headers: {
'Content-Type': 'application/json',
'Accept': 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',

8
src/views/work/components/MailCheck.vue

@ -140,18 +140,20 @@ const result = ref(true)
const ifShow = ref(false)
const upload = ref<UploadInstance>()
const fileList = ref([])
const importData = ref([])
const handleUpload: UploadProps['httpRequest'] = (file) => {
const formData = new FormData(); //
formData.append("file", file.file); //
return axios.post("/lan-api/api/work/check", formData) // 使 axios post
.then((res) => {
//
console.log('checkMsg', res.data);
//
if (res.data.data[0]) {
console.log('checkMsg', res.data.data);
result.value = false
ifShow.value = true
form.value = res.data.data
importData.value = res.data.data
} else {
ifShow.value = true
result.value = true
@ -169,7 +171,7 @@ const handleCheck = () => {
console.log(query.value)
}
const handleImport = () => {
request.post({ url: '/work/import', body: form.value }).then((data: any) => {
request.post({ url: '/work/import', body: importData.value }).then((data: any) => {
ElMessage.success('下载成功')
resetView()
}).catch((error: any) => {

Loading…
Cancel
Save