pull/1/head
袁野 3 years ago
parent 448dfdc458
commit 79b068eb5f
  1. 69
      src/app/admin/index/index/index.component.html
  2. 127
      src/app/admin/index/index/index.component.ts
  3. 21
      src/app/services/index.service.ts

@ -1,10 +1,20 @@
<!-- start 面包屑 -->
<app-breadcrumb></app-breadcrumb>
<nz-breadcrumb>
<nz-breadcrumb-item>
首页
</nz-breadcrumb-item>
</nz-breadcrumb>
<!-- end 面包屑 -->
<!--条件搜索-->
<div class="inner-content">
<div nz-row [nzGutter]="16">
<!--渠道公司-->
<div class="inner-content" *ngIf="roleType == 7">
<div nz-row >
<button nz-button nzType="primary" (click)="isVisibleAdd = true">新增预充值余额</button>
</div>
<div nz-row style="margin-top: 20px;" [nzGutter]="16">
<div nz-col nzSpan="8">
<nz-card nzHoverable [nzLoading]="loading" (click)="isVisible = true">
<h3>汇联通预充值账号</h3>
@ -31,10 +41,45 @@
</div>
</div>
</div>
<!--运营角色-->
<div class="inner-content" *ngIf="roleType == 1">
<div nz-row style="margin-top: 20px;" [nzGutter]="16">
<div nz-col nzSpan="8">
<nz-card nzHoverable [nzLoading]="loading" [nzTitle]="'注册总人数'">
<h3>{{countData['registrantNum']}}</h3>
</nz-card>
</div>
<div nz-col nzSpan="8">
<nz-card nzHoverable [nzLoading]="loading" [nzTitle]="'总交易金额'">
<h3>{{countData['transactionNum']}}</h3>
</nz-card>
</div>
<div nz-col nzSpan="8">
<nz-card nzHoverable [nzLoading]="loading" [nzTitle]="'总交易订单数量'">
<h3>{{countData['transactionOrder']}}</h3>
</nz-card>
</div>
<div nz-col nzSpan="8" style="margin-top: 20px">
<nz-card nzHoverable [nzLoading]="loading" [nzTitle]="'当天交易金额'">
<h3>{{countData['transactionToday']}}</h3>
</nz-card>
</div>
<div nz-col nzSpan="8" style="margin-top: 20px">
<nz-card nzHoverable [nzLoading]="loading" [nzTitle]="'当天交易订单'">
<h3>{{countData['transactionOrderToday']}}</h3>
</nz-card>
</div>
</div>
<div style="margin-top: 20px" echarts [options]="data"></div>
</div>
<nz-modal [(nzVisible)]="isVisible" nzWidth="1200" nzTitle="订单列表" (nzOnCancel)="isVisible = false" (nzOnOk)="isVisible = false">
<nz-table #basicTable [nzData]="listOfData" [nzScroll]="{ x: '1200px' }">
<div nz-row>
<button nz-button nzType="primary" (click)="downloadTemplate()">导出汇联通预充值数据</button>
</div>
<nz-table #basicTable [nzData]="listOfData" style="margin-top: 20px;" [nzScroll]="{ x: '1200px' }">
<thead>
<tr>
<th nzWidth="50px">编号</th>
@ -75,3 +120,17 @@
</tbody>
</nz-table>
</nz-modal>
<nz-modal [(nzVisible)]="isVisibleAdd" nzTitle="新增预充值余额" (nzOnCancel)="isVisibleAdd = false" (nzOnOk)="handleOk()">
<div nz-row>
<div nz-col nzSpan="18">
<nz-form-item>
<nz-form-label [nzSpan]="6">充值金额</nz-form-label>
<nz-form-control [nzSpan]="16">
<input nz-input placeholder="请输入充值金额..." [(ngModel)]="price" />
</nz-form-control>
</nz-form-item>
</div>
</div>
</nz-modal>

@ -4,6 +4,7 @@ import {LocalStorageService} from '../../../services/local-storage.service';
import {CommonsService} from '../../../services/commons.service';
import {IndexService} from '../../../services/index.service';
import {NzMessageService} from '_ng-zorro-antd@9.3.0@ng-zorro-antd';
import {environment} from '../../../../environments/environment';
@Component({
@ -12,13 +13,17 @@ import {NzMessageService} from '_ng-zorro-antd@9.3.0@ng-zorro-antd';
styleUrls: ['./index.component.less']
})
export class IndexComponent implements OnInit {
secRoleId: number;
FILE_URL = environment.imageUrl;
roleType: number;
loading = true;
isVisible = false;
isVisibleAdd = false;
balance: number;
price: number;
code = 60;
listOfData;
countData: any = {};
data: any = {};
orderData = {};
balanceData = {};
rechargeData = {};
@ -29,13 +34,19 @@ export class IndexComponent implements OnInit {
) { }
ngOnInit(): void {
this.store.get(ADMIN_INFO_OBJECT)['secRole'].id = this.secRoleId;
this.roleType = this.store.get(ADMIN_INFO_OBJECT)['secRole'].roleType;
console.log(this.roleType);
if (this.roleType === 1) {
this.getIndexCount();
this.getLineCount();
}
if (this.store.get(ADMIN_INFO_OBJECT)['highAgent'] != null) {
this.code = this.store.get(ADMIN_INFO_OBJECT)['highAgent'].id;
}
if (this.store.get(ADMIN_INFO_OBJECT)['bsCompany'].id === 3) {
this.code = 60;
}
this.getHLTBalance();
this.orderByIndex();
this.HLTOrderByIndex();
@ -43,11 +54,12 @@ export class IndexComponent implements OnInit {
this.HLTOrderByList();
}
}
// 查询余额
public getHLTBalance(): void {
const paramsObject = {
codeType: 'HLT_BALANCE',
codeName: '汇联通预充值余额'
codeType: 'HLT_BALANCE'
};
this.index.getHLTBalance(paramsObject , data => {
if (data['return_code'] === '000000') {
@ -102,4 +114,107 @@ export class IndexComponent implements OnInit {
});
}
public getIndexCount(): void {
this.index.getIndexCount(data => {
if (data['return_code'] === '000000') {
this.loading = false;
this.countData = data['return_data'];
} else {
this.message.error(data['return_msg']);
}
});
}
public getLineCount(): void {
this.index.getLineCount(data => {
console.log(data);
if (data['return_code'] === '000000') {
this.data = {
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'cross',
label: {
backgroundColor: '#6a7985'
}
}
},
legend: {},
xAxis: {
type: 'category',
data: data['return_data']['date']
},
yAxis: {
type: 'value'
},
series: [
{
name: '订单金额',
data: data['return_data']['orderPriceSum'],
type: 'line'
},
{
name: '话费订单金额',
data: data['return_data']['orderRechargePriceSum'],
type: 'line'
},
{
name: '订单数量',
data: data['return_data']['orderCount'],
type: 'line'
},
{
name: '话费订单数量',
data: data['return_data']['orderRechargeCount'],
type: 'line'
},
{
name: '用户注册数量',
data: data['return_data']['userCount'],
type: 'line'
},
{
name: '话费订单金额',
data: data['return_data']['orderRechargePriceSum'],
type: 'line'
}
]
};
} else {
this.message.error(data['return_msg']);
}
});
}
// 下载模板
downloadTemplate() {
this.index.exportHLTOrderByList(this.code , data => {
if (data['return_code'] === '000000') {
window.location.href = this.FILE_URL + data['return_data'];
} else {
this.message.error(data['return_msg']);
}
});
}
handleOk(): void {
if (this.price == null) {
this.message.error('请输入充值金额');
return;
}
const paramsObject = {
codeType: 'HLT_BALANCE',
price: this.price
};
this.index.addHLTBalance(paramsObject , data => {
if (data['return_code'] === '000000') {
this.getHLTBalance();
this.isVisibleAdd = false;
} else {
this.message.error(data['return_msg']);
}
});
}
}

@ -26,6 +26,20 @@ export class IndexService {
});
}
// 运营角色查询统计
public getIndexCount(callBack) {
this.http.get(environment.baseUrl + 'common/getIndexCount').subscribe(data => {
callBack(data);
});
}
// 运营角色查询折线图数据
public getLineCount(callBack) {
this.http.get(environment.baseUrl + 'common/getLineCount').subscribe(data => {
callBack(data);
});
}
/**
* @Author Sum1Dream
* @methodName addHLTBalance
@ -91,4 +105,11 @@ export class IndexService {
});
}
public exportHLTOrderByList(code: number, callBack) {
this.http.get(environment.baseUrl + 'highOrder/exportHLTOrderByList?code=' + code).subscribe(data => {
callBack(data);
});
}
}

Loading…
Cancel
Save