From 19dbeffb652612ee04d783e93c917b4fc5c6a189 Mon Sep 17 00:00:00 2001 From: nsgkyjk <759200926@qq.com> Date: Tue, 22 Mar 2022 13:55:47 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=85=E5=9F=BA=E5=9C=B0=E8=B0=83=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/homesteadSurvey/add.vue | 41 +++++++++++-- .../paymentAccount/paymentAccountDetail.vue | 59 ++++++++++++++++--- 2 files changed, 88 insertions(+), 12 deletions(-) diff --git a/src/views/homesteadSurvey/add.vue b/src/views/homesteadSurvey/add.vue index 820da87c..f3d05388 100644 --- a/src/views/homesteadSurvey/add.vue +++ b/src/views/homesteadSurvey/add.vue @@ -295,7 +295,7 @@ - - + -->
保存
@@ -3806,8 +3806,8 @@ d.push(blobBin.charCodeAt(i)) } const data2 = new FormData(); - console.log(d) data2.append("file", new Blob([new Uint8Array(d)],{type:'image/jpeg'})); + this.saveBlobAsFile(new Blob([new Uint8Array(d)],{type:'image/jpeg'}),this.form.zjddm) uploadFile(data2).then(res => { if(this.form.zjdxctp!=null&&this.form.zjdxctp!=""){ this.form.zjdxctp = this.form.zjdxctp + "," + res.fileName @@ -3817,6 +3817,39 @@ }) } }, + blobToBase64(blob) { + return new Promise((resolve, reject) => { + const fileReader = new FileReader(); + fileReader.onload = (e) => { + resolve(e.target.result); + }; + // readAsDataURL + fileReader.readAsDataURL(blob); + fileReader.onerror = () => { + reject(new Error('blobToBase64 error')); + }; + }); + }, + saveBlobAsFile(blob, fileName) { + /* var reader = new FileReader(blob); + reader.onloadend = function () { + var base64 = reader.result ; + var link = document.createElement("a"); + link.setAttribute("href", base64); + link.setAttribute("download", fileName); + link.click(); + /!**!/ + }; + reader.readAsDataURL(blob);*/ + + let link = document.createElement("a"); + link.href = window.URL.createObjectURL(blob); + link.download = fileName; + link.click(); + window.URL.revokeObjectURL(link.href) + link.remove() + }, + // 图片删除 deleteFilezjd(file){ let url = ","+file.baseUrl diff --git a/src/views/onlineHome/bankAgriculture/paymentAccount/paymentAccountDetail.vue b/src/views/onlineHome/bankAgriculture/paymentAccount/paymentAccountDetail.vue index 716d40f1..401dec90 100644 --- a/src/views/onlineHome/bankAgriculture/paymentAccount/paymentAccountDetail.vue +++ b/src/views/onlineHome/bankAgriculture/paymentAccount/paymentAccountDetail.vue @@ -13,21 +13,53 @@

基础信息

+ + + + + + + + + + + + - - - - - - - + + + + + + - + + + + + + +
+

账簿信息

+
+ + + + + + +
@@ -47,6 +79,17 @@ jgList:{}, accountType:'', + bankType:'', + villageAccountType:'', + taccountId:'', + accountNo:'', + managementControlType:'', + centralBookId:'', + centralSubjectId:'', + bankAccountType:'', + alternateField1:'', + alternateField2:'', + alternateField3:'', subjectValue:'', wfydlx:'',