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 be2aec4..117390e 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 @@ -51,6 +51,7 @@ export const importEntryPersonAPI = (data) => { data, }) } + // 修改人员的红绿灯状态 export const updatePersonLightStatusAPI = (id) => { return request({ @@ -58,3 +59,12 @@ export const updatePersonLightStatusAPI = (id) => { method: 'POST', }) } + +// 人员入场时 校验人脸图片接口 +export const checkFaceImageAPI = (data) => { + return requestFormData({ + url: '/bmw/worker/faceDetection', + method: 'POST', + data, + }) +} 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 f04680c..afeadad 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 @@ -196,7 +196,7 @@ :limit="1" :file-size="10" :multiple="true" - @onUploadChange="onUploadChange" + @onUploadChange="onUploadChangeFaceImg" :file-type="['jpg', 'png', 'jpeg']" :file-list.sync="idCardInfoForm.faceImg" :is-uploaded="idCardInfoForm.faceImg.length >= 1" @@ -585,6 +585,7 @@ import UploadImgFormData from '@/components/UploadImgFormData' import UploadFileFormData from '@/components/UploadFileFormData' import { + checkFaceImageAPI, addEntryPersonAPI, editEntryPersonAPI, getEntryPersonDetailAPI, @@ -940,6 +941,15 @@ export default { trigger: 'blur', }, ], + wageCriterion: [ + { + required: false, + }, + { + pattern: /^[1-9]\d*$/, + message: '请输入正确的工资核定标准', + }, + ], }, // 入场工程列表 @@ -1222,7 +1232,7 @@ export default { await updatePersonLightStatusAPI( this.queryDetailsId ? this.workerId - : res.data.id, + : res.data, ) console.log( result, @@ -1565,11 +1575,16 @@ export default { }, // 人脸照片验证 - onUploadChange(fileList) { + async onUploadChangeFaceImg(fileList) { console.log('人脸照片验证', fileList) if (fileList.length > 0) { // 走验证逻辑 + + const formData = new FormData() + formData.append('file', fileList[0].raw) + const res = await checkFaceImageAPI(formData) + console.log(res, 'res人脸照片验证结果') } }, },