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 = {