Commit a0cd86ab authored by wangqinghua's avatar wangqinghua

通讯录-选择角色

parent e84ed9aa
<ion-header> <ion-header>
<ion-navbar> <ion-navbar>
<ion-title text-center> <ion-title text-center>
<span>{{area?.name}}</span> <span>{{area?.name}}({{roleName}})</span>
</ion-title> </ion-title>
</ion-navbar> </ion-navbar>
</ion-header> </ion-header>
...@@ -24,6 +24,22 @@ ...@@ -24,6 +24,22 @@
</div> </div>
</ion-item> </ion-item>
</ng-container> </ng-container>
<ng-container *ngFor="let person of page.noNumList">
<ion-item (click)="goToInfo(person)">
<div class="contact-box">
<img src="./assets/imgs/man.png" class="contact-img">
<div class="contact-box-right">
<div>
<span class="contact-name">{{person.name}}</span>
</div>
<div>
<span class="contact-handphone">手机:{{person.mobilePhone || "-"}}</span>
<span class="contact-telphone">座机:{{person.telPhone || "-"}}</span>
</div>
</div>
</div>
</ion-item>
</ng-container>
</ion-list> </ion-list>
<ion-list text-center style="margin-top: 10rem" *ngIf="page.list.length == 0 && page.isLoad"> <ion-list text-center style="margin-top: 10rem" *ngIf="page.list.length == 0 && page.isLoad">
<img style="width: 20%;" src="./assets/imgs/no-data.png" alt=""> <img style="width: 20%;" src="./assets/imgs/no-data.png" alt="">
......
...@@ -11,16 +11,21 @@ import {GlobalData} from "../../../core/GlobleData"; ...@@ -11,16 +11,21 @@ import {GlobalData} from "../../../core/GlobleData";
}) })
export class ContactListPage { export class ContactListPage {
role;
area; area;
page = { page = {
list: [], list: [],
noNumList: [],
isLoad: false isLoad: false
} };
roleName;
constructor(public navCtrl: NavController, public navParams: NavParams, constructor(public navCtrl: NavController, public navParams: NavParams,
private globle:GlobalData, private globle: GlobalData,
private homeSer: HomeService) { private homeSer: HomeService) {
this.role = this.navParams.get('role');
this.area = this.navParams.get('area'); this.area = this.navParams.get('area');
this.roleName = this.navParams.get('roleName');
} }
ionViewDidLoad() { ionViewDidLoad() {
...@@ -32,11 +37,16 @@ export class ContactListPage { ...@@ -32,11 +37,16 @@ export class ContactListPage {
const data = { const data = {
page: 1, page: 1,
limit: 1000, limit: 1000,
areacode:this.area.code areacode: this.area.code,
role: this.role,
}; };
this.homeSer.getOrgList(data).subscribe( this.homeSer.getOrgList(data).subscribe(
(res) => { (res) => {
this.page.list = res.list.user.filter(e => e.areacode == this.area.code); this.page.list = res.list.user.filter(e => e.orderNum != "" && e.areacode == this.area.code);
this.page.noNumList = res.list.user.filter(e => e.orderNum == "" && e.areacode == this.area.code);
this.page.list.sort((a, b) => a.orderNum - b.orderNum);
console.log(this.page.list);
console.log(this.page.noNumList);
this.page.isLoad = true; this.page.isLoad = true;
} }
) )
......
<ion-header>
<ion-navbar>
<ion-title text-center>
<span>用户角色</span>
</ion-title>
</ion-navbar>
</ion-header>
<ion-content direction="y" scrollbar-y="true">
<ion-list>
<ion-item *ngFor="let item of roleList">
<div class="contact-box" (click)="goToList(item)">
<img src="./assets/imgs/man.png" class="contact-img">
<div class="contact-box-right">
<div>
<span class="contact-name">{{item.label}}</span>
</div>
</div>
</div>
</ion-item>
</ion-list>
</ion-content>
page-contact-role {
.searchToolBar {
display: flex;
flex-direction: row;
align-items: center;
justify-content: left;
box-sizing: border-box;
}
.list-ios .item-block .item-inner {
border-bottom: 1px solid #dadada;
}
.search {
float: right;
color: #72a4fe;
font-size: 24px;
margin-right: 10px;
}
.contact-box {
// height: 100%;
display: flex;
flex-direction: row;
align-items: center;
justify-content: left;
box-sizing: border-box;
}
.contact-box-right {
margin-left: 10px;
}
.contact-img {
width: 4rem;
height: 4rem;
border-radius: 2px;
}
.contact-name {
font-size: 16px;
}
.contact-sex {
font-size: 16px;
font-weight: bold;
}
.male {
color: #72a4fe;
}
.female {
color: #f09ae5;
}
.contact-organization {
color: #808080;
font-size: 12px;
}
.contact-telphone {
color: #808080;
font-size: 12px;
}
.contact-handphone {
color: #808080;
font-size: 12px;
margin-right: 10px;
}
.back-btn {
width: 30px;
height: 30px;
}
}
import {Component} from '@angular/core';
import {IonicPage, NavController, NavParams} from 'ionic-angular';
import {ContactListPage} from "../contact-list/contact-list";
@Component({
selector: 'page-contact-role',
templateUrl: 'contact-role.html',
})
export class ContactRolePage {
roleList = [
{value: 0, label: '管理员'},
{value: 1, label: '单位领导'},
{value: 2, label: '工作人员'},
{value: 3, label: '其他人员'},
];
area;
constructor(public navCtrl: NavController, public navParams: NavParams) {
this.area = this.navParams.get('area');
}
ionViewDidLoad() {
console.log('ionViewDidLoad ContactRolePage');
}
goToList(item) {
this.navCtrl.push(ContactListPage, {role: item.value, area: this.area, roleName: item.label});
}
}
...@@ -5,6 +5,7 @@ import {ContactListPage} from "../contact-list/contact-list"; ...@@ -5,6 +5,7 @@ import {ContactListPage} from "../contact-list/contact-list";
import * as Mock from "mockjs" import * as Mock from "mockjs"
import {HomeService} from "../home.service"; import {HomeService} from "../home.service";
import {LoginService} from "../../login/login.service"; import {LoginService} from "../../login/login.service";
import {ContactRolePage} from "../contact-role/contact-role";
@Component({ @Component({
selector: 'page-contact', selector: 'page-contact',
...@@ -43,7 +44,7 @@ export class ContactPage { ...@@ -43,7 +44,7 @@ export class ContactPage {
//人员列表 //人员列表
goToList(area) { goToList(area) {
this.navCtrl.push(ContactListPage, {area: area}); this.navCtrl.push(ContactRolePage, {area: area});
} }
//查询人员 //查询人员
......
...@@ -12,6 +12,7 @@ import {InfoDetailPage} from "./report-info/info-detail/info-detail"; ...@@ -12,6 +12,7 @@ import {InfoDetailPage} from "./report-info/info-detail/info-detail";
import {InfoListPage} from "./report-info/info-list/info-list"; import {InfoListPage} from "./report-info/info-list/info-list";
import {YearReportPage} from "./report-info/year-report/year-report"; import {YearReportPage} from "./report-info/year-report/year-report";
import {PipesModule} from "../../pipes/pipes.module"; import {PipesModule} from "../../pipes/pipes.module";
import {ContactRolePage} from "./contact-role/contact-role";
@NgModule({ @NgModule({
declarations: [ declarations: [
...@@ -25,6 +26,7 @@ import {PipesModule} from "../../pipes/pipes.module"; ...@@ -25,6 +26,7 @@ import {PipesModule} from "../../pipes/pipes.module";
InfoDetailPage, InfoDetailPage,
InfoListPage, InfoListPage,
YearReportPage, YearReportPage,
ContactRolePage,
], ],
imports: [ imports: [
IonicPageModule.forChild(HomePage), IonicPageModule.forChild(HomePage),
...@@ -40,6 +42,7 @@ import {PipesModule} from "../../pipes/pipes.module"; ...@@ -40,6 +42,7 @@ import {PipesModule} from "../../pipes/pipes.module";
DoVerityPage, DoVerityPage,
InfoDetailPage, InfoDetailPage,
InfoListPage, InfoListPage,
ContactRolePage,
YearReportPage, YearReportPage,
] ]
}) })
......
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