|
|
@ -1,7 +1,6 @@ |
|
|
|
import {Component, OnInit} from '@angular/core'; |
|
|
|
import {Component, OnInit} from '@angular/core'; |
|
|
|
import {ADMIN_INFO_OBJECT} from '../../../services/local-storage.namespace'; |
|
|
|
import {ADMIN_INFO_OBJECT} from '../../../services/local-storage.namespace'; |
|
|
|
import {LocalStorageService} from '../../../services/local-storage.service'; |
|
|
|
import {LocalStorageService} from '../../../services/local-storage.service'; |
|
|
|
import {CommonsService} from '../../../services/commons.service'; |
|
|
|
|
|
|
|
import {IndexService} from '../../../services/index.service'; |
|
|
|
import {IndexService} from '../../../services/index.service'; |
|
|
|
import {NzMessageService} from '_ng-zorro-antd@9.3.0@ng-zorro-antd'; |
|
|
|
import {NzMessageService} from '_ng-zorro-antd@9.3.0@ng-zorro-antd'; |
|
|
|
import {environment} from '../../../../environments/environment'; |
|
|
|
import {environment} from '../../../../environments/environment'; |
|
|
@ -27,17 +26,21 @@ export class IndexComponent implements OnInit { |
|
|
|
orderData = {}; |
|
|
|
orderData = {}; |
|
|
|
balanceData = {}; |
|
|
|
balanceData = {}; |
|
|
|
rechargeData = {}; |
|
|
|
rechargeData = {}; |
|
|
|
|
|
|
|
tyBalance; |
|
|
|
|
|
|
|
|
|
|
|
constructor( |
|
|
|
constructor( |
|
|
|
private store: LocalStorageService, // 数据缓存
|
|
|
|
private store: LocalStorageService, // 数据缓存
|
|
|
|
private message: NzMessageService, // 信息提示
|
|
|
|
private message: NzMessageService, // 信息提示
|
|
|
|
private index: IndexService |
|
|
|
private index: IndexService |
|
|
|
) { } |
|
|
|
) { |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
ngOnInit(): void { |
|
|
|
ngOnInit(): void { |
|
|
|
this.roleType = this.store.get(ADMIN_INFO_OBJECT)['secRole'].roleType; |
|
|
|
this.roleType = this.store.get(ADMIN_INFO_OBJECT)['secRole'].roleType; |
|
|
|
if (this.roleType === 1) { |
|
|
|
if (this.roleType === 1) { |
|
|
|
this.getIndexCount(); |
|
|
|
this.getIndexCount(); |
|
|
|
this.getLineCount(); |
|
|
|
this.getLineCount(); |
|
|
|
|
|
|
|
this.queryCompanyAccountInfo2JD(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (this.store.get(ADMIN_INFO_OBJECT)['highAgent'] != null) { |
|
|
|
if (this.store.get(ADMIN_INFO_OBJECT)['highAgent'] != null) { |
|
|
@ -59,7 +62,7 @@ export class IndexComponent implements OnInit { |
|
|
|
const paramsObject = { |
|
|
|
const paramsObject = { |
|
|
|
codeType: 'HLT_BALANCE' |
|
|
|
codeType: 'HLT_BALANCE' |
|
|
|
}; |
|
|
|
}; |
|
|
|
this.index.getHLTBalance(paramsObject , data => { |
|
|
|
this.index.getHLTBalance(paramsObject, data => { |
|
|
|
if (data['return_code'] === '000000') { |
|
|
|
if (data['return_code'] === '000000') { |
|
|
|
this.loading = false; |
|
|
|
this.loading = false; |
|
|
|
this.balance = data['return_data']; |
|
|
|
this.balance = data['return_data']; |
|
|
@ -70,7 +73,7 @@ export class IndexComponent implements OnInit { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public orderByIndex(): void { |
|
|
|
public orderByIndex(): void { |
|
|
|
this.index.orderByIndex(this.code , data => { |
|
|
|
this.index.orderByIndex(this.code, data => { |
|
|
|
if (data['return_code'] === '000000') { |
|
|
|
if (data['return_code'] === '000000') { |
|
|
|
this.orderData = data['return_data']; |
|
|
|
this.orderData = data['return_data']; |
|
|
|
this.loading = false; |
|
|
|
this.loading = false; |
|
|
@ -80,8 +83,20 @@ export class IndexComponent implements OnInit { |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 查询团油余额
|
|
|
|
|
|
|
|
public queryCompanyAccountInfo2JD() { |
|
|
|
|
|
|
|
this.index.queryCompanyAccountInfo2JD(data => { |
|
|
|
|
|
|
|
if (data['return_code'] === '000000') { |
|
|
|
|
|
|
|
console.log(data); |
|
|
|
|
|
|
|
this.tyBalance = data['return_data']; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
this.message.error(data['return_msg']); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public HLTOrderByIndex(): void { |
|
|
|
public HLTOrderByIndex(): void { |
|
|
|
this.index.HLTOrderByIndex(this.code , data => { |
|
|
|
this.index.HLTOrderByIndex(this.code, data => { |
|
|
|
if (data['return_code'] === '000000') { |
|
|
|
if (data['return_code'] === '000000') { |
|
|
|
this.balanceData = data['return_data']; |
|
|
|
this.balanceData = data['return_data']; |
|
|
|
this.loading = false; |
|
|
|
this.loading = false; |
|
|
@ -92,7 +107,7 @@ export class IndexComponent implements OnInit { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public rechargeOrderByIndex(): void { |
|
|
|
public rechargeOrderByIndex(): void { |
|
|
|
this.index.rechargeOrderByIndex(this.code , data => { |
|
|
|
this.index.rechargeOrderByIndex(this.code, data => { |
|
|
|
if (data['return_code'] === '000000') { |
|
|
|
if (data['return_code'] === '000000') { |
|
|
|
this.rechargeData = data['return_data']; |
|
|
|
this.rechargeData = data['return_data']; |
|
|
|
this.loading = false; |
|
|
|
this.loading = false; |
|
|
@ -103,7 +118,7 @@ export class IndexComponent implements OnInit { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public HLTOrderByList(): void { |
|
|
|
public HLTOrderByList(): void { |
|
|
|
this.index.HLTOrderByList(this.code , data => { |
|
|
|
this.index.HLTOrderByList(this.code, data => { |
|
|
|
if (data['return_code'] === '000000') { |
|
|
|
if (data['return_code'] === '000000') { |
|
|
|
this.listOfData = data['return_data']; |
|
|
|
this.listOfData = data['return_data']; |
|
|
|
} else { |
|
|
|
} else { |
|
|
@ -186,7 +201,7 @@ export class IndexComponent implements OnInit { |
|
|
|
|
|
|
|
|
|
|
|
// 下载模板
|
|
|
|
// 下载模板
|
|
|
|
downloadTemplate() { |
|
|
|
downloadTemplate() { |
|
|
|
this.index.exportHLTOrderByList(this.code , data => { |
|
|
|
this.index.exportHLTOrderByList(this.code, data => { |
|
|
|
if (data['return_code'] === '000000') { |
|
|
|
if (data['return_code'] === '000000') { |
|
|
|
window.location.href = this.FILE_URL + data['return_data']; |
|
|
|
window.location.href = this.FILE_URL + data['return_data']; |
|
|
|
} else { |
|
|
|
} else { |
|
|
@ -205,7 +220,7 @@ export class IndexComponent implements OnInit { |
|
|
|
codeType: 'HLT_BALANCE', |
|
|
|
codeType: 'HLT_BALANCE', |
|
|
|
price: this.price |
|
|
|
price: this.price |
|
|
|
}; |
|
|
|
}; |
|
|
|
this.index.addHLTBalance(paramsObject , data => { |
|
|
|
this.index.addHLTBalance(paramsObject, data => { |
|
|
|
if (data['return_code'] === '000000') { |
|
|
|
if (data['return_code'] === '000000') { |
|
|
|
this.getHLTBalance(); |
|
|
|
this.getHLTBalance(); |
|
|
|
this.isVisibleAdd = false; |
|
|
|
this.isVisibleAdd = false; |
|
|
|