提交代码

pull/1/head
胡锐 3 years ago
parent cf5d1c0a4d
commit 7e77d7d84c
  1. 137
      src/app/admin/order/discount-use-condition-list/discount-use-condition-list.component.html
  2. 0
      src/app/admin/order/discount-use-condition-list/discount-use-condition-list.component.scss
  3. 25
      src/app/admin/order/discount-use-condition-list/discount-use-condition-list.component.spec.ts
  4. 113
      src/app/admin/order/discount-use-condition-list/discount-use-condition-list.component.ts
  5. 5
      src/app/admin/order/order-coupons/order-coupons.component.html
  6. 4
      src/app/admin/order/order-routing.module.ts
  7. 7
      src/app/admin/order/order.module.ts
  8. 2
      src/app/pipes/discount-code-status.pipe.ts
  9. 12
      src/app/services/discount.service.ts

@ -0,0 +1,137 @@
<!-- start 面包屑 -->
<app-breadcrumb></app-breadcrumb>
<!-- end 面包屑 -->
<!--条件搜索-->
<div class="inner-content">
<form nz-form [formGroup]="searchForm" (ngSubmit)="search(searchForm.value)">
<div nz-row>
<div nz-col nzSpan="8">
<nz-form-item>
<nz-form-label [nzSpan]="8">优惠券</nz-form-label>
<nz-form-control [nzSpan]="14">
<nz-select nzAllowClear formControlName="discountId">
<nz-option *ngFor="let item of discountArray" nzLabel="{{item['highDiscount'].discountName}}" nzValue="{{item['highDiscount'].id}}"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col nzSpan="8">
<nz-form-item>
<nz-form-label [nzSpan]="8">状态</nz-form-label>
<nz-form-control [nzSpan]="14">
<nz-select nzAllowClear formControlName="status">
<nz-option nzLabel="待领取" nzValue="1"></nz-option>
<nz-option nzLabel="待使用" nzValue="2"></nz-option>
<nz-option nzLabel="已使用" nzValue="3"></nz-option>
<nz-option nzLabel="已过期" nzValue="4"></nz-option>
<nz-option nzLabel="已分配" nzValue="5"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col nzSpan="8">
<nz-form-item>
<nz-form-label [nzSpan]="8">使用门店</nz-form-label>
<nz-form-control [nzSpan]="14">
<input nz-input formControlName="storeName" />
</nz-form-control>
</nz-form-item>
</div>
<div nz-col nzSpan="8">
<nz-form-item>
<nz-form-label [nzSpan]="8">领取时间</nz-form-label>
<nz-form-control [nzSpan]="14">
<nz-range-picker
formControlName="receiveTime"
[nzShowTime]="{ nzHideDisabledOptions: true}"
nzFormat="yyyy-MM-dd HH:mm:ss"
></nz-range-picker>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col nzSpan="8">
<nz-form-item>
<nz-form-label [nzSpan]="8">使用时间</nz-form-label>
<nz-form-control [nzSpan]="14">
<nz-range-picker
formControlName="useTime"
[nzShowTime]="{ nzHideDisabledOptions: true}"
nzFormat="yyyy-MM-dd HH:mm:ss"
></nz-range-picker>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col nzSpan="8">
<nz-form-item>
<nz-form-label [nzSpan]="8">编码范围</nz-form-label>
<nz-form-control [nzSpan]="14">
<nz-space>
<nz-space-item>
<nz-input-number formControlName="idS" [nzPlaceHolder]="'开始'" [nzMin]="1" [nzStep]="1"></nz-input-number>
</nz-space-item>
<nz-space-item>
<nz-input-number formControlName="idE" [nzPlaceHolder]="'结束'" [nzMin]="1" [nzStep]="1"></nz-input-number>
</nz-space-item>
</nz-space>
</nz-form-control>
</nz-form-item>
</div>
</div>
<div nz-row>
<div nz-col nzSpan="24" class="search-button">
<button nz-button nzType="primary"><i nz-icon nzType="search" nzTheme="outline"></i>搜索</button>
<button nz-button nzType="default" (click)="resetForm()"><i nz-icon nzType="reload" nzTheme="outline"></i>重置</button>
</div>
</div>
</form>
</div>
<div class="inner-content">
<span>共计 {{dataObject.total?dataObject.total:0}} 条数据</span>
<div class="operating-button">
<!-- <button nz-button nzType="primary" class="right-btn"><i nz-icon nzType="plus" nzTheme="outline"></i></button>-->
</div>
<!--数组表格 -->
<nz-table #basicTable
[nzData]="dataObject.list"
[nzTotal]="dataObject.total"
[nzFrontPagination]="false"
[nzLoading]="tableLoading"
[nzPageIndex]="whereObject.pageNum"
(nzPageIndexChange)="requestData($event)"
[nzScroll]="{ x: '1150px'}">
<thead>
<tr>
<th nzWidth="100px">优惠券编码</th>
<th nzWidth="200px">优惠券名称</th>
<th nzWidth="120px">优惠券状态</th>
<th nzWidth="160px">领取时间</th>
<th nzWidth="120px">领取人</th>
<th nzWidth="120px">领取手机号</th>
<th nzWidth="160px">使用时间</th>
<th nzWidth="160px">使用门店</th>
<!--<th nzWidth="10 0px" nzRight="0px">操作</th>-->
</tr>
</thead>
<tbody>
<tr *ngFor="let data of basicTable.data;let i = index">
<td>{{data.id}}</td>
<td>{{data.discountName}}</td>
<td>{{data.status | discountCodeStatus}}</td>
<td>{{data.receiveTime | date : 'yyyy-MM-dd HH:mm:ss'}}</td>
<td>{{data.userName}}</td>
<td>{{data.userPhone}}</td>
<td>{{data.useTime | date : 'yyyy-MM-dd HH:mm:ss'}}</td>
<td>{{data.storeName}}</td>
<!--<td nzRight="0px" class="table-td-operation">
<a [routerLink]="['/admin/testManager/details']" [queryParams]="{examId: data.id}">详情</a>
</td>-->
</tr>
</tbody>
</nz-table>
</div>

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { DiscountUseConditionListComponent } from './discount-use-condition-list.component';
describe('DiscountUseConditionListComponent', () => {
let component: DiscountUseConditionListComponent;
let fixture: ComponentFixture<DiscountUseConditionListComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ DiscountUseConditionListComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(DiscountUseConditionListComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

@ -0,0 +1,113 @@
import { Component, OnInit } from '@angular/core';
import {environment} from '../../../../environments/environment';
import {FormBuilder, FormGroup, Validators} from '_@angular_forms@9.0.7@@angular/forms';
import {RechargeService} from '../../../services/recharge.service';
import {DiscountService} from '../../../services/discount.service';
import {CouponService} from '../../../services/coupon.service';
import {LocalStorageService} from '../../../services/local-storage.service';
import {IconService} from '../../../services/icon.service';
import {NzMessageService} from '_ng-zorro-antd@9.3.0@ng-zorro-antd';
import {ADMIN_INFO_OBJECT} from '../../../services/local-storage.namespace';
import {NzModalService} from "ng-zorro-antd";
import {AgentService} from "../../../services/agent.service";
@Component({
selector: 'app-discount-use-condition-list',
templateUrl: './discount-use-condition-list.component.html',
styleUrls: ['./discount-use-condition-list.component.scss']
})
export class DiscountUseConditionListComponent implements OnInit {
dataObject: any = {};
tableLoading = true;
searchForm: FormGroup;
pageNum: number;
whereObject: any = {};
discountArray = [];
constructor(private modal: NzModalService,
private message: NzMessageService,
private agentService: AgentService,
private discountService: DiscountService,
private store: LocalStorageService,
private form: FormBuilder) { }
ngOnInit(): void {
this.searchForm = this.form.group({
discountId: [null],
status: [null],
storeName: [null],
receiveTime: [[]],
useTime: [[]],
idS: [null],
idE: [null],
});
this.requestAgentDiscount();
this.requestData(1);
}
/**
*
*/
requestData(pageNum) {
this.tableLoading = true;
this.whereObject['pageNum'] = pageNum;
this.whereObject['pageSize'] = 10;
this.discountService.getDiscountUseConditionList(this.whereObject, data => {
this.dataObject = data['return_data'];
this.tableLoading = false;
});
}
/**
*
*/
requestAgentDiscount() {
const param = {
agentId: this.store.get(ADMIN_INFO_OBJECT)['highAgent'].id,
pageNum: 1,
pageSize: 9999,
};
this.agentService.getDiscountAgentList(param, data => {
if (data['return_code'] === '000000') {
this.discountArray = data['return_data'].list;
} else {
this.message.error(data['return_msg']);
}
});
}
/**
*
* @param whereObject
*/
search(whereObject: object) {
if (whereObject['receiveTime'] != null && whereObject['receiveTime'].length > 0) {
whereObject['receiveTimeS'] = new Date(whereObject['receiveTime'][0]).getTime();
whereObject['receiveTimeE'] = new Date(whereObject['receiveTime'][1]).getTime();
} else {
whereObject['receiveTimeS'] = null;
whereObject['receiveTimeE'] = null;
}
if (whereObject['useTime'] != null && whereObject['useTime'].length > 0) {
whereObject['useTimeS'] = new Date(whereObject['useTime'][0]).getTime();
whereObject['useTimeE'] = new Date(whereObject['useTime'][1]).getTime();
} else {
whereObject['useTimeS'] = null;
whereObject['useTimeE'] = null;
}
this.whereObject = whereObject;
this.requestData(1);
}
/**
*
*/
resetForm(): void {
this.searchForm.reset();
}
}

@ -20,8 +20,8 @@
<thead nzSingleSort>
<tr>
<th nzWidth="50px">编号</th>
<th nzWidth="80px">优惠券KEY</th>
<th nzWidth="80px">优惠券名称</th>
<th nzWidth="120px">优惠券KEY</th>
<th nzWidth="150px">优惠券名称</th>
<th nzWidth="80px">优惠券类型</th>
<th nzWidth="70px">优惠内容</th>
<th nzWidth="70px">有效天数</th>
@ -72,6 +72,7 @@
<nz-option nzLabel="待使用" nzValue="2"></nz-option>
<nz-option nzLabel="已使用" nzValue="3"></nz-option>
<nz-option nzLabel="已过期" nzValue="4"></nz-option>
<nz-option nzLabel="预支付" nzValue="99"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>

@ -10,7 +10,8 @@ import {OrderKListComponent} from './order-k-list/order-k-list.component';
import {OrderHListComponent} from './order-h-list/order-h-list.component';
import {OrderAgentComponent} from './order-agent/order-agent.component';
import {PreOrderComponent} from './pre-order/pre-order.component';
import {PackageRecordListComponent} from "./package-record-list/package-record-list.component";
import {PackageRecordListComponent} from './package-record-list/package-record-list.component';
import {DiscountUseConditionListComponent} from './discount-use-condition-list/discount-use-condition-list.component';
const routes: Routes = [
@ -25,6 +26,7 @@ const routes: Routes = [
{ path: 'order-agent', component: OrderAgentComponent },
{ path: 'pre-order', component: PreOrderComponent },
{ path: 'package-record-list', component: PackageRecordListComponent },
{ path: 'discount-use-condition-list', component: DiscountUseConditionListComponent },
];
@NgModule({

@ -19,10 +19,12 @@ import { OrderHListComponent } from './order-h-list/order-h-list.component';
import { OrderAgentComponent } from './order-agent/order-agent.component';
import { PreOrderComponent } from './pre-order/pre-order.component';
import { PackageRecordListComponent } from './package-record-list/package-record-list.component';
import { DiscountUseConditionListComponent } from './discount-use-condition-list/discount-use-condition-list.component';
import {NzSpaceModule} from "_ng-zorro-antd@9.3.0@ng-zorro-antd/space";
@NgModule({
declarations: [OrderListComponent, OrderDetailComponent, OrderCouponsComponent, OrderCouponComponent , OrderTListComponent, OrderKListComponent , OrderCListComponent, OrderHListComponent, OrderAgentComponent, PreOrderComponent, PackageRecordListComponent],
declarations: [OrderListComponent, OrderDetailComponent, OrderCouponsComponent, OrderCouponComponent , OrderTListComponent, OrderKListComponent , OrderCListComponent, OrderHListComponent, OrderAgentComponent, PreOrderComponent, PackageRecordListComponent, DiscountUseConditionListComponent],
imports: [
CommonModule,
OrderRoutingModule,
@ -32,7 +34,8 @@ import { PackageRecordListComponent } from './package-record-list/package-record
FormsModule,
BreadcrumbModule,
RegionSelectorModule,
AppCommonModule
AppCommonModule,
NzSpaceModule
]
})
export class OrderModule { }

@ -15,6 +15,8 @@ export class DiscountCodeStatusPipe implements PipeTransform {
return '已使用';
case 4:
return '已过期';
case 5:
return '已分配';
}
}

@ -105,6 +105,18 @@ export class DiscountService {
});
}
/**
* 使
*
* @param id id
* @param callBack
*/
public getDiscountUseConditionList(param: object, callBack) {
this.http.get(environment.baseUrl + 'discountAgentRel/getDiscountUseConditionList?' + this.common.getWhereCondition(param)).subscribe(data => {
callBack(data);
});
}
/**
*
*

Loading…
Cancel
Save