Merge remote-tracking branch 'origin/ymt-dev' into 2.0-dev

2.0-dev
袁野 1 year ago
commit aec90b3f41
  1. 66
      src/app/admin/coupon/blx-coupon/blx-coupon.component.html
  2. 6
      src/app/admin/coupon/blx-coupon/blx-coupon.component.scss
  3. 61
      src/app/admin/coupon/blx-coupon/blx-coupon.component.ts
  4. 2
      src/app/admin/coupon/coupon-routing.module.ts
  5. 4
      src/app/admin/coupon/coupon.module.ts
  6. 5
      src/app/app-common.module.ts
  7. 37
      src/app/pipes/coupon-status.pipe.ts
  8. 11
      src/app/services/coupon.service.ts

@ -0,0 +1,66 @@
<!-- start 面包屑 -->
<app-breadcrumb></app-breadcrumb>
<!-- end 面包屑 -->
<div class="inner-content">
<span>共计 {{total}} 条数据</span>
<!-- <div class="operating-button">
<button nz-button nzType="primary" class="right-btn" [routerLink]="['/admin/coupon/coupon-edit']" ><i nz-icon nzType="plus" nzTheme="outline"></i>添加</button>
<button nz-button nzType="primary" class="right-btn" (click)="getGuizhouSinopec()" ><i nz-icon nzType="redo" nzTheme="outline"></i>刷新中石化卡券</button>
</div> -->
<nz-table
class="table"
#ajaxTable
nzShowSizeChanger
[nzFrontPagination]="false"
[nzData]="requestData"
[nzLoading]="loading"
[nzTotal]="total"
[(nzPageIndex)]="pageNum"
[(nzPageSize)]="pageSize"
(nzPageIndexChange)="getRequest(false , searchForm.value)"
(nzPageSizeChange)="getRequest(false , searchForm.value)">
<thead nzSingleSort>
<tr>
<th nzWidth="80px">编号</th>
<th >优惠券编码</th>
<th >优惠券名称</th>
<th >面额</th>
<!-- <th nzWidth="100px">使用条件</th>
<th nzWidth="100px">有效类型</th>
<th nzWidth="100px">使用开始时间</th>
<th nzWidth="100px">使用结束时间</th>
<th nzWidth="100px">有效天数</th> -->
<th >优惠券状态</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let data of ajaxTable.data; let i = index">
<td>{{i+1}}</td>
<td>{{data.couponCode}}</td>
<td>{{data.couponName}}</td>
<td>{{data.denomination}}</td>
<!-- <td>{{data.minPrice}}</td>
<td>{{data.receiveType | receiveType}}</td>
<td>{{(data.useStartTime | date: 'yyyy-MM-dd HH:mm') || '暂无数据'}}</td>
<td>{{(data.useEndTime | date: 'yyyy-MM-dd HH:mm') || '暂无数据'}}</td>
<td>{{data.receiveDays}}</td> -->
<td >{{data.couponStatus | blxCouponStatus}}</td>
<!-- <td >
<span *ngIf="data.status === 2" style="color: limegreen">{{data.status | couponStatus}}</span>
<span *ngIf="data.status === 3" style="color: red">{{data.status | couponStatus}}</span>
<span *ngIf="data.status === 1 || data.status === 102 || data.status === 101">{{data.status | couponStatus}}</span>
</td> -->
</tr>
</tbody>
</nz-table>
</div>

@ -0,0 +1,6 @@
img {
width: 60px;
}
.fontColor {
color: red;
}

