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