|
|
|
@ -19,6 +19,8 @@ export class UserGoldComponent implements OnInit { |
|
|
|
|
pageNum = 1; // 页码
|
|
|
|
|
pageSize = 10; // 条码
|
|
|
|
|
loading = true; |
|
|
|
|
income = 0; // 收入
|
|
|
|
|
expend = 0; // 支出
|
|
|
|
|
|
|
|
|
|
constructor( |
|
|
|
|
private form: FormBuilder, |
|
|
|
@ -37,6 +39,7 @@ export class UserGoldComponent implements OnInit { |
|
|
|
|
this.searchForm = this.form.group({ |
|
|
|
|
goldType: [null], |
|
|
|
|
resType: [null], |
|
|
|
|
createTime: [null], |
|
|
|
|
}); |
|
|
|
|
this.getRequest(true, this.searchForm.value); |
|
|
|
|
} |
|
|
|
@ -48,6 +51,10 @@ export class UserGoldComponent implements OnInit { |
|
|
|
|
if (reset) { |
|
|
|
|
this.pageNum = 1; |
|
|
|
|
} |
|
|
|
|
if (whereObject['createTime'] != null && whereObject['createTime'].length > 0) { |
|
|
|
|
whereObject['createTimeS'] = new Date(whereObject['createTime'][0]).getTime(); |
|
|
|
|
whereObject['createTimeE'] = new Date(whereObject['createTime'][1]).getTime(); |
|
|
|
|
} |
|
|
|
|
whereObject['pageNum'] = this.pageNum; |
|
|
|
|
whereObject['pageSize'] = this.pageSize; |
|
|
|
|
this.user.getGoldRecList(whereObject, data => { |
|
|
|
@ -58,6 +65,20 @@ export class UserGoldComponent implements OnInit { |
|
|
|
|
this.message.error(data['return_msg']); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
this.user.queryGold(whereObject , data => { |
|
|
|
|
this.income = 0; |
|
|
|
|
this.expend = 0; |
|
|
|
|
if (data['return_code'] === '000000') { |
|
|
|
|
for (const datum of data['return_data']) { |
|
|
|
|
if (datum['gold_type'] === 1) { |
|
|
|
|
this.income = datum['sum']; |
|
|
|
|
} |
|
|
|
|
if (datum['gold_type'] === 2) { |
|
|
|
|
this.expend = datum['sum']; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 重置
|
|
|
|
|