|
|
@ -29,7 +29,7 @@ export class PriceListComponent implements OnInit { |
|
|
|
edit = false; |
|
|
|
edit = false; |
|
|
|
|
|
|
|
|
|
|
|
isVisibleGoods = false; |
|
|
|
isVisibleGoods = false; |
|
|
|
|
|
|
|
realPrice = 0; |
|
|
|
goodsArray; |
|
|
|
goodsArray; |
|
|
|
constructor( |
|
|
|
constructor( |
|
|
|
private form: FormBuilder, |
|
|
|
private form: FormBuilder, |
|
|
@ -54,9 +54,12 @@ export class PriceListComponent implements OnInit { |
|
|
|
this.validateForm = this.form.group({ |
|
|
|
this.validateForm = this.form.group({ |
|
|
|
type: [null, [Validators.required]], |
|
|
|
type: [null, [Validators.required]], |
|
|
|
price: [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); |
|
|
|
this.getRequest(true, this.searchForm.value); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -120,6 +123,7 @@ export class PriceListComponent implements OnInit { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
this.validateForm.value.realPrice = this.realPrice; |
|
|
|
if (this.edit) { |
|
|
|
if (this.edit) { |
|
|
|
this.validateForm.value['id'] = this.id; |
|
|
|
this.validateForm.value['id'] = this.id; |
|
|
|
this.recharge.updatePrice(this.validateForm.value, data => { |
|
|
|
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; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|