PD team Edit Changes : ps

This commit is contained in:
venbatechnologies@gmail.com 2018-10-23 16:16:29 +05:30
parent a9ff6cd1ac
commit b709dc1e21
3 changed files with 17 additions and 18 deletions

View File

@ -72,7 +72,7 @@ this._pdTeamService.getAllPdTeamCityMapping()
/** To Display The City Data For City DropDown */
this._masterService.getAllMasterData('CITY').subscribe(
dataresult => {
if (dataresult.status == 200) {
if(dataresult.dataStatus == true){
this.citydatas = dataresult.records;
this.citydatas = this.citydatas.filter(city=>city.isactive == 1 );
}
@ -82,7 +82,7 @@ this._masterService.getAllMasterData('CITY').subscribe(
/** To Display The Entities Data For Entities DropDown */
this._masterService.getAllMasterData('ENTITY').subscribe(
dataresult => {
if (dataresult.status == 200) {
if(dataresult.dataStatus == true){
this.lenderdatas = dataresult.records;
this.lenderdatas = this.lenderdatas.filter(entity=>entity.isactive == 1 );
}
@ -91,7 +91,7 @@ this._masterService.getAllMasterData('ENTITY').subscribe(
/** To Display The Entities Data For Entities DropDown */
this._masterService.getAllMasterData('PRODUCTS').subscribe(
dataresult => {
if (dataresult.status == 200) {
if(dataresult.dataStatus == true) {
this.productdatas = dataresult.records;
this.productdatas = this.productdatas.filter(product=>product.isactive == 1 );
}
@ -100,7 +100,7 @@ this._masterService.getAllMasterData('PRODUCTS').subscribe(
/** To Display The Entities Data For Entities DropDown */
this._masterService.getAllMasterData('CUSTOMERSEGMENT').subscribe(
dataresult => {
if (dataresult.status == 200) {
if(dataresult.dataStatus == true) {
this.customerSegmentdatas = dataresult.records;
this.customerSegmentdatas = this.customerSegmentdatas.filter(segment=>segment.isactive == 1 );
}
@ -145,7 +145,7 @@ onSubmit() {
this._pdTeamService.addPdTeamDetail(this._pdTeamForm.value).subscribe(
dataresult => {
if (dataresult.status == 200) {
if(dataresult.dataStatus == true) {
//this.notifier.notify('success', 'Record Saved Successfully.!');
Swal('Record Saved Successfully.!','success');
this._pdTeamForm.reset();
@ -225,7 +225,8 @@ onChangeCityDatas($event){
if($event.source._selected === true ){
this._pdTeamService.getLenderData(lenderId).subscribe(
dataresult => {
if(dataresult.status == 200) {
if(dataresult.dataStatus == true) {
this.CityValidation = dataresult.records;
}
}, error => this.errorMessage = <any> error);

View File

@ -278,7 +278,7 @@ export class PdTeamEditComponent implements OnInit {
if($event.source._selected === true ){
this._pdTeamService.getLenderData(lenderId).subscribe(
dataresult => {
if(dataresult.status == 200) {
if(dataresult.dataStatus == true){
this.CityValidation = dataresult.records;
}
}, error => this.errorMessage = <any> error);

View File

@ -66,7 +66,6 @@ return this._http.post<any>(this.apiUrl+"savePDTeam", ArrayData)
var ArrayData = { "records": Records }
console.log(ArrayData);
//return this._http.post(this.apiUrl+'savePDTeam',ArrayData)
//return this._http.post('http://localhost/sparqapi/api/savePDTeam',ArrayData)
return this._http.post<any>(this.apiUrl+"savePDTeam", ArrayData)
.pipe(
catchError(this.handleError('role', []))
@ -113,11 +112,11 @@ return this._http.post<any>(this.apiUrl+"savePDTeam", ArrayData)
// }
//To delete PDTeam Mapping Details
deletePDteamCity(id:any){
deletePDteamCity(id:any): Observable<any> {
var ArrayData = { "pdteam_city_id": id};
console.log('service data',ArrayData);
//return this._http.post("http://localhost/sparqapi/api/deletePdTeamMapping",ArrayData).pipe(
return this._http.post<any>(this.apiUrl+"deletePdTeamMapping", ArrayData).pipe(
catchError(this.handleError('role', []))
);
@ -139,29 +138,28 @@ return this._http.post<any>(this.apiUrl+"savePDTeam", ArrayData)
// }
getLenderData(lenderId){
getLenderData(lenderId: any): Observable<any> {
var ArrayData = {"lender_id":lenderId }
//return this._http.post<any>('http://localhost/sparqapi/api/getLender',ArrayData)
return this._http.post(this.apiUrl+"getLender",ArrayData)
.pipe(
catchError(this.handleError('role', []))
)
}
getProductData(TeamId){
getProductData(TeamId: any): Observable<any> {
var ArrayData = {"team_id":TeamId }
//return this._http.post<any>('http://localhost/sparqapi/api/getProduct',ArrayData)
return this._http.post(this.apiUrl+"getProduct",ArrayData)
.pipe(
catchError(this.handleError('role', []))
)
}
getCustomerSegmentData(TeamId){
getCustomerSegmentData(TeamId: any): Observable<any> {
var ArrayData = {"team_id":TeamId }
//return this._http.post<any>('http://localhost/sparqapi/api/getCustomerSegment',ArrayData)
return this._http.post(this.apiUrl+"getCustomerSegment",ArrayData)
.pipe(
catchError(this.handleError('role', []))
@ -202,7 +200,7 @@ return this._http.post<any>(this.apiUrl+"savePDTeam", ArrayData)
)
}
getAllPDTeamWithPDTeamID(Primarykey): Observable<any> {
getAllPDTeamWithPDTeamID(Primarykey: any): Observable<any> {
var pk = { "primary_key":Primarykey }
return this._http.post<any>(this.apiUrl+'getListOfPDTeam',pk)
@ -212,7 +210,7 @@ return this._http.post<any>(this.apiUrl+"savePDTeam", ArrayData)
}
// /** Get All PD Team Child Data using API call Based on Primary Key */
getAllPdTeamMapListWithPK(Primarykey): Observable<any> {
getAllPdTeamMapListWithPK(Primarykey: any): Observable<any> {
var pk = { "primary_key":Primarykey }
//var Primar = Primarykey