提交修改

pull/1/head
袁野 3 years ago
parent 31715635f4
commit 1b68d67ae8
  1. 1
      src/app/admin/agent/agent-edit/agent-edit.component.ts
  2. 1
      src/app/admin/agent/agent-list/agent-list.component.ts
  3. 20
      src/app/admin/recharge-order/order-list/order-list.component.html
  4. 34
      src/app/admin/recharge-order/order-list/order-list.component.ts
  5. 4
      src/app/admin/recharge-order/order-statistical/order-statistical.component.html
  6. 17
      src/app/admin/recharge-order/order-statistical/order-statistical.component.ts
  7. 6
      src/app/admin/recharge-order/recharge-order-routing.module.ts
  8. 4
      src/app/admin/recharge-order/recharge-order.module.ts
  9. 86
      src/app/admin/recharge-order/user-edit/user-edit.component.html
  10. 6
      src/app/admin/recharge-order/user-edit/user-edit.component.scss
  11. 122
      src/app/admin/recharge-order/user-edit/user-edit.component.ts
  12. 63
      src/app/admin/recharge-order/user-statistical/user-statistical.component.html
  13. 68
      src/app/admin/recharge-order/user-statistical/user-statistical.component.ts
  14. 105
      src/app/admin/recharge-order/user/user.component.html
  15. 12
      src/app/admin/recharge-order/user/user.component.scss
  16. 111
      src/app/admin/recharge-order/user/user.component.ts
  17. 13
      src/app/services/agent.service.ts
  18. 50
      src/app/services/recharge.service.ts

