|
|
|
@ -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']); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|