zhangxiaoxu123
2022-12-31 d048c7eb44ccaa504b7b4f462d83dbaa25928d8f
发票下载
2个文件已修改
6 ■■■■■ 已修改文件
src/assets/js/ByUtils.js 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/page/invoice/invoiceForm.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/js/ByUtils.js
@@ -320,9 +320,10 @@
        // vm.$loading();
        vm.$axios({
            // headers: {
            //     'token': token
            //     'Content-Type': "application/json;charset=UTF-8"
            // },
            withCredentials: false,
            responseType: "blob",
            url: url,
            method: 'post',
            data: data
src/components/page/invoice/invoiceForm.vue
@@ -171,9 +171,10 @@
                    console.log(res,'res=========')
                    let blob = new Blob([res], {type: 'application/zip'});
                    let downloadElement = document.createElement("a");
                    downloadElement.style.display = "none";
                    let href = window.URL.createObjectURL(blob); //创建下载的链接
                    downloadElement.href = href;
                    downloadElement.download = '发票下载'
                    downloadElement.download = '发票下载.zip'
                    document.body.appendChild(downloadElement);
                    downloadElement.click(); //点击下载
                    document.body.removeChild(downloadElement); //下载完成移除元素