客户明细

This commit is contained in:
潘晓云
2022-02-24 17:18:22 +08:00
parent 522043df21
commit 984a9a85f0
13 changed files with 355 additions and 17 deletions

View File

@ -0,0 +1,42 @@
<page-header-wrapper [title]="'客户明细'" [logo]="logo">
<ng-template #logo>
<button nz-button nz-tooltip nzTooltipTitle="返回上一页" (click)="goBack()">
<i nz-icon nzType="left" nzTheme="outline"></i>
</button>
</ng-template>
</page-header-wrapper>
<nz-card>
<div class="user-info border-1" nz-row>
<div nz-col nzSpan="24" class="d-flex p-md">
<img class="user-logo" [src]="detailInfo?.logo" />
<div style="flex: 1;">
<div>
<h3>{{detailInfo?.company}}</h3>
<div class="mb-sm">
<span class="letf-box text-grey-dark">{{detailInfo?.code}}</span>
<span class="mr-xs">{{detailInfo?.proxy}}</span>
</div>
<div>
<span class="letf-box">添加时间:{{detailInfo?.createTime}}</span>
<span c>所属城市:{{detailInfo?.belongCity}}</span>
</div>
</div>
</div>
</div>
</div>
<div class="mt-md" nz-row>
<div nz-col [nzSpan]="12">
<sf #sf [schema]="schema" [ui]="ui" [compact]="true" [button]="'none'"> </sf>
</div>
<div nz-col [nzSpan]="8">
<button nz-button nzType="primary" [disabled]="!sf.valid" [nzLoading]="service.http.loading"
(click)="search()">查询</button>
<button nz-button (click)="resetSF()">重置</button>
<button nz-button (click)="export()" nzType="primary" nzGhost>导出</button>
</div>
</div>
</nz-card>
<nz-card>
<st #st [data]="service.$api_get_partner_statistics_page" [columns]="columns"></st>
</nz-card>

View File

@ -0,0 +1,11 @@
:host {
.user-logo {
width: 90px;
}
.letf-box {
width: 250px;
display: inline-block;
}
}

View File

