|
@@ -38,6 +38,7 @@ import { NzGridModule } from 'ng-zorro-antd/grid';
|
|
styleUrls: ['./account-info.component.scss'],
|
|
styleUrls: ['./account-info.component.scss'],
|
|
})
|
|
})
|
|
export class AccountInfoComponent implements OnInit {
|
|
export class AccountInfoComponent implements OnInit {
|
|
|
|
+ url:string = `"http://hep-textbook.oss-cn-beijing.aliyuncs.com/6687b9417f823ff53c74cfd6/2024-7-15/1721044465100-%E2%80%9C%E5%8D%81%E5%9B%9B%E4%BA%94%E2%80%9D%E6%99%AE%E9%80%9A%E9%AB%98%E7%AD%89%E6%95%99%E8%82%B2%E6%9C%AC%E7%A7%91%E5%9B%BD%E5%AE%B6%E7%BA%A7%E8%A7%84%E5%88%92%E6%95%99%E6%9D%90%E6%8E%A8%E8%8D%90%E9%81%B4%E9%80%89%E5%B7%A5%E4%BD%9C%E8%81%94%E7%B3%BB%E4%BA%BA%E4%BF%A1%E6%81%AF%E8%A1%A8.doc"`
|
|
user: Parse.Object | undefined;
|
|
user: Parse.Object | undefined;
|
|
validateForm: FormGroup<{
|
|
validateForm: FormGroup<{
|
|
name: FormControl<string>; //姓名
|
|
name: FormControl<string>; //姓名
|
|
@@ -46,7 +47,6 @@ export class AccountInfoComponent implements OnInit {
|
|
// telephone: FormControl<string>; //办公电话
|
|
// telephone: FormControl<string>; //办公电话
|
|
// province: FormControl<string>; //省份
|
|
// province: FormControl<string>; //省份
|
|
identity: FormControl<string>; //人员类型
|
|
identity: FormControl<string>; //人员类型
|
|
- companyType: FormControl<string>; //单位类型
|
|
|
|
// idcard: FormControl<string>; //身份证号
|
|
// idcard: FormControl<string>; //身份证号
|
|
// departmentName: FormControl<string>; //所在部门
|
|
// departmentName: FormControl<string>; //所在部门
|
|
// postName: FormControl<string>; //职务
|
|
// postName: FormControl<string>; //职务
|
|
@@ -57,11 +57,12 @@ export class AccountInfoComponent implements OnInit {
|
|
// telephone: [''],
|
|
// telephone: [''],
|
|
// province: [''],
|
|
// province: [''],
|
|
identity: ['', [Validators.required]],
|
|
identity: ['', [Validators.required]],
|
|
- companyType: ['', [Validators.required]],
|
|
|
|
// idcard: ['', [Validators.required]],
|
|
// idcard: ['', [Validators.required]],
|
|
// departmentName: [''],
|
|
// departmentName: [''],
|
|
// postName: [''],
|
|
// postName: [''],
|
|
});
|
|
});
|
|
|
|
+ companyType: string = ''; //单位类型
|
|
|
|
+
|
|
identityFile: string = ''; //单位联系人认证文件
|
|
identityFile: string = ''; //单位联系人认证文件
|
|
companyId: string = ''; //单位名称
|
|
companyId: string = ''; //单位名称
|
|
|
|
|
|
@@ -104,12 +105,12 @@ export class AccountInfoComponent implements OnInit {
|
|
// telephone: [profile?.get('telephone') || ''],
|
|
// telephone: [profile?.get('telephone') || ''],
|
|
// province: [user?.get('province') || ''],
|
|
// province: [user?.get('province') || ''],
|
|
identity: [profile?.get('identity') || '', [Validators.required]],
|
|
identity: [profile?.get('identity') || '', [Validators.required]],
|
|
- companyType: [profile?.get('companyType') || '', [Validators.required]],
|
|
|
|
// departmentName: [user?.get('departmentName') || ''],
|
|
// departmentName: [user?.get('departmentName') || ''],
|
|
// postName: [profile?.get('postName') || ''],
|
|
// postName: [profile?.get('postName') || ''],
|
|
});
|
|
});
|
|
this.identityFile = profile?.get('identityFile') || ''
|
|
this.identityFile = profile?.get('identityFile') || ''
|
|
this.companyId = user?.get('department')?.id || '';
|
|
this.companyId = user?.get('department')?.id || '';
|
|
|
|
+ this.companyType = profile?.get('companyType') || ''
|
|
this.provinceChange();
|
|
this.provinceChange();
|
|
// console.log(this.companyId, this.identityFile);
|
|
// console.log(this.companyId, this.identityFile);
|
|
// console.log(this.validateForm.value);
|
|
// console.log(this.validateForm.value);
|
|
@@ -130,10 +131,9 @@ export class AccountInfoComponent implements OnInit {
|
|
// console.log(val);
|
|
// console.log(val);
|
|
if (isChange) this.companyId = '';
|
|
if (isChange) this.companyId = '';
|
|
this.companys = [];
|
|
this.companys = [];
|
|
- let parent = this.unitTypes.find(item=>item.name == this.validateForm.value.companyType)
|
|
|
|
|
|
+ let parent = this.unitTypes.find(item=>item.name == this.companyType)
|
|
console.log(parent);
|
|
console.log(parent);
|
|
let query = new Parse.Query('Department');
|
|
let query = new Parse.Query('Department');
|
|
- // query.equalTo('branch', this.validateForm.value.companyType);
|
|
|
|
query.equalTo('parent', parent.id);
|
|
query.equalTo('parent', parent.id);
|
|
query.select('name', 'branch');
|
|
query.select('name', 'branch');
|
|
query.limit(100);
|
|
query.limit(100);
|
|
@@ -147,7 +147,7 @@ export class AccountInfoComponent implements OnInit {
|
|
console.log(this.validateForm.value);
|
|
console.log(this.validateForm.value);
|
|
console.log(this.companyId);
|
|
console.log(this.companyId);
|
|
if (this.validateForm.valid) {
|
|
if (this.validateForm.valid) {
|
|
- if (!this.companyId) {
|
|
|
|
|
|
+ if (!this.companyId && this.validateForm.value.identity == '工作联系人') {
|
|
this.message.error('单位名称未选择或与单位类型不匹配,请重新选择');
|
|
this.message.error('单位名称未选择或与单位类型不匹配,请重新选择');
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
@@ -157,7 +157,7 @@ export class AccountInfoComponent implements OnInit {
|
|
this.message.error('邮箱格式不正确');
|
|
this.message.error('邮箱格式不正确');
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
- if (!this.identityFile) {
|
|
|
|
|
|
+ if (!this.identityFile && this.validateForm.value.identity == '工作联系人') {
|
|
this.message.error('请上传单位联系人认证文件');
|
|
this.message.error('请上传单位联系人认证文件');
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
@@ -179,22 +179,24 @@ export class AccountInfoComponent implements OnInit {
|
|
queryDepart.equalTo('objectId', this.companyId);
|
|
queryDepart.equalTo('objectId', this.companyId);
|
|
queryDepart.select('objectId');
|
|
queryDepart.select('objectId');
|
|
let depart = await queryDepart.first()
|
|
let depart = await queryDepart.first()
|
|
- if(!depart?.id){
|
|
|
|
|
|
+ if(!depart?.id && this.validateForm.value.identity == '工作联系人'){
|
|
this.message.error('单位名称未选择或与单位类型不匹配,请重新选择');
|
|
this.message.error('单位名称未选择或与单位类型不匹配,请重新选择');
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
this.user?.set('name', params.name);
|
|
this.user?.set('name', params.name);
|
|
this.user?.set('email', params.email);
|
|
this.user?.set('email', params.email);
|
|
this.user?.set('phone', params.phone);
|
|
this.user?.set('phone', params.phone);
|
|
- this.user?.set('province', params.province);
|
|
|
|
|
|
+ // this.user?.set('province', params.province);
|
|
this.user?.set('companyName', depart?.get('name'));
|
|
this.user?.set('companyName', depart?.get('name'));
|
|
- this.user?.set('department', {
|
|
|
|
- __type: 'Pointer',
|
|
|
|
- className: 'Department',
|
|
|
|
- objectId: depart?.id,
|
|
|
|
- });
|
|
|
|
|
|
+ if(this.validateForm.value.identity == '工作联系人'){
|
|
|
|
+ this.user?.set('department', {
|
|
|
|
+ __type: 'Pointer',
|
|
|
|
+ className: 'Department',
|
|
|
|
+ objectId: depart?.id,
|
|
|
|
+ });
|
|
|
|
+ }
|
|
!this.user?.get('accountState') && this.user?.set('accountState', '待认证');
|
|
!this.user?.get('accountState') && this.user?.set('accountState', '待认证');
|
|
- this.user?.set('departmentName', params.departmentName);
|
|
|
|
|
|
+ // this.user?.set('departmentName', params.departmentName);
|
|
await this.user?.save();
|
|
await this.user?.save();
|
|
|
|
|
|
let query = new Parse.Query('Profile');
|
|
let query = new Parse.Query('Profile');
|
|
@@ -211,13 +213,15 @@ export class AccountInfoComponent implements OnInit {
|
|
className: 'Company',
|
|
className: 'Company',
|
|
objectId: this.tbookSer.company,
|
|
objectId: this.tbookSer.company,
|
|
});
|
|
});
|
|
- profile?.set('telephone', params.telephone);
|
|
|
|
- profile?.set('companyType', params.companyType);
|
|
|
|
|
|
+ // profile?.set('telephone', params.telephone);
|
|
|
|
+ if(this.validateForm.value.identity == '工作联系人'){
|
|
|
|
+ profile?.set('companyType', this.companyType);
|
|
|
|
+ profile?.set('identityFile', this.identityFile);
|
|
|
|
+ }
|
|
profile?.set('email', params.email);
|
|
profile?.set('email', params.email);
|
|
// profile?.set('idcard', params.idcard);
|
|
// profile?.set('idcard', params.idcard);
|
|
|
|
+ // profile?.set('postName', params.postName);
|
|
profile?.set('identity', params.identity);
|
|
profile?.set('identity', params.identity);
|
|
- profile?.set('identityFile', this.identityFile);
|
|
|
|
- profile?.set('postName', params.postName);
|
|
|
|
let res = await profile?.save();
|
|
let res = await profile?.save();
|
|
this.modal.success({
|
|
this.modal.success({
|
|
nzTitle: '提交成功',
|
|
nzTitle: '提交成功',
|