@ -0,0 +1,61 @@
import { Component, OnInit } from '@angular/core';
import { CouponService } from '../../../services/coupon.service';
import {CommonsService} from '../../../services/commons.service';
import { FormBuilder, FormGroup } from '@angular/forms';
import {NzMessageService} from 'ng-zorro-antd';
@Component({
selector: 'app-blx-coupon',
templateUrl: './blx-coupon.component.html',
styleUrls: ['./blx-coupon.component.scss']
})
export class BlxCouponComponent implements OnInit {
searchForm: FormGroup; // 搜索框
requestData = []; // 列表数据
total: number = 0; // 总计条数
pageNum = 1; // 页码
pageSize = 10; // 条码
loading = false;
constructor(
private form: FormBuilder,
private coupon: CouponService,
private message: NzMessageService,
) { }
ngOnInit() {
this.searchForm = this.form.group({
// merchantId: [null],
// couponName: [null],
// couponType: [null],
// goodsTypeId: [null],
// brandId: [null],
// displayArea: [null],
// status: [null],
});
this.getRequest(true,this.searchForm.value)
}
// 查询列表
public getRequest(reset: boolean = false, whereObject: object) {
this.loading = true;
if (reset) {
this.pageNum = 1;
}
whereObject['pageNum'] = this.pageNum;
whereObject['pageSize'] = this.pageSize;
this.coupon.getBlxCouponList(whereObject, data => {
this.loading = false;
if (data['return_code'] === '000000') {
this.requestData = data['return_data'].list;
this.total = data['return_data'].total;
} else {
this.message.error(data['return_msg']);
}
});
}
}

@ -4,6 +4,7 @@ import {CouponListComponent} from './coupon-list/coupon-list.component';
import {CouponEditComponent} from './coupon-edit/coupon-edit.component';
import {CouponDetailComponent} from './coupon-detail/coupon-detail.component';
import {SalesCodeListComponent} from './sales-code-list/sales-code-list.component';
import { BlxCouponComponent } from './blx-coupon/blx-coupon.component';
const routes: Routes = [
@ -11,6 +12,7 @@ const routes: Routes = [
{ path: 'coupon-edit', component: CouponEditComponent },
{ path: 'coupon-detail', component: CouponDetailComponent },
{ path: 'salesCode-list', component: SalesCodeListComponent },
{path:'blx-coupon',component:BlxCouponComponent}
];
@NgModule({

@ -12,9 +12,11 @@ import {BreadcrumbModule} from '../../common/breadcrumb/breadcrumb.module';
import {RichtextModule} from '../../common/richtext/richtext.module';
import {AppCommonModule} from '../../app-common.module';
import { SalesCodeListComponent } from './sales-code-list/sales-code-list.component';
import { BlxCouponComponent } from './blx-coupon/blx-coupon.component';
@NgModule({
declarations: [CouponListComponent, CouponEditComponent, CouponDetailComponent, SalesCodeListComponent],
declarations: [CouponListComponent, CouponEditComponent, CouponDetailComponent, SalesCodeListComponent,
BlxCouponComponent],
imports: [
CommonModule,
CouponRoutingModule,

@ -73,6 +73,9 @@ import {
PayCouponStatusPipe,
OrderOilChannelTypePipe,
VerifyProductTypePipe,
BlxCouponStatusPipe,
ReceiveTypePipe,
} from './pipes';
import {MsgTypePipe} from './pipes/msg/msg-type.pipe';
import { OrderProductTypePipe } from './pipes/order/order-product-type.pipe';
@ -149,6 +152,8 @@ const PIPES = [
MsgTypePipe,
OrderOilChannelTypePipe,
VerifyProductTypePipe,
BlxCouponStatusPipe,
ReceiveTypePipe,
LogisticsStatusPipe,
OrderProductTypePipe,
GoodsStatusPipe

@ -22,3 +22,40 @@ export class CouponStatusPipe implements PipeTransform {
}
}
}
@Pipe({
name: 'blxCouponStatus'
})
export class BlxCouponStatusPipe implements PipeTransform {
transform(value: number): string {
switch (value) {
case 0:
return '待审核';
case 1:
return '审核通过';
case 2:
return '强制结束';
}
}
}
@Pipe({
name: 'receiveType'
})
export class ReceiveTypePipe implements PipeTransform {
transform(value: number): string {
switch (value) {
case 1:
return '天数';
case 2:
return '时间段';
case null:
return '暂无数据';
}
}
}

@ -168,4 +168,15 @@ export class CouponService {
});
}
/*
*/
public getBlxCouponList(params: object, callBack) {
this.http.get(environment.baseUrl + 'apiCoupon/getBlxCouponList?'+ this.common.getWhereCondition(params)).subscribe(data => {
callBack(data);
});
}
}

Loading…
Cancel
Save