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 = () => { const outputSelectedMail = () => {
console.log("outputSelectedMail", solveCheckBox.value); 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: { headers: {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
'Accept': 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', '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 ifShow = ref(false)
const upload = ref<UploadInstance>() const upload = ref<UploadInstance>()
const fileList = ref([]) const fileList = ref([])
const importData = ref([])
const handleUpload: UploadProps['httpRequest'] = (file) => { const handleUpload: UploadProps['httpRequest'] = (file) => {
const formData = new FormData(); // const formData = new FormData(); //
formData.append("file", file.file); // formData.append("file", file.file); //
return axios.post("/lan-api/api/work/check", formData) // 使 axios post return axios.post("/lan-api/api/work/check", formData) // 使 axios post
.then((res) => { .then((res) => {
// //
console.log('checkMsg', res.data);
if (res.data.data[0]) { if (res.data.data[0]) {
console.log('checkMsg', res.data.data);
result.value = false result.value = false
ifShow.value = true ifShow.value = true
form.value = res.data.data form.value = res.data.data
importData.value = res.data.data
} else { } else {
ifShow.value = true ifShow.value = true
result.value = true result.value = true
@ -169,7 +171,7 @@ const handleCheck = () => {
console.log(query.value) console.log(query.value)
} }
const handleImport = () => { 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('下载成功') ElMessage.success('下载成功')
resetView() resetView()
}).catch((error: any) => { }).catch((error: any) => {

Loading…
Cancel
Save