|
|
@ -8,22 +8,32 @@ import {environment} from '../../../environments/environment'; |
|
|
|
import {CookieService} from 'ngx-cookie-service'; |
|
|
|
import {CookieService} from 'ngx-cookie-service'; |
|
|
|
import {AbstractRoute} from '../../AbstractRoute'; |
|
|
|
import {AbstractRoute} from '../../AbstractRoute'; |
|
|
|
import {Router} from '@angular/router'; |
|
|
|
import {Router} from '@angular/router'; |
|
|
|
|
|
|
|
import {FormBuilder, FormGroup, Validators} from '@angular/forms'; |
|
|
|
|
|
|
|
import {Commons} from '../../commons'; |
|
|
|
|
|
|
|
|
|
|
|
@Component({ |
|
|
|
@Component({ |
|
|
|
selector: 'app-visitor', |
|
|
|
selector: 'app-visitor', |
|
|
|
templateUrl: './visitor.component.html', |
|
|
|
templateUrl: './visitor.component.html', |
|
|
|
styleUrls: ['./visitor.component.scss'] |
|
|
|
styleUrls: ['./visitor.component.scss'] |
|
|
|
}) |
|
|
|
}) |
|
|
|
export class VisitorComponent implements OnInit, MessageInterface { |
|
|
|
export class VisitorComponent extends Commons implements OnInit, MessageInterface { |
|
|
|
|
|
|
|
|
|
|
|
constructor(private visitorService: VisitorService, |
|
|
|
constructor(private visitorService: VisitorService, |
|
|
|
private messageUtil: MessageUtil, |
|
|
|
private messageUtil: MessageUtil, |
|
|
|
private cookieService: CookieService, |
|
|
|
private cookieService: CookieService, |
|
|
|
private abstractRoute: AbstractRoute, |
|
|
|
private abstractRoute: AbstractRoute, |
|
|
|
private router: Router, |
|
|
|
private router: Router, |
|
|
|
|
|
|
|
private fb: FormBuilder, |
|
|
|
) { |
|
|
|
) { |
|
|
|
|
|
|
|
super(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 查询表单
|
|
|
|
|
|
|
|
queryForm = this.fb.group({ |
|
|
|
|
|
|
|
// 查询预约人
|
|
|
|
|
|
|
|
appointment: this.fb.control('', [Validators.required]), |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
// 访客信息
|
|
|
|
// 访客信息
|
|
|
|
visitors: Page<Visitor>; |
|
|
|
visitors: Page<Visitor>; |
|
|
|
// 审核状态
|
|
|
|
// 审核状态
|
|
|
@ -36,7 +46,7 @@ export class VisitorComponent implements OnInit, MessageInterface { |
|
|
|
// 加载访客信息
|
|
|
|
// 加载访客信息
|
|
|
|
loadAll(page) { |
|
|
|
loadAll(page) { |
|
|
|
this.currentPage = page; |
|
|
|
this.currentPage = page; |
|
|
|
this.visitorService.loadAll(page).subscribe(r => { |
|
|
|
this.visitorService.loadAll(Object.assign(this.queryForm.value, {currentPage: page})).subscribe(r => { |
|
|
|
if (r.result === Result.OK) { |
|
|
|
if (r.result === Result.OK) { |
|
|
|
this.visitors = r.visitorList; |
|
|
|
this.visitors = r.visitorList; |
|
|
|
} else { |
|
|
|
} else { |
|
|
@ -66,4 +76,8 @@ export class VisitorComponent implements OnInit, MessageInterface { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
form(): FormGroup { |
|
|
|
|
|
|
|
return this.queryForm; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|