mirror of
https://github.com/akveo/ngx-admin.git
synced 2025-12-16 15:40:11 +01:00
fix(Billing): Fixing bug billing
This commit is contained in:
parent
42707efc24
commit
311885894f
9 changed files with 183 additions and 104 deletions
|
|
@ -1,7 +1,9 @@
|
||||||
import { Component, Inject, Input } from '@angular/core';
|
import { Component, Inject, Input, ChangeDetectorRef } from '@angular/core';
|
||||||
import { NbWindowRef, NB_WINDOW_CONTEXT } from '@nebular/theme';
|
import { NbWindowRef, NB_WINDOW_CONTEXT } from '@nebular/theme';
|
||||||
import { BillingList } from '../../../@core/data/billing';
|
import { BillingList } from '../../../@core/data/billing';
|
||||||
|
import { ActivatedRoute } from '@angular/router';
|
||||||
import { BillingService } from '../billing.service';
|
import { BillingService } from '../billing.service';
|
||||||
|
import { BillingComponent } from '../billing.component';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ngx-billing-detail',
|
selector: 'ngx-billing-detail',
|
||||||
|
|
@ -11,11 +13,12 @@ import { BillingService } from '../billing.service';
|
||||||
export class BillingDetailComponent {
|
export class BillingDetailComponent {
|
||||||
|
|
||||||
@Input() data: BillingList;
|
@Input() data: BillingList;
|
||||||
constructor(private service: BillingService, public windowRef: NbWindowRef, @Inject(NB_WINDOW_CONTEXT) context) {
|
constructor(private service: BillingService, public windowRef: NbWindowRef, @Inject(NB_WINDOW_CONTEXT) context, private changeDetectorRefs: ChangeDetectorRef) {
|
||||||
if (context != null) {
|
if (context != null) {
|
||||||
this.data = Object.assign({}, context.data);
|
this.data = Object.assign({}, context.data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
private router: ActivatedRoute;
|
||||||
|
|
||||||
onSubmit(){
|
onSubmit(){
|
||||||
console.log('isi json',this.data.billTitle)
|
console.log('isi json',this.data.billTitle)
|
||||||
|
|
@ -24,11 +27,17 @@ export class BillingDetailComponent {
|
||||||
this.data.billTitle = Math.floor(temp)
|
this.data.billTitle = Math.floor(temp)
|
||||||
console.log('after', this.data)
|
console.log('after', this.data)
|
||||||
this.service.postBilling(this.data).subscribe((value) => {
|
this.service.postBilling(this.data).subscribe((value) => {
|
||||||
|
this.changeDetectorRefs.detectChanges()
|
||||||
|
// this.router.routeReuseStrategy.shouldReuseRoute = function () {
|
||||||
|
// return false;
|
||||||
|
// };
|
||||||
|
window.location.reload();
|
||||||
this.close();
|
this.close();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
close() {
|
close() {
|
||||||
|
console.log('masuk')
|
||||||
this.windowRef.close();
|
this.windowRef.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<nb-card>
|
<nb-card>
|
||||||
<nb-card-header>
|
<nb-card-header>
|
||||||
Billing - 90%
|
Billing - 100%
|
||||||
</nb-card-header>
|
</nb-card-header>
|
||||||
|
|
||||||
<nb-card-body>
|
<nb-card-body>
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit, ChangeDetectorRef } from '@angular/core';
|
||||||
import { BillingList } from '../../@core/data/billing';
|
import { BillingList } from '../../@core/data/billing';
|
||||||
import { BillingService } from './billing.service';
|
import { BillingService } from './billing.service';
|
||||||
import { BillingDetailComponent } from './billing-detail/billing-detail.component';
|
import { BillingDetailComponent } from './billing-detail/billing-detail.component';
|
||||||
|
|
@ -10,9 +10,11 @@ import { NbWindowService } from '@nebular/theme';
|
||||||
styleUrls: ['./billing.component.scss'],
|
styleUrls: ['./billing.component.scss'],
|
||||||
})
|
})
|
||||||
export class BillingComponent implements OnInit {
|
export class BillingComponent implements OnInit {
|
||||||
|
|
||||||
settings = {
|
settings = {
|
||||||
mode: 'inline',
|
mode: 'inline',
|
||||||
|
actions: {
|
||||||
|
add: false,
|
||||||
|
},
|
||||||
add: {
|
add: {
|
||||||
addButtonContent: '<i class="nb-plus"></i>',
|
addButtonContent: '<i class="nb-plus"></i>',
|
||||||
createButtonContent: '<i class="nb-checkmark"></i>',
|
createButtonContent: '<i class="nb-checkmark"></i>',
|
||||||
|
|
@ -45,7 +47,9 @@ export class BillingComponent implements OnInit {
|
||||||
|
|
||||||
source: BillingList[] = [];
|
source: BillingList[] = [];
|
||||||
|
|
||||||
constructor(private service: BillingService, private windowService: NbWindowService) {
|
constructor(private service: BillingService, private windowService: NbWindowService, private changeDetectorRefs: ChangeDetectorRef) {
|
||||||
|
console.log('masuk cons')
|
||||||
|
this.initData();
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
|
|
@ -54,7 +58,8 @@ export class BillingComponent implements OnInit {
|
||||||
initData(){
|
initData(){
|
||||||
this.service.getBilling().subscribe((result) => {
|
this.service.getBilling().subscribe((result) => {
|
||||||
this.source = Object.assign([], result);
|
this.source = Object.assign([], result);
|
||||||
console.log('test', result);
|
console.log('hasil', result);
|
||||||
|
this.changeDetectorRefs.detectChanges();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
onCreateConfirm(event) {
|
onCreateConfirm(event) {
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,12 @@
|
||||||
<button type="button" class=".btn" data-toggle="modal" data-target="#myModal">
|
|
||||||
Launch demo modal
|
|
||||||
</button>
|
|
||||||
<nb-card>
|
<nb-card>
|
||||||
<nb-card-header>
|
<nb-card-header>
|
||||||
Service Agreement
|
Service Agreement
|
||||||
</nb-card-header>
|
</nb-card-header>
|
||||||
|
|
||||||
<nb-card-body>
|
<nb-card-body>
|
||||||
<ng2-smart-table [settings]="settings" [source]="source" (deleteConfirm)="onDeleteConfirm($event)">
|
<ng2-smart-table [settings]="settings" [source]="source" (deleteConfirm)="onDeleteConfirm($event)"
|
||||||
|
(createConfirm)="onCreateConfirm($event)" (editConfirm)="onCreateConfirm($event)"
|
||||||
|
(userRowSelect)="openWindowForm($event)">
|
||||||
</ng2-smart-table>
|
</ng2-smart-table>
|
||||||
</nb-card-body>
|
</nb-card-body>
|
||||||
</nb-card>
|
</nb-card>
|
||||||
|
|
@ -69,7 +69,16 @@ export class ServiceAgreementComponent implements OnInit{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
openWindowForm() {
|
openWindowForm(event) {
|
||||||
this.windowService.open(ServiceAgreementDetailComponent, { title: `Service Agreement Detail` });
|
|
||||||
|
// let temp = event.data.billTitle.toString()
|
||||||
|
// event.data.billTitle = temp
|
||||||
|
console.log('data kirim', event.data)
|
||||||
|
this.windowService.open(ServiceAgreementDetailComponent, {
|
||||||
|
title: 'Service Agreement Detail',
|
||||||
|
context: {
|
||||||
|
data: event.data,
|
||||||
|
},
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,16 @@
|
||||||
import { NgModule } from '@angular/core';
|
import { NgModule } from '@angular/core';
|
||||||
import { NbCardModule, NbIconModule, NbInputModule, NbTreeGridModule } from '@nebular/theme';
|
import { NbCardModule
|
||||||
|
, NbIconModule
|
||||||
|
, NbInputModule
|
||||||
|
, NbTreeGridModule
|
||||||
|
, NbButtonModule,
|
||||||
|
NbCheckboxModule,
|
||||||
|
NbRadioModule,
|
||||||
|
NbSelectModule,
|
||||||
|
NbDatepickerModule
|
||||||
|
} from '@nebular/theme';
|
||||||
import { Ng2SmartTableModule } from 'ng2-smart-table';
|
import { Ng2SmartTableModule } from 'ng2-smart-table';
|
||||||
|
import { FormsModule } from '@angular/forms';
|
||||||
import { ThemeModule } from '../../@theme/theme.module';
|
import { ThemeModule } from '../../@theme/theme.module';
|
||||||
import { ServiceAgreementComponent } from './sa.component';
|
import { ServiceAgreementComponent } from './sa.component';
|
||||||
import { ServiceAgreementService } from './sa.service';
|
import { ServiceAgreementService } from './sa.service';
|
||||||
|
|
@ -15,6 +24,12 @@ import { ServiceAgreementDetailComponent } from './service-agreement-detail/serv
|
||||||
NbInputModule,
|
NbInputModule,
|
||||||
ThemeModule,
|
ThemeModule,
|
||||||
Ng2SmartTableModule,
|
Ng2SmartTableModule,
|
||||||
|
NbButtonModule,
|
||||||
|
NbCheckboxModule,
|
||||||
|
NbRadioModule,
|
||||||
|
NbSelectModule,
|
||||||
|
NbDatepickerModule,
|
||||||
|
FormsModule
|
||||||
],
|
],
|
||||||
declarations: [
|
declarations: [
|
||||||
ServiceAgreementComponent,
|
ServiceAgreementComponent,
|
||||||
|
|
@ -22,6 +37,7 @@ import { ServiceAgreementDetailComponent } from './service-agreement-detail/serv
|
||||||
],
|
],
|
||||||
providers: [
|
providers: [
|
||||||
ServiceAgreementService,
|
ServiceAgreementService,
|
||||||
|
ServiceAgreementDetailComponent
|
||||||
],
|
],
|
||||||
entryComponents: [
|
entryComponents: [
|
||||||
ServiceAgreementDetailComponent,
|
ServiceAgreementDetailComponent,
|
||||||
|
|
|
||||||
|
|
@ -4,14 +4,15 @@ import {Observable, throwError} from 'rxjs';
|
||||||
import {map, catchError} from 'rxjs/operators';
|
import {map, catchError} from 'rxjs/operators';
|
||||||
import {HttpErrorResponse} from '@angular/common/http';
|
import {HttpErrorResponse} from '@angular/common/http';
|
||||||
import { ServiceAgreementList } from '../../@core/data/service-agreement';
|
import { ServiceAgreementList } from '../../@core/data/service-agreement';
|
||||||
|
import { DatePipe } from '@angular/common'
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root',
|
providedIn: 'root',
|
||||||
})
|
})
|
||||||
export class ServiceAgreementService {
|
export class ServiceAgreementService {
|
||||||
constructor(private http: HttpClient) {
|
constructor(private http: HttpClient, public datepipe: DatePipe) {
|
||||||
}
|
}
|
||||||
url = 'http://localhost:8011/api/customerStatic/pagingSearchParam?start=0&sort=desc&length=20&column=startTime&customerCode=&customerFullname=&customerBusiness=&payCycle=&isActive=';
|
url = 'http://34.87.6.140:8011/api/customerStatic/pagingSearchParam?start=0&sort=desc&length=20&column=startTime&customerCode=&customerFullname=&customerBusiness=&payCycle=&isActive=';
|
||||||
json;
|
json;
|
||||||
getServiceAgreement(): Observable<any> {
|
getServiceAgreement(): Observable<any> {
|
||||||
const headers = new HttpHeaders({
|
const headers = new HttpHeaders({
|
||||||
|
|
@ -27,6 +28,29 @@ export class ServiceAgreementService {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
postServiceAgreement(data: ServiceAgreementList): Observable<any> {
|
||||||
|
const headers = new HttpHeaders({
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
'X-Requested-Method': 'POST',
|
||||||
|
});
|
||||||
|
console.log('isiiii', data.ebCustomerId)
|
||||||
|
const id = data.ebCustomerId
|
||||||
|
let nextBill_date =this.datepipe.transform(data.nextBillTm, 'yyyy-MM-dd'+'T'+'HH:mm:ss.SSS');
|
||||||
|
let endTime_date =this.datepipe.transform(data.endTime, 'yyyy-MM-dd'+'T'+'HH:mm:ss.SSS');
|
||||||
|
let startTime_date =this.datepipe.transform(data.startTime, 'yyyy-MM-dd'+'T'+'HH:mm:ss.SSS');
|
||||||
|
let modifyTm_date =this.datepipe.transform(data.modifyTm, 'yyyy-MM-dd'+'T'+'HH:mm:ss.SSS');
|
||||||
|
data.nextBillTm = nextBill_date
|
||||||
|
data.endTime = endTime_date
|
||||||
|
data.startTime = startTime_date
|
||||||
|
data.modifyTm = modifyTm_date
|
||||||
|
console.log('isi tanggal' ,data)
|
||||||
|
const options = { headers: headers };
|
||||||
|
const url = 'http://34.87.6.140:8011/api/customerStatic/insertData';
|
||||||
|
return this.http.post(url, JSON.stringify(data) , options).pipe(
|
||||||
|
catchError(this.handleError),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
private extractData(body: any): ServiceAgreementList[] {
|
private extractData(body: any): ServiceAgreementList[] {
|
||||||
// console.log('test', body.serviceAgreementList);
|
// console.log('test', body.serviceAgreementList);
|
||||||
return Object.assign(body.content);
|
return Object.assign(body.content);
|
||||||
|
|
|
||||||
|
|
@ -1,81 +1,87 @@
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-4">
|
<div class="col-md-4">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="exampleInputEmail1" class="label">Partner Code</label>
|
<label class="label">Client</label>
|
||||||
<input nbInput fullWidth id="exampleInputEmail1" [(ngModel)]="data.customerID">
|
<input nbInput fullWidth [(ngModel)]="data.customerCode" disabled>
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="exampleInputPassword1" class="label">User Id</label>
|
|
||||||
<input nbInput fullWidth id="exampleInputPassword1" [(ngModel)]="data.customerID">
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="exampleInputEmail1" class="label">Promo Type</label>
|
|
||||||
<input nbInput fullWidth id="exampleInputEmail1" [(ngModel)]="data.promotionType">
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="exampleInputPassword1" class="label">Periode </label>
|
|
||||||
<input nbInput fullWidth id="exampleInputPassword1" [(ngModel)]="data.validDay">
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="exampleInputEmail1" class="label">Coupon Code</label>
|
|
||||||
<input nbInput fullWidth id="exampleInputEmail1" [(ngModel)]="data.code">
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="exampleInputPassword1" class="label">Valid Start</label>
|
|
||||||
<input nbInput fullWidth id="exampleInputPassword1" [(ngModel)]="data.validFrom">
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-4">
|
<div class="form-group">
|
||||||
<div class="form-group">
|
<label class="label">Partner Code</label>
|
||||||
<label for="exampleInputPassword1" class="label">Valid End</label>
|
<input nbInput fullWidth [(ngModel)]="data.customerCode" disabled>
|
||||||
<input nbInput fullWidth id="exampleInputPassword1" [(ngModel)]="data.validTo">
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="exampleInputPassword1" class="label">Promo</label>
|
|
||||||
<input nbInput fullWidth id="exampleInputPassword1" [(ngModel)]="data.value">
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="exampleInputEmail1" class="label">Max. Promo</label>
|
|
||||||
<input nbInput fullWidth id="exampleInputEmail1" [(ngModel)]="data.maximumDiscount">
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="exampleInputEmail1" class="label">Quota per User</label>
|
|
||||||
<input nbInput fullWidth id="exampleInputEmail1" [(ngModel)]="data.maximumPerUser">
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="exampleInputPassword1" class="label">User Type</label>
|
|
||||||
<input nbInput fullWidth id="exampleInputPassword1" [(ngModel)]="data.customerType">
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="exampleInputPassword1" class="label">Coverage Pickup</label>
|
|
||||||
<input nbInput fullWidth id="exampleInputPassword1" [(ngModel)]="data.coverage">
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="label">Partner Name</label>
|
||||||
|
<input nbInput fullWidth [(ngModel)]="data.customerFullname">
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="label">Partner Short Name </label>
|
||||||
|
<input nbInput fullWidth [(ngModel)]="data.customerShortname">
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="label">Start Time</label>
|
||||||
|
<input nbInput
|
||||||
|
placeholder="Select Date"
|
||||||
|
[nbDatepicker]="formpickerstart"
|
||||||
|
[(ngModel)]="data.startTime">
|
||||||
|
<nb-datepicker #formpickerstart></nb-datepicker>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="label">End Time</label>
|
||||||
|
<input nbInput
|
||||||
|
placeholder="Select Date"
|
||||||
|
[nbDatepicker]="formpickerend"
|
||||||
|
[(ngModel)]="data.endTime">
|
||||||
|
<nb-datepicker #formpickerend></nb-datepicker>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-4">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="label">Bill Title</label>
|
||||||
|
<nb-card-body>
|
||||||
|
<nb-select [(selected)]="data.billTitle">
|
||||||
|
<nb-option value="1">Invoice</nb-option>
|
||||||
|
<nb-option value="2">Debit Note</nb-option>
|
||||||
|
<nb-option value="3">Surat Perintah Penagihan</nb-option>
|
||||||
|
</nb-select>
|
||||||
|
</nb-card-body>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="label">Bill Code</label>
|
||||||
|
<input nbInput fullWidth [(ngModel)]="data.billCode">
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="label">Next Billing Time</label>
|
||||||
|
<input nbInput
|
||||||
|
placeholder="Select Date"
|
||||||
|
[nbDatepicker]="formpickernextbilling"
|
||||||
|
[(ngModel)]="data.nextBillTm">
|
||||||
|
<nb-datepicker #formpickernextbilling></nb-datepicker>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="label">Tax</label>
|
||||||
|
<nb-radio-group [(value)]="data.tax">
|
||||||
|
<nb-radio
|
||||||
|
[value]="1">
|
||||||
|
Exclude
|
||||||
|
</nb-radio>
|
||||||
|
<nb-radio
|
||||||
|
[value]="2">
|
||||||
|
Include
|
||||||
|
</nb-radio>
|
||||||
|
</nb-radio-group>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="label">VAT</label>
|
||||||
|
<input nbInput [(ngModel)]="data.vat"> %
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="label">Insurance</label>
|
||||||
|
Rp.<input nbInput [(ngModel)]="data.price">
|
||||||
|
<input nbInput fullWidth [(ngModel)]="data.percentage">%
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group row">
|
||||||
<div class="col-md-4">
|
<div class="col-md-4">
|
||||||
<div class="form-group">
|
|
||||||
<label for="exampleInputPassword1" class="label">Product</label>
|
|
||||||
<input nbInput fullWidth id="exampleInputPassword1" [(ngModel)]="data.product">
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="exampleInputPassword1" class="label">Promo (IDR)</label>
|
|
||||||
<input nbInput fullWidth id="exampleInputPassword1" [(ngModel)]="data.value">
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="exampleInputPassword1" class="label">Promo (%)</label>
|
|
||||||
<input nbInput fullWidth id="exampleInputPassword1" [(ngModel)]="data.value">
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="exampleInputPassword1" class="label">Max. Promo</label>
|
|
||||||
<input nbInput fullWidth id="exampleInputPassword1" [(ngModel)]="data.maximumDiscountValue">
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="exampleInputPassword1" class="label">Budget</label>
|
|
||||||
<input nbInput fullWidth id="exampleInputPassword1" [(ngModel)]="data.maximumDiscount">
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="exampleInputPassword1" class="label">Quota</label>
|
|
||||||
<input nbInput fullWidth id="exampleInputPassword1" [(ngModel)]="data.quota">
|
|
||||||
</div>
|
|
||||||
<button (click)="onSubmit()" type="submit" nbButton status="primary">Submit</button>
|
<button (click)="onSubmit()" type="submit" nbButton status="primary">Submit</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
@ -1,20 +1,31 @@
|
||||||
import { Component } from '@angular/core';
|
import { Component, Inject, Input, ChangeDetectorRef } from '@angular/core';
|
||||||
import { NbWindowRef } from '@nebular/theme';
|
import { NbWindowRef, NB_WINDOW_CONTEXT } from '@nebular/theme';
|
||||||
|
import { ServiceAgreementList } from '../../../@core/data/service-agreement';
|
||||||
|
import { ServiceAgreementService } from '../sa.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
template: `
|
selector: 'ngx-service-agreement-detail',
|
||||||
<form class="form">
|
templateUrl: './service-agreement-detail.component.html',
|
||||||
<label for="subject">Subject:</label>
|
|
||||||
<input nbInput id="subject" type="text">
|
|
||||||
|
|
||||||
<label class="text-label" for="text">Text:</label>
|
|
||||||
<textarea nbInput id="text"></textarea>
|
|
||||||
</form>
|
|
||||||
`,
|
|
||||||
styleUrls: ['service-agreement-detail.component.scss'],
|
styleUrls: ['service-agreement-detail.component.scss'],
|
||||||
})
|
})
|
||||||
export class ServiceAgreementDetailComponent {
|
export class ServiceAgreementDetailComponent {
|
||||||
constructor(public windowRef: NbWindowRef) {}
|
@Input() data: ServiceAgreementList;
|
||||||
|
constructor(private service: ServiceAgreementService, public windowRef: NbWindowRef, @Inject(NB_WINDOW_CONTEXT) context) {
|
||||||
|
if (context != null) {
|
||||||
|
this.data = Object.assign({}, context.data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
onSubmit(){
|
||||||
|
// console.log('isi json',this.data.billTitle)
|
||||||
|
// let temp = this.data.billTitle
|
||||||
|
// this.data.state = 'updated'
|
||||||
|
// this.data.billTitle = Math.floor(temp)
|
||||||
|
// console.log('after', this.data)
|
||||||
|
this.service.postServiceAgreement(this.data).subscribe((value) => {
|
||||||
|
//this.changeDetectorRefs.detectChanges()
|
||||||
|
this.close();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
close() {
|
close() {
|
||||||
this.windowRef.close();
|
this.windowRef.close();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue