mirror of
https://github.com/akveo/ngx-admin.git
synced 2025-12-18 08:20:13 +01:00
add partner price new
This commit is contained in:
parent
16280a1d04
commit
cdf458488a
8 changed files with 83 additions and 3 deletions
1
src/app/@core/data/partner-price-new.ts
Normal file
1
src/app/@core/data/partner-price-new.ts
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
export interface PartnerPriceNew { lovCode: string, lovName: string }
|
||||||
|
|
@ -0,0 +1,13 @@
|
||||||
|
<div class="form-group row">
|
||||||
|
<label for="inputEmail1" class="label col-sm-3 col-form-label">Partner</label>
|
||||||
|
<nb-select *ngIf="items">
|
||||||
|
<ng-container *ngFor="let item of items">
|
||||||
|
<nb-option>{{ item }}</nb-option>
|
||||||
|
</ng-container>
|
||||||
|
</nb-select>
|
||||||
|
</div>
|
||||||
|
<div class="form-group row">
|
||||||
|
<div class="offset-sm-3 col-sm-9">
|
||||||
|
<button type="submit" nbButton status="primary">Submit</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
nb-checkbox {
|
||||||
|
margin-bottom: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-inline [fullWidth] {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-inline > * {
|
||||||
|
margin: 0 1.5rem 1.5rem 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
nb-card.inline-form-card nb-card-body {
|
||||||
|
padding-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,28 @@
|
||||||
|
import { Component, OnInit } from '@angular/core';
|
||||||
|
import { PartnerPriceService } from '../partner-price.service';
|
||||||
|
import { PartnerPriceNew } from '../../../@core/data/partner-price-new';
|
||||||
|
import { NbWindowRef } from '@nebular/theme';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'ngx-partner-price-new',
|
||||||
|
styleUrls: ['./partner-price-new.component.scss'],
|
||||||
|
templateUrl: './partner-price-new.component.html',
|
||||||
|
})
|
||||||
|
export class PartnerPriceNewComponent implements OnInit {
|
||||||
|
|
||||||
|
items: PartnerPriceNew[] = []
|
||||||
|
|
||||||
|
constructor(private service: PartnerPriceService, public windowRef: NbWindowRef ) {
|
||||||
|
}
|
||||||
|
|
||||||
|
ngOnInit(): void {
|
||||||
|
this.getData();
|
||||||
|
}
|
||||||
|
|
||||||
|
getData() {
|
||||||
|
this.service.getNewPrtnerPriceParam().subscribe((result) => {
|
||||||
|
this.items = Object.assign([], result);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -3,6 +3,7 @@ import { PartnerPriceService } from './partner-price.service';
|
||||||
import { PartnerPriceDetailComponent } from './partner-price-detail/partner-price-detail.component';
|
import { PartnerPriceDetailComponent } from './partner-price-detail/partner-price-detail.component';
|
||||||
import { NbWindowService } from '@nebular/theme';
|
import { NbWindowService } from '@nebular/theme';
|
||||||
import { PartnerPrice } from '../../@core/data/partner-price';
|
import { PartnerPrice } from '../../@core/data/partner-price';
|
||||||
|
import { PartnerPriceNewComponent } from './partner-price-new/partner-price-new.component';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ngx-partner-price',
|
selector: 'ngx-partner-price',
|
||||||
|
|
@ -97,8 +98,9 @@ export class PartnerPriceComponent implements OnInit {
|
||||||
}
|
}
|
||||||
|
|
||||||
openCreateDialog(event) {
|
openCreateDialog(event) {
|
||||||
|
this.windowService.open(PartnerPriceNewComponent, {
|
||||||
//logic
|
title: 'Add Partner Price',
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
openWindowForm(event) {
|
openWindowForm(event) {
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,8 @@ import {
|
||||||
NbTreeGridModule,
|
NbTreeGridModule,
|
||||||
NbButtonModule,
|
NbButtonModule,
|
||||||
NbCheckboxModule,
|
NbCheckboxModule,
|
||||||
NbRadioModule} from '@nebular/theme';
|
NbRadioModule,
|
||||||
|
NbSelectModule} from '@nebular/theme';
|
||||||
import { Ng2SmartTableModule } from 'ng2-smart-table';
|
import { Ng2SmartTableModule } from 'ng2-smart-table';
|
||||||
|
|
||||||
import { ThemeModule } from '../../@theme/theme.module';
|
import { ThemeModule } from '../../@theme/theme.module';
|
||||||
|
|
@ -14,6 +15,7 @@ import { PartnerPriceComponent } from './partner-price.component';
|
||||||
import { PartnerPriceService } from './partner-price.service';
|
import { PartnerPriceService } from './partner-price.service';
|
||||||
import { PartnerPriceDetailComponent } from './partner-price-detail/partner-price-detail.component';
|
import { PartnerPriceDetailComponent } from './partner-price-detail/partner-price-detail.component';
|
||||||
import { FormsModule } from '@angular/forms';
|
import { FormsModule } from '@angular/forms';
|
||||||
|
import { PartnerPriceNewComponent } from './partner-price-new/partner-price-new.component';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
|
|
@ -27,17 +29,21 @@ import { FormsModule } from '@angular/forms';
|
||||||
NbCheckboxModule,
|
NbCheckboxModule,
|
||||||
Ng2SmartTableModule,
|
Ng2SmartTableModule,
|
||||||
FormsModule,
|
FormsModule,
|
||||||
|
NbSelectModule,
|
||||||
],
|
],
|
||||||
declarations: [
|
declarations: [
|
||||||
PartnerPriceComponent,
|
PartnerPriceComponent,
|
||||||
PartnerPriceDetailComponent,
|
PartnerPriceDetailComponent,
|
||||||
|
PartnerPriceNewComponent,
|
||||||
],
|
],
|
||||||
providers: [
|
providers: [
|
||||||
PartnerPriceService,
|
PartnerPriceService,
|
||||||
PartnerPriceDetailComponent,
|
PartnerPriceDetailComponent,
|
||||||
|
PartnerPriceNewComponent,
|
||||||
],
|
],
|
||||||
entryComponents: [
|
entryComponents: [
|
||||||
PartnerPriceDetailComponent,
|
PartnerPriceDetailComponent,
|
||||||
|
PartnerPriceNewComponent,
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
export class PromotionModule { }
|
export class PromotionModule { }
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ import { HttpErrorResponse } from '@angular/common/http';
|
||||||
import { PromotionList } from '../../@core/data/promotion';
|
import { PromotionList } from '../../@core/data/promotion';
|
||||||
import { PartnerPrice } from '../../@core/data/partner-price';
|
import { PartnerPrice } from '../../@core/data/partner-price';
|
||||||
import { PartnerPriceDetail } from '../../@core/data/partner-price-detail';
|
import { PartnerPriceDetail } from '../../@core/data/partner-price-detail';
|
||||||
|
import { PartnerPriceNew } from '../../@core/data/partner-price-new';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root',
|
providedIn: 'root',
|
||||||
|
|
@ -30,6 +31,14 @@ export class PartnerPriceService {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getNewPrtnerPriceParam(): Observable<any>{
|
||||||
|
const url = 'http://34.87.6.140:8011/api/lov/getCustomerInput';
|
||||||
|
return this.http.post(url, null).pipe(
|
||||||
|
map(this.extractData),
|
||||||
|
catchError(this.handleError),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
// postPromotion(data: PromotionList): Observable<any> {
|
// postPromotion(data: PromotionList): Observable<any> {
|
||||||
// const headers = new HttpHeaders({
|
// const headers = new HttpHeaders({
|
||||||
// 'Content-Type': 'application/json',
|
// 'Content-Type': 'application/json',
|
||||||
|
|
@ -50,6 +59,11 @@ export class PartnerPriceService {
|
||||||
return Object.assign(body.content);
|
return Object.assign(body.content);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private extractDataParamNew(body: any): PartnerPriceNew[] {
|
||||||
|
return Object.assign(body.content);
|
||||||
|
}
|
||||||
|
|
||||||
private handleError(error: HttpErrorResponse | any) {
|
private handleError(error: HttpErrorResponse | any) {
|
||||||
let errMsg: string;
|
let errMsg: string;
|
||||||
let errObj: any;
|
let errObj: any;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue