Commit 306f10c4ffa4ec0e74581e5aa42050f4778a5d97
1 parent
2301ee40
1.处理处理职员信息,点击人脸采集,入参取主表数据,而非userinfo
Showing
4 changed files
with
36 additions
and
5 deletions
.idea/.gitignore
0 → 100644
.idea/vcs.xml
0 → 100644
src/components/Common/PersonCenter/PersonCenterAddFace.js
| @@ -25,7 +25,7 @@ const PersonCenterAddFace = Form.create({ | @@ -25,7 +25,7 @@ const PersonCenterAddFace = Form.create({ | ||
| 25 | className={styles.changePwd} | 25 | className={styles.changePwd} |
| 26 | > | 26 | > |
| 27 | <div className="tab-container"> | 27 | <div className="tab-container"> |
| 28 | - <FaceDetect {...props} actionType="saveFace" onSaveFaceSuccess={props.onSaveFaceSuccess}> | 28 | + <FaceDetect {...props} bClickSource = 'BtnAddFace' actionType="saveFace" onSaveFaceSuccess={props.onSaveFaceSuccess}> |
| 29 | 11 | 29 | 11 |
| 30 | </FaceDetect> | 30 | </FaceDetect> |
| 31 | </div> | 31 | </div> |
src/components/FaceDetect/index.js
| @@ -29,6 +29,7 @@ class FaceDetect extends Component { | @@ -29,6 +29,7 @@ class FaceDetect extends Component { | ||
| 29 | 29 | ||
| 30 | componentWillReceiveProps(nextProps, nextContext) { | 30 | componentWillReceiveProps(nextProps, nextContext) { |
| 31 | if (nextProps.masterData) { | 31 | if (nextProps.masterData) { |
| 32 | + console.log('ssss', nextProps.masterData); | ||
| 32 | this.user_id = nextProps.masterData.sEmployeeNo; | 33 | this.user_id = nextProps.masterData.sEmployeeNo; |
| 33 | this.user_info = JSON.stringify( | 34 | this.user_info = JSON.stringify( |
| 34 | { | 35 | { |
| @@ -203,19 +204,35 @@ class FaceDetect extends Component { | @@ -203,19 +204,35 @@ class FaceDetect extends Component { | ||
| 203 | } else { | 204 | } else { |
| 204 | _this.changeStatusContent('人脸采集成功'); | 205 | _this.changeStatusContent('人脸采集成功'); |
| 205 | let img = _this.getFace(); | 206 | let img = _this.getFace(); |
| 206 | - const userinfo = this.props.app.userinfo; | 207 | + let userinfo = this.props.app.userinfo; |
| 208 | + const sBrandId = userinfo?.sBrandsId; | ||
| 209 | + const sSubsidiaryId = userinfo?.sSubsidiaryId; | ||
| 210 | + if(this.props.bClickSource?.includes('BtnAddFace') ){ | ||
| 211 | + userinfo = { | ||
| 212 | + sUserName: this.props.masterData?.sEmployeeName, | ||
| 213 | + sEmployeeNo: this.props.masterData?.sEmployeeNo, | ||
| 214 | + sEmployeeId : this.props.masterData?.sEmployeeId, | ||
| 215 | + sDepartName: this.props.masterData?.sDepartName, | ||
| 216 | + sId :this.props.masterData?.sId | ||
| 217 | + } | ||
| 218 | + console.log('userinfo', userinfo); | ||
| 219 | + } | ||
| 220 | + | ||
| 207 | let item = { | 221 | let item = { |
| 208 | "image": img.split(',')[1], | 222 | "image": img.split(',')[1], |
| 209 | "image_type": "BASE64", | 223 | "image_type": "BASE64", |
| 210 | "sParentId": userinfo.sId, | 224 | "sParentId": userinfo.sId, |
| 211 | - "sEmployeeId": userinfo.sEmployeeId, | 225 | + "sEmployeeId": userinfo.sId, |
| 226 | + "sEmployeeName": userinfo.sUserName, | ||
| 227 | + "sEmployeeNo": userinfo.sEmployeeNo, | ||
| 212 | "sUserName": userinfo.sUserName, | 228 | "sUserName": userinfo.sUserName, |
| 213 | - "sBrandsId": userinfo.sBrandsId, | ||
| 214 | - "sSubsidiaryId": userinfo.sSubsidiaryId, | 229 | + "sBrandsId": sBrandId, |
| 230 | + "sSubsidiaryId": sSubsidiaryId, | ||
| 215 | "quality_control": "NORMAL", | 231 | "quality_control": "NORMAL", |
| 216 | "liveness_control": "LOW", | 232 | "liveness_control": "LOW", |
| 217 | "face_field": "feature" | 233 | "face_field": "feature" |
| 218 | } | 234 | } |
| 235 | + console.log('item', item); | ||
| 219 | //保存URL | 236 | //保存URL |
| 220 | const url = this.urlpre + `/face/faceAdd`; | 237 | const url = this.urlpre + `/face/faceAdd`; |
| 221 | _this.changeStatusContent('人脸数据处理中,请稍等'); | 238 | _this.changeStatusContent('人脸数据处理中,请稍等'); |