spring
2025-05-21 ee2882cff02d3545b66c7591f88ed4800f730a9a
src/components/do/a8-file-handling/FileObsoletionRequest.vue
@@ -374,9 +374,11 @@
    changeFileList(e){
      if(e){
        let obj = this.fileList.find(a=>a.documentCode == e)
        this.addInfo.name = obj.name
        this.addInfo.version = obj.version
        this.addInfo.documentState = obj.state
        if(obj){
          this.addInfo.name = obj.name
          this.addInfo.version = obj.version
          this.addInfo.documentState = obj.state
        }
      }
    },
    handleUpdate(row){
@@ -434,13 +436,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();
        //将Blob 对象转换成字符串
        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('导出成功')
          }
        }
      })
    }
  }