From 237f95b05e0f122ee9ec7beaf82ba366a8b220ed Mon Sep 17 00:00:00 2001 From: spring <2396852758@qq.com> Date: 星期六, 15 二月 2025 14:50:59 +0800 Subject: [PATCH] 修改设备模块bug --- src/components/do/a8-file-handling/DistributionCollectionRecord.vue | 63 ++++++++++++++++++++++++++----- 1 files changed, 52 insertions(+), 11 deletions(-) diff --git a/src/components/do/a8-file-handling/DistributionCollectionRecord.vue b/src/components/do/a8-file-handling/DistributionCollectionRecord.vue index a71f9ac..b7b9d78 100644 --- a/src/components/do/a8-file-handling/DistributionCollectionRecord.vue +++ b/src/components/do/a8-file-handling/DistributionCollectionRecord.vue @@ -429,13 +429,33 @@ 'Content-Type': 'application/json' },responseType: "blob"},).then(res => { this.outLoading = false - this.$message.success('瀵煎嚭鎴愬姛') const blob = new Blob([res],{ type: 'application/octet-stream' }); - const url = URL.createObjectURL(blob); - const link = document.createElement('a'); - link.href = url; - link.download = '鍙戞斁鍥炴敹璁板綍.xlsx'; - link.click(); + //灏咮lob 瀵硅薄杞崲鎴愬瓧绗︿覆 + let reader = new FileReader(); + reader.readAsText(blob, 'utf-8'); + reader.onload = () => { + try { + let result = JSON.parse(reader.result); + if (result.message) { + this.$message.error(result.message); + } else { + const url = URL.createObjectURL(blob); + const link = document.createElement('a'); + link.href = url; + link.download = '鍙戞斁鍥炴敹璁板綍.xlsx'; + link.click(); + this.$message.success('瀵煎嚭鎴愬姛') + } + } catch (err) { + console.log(err); + const url = URL.createObjectURL(blob); + const link = document.createElement('a'); + link.href = url; + link.download = '鍙戞斁鍥炴敹璁板綍.xlsx'; + link.click(); + this.$message.success('瀵煎嚭鎴愬姛') + } + } }) }, changeFileList(e){ @@ -496,11 +516,32 @@ }else{ let {documentCode,id,issueUser,recycleUser,receiveUser,name,version,documentState,issueCode,recycleCode,issueDate,recycleDate,issueNote,recycleNote} = this.addInfo // 娣诲姞鍥炴敹璁板綍 - this.$axios.post(this.$api.manageDocumentList.doManageDocumentIssueRecycle,{ - documentCode,id,issueUser,recycleUser,receiveUser,name,version,documentState,issueCode,recycleCode,issueDate,recycleDate,issueNote,recycleNote - },{headers: { - 'Content-Type': 'application/json' - },noQS:true}).then(res=>{ + let obj = { + documentCode, + id, + issueUser, + recycleUser, + receiveUser, + name, + version, + documentState, + issueCode, + recycleCode, + issueDate, + recycleDate, + issueNote, + recycleNote + } + let fd = new FormData(); + for(let key in obj){ + fd.append(key,obj[key]) + } + this.$axios.post(this.$api.manageDocumentList.doManageDocumentIssueRecycle,fd,{ + headers: { + 'Content-Type': 'multipart/form-data' + }, + noQs:true + }).then(res=>{ this.addLoading = false; if(res.code==200){ this.$message.success('鎻愪氦鎴愬姛') -- Gitblit v1.9.3