xiejun
2023-12-07 05d45bd440ffc92e14e6c8728ac8956a0488c0ab
Source/UBCS-WEB/src/components/MasterCrud/VciMasterCrud.vue
@@ -578,19 +578,28 @@
      exportGroupCodeExcel({
        codeClassifyOid: this.codeClassifyOid,
      }).then(res => {
        console.log(res)
        if (res) {
          func.downloadFileByBlobHandler(res);
          this.$message.success('下载成功,请查看!');
          this.isLoading = false;
        }
      }).catch(error => {
        console.log(error)
        if (error) {
          this.$message.error('请查看下载的错误文件!');
        }
        // let reader = new FileReader();
        // reader.readAsText(res.data);
        // reader.onload = () => {
        //   try {
        //     let resData = JSON.parse(reader.result);  // 解析对象成功
        //     if (!resData.success) {
        //       this.$message.error(resData.msg);
        //       this.isLoading = false;
        //     }
        //   } catch (err) {
        //     // 解析成对象失败,说明是正常的文件流
        //     func.downloadFileByBlobHandler(res);
        //     this.$message.success('下载成功,请查看!');
        //     this.isLoading = false;
        //   }
        // };
        func.downloadFileByBlobHandler(res);
        this.$message.success('下载成功,请查看!');
        this.isLoading = false;
      })
      }).catch(error=>{
        this.$message.error(error);
      });
    },
    //标准申请
    codeApplyHandler() {