|
|
|
@ -29,7 +29,7 @@ export class PriceListComponent implements OnInit { |
|
|
|
|
edit = false; |
|
|
|
|
|
|
|
|
|
isVisibleGoods = false; |
|
|
|
|
|
|
|
|
|
realPrice = 0; |
|
|
|
|
goodsArray; |
|
|
|
|
constructor( |
|
|
|
|
private form: FormBuilder, |
|
|
|
@ -54,9 +54,12 @@ export class PriceListComponent implements OnInit { |
|
|
|
|
this.validateForm = this.form.group({ |
|
|
|
|
type: [null, [Validators.required]], |
|
|
|
|
price: [null, [Validators.required]], |
|
|
|
|
realPrice: [null, [Validators.required]], |
|
|
|
|
realPrice: [{value: null, disabled: true}, [Validators.required]], |
|
|
|
|
goodsId: [null, [Validators.required]], |
|
|
|
|
discount: [null, [Validators.required]], |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.getRequest(true, this.searchForm.value); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -120,6 +123,7 @@ export class PriceListComponent implements OnInit { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
this.validateForm.value.realPrice = this.realPrice; |
|
|
|
|
if (this.edit) { |
|
|
|
|
this.validateForm.value['id'] = this.id; |
|
|
|
|
this.recharge.updatePrice(this.validateForm.value, data => { |
|
|
|
@ -175,4 +179,8 @@ export class PriceListComponent implements OnInit { |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public getPrice(): void { |
|
|
|
|
this.realPrice = this.validateForm.value.price * this.validateForm.value.discount / 100; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|