From 8df1a6660369da5b4f0511f04930b60f7e6f31cd Mon Sep 17 00:00:00 2001 From: yuyanglin Date: Tue, 26 May 2020 11:08:29 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=AE=A2=E6=88=B7=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E4=B8=8A=E4=BC=A0logo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/c-manage/customer-manage.scss | 25 +++++++++++++++- .../customer-manage/customer-manage.vue | 29 +++++++++++++++++++ 2 files changed, 53 insertions(+), 1 deletion(-) diff --git a/epmet-oper-web/src/assets/scss/modules/c-manage/customer-manage.scss b/epmet-oper-web/src/assets/scss/modules/c-manage/customer-manage.scss index aa83828..76a8b08 100644 --- a/epmet-oper-web/src/assets/scss/modules/c-manage/customer-manage.scss +++ b/epmet-oper-web/src/assets/scss/modules/c-manage/customer-manage.scss @@ -38,4 +38,27 @@ width: 200px; }; } -} \ No newline at end of file +} +.avatar-uploader .el-upload { + border: 1px dashed #d9d9d9; + border-radius: 6px; + cursor: pointer; + position: relative; + overflow: hidden; + } + .avatar-uploader .el-upload:hover { + border-color: #409EFF; + } + .avatar-uploader-icon { + font-size: 28px; + color: #8c939d; + width: 178px; + height: 178px; + line-height: 178px; + text-align: center; + } + .avatar { + width: 178px; + height: 178px; + display: block; + } \ No newline at end of file diff --git a/epmet-oper-web/src/views/modules/customer-manage/customer-manage.vue b/epmet-oper-web/src/views/modules/customer-manage/customer-manage.vue index 5d3976e..08a65d4 100644 --- a/epmet-oper-web/src/views/modules/customer-manage/customer-manage.vue +++ b/epmet-oper-web/src/views/modules/customer-manage/customer-manage.vue @@ -36,6 +36,17 @@ + + + + + + 下一步 @@ -108,6 +119,7 @@ export default { getDataListURL: '/oper/crm/customer/getvalidcustomerlist', getDataListIsPage: false }, + uploadUlr: window.SITE_CONFIG['apiURL'] + '/oss/file/customerlogo/upload', pcd: 'district', pcdError: true, centerDialogVisible: false, @@ -124,6 +136,7 @@ export default { customerId: '', agencyId: '', dataForm2: { + logo: '', customerName: '', organizationLevel: '' }, @@ -296,6 +309,22 @@ export default { if (this.pcd === 'district') { this.pcdError = false } + }, + handleAvatarSuccess (res, file) { + if (res.code === 0 && res.msg === 'success') this.dataForm2.logo = res.data.url + else this.$message.error(res.msg) + }, + beforeAvatarUpload (file) { + const isJPG = file.type === 'image/jpeg' + const isLt2M = file.size / 1024 / 1024 < 2 + + if (!isJPG) { + this.$message.error('上传头像图片只能是 JPG 格式!') + } + if (!isLt2M) { + this.$message.error('上传头像图片大小不能超过 2MB!') + } + return isJPG && isLt2M } }, computed: {