webpackJsonp([1],{

/***/ 321:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SearchModule", function() { return SearchModule; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_ionic_angular__ = __webpack_require__(10);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__search_search__ = __webpack_require__(347);
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};



var SearchModule = (function () {
    function SearchModule() {
    }
    SearchModule = __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["I" /* NgModule */])({
            declarations: [
                __WEBPACK_IMPORTED_MODULE_2__search_search__["a" /* SearchPage */],
            ],
            imports: [
                __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["h" /* IonicPageModule */].forChild(__WEBPACK_IMPORTED_MODULE_2__search_search__["a" /* SearchPage */]),
            ],
        })
    ], SearchModule);
    return SearchModule;
}());

//# sourceMappingURL=search.module.js.map

/***/ }),

/***/ 347:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return SearchPage; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_ionic_angular__ = __webpack_require__(10);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__service_appHttpService__ = __webpack_require__(19);
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};



var SearchPage = (function () {
    function SearchPage(navCtrl, navParams, appService) {
        this.navCtrl = navCtrl;
        this.navParams = navParams;
        this.appService = appService;
        //组织部门id
        this.orgId = '';
        this.orgName = '';
        if (!typeof (this.navParams.get("orgid")) == undefined) {
            this.orgId = this.navParams.get("orgid");
        }
        if (!typeof (this.navParams.get("orgName")) == undefined) {
            this.orgName = this.navParams.get("orgName");
        }
    }
    SearchPage.prototype.clearValue = function () {
        this.searchValue = "";
    };
    SearchPage.prototype.searchUser = function () {
        var _this = this;
        console.log("searchValue:" + this.searchValue);
        var nameval = encodeURIComponent(this.searchValue);
        this.appService.ObserverHttpPost("/wisdomgroup/app/getUserByName", { "name": nameval, "orgId": this.orgId })
            .subscribe(function (res) {
            var data = res.json();
            _this.contactPersons = data;
            if (_this.orgId != null && _this.orgId != '') {
                //同组织部门下
                _this.contactPersons.forEach(function (element) {
                    element["orgName"] = _this.orgName;
                    element["hasgeneralpersonsflag"] = false;
                });
            }
            else {
                _this.contactPersons.forEach(function (element) {
                    _this.getOrgName(element["id"], function (result) {
                        element["orgName"] = result["orgName"];
                        element["hasgeneralpersonsflag"] = false;
                    });
                });
            }
        }, function (error) {
            _this.appService.alert('网络异常！');
        });
    };
    //跳转联系人信息页面
    SearchPage.prototype.contactPersonInfo = function (contactPerson) {
        console.log("contactPerson:" + JSON.stringify(contactPerson));
        this.navCtrl.push("ContractPersoninfoPage", { "contactPerson": contactPerson });
    };
    //根据用户id获取部门信息
    SearchPage.prototype.getOrgName = function (id, callback) {
        this.appService.ObserverHttpPost("/wisdomgroup/app/getOrgName", { "userid": id })
            .toPromise()
            .then(function (res) {
            var data = res.json();
            callback(data == null ? "[]" : data);
        })
            .catch(function (error) {
        });
    };
    SearchPage = __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* Component */])({
            selector: 'page-search',template:/*ion-inline-start:"/Users/ben/gitLab-project/wisdom-ces/src/pages/search/search.html"*/'<ion-header>\n\n  <ion-toolbar>\n\n    <div class="searchToolBar">\n\n      <button ion-button clear small navPop style="padding: 0;">\n\n        <img class="back-btn" src="./assets/imgs/back.png" />\n\n      </button>\n\n      <div class="search-header">\n\n        <ion-input type="text" placeholder="按姓名搜索" [(ngModel)]="searchValue" (ionChange)="searchUser()"></ion-input>\n\n        <ion-icon name="close" class="clear" (click)="clearValue()"></ion-icon>\n\n      </div>\n\n    </div>\n\n  </ion-toolbar>\n\n</ion-header>\n\n<ion-content>\n\n  <div class="common">\n\n    联系人\n\n  </div>\n\n  <ion-list>\n\n    <ion-item *ngFor="let contactPerson of contactPersons" (click)="contactPersonInfo(contactPerson)">\n\n      <div class="contact-box">\n\n        <img src="./assets/imgs/man.png" class="contact-img" *ngIf="contactPerson.gender ==\'1\'||contactPerson.gender==null">\n\n        <img src="./assets/imgs/woman.png" class="contact-img" *ngIf="contactPerson.gender ==\'0\'">\n\n\n\n        <div class="contact-box-right">\n\n          <div>\n\n            <span class="contact-name">{{contactPerson.name}}</span>\n\n            <ion-icon name="male" class="contact-sex male" *ngIf="contactPerson.gender ==\'1\'||contactPerson.gender==null"></ion-icon>\n\n            <ion-icon name="female" class="contact-sex female" *ngIf="contactPerson.gender ==\'0\'"></ion-icon>\n\n          </div>\n\n          <div class="contact-organization">{{contactPerson.orgName}}</div>\n\n          <div>\n\n            <span class="contact-telphone">座机：{{contactPerson.telephone}}</span>\n\n            <span class="contact-handphone">手机：{{contactPerson.mobile}}</span>\n\n          </div>\n\n        </div>\n\n      </div>\n\n    </ion-item>\n\n  </ion-list>\n\n</ion-content>'/*ion-inline-end:"/Users/ben/gitLab-project/wisdom-ces/src/pages/search/search.html"*/
        }),
        __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_1_ionic_angular__["j" /* NavController */],
            __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["k" /* NavParams */],
            __WEBPACK_IMPORTED_MODULE_2__service_appHttpService__["b" /* AppService */]])
    ], SearchPage);
    return SearchPage;
}());

//# sourceMappingURL=search.js.map

/***/ })

});
//# sourceMappingURL=1.js.map