From 549a5291747d92baaae5415948252f4b4baff7a7 Mon Sep 17 00:00:00 2001 From: xiaozhiyong Date: Wed, 22 Feb 2023 17:50:42 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/generalDetails/index.vue | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/components/generalDetails/index.vue b/src/components/generalDetails/index.vue index 8d8a9d2..b26a077 100644 --- a/src/components/generalDetails/index.vue +++ b/src/components/generalDetails/index.vue @@ -123,14 +123,15 @@ export default { iconClass: mappingDataItem.iconClass || "iconjichuziliao", isFold: mappingDataItem.isFold || true, listData: mappingDataItem.carItems.map((carItem) => { + let value = + (typeof carItem.value == "function" && + carItem.value(shineData)) || + shineData[carItem.value] == 0 + ? 0 + : shineData[carItem.value] || carItem.fieldDefault || ""; return { label: carItem.label, - value: - (typeof carItem.value == "function" && - carItem.value(shineData)) || - shineData[carItem.value] || - carItem.fieldDefault || - "暂无数据", + value: value, field: carItem.value, remark: carItem.remark, isCopy: carItem.isCopy || false, From 77dde3628a98f25daa758728cefc15d89d8b1cd1 Mon Sep 17 00:00:00 2001 From: xiaozhiyong Date: Wed, 22 Feb 2023 18:09:39 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/financialCenter/enterpriseRecharge.js | 2 +- src/utils/axios.js | 7 +++++ .../enterpriseRecharge/components/add.vue | 26 +++++++++++++++++-- 3 files changed, 32 insertions(+), 3 deletions(-) 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() {