pull/1/head
袁野 3 years ago
parent 403e0b34b8
commit 20599242c2
  1. 24
      src/app/admin/recharge-order/price-list/price-list.component.html
  2. 3
      src/app/admin/recharge-order/price-list/price-list.component.ts
  3. 11
      src/app/app-common.module.ts
  4. 1
      src/app/pipes/index.ts
  5. 18
      src/app/pipes/price-show.pipe.ts

@ -19,6 +19,18 @@
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
</div> </div>
<div nz-col nzSpan="8">
<nz-form-item>
<nz-form-label [nzSpan]="6">展示区域</nz-form-label>
<nz-form-control [nzSpan]="16">
<nz-select nzShowSearch nzAllowClear formControlName="showType" nzPlaceHolder="请选择展示区域">
<nz-option nzLabel="小程序" [nzValue]="1"></nz-option>
<nz-option nzLabel="H5" [nzValue]="2"></nz-option>
<nz-option nzLabel="银联" [nzValue]="3"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
</div>
</div> </div>
@ -56,6 +68,7 @@
<tr> <tr>
<th>编号</th> <th>编号</th>
<th>金额类型</th> <th>金额类型</th>
<th>展示区域</th>
<!-- <th>供货商编号</th>--> <!-- <th>供货商编号</th>-->
<!-- <th>商品ID</th>--> <!-- <th>商品ID</th>-->
<th>充值金额</th> <th>充值金额</th>
@ -68,6 +81,7 @@
<tr *ngFor="let data of ajaxTable.data; let i = index"> <tr *ngFor="let data of ajaxTable.data; let i = index">
<td>{{i + 1}}</td> <td>{{i + 1}}</td>
<td>{{data.type | rechargePrice}}</td> <td>{{data.type | rechargePrice}}</td>
<td>{{data.showType | priceShow}}</td>
<!-- <td>{{data.channel}}</td>--> <!-- <td>{{data.channel}}</td>-->
<!-- <td>{{data.goodsId}}</td>--> <!-- <td>{{data.goodsId}}</td>-->
<td>{{data.price}}</td> <td>{{data.price}}</td>
@ -94,6 +108,16 @@
</nz-select> </nz-select>
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
<nz-form-item >
<nz-form-label [nzSpan]="6" nzRequired>展示区域</nz-form-label>
<nz-form-control [nzSpan]="16" nzErrorTip="请选择展示区域!">
<nz-select nzShowSearch nzAllowClear formControlName="showType" nzPlaceHolder="请选择展示区域">
<nz-option nzLabel="小程序" [nzValue]="1"></nz-option>
<nz-option nzLabel="H5" [nzValue]="2"></nz-option>
<nz-option nzLabel="银联" [nzValue]="3"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
<nz-form-item> <nz-form-item>
<nz-form-label [nzSpan]="6" nzRequired>商品排序</nz-form-label> <nz-form-label [nzSpan]="6" nzRequired>商品排序</nz-form-label>
<nz-form-control [nzSpan]="16" nzErrorTip="请输入商品排序!"> <nz-form-control [nzSpan]="16" nzErrorTip="请输入商品排序!">

@ -50,9 +50,11 @@ export class PriceListComponent implements OnInit {
public init(): void { public init(): void {
this.searchForm = this.form.group({ this.searchForm = this.form.group({
type: [null], type: [null],
showType: [null],
}); });
this.validateForm = this.form.group({ this.validateForm = this.form.group({
type: [null, [Validators.required]], type: [null, [Validators.required]],
showType: [null, [Validators.required]],
price: [null, [Validators.required]], price: [null, [Validators.required]],
realPrice: [{value: null, disabled: true}, [Validators.required]], realPrice: [{value: null, disabled: true}, [Validators.required]],
// goodsId: [null, [Validators.required]], // goodsId: [null, [Validators.required]],
@ -126,6 +128,7 @@ export class PriceListComponent implements OnInit {
} }
} }
this.validateForm.value.realPrice = this.validateForm.value.price * this.validateForm.value.discount / 100; this.validateForm.value.realPrice = this.validateForm.value.price * this.validateForm.value.discount / 100;
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 => {

@ -31,11 +31,13 @@ import {
StatusPipe, StatusPipe,
RechargePayTypePipe, RechargePayTypePipe,
RefundSourcePipe, RefundSourcePipe,
RefundStatusPipe RefundStatusPipe,
PreOrderStatusPipe,
ButtonPipe,
DiscountPackageStatusPipe,
PriceShowPipe
} from './pipes'; } from './pipes';
import { PreOrderStatusPipe } from './pipes/order/pre-order-status.pipe';
import { ButtonPipe } from './pipes/commons/button.pipe';
import { DiscountPackageStatusPipe } from './pipes/discount-package-status.pipe';
@ -66,6 +68,7 @@ const PIPES = [
PreOrderStatusPipe, PreOrderStatusPipe,
ButtonPipe, ButtonPipe,
DiscountPackageStatusPipe, DiscountPackageStatusPipe,
PriceShowPipe,
]; ];

@ -23,3 +23,4 @@ export * from './audit/refund-status.pipe';
export * from './order/pre-order-status.pipe'; export * from './order/pre-order-status.pipe';
export * from './commons/button.pipe'; export * from './commons/button.pipe';
export * from './discount-package-status.pipe'; export * from './discount-package-status.pipe';
export * from './price-show.pipe';

@ -0,0 +1,18 @@
import { Pipe, PipeTransform } from '@angular/core';
@Pipe({
name: 'priceShow'
})
export class PriceShowPipe implements PipeTransform {
transform(value: number): string {
switch (value) {
case 1:
return '小程序';
case 2:
return 'H5';
case 3:
return '银联';
}
}
}
Loading…
Cancel
Save