parent
a4505f8c70
commit
386dfaf024
@ -0,0 +1,124 @@ |
||||
<!-- start 面包屑 --> |
||||
<app-breadcrumb></app-breadcrumb> |
||||
<!-- end 面包屑 --> |
||||
|
||||
<!--条件搜索--> |
||||
<div class="inner-content"> |
||||
<form nz-form [formGroup]="searchForm" (ngSubmit)="getRequest(true , searchForm.value)"> |
||||
<div nz-row> |
||||
|
||||
<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="agentId" nzPlaceHolder="请选择代理商" (ngModelChange)="getDistributionFirst($event)"> |
||||
<nz-option *ngFor="let item of agentData" nzLabel="{{item.agentName}}" [nzValue]="item.agentId"></nz-option> |
||||
</nz-select> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
</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="popularizeUserId" nzPlaceHolder="请选择一级分销" (ngModelChange)="getDistributionSecond($event)"> |
||||
<nz-option *ngFor="let item of distributionFirst" nzLabel="{{item.userName}}" [nzValue]="item.userId"></nz-option> |
||||
</nz-select> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
</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="popularizeUserId" nzPlaceHolder="请选择二级分销"> |
||||
<nz-option *ngFor="let item of distributionSecond" nzLabel="{{item.userName}}" [nzValue]="item.userId"></nz-option> |
||||
</nz-select> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
</div> |
||||
<div nz-col nzSpan="8"> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="6">订单号</nz-form-label> |
||||
<nz-form-control [nzSpan]="16"> |
||||
<input nz-input formControlName="orderNo" [placeholder]="'请输入订单号'" /> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
</div> |
||||
<div nz-col nzSpan="8"> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="6">标题</nz-form-label> |
||||
<nz-form-control [nzSpan]="16"> |
||||
<input nz-input formControlName="title" [placeholder]="'请输入标题'" /> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
</div> |
||||
<div nz-col nzSpan="8"> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="6">用户名称</nz-form-label> |
||||
<nz-form-control [nzSpan]="16"> |
||||
<input nz-input formControlName="userName" [placeholder]="'请输入用户名称'" /> |
||||
</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>共计 {{total}} 条数据</span> |
||||
|
||||
<nz-table |
||||
class="table" |
||||
#ajaxTable |
||||
nzShowSizeChanger |
||||
[nzFrontPagination]="false" |
||||
[nzData]="requestData" |
||||
[nzLoading]="loading" |
||||
[nzTotal]="total" |
||||
[(nzPageIndex)]="pageNum" |
||||
[(nzPageSize)]="pageSize" |
||||
[nzScroll]="{ x: '1200px' }" |
||||
(nzPageIndexChange)="getRequest(false , searchForm.value)" |
||||
(nzPageSizeChange)="getRequest(false , searchForm.value)"> |
||||
<thead nzSingleSort> |
||||
<tr> |
||||
<th nzWidth="50px">编号</th> |
||||
<th nzWidth="80px">标题</th> |
||||
<th nzWidth="100px">商品logo</th> |
||||
<th nzWidth="80px">分销类型</th> |
||||
<th nzWidth="70px">订单号</th> |
||||
<th nzWidth="70px">用户名称</th> |
||||
<th nzWidth="70px">积分数量</th> |
||||
<th nzWidth="100px">创建时间</th> |
||||
</tr> |
||||
</thead> |
||||
<tbody> |
||||
<tr *ngFor="let data of ajaxTable.data; let i = index"> |
||||
<td>{{i+1}}</td> |
||||
<td>{{data.title}}</td> |
||||
<td> |
||||
<img class="head_img" src="{{WEB_SERVE_URL + data.ext1}}" onerror="this.src='../../../../assets/admin/navigation/icon.png'" alt=""> |
||||
</td> |
||||
<td>{{data.type == 1 ? '二级分销' : '一级分销'}}</td> |
||||
<td>{{data.orderNo}}</td> |
||||
<td>{{data.userName}}</td> |
||||
<td>{{data.integralNum}}</td> |
||||
<td>{{data.createTime | date: 'yyyy-MM-dd HH:mm'}}</td> |
||||
</tbody> |
||||
</nz-table> |
||||
</div> |
||||
|
||||
|
||||
|
@ -0,0 +1,4 @@ |
||||
.head_img { |
||||
height: 60px; |
||||
width: 60px; |
||||
} |
@ -0,0 +1,115 @@ |
||||
import { Component, OnInit } from '@angular/core'; |
||||
import {environment} from '../../../../environments/environment'; |
||||
import {FormBuilder, FormGroup} from '_@angular_forms@9.0.7@@angular/forms'; |
||||
import {IconService} from '../../../services/icon.service'; |
||||
import {NzMessageService} from '_ng-zorro-antd@9.3.0@ng-zorro-antd'; |
||||
import {Router} from '_@angular_router@9.0.7@@angular/router'; |
||||
import {CommonsService} from '../../../services/commons.service'; |
||||
import {DistributionService} from '../../../services/distribution.service'; |
||||
|
||||
@Component({ |
||||
selector: 'app-distribution-integral-list', |
||||
templateUrl: './distribution-integral-list.component.html', |
||||
styleUrls: ['./distribution-integral-list.component.scss'] |
||||
}) |
||||
export class DistributionIntegralListComponent implements OnInit { |
||||
|
||||
WEB_SERVE_URL = environment.imageUrl; |
||||
searchForm: FormGroup; // 搜索框
|
||||
requestData = []; // 列表数据
|
||||
agentData = []; // 代理商列表
|
||||
distributionFirst = []; // 一级分销
|
||||
distributionSecond = []; // 二级分销人员
|
||||
|
||||
total: number; // 页码
|
||||
pageNum = 1; // 页码
|
||||
pageSize = 10; // 条码
|
||||
loading = true; |
||||
// 代理商id
|
||||
agentId: number; |
||||
popularizeUserId: number; |
||||
|
||||
|
||||
constructor( |
||||
private form: FormBuilder, |
||||
private distribution: DistributionService, |
||||
private iconService: IconService, |
||||
private message: NzMessageService, |
||||
) { |
||||
} |
||||
|
||||
ngOnInit(): void { |
||||
this.init(); |
||||
this.getInitData(); |
||||
this.getDistributionFirst(); |
||||
this.getDistributionSecond(); |
||||
} |
||||
|
||||
// 获取初始化数据
|
||||
private getInitData(): void { |
||||
// 获取价格数据
|
||||
this.distribution.getDistributionAgent( data => { |
||||
this.agentData = data['return_data']; |
||||
}); |
||||
|
||||
} |
||||
|
||||
public init(): void { |
||||
this.searchForm = this.form.group({ |
||||
agentId : [null], |
||||
popularizeUserId: [null], |
||||
orderNo: [null], |
||||
title: [null], |
||||
userName: [null], |
||||
}); |
||||
|
||||
this.getRequest(true, this.searchForm.value); |
||||
} |
||||
|
||||
// 查询列表
|
||||
public getRequest(reset: boolean = false, whereObject: object) { |
||||
|
||||
this.loading = false; |
||||
if (reset) { |
||||
this.pageNum = 1; |
||||
} |
||||
whereObject['pageNum'] = this.pageNum; |
||||
whereObject['pageSize'] = this.pageSize; |
||||
this.distribution.getDistributionIntegralList(whereObject, data => { |
||||
if (data['return_code'] === '000000') { |
||||
this.requestData = data['return_data'].list; |
||||
this.total = data['return_data'].total; |
||||
} else { |
||||
this.message.error(data['return_msg']); |
||||
} |
||||
}); |
||||
} |
||||
|
||||
// 重置
|
||||
public resetForm(): void { |
||||
this.searchForm.reset(); |
||||
} |
||||
|
||||
// 查询一级分销
|
||||
public getDistributionFirst(agentId?: number) { |
||||
this.agentId = agentId; |
||||
const param = { |
||||
agentId : this.agentId |
||||
}; |
||||
this.distribution.getDistributionFirst(param , data => { |
||||
this.distributionFirst = data['return_data']; |
||||
}); |
||||
} |
||||
|
||||
// 查询二级分销
|
||||
public getDistributionSecond(popularizeUserId?: number) { |
||||
this.popularizeUserId = popularizeUserId; |
||||
const param = { |
||||
agentId : this.agentId, |
||||
popularizeUserId : this.popularizeUserId, |
||||
}; |
||||
this.distribution.getDistributionSecond(param , data => { |
||||
this.distributionSecond = data['return_data']; |
||||
}); |
||||
} |
||||
} |
@ -0,0 +1,86 @@ |
||||
<!-- start 面包屑 --> |
||||
<app-breadcrumb></app-breadcrumb> |
||||
<!-- end 面包屑 --> |
||||
|
||||
<!--条件搜索--> |
||||
<div class="inner-content"> |
||||
<form nz-form [formGroup]="searchForm" (ngSubmit)="getRequest(true , searchForm.value)"> |
||||
<div nz-row> |
||||
|
||||
<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="agentId" nzPlaceHolder="请选择推广人"> |
||||
<nz-option *ngFor="let item of agentData" nzLabel="{{item.name}}" [nzValue]="item.id"></nz-option> |
||||
</nz-select> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
</div> |
||||
<div nz-col nzSpan="8"> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="6">推广码</nz-form-label> |
||||
<nz-form-control [nzSpan]="16"> |
||||
<input nz-input formControlName="code" [placeholder]="'请输入推广码'" /> |
||||
</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>共计 {{total}} 条数据</span> |
||||
|
||||
<nz-table |
||||
class="table" |
||||
#ajaxTable |
||||
nzShowSizeChanger |
||||
[nzFrontPagination]="false" |
||||
[nzData]="requestData" |
||||
[nzLoading]="loading" |
||||
[nzTotal]="total" |
||||
[(nzPageIndex)]="pageNum" |
||||
[(nzPageSize)]="pageSize" |
||||
[nzScroll]="{ x: '1200px' }" |
||||
(nzPageIndexChange)="getRequest(false , searchForm.value)" |
||||
(nzPageSizeChange)="getRequest(false , searchForm.value)"> |
||||
<thead nzSingleSort> |
||||
<tr> |
||||
<th nzWidth="50px">编号</th> |
||||
<th nzWidth="80px">标题</th> |
||||
<th nzWidth="80px">推广人</th> |
||||
<th nzWidth="80px">订单金额</th> |
||||
<th nzWidth="70px">订单号</th> |
||||
<th nzWidth="70px">用户名称</th> |
||||
<th nzWidth="70px">用户电话</th> |
||||
<th nzWidth="100px">创建时间</th> |
||||
</tr> |
||||
</thead> |
||||
<tbody> |
||||
<tr *ngFor="let data of ajaxTable.data; let i = index"> |
||||
<td>{{i+1}}</td> |
||||
<td>{{data.goodsTypeName}}</td> |
||||
<td>{{data.agentName}}</td> |
||||
<td>{{'¥' + data.totalPrice}}</td> |
||||
<td>{{data.orderNo}}</td> |
||||
<td>{{data.memName}}</td> |
||||
<td>{{data.memPhone}}</td> |
||||
<td>{{data.createTime | date: 'yyyy-MM-dd HH:mm'}}</td> |
||||
</tbody> |
||||
</nz-table> |
||||
</div> |
||||
|
||||
|
||||
|
@ -0,0 +1,92 @@ |
||||
import { Component, OnInit } from '@angular/core'; |
||||
import {environment} from '../../../../environments/environment'; |
||||
import {FormBuilder, FormGroup} from '_@angular_forms@9.0.7@@angular/forms'; |
||||
import {DistributionService} from '../../../services/distribution.service'; |
||||
import {IconService} from '../../../services/icon.service'; |
||||
import {NzMessageService} from '_ng-zorro-antd@9.3.0@ng-zorro-antd'; |
||||
import {Router} from '_@angular_router@9.0.7@@angular/router'; |
||||
import {CommonsService} from '../../../services/commons.service'; |
||||
|
||||
@Component({ |
||||
selector: 'app-promotion-order-list', |
||||
templateUrl: './promotion-order-list.component.html', |
||||
styleUrls: ['./promotion-order-list.component.scss'] |
||||
}) |
||||
export class PromotionOrderListComponent implements OnInit { |
||||
|
||||
WEB_SERVE_URL = environment.imageUrl; |
||||
searchForm: FormGroup; // 搜索框
|
||||
requestData = []; // 列表数据
|
||||
agentData = []; // 代理商列表
|
||||
|
||||
|
||||
total: number; // 页码
|
||||
pageNum = 1; // 页码
|
||||
pageSize = 10; // 条码
|
||||
loading = true; |
||||
|
||||
|
||||
|
||||
constructor( |
||||
private form: FormBuilder, |
||||
private distribution: DistributionService, |
||||
private iconService: IconService, |
||||
private message: NzMessageService, |
||||
private router: Router, |
||||
private common: CommonsService |
||||
) { |
||||
} |
||||
|
||||
ngOnInit(): void { |
||||
this.init(); |
||||
this.getInitData(); |
||||
} |
||||
|
||||
// 获取初始化数据
|
||||
private getInitData(): void { |
||||
// 获取价格数据
|
||||
this.distribution.agentUserList( data => { |
||||
this.agentData = data['return_data']; |
||||
}); |
||||
|
||||
} |
||||
|
||||
public init(): void { |
||||
this.searchForm = this.form.group({ |
||||
agentId : [null], |
||||
popularizeUserId: [null], |
||||
orderNo: [null], |
||||
title: [null], |
||||
userName: [null], |
||||
code: [null], |
||||
}); |
||||
|
||||
this.getRequest(true, this.searchForm.value); |
||||
} |
||||
|
||||
// 查询列表
|
||||
public getRequest(reset: boolean = false, whereObject: object) { |
||||
|
||||
this.loading = false; |
||||
if (reset) { |
||||
this.pageNum = 1; |
||||
} |
||||
whereObject['pageNum'] = this.pageNum; |
||||
whereObject['pageSize'] = this.pageSize; |
||||
this.distribution.orderListByAgentId(whereObject, data => { |
||||
if (data['return_code'] === '000000') { |
||||
this.requestData = data['return_data'].list; |
||||
this.total = data['return_data'].total; |
||||
} else { |
||||
this.message.error(data['return_msg']); |
||||
} |
||||
}); |
||||
} |
||||
|
||||
// 重置
|
||||
public resetForm(): void { |
||||
this.searchForm.reset(); |
||||
} |
||||
|
||||
|
||||
} |
@ -0,0 +1,17 @@ |
||||
import { NgModule } from '@angular/core'; |
||||
import { Routes, RouterModule } from '@angular/router'; |
||||
import {DistributionIntegralListComponent} from './distribution-integral-list/distribution-integral-list.component'; |
||||
import {PromotionOrderListComponent} from './promotion-order-list/promotion-order-list.component'; |
||||
|
||||
|
||||
|
||||
const routes: Routes = [ |
||||
{ path: 'distribution-integral-list', component: DistributionIntegralListComponent }, |
||||
{ path: 'promotion-order-list', component: PromotionOrderListComponent }, |
||||
]; |
||||
|
||||
@NgModule({ |
||||
imports: [RouterModule.forChild(routes)], |
||||
exports: [RouterModule] |
||||
}) |
||||
export class PromotionRoutingModule { } |
@ -0,0 +1,25 @@ |
||||
import { NgModule } from '@angular/core'; |
||||
import { CommonModule } from '@angular/common'; |
||||
|
||||
import { PromotionRoutingModule } from './promotion-routing.module'; |
||||
import { DistributionIntegralListComponent } from './distribution-integral-list/distribution-integral-list.component'; |
||||
import { PromotionOrderListComponent } from './promotion-order-list/promotion-order-list.component'; |
||||
import {NgZorroAntdModule} from '_ng-zorro-antd@9.3.0@ng-zorro-antd'; |
||||
import {SeparateModule} from '../../common/separate/separate.module'; |
||||
import {FormsModule, ReactiveFormsModule} from '_@angular_forms@9.0.7@@angular/forms'; |
||||
import {BreadcrumbModule} from '../../common/breadcrumb/breadcrumb.module'; |
||||
|
||||
|
||||
@NgModule({ |
||||
declarations: [DistributionIntegralListComponent, PromotionOrderListComponent], |
||||
imports: [ |
||||
CommonModule, |
||||
NgZorroAntdModule, |
||||
SeparateModule, |
||||
ReactiveFormsModule, |
||||
FormsModule, |
||||
BreadcrumbModule, |
||||
PromotionRoutingModule |
||||
] |
||||
}) |
||||
export class PromotionModule { } |
@ -1,16 +0,0 @@ |
||||
import { TestBed } from '@angular/core/testing'; |
||||
|
||||
import { IntegrRebateService } from './integr-rebate.service'; |
||||
|
||||
describe('IntegrRebateService', () => { |
||||
let service: IntegrRebateService; |
||||
|
||||
beforeEach(() => { |
||||
TestBed.configureTestingModule({}); |
||||
service = TestBed.inject(IntegrRebateService); |
||||
}); |
||||
|
||||
it('should be created', () => { |
||||
expect(service).toBeTruthy(); |
||||
}); |
||||
}); |
@ -1,9 +0,0 @@ |
||||
import { Injectable } from '@angular/core'; |
||||
|
||||
@Injectable({ |
||||
providedIn: 'root' |
||||
}) |
||||
export class IntegrRebateService { |
||||
|
||||
constructor() { } |
||||
} |
@ -0,0 +1,94 @@ |
||||
import { Injectable } from '@angular/core'; |
||||
import {HttpClient} from '_@angular_common@9.0.7@@angular/common/http'; |
||||
import {CommonsService} from './commons.service'; |
||||
import {environment} from '../../environments/environment'; |
||||
|
||||
@Injectable({ |
||||
providedIn: 'root' |
||||
}) |
||||
export class DistributionService { |
||||
|
||||
constructor( |
||||
private http: HttpClient, |
||||
private common: CommonsService |
||||
) { } |
||||
|
||||
/** |
||||
* @Author Sum1Dream |
||||
* @methodName getDistributionAgent |
||||
* @Description // 查询分销代理商
|
||||
* @Date 11:06 2022/8/19 |
||||
* @Param callBack |
||||
*/ |
||||
public getDistributionAgent(callBack) { |
||||
this.http.get(environment.baseUrl + 'bsDistributionUserRel/getDistributionAgent').subscribe(data => { |
||||
callBack(data); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* @Author Sum1Dream |
||||
* @methodName getDistributionFirst |
||||
* @Description // 查询一级分销
|
||||
* @Date 11:07 2022/8/19 |
||||
* @Param param: object , callBack |
||||
*/ |
||||
public getDistributionFirst(param: object , callBack) { |
||||
this.http.get(environment.baseUrl + 'bsDistributionUserRel/getDistributionFirst?' + this.common.getWhereCondition(param)).subscribe(data => { |
||||
callBack(data); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* @Author Sum1Dream |
||||
* @methodName getDistributionSecond |
||||
* @Description // 查询二级分销
|
||||
* @Date 11:08 2022/8/19 |
||||
* @Param param: object , callBack |
||||
*/ |
||||
public getDistributionSecond(param: object , callBack) { |
||||
this.http.get(environment.baseUrl + 'bsDistributionUserRel/getDistributionSecond?' + this.common.getWhereCondition(param)).subscribe(data => { |
||||
callBack(data); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* @Author Sum1Dream |
||||
* @methodName getDistributionIntegralList |
||||
* @Description // 查询分销积分列表
|
||||
* @Date 11:09 2022/8/19 |
||||
* @Param param: object , callBack |
||||
*/ |
||||
public getDistributionIntegralList(param: object , callBack) { |
||||
this.http.get(environment.baseUrl + 'bsDistributionUserRel/getDistributionIntegralList?' + this.common.getWhereCondition(param)).subscribe(data => { |
||||
callBack(data); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* @Author Sum1Dream |
||||
* @methodName getDistributionAgent |
||||
* @Description // 查询推广代理商
|
||||
* @Date 11:06 2022/8/19 |
||||
* @Param callBack |
||||
*/ |
||||
public agentUserList(callBack) { |
||||
this.http.get(environment.baseUrl + 'bsDistributionUserRel/agentUserList').subscribe(data => { |
||||
callBack(data); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* @Author Sum1Dream |
||||
* @methodName getDistributionIntegralList |
||||
* @Description // 查询推广订单列表
|
||||
* @Date 11:09 2022/8/19 |
||||
* @Param param: object , callBack |
||||
*/ |
||||
public orderListByAgentId(param: object , callBack) { |
||||
this.http.get(environment.baseUrl + 'bsDistributionUserRel/orderListByAgentId?' + this.common.getWhereCondition(param)).subscribe(data => { |
||||
callBack(data); |
||||
}); |
||||
} |
||||
|
||||
} |
Loading…
Reference in new issue