@ -43,6 +43,7 @@ export class AgentEditComponent implements OnInit {
loginName: [null, [Validators.required, ValidatorsService.maxLength(20)]],
password: [null, [Validators.required]],
agentName: [null, [Validators.required]],
type: [1],
agentUser: [null, [Validators.required, ValidatorsService.maxLength(50)]],
agentPhone: [null, [Validators.required, ValidatorsService.maxLength(50)]],
agentAddress: [null, [Validators.required, ValidatorsService.maxLength(80)]],

@ -70,6 +70,7 @@ export class AgentListComponent implements OnInit {
agentName: [null],
agentPhone: [null],
status: [null],
type: [1],
});
this.validateForm = this.form.group({
discountId: [null, [Validators.required]],

@ -59,6 +59,22 @@
</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-range-picker [nzShowTime]="{ nzFormat: 'HH:mm' }" formControlName="payTime"></nz-range-picker>
</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-range-picker [nzShowTime]="{ nzFormat: 'HH:mm' }" formControlName="createTime"></nz-range-picker>
</nz-form-control>
</nz-form-item>
</div>
</div>
<div nz-row>
@ -72,9 +88,11 @@
</form>
</div>
<div class="inner-content">
<span>共计 {{total}} 条数据</span>
<div class="operating-button">
<button nz-button nzType="primary" class="right-btn" (click)="downloadTemplate(searchForm.value)" ><i nz-icon nzType="download" nzTheme="outline"></i>导出订单</button>
</div>
<nz-table
class="table"
#ajaxTable

@ -8,7 +8,7 @@ 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 {RechargeService} from '../../../services/recharge.service';
import {NzNotificationService} from "ng-zorro-antd";
import {NzNotificationService} from 'ng-zorro-antd';
@Component({
selector: 'app-order-list',
@ -16,7 +16,7 @@ import {NzNotificationService} from "ng-zorro-antd";
styleUrls: ['./order-list.component.scss']
})
export class OrderListComponent implements OnInit , OnDestroy {
WEB_SERVE_URL = environment.imageUrl;
FILE_URL = environment.imageUrl;
searchForm: FormGroup; // 搜索框
validateForm: FormGroup; // 添加框
requestData = []; // 列表数据
@ -72,6 +72,8 @@ export class OrderListComponent implements OnInit , OnDestroy {
rechargeModel: [null],
rechargeContent: [null],
userPhone: [null],
payTime: [null],
createTime: [null],
});
this.validateForm = this.form.group({
type: [null, [Validators.required]],
@ -84,7 +86,15 @@ export class OrderListComponent implements OnInit , OnDestroy {
// 查询列表
public getRequest(reset: boolean = false, whereObject: object) {
if (whereObject['payTime'] != null && whereObject['payTime'].length !== 0) {
whereObject['payTimeS'] = whereObject['payTime'][0].getTime();
whereObject['payTimeE'] = whereObject['payTime'][1].getTime();
}
if (whereObject['createTime'] != null && whereObject['createTime'].length !== 0) {
whereObject['createTimeS'] = whereObject['createTime'][0].getTime();
whereObject['createTimeE'] = whereObject['createTime'][1].getTime();
}
this.loading = false;
if (reset) {
this.pageNum = 1;
@ -158,4 +168,24 @@ export class OrderListComponent implements OnInit , OnDestroy {
});
}
// 下载模板
downloadTemplate(whereObject) {
if (whereObject['payTime'] != null && whereObject['payTime'].length !== 0) {
whereObject['payTimeS'] = whereObject['payTime'][0].getTime();
whereObject['payTimeE'] = whereObject['payTime'][1].getTime();
}
if (whereObject['createTime'] != null && whereObject['createTime'].length !== 0) {
whereObject['createTimeS'] = whereObject['createTimeS'][0].getTime();
whereObject['createTimeE'] = whereObject['createTimeE'][1].getTime();
}
this.recharge.exportOrderList(whereObject, data => {
if (data['return_code'] === '000000') {
window.location.href = this.FILE_URL + data['return_data'];
} else {
this.message.error(data['return_msg']);
}
});
}
}

@ -29,7 +29,7 @@
<div class="inner-content">
<span>共计 {{total}} 条数据</span>
<div class="operating-button">
<!-- <button nz-button nzType="primary" class="right-btn" (click)="downloadTemplate(searchForm.value)" ><i nz-icon nzType="download" nzTheme="outline"></i>导出订单</button>-->
<button nz-button nzType="primary" class="right-btn" (click)="downloadTemplate(searchForm.value)" ><i nz-icon nzType="download" nzTheme="outline"></i>导出订单</button>
</div>
<nz-table
class="table"
@ -55,7 +55,7 @@
<tbody>
<tr *ngFor="let data of ajaxTable.data; let i = index">
<td>{{i+1}}</td>
<td>{{data.day}}</td>
<td>{{data.day | date: 'yyyy-MM-dd'}}</td>
<td>{{data.count}}</td>
<td>{{data.payPrice}}</td>
<td>{{data.orderPrice}}</td>

@ -2,6 +2,7 @@ import { Component, OnInit } from '@angular/core';
import {RechargeService} from '../../../services/recharge.service';
import {FormBuilder, FormGroup} from '_@angular_forms@9.0.7@@angular/forms';
import {NzMessageService} from 'ng-zorro-antd';
import {environment} from '../../../../environments/environment';
@Component({
selector: 'app-order-statistical',
@ -10,6 +11,7 @@ import {NzMessageService} from 'ng-zorro-antd';
})
export class OrderStatisticalComponent implements OnInit {
searchForm: FormGroup; // 搜索框
FILE_URL = environment.imageUrl;
requestData = []; // 列表数据
total: number; // 页码
pageNum = 1; // 页码
@ -60,4 +62,19 @@ export class OrderStatisticalComponent implements OnInit {
this.searchForm.reset();
}
// 下载模板
downloadTemplate(whereObject) {
if (whereObject['finishTime'] != null && whereObject['finishTime'].length !== 0) {
whereObject['finishTimeS'] = whereObject['finishTime'][0].getTime();
whereObject['finishTimeE'] = whereObject['finishTime'][1].getTime();
}
this.recharge.exportOrderListCount(whereObject, data => {
if (data['return_code'] === '000000') {
window.location.href = this.FILE_URL + data['return_data'];
} else {
this.message.error(data['return_msg']);
}
});
}
}

@ -4,13 +4,17 @@ import {OrderListComponent} from './order-list/order-list.component';
import {PriceListComponent} from './price-list/price-list.component';
import {OrderStatisticalComponent} from './order-statistical/order-statistical.component';
import {UserStatisticalComponent} from './user-statistical/user-statistical.component';
import {UserComponent} from './user/user.component';
import {UserEditComponent} from './user-edit/user-edit.component';
const routes: Routes = [
{ path: 'order-list', component: OrderListComponent },
{ path: 'price-list', component: PriceListComponent},
{ path: 'price-list', component: PriceListComponent},
{ path: 'order-statistical', component: OrderStatisticalComponent},
{ path: 'user-statistical', component: UserStatisticalComponent},
{ path: 'user-statistics', component: UserStatisticalComponent},
{ path: 'user', component: UserComponent},
{ path: 'user-edit', component: UserEditComponent},
];
@NgModule({

@ -12,10 +12,12 @@ import {RegionSelectorModule} from '../../common/region-selector/region-selector
import {AppCommonModule} from '../../app-common.module';
import { OrderStatisticalComponent } from './order-statistical/order-statistical.component';
import { UserStatisticalComponent } from './user-statistical/user-statistical.component';
import { UserComponent } from './user/user.component';
import { UserEditComponent } from './user-edit/user-edit.component';
@NgModule({
declarations: [OrderListComponent, PriceListComponent, OrderStatisticalComponent, UserStatisticalComponent],
declarations: [OrderListComponent, PriceListComponent, OrderStatisticalComponent, UserStatisticalComponent, UserComponent, UserEditComponent],
imports: [
CommonModule,
RechargeOrderRoutingModule,

@ -0,0 +1,86 @@
<!-- start 面包屑 -->
<nz-breadcrumb>
<nz-breadcrumb-item>
系统管理
</nz-breadcrumb-item>
<nz-breadcrumb-item>
增加代理商
</nz-breadcrumb-item>
</nz-breadcrumb>
<!-- end 面包屑 -->
<div class="inner-content">
<div nz-row>
<div nz-col nzSpan="2"></div>
<div nz-col nzSpan="20">
<form nz-form [formGroup]="validateForm" >
<div nz-row [nzGutter]="24">
<nz-divider nzText="账号信息"></nz-divider>
<div nz-col [nzSpan]="8">
<nz-form-item>
<nz-form-label [nzFor]="'loginName'" nzRequired>用户名</nz-form-label>
<nz-form-control nzErrorTip="请输入用户名!">
<input nz-input placeholder="请输入用户名..." [formControlName]="'loginName'" id="'loginName'" />
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="8">
<nz-form-item>
<nz-form-label [nzFor]="'password'" nzRequired>登录密码</nz-form-label>
<nz-form-control nzErrorTip="请输入登录密码!">
<nz-input-group [nzSuffix]="suffixTemplate">
<input [type]="passwordVisible ? 'text' : 'password'" nz-input placeholder="请输入登录密码..." [formControlName]="'password'" id="'password'" />
</nz-input-group>
<ng-template #suffixTemplate>
<i nz-icon [nzType]="passwordVisible ? 'eye-invisible' : 'eye'" (click)="passwordVisible = !passwordVisible"></i>
</ng-template>
</nz-form-control>
</nz-form-item>
</div>
<nz-divider nzText="代理商信息"></nz-divider>
<div nz-col [nzSpan]="8">
<nz-form-item>
<nz-form-label [nzFor]="'agentName'" nzRequired>代理商名称</nz-form-label>
<nz-form-control nzErrorTip="请输入代理商名称!">
<input nz-input placeholder="请输入代理商名称..." [formControlName]="'agentName'" id="'agentName'" />
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="8">
<nz-form-item>
<nz-form-label [nzFor]="'agentAddress'" nzRequired>代理商地址</nz-form-label>
<nz-form-control nzErrorTip="请输入代理商地址!">
<input nz-input placeholder="请输入代理商地址..." [formControlName]="'agentAddress'" id="'agentAddress'" />
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="8">
<nz-form-item>
<nz-form-label [nzFor]="'agentUser'" nzRequired>联系人</nz-form-label>
<nz-form-control nzErrorTip="请输入联系人!">
<input nz-input placeholder="请输入联系人..." [formControlName]="'agentUser'" id="'agentUser'" />
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="8">
<nz-form-item>
<nz-form-label [nzFor]="'agentPhone'" nzRequired>联系方式</nz-form-label>
<nz-form-control nzErrorTip="请输入联系方式!">
<input nz-input placeholder="请输入联系方式..." [formControlName]="'agentPhone'" id="'agentPhone'" />
</nz-form-control>
</nz-form-item>
</div>
</div>
<div nz-row>
<div nz-col [nzSpan]="24" class="search-area">
<button nz-button [nzType]="'primary'" (click)="getSave()">提交</button>
</div>
</div>
</form>
</div>
<div nz-col nzSpan="2"></div>
</div>
</div>

@ -0,0 +1,6 @@
button {
margin-left: 8px;
}
:host ::ng-deep .ant-upload {
background-color: #ffffff;
}

@ -0,0 +1,122 @@
import { Component, OnInit } from '@angular/core';
import {FormBuilder, FormGroup, Validators} from '_@angular_forms@9.0.7@@angular/forms';
import {environment} from '../../../../environments/environment';
import {AgentService} from '../../../services/agent.service';
import {NzMessageService} from '_ng-zorro-antd@9.3.0@ng-zorro-antd';
import {ActivatedRoute} from '_@angular_router@9.0.7@@angular/router';
import {ValidatorsService} from '../../../services/validators.service';
@Component({
selector: 'app-user-edit',
templateUrl: './user-edit.component.html',
styleUrls: ['./user-edit.component.scss']
})
export class UserEditComponent implements OnInit {
validateForm!: FormGroup;
data: any;
editFlag = false;
id: number;
passwordVisible = false;
logoFile = [];
WEB_SERVE_URL = environment.baseUrl;
userId: number;
time;
constructor(
private fb: FormBuilder,
private agent: AgentService,
private message: NzMessageService, // 信息提示
private activatedRoute: ActivatedRoute,
) {
}
ngOnInit(): void {
this.activatedRoute.queryParams.subscribe(queryParams => {
if (queryParams.agentId != null) {
this.editFlag = true;
this.id = queryParams.agentId;
this.getDetails(queryParams.agentId);
}
});
this.validateForm = this.fb.group({
loginName: [null, [Validators.required, ValidatorsService.maxLength(20)]],
password: [null, [Validators.required]],
agentName: [null, [Validators.required]],
type: [2],
agentUser: [null, [Validators.required, ValidatorsService.maxLength(50)]],
agentPhone: [null, [Validators.required, ValidatorsService.maxLength(50)]],
agentAddress: [null, [Validators.required, ValidatorsService.maxLength(80)]],
secUser: {},
});
}
// 返回
getBack() {
history.back();
}
// 重置
public resetForm(): void {
this.validateForm.reset();
}
// 课程保存
public getSave(): void {
// tslint:disable-next-line:forin
for (const i in this.validateForm.controls) {
this.validateForm.controls[i].markAsDirty();
this.validateForm.controls[i].updateValueAndValidity();
if (this.validateForm.controls[i].errors != null) {
this.message.error('必填项不能为空');
return;
}
}
this.validateForm.value['secUser']['loginName'] = this.validateForm.value.loginName;
this.validateForm.value['secUser']['password'] = this.validateForm.value.password;
if (this.logoFile.length !== 0) {
if (this.logoFile[0]['response'] != null) {
this.validateForm.value.logo = this.logoFile[0]['response']['return_data'][0];
} else {
this.validateForm.value.logo = this.logoFile[0].name;
}
}
if (this.editFlag) {
this.validateForm.value.id = this.id;
this.agent.updateAgent(this.validateForm.value, data => {
if (data['return_code'] === '000000') {
this.getBack();
this.message.success('修改成功');
} else {
this.message.create('error', '修改失败');
}
});
} else {
this.agent.insertAgent(this.validateForm.value, data => {
if (data['return_code'] === '000000') {
this.getBack();
this.message.success('添加成功');
} else {
this.message.create('error', data['return_msg']);
}
});
}
}
public getDetails(id) {
this.agent.findByAgentId(id, data => {
console.log(data);
if (data['return_code'] === '000000') {
data['return_data'].loginName = data['return_data'].secUser.loginName;
data['return_data'].password = data['return_data'].secUser.password;
this.validateForm.patchValue(data['return_data']);
} else {
this.message.create('error', data['return_msg']);
}
});
}
}

@ -1 +1,62 @@
<p>user-statistical works!</p>
<!-- 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-range-picker [nzShowTime]="{ nzFormat: 'HH:mm' }" formControlName="finishTime"></nz-range-picker>
</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>
<div class="operating-button">
<button nz-button nzType="primary" class="right-btn" (click)="downloadTemplate(searchForm.value)" ><i nz-icon nzType="download" 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="50px">编号</th>
<th nzWidth="180px">员工名称</th>
<th nzWidth="180px">数量</th>
<th nzWidth="180px">支付金额</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let data of ajaxTable.data; let i = index">
<td>{{i+1}}</td>
<td>{{data.agentName}}</td>
<td>{{data.count}}</td>
<td>{{data.payPrice}}</td>
</tbody>
</nz-table>
</div>

@ -1,4 +1,8 @@
import { Component, OnInit } from '@angular/core';
import {FormBuilder, FormGroup} from "_@angular_forms@9.0.7@@angular/forms";
import {environment} from "../../../../environments/environment";
import {RechargeService} from "../../../services/recharge.service";
import {NzMessageService} from "_ng-zorro-antd@9.3.0@ng-zorro-antd";
@Component({
selector: 'app-user-statistical',
@ -7,9 +11,71 @@ import { Component, OnInit } from '@angular/core';
})
export class UserStatisticalComponent implements OnInit {
constructor() { }
searchForm: FormGroup; // 搜索框
FILE_URL = environment.imageUrl;
requestData = []; // 列表数据
total: number; // 页码
pageNum = 1; // 页码
pageSize = 10; // 条码
loading = true;
constructor(
private recharge: RechargeService,
private form: FormBuilder,
private message: NzMessageService,
) { }
ngOnInit(): void {
this.searchForm = this.form.group({
finishTime: [null],
});
this.getRequest(true, this.searchForm.value);
}
// 查询列表
public getRequest(reset: boolean = false, whereObject: object) {
if (whereObject['finishTime'] != null && whereObject['finishTime'].length !== 0) {
whereObject['finishTimeS'] = whereObject['finishTime'][0].getTime();
whereObject['finishTimeE'] = whereObject['finishTime'][1].getTime();
}
this.loading = false;
if (reset) {
this.pageNum = 1;
}
whereObject['pageNum'] = this.pageNum;
whereObject['pageSize'] = this.pageSize;
this.recharge.getUserCountList(whereObject, data => {
console.log(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();
}
// 下载模板
downloadTemplate(whereObject) {
if (whereObject['finishTime'] != null && whereObject['finishTime'].length !== 0) {
whereObject['finishTimeS'] = whereObject['finishTime'][0].getTime();
whereObject['finishTimeE'] = whereObject['finishTime'][1].getTime();
}
this.recharge.exportUserOrderListCount(whereObject, data => {
if (data['return_code'] === '000000') {
window.location.href = this.FILE_URL + data['return_data'];
} else {
this.message.error(data['return_msg']);
}
});
}
}

@ -0,0 +1,105 @@
<!-- 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">
<input nz-input formControlName="agentName"/>
</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="agentPhone"/>
</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="status" nzPlaceHolder="请选择代理商状态">
<nz-option nzLabel="禁用" nzValue="0"></nz-option>
<nz-option nzLabel="正常" nzValue="1"></nz-option>
</nz-select>
</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>
<div class="operating-button">
<button nz-button nzType="primary" class="right-btn" [routerLink]="['/admin/rechargeOrder/user-edit']"><i nz-icon
nzType="plus"
nzTheme="outline"></i>添加
</button>
</div>
<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="100px">创建时间</th>
<th nzWidth="80px" nzRight="0px">操作</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let data of ajaxTable.data; let i = index">
<td>{{i + 1}}</td>
<td>{{data.agentName}}</td>
<td>{{data.agentAddress}}</td>
<td>{{data.agentUser}}</td>
<td>{{data.agentPhone}}</td>
<td>{{data.createTime | date: 'yyyy-MM-dd HH:mm'}}</td>
<td nzRight="0px" class="table-td-operation">
<a (click)="getEdit(data.id)">编辑</a>
<a nz-dropdown [nzDropdownMenu]="menu">更多</a>
<nz-dropdown-menu #menu="nzDropdownMenu">
<ul nz-menu nzSelectable>
<li class="li-a" nz-menu-item><a (click)="generateRechargeAgentQrCode(data.id)">生成二维码</a></li>
<li class="li-a" nz-menu-item><a (click)='getForbiddenUser(data.id , data.status)'>{{data.status === 1 ? '禁用': '启用'}}</a></li>
</ul>
</nz-dropdown-menu>
</td>
</tbody>
</nz-table>
</div>

@ -0,0 +1,12 @@
.head_img {
height: 80px;
width: 80px;
}
.table-td-operation {
a {
margin-left: 8px;
}
}
.li-a :hover {
color: #1890ff;
}

@ -0,0 +1,111 @@
import { Component, OnInit } from '@angular/core';
import {environment} from '../../../../environments/environment';
import {FormBuilder, FormGroup, Validators} from '_@angular_forms@9.0.7@@angular/forms';
import {AgentService} from '../../../services/agent.service';
import {DiscountService} from '../../../services/discount.service';
import {CouponService} from '../../../services/coupon.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-user',
templateUrl: './user.component.html',
styleUrls: ['./user.component.scss']
})
export class UserComponent implements OnInit {
WEB_SERVE_URL = environment.imageUrl;
FILE_URL = environment.imageUrl;
searchForm: FormGroup; // 搜索框
requestData = []; // 列表数据
total: number; // 页码
pageNum = 1; // 页码
pageSize = 10; // 条码
loading = true;
constructor(
private form: FormBuilder,
private agent: AgentService,
private discount: DiscountService,
private coupon: CouponService,
private iconService: IconService,
private message: NzMessageService,
private router: Router,
private common: CommonsService
) {
}
ngOnInit(): void {
this.init();
}
public init(): void {
this.searchForm = this.form.group({
agentName: [null],
agentPhone: [null],
status: [null],
type: [2],
});
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.agent.getListAgent(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 getForbiddenUser(id, status: any): void {
const message = (status === 1 ? '是否禁用当前代理商' : '是否启用当前代理商');
this.common.showConfirm(message, data => {
if (data) {
this.agent.editStatus(id, dataUser => {
this.getRequest(false, this.searchForm.value);
});
}
});
}
// 修改
public getEdit(id: number): void {
this.router.navigate(['/admin/rechargeOrder/user-edit'], {
queryParams: {
agentId: id
}
}).then(r => console.log(r));
}
public generateRechargeAgentQrCode(id: number): void {
this.agent.generateRechargeAgentQrCode(id, data => {
if (data['return_code'] === '000000') {
window.location.href = this.FILE_URL + data['return_data'];
} else {
this.message.error(data['return_msg']);
}
});
}
}

@ -79,6 +79,19 @@ export class AgentService {
});
}
/**
*
*
* @param id id
* @param status status
* @param callBack
*/
public generateRechargeAgentQrCode(id: number, callBack) {
this.http.get(environment.baseUrl + 'highAgent/generateRechargeAgentQrCode?agentId=' + id).subscribe(data => {
callBack(data);
});
}
/**
*
*

@ -148,4 +148,54 @@ export class RechargeService {
});
}
/**
*
*
* @param paramsObject
* @param callBack
*/
public exportOrderListCount(paramsObject: object, callBack) {
this.http.get(environment.baseUrl + 'outRechargeOrder/exportOrderListCount?' + this.common.getWhereCondition(paramsObject)).subscribe(data => {
callBack(data);
});
}
/**
*
*
* @param paramsObject
* @param callBack
*/
public exportOrderList(paramsObject: object, callBack) {
this.http.get(environment.baseUrl + 'outRechargeOrder/exportOrderList?' + this.common.getWhereCondition(paramsObject)).subscribe(data => {
callBack(data);
});
}
/**
*
*
* @param paramsObject
* @param callBack
*/
public getUserCountList(paramsObject: object, callBack) {
this.http.get(environment.baseUrl + 'outRechargeOrder/getUserCountList?' + this.common.getWhereCondition(paramsObject)).subscribe(data => {
callBack(data);
});
}
/**
*
*
* @param paramsObject
* @param callBack
*/
public exportUserOrderListCount(paramsObject: object, callBack) {
this.http.get(environment.baseUrl + 'outRechargeOrder/exportUserOrderListCount?' + this.common.getWhereCondition(paramsObject)).subscribe(data => {
callBack(data);
});
}
}

Loading…
Cancel
Save