diff --git a/src/app/admin/index/index/index.component.html b/src/app/admin/index/index/index.component.html index b75c0fa..d0c39b1 100644 --- a/src/app/admin/index/index/index.component.html +++ b/src/app/admin/index/index/index.component.html @@ -1,10 +1,20 @@ - + + + 首页 + + -
-
+ +
+ +
+ +
+ +

汇联通预充值账号

@@ -31,10 +41,45 @@
- + +
+
+
+ +

{{countData['registrantNum']}}

+
+
+
+ +

{{countData['transactionNum']}}

+
+
+
+ +

{{countData['transactionOrder']}}

+
+
+
+ +

{{countData['transactionToday']}}

+
+
+
+ +

{{countData['transactionOrderToday']}}

+
+
+
+
+
- + +
+ +
+ + 编号 @@ -75,3 +120,17 @@
+ + + +
+
+ + 充值金额 + + + + +
+
+
diff --git a/src/app/admin/index/index/index.component.ts b/src/app/admin/index/index/index.component.ts index 447515a..8330c5a 100644 --- a/src/app/admin/index/index/index.component.ts +++ b/src/app/admin/index/index/index.component.ts @@ -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,25 +34,32 @@ 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(); + this.rechargeOrderByIndex(); + this.HLTOrderByList(); } - this.getHLTBalance(); - this.orderByIndex(); - this.HLTOrderByIndex(); - this.rechargeOrderByIndex(); - 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']); + } + }); + } + } diff --git a/src/app/services/index.service.ts b/src/app/services/index.service.ts index a15b150..b255fa5 100644 --- a/src/app/services/index.service.ts +++ b/src/app/services/index.service.ts @@ -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); + }); + } + + }