From a5fc697513e5c8da183e81fb06a70e2d38f8092d Mon Sep 17 00:00:00 2001 From: Jack <1638169491@qq.com> Date: Thu, 28 Jul 2022 19:07:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=BA=E5=91=98=E7=AE=A1=E7=90=86(=E5=8A=B3?= =?UTF-8?q?=E5=8A=A1=E4=BA=BA=E5=91=98)=EF=BC=9A=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E7=8E=B0=E5=9C=BA=E9=87=87=E9=9B=86=E4=BA=BA?= =?UTF-8?q?=E8=84=B8=E5=8E=8B=E7=BC=A9=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../personModule/laborComponent.vue | 81 ++++++++----------- 1 file changed, 32 insertions(+), 49 deletions(-) diff --git a/src/views/projectFront/laborManage/personModule/laborComponent.vue b/src/views/projectFront/laborManage/personModule/laborComponent.vue index e3cddd39..a0049f59 100644 --- a/src/views/projectFront/laborManage/personModule/laborComponent.vue +++ b/src/views/projectFront/laborManage/personModule/laborComponent.vue @@ -1534,7 +1534,9 @@ :show-file-list="false" :file-list="idCardUpPhotoFile" :disabled="titleType == 'detail'" - :http-request="handleUpload" + :http-request=" + (val) => handleUpload(val, 'idCardAvatar') + " > { const formData = new FormData() formData.append('files', result.file) + // 图片上传 apiUploadImage(formData).then((res) => { if (res.code == 200 || res.status == 'SUCCESS') { const imgInfo = res.data[0] - this.personForm.idCardBigPhotoUrl = imgInfo.imageUrl - this.idCardUpPhotoFile = [ - { name: imgInfo.filename, url: imgInfo.imageUrl } - ] + + switch (type) { + case 'idCardAvatar': // 身份证头像 + this.personForm.idCardBigPhotoUrl = imgInfo.imageUrl + this.idCardUpPhotoFile = [ + { name: imgInfo.filename, url: imgInfo.imageUrl } + ] + break + case 'livesFace': // 现场采集人脸 + let imgStatus = result.file.size / 1024 < 500 + if (!imgStatus) { + this.cropperOption.img = + this.$store.state.FILEURL + imgInfo.imageUrl + this.cropperDialog = true + } else { + if (this.isSzProject == 1) { + this.checkImgLibrary(imgInfo.imageUrl) + } else { + this.checkFace(imgInfo.imageUrl) + } + } + break + } } }) }) @@ -3344,18 +3352,8 @@ export default { this.$message.error(this.$t('message.companyDiagram.hint8')) return false } - } else { - // if(type==7){ - // const isLt2M = file.size / 1024 < 500; - // if (!isLt2M) { - // this.$message.error('现场采集照图片大小不能超过 500kb!'); - // } - // return isLt2M; - // }else{ - // return true; - // } - return true } + return true }, //删除 身份证头像 或 现场采集照片 @@ -3499,21 +3497,6 @@ export default { arrJoin.push(data) } this.personForm.employmentCard = arrJoin.join(',') - } else if (type == 6) { - this.personForm.idCardBigPhotoUrl = obj.url - this.idCardUpPhotoFile = [obj] - } else if (type == 7) { - let imgStatus = file2.size / 1024 < 500 - if (!imgStatus) { - this.cropperOption.img = this.$store.state.FILEURL + obj.url - this.cropperDialog = true - } else { - if (this.isSzProject == 1) { - this.checkImgLibrary(file.data[0].imageUrl) - } else { - this.checkFace(file.data[0].imageUrl) - } - } } else if (type == 8) { console.log(file) let data = {