From fcf237fd050e0bda12606d6a7445a53b4b9099bb Mon Sep 17 00:00:00 2001 From: BianLzhaoMin <11485688+bianliangzhaomin123@user.noreply.gitee.com> Date: Fri, 26 Sep 2025 13:56:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entry-and-exit-manage/person-entry.js | 9 ++++++ .../person-entry/add-or-edit-form.vue | 32 ++++++++++++++++--- 2 files changed, 37 insertions(+), 4 deletions(-) diff --git a/src/api/construction-person/entry-and-exit-manage/person-entry.js b/src/api/construction-person/entry-and-exit-manage/person-entry.js index ca517e7..ddc7627 100644 --- a/src/api/construction-person/entry-and-exit-manage/person-entry.js +++ b/src/api/construction-person/entry-and-exit-manage/person-entry.js @@ -69,6 +69,15 @@ export const checkFaceImageAPI = (data) => { }) } +// 人员入场时 读卡器方式校验人脸图片接口 +export const checkFaceImageReadCardAPI = (data) => { + return requestFormData({ + url: '/bmw/worker/faceDetectionBase64', + method: 'POST', + data, + }) +} + // 根据身份证号码查询上海工程接口 export const getShanghaiProByIdNumberAPI = (data) => { return request({ diff --git a/src/views/construction-person/entry-and-exit-manage/person-entry/add-or-edit-form.vue b/src/views/construction-person/entry-and-exit-manage/person-entry/add-or-edit-form.vue index b34f699..98e279a 100644 --- a/src/views/construction-person/entry-and-exit-manage/person-entry/add-or-edit-form.vue +++ b/src/views/construction-person/entry-and-exit-manage/person-entry/add-or-edit-form.vue @@ -612,6 +612,7 @@ import UploadImgFormData from '@/components/UploadImgFormData' import UploadFileFormData from '@/components/UploadFileFormData' import { checkFaceImageAPI, + checkFaceImageReadCardAPI, addEntryPersonAPI, editEntryPersonAPI, getEntryPersonDetailAPI, @@ -1149,7 +1150,10 @@ export default { // 人脸图片 faceImg.forEach((item) => { - if (!item.id) { + if ( + !item.id && + !this.Base64Photo + ) { formData.append( 'files', item.raw, @@ -1320,6 +1324,11 @@ export default { } } + if (this.Base64Photo) { + params.facePhotoBase64 = + this.Base64Photo + } + formData.append( 'params', JSON.stringify(params), @@ -1553,10 +1562,10 @@ export default { // 工资卡信息 if (bmWorkerWageCard && Object.keys(bmWorkerWageCard).length > 0) { const { - bankCardCode, - bankName, - bankBranchName, id, + bankName, + bankCardCode, + bankBranchName, bankIdentifierCode, } = bmWorkerWageCard this.salaryCardInfoForm = { @@ -1719,6 +1728,7 @@ export default { _this.idCardInfoForm.birthday = _this.initDate(Birthday) _this.idCardInfoForm.startTime = _this.initDate(IssuedData) _this.Base64Photo = Base64Photo + _this.onUploadChangeFaceImgReadCard() // 读卡器方式人脸照片验证 // 计算年龄 const birthdayYear = Birthday.slice(0, 4) @@ -1787,6 +1797,20 @@ export default { } }, + // 读卡器方式人脸照片验证 + async onUploadChangeFaceImgReadCard() { + const formData = new FormData() + formData.append('file', this.Base64Photo) + const res = await checkFaceImageReadCardAPI(formData) + console.log(res, 'res读卡器方式人脸照片验证') + if (res.code !== 200) { + this.Base64Photo = '' + this.idCardInfoForm.faceImg = [] + } else { + this.idCardInfoForm.faceImg.push(this.Base64Photo) + } + }, + // 删除人脸照片 onDeleteFaceImg() { this.isReadCard = false