pull/1/head
袁野 3 years ago
parent 12cb9736c8
commit 4bf838ffc2
  1. 33
      src/app/admin/user/user-gold/user-gold.component.html
  2. 21
      src/app/admin/user/user-gold/user-gold.component.ts
  3. 13
      src/app/services/user.service.ts

@ -4,24 +4,14 @@
<div class="inner-content">
<div nz-row [nzGutter]="8" class="statistics">
<div nz-col [nzSpan]="6">
<nz-card nzTitle="收入">
<span>¥ 300</span>
<div nz-col [nzSpan]="12">
<nz-card nzTitle="收入">
<span>¥ {{income}}</span>
</nz-card>
</div>
<div nz-col [nzSpan]="6">
<nz-card nzTitle="总收入">
<span>¥ 9000</span>
</nz-card>
</div>
<div nz-col [nzSpan]="6">
<nz-card nzTitle="月支出">
<span style="color: red">¥ 200</span>
</nz-card>
</div>
<div nz-col [nzSpan]="6">
<nz-card nzTitle="总支出">
<span style="color: red">¥ 2000</span>
<div nz-col [nzSpan]="12">
<nz-card nzTitle="支出">
<span style="color: red">¥ {{expend}}</span>
</nz-card>
</div>
</div>
@ -53,6 +43,17 @@
</nz-form-control>
</nz-form-item>
</div>
<div nz-col nzSpan="8">
<nz-form-item>
<nz-form-label [nzSpan]="6">时间区间</nz-form-label>
<nz-form-control [nzSpan]="16">
<nz-range-picker
[nzFormat]="'yyyy/MM/dd'"
formControlName="createTime"
></nz-range-picker>
</nz-form-control>
</nz-form-item>
</div>
</div>
<div nz-row>

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

@ -48,6 +48,19 @@ export class UserService {
});
}
/**
* @Author Sum1Dream
* @methodName queryGold
* @Description //获取金币统计
* @Date 16:32 2021/9/22
* @Param mod
**/
public queryGold(paramsObject: object, callBack) {
this.http.get(environment.baseUrl + 'highGoldRec/queryGold?' + this.common.getWhereCondition(paramsObject)).subscribe(data => {
callBack(data);
});
}
/**
*
*

Loading…
Cancel
Save