Commit 0d2e5d20 by sunchao

工作经历&个人照片&身份证保存

parent 82a950ba
......@@ -100,7 +100,7 @@
position: relative;
background-color: #fff;
height: 240px;
overflow: hidden;
overflow: auto;
.weui-picker__content {
width: 100%;
padding-bottom: 90px;
......
......@@ -5,7 +5,7 @@ export class EmployBasicQuery {
public mobileNo?:number,
public idTypeId?:number,
public idType?:string,
public idNo?:number,
public idNo?:any,
//1=Male, 2=Female
public gender?:string,
public practitionerBirthdate?:string,
......
export class ExperienceQuery {
constructor(
public hiringBasicInfoId?:any,
public workingCompany?:string,
public position?:string,
public workingStart?:string,
public workingEnd?:string,
) {
}
}
\ No newline at end of file
......@@ -32,6 +32,7 @@
[minDate] ="minDate"
[(ngModel)]="showPractitionerBirthdate"
(onOk)="onOk($event)"
[disabled]="editEmployBasicInfo.idTypeId==1"
>
生日
</ListItem>
......@@ -39,7 +40,7 @@
<div class="contentItem">
<span>性别</span>
<select class="form-control" [(ngModel)]="editEmployBasicInfo.gender">
<select class="form-control" [(ngModel)]="editEmployBasicInfo.gender" [disabled]="editEmployBasicInfo.idTypeId==1">
<option value=null>请选择</option>
<option value='1'></option>
<option value="2"></option>
......
......@@ -15,7 +15,7 @@ export class EmployeeBasicInfoComponent implements OnInit {
editEmployBasicInfo:EmployBasicQuery = new EmployBasicQuery();
isNeedAlert: boolean;
dialogInfo: any;
showPractitionerBirthdate:any;
showPractitionerBirthdate:any = null;
houseFlag:boolean;
addressInfo:any;
provinces:Array<any>;
......@@ -31,7 +31,6 @@ export class EmployeeBasicInfoComponent implements OnInit {
this.editEmployBasicInfo.mobileNo = this.activatedRoute.snapshot.queryParams.mobileNo?this.activatedRoute.snapshot.queryParams.mobileNo:null;
this.erpInitialize();
this.provCityQry();
this.showPractitionerBirthdate = new Date();
this.editEmployBasicInfo = new EmployBasicQuery(this.hiringBasicInfoId,null,this.editEmployBasicInfo.mobileNo,null,null,null,null,null,null,null,null,null,null,null,null)
}
......@@ -44,14 +43,17 @@ export class EmployeeBasicInfoComponent implements OnInit {
}
currentDateFormat(date, format: string = 'yyyy-mm-dd HH:MM'): any {
const pad = (n: number): string => (n < 10 ? `0${n}` : n.toString());
return format
.replace('yyyy', date.getFullYear())
.replace('mm', pad(date.getMonth() + 1))
.replace('dd', pad(date.getDate()))
.replace('HH', pad(date.getHours()))
.replace('MM', pad(date.getMinutes()))
.replace('ss', pad(date.getSeconds()));
if(date){
const pad = (n: number): string => (n < 10 ? `0${n}` : n.toString());
return format
.replace('yyyy', date.getFullYear())
.replace('mm', pad(date.getMonth() + 1))
.replace('dd', pad(date.getDate()))
.replace('HH', pad(date.getHours()))
.replace('MM', pad(date.getMinutes()))
.replace('ss', pad(date.getSeconds()));
}
}
onOk(result: Date) {
......@@ -78,6 +80,9 @@ export class EmployeeBasicInfoComponent implements OnInit {
this.lifeCommonService.scrollTo();
if (type) {
if(type === 1 && this.editEmployBasicInfo.idTypeId==1){
if(this.editEmployBasicInfo.idNo){
this.editEmployBasicInfo.idNo = this.editEmployBasicInfo.idNo.trim();
}
this.idCardInput(this.editEmployBasicInfo.idNo);
}
}
......
......@@ -14,10 +14,13 @@
<span class="tips">(正确示例:身份证正面,字体清晰)</span>
</div>
<div class="right">
<div class="photo" [ngStyle]="{'width':this.exampleWidth + 'px','height':this.exampleHeight + 'px'}">
<div class="photo" [ngStyle]="{'width':this.exampleWidth + 'px','height':this.exampleHeight + 'px'}"
*ngIf="!frontVxUrl">
<img src="assets/images/camera.png" alt="身份证" />
<div>点击添加身份证正面</div>
<div (click)="selectPic('front')">点击添加身份证正面</div>
</div>
<img src="{{frontVxUrl}}" alt="身份证正面" *ngIf="frontVxUrl"
(click)="selectPic('front')" [ngStyle]="{'width':this.exampleWidth + 'px','height':this.exampleHeight + 'px'}">
<span class="tips">(jpg,png 文件大小不大于1mb)</span>
</div>
</div>
......@@ -27,11 +30,13 @@
<span class="tips">(正确示例:身份证正面,字体清晰)</span>
</div>
<div class="right">
<div class="photo" [ngStyle]="{'width':this.exampleWidth + 'px','height':this.exampleHeight + 'px'}">
<div class="photo" [ngStyle]="{'width':this.exampleWidth + 'px','height':this.exampleHeight + 'px'}"
*ngIf="!backVxUrl">
<img src="assets/images/camera.png" alt="身份证" />
<div>点击添加身份证正面</div>
<div (click)="selectPic('back')">点击添加身份证正面</div>
</div>
<img src="{{backVxUrl}}" alt="身份证反面" *ngIf="backVxUrl"
(click)="selectPic('back')" [ngStyle]="{'width':this.exampleWidth + 'px','height':this.exampleHeight + 'px'}">
<span class="tips">(jpg,png 文件大小不大于1mb)</span>
</div>
</div>
......@@ -39,4 +44,5 @@
<footer class="fixed" (click)="next()">
保存并下一步
</footer>
</div>
\ No newline at end of file
</div>
<ydlife-toast *ngIf="toastDialog" [toastInfo]="toastInfo"></ydlife-toast>
\ No newline at end of file
......@@ -2,7 +2,8 @@ import { Component, OnInit,ViewChild,ElementRef } from '@angular/core';
import { MyService } from '../../my.service';
import { ActivatedRoute,Router } from "@angular/router";
import { LifeCommonService } from "../../../common/life-common.service";
import { ChangeDetectorRef } from '@angular/core';
declare const wx: any;
@Component({
selector: 'ydlife-employee-id-card',
templateUrl: './employee-id-card.component.html',
......@@ -13,9 +14,14 @@ export class EmployeeIdCardComponent implements OnInit {
exampleWidth:any;
exampleHeight:any;
hiringBasicInfoId:any;
frontVxUrl:any = null;
backVxUrl:any = null;
serverId: any;
toastDialog: boolean;
toastInfo: any;
constructor(private activatedRoute: ActivatedRoute,
private router: Router,public lifeCommonService:LifeCommonService,
public myService:MyService) {
public myService:MyService,private changeDetectorRef: ChangeDetectorRef) {
}
......@@ -31,7 +37,63 @@ export class EmployeeIdCardComponent implements OnInit {
}
next(){
this.router.navigate(['/employee_education'],{ queryParams: { hiringBasicInfoId:this.hiringBasicInfoId} });
const param = {
hiringBasicInfoId:this.hiringBasicInfoId,
frontVxUrl:this.frontVxUrl,
backVxUrl:this.backVxUrl
}
this.myService.saveBasicInfo(param).subscribe((res)=>{
if(res['success']){
this.router.navigate(['/employee_education'],{ queryParams: { hiringBasicInfoId:this.hiringBasicInfoId} });
}else{
this.toastDialog = true;
this.toastInfo = {
status: 1,
msg: res['message'],
timeout: 3000,
align: 'center'
};
}
})
}
selectPic(type){
// 5.1 拍照、本地选图
const t = this;
wx.chooseImage({
count: 1, // 默认9
sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有
sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
success: function (res) {
this.localId = res.localIds[0]; // 返回选定照片的本地ID列表,localId可以作为img标签的src属性显示图片
const THIS = t;
wx.uploadImage({
localId: this.localId, // 需要上传的图片的本地ID,由chooseImage接口获得
isShowProgressTips: 1, // 默认为1,显示进度提示
success: function (response) {
THIS.serverId = response.serverId; // 返回图片的服务器端ID
const m = {
mediaId: response.serverId,
origin: 'ydLife'
};
THIS.myService.mediaGet(m).subscribe(async e => {
alert(e['data'])
if (e['success']) {
if(type=='front'){
THIS.frontVxUrl = e['data']['imgUrl'];
}
if(type=='back'){
THIS.backVxUrl = e['data']['imgUrl'];
}
THIS.changeDetectorRef.markForCheck();
THIS.changeDetectorRef.detectChanges();
} else {
alert(e['message']);
}
});
}
});
}
});
}
}
......@@ -4,10 +4,11 @@
<span class="page_mark"> 3/8</span>
</div>
<div class="content">
<div class="photo_wrapper">
<img src="assets/images/camera.png" alt="" />
<div class="photo_wrapper" (click)="selectPic('add')" *ngIf="!vxUrl">
<img src="assets/images/camera.png" alt="" style="width: 29px;height: 29px;margin-bottom: 20px;"/>
<div>点击添加</div>
</div>
<img alt="个人照片" src="{{vxUrl}}" *ngIf="vxUrl" (click)="selectPic('edit')">
<div class="tips">
<p>2寸照片,一年之内近照</p>
<p>(请勿使用生活照,大小小于1mb)</p>
......@@ -16,4 +17,5 @@
<footer class="fixed" (click)="next()">
保存并下一步
</footer>
</div>
\ No newline at end of file
</div>
<ydlife-toast *ngIf="toastDialog" [toastInfo]="toastInfo"></ydlife-toast>
\ No newline at end of file
......@@ -2,7 +2,8 @@ import { Component, OnInit } from '@angular/core';
import { MyService } from '../../my.service';
import { ActivatedRoute,Router } from "@angular/router";
import { LifeCommonService } from "../../../common/life-common.service";
import { ChangeDetectorRef } from '@angular/core';
declare const wx: any;
@Component({
selector: 'ydlife-personal-photos',
templateUrl: './personal-photos.component.html',
......@@ -10,9 +11,13 @@ import { LifeCommonService } from "../../../common/life-common.service";
})
export class PersonalPhotosComponent implements OnInit {
hiringBasicInfoId:any;
serverId: any;
vxUrl:any = null;
toastDialog: boolean;
toastInfo: any;
constructor(private activatedRoute: ActivatedRoute,
private router: Router,public lifeCommonService:LifeCommonService,
public myService:MyService) { }
public myService:MyService,private changeDetectorRef: ChangeDetectorRef) { }
ngOnInit() {
const title = this.activatedRoute.snapshot.data[0]['title'];
......@@ -21,7 +26,59 @@ export class PersonalPhotosComponent implements OnInit {
}
selectPic(type){
// 5.1 拍照、本地选图
const t = this;
wx.chooseImage({
count: 1, // 默认9
sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有
sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
success: function (res) {
this.localId = res.localIds[0]; // 返回选定照片的本地ID列表,localId可以作为img标签的src属性显示图片
const THIS = t;
wx.uploadImage({
localId: this.localId, // 需要上传的图片的本地ID,由chooseImage接口获得
isShowProgressTips: 1, // 默认为1,显示进度提示
success: function (response) {
THIS.serverId = response.serverId; // 返回图片的服务器端ID
const m = {
mediaId: response.serverId,
origin: 'ydLife'
};
THIS.myService.mediaGet(m).subscribe(async e => {
alert(e['data'])
if (e['success']) {
THIS.vxUrl = e['data']['imgUrl'];
THIS.changeDetectorRef.markForCheck();
THIS.changeDetectorRef.detectChanges();
} else {
alert(e['message']);
}
});
}
});
}
});
}
next(){
this.router.navigate(['/employee_id_card'],{ queryParams: { hiringBasicInfoId:this.hiringBasicInfoId} });
const param = {
hiringBasicInfoId:this.hiringBasicInfoId,
vxUrl:this.vxUrl
}
this.myService.savePersonPicture(param).subscribe((res)=>{
if(res['success']){
this.router.navigate(['/employee_id_card'],{ queryParams: { hiringBasicInfoId:this.hiringBasicInfoId} });
}else{
this.toastDialog = true;
this.toastInfo = {
status: 1,
msg: res['message'],
timeout: 3000,
align: 'center'
};
}
})
}
}
......@@ -7,49 +7,71 @@
<div class="contentDetail employ">
<div class="contentItem">
<span>工作单位</span>
<input type="text" class="form-control" />
<input type="text" class="form-control" [(ngModel)]="addExperience.workingCompany"/>
</div>
<div class="contentItem">
<span>职位</span>
<input type="text" class="form-control" />
</div>
<div class="contentItem">
<span>任职起始时间</span>
<input type="text" class="form-control" />
</div>
<div class="contentItem">
<span>任职结束时间</span>
<input type="text" class="form-control" />
<input type="text" class="form-control" [(ngModel)]="addExperience.position"/>
</div>
<List [className]="'date-picker-list'">
<ListItem
DatePicker
[extra]="currentDateFormat(showworkingStart, 'yyyy-mm-dd')"
[arrow]="'horizontal'"
[mode]="'date'"
[minDate] ="minDate"
[maxDate] = "maxDate"
[(ngModel)]="showworkingStart"
(onOk)="onOk($event,'start')"
>
任职起始时间
</ListItem>
</List>
<List [className]="'date-picker-list'">
<ListItem
DatePicker
[extra]="currentDateFormat(showworkingEnd, 'yyyy-mm-dd')"
[arrow]="'horizontal'"
[mode]="'date'"
[minDate] ="showworkingStart"
[maxDate] = "maxDate"
[(ngModel)]="showworkingEnd"
(onOk)="onOk($event,'end')"
>
任职结束时间
</ListItem>
</List>
</div>
</div>
<div class="add_wrapper">
<i class="iconfont icon-jiahao"></i>
<div class="add_wrapper" >
<i class="iconfont icon-jiahao" (click)="addExperienceList()"></i>
<span>确认并添加</span>
</div>
<div class="experience_list">
<ul>
<div class="experience_list" *ngIf="experienceList?.length>0">
<ul *ngFor="let experienceItem of experienceList;index as i;">
<div style="font-size: 14px;font-weight: bold;margin-bottom: 5px;">经历 {{i+1}}</div>
<li>
<span>工作单位</span>
<span>上海银盾保险经纪有限公司</span>
<span>{{experienceItem.workingCompany}}</span>
</li>
<li>
<span>职位</span>
<span>经纪人</span>
<span>{{experienceItem.position}}</span>
</li>
<li>
<span>任职起始时间</span>
<span>2018-5-23</span>
<span>{{experienceItem.workingStart}}</span>
</li>
<li>
<span>任职结束时间</span>
<span>2019-5-23</span>
<span>{{experienceItem.workingEnd}}</span>
</li>
</ul>
</div>
<footer class="fixed" (click)="next()">
保存并下一步
</footer>
</div>
\ No newline at end of file
</div>
<ydlife-toast *ngIf="toastDialog" [toastInfo]="toastInfo"></ydlife-toast>
......@@ -2,6 +2,7 @@ import { Component, OnInit } from '@angular/core';
import { MyService } from '../../my.service';
import { ActivatedRoute,Router } from "@angular/router";
import { LifeCommonService } from "../../../common/life-common.service";
import { ExperienceQuery } from '../../../domain/experienceQuery';
@Component({
selector: 'ydlife-work-experience',
......@@ -10,18 +11,81 @@ import { LifeCommonService } from "../../../common/life-common.service";
})
export class WorkExperienceComponent implements OnInit {
hiringBasicInfoId:any;
addExperience:ExperienceQuery = new ExperienceQuery(null,null,null,null,null);
//工作经历列表
experienceList:Array<any>;
minDate:any = new Date('1900-01-01');
showworkingStart:any=null;
showworkingEnd:any = null;
maxDate:any = new Date();
//控制弹框
toastDialog: boolean;
toastInfo: any;
constructor(private activatedRoute: ActivatedRoute,
private router: Router,public lifeCommonService:LifeCommonService,
public myService:MyService) { }
public myService:MyService) {
this.experienceList = [];
}
ngOnInit() {
const title = this.activatedRoute.snapshot.data[0]['title'];
this.lifeCommonService.setTitle(title);
this.hiringBasicInfoId = this.activatedRoute.snapshot.queryParams.hiringBasicInfoId?this.activatedRoute.snapshot.queryParams.hiringBasicInfoId:null;
this.addExperience = new ExperienceQuery(this.hiringBasicInfoId, null, null,null, null);
}
next(){
this.router.navigate(['/personal_photos'],{ queryParams: { hiringBasicInfoId:this.hiringBasicInfoId} });
const experienceParam = {
workingExperienceList:this.experienceList
}
this.myService.saveWorkingExperience(experienceParam).subscribe((res)=>{
if(res['success']){
this.router.navigate(['/personal_photos'],{ queryParams: { hiringBasicInfoId:this.hiringBasicInfoId} });
}else{
this.toastDialog = true;
this.toastInfo = {
status: 1,
msg: res['message'],
timeout: 3000,
align: 'center'
};
}
})
}
addExperienceList() {
//先push进去list在清空
if(this.addExperience.workingCompany || this.addExperience.position || this.addExperience.workingStart || this.addExperience.workingEnd){
this.experienceList.push(this.addExperience)
this.showworkingStart=null;
this.showworkingEnd = null;
this.addExperience = new ExperienceQuery(this.hiringBasicInfoId, null, null,null, null);
}
}
currentDateFormat(date, format: string = 'yyyy-mm-dd HH:MM'): any {
if(date){
const pad = (n: number): string => (n < 10 ? `0${n}` : n.toString());
return format
.replace('yyyy', date.getFullYear())
.replace('mm', pad(date.getMonth() + 1))
.replace('dd', pad(date.getDate()))
.replace('HH', pad(date.getHours()))
.replace('MM', pad(date.getMinutes()))
.replace('ss', pad(date.getSeconds()));
}
}
onOk(result: Date,type) {
if(type=='start'){
this.addExperience.workingStart = this.currentDateFormat(result, 'yyyy-mm-dd');
this.showworkingStart = result;
}
if(type=='end'){
this.addExperience.workingEnd = this.currentDateFormat(result, 'yyyy-mm-dd');
this.showworkingEnd =result;
}
}
}
......@@ -432,6 +432,26 @@ export class MyService {
const url = this.ydapi + '/practitionerHiring/saveBasicInfo';
return this.http
.post(url, JSON.stringify(param));
}
//工作经历
saveWorkingExperience(param){
const url = this.ydapi + '/practitionerHiring/saveWorkingExperience';
return this.http
.post(url, JSON.stringify(param));
}
//个人资料照片
savePersonPicture(param){
const url = this.ydapi + '/practitionerHiring/savePersonPicture';
return this.http
.post(url, JSON.stringify(param));
}
//身份证
saveIDPicture(param){
const url = this.ydapi + '/practitionerHiring/saveIDPicture';
return this.http
.post(url, JSON.stringify(param));
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment