diff --git a/src/api/financialCenter/enterpriseRecharge.js b/src/api/financialCenter/enterpriseRecharge.js index 1f219ec..42756ae 100644 --- a/src/api/financialCenter/enterpriseRecharge.js +++ b/src/api/financialCenter/enterpriseRecharge.js @@ -21,7 +21,7 @@ const save = (params) => { }; // 修改 const update = (params) => { - return request.postJson( + return request.postPut( "/oil-finance/oilCompanyAccountReverse/update", params ); diff --git a/src/utils/axios.js b/src/utils/axios.js index b35ad86..62cc0ff 100644 --- a/src/utils/axios.js +++ b/src/utils/axios.js @@ -24,6 +24,13 @@ export default { data: data, }); }, + postPut(url, data) { + return axios({ + url: url, + method: "put", + data: data, + }); + }, postFromData(url, data) { return axios({ url: url, diff --git a/src/views/financialCenter/enterpriseRecharge/components/add.vue b/src/views/financialCenter/enterpriseRecharge/components/add.vue index a002122..e591135 100644 --- a/src/views/financialCenter/enterpriseRecharge/components/add.vue +++ b/src/views/financialCenter/enterpriseRecharge/components/add.vue @@ -105,10 +105,17 @@ > @@ -281,6 +288,17 @@ export default { this.handleRemove(); } }, + beforeHandle(file) { + if (file.type.indexOf("image/") === -1) { + this.$message.error("上传的文件不是图片格式!"); + return false; + } else if (file.size / 1024 / 1024 > 5) { + this.$message.error("上传图片大小不能超过 5MB!"); + return false; + } + return true; + }, + //img大图 handlePictureCardPreview(file) { this.form.offlineTransactionProof = file.url; @@ -292,9 +310,13 @@ export default { }, // 上传成功 handleSuccess(response, file, fileList) { - if (response.code === 20000) { - this.form.offlineTransactionProof = response.data.publicUrl; + if (response.code !== 20000) { + this.$message.error(response.msg); + this.fileList = []; + return; } + console.log("response", response); + this.form.offlineTransactionProof = response.data.publicUrl; }, //企业收款账户 getCascaderList() {