This commit is contained in:
潘晓云
2022-03-09 14:18:56 +08:00
parent 647d42690c
commit 957a66254f
4 changed files with 126 additions and 36 deletions

View File

@ -1,9 +1,35 @@
<page-header [action]="phActionTpl">
<ng-template #phActionTpl>
<button (click)="add()" nz-button nzType="primary">新建</button>
</ng-template>
</page-header>
<nz-card> <nz-card>
<sf mode="search" [schema]="searchSchema" (formSubmit)="st.reset($event)" (formReset)="st.reset($event)"></sf> <sf mode="search" [schema]="schema" [ui]="ui" [button]="'none'" (formSubmit)="st.load(1)" (formReset)="resetSF()" #sf>
<st #st [data]="url" [columns]="columns"></st> <button nz-button nzType="primary" [disabled]="!sf.valid" [nzLoading]="service.http.loading"
(click)="st?.load(1)">查询</button>
<button nz-button (click)="resetSF()">重置</button>
<button nz-button (click)="export()" nzType="primary" nzGhost>导出</button>
</sf>
</nz-card>
<nz-card>
<st #st [data]="service.$api_get_partner_statistics_page" [columns]="columns" [scroll]="{ x: '1200px' }"
[req]="{ method: 'POST', allInBody: true, reName: { pi: 'pageIndex', ps: 'pageSize' }, params: reqParams }"
[res]="{ reName: { list: 'data.records', total: 'data.total' } }"
[page]="{ show: true, showSize: true, pageSizes: [10, 20, 30, 50, 100, 200, 300, 500, 1000] }"
[loading]="service.http.loading">
<ng-template st-row="approvalStatus" let-item>
<a [routerLink]="'/partner/business-statistics/partner/custom-detail/'+item?.id">{{item.yskmoney}}</a>
</ng-template>
<ng-template st-row="approvalStatus1" let-item>
<div class="text-right">{{item.approvalStatus1 | currency:' '}}</div>
</ng-template>
<ng-template st-row="approvalStatus2" let-item>
<a class="text-right text-blue-dark"
[routerLink]="'/partner/business-statistics/partner/order-detail/'+item?.id">{{item.yskmoney | currency:'
'}}</a>
</ng-template>
<ng-template st-row="approvalStatus3" let-item>
<div class="text-right">{{item.yskmoney | currency:' '}}</div>
</ng-template>
<ng-template st-row="approvalStatus4" let-item>
<div class="text-right">{{item.armoney | currency:' '}}</div>
</ng-template>
</st>
</nz-card> </nz-card>

View File

@ -1,7 +1,8 @@
import { Component, OnInit, ViewChild } from '@angular/core'; import { Component, OnInit, ViewChild } from '@angular/core';
import { STColumn, STComponent } from '@delon/abc/st'; import { STColumn, STComponent } from '@delon/abc/st';
import { SFSchema } from '@delon/form'; import { SFComponent, SFSchema, SFUISchema } from '@delon/form';
import { ModalHelper, _HttpClient } from '@delon/theme'; import { ModalHelper, _HttpClient } from '@delon/theme';
import { BussinessStatisticsService } from '../../../business-statistics/services/bussiness-statistics.service';
@Component({ @Component({
selector: 'app-partner-list', selector: 'app-partner-list',
@ -9,37 +10,88 @@ import { ModalHelper, _HttpClient } from '@delon/theme';
}) })
export class PartnerAccountManagementListComponent implements OnInit { export class PartnerAccountManagementListComponent implements OnInit {
url = `/user`; url = `/user`;
searchSchema: SFSchema = { schema!: SFSchema;
properties: { ui!: SFUISchema;
no: { @ViewChild('st') private readonly st!: STComponent;
type: 'string', @ViewChild('sf') private readonly sf!: SFComponent;
title: '编号' columns: STColumn[] = [];
constructor(public service: BussinessStatisticsService) { }
/**
* 查询参数
*/
get reqParams() {
const params = { ...this.sf?.value };
return params
}
ngOnInit(): void {
this.initSF();
this.initST();
}
initSF() {
this.schema = {
properties: {
abnormalCause: {
title: '合伙人名称',
type: 'string',
ui: {
placeholder: '请输入',
},
},
abnormalCause1: {
title: '类型',
type: 'string',
default: '',
enum: [
{
label: '全部',
value: ''
},
{
label: '个人',
value: '1'
},
{
label: '企业',
value: '2'
}
],
ui: {
widget: 'select'
},
},
} }
} }
}; this.ui = { '*': { spanLabelFixed: 120, grid: { span: 8, gutter: 4 } } };
@ViewChild('st') private readonly st!: STComponent; }
columns: STColumn[] = [ /**
{ title: '编号', index: 'no' }, * 初始化数据列表
{ title: '调用次数', type: 'number', index: 'callNo' }, */
{ title: '头像', type: 'img', width: '50px', index: 'avatar' }, initST() {
{ title: '时间', type: 'date', index: 'updatedAt' }, this.columns = [
{ { title: '合伙人名称', index: 'carNo', className: 'text-center', width: 150 },
title: '', { title: '类型', render: 'carModelLabel', className: 'text-center', width: 150 },
buttons: [ { title: '注册时间', index: 'carNo', className: 'text-center', width: 150 },
// { text: '查看', click: (item: any) => `/form/${item.id}` }, { title: '本月新增客户', render: 'approvalStatus0', className: 'text-center', sort: true, width: 150 },
// { text: '编辑', type: 'static', component: FormEditComponent, click: 'reload' }, { title: '客户总数', render: 'approvalStatus', className: 'text-center', sort: true, width: 150 },
] { title: '本月已结算金额(元)', render: 'approvalStatus1', className: 'text-right', sort: true, width: 180 },
} { title: '累计已结算金额(元)', render: 'approvalStatus2', className: 'text-right', sort: true, width: 180 },
]; { title: '本月预估收益(元)', render: 'approvalStatus3', className: 'text-right', sort: true, width: 180 },
{ title: '累计收益(元)', render: 'approvalStatus4', className: 'text-right', sort: true, width: 180 },
];
}
constructor(private http: _HttpClient, private modal: ModalHelper) { } resetSF() {
this.sf.reset();
setTimeout(() => {
this.st.reset();
})
}
ngOnInit(): void { } export() {
add(): void {
// this.modal
// .createStatic(FormEditComponent, { i: { id: 0 } })
// .subscribe(() => this.st.reload());
} }
} }

View File

@ -0,0 +1,12 @@
import { Injectable, Injector } from '@angular/core';
import { BaseService } from '@shared';
@Injectable({
providedIn: 'root'
})
export class AccountManagemantService extends BaseService {
constructor(public injector: Injector) {
super(injector)
}
}

View File

@ -72,7 +72,7 @@ const routes: Routes = [
path: 'download', path: 'download',
loadChildren: () => import('./download/download.module').then(m => m.DownloadModule) loadChildren: () => import('./download/download.module').then(m => m.DownloadModule)
} }
{ path: 'account-management', loadChildren: () => import('./account-management/account-management.module').then((m) => m.AccountManagementModule) },] ]
}, },
// passport // passport
{ path: '', loadChildren: () => import('./passport/passport.module').then(m => m.PassportModule) }, { path: '', loadChildren: () => import('./passport/passport.module').then(m => m.PassportModule) },
@ -92,4 +92,4 @@ const routes: Routes = [
], ],
exports: [RouterModule] exports: [RouterModule]
}) })
export class RouteRoutingModule {} export class RouteRoutingModule { }