@ -0,0 +1,24 @@
import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing';
import { PartnerPartnerCustomDetailComponent } from './partner-custom-detail.component';
describe('PartnerPartnerCustomDetailComponent', () => {
let component: PartnerPartnerCustomDetailComponent;
let fixture: ComponentFixture<PartnerPartnerCustomDetailComponent>;
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
declarations: [ PartnerPartnerCustomDetailComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(PartnerPartnerCustomDetailComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -0,0 +1,132 @@
import { Component, OnInit, ViewChild } from '@angular/core';
import { STColumn, STComponent } from '@delon/abc/st';
import { SFComponent, SFSchema, SFUISchema } from '@delon/form';
import { ModalHelper, _HttpClient } from '@delon/theme';
import { BussinessStatisticsService } from '../../services/bussiness-statistics.service';
@Component({
selector: 'app-partner-partner-custom-detail',
templateUrl: './partner-custom-detail.component.html',
styleUrls: ['./partner-custom-detail.component.less']
})
export class PartnerPartnerCustomDetailComponent implements OnInit {
schema: SFSchema = {};
ui!: SFUISchema;
detailInfo: any = {
logo: './assets/images/user/logo.svg',
company: '张三',
code: '91440300357887492H',
proxy: '企业合伙人',
belongCity: '深圳、上海、北京',
createTime: '2021-09-23 14:43:31'
}
@ViewChild('st') private readonly st!: STComponent;
@ViewChild('sf') private readonly sf!: SFComponent;
columns: STColumn[] = [
{ title: '编号', index: 'no' },
{ title: '调用次数', type: 'number', index: 'callNo' },
{ title: '头像', type: 'img', width: '50px', index: 'avatar' },
{ title: '时间', type: 'date', index: 'updatedAt' },
{
title: '',
buttons: [
// { text: '查看', click: (item: any) => `/form/${item.id}` },
// { text: '编辑', type: 'static', component: FormEditComponent, click: 'reload' },
]
}
];
_$expand = false;
constructor(public service: BussinessStatisticsService) {
}
ngOnInit(): void {
this.initST();
this.initSF();
}
resetSF() {
this._$expand = false;
this.sf.reset()
}
/**
* 伸缩查询条件
*/
expandToggle() {
this._$expand = !this._$expand;
this.sf?.setValue('/_$expand', this._$expand);
}
add(): void {
// this.modal
// .createStatic(FormEditComponent, { i: { id: 0 } })
// .subscribe(() => this.st.reload());
}
search() {
this.st.load(1);
}
export() {
}
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: 100, grid: { span: 11, gutter: 4 } },
};
}
/**
* 初始化数据列表
*/
initST() {
this.columns = [
{ title: '合伙人名称', index: 'carNo', className: 'text-center' },
{ title: '类型', render: 'carModelLabel', className: 'text-center' },
{ title: '注册时间', index: 'carNo', className: 'text-center' },
{ title: '本月新增客户', render: 'approvalStatus0', className: 'text-center', sort: true },
{ title: '客户总数', render: 'approvalStatus', className: 'text-center', sort: true },
{ title: '本月已结算金额(元)', render: 'approvalStatus1', className: 'text-center', sort: true },
{ title: '累计已结算金额(元)', render: 'approvalStatus2', className: 'text-center', sort: true },
{ title: '本月预估收益(元)', render: 'approvalStatus3', className: 'text-center', sort: true },
{ title: '累计收益(元)', render: 'approvalStatus4', className: 'text-center', sort: true },
];
}
goBack() {
window.history.go(-1);
}
}

View File

@ -1,24 +1,24 @@
<nz-card>
<sf mode="search" [schema]="schema" [ui]="ui" (formSubmit)="st.reset($event)" (formReset)="st.reset($event)"></sf>
<sf mode="search" [schema]="schema" [ui]="ui" (formSubmit)="st.load(1)" (formReset)="resetSF()" #sf></sf>
</nz-card>
<nz-card>
<st #st [data]="url" [columns]="columns">
<st #st [data]="service.$api_get_partner_statistics_page" [columns]="columns">
<ng-template st-row="approvalStatus" let-item>
<a [routerLink]="'/'">{{item.approvalStatus}}</a>
<a [routerLink]="'/partner/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>
<div class="text-right">{{item.approvalStatus1 | currency:' '}}</div>
<a class="text-right text-blue-dark">{{item.yskmoney | currency:' '}}</a>
</ng-template>
<ng-template st-row="approvalStatus3" let-item>
<div class="text-right">{{item.approvalStatus1 | currency:' '}}</div>
<div class="text-right">{{item.yskmoney | currency:' '}}</div>
</ng-template>
<ng-template st-row="approvalStatus4" let-item>
<div class="text-right">{{item.approvalStatus1 | currency:' '}}</div>
<div class="text-right">{{item.armoney | currency:' '}}</div>
</ng-template>
</st>
</nz-card>

View File

@ -1,7 +1,8 @@
import { Component, OnInit, ViewChild } from '@angular/core';
import { STColumn, STComponent } from '@delon/abc/st';
import { SFSchema, SFUISchema } from '@delon/form';
import { SFComponent, SFSchema, SFUISchema } from '@delon/form';
import { ModalHelper, _HttpClient } from '@delon/theme';
import { BussinessStatisticsService } from '../../services/bussiness-statistics.service';
@Component({
selector: 'app-partner-partner-statistics',
@ -12,9 +13,10 @@ export class PartnerPartnerStatisticsComponent implements OnInit {
schema!: SFSchema;
ui!: SFUISchema;
@ViewChild('st') private readonly st!: STComponent;
@ViewChild('sf') private readonly sf!: SFComponent;
columns: STColumn[] = [];
constructor(private http: _HttpClient, private modal: ModalHelper) { }
constructor(public service: BussinessStatisticsService) { }
ngOnInit(): void {
this.initSF();
@ -65,15 +67,19 @@ export class PartnerPartnerStatisticsComponent implements OnInit {
{ title: '合伙人名称', index: 'carNo', className: 'text-center' },
{ title: '类型', render: 'carModelLabel', className: 'text-center' },
{ title: '注册时间', index: 'carNo', className: 'text-center' },
{ title: '本月新增客户', render: 'approvalStatus', className: 'text-center', sort: true },
{ title: '本月新增客户', render: 'approvalStatus0', className: 'text-center', sort: true },
{ title: '客户总数', render: 'approvalStatus', className: 'text-center', sort: true },
{ title: '本月已结算金额(元)', render: 'approvalStatus1', className: 'text-center', sort: true },
{ title: '累计已结算金额(元)', render: 'approvalStatus2', className: 'text-center', sort: true },
{ title: '本月预估收益(元)', render: 'approvalStatus3', className: 'text-center', sort: true },
{ title: '累计收益(元)', render: 'approvalStatus4', className: 'text-center', sort: true },
];
}
resetSF() {
this.sf.reset();
this.st.reset();
}
}

View File

@ -0,0 +1,27 @@
<page-header-wrapper [title]="''" [content]="content">
<ng-template #content>
<div class="user-info border-1" nz-row>
<div nz-col nzSpan="24" class="d-flex p-md">
<img class="user-logo" [src]="detailInfo?.logo" />
<div style="flex: 1;">
<div>
<h3>{{detailInfo?.name}}</h3>
<div>
<span class="mr-md">{{detailInfo?.phone}}</span>
<span class="mr-xs">{{detailInfo?.proxy}}</span>
<span>{{detailInfo?.level}}</span>
</div>
<p>添加时间:{{detailInfo?.createTime}}</p>
</div>
</div>
</div>
</div>
</ng-template>
</page-header-wrapper>
<nz-card>
</nz-card>
<nz-card>
<sf mode="search" [schema]="searchSchema" (formSubmit)="st.reset($event)" (formReset)="st.reset($event)"></sf>
<st #st [data]="url" [columns]="columns"></st>
</nz-card>

View File

@ -0,0 +1,24 @@
import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing';
import { PartnerSaleCustomDetailComponent } from './sale-custom-detail.component';
describe('PartnerSaleCustomDetailComponent', () => {
let component: PartnerSaleCustomDetailComponent;
let fixture: ComponentFixture<PartnerSaleCustomDetailComponent>;
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
declarations: [ PartnerSaleCustomDetailComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(PartnerSaleCustomDetailComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -0,0 +1,53 @@
import { Component, OnInit, ViewChild } from '@angular/core';
import { STColumn, STComponent } from '@delon/abc/st';
import { SFSchema } from '@delon/form';
import { ModalHelper, _HttpClient } from '@delon/theme';
@Component({
selector: 'app-partner-sale-custom-detail',
templateUrl: './sale-custom-detail.component.html',
})
export class PartnerSaleCustomDetailComponent implements OnInit {
url = `/user`;
searchSchema: SFSchema = {
properties: {
no: {
type: 'string',
title: '编号'
}
}
};
detailInfo: any = {
logo: './assets/images/user/logo.svg',
name: '张三',
phone: '1399999999',
proxy: '城市代理',
level: '二级',
createTime: '添加时间'
}
@ViewChild('st') private readonly st!: STComponent;
columns: STColumn[] = [
{ title: '编号', index: 'no' },
{ title: '调用次数', type: 'number', index: 'callNo' },
{ title: '头像', type: 'img', width: '50px', index: 'avatar' },
{ title: '时间', type: 'date', index: 'updatedAt' },
{
title: '',
buttons: [
// { text: '查看', click: (item: any) => `/form/${item.id}` },
// { text: '编辑', type: 'static', component: FormEditComponent, click: 'reload' },
]
}
];
constructor(private http: _HttpClient, private modal: ModalHelper) { }
ngOnInit(): void { }
add(): void {
// this.modal
// .createStatic(FormEditComponent, { i: { id: 0 } })
// .subscribe(() => this.st.reload());
}
}

View File

@ -0,0 +1,13 @@
import { Injectable, Injector } from '@angular/core';
import { BaseService } from '@shared';
@Injectable({
providedIn: 'root'
})
export class BussinessStatisticsService extends BaseService {
$api_get_partner_statistics_page = `/api/fcc/ficoBrmH/list/page`;
constructor(public injector: Injector) {
super(injector);
}
}

View File

@ -1,13 +1,14 @@
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { PartnerBusinessStatisticsIndexComponent } from './business-statistics/components/index/index.component';
import { PartnerPartnerStatisticsComponent } from './business-statistics/components/partner-statistics/partner-statistics.component';
import { PartnerSaleStatisticsComponent } from './business-statistics/components/sale-statistics/sale-statistics.component';
import { PartnerPartnerCustomDetailComponent } from './business-statistics/components/partner-custom-detail/partner-custom-detail.component';
import { PartnerSaleCustomDetailComponent } from './business-statistics/components/sale-custom-detail/sale-custom-detail.component';
const routes: Routes = [
{ path: 'business-statistics/index', component: PartnerBusinessStatisticsIndexComponent },
{ path: 'partner-statistics', component: PartnerPartnerStatisticsComponent },
{ path: 'sale-statistics', component: PartnerSaleStatisticsComponent }];
{ path: 'sale-custom/detail/:id', component: PartnerSaleCustomDetailComponent },
{ path: 'partner-custom/detail/:id', component: PartnerPartnerCustomDetailComponent },
];
@NgModule({
imports: [RouterModule.forChild(routes)],

View File

@ -5,11 +5,16 @@ import { PartnerRoutingModule } from './partner-routing.module';
import { PartnerBusinessStatisticsIndexComponent } from './business-statistics/components/index/index.component';
import { PartnerPartnerStatisticsComponent } from './business-statistics/components/partner-statistics/partner-statistics.component';
import { PartnerSaleStatisticsComponent } from './business-statistics/components/sale-statistics/sale-statistics.component';
import { PartnerSaleCustomDetailComponent } from './business-statistics/components/sale-custom-detail/sale-custom-detail.component';
import { PartnerPartnerCustomDetailComponent } from './business-statistics/components/partner-custom-detail/partner-custom-detail.component';
const COMPONENTS: any[] = [
PartnerBusinessStatisticsIndexComponent,
PartnerPartnerStatisticsComponent,
PartnerSaleStatisticsComponent];
PartnerSaleStatisticsComponent,
PartnerPartnerCustomDetailComponent,
PartnerPartnerCustomDetailComponent,
PartnerSaleCustomDetailComponent];
@NgModule({
declarations: [...COMPONENTS],
imports: [CommonModule, PartnerRoutingModule, SharedModule]

View File

@ -8,7 +8,7 @@
<ng-template #content>
<div class="user-info" nz-row>
<div nz-col nzSpan="24" class="d-flex">
<img [src]="detailData?.enterpriseLogo" />
<img [src]="detailData?.enterpriseLogo" style="width: 120px;" />
<div style="flex: 1;">
<div nz-row>
<div nz-col [nzLg]="12" [nzSm]="24" [nzXs]="24">
@ -266,4 +266,4 @@
</div>
</div>
</nz-upload>
</ng-template>
</ng-template>