Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
import {Component} from '@angular/core';
import {IonicPage, ModalController, NavController, NavParams, ToastController} from 'ionic-angular';
import {AppGlobal, AppService} from "../../../service/http.service";
import {ContactModalPage} from "../contact-modal/contact-modal";
import {PersonListPage} from "../person-list/person-list";
import {message} from "../../../app/main";
@IonicPage()
@Component({
selector: 'page-block-list',
templateUrl: 'block-list.html',
})
export class BlockListPage {
orgid;
orgName;
contactPersons;
picture: string = AppGlobal.picture;
constructor(public navCtrl: NavController, public navParams: NavParams,
public appService: AppService, public modalCtrl: ModalController,
public toastCtrl: ToastController) {
}
ionViewDidLoad() {
this.orgid = this.navParams.get("orgid");
this.orgName = this.navParams.get("orgName");
this.initList();
}
initList() {
const data = {
'groupId': this.orgid
}
this.appService.ObserverHttpGetOption('/wisdomgroup/modules/telpBookPerson', data)
.subscribe((res) => {
if (res.json().data) {
this.contactPersons = res.json().data.list;
}
})
}
showPersonModal() {
const toast = this.toastCtrl.create(message);
let peoModal = this.modalCtrl.create(PersonListPage);
peoModal.onDidDismiss(res => {
if (res) {
const data = {
'telpBookPersonList': [{
'telpbookId': this.orgid,
'linkUserid': res.id,
'linkUsername': res.name
}]
};
this.appService.ObserverHttpPostData('/wisdomgroup/modules/telpBook', data)
.subscribe((res) => {
if (res.json().apiResult.errcode == '0') {
toast.setMessage('添加成功');
toast.present();
this.initList();
} else {
toast.setMessage(res.json().apiResult.data);
toast.present();
}
})
}
});
peoModal.present();
}
removeItem(item) {
const data = {
userId: item.id
};
this.appService.ObserverHttpDeteleteData('/wisdomgroup/modules/telpBookPerson/', this.orgid, data)
.subscribe((res) => {
if (res.json().errcode == '0') {
this.initList();
}
})
}
//人员详情
contactPersonInfo(contactPerson) {
this.navCtrl.push("ContractPersoninfoPage", {"id": contactPerson.id});
}
}