diff --git a/src/app/admin/recharge-order/price-list/price-list.component.html b/src/app/admin/recharge-order/price-list/price-list.component.html index 0b903a4..ae6da51 100644 --- a/src/app/admin/recharge-order/price-list/price-list.component.html +++ b/src/app/admin/recharge-order/price-list/price-list.component.html @@ -56,6 +56,7 @@ 编号 金额类型 + 商品ID 充值金额 支付金额 创建时间 @@ -66,6 +67,7 @@ {{i + 1}} {{data.type | rechargePrice}} + {{data.goodsId}} {{data.price}} {{data.realPrice}} {{data.createTime | date: 'yyyy-MM-dd HH:mm'}} @@ -89,16 +91,34 @@ + + 商品ID + + + + 充值金额 - + + + + + + + 折扣比例 + + + + 支付金额 - + + + diff --git a/src/app/admin/recharge-order/price-list/price-list.component.ts b/src/app/admin/recharge-order/price-list/price-list.component.ts index a41a91a..d3b8bc5 100644 --- a/src/app/admin/recharge-order/price-list/price-list.component.ts +++ b/src/app/admin/recharge-order/price-list/price-list.component.ts @@ -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; + } + }