Merge branch 'develop' of https://gitlab.eascs.com/tms-ui/tms-obc-web into develop

This commit is contained in:
潘晓云
2022-03-29 16:46:45 +08:00
73 changed files with 2104 additions and 263 deletions

View File

@ -20,7 +20,7 @@ module.exports = {
// }
'//api': {
target: {
host: 'tms-api-test.eascs.com',
host: 'tms-api-dev.eascs.com',
protocol: 'https:',
port: 443
},

View File

@ -244,7 +244,7 @@ export class ContractManagementTemplateFrameComponent implements OnInit {
this.service.request(this.service.$api_deletebatch_contractTemplate, [value.id]).subscribe(res => {
if (res) {
this.service.msgSrv.success('删除成功!');
this.st.reload(1)
this.st.reload()
}
})
});

View File

@ -244,7 +244,7 @@ export class ContractManagementTemplatePartnerComponent implements OnInit {
this.service.request(this.service.$api_deletebatch_contractTemplate, [value.id]).subscribe(res => {
if (res) {
this.service.msgSrv.success('删除成功!');
this.st.reload(1)
this.st.reload()
}
})
});

View File

@ -0,0 +1,6 @@
<!-- 页头 -->
<page-header-wrapper [title]="'数据报表'"></page-header-wrapper>
<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 { DatatableCustomindexComponent } from './customindex.component';
describe('DatatableCustomindexComponent', () => {
let component: DatatableCustomindexComponent;
let fixture: ComponentFixture<DatatableCustomindexComponent>;
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
declarations: [ DatatableCustomindexComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(DatatableCustomindexComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -0,0 +1,45 @@
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-datatable-customindex',
templateUrl: './customindex.component.html',
})
export class DatatableCustomindexComponent implements OnInit {
url = `/user`;
searchSchema: SFSchema = {
properties: {
no: {
type: 'string',
title: '编号'
}
}
};
@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,6 @@
<!-- 页头 -->
<page-header-wrapper [title]="'数据报表'"></page-header-wrapper>
<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 { DatatableCustomtableComponent } from './customtable.component';
describe('DatatableCustomtableComponent', () => {
let component: DatatableCustomtableComponent;
let fixture: ComponentFixture<DatatableCustomtableComponent>;
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
declarations: [ DatatableCustomtableComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(DatatableCustomtableComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -0,0 +1,45 @@
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-datatable-customtable',
templateUrl: './customtable.component.html',
})
export class DatatableCustomtableComponent implements OnInit {
url = `/user`;
searchSchema: SFSchema = {
properties: {
no: {
type: 'string',
title: '编号'
}
}
};
@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,6 @@
<!-- 页头 -->
<page-header-wrapper [title]="'数据报表'"></page-header-wrapper>
<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 { DatatableDriverComponent } from './driver.component';
describe('DatatableDriverComponent', () => {
let component: DatatableDriverComponent;
let fixture: ComponentFixture<DatatableDriverComponent>;
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
declarations: [ DatatableDriverComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(DatatableDriverComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -0,0 +1,45 @@
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-datatable-driver',
templateUrl: './driver.component.html',
})
export class DatatableDriverComponent implements OnInit {
url = `/user`;
searchSchema: SFSchema = {
properties: {
no: {
type: 'string',
title: '编号'
}
}
};
@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,5 @@
<!-- 页头 -->
<page-header-wrapper [title]="'运营报表'"></page-header-wrapper>
<nz-card>
<st #st [data]="url" [columns]="columns"></st>
</nz-card>

View File

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

View File

@ -0,0 +1,45 @@
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-datatable-owner',
templateUrl: './owner.component.html',
})
export class DatatableOwnerComponent implements OnInit {
url = `/user`;
searchSchema: SFSchema = {
properties: {
no: {
type: 'string',
title: '编号'
}
}
};
@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,69 @@
<!-- 页头 -->
<page-header-wrapper [title]="'数据报表'"></page-header-wrapper>
<div nz-row [nzGutter]="16">
<div nz-col class="gutter-row" [nzSpan]="6">
<g2-card [title]="'客户预存款总额'" [bordered]="true" [total]="'¥ 126,560.00'" [footer]="footer" contentHeight="46">
<ng-template #footer>
<g2-mini-area line color="#cceafe" height="45" [data]="visitData" (clickItem)="handleClick($event)">
</g2-mini-area>
</ng-template>
</g2-card>
</div>
<div nz-col class="gutter-row" [nzSpan]="6">
<g2-card [title]="'业绩量总额'" [bordered]="true" [total]="'¥ 126,560.00'" [footer]="footer" contentHeight="46">
<ng-template #footer>
<g2-mini-area line color="#cceafe" height="45" [data]="visitData" (clickItem)="handleClick($event)">
</g2-mini-area>
</ng-template>
</g2-card>
</div>
<div nz-col class="gutter-row" [nzSpan]="6">
<g2-card [title]="'司机应付总额'" [bordered]="true" [total]="'¥ 126,560.00'" [footer]="footer" contentHeight="46">
<ng-template #footer>
<g2-mini-area line color="#cceafe" height="45" [data]="visitData" (clickItem)="handleClick($event)">
</g2-mini-area>
</ng-template>
</g2-card>
</div>
<div nz-col class="gutter-row" [nzSpan]="6">
<g2-card [title]="'附加费总额'" [bordered]="true" [total]="'¥ 126,560.00'" [footer]="footer" contentHeight="46">
<ng-template #footer>
<g2-mini-area line color="#cceafe" height="45" [data]="visitData" (clickItem)="handleClick($event)">
</g2-mini-area>
</ng-template>
</g2-card>
</div>
</div>
<div nz-row [nzGutter]="16">
<div nz-col class="gutter-row" [nzSpan]="12">
<nz-card [nzTitle]="'订单类型比例'">
<g2-custom delay="100" (render)="render($event)"></g2-custom>
</nz-card>
</div>
<div nz-col class="gutter-row" [nzSpan]="12">
<nz-card [nzTitle]="'大区业绩完成情况'">
<g2-timeline
[data]="chartData"
[titleMap]="{ y1: '客流量', y2: '支付笔数' }"
[height]="200"
mask="MM月DD日"
[slider]="false"
></g2-timeline>
</nz-card>
</div>
</div>
<div nz-row [nzGutter]="16">
<div nz-col class="gutter-row" [nzSpan]="12">
<nz-card [nzTitle]="'运单直付比例'">
<g2-pie #pie title="销售额" subTitle="销售额" [total]="total" [valueFormat]="format" [data]="salesPieData" height="294"
(clickItem)="handleClick($event)" [lineWidth]="10">
</g2-pie>
</nz-card>
</div>
<div nz-col class="gutter-row" [nzSpan]="12">
<nz-card [nzTitle]="'业绩完成情况'">
<g2-bar height="200" [title]="'销售额趋势'" [data]="salesData" (clickItem)="handleClick($event)"></g2-bar>
</nz-card>
</div>
</div>

View File

@ -0,0 +1,249 @@
import { Component, ElementRef, NgZone, OnInit, ViewChild } from '@angular/core';
import { ModalHelper, _HttpClient } from '@delon/theme';
import { G2MiniAreaClickItem, G2MiniAreaData } from '@delon/chart/mini-area';
import { G2PieClickItem, G2PieComponent, G2PieData } from '@delon/chart/pie';
import { format } from 'date-fns';
import { DataService } from '../../services/data.service';
import { Chart, registerShape, Util } from '@antv/g2';
import { G2TimelineClickItem, G2TimelineData } from '@delon/chart/timeline';
@Component({
selector: 'app-datatable-dataindex',
templateUrl: './dataindex.component.html',
styleUrls: ['./dataindex.component.less']
})
export class DatatableDataindexComponent implements OnInit {
@ViewChild('pie', { static: false }) pie!: G2PieComponent;
chartData: G2TimelineData[] = [];
visitData = this.genData();
salesData = this.genData();
salesPieData: G2PieData[] = [];
total = '';
constructor(private service: DataService, private ngZone: NgZone) {
}
ngOnInit(): void {
this.refreshPie();
this.initLineData()
}
initLineData(){
for (let i = 0; i < 20; i += 1) {
this.chartData.push({
time: new Date().getTime() + 1000 * 60 * 60 * 24 * i,
y1: Math.floor(Math.random() * 100) + 1000,
y2: Math.floor(Math.random() * 100) + 10,
});
}
}
private genData(): G2MiniAreaData[] {
const beginDay = new Date().getTime();
const res: G2MiniAreaData[] = [];
for (let i = 0; i < 20; i += 1) {
res.push({
x: format(new Date(beginDay + 1000 * 60 * 60 * 24 * i), 'yyyy-MM-dd'),
y: Math.floor(Math.random() * 100) + 10,
});
}
return res;
}
refresh(): void {
this.visitData = this.genData();
}
refreshPie(): void {
const rv = (min: number = 0, max: number = 5000) => Math.floor(Math.random() * (max - min + 1) + min);
this.salesPieData = [
{
x: '家用电器',
y: rv(),
},
{
x: '食用酒水',
y: rv(),
},
{
x: '个护健康',
y: rv(),
},
{
x: '服饰箱包',
y: rv(),
},
{
x: '母婴产品',
y: rv(),
},
];
if (Math.random() > 0.5) {
this.salesPieData.push({
x: '其他',
y: rv(),
});
}
this.total = `&yen ${this.salesPieData.reduce((pre, now) => now.y + pre, 0).toFixed(2)}`;
if (this.pie) {
// 等待组件渲染
setTimeout(() => {
console.log('a')
this.pie.changeData()
});
}
}
handleClick(data: G2MiniAreaClickItem): void {
this.service.msgSrv.info(`${data.item.x} - ${data.item.y}`);
}
format(val: number): string {
return `&yen ${val.toFixed(2)}`;
}
render(el: ElementRef<HTMLDivElement>): void {
this.ngZone.runOutsideAngular(() => this.init(el.nativeElement));
}
private init(el: HTMLElement): void {
const data = [
{ item: '货源单', count: 40, percent: 0.4 },
{ item: '合同单', count: 21, percent: 0.21 },
{ item: '事例三', count: 17, percent: 0.17 },
{ item: '事例四', count: 13, percent: 0.13 },
{ item: '事例五', count: 9, percent: 0.09 },
];
const chart = new Chart({
container: el,
autoFit: true,
height: 400,
});
// 新建一个 view 用来单独渲染Annotation
const innerView = chart.createView();
chart.coordinate('theta', {
radius: 0.6,
innerRadius: 0.7,
});
chart.data(data);
chart.scale('percent', {
formatter: val => {
val = val * 100 + '%';
return val;
},
});
chart.tooltip(false);
// 声明需要进行自定义图例字段: 'item'
chart.legend('item', {
position: 'right', // 配置图例显示位置
custom: true, // 关键字段,告诉 G2要使用自定义的图例
items: data.map((obj, index) => {
return {
name: obj.item, // 对应 itemName
value: obj.percent, // 对应 itemValue
marker: {
symbol: 'square', // marker 的形状
style: {
r: 5, // marker 图形半径
fill: chart.getTheme().colors10[index], // marker 颜色,使用默认颜色,同图形对应
},
}, // marker 配置
};
}),
itemValue: {
style: {
fill: '#999',
}, // 配置 itemValue 样式
formatter: (val: any) => `${val * 100}%` // 格式化 itemValue 内容
},
});
chart
.interval()
.adjust('stack')
.position('percent')
.color('item')
.style({
fillOpacity: 1,
stroke: 'white',
lineWidth: 8,
})
.state({
active: {
style: element => {
const shape = element.shape;
return {
lineWidth: 1,
stroke: 'white',
strokeOpacity: shape.attr('fillOpacity'),
};
},
},
});
// 移除图例点击过滤交互
chart.removeInteraction('legend-filter');
chart.interaction('element-active');
chart.render();
// 监听 element 上状态的变化来动态更新 Annotation 信息
chart.on('element:statechange', (ev: any) => {
const { state, stateStatus, element } = ev.gEvent.originalEvent;
// 本示例只需要监听 active 的状态变化
if (state === 'active') {
const data = element.getData();
if (stateStatus) {
// 更新 Annotation
updateAnnotation(data);
} else {
// 隐藏 Annotation
clearAnnotation();
}
}
});
// 绘制 annotation
let lastItem: any;
function updateAnnotation(data: any) {
if (data.item !== lastItem) {
innerView.annotation().clear(true);
innerView
.annotation()
.text({
position: ['50%', '50%'],
content: data.item,
style: {
fontSize: 20,
fill: '#8c8c8c',
textAlign: 'center',
},
offsetY: -20,
})
.text({
position: ['50%', '50%'],
content: data.count,
style: {
fontSize: 28,
fill: '#8c8c8c',
textAlign: 'center',
},
offsetX: -10,
offsetY: 20,
})
innerView.render(true);
lastItem = data.item;
}
}
// 清空 annotation
function clearAnnotation() {
innerView.annotation().clear(true);
innerView.render(true);
lastItem = null;
}
}
}

View File

@ -0,0 +1,69 @@
<!-- 页头 -->
<page-header-wrapper [title]="'数据报表'"></page-header-wrapper>
<div nz-row [nzGutter]="16">
<div nz-col class="gutter-row" [nzSpan]="6">
<g2-card [title]="'客户预存款总额'" [bordered]="true" [total]="'¥ 126,560.00'" [footer]="footer" contentHeight="46">
<ng-template #footer>
<g2-mini-area line color="#cceafe" height="45" [data]="visitData" (clickItem)="handleClick($event)">
</g2-mini-area>
</ng-template>
</g2-card>
</div>
<div nz-col class="gutter-row" [nzSpan]="6">
<g2-card [title]="'业绩量总额'" [bordered]="true" [total]="'¥ 126,560.00'" [footer]="footer" contentHeight="46">
<ng-template #footer>
<g2-mini-area line color="#cceafe" height="45" [data]="visitData" (clickItem)="handleClick($event)">
</g2-mini-area>
</ng-template>
</g2-card>
</div>
<div nz-col class="gutter-row" [nzSpan]="6">
<g2-card [title]="'司机应付总额'" [bordered]="true" [total]="'¥ 126,560.00'" [footer]="footer" contentHeight="46">
<ng-template #footer>
<g2-mini-area line color="#cceafe" height="45" [data]="visitData" (clickItem)="handleClick($event)">
</g2-mini-area>
</ng-template>
</g2-card>
</div>
<div nz-col class="gutter-row" [nzSpan]="6">
<g2-card [title]="'附加费总额'" [bordered]="true" [total]="'¥ 126,560.00'" [footer]="footer" contentHeight="46">
<ng-template #footer>
<g2-mini-area line color="#cceafe" height="45" [data]="visitData" (clickItem)="handleClick($event)">
</g2-mini-area>
</ng-template>
</g2-card>
</div>
</div>
<div nz-row [nzGutter]="16">
<div nz-col class="gutter-row" [nzSpan]="12">
<nz-card [nzTitle]="'订单类型比例'">
<g2-custom delay="100" (render)="render($event)"></g2-custom>
</nz-card>
</div>
<div nz-col class="gutter-row" [nzSpan]="12">
<nz-card [nzTitle]="'大区业绩完成情况'">
<g2-timeline
[data]="chartData"
[titleMap]="{ y1: '客流量', y2: '支付笔数' }"
[height]="200"
mask="MM月DD日"
[slider]="false"
></g2-timeline>
</nz-card>
</div>
</div>
<div nz-row [nzGutter]="16">
<div nz-col class="gutter-row" [nzSpan]="12">
<nz-card [nzTitle]="'运单直付比例'">
<g2-pie #pie title="销售额" subTitle="销售额" [total]="total" [valueFormat]="format" [data]="salesPieData" height="294"
(clickItem)="handleClick($event)" [lineWidth]="10">
</g2-pie>
</nz-card>
</div>
<div nz-col class="gutter-row" [nzSpan]="12">
<nz-card [nzTitle]="'业绩完成情况'">
<g2-bar height="200" [title]="'销售额趋势'" [data]="salesData" (clickItem)="handleClick($event)"></g2-bar>
</nz-card>
</div>
</div>

View File

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

View File

@ -0,0 +1,249 @@
import { Component, ElementRef, NgZone, OnInit, ViewChild } from '@angular/core';
import { ModalHelper, _HttpClient } from '@delon/theme';
import { G2MiniAreaClickItem, G2MiniAreaData } from '@delon/chart/mini-area';
import { G2PieClickItem, G2PieComponent, G2PieData } from '@delon/chart/pie';
import { format } from 'date-fns';
import { DataindexService } from '../services/dataindex.service';
import { Chart, registerShape, Util } from '@antv/g2';
import { G2TimelineClickItem, G2TimelineData } from '@delon/chart/timeline';
@Component({
selector: 'app-datatable-dataindex',
templateUrl: './dataindex.component.html',
styleUrls: ['./dataindex.component.less']
})
export class DatatableDataindexComponent implements OnInit {
@ViewChild('pie', { static: false }) pie!: G2PieComponent;
chartData: G2TimelineData[] = [];
visitData = this.genData();
salesData = this.genData();
salesPieData: G2PieData[] = [];
total = '';
constructor(private service: DataindexService, private ngZone: NgZone) {
}
ngOnInit(): void {
this.refreshPie();
this.initLineData()
}
initLineData(){
for (let i = 0; i < 20; i += 1) {
this.chartData.push({
time: new Date().getTime() + 1000 * 60 * 60 * 24 * i,
y1: Math.floor(Math.random() * 100) + 1000,
y2: Math.floor(Math.random() * 100) + 10,
});
}
}
private genData(): G2MiniAreaData[] {
const beginDay = new Date().getTime();
const res: G2MiniAreaData[] = [];
for (let i = 0; i < 20; i += 1) {
res.push({
x: format(new Date(beginDay + 1000 * 60 * 60 * 24 * i), 'yyyy-MM-dd'),
y: Math.floor(Math.random() * 100) + 10,
});
}
return res;
}
refresh(): void {
this.visitData = this.genData();
}
refreshPie(): void {
const rv = (min: number = 0, max: number = 5000) => Math.floor(Math.random() * (max - min + 1) + min);
this.salesPieData = [
{
x: '家用电器',
y: rv(),
},
{
x: '食用酒水',
y: rv(),
},
{
x: '个护健康',
y: rv(),
},
{
x: '服饰箱包',
y: rv(),
},
{
x: '母婴产品',
y: rv(),
},
];
if (Math.random() > 0.5) {
this.salesPieData.push({
x: '其他',
y: rv(),
});
}
this.total = `&yen ${this.salesPieData.reduce((pre, now) => now.y + pre, 0).toFixed(2)}`;
if (this.pie) {
// 等待组件渲染
setTimeout(() => {
console.log('a')
this.pie.changeData()
});
}
}
handleClick(data: G2MiniAreaClickItem): void {
this.service.msgSrv.info(`${data.item.x} - ${data.item.y}`);
}
format(val: number): string {
return `&yen ${val.toFixed(2)}`;
}
render(el: ElementRef<HTMLDivElement>): void {
this.ngZone.runOutsideAngular(() => this.init(el.nativeElement));
}
private init(el: HTMLElement): void {
const data = [
{ item: '货源单', count: 40, percent: 0.4 },
{ item: '合同单', count: 21, percent: 0.21 },
{ item: '事例三', count: 17, percent: 0.17 },
{ item: '事例四', count: 13, percent: 0.13 },
{ item: '事例五', count: 9, percent: 0.09 },
];
const chart = new Chart({
container: el,
autoFit: true,
height: 400,
});
// 新建一个 view 用来单独渲染Annotation
const innerView = chart.createView();
chart.coordinate('theta', {
radius: 0.6,
innerRadius: 0.7,
});
chart.data(data);
chart.scale('percent', {
formatter: val => {
val = val * 100 + '%';
return val;
},
});
chart.tooltip(false);
// 声明需要进行自定义图例字段: 'item'
chart.legend('item', {
position: 'right', // 配置图例显示位置
custom: true, // 关键字段,告诉 G2要使用自定义的图例
items: data.map((obj, index) => {
return {
name: obj.item, // 对应 itemName
value: obj.percent, // 对应 itemValue
marker: {
symbol: 'square', // marker 的形状
style: {
r: 5, // marker 图形半径
fill: chart.getTheme().colors10[index], // marker 颜色,使用默认颜色,同图形对应
},
}, // marker 配置
};
}),
itemValue: {
style: {
fill: '#999',
}, // 配置 itemValue 样式
formatter: (val: any) => `${val * 100}%` // 格式化 itemValue 内容
},
});
chart
.interval()
.adjust('stack')
.position('percent')
.color('item')
.style({
fillOpacity: 1,
stroke: 'white',
lineWidth: 8,
})
.state({
active: {
style: element => {
const shape = element.shape;
return {
lineWidth: 1,
stroke: 'white',
strokeOpacity: shape.attr('fillOpacity'),
};
},
},
});
// 移除图例点击过滤交互
chart.removeInteraction('legend-filter');
chart.interaction('element-active');
chart.render();
// 监听 element 上状态的变化来动态更新 Annotation 信息
chart.on('element:statechange', (ev: any) => {
const { state, stateStatus, element } = ev.gEvent.originalEvent;
// 本示例只需要监听 active 的状态变化
if (state === 'active') {
const data = element.getData();
if (stateStatus) {
// 更新 Annotation
updateAnnotation(data);
} else {
// 隐藏 Annotation
clearAnnotation();
}
}
});
// 绘制 annotation
let lastItem: any;
function updateAnnotation(data: any) {
if (data.item !== lastItem) {
innerView.annotation().clear(true);
innerView
.annotation()
.text({
position: ['50%', '50%'],
content: data.item,
style: {
fontSize: 20,
fill: '#8c8c8c',
textAlign: 'center',
},
offsetY: -20,
})
.text({
position: ['50%', '50%'],
content: data.count,
style: {
fontSize: 28,
fill: '#8c8c8c',
textAlign: 'center',
},
offsetX: -10,
offsetY: 20,
})
innerView.render(true);
lastItem = data.item;
}
}
// 清空 annotation
function clearAnnotation() {
innerView.annotation().clear(true);
innerView.render(true);
lastItem = null;
}
}
}

View File

@ -0,0 +1,69 @@
<!-- 页头 -->
<page-header-wrapper [title]="'数据报表'"></page-header-wrapper>
<div nz-row [nzGutter]="16">
<div nz-col class="gutter-row" [nzSpan]="6">
<g2-card [title]="'客户预存款总额'" [bordered]="true" [total]="'¥ 126,560.00'" [footer]="footer" contentHeight="46">
<ng-template #footer>
<g2-mini-area line color="#cceafe" height="45" [data]="visitData" (clickItem)="handleClick($event)">
</g2-mini-area>
</ng-template>
</g2-card>
</div>
<div nz-col class="gutter-row" [nzSpan]="6">
<g2-card [title]="'业绩量总额'" [bordered]="true" [total]="'¥ 126,560.00'" [footer]="footer" contentHeight="46">
<ng-template #footer>
<g2-mini-area line color="#cceafe" height="45" [data]="visitData" (clickItem)="handleClick($event)">
</g2-mini-area>
</ng-template>
</g2-card>
</div>
<div nz-col class="gutter-row" [nzSpan]="6">
<g2-card [title]="'司机应付总额'" [bordered]="true" [total]="'¥ 126,560.00'" [footer]="footer" contentHeight="46">
<ng-template #footer>
<g2-mini-area line color="#cceafe" height="45" [data]="visitData" (clickItem)="handleClick($event)">
</g2-mini-area>
</ng-template>
</g2-card>
</div>
<div nz-col class="gutter-row" [nzSpan]="6">
<g2-card [title]="'附加费总额'" [bordered]="true" [total]="'¥ 126,560.00'" [footer]="footer" contentHeight="46">
<ng-template #footer>
<g2-mini-area line color="#cceafe" height="45" [data]="visitData" (clickItem)="handleClick($event)">
</g2-mini-area>
</ng-template>
</g2-card>
</div>
</div>
<div nz-row [nzGutter]="16">
<div nz-col class="gutter-row" [nzSpan]="12">
<nz-card [nzTitle]="'订单类型比例'">
<g2-custom delay="100" (render)="render($event)"></g2-custom>
</nz-card>
</div>
<div nz-col class="gutter-row" [nzSpan]="12">
<nz-card [nzTitle]="'大区业绩完成情况'">
<g2-timeline
[data]="chartData"
[titleMap]="{ y1: '客流量', y2: '支付笔数' }"
[height]="200"
mask="MM月DD日"
[slider]="false"
></g2-timeline>
</nz-card>
</div>
</div>
<div nz-row [nzGutter]="16">
<div nz-col class="gutter-row" [nzSpan]="12">
<nz-card [nzTitle]="'运单直付比例'">
<g2-pie #pie title="销售额" subTitle="销售额" [total]="total" [valueFormat]="format" [data]="salesPieData" height="294"
(clickItem)="handleClick($event)" [lineWidth]="10">
</g2-pie>
</nz-card>
</div>
<div nz-col class="gutter-row" [nzSpan]="12">
<nz-card [nzTitle]="'业绩完成情况'">
<g2-bar height="200" [title]="'销售额趋势'" [data]="salesData" (clickItem)="handleClick($event)"></g2-bar>
</nz-card>
</div>
</div>

View File

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

View File

@ -0,0 +1,249 @@
import { Component, ElementRef, NgZone, OnInit, ViewChild } from '@angular/core';
import { ModalHelper, _HttpClient } from '@delon/theme';
import { G2MiniAreaClickItem, G2MiniAreaData } from '@delon/chart/mini-area';
import { G2PieClickItem, G2PieComponent, G2PieData } from '@delon/chart/pie';
import { format } from 'date-fns';
import { Chart, registerShape, Util } from '@antv/g2';
import { G2TimelineClickItem, G2TimelineData } from '@delon/chart/timeline';
import { DataService } from '../../../services/data.service';
@Component({
selector: 'app-datatable-curve',
templateUrl: './curve.component.html',
styleUrls: ['./curve.component.less']
})
export class DatatableDataindexComponent implements OnInit {
@ViewChild('pie', { static: false }) pie!: G2PieComponent;
chartData: G2TimelineData[] = [];
visitData = this.genData();
salesData = this.genData();
salesPieData: G2PieData[] = [];
total = '';
constructor(private service: DataService, private ngZone: NgZone) {
}
ngOnInit(): void {
this.refreshPie();
this.initLineData()
}
initLineData(){
for (let i = 0; i < 20; i += 1) {
this.chartData.push({
time: new Date().getTime() + 1000 * 60 * 60 * 24 * i,
y1: Math.floor(Math.random() * 100) + 1000,
y2: Math.floor(Math.random() * 100) + 10,
});
}
}
private genData(): G2MiniAreaData[] {
const beginDay = new Date().getTime();
const res: G2MiniAreaData[] = [];
for (let i = 0; i < 20; i += 1) {
res.push({
x: format(new Date(beginDay + 1000 * 60 * 60 * 24 * i), 'yyyy-MM-dd'),
y: Math.floor(Math.random() * 100) + 10,
});
}
return res;
}
refresh(): void {
this.visitData = this.genData();
}
refreshPie(): void {
const rv = (min: number = 0, max: number = 5000) => Math.floor(Math.random() * (max - min + 1) + min);
this.salesPieData = [
{
x: '家用电器',
y: rv(),
},
{
x: '食用酒水',
y: rv(),
},
{
x: '个护健康',
y: rv(),
},
{
x: '服饰箱包',
y: rv(),
},
{
x: '母婴产品',
y: rv(),
},
];
if (Math.random() > 0.5) {
this.salesPieData.push({
x: '其他',
y: rv(),
});
}
this.total = `&yen ${this.salesPieData.reduce((pre, now) => now.y + pre, 0).toFixed(2)}`;
if (this.pie) {
// 等待组件渲染
setTimeout(() => {
console.log('a')
this.pie.changeData()
});
}
}
handleClick(data: G2MiniAreaClickItem): void {
this.service.msgSrv.info(`${data.item.x} - ${data.item.y}`);
}
format(val: number): string {
return `&yen ${val.toFixed(2)}`;
}
render(el: ElementRef<HTMLDivElement>): void {
this.ngZone.runOutsideAngular(() => this.init(el.nativeElement));
}
private init(el: HTMLElement): void {
const data = [
{ item: '货源单', count: 40, percent: 0.4 },
{ item: '合同单', count: 21, percent: 0.21 },
{ item: '事例三', count: 17, percent: 0.17 },
{ item: '事例四', count: 13, percent: 0.13 },
{ item: '事例五', count: 9, percent: 0.09 },
];
const chart = new Chart({
container: el,
autoFit: true,
height: 400,
});
// 新建一个 view 用来单独渲染Annotation
const innerView = chart.createView();
chart.coordinate('theta', {
radius: 0.6,
innerRadius: 0.7,
});
chart.data(data);
chart.scale('percent', {
formatter: val => {
val = val * 100 + '%';
return val;
},
});
chart.tooltip(false);
// 声明需要进行自定义图例字段: 'item'
chart.legend('item', {
position: 'right', // 配置图例显示位置
custom: true, // 关键字段,告诉 G2要使用自定义的图例
items: data.map((obj, index) => {
return {
name: obj.item, // 对应 itemName
value: obj.percent, // 对应 itemValue
marker: {
symbol: 'square', // marker 的形状
style: {
r: 5, // marker 图形半径
fill: chart.getTheme().colors10[index], // marker 颜色,使用默认颜色,同图形对应
},
}, // marker 配置
};
}),
itemValue: {
style: {
fill: '#999',
}, // 配置 itemValue 样式
formatter: (val: any) => `${val * 100}%` // 格式化 itemValue 内容
},
});
chart
.interval()
.adjust('stack')
.position('percent')
.color('item')
.style({
fillOpacity: 1,
stroke: 'white',
lineWidth: 8,
})
.state({
active: {
style: element => {
const shape = element.shape;
return {
lineWidth: 1,
stroke: 'white',
strokeOpacity: shape.attr('fillOpacity'),
};
},
},
});
// 移除图例点击过滤交互
chart.removeInteraction('legend-filter');
chart.interaction('element-active');
chart.render();
// 监听 element 上状态的变化来动态更新 Annotation 信息
chart.on('element:statechange', (ev: any) => {
const { state, stateStatus, element } = ev.gEvent.originalEvent;
// 本示例只需要监听 active 的状态变化
if (state === 'active') {
const data = element.getData();
if (stateStatus) {
// 更新 Annotation
updateAnnotation(data);
} else {
// 隐藏 Annotation
clearAnnotation();
}
}
});
// 绘制 annotation
let lastItem: any;
function updateAnnotation(data: any) {
if (data.item !== lastItem) {
innerView.annotation().clear(true);
innerView
.annotation()
.text({
position: ['50%', '50%'],
content: data.item,
style: {
fontSize: 20,
fill: '#8c8c8c',
textAlign: 'center',
},
offsetY: -20,
})
.text({
position: ['50%', '50%'],
content: data.count,
style: {
fontSize: 28,
fill: '#8c8c8c',
textAlign: 'center',
},
offsetX: -10,
offsetY: 20,
})
innerView.render(true);
lastItem = data.item;
}
}
// 清空 annotation
function clearAnnotation() {
innerView.annotation().clear(true);
innerView.render(true);
lastItem = null;
}
}
}

View File

@ -0,0 +1,46 @@
<!-- 页头 -->
<page-header-wrapper [title]="'运营报表'"></page-header-wrapper>
<nz-card nzTitle="运营报表" [nzExtra]="extraTemplate">
<ng-template #extraTemplate>
<div class="chooseBox">
<button nz-button nzType="primary" (click)="exportFun()">导出</button>
<div class="timeBox">
<nz-radio-group [(ngModel)]="mode" nzButtonStyle="solid" (ngModelChange)="changeData()">
<label nz-radio-button nzValue="year"></label>
<label nz-radio-button nzValue="month"></label>
<label nz-radio-button nzValue="date"></label>
<label nz-radio-button nzValue="define">自定义</label>
</nz-radio-group>
<div class="dateBox">
<nz-date-picker [(ngModel)]="date" [nzMode]="mode" [nzFormat]="dateFormat" *ngIf="mode !== 'define'" [nzDisabledDate]="disabledDate" (ngModelChange)="onChange($event)"></nz-date-picker>
<nz-range-picker [(ngModel)]="defineDate" [nzFormat]="dateFormat" *ngIf="mode === 'define'" [nzDisabledDate]="disabledDate" (ngModelChange)="onChange($event)"></nz-range-picker>
</div>
</div>
</div>
</ng-template>
<st #st multiSort [columns]="columns" [ps]="20" [data]="service.$api_listOperationalReportPage"
[req]="{ method: 'POST', allInBody: true, reName: { pi: 'pageIndex', ps: 'pageSize' }, params: reqParams }"
[scroll]="{ x: '1200px' }" [res]="{ reName: { list: 'data.records', total: 'data.total' } }"
[page]="{ show: true, showSize: true, pageSizes: [20, 50, 100] }" [loading]="false"></st>
</nz-card>
<nz-card nzTitle="运营报表" [nzExtra]="extraTemplate">
<ng-template #extraTemplate>
<div class="chooseBox">
<button nz-button nzType="primary" (click)="exportFun()">导出</button>
<div class="timeBox">
<nz-radio-group [(ngModel)]="mode" nzButtonStyle="solid" (ngModelChange)="changeData()">
<label nz-radio-button nzValue="year"></label>
<label nz-radio-button nzValue="month"></label>
</nz-radio-group>
<div class="dateBox">
<nz-date-picker [nzDisabledDate]="disabledDate" [nzMode]="mode" (ngModelChange)="onChange($event)"></nz-date-picker>
</div>
</div>
</div>
</ng-template>
</nz-card>
<nz-card nzTitle="运单状态分布">
<app-opeationtable-pie></app-opeationtable-pie>
</nz-card>

View File

@ -0,0 +1,11 @@
.chooseBox{
display: flex;
}
.timeBox{
display: flex;
margin: 0 0 0 10px;
}
.dateBox{
display: inline-block;
margin: 0 0 0 10px;
}

View File

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

View File

@ -0,0 +1,89 @@
import { Component, OnInit, ViewChild } from '@angular/core';
import { STColumn, STComponent } from '@delon/abc/st';
import { DatePipe, _HttpClient } from '@delon/theme';
import { DataService } from '../../services/data.service';
import { differenceInCalendarDays } from 'date-fns';
@Component({
selector: 'app-datatable-operationtable',
templateUrl: './operationtable.component.html',
styleUrls: ['./operationtable.component.less'],
providers: [DatePipe]
})
export class DatatableOperationtableComponent implements OnInit {;
type = 1;
mode = 'year';
date: any = null;
defineDate = [];
time: any = ['2022-01-01 00:00:00']
dateFormat = 'yyyy-MM-dd';
today = new Date();
@ViewChild('st') private readonly st!: STComponent;
columns: STColumn[] = [
{ title: '运营主体', index: 'networkTransporterName', className: 'text-center' },
{ title: '订单数', index: 'zsl', className: 'text-center' },
{ title: '应收金额', index: 'yingsje', className: 'text-center' },
{ title: '承运数', index: 'cys', className: 'text-center' },
{ title: '应付运费', index: 'yingfyf', className: 'text-center' },
{ title: '运量(吨)', index: 'yl', className: 'text-center' },
{ title: '待接单数', index: 'djd', className: 'text-center' },
{ title: '在途数', index: 'ysz', className: 'text-center' },
{ title: '运输完成', index: 'yswc', className: 'text-center' },
{ title: '已收金额', index: 'yisje', className: 'text-center' },
{ title: '已付运费', index: 'yifyf', className: 'text-center' }
];
/**
* 查询参数
*/
get reqParams() {
if(this.mode === 'year') {
this.type = 1
} else if(this.mode === 'month') {
this.type = 2
} else if(this.mode === 'date') {
this.type = 3
} else {
this.type = 4
}
let params: any = {
time: this.time,
type: this.type
};
delete params._$expand;
return { ...params };
}
constructor(public service: DataService, private datePipe: DatePipe) { }
ngOnInit(): void { }
changeData(){
if(this.mode === 'year') {
this.dateFormat = 'yyyy'
} else if(this.mode === 'month') {
this.dateFormat = 'yyyy-MM'
} else {
this.dateFormat = 'yyyy-MM-dd'
}
}
onChange(result: any) {
if(this.mode === 'year') {
this.time = [this.datePipe.transform(this.date, 'yyyy') + '-01-01 00:00:00']
} else if(this.mode === 'month') {
this.time = [this.datePipe.transform(this.date, 'yyyy-MM') + '-01 00:00:00']
} else if(this.mode === 'date') {
this.time = [this.datePipe.transform(this.date, 'yyyy-MM-dd') + ' 00:00:00']
} else{
this.time = [this.datePipe.transform(this.defineDate[0], 'yyyy-MM-dd') + '00:00:00', this.datePipe.transform(this.defineDate[1], 'yyyy-MM-dd') + ' 00:00:00']
}
this.st.reload({ ...this.reqParams });
}
disabledDate = (current: Date): boolean =>
// Can not select days before today and today
differenceInCalendarDays(current, this.today) > 0;
exportFun(){
}
}

View File

@ -0,0 +1 @@
<g2-custom delay="100" (render)="render($event)"></g2-custom>

View File

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

View File

@ -0,0 +1,252 @@
import { Component, ElementRef, NgZone, OnInit, ViewChild } from '@angular/core';
import { ModalHelper, _HttpClient } from '@delon/theme';
import { G2MiniAreaClickItem, G2MiniAreaData } from '@delon/chart/mini-area';
import { G2PieClickItem, G2PieComponent, G2PieData } from '@delon/chart/pie';
import { format } from 'date-fns';
import { Chart, registerShape, Util } from '@antv/g2';
import { G2TimelineClickItem, G2TimelineData } from '@delon/chart/timeline';
import { DataService } from '../../../services/data.service';
@Component({
selector: 'app-opeationtable-pie',
templateUrl: './pie.component.html',
styleUrls: ['./pie.component.less']
})
export class OperationtablePieComponent implements OnInit {
@ViewChild('pie', { static: false }) pie!: G2PieComponent;
chartData: G2TimelineData[] = [];
visitData = this.genData();
salesData = this.genData();
salesPieData: G2PieData[] = [];
total = '';
constructor(private service: DataService, private ngZone: NgZone) {
}
ngOnInit(): void {
this.refreshPie();
this.initLineData()
}
initLineData() {
for (let i = 0; i < 20; i += 1) {
this.chartData.push({
time: new Date().getTime() + 1000 * 60 * 60 * 24 * i,
y1: Math.floor(Math.random() * 100) + 1000,
y2: Math.floor(Math.random() * 100) + 10,
});
}
}
private genData(): G2MiniAreaData[] {
const beginDay = new Date().getTime();
const res: G2MiniAreaData[] = [];
for (let i = 0; i < 20; i += 1) {
res.push({
x: format(new Date(beginDay + 1000 * 60 * 60 * 24 * i), 'yyyy-MM-dd'),
y: Math.floor(Math.random() * 100) + 10,
});
}
return res;
}
refresh(): void {
this.visitData = this.genData();
}
refreshPie(): void {
const rv = (min: number = 0, max: number = 5000) => Math.floor(Math.random() * (max - min + 1) + min);
this.salesPieData = [
{
x: '家用电器',
y: rv(),
},
{
x: '食用酒水',
y: rv(),
},
{
x: '个护健康',
y: rv(),
},
{
x: '服饰箱包',
y: rv(),
},
{
x: '母婴产品',
y: rv(),
},
];
if (Math.random() > 0.5) {
this.salesPieData.push({
x: '其他',
y: rv(),
});
}
this.total = `&yen ${this.salesPieData.reduce((pre, now) => now.y + pre, 0).toFixed(2)}`;
if (this.pie) {
// 等待组件渲染
setTimeout(() => {
console.log('a')
this.pie.changeData()
});
}
}
handleClick(data: G2MiniAreaClickItem): void {
this.service.msgSrv.info(`${data.item.x} - ${data.item.y}`);
}
format(val: number): string {
return `&yen ${val.toFixed(2)}`;
}
render(el: ElementRef<HTMLDivElement>): void {
this.ngZone.runOutsideAngular(() => this.init(el.nativeElement));
}
private init(el: HTMLElement): void {
const data = [
{ item: '货源单', count: 40, percent: 0.4 },
{ item: '合同单', count: 21, percent: 0.21 },
{ item: '事例三', count: 17, percent: 0.17 },
{ item: '事例四', count: 13, percent: 0.13 },
{ item: '事例五', count: 9, percent: 0.09 },
];
const chart = new Chart({
container: el,
autoFit: true,
height: 400,
});
// 新建一个 view 用来单独渲染Annotation
const innerView = chart.createView();
chart.coordinate('theta', {
radius: 0.6,
innerRadius: 0.7,
});
chart.data(data);
chart.scale('percent', {
formatter: val => {
val = val * 100 + '%';
return val;
},
});
chart.tooltip(false);
// 声明需要进行自定义图例字段: 'item'
chart.legend('item', {
position: 'right', // 配置图例显示位置
custom: true, // 关键字段,告诉 G2要使用自定义的图例
items: data.map((obj, index) => {
return {
name: obj.item, // 对应 itemName
value: obj.percent, // 对应 itemValue
marker: {
symbol: 'square', // marker 的形状
style: {
r: 5, // marker 图形半径
fill: chart.getTheme().colors10[index], // marker 颜色,使用默认颜色,同图形对应
},
}, // marker 配置
};
}),
itemValue: {
style: {
fill: '#999',
}, // 配置 itemValue 样式
formatter: (val: any) => `${val * 100}%` // 格式化 itemValue 内容
},
});
const interval = chart
.interval()
.adjust('stack')
.position('percent')
.color('item')
.style({
fillOpacity: 1,
stroke: 'white',
lineWidth: 8,
})
.state({
active: {
style: element => {
const shape = element.shape;
return {
lineWidth: 1,
stroke: 'white',
strokeOpacity: shape.attr('fillOpacity'),
};
},
},
});
// 移除图例点击过滤交互
chart.removeInteraction('legend-filter');
chart.interaction('element-active');
chart.render();
// 默认选择
interval.elements[0].setState('selected', true);
// 监听 element 上状态的变化来动态更新 Annotation 信息
chart.on('element:statechange', (ev: any) => {
const { state, stateStatus, element } = ev.gEvent.originalEvent;
// 本示例只需要监听 active 的状态变化
if (state === 'active') {
const data = element.getData();
if (stateStatus) {
// 更新 Annotation
updateAnnotation(data);
} else {
// 隐藏 Annotation
clearAnnotation();
}
}
});
// 绘制 annotation
let lastItem: any;
function updateAnnotation(data: any) {
if (data.item !== lastItem) {
innerView.annotation().clear(true);
innerView
.annotation()
.text({
position: ['50%', '50%'],
content: data.item,
style: {
fontSize: 20,
fill: '#8c8c8c',
textAlign: 'center',
},
offsetY: -20,
})
.text({
position: ['50%', '50%'],
content: data.count,
style: {
fontSize: 28,
fill: '#8c8c8c',
textAlign: 'center',
},
offsetX: -10,
offsetY: 20,
})
innerView.render(true);
lastItem = data.item;
}
}
// 清空 annotation
function clearAnnotation() {
innerView.annotation().clear(true);
innerView.render(true);
lastItem = null;
}
}
}

View File

@ -1,32 +0,0 @@
<!-- 页头 -->
<page-header-wrapper [title]="'数据报表'"></page-header-wrapper>
<div nz-row [nzGutter]="16">
<div nz-col class="gutter-row" [nzSpan]="6">
<g2-card [title]="'客户预存款总额'" [bordered]="true" [total]="'¥ 126,560.00'" [footer]="footer" contentHeight="46">
<ng-template #footer>
<g2-mini-area line color="#cceafe" height="45" [data]="visitData" (clickItem)="handleClick($event)"></g2-mini-area>
</ng-template>
</g2-card>
</div>
<div nz-col class="gutter-row" [nzSpan]="6">
<g2-card [title]="'客户预存款总额'" [bordered]="true" [total]="'¥ 126,560.00'" [footer]="footer" contentHeight="46">
<ng-template #footer>
<g2-mini-area line color="#cceafe" height="45" [data]="visitData" (clickItem)="handleClick($event)"></g2-mini-area>
</ng-template>
</g2-card>
</div>
<div nz-col class="gutter-row" [nzSpan]="6">
<g2-card [title]="'客户预存款总额'" [bordered]="true" [total]="'¥ 126,560.00'" [footer]="footer" contentHeight="46">
<ng-template #footer>
<g2-mini-area line color="#cceafe" height="45" [data]="visitData" (clickItem)="handleClick($event)"></g2-mini-area>
</ng-template>
</g2-card>
</div>
<div nz-col class="gutter-row" [nzSpan]="6">
<g2-card [title]="'客户预存款总额'" [bordered]="true" [total]="'¥ 126,560.00'" [footer]="footer" contentHeight="46">
<ng-template #footer>
<g2-mini-area line color="#cceafe" height="45" [data]="visitData" (clickItem)="handleClick($event)"></g2-mini-area>
</ng-template>
</g2-card>
</div>
</div>

View File

@ -1,37 +0,0 @@
import { Component, OnInit, ViewChild } from '@angular/core';
import { ModalHelper, _HttpClient } from '@delon/theme';
import { G2MiniAreaClickItem, G2MiniAreaData } from '@delon/chart/mini-area';
import { format } from 'date-fns';
@Component({
selector: 'app-datatable-dataindex',
templateUrl: './dataindex.component.html',
styleUrls: ['./dataindex.component.less']
})
export class DatatableDataindexComponent implements OnInit {
visitData = this.genData();
constructor(private http: _HttpClient, private modal: ModalHelper) { }
ngOnInit(): void { }
private genData(): G2MiniAreaData[] {
const beginDay = new Date().getTime();
const res: G2MiniAreaData[] = [];
for (let i = 0; i < 20; i += 1) {
res.push({
x: format(new Date(beginDay + 1000 * 60 * 60 * 24 * i), 'yyyy-MM-dd'),
y: Math.floor(Math.random() * 100) + 10,
});
}
return res;
}
refresh(): void {
this.visitData = this.genData();
}
handleClick(data: G2MiniAreaClickItem): void {
//this.msg.info(`${data.item.x} - ${data.item.y}`);
}
}

View File

@ -1,14 +1,23 @@
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { DatatableDataindexComponent } from './dataindex/dataindex.component';
import { DatatableCustomtableComponent } from './components/customtable/customtable.component';
import { DatatableCustomindexComponent } from './components/customtable/customindex/customindex.component';
import { DatatableOwnerComponent } from './components/customtable/owner/owner.component';
import { DatatableDriverComponent } from './components/customtable/driver/driver.component';
import { DatatableOperationtableComponent } from './components/operationtable/operationtable.component';
import { DatatableOrderReportingComponent } from './reporting/components/order-reporting/order-reporting.component';
import { DatatableReportingVerifyResultComponent } from './reporting/components/verify-result/verify-result.component';
import { DatatableDataindexComponent } from './components/dataindex/dataindex.component';
const routes: Routes = [
{ path: 'dataindex', component: DatatableDataindexComponent },
{ path: 'customtable', component: DatatableCustomtableComponent },
{ path: 'customindex', component: DatatableCustomindexComponent },
{ path: 'owner', component: DatatableOwnerComponent },
{ path: 'driver', component: DatatableDriverComponent },
{ path: 'operationtable', component: DatatableOperationtableComponent },
{ path: 'reporting/order', component: DatatableOrderReportingComponent },
{ path: 'verify-result', component: DatatableReportingVerifyResultComponent }];
];
@NgModule({
imports: [RouterModule.forChild(routes)],

View File

@ -1,16 +1,29 @@
import { NgModule, Type } from '@angular/core';
import { SharedModule, SHARED_G2_MODULES } from '@shared';
import { DatatableRoutingModule } from './datatable-routing.module';
import { DatatableDataindexComponent } from './dataindex/dataindex.component';
import { DatatableCustomtableComponent } from './components/customtable/customtable.component';
import { DatatableCustomindexComponent } from './components/customtable/customindex/customindex.component';
import { DatatableOwnerComponent } from './components/customtable/owner/owner.component';
import { DatatableDriverComponent } from './components/customtable/driver/driver.component';
import { DatatableOperationtableComponent } from './components/operationtable/operationtable.component';
import { OperationtablePieComponent } from './components/operationtable/pie/pie.component';
import { DatatableOrderReportingComponent } from './reporting/components/order-reporting/order-reporting.component';
import { DatatableDataindexComponent } from './components/dataindex/dataindex.component';
import { DatatableReportingUploadSettingComponent } from './reporting/components/upload-setting/upload-setting.component';
import { DatatableReportingVerifyResultComponent } from './reporting/components/verify-result/verify-result.component';
const COMPONENTS: Type<void>[] = [
DatatableDataindexComponent,
DatatableCustomtableComponent,
DatatableCustomindexComponent,
DatatableOwnerComponent,
DatatableDriverComponent,
DatatableOperationtableComponent,
OperationtablePieComponent,
DatatableOrderReportingComponent,
DatatableReportingUploadSettingComponent,
DatatableReportingVerifyResultComponent];
DatatableReportingVerifyResultComponent
];
@NgModule({
imports: [

View File

@ -0,0 +1,30 @@
/*
* @Description :
* @Version : 1.0
* @Author : Shiming
* @Date : 2021-12-27 10:30:56
* @LastEditors : Shiming
* @LastEditTime : 2022-01-18 17:14:59
* @FilePath : \\tms-obc-web\\src\\app\\routes\\account\\services\\account.service.ts
* Copyright (C) 2022 huzhenhong. All rights reserved.
*/
import { Injectable, Injector } from '@angular/core';
import { _HttpClient } from '@delon/theme';
import { NzMessageService } from 'ng-zorro-antd/message';
import { map } from 'rxjs/operators';
import { BaseService } from 'src/app/shared/services/core/base.service';
import { EAFileUtil } from 'src/app/shared/utils/file.util';
@Injectable({
providedIn: 'root',
})
export class DataService extends BaseService {
// 查询运营报表
$api_listOperationalReportPage = `/api/sdc/report/listOperationalReportPage`;
constructor(public injector: Injector) {
super(injector);
}
}

View File

@ -360,7 +360,7 @@
</div>
</nz-card>
<nz-modal [(nzVisible)]="isVisible" [nzFooter]="nzModalFooter" [nzTitle]="modalTitle" (nzOnOk)="handleOK()" (nzOnCancel)="handleCancel()">
<nz-modal [(nzVisible)]="isVisible" [nzFooter]="nzModalFooter" [nzTitle]="modalTitle" (nzOnOk)="handleOK()" nzWidth="1000px" (nzOnCancel)="handleCancel()">
<ng-container *nzModalContent>
<div *ngIf="!modalcontent">暂无附件信息</div>
<div [innerHTML]="modalcontent"></div>

View File

@ -4,7 +4,7 @@
* @Author : Shiming
* @Date : 2021-12-06 20:20:26
* @LastEditors : Shiming
* @LastEditTime : 2022-03-28 20:30:13
* @LastEditTime : 2022-03-29 14:30:12
* @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\components\\bulk-detail\\bulk-detail.component.html
* Copyright (C) 2022 huzhenhong. All rights reserved.
-->
@ -222,7 +222,7 @@
</ng-template>
</div>
</nz-card>
<nz-card>
<nz-card *ngIf="!route?.snapshot?.queryParams?.sts">
<nz-tabset >
<nz-tab nzTitle="风险异常检测">
<button nz-button nzType="primary"[disabled]="">申 诉</button>
@ -247,7 +247,7 @@
</nz-tabset>
</nz-card>
<nz-modal [(nzVisible)]="isVisible" [nzFooter]="nzModalFooter" [nzTitle]="modalTitle" (nzOnOk)="handleOK()" (nzOnCancel)="handleCancel()">
<nz-modal [(nzVisible)]="isVisible" [nzFooter]="nzModalFooter" [nzTitle]="modalTitle" (nzOnOk)="handleOK()" nzWidth="1000px" (nzOnCancel)="handleCancel()">
<ng-container *nzModalContent>
<div *ngIf="!modalcontent">暂无附件信息</div>
<div [innerHTML]="modalcontent"></div>

View File

@ -4,7 +4,7 @@
* @Author : Shiming
* @Date : 2021-12-06 20:20:26
* @LastEditors : Shiming
* @LastEditTime : 2022-03-23 14:44:43
* @LastEditTime : 2022-03-29 14:30:11
* @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\components\\bulk-detail\\bulk-detail.component.ts
* Copyright (C) 2022 huzhenhong. All rights reserved.
*/
@ -65,14 +65,17 @@ export class OrderManagementBulkeDetailComponent implements OnInit {
mapList:any[] = []; //地图点位数据组
addressItems:any[] = []; //打点地址数据组
constructor(
private route: ActivatedRoute,
public route: ActivatedRoute,
private msgSrv: NzMessageService,
private service: OrderManagementService,
private router: Router,
private modal: NzModalService
) {}
) {
}
ngOnInit(): void {
console.log(this.route?.snapshot?.queryParams?.sts);
this.initData();
this.getTrajectory();
}

View File

@ -4,7 +4,7 @@
* @Author : Shiming
* @Date : 2022-01-04 17:29:18
* @LastEditors : Shiming
* @LastEditTime : 2022-01-18 17:18:54
* @LastEditTime : 2022-03-29 16:26:09
* @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\components\\complaint-detail\\complaint-detail.component.html
* Copyright (C) 2022 huzhenhong. All rights reserved.
-->
@ -21,7 +21,7 @@
<ng-template #cardTemplate>
<button nz-button nzType="primary" [nzLoading]="false" (click)="viewEvaluate()" *ngIf="complaint?.complaintStatus == 1" [disabled]="complaintStatus">处理</button>
</ng-template>
<h2>投诉单号:{{datailList?.id}}</h2>
<h2>投诉单号:{{datailList?.complaintCode}}</h2>
<sf #sf [compact]="true" [ui]="ui" [schema]="schema" [button]="'none'" *ngIf="schema" [formData]="datailList">
<ng-template sf-template="imgUrls" let-schema="schema" let-item let-ui="ui">
<app-imagelist [imgList]="datailList?.imgUrls"></app-imagelist>

View File

@ -4,7 +4,7 @@
* @Author : Shiming
* @Date : 2022-01-12 10:52:50
* @LastEditors : Shiming
* @LastEditTime : 2022-03-23 10:11:08
* @LastEditTime : 2022-03-29 16:13:40
* @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\components\\complaint\\complaint.component.html
* Copyright (C) 2022 huzhenhong. All rights reserved.
-->
@ -21,10 +21,10 @@
<nz-card>
<div nz-row nzGutter="12">
<!-- 查询字段大于3个时根据展开状态调整布局 -->
<div nz-col [nzSpan]="18">
<div nz-col [nzSpan]="24">
<sf #sf [schema]="schema" [ui]="ui" [compact]="true" [button]="'none'"></sf>
</div>
<div nz-col [nzSpan]="6" >
<div nz-col [nzSpan]="24" style="display: flex; justify-content: flex-end;">
<button nz-button nzType="primary" [disabled]="!sf.valid" [nzLoading]="false"
(click)="st?.load(1)" acl [acl-ability]="['ORDER-COMPLAINT-search']">查询</button>
<button nz-button nzType="primary" acl [acl-ability]="['ORDER-COMPLAINT-export']"

View File

@ -106,18 +106,24 @@ export class OrderManagementComplaintComponent implements OnInit {
type: 'string',
ui: {
widget: 'dict-select',
params: { dictKey: 'complaint:cause' },
params: { dictKey: 'drvcomplaint:cause' },
containsAllLabel: true,
} as SFSelectWidgetSchema
},
complainantTime: {
type: 'string',
title: '投诉时间',
ui: { widget: 'sl-from-to', type: 'date', format: 'yyyy-MM-dd' } as SFDateWidgetSchema,
ui: {
widget: 'sl-from-to', type: 'date', format: 'yyyy-MM-dd' } as SFDateWidgetSchema,
},
},
};
this.ui = { '*': { spanLabelFixed: 110, grid: { span: 8, gutter: 4 } } };
this.ui =
{
'*': { spanLabelFixed: 110, grid: { span: 8, gutter: 8 } },
};
}
/**
@ -145,7 +151,7 @@ export class OrderManagementComplaintComponent implements OnInit {
className: 'text-center',
},
{ title: '托运方', index: 'shipperAppUserName', width: '200px', className: 'text-center' },
{ title: '司机', index: 'driverIdLabel', width: '120px', className: 'text-center' },
{ title: '司机', index: 'driverName', width: '120px', className: 'text-center' },
{
title: '投诉原因',
className: 'text-center',

View File

@ -4,7 +4,7 @@
* @Author : Shiming
* @Date : 2022-01-12 10:52:50
* @LastEditors : Shiming
* @LastEditTime : 2022-03-25 13:44:42
* @LastEditTime : 2022-03-29 14:28:39
* @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\components\\compliance-audit\\compliance-audit.component.html
* Copyright (C) 2022 huzhenhong. All rights reserved.
-->
@ -88,7 +88,7 @@
</ng-template>
<ng-template st-row="billCode" let-item let-index="index">
<a *ngIf="item.billType == '1'" [routerLink]="'/order-management/vehicle/vehicle-detail/' + item.id">{{ item.billCode }}</a>
<a *ngIf="item.billType == '2'" [routerLink]="'/order-management/bulk/bulk-detail/' + item.id">{{ item.billCode }}</a>
<a *ngIf="item.billType == '2'" [routerLink]="'/order-management/bulk/bulk-detail/' + item.id" [queryParams]="{ sts :1}">{{ item.billCode }}</a>
<a *ngIf="item.billType == '3'" [routerLink]="'/order-management/vehicle/vehicle-detail/' + item.id">{{ item.billCode }}</a>
<div>
<span>{{ item?.billStatusLabel }}</span>

View File

@ -25,6 +25,7 @@ export class OrderManagementComplianceAuditComponent implements OnInit {
changeId: any; // 主页面查看运费变更记录id - 用于运费变更记录
changeViewId: any; // 查看运费变更记录id - 用于查看
auditId: any;
auditIdR: any;
auditMany = false;
isVisibleView = false;
isVisibleEvaluate = false;
@ -142,7 +143,6 @@ export class OrderManagementComplianceAuditComponent implements OnInit {
type: 'string',
title: '订单号',
ui: {
placeholder: '最多100个单号空号隔开'
}
},
resourceCode: {
@ -629,7 +629,7 @@ export class OrderManagementComplianceAuditComponent implements OnInit {
idList.push(item.id);
});
} else {
idList.push(this.sfView.value.billCode)
idList.push(this?.auditIdR)
}
const parms = {
ids: idList,
@ -681,7 +681,8 @@ export class OrderManagementComplianceAuditComponent implements OnInit {
audit(item?: any) {
if (item) {
this.isVisibleRE = true;
this.auditId = item.id;
this.auditId = item.billCode;
this.auditIdR = item.id;
this.initSTAudit(1);
} else {
if (this.selectedRows.length <= 0) {

View File

@ -146,14 +146,14 @@ export class OrderManagementReceiptsAuditComponent implements OnInit {
type: 'string',
title: '订单号',
ui: {
placeholder: '最多100个单号空号隔开'
placeholder: '请输入'
}
},
wayBillCode: {
type: 'string',
title: '运单号',
ui: {
placeholder: '最多100个运单空号隔开'
placeholder: '请输入'
}
},
resourceCode: {

View File

@ -333,7 +333,7 @@
</ng-template>
</div>
</nz-card>
<nz-modal [(nzVisible)]="isVisible" [nzFooter]="nzModalFooter" [nzTitle]="modalTitle" (nzOnOk)="handleOK()" (nzOnCancel)="handleCancel()">
<nz-modal [(nzVisible)]="isVisible" nzWidth="1000px" [nzFooter]="nzModalFooter" [nzTitle]="modalTitle" (nzOnOk)="handleOK()" (nzOnCancel)="handleCancel()">
<ng-container *nzModalContent>
<div *ngIf="!modalcontent">暂无附件信息</div>
<div [innerHTML]="modalcontent"></div>

View File

@ -229,8 +229,31 @@
</ng-template>
</div>
</nz-card>
<nz-modal [(nzVisible)]="isVisible" [nzFooter]="nzModalFooter" [nzTitle]="modalTitle" (nzOnOk)="handleOK()" (nzOnCancel)="handleCancel()">
<nz-card *ngIf="!route?.snapshot?.queryParams?.sts">
<nz-tabset >
<nz-tab nzTitle="风险异常检测">
<button nz-button nzType="primary"[disabled]="">申 诉</button>
<div>
您的订单可能存在交易风险,请及时提交申诉材料,提交成功后,平台将及时完成审核并通知您!
</div>
<div>如果您的运单没有问题可以提出申诉并提供相关资料我们将24小时内审核反馈</div>
<ul *ngFor="let item of abnormalList">
<li>系统识别:{{item?.complianceTypeName}}</li>
<li>{{item?.determineDetails}},您可在企业端提交申诉材料或联系客服。</li>
<li>2021-11-07 03:20:15</li>
</ul>
</nz-tab>
<nz-tab nzTitle="异常预警">
<st #st [data]="addressItems" [columns]="logColumns2" [ps]="0" [page]="{ show: false, showSize: false }">
</st>
</nz-tab>
<nz-tab nzTitle="操作日志">
<st #st [data]="addressItems" [columns]="logColumns2" [ps]="0" [page]="{ show: false, showSize: false }">
</st>
</nz-tab>
</nz-tabset>
</nz-card>
<nz-modal [(nzVisible)]="isVisible" nzWidth="1000px" [nzFooter]="nzModalFooter" [nzTitle]="modalTitle" (nzOnOk)="handleOK()" (nzOnCancel)="handleCancel()">
<ng-container *nzModalContent>
<div *ngIf="!modalcontent">暂无附件信息</div>
<div [innerHTML]="modalcontent"></div>

View File

@ -4,7 +4,7 @@
* @Author : Shiming
* @Date : 2021-12-28 14:42:03
* @LastEditors : Shiming
* @LastEditTime : 2022-03-23 14:45:58
* @LastEditTime : 2022-03-29 16:08:56
* @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\components\\vehicle-detail\\vehicle-detail.component.ts
* Copyright (C) 2022 huzhenhong. All rights reserved.
*/
@ -29,6 +29,7 @@ export class OrderManagementVehicleDetailComponent implements OnInit {
mapList: any[] = []; //地图点位数据组
pois: any[] = [];
addressItems: any[] = []; //打点地址数据组
abnormalList: any[] = [];
i: any = {
unLoadingPlaceList: [],
billExpenseDetails: [],
@ -66,7 +67,7 @@ export class OrderManagementVehicleDetailComponent implements OnInit {
}
];
constructor(
private route: ActivatedRoute,
public route: ActivatedRoute,
private msgSrv: NzMessageService,
private service: OrderManagementService,
private router: Router,
@ -102,6 +103,19 @@ export class OrderManagementVehicleDetailComponent implements OnInit {
this.i.scheduleVOList = this.i?.scheduleVOList?.filter((data: any) => data.displayStatus !== 'HIDE');
}
});
this.service.request(this.service.$api_listBillComplianceAbnormalByBillId, { id: this.id }).subscribe(res => {
if (res) {
console.log('风险详情')
console.log(res)
this.abnormalList = res
}
});
this.service.request(this.service.$api_getAbnormalWarningByBillId, { id: this.id }).subscribe(res => {
if (res) {
console.log('异常预警')
console.log(res)
}
});
}
// 取消订单
cancellation() {

View File

@ -71,6 +71,9 @@ export class PartnerListComponent {
nzComponentParams: { info: { ...item, enterpriseName: item.enterpriseName || item.contactName }, sourcePage: '合伙人审核列表' },
nzFooter: null
});
modal.afterClose.subscribe(res => {
modal.destroy();
});
}
editTemplateAction(item: any) {
@ -102,6 +105,7 @@ export class PartnerListComponent {
.subscribe(res => {
if (res) {
this.service.msgSrv.success('修改成功');
this.st.load(1);
this.nzModalService.closeAll();
}
});
@ -161,6 +165,7 @@ export class PartnerListComponent {
if (res) {
this.service.msgSrv.success('修改成功');
this.nzModalService.closeAll();
this.st.load(1);
}
});
}
@ -185,6 +190,7 @@ export class PartnerListComponent {
} else {
this.service.msgSrv.warning('发起失败');
}
this.st.load(1);
});
}
});

View File

@ -112,6 +112,7 @@ export class PartnerAuditModalComponent implements OnInit {
};
this.service
.request(this.service.$api_audit_partner, {
...params,
auditStatusEnum: params.auditStatusEnum,
id: params.id,
approvalOpinion: params.approvalOpinion,

View File

@ -16,8 +16,8 @@
<p style="margin-bottom: 0">{{ detailData?.enterpriseName }}</p>
</div>
<div nz-col [nzLg]="12" [nzSm]="24" [nzXs]="24">
<nz-badge nzStatus="success" nzText="正常" *ngIf="detailData?.stateLocked === 0"> </nz-badge>
<nz-badge nzStatus="error" nzText="冻结" *ngIf="detailData?.stateLocked === 1"></nz-badge>
<nz-badge nzStatus="success" nzText="正常" *ngIf="detailData?.lockedStatus === 0"> </nz-badge>
<nz-badge nzStatus="error" nzText="冻结" *ngIf="detailData?.lockedStatus === 1"></nz-badge>
</div>
</div>
<div nz-row>
@ -46,12 +46,12 @@
</ng-container>
<ng-container *ngIf="detailData?.approvalStatus != 10">
<button [disabled]="service.http.loading" nz-button nzDanger nz-popconfirm [nzPopconfirmTitle]="enable"
(nzOnConfirm)="freezeOrResume(0)" nzPopconfirmPlacement="bottomRight" *ngIf="detailData?.stateLocked"
(nzOnConfirm)="freezeOrResume(0)" nzPopconfirmPlacement="bottomRight" *ngIf="detailData?.lockedStatus"
acl [acl-ability]="['USERCENTER-FREIGHT-ENTERPRISE-D-lock']">
启用
</button>
<button [disabled]="service.http.loading" nz-button nzDanger nz-popconfirm [nzPopconfirmTitle]="frozen"
(nzOnConfirm)="freezeOrResume(1)" nzPopconfirmPlacement="bottomRight" *ngIf="!detailData?.stateLocked"
(nzOnConfirm)="freezeOrResume(1)" nzPopconfirmPlacement="bottomRight" *ngIf="!detailData?.lockedStatus"
acl [acl-ability]="['USERCENTER-FREIGHT-ENTERPRISE-D-lock']">
冻结
</button>

View File

@ -117,8 +117,10 @@ export class PartnerDetailComponent implements OnInit, OnDestroy {
freezeOrResume(type: number) {
this.service.http
.post(this.service.$api_lock_freight, {
id: this.route.snapshot.params.id,
statedLocked: !!type
appUserId: [this.detailData.appUserId],
freezeOrResume: !!type,
pageName: '合伙人详情',
telephone: this.detailData.adminUserInfo.mobile
})
.subscribe(res => {
if (res.data === true) {
@ -138,7 +140,7 @@ export class PartnerDetailComponent implements OnInit, OnDestroy {
const modal = this.nzModalService.create({
nzTitle: '审核',
nzContent: PartnerAuditModalComponent,
nzComponentParams: { info: { ...this.detailData, isPass },sourcePage:'合伙人审核详情' },
nzComponentParams: { info: { ...this.detailData, isPass }, sourcePage: '合伙人审核详情' },
nzFooter: null
});
}
@ -274,7 +276,7 @@ export class PartnerDetailComponent implements OnInit, OnDestroy {
operatingEndTime: this.datePipe.transform(dateil.operatingEndTime, 'yyyy-MM-dd'),
operatingStartTime: this.datePipe.transform(dateil.operatingStartTime, 'yyyy-MM-dd')
});
this.service.request(this.service.$api_save_entp_partner, params).subscribe(res => {
if (res) {
this.service.msgSrv.success('企业合伙人修改成功');

View File

@ -16,8 +16,8 @@
<p style="margin-bottom: 0">{{ detailData?.adminUserInfo?.name }}</p>
</div>
<div nz-col [nzLg]="12" [nzSm]="24" [nzXs]="24">
<nz-badge nzStatus="success" nzText="正常" *ngIf="detailData?.stateLocked === 0"> </nz-badge>
<nz-badge nzStatus="error" nzText="冻结" *ngIf="detailData?.stateLocked === 1"></nz-badge>
<nz-badge nzStatus="success" nzText="正常" *ngIf="detailData?.lockedStatus === 0"> </nz-badge>
<nz-badge nzStatus="error" nzText="冻结" *ngIf="detailData?.lockedStatus === 1"></nz-badge>
</div>
</div>
<div nz-row>
@ -46,12 +46,12 @@
</ng-container>
<ng-container *ngIf="detailData?.approvalStatus != 10">
<button [disabled]="service.http.loading" nz-button nzDanger nz-popconfirm [nzPopconfirmTitle]="enable"
(nzOnConfirm)="freezeOrResume(0)" nzPopconfirmPlacement="bottomRight" *ngIf="detailData?.stateLocked"
(nzOnConfirm)="freezeOrResume(0)" nzPopconfirmPlacement="bottomRight" *ngIf="detailData?.lockedStatus"
acl [acl-ability]="['USERCENTER-FREIGHT-ENTERPRISE-D-lock']">
启用
</button>
<button [disabled]="service.http.loading" nz-button nzDanger nz-popconfirm [nzPopconfirmTitle]="frozen"
(nzOnConfirm)="freezeOrResume(1)" nzPopconfirmPlacement="bottomRight" *ngIf="!detailData?.stateLocked"
(nzOnConfirm)="freezeOrResume(1)" nzPopconfirmPlacement="bottomRight" *ngIf="!detailData?.lockedStatus"
acl [acl-ability]="['USERCENTER-FREIGHT-ENTERPRISE-D-lock']">
冻结
</button>

View File

@ -92,8 +92,10 @@ export class PersonalPartnerDetailComponent implements OnInit {
freezeOrResume(type: number) {
this.service.http
.post(this.service.$api_lock_freight, {
id: this.route.snapshot.params.id,
statedLocked: !!type
appUserId: [this.detailData.appUserId],
freezeOrResume: !!type,
pageName: '合伙人详情',
telephone: this.detailData.adminUserInfo.mobile
})
.subscribe(res => {
if (res.data === true) {

View File

@ -38,7 +38,7 @@ export class PartnerListService extends ShipperBaseService {
// 渠道销售修改详情
$api_get_partner_change_list = '/api/mdc/partnerChannelRelLog/partnerChannelUpdateDetaiList';
// 冻结/启用企业业
$api_lock_freight = '/api/mdc/cuc/enterpriseInfo/operate/lock';
$api_lock_freight = '/api/mdc/cuc/userApp/freezeOrResume';
// 根据地区code查询列表
$api_get_region_by_code = '/api/mdc/pbc/region/getRegionByCode';

View File

@ -4,7 +4,7 @@
* @Author : Shiming
* @Date : 2022-02-24 20:09:49
* @LastEditors : Shiming
* @LastEditTime : 2022-03-10 15:12:03
* @LastEditTime : 2022-03-29 13:40:16
* @FilePath : \\tms-obc-web\\src\\app\\routes\\partner\\rebate-management\\components\\rebate-record\\rebate-record.component.html
* Copyright (C) 2022 huzhenhong. All rights reserved.
-->
@ -33,7 +33,7 @@
<!-- 数据列表 -->
<st
#st
[data]="data"
[data]="service.$api_get_getIncomeByBillpage"
[columns]="columns"
[req]="{ method: 'POST', allInBody: true, reName: { pi: 'pageIndex', ps: 'pageSize' }, params: reqParams }"
[res]="{ reName: { list: 'data.records', total: 'data.total' } }"
@ -41,8 +41,8 @@
[loadingDelay]="500"
[loading]="service.http.loading"
>
<ng-template st-row='name44' let-item let-index='index'>
<div style="color: #f59a23;" (click)="feedback()">1223</div>
<ng-template st-row='abnormalFeedback' let-item let-index='index'>
<div style="color: #f59a23;" (click)="feedback()">123212{{item?.abnormalFeedback}}</div>
</ng-template>
</st>
</nz-card>

View File

@ -32,30 +32,12 @@ export class ParterRebateManageMentRecordComponent implements OnInit {
public shipperservice: ShipperBaseService,
) {}
/**
* 查询字段个数
*/
get queryFieldCount(): number {
return Object.keys(this.schema?.properties || {}).length;
}
/**
* 伸缩查询条件
*/
expandToggle(): void {
this._$expand = !this._$expand;
this.sf?.setValue('/_$expand', this._$expand);
}
/**
* 查询参数
*/
get reqParams() {
const params: any = Object.assign({}, this.sf?.value || {});
delete params._$expand;
return {
...params,
deadlineTime: {
start: this.sf?.value?.deadlineTime?.[0] || '',
end: this.sf?.value?.deadlineTime?.[1] || '',
},
};
}
ngOnInit() {
@ -66,7 +48,6 @@ export class ParterRebateManageMentRecordComponent implements OnInit {
initSF() {
this.schema = {
properties: {
_$expand: { type: 'boolean', ui: { hidden: true } },
month: {
type: 'string',
title: '时间月份',
@ -90,7 +71,8 @@ export class ParterRebateManageMentRecordComponent implements OnInit {
this.columns = [
{
title: '月份',
index: 'name1'
index: 'month',
format: (item: any) => {return item?.month ? item?.month + '月' : ''}
},
{
title: '返佣金额(元)',
@ -98,7 +80,7 @@ export class ParterRebateManageMentRecordComponent implements OnInit {
},
{
title: '合伙人名称',
index: 'name1'
index: 'partnerName'
},
{
title: '实际等级',
@ -106,7 +88,7 @@ export class ParterRebateManageMentRecordComponent implements OnInit {
},
{
title: '管理费比例',
index: 'name1'
index: 'rebateRatio'
},
{
title: '返佣时间',
@ -114,7 +96,7 @@ export class ParterRebateManageMentRecordComponent implements OnInit {
},
{
title: '异常反馈',
render: 'name44'
render: 'abnormalFeedback'
},
{
title: '操作',

View File

@ -1,6 +1,14 @@
import { Component, OnInit, ViewChild, Type } from '@angular/core';
import { STComponent, STColumn, STChange } from '@delon/abc/st';
import { SFComponent, SFDateWidgetSchema, SFRadioWidgetSchema, SFSchema, SFSchemaEnum, SFSelectWidgetSchema, SFUISchema } from '@delon/form';
import {
SFComponent,
SFDateWidgetSchema,
SFRadioWidgetSchema,
SFSchema,
SFSchemaEnum,
SFSelectWidgetSchema,
SFUISchema
} from '@delon/form';
import { ShipperBaseService } from '@shared';
import { NzModalService, NzModalRef } from 'ng-zorro-antd/modal';
import { of } from 'rxjs';
@ -28,8 +36,6 @@ export class ParterRebateManageMentAddPartnerListComponent implements OnInit {
editId = false;
selectedIndex = 0;
columns: STColumn[] = [
{ title: '', type: 'checkbox', width: '50px', className: 'text-center' },
{
@ -42,20 +48,22 @@ export class ParterRebateManageMentAddPartnerListComponent implements OnInit {
{ title: '手机号', index: 'contactMobile', className: 'text-center', width: 150 },
{ title: '类型', index: 'partnerType', className: 'text-center', width: 130, type: 'enum', enum: { 1: '企业', 2: '个人' } },
{
title: '操作', width: '90px', fixed: 'right',
title: '操作',
width: '90px',
fixed: 'right',
buttons: [
{
text: '添加',
click: _record => this.add(_record),
acl: { ability: ['AbnormalAppear-reply'] }
},
}
]
},
}
];
get reqParams() {
// signStatus固定传20 代表签约完成
let params: any = { ...this.sf?.value,signStatus: 20 };
// signStatus固定传20 代表签约完成 signStatus: 20
let params: any = { ...this.sf?.value, };
return params;
}
@ -67,12 +75,11 @@ export class ParterRebateManageMentAddPartnerListComponent implements OnInit {
public service: RebateManagementService,
public shipperSrv: ShipperBaseService,
private modal: NzModalService,
private modals: NzModalRef,
) { }
private modals: NzModalRef
) {}
ngOnInit(): void {
this.initSF()
this.initSF();
}
initSF() {
this.schema = {
@ -97,19 +104,19 @@ export class ParterRebateManageMentAddPartnerListComponent implements OnInit {
}
},
default: ''
},
}
}
}
};
this.ui = { '*': { spanLabelFixed: 110, grid: { span: 8, gutter: 4 } } };
}
search() {
this.st?.load(1)
this.st?.load(1);
}
selectedIndexChange(event: any) {
if (this.selectedIndex === 0) {
this.st?.load(1)
this.st?.load(1);
}
}
/**
@ -121,8 +128,7 @@ export class ParterRebateManageMentAddPartnerListComponent implements OnInit {
// 回复操作
add(item: any) {
console.log(item);
this.modals.destroy(item)
this.modals.destroy(item);
}
// 批量回复操作
batchReply() {
@ -130,6 +136,6 @@ export class ParterRebateManageMentAddPartnerListComponent implements OnInit {
// this.service.msgSrv.warning('请勾选数据!')
// return;
// }
this.modals.destroy(this.selectedRows)
this.modals.destroy(this.selectedRows);
}
}

View File

@ -4,7 +4,7 @@
* @Author : Shiming
* @Date : 2022-02-24 20:09:49
* @LastEditors : Shiming
* @LastEditTime : 2022-03-28 19:46:23
* @LastEditTime : 2022-03-29 10:47:02
* @FilePath : \\tms-obc-web\\src\\app\\routes\\partner\\rebate-management\\components\\rebate-setting\\add\\add.component.html
* Copyright (C) 2022 huzhenhong. All rights reserved.
-->
@ -26,17 +26,17 @@
</sv>
<sv col="1">
&nbsp;&nbsp;
<app-rebate-table ></app-rebate-table>
<app-rebate-table #table [(data)]='tabelData'></app-rebate-table>
</sv>
<sv-title>关联合伙人配置</sv-title>
&nbsp;&nbsp;<sv label="合伙人选择">
<!-- <nz-select ngModel="lucy" style="max-width: 400px; min-width: 200px;">
<nz-option nzValue="jack" nzLabel="Jack"></nz-option>
<nz-option nzValue="lucy" nzLabel="Lucy"></nz-option>
</nz-select> -->
<input *ngIf="peopleStatus" nz-input disabled style=" max-width: 200px;" placeholder="请添加" [(ngModel)]="partnerPeople" />
<nz-select [(ngModel)]="partnerType" style="max-width: 400px; min-width: 200px;">
<nz-option nzValue="1" nzLabel="全部合伙人"></nz-option>
<nz-option nzValue="2" nzLabel="新注册合伙人"></nz-option>
<nz-option nzValue="3" nzLabel="自定义合伙人"></nz-option>
</nz-select>
&nbsp;&nbsp;<span style="color: #0000FF;" (click)="add()">添加</span>
<st *ngIf="!peopleStatus" #st [data]="partnerPeopleList" [columns]="columns"
<st *ngIf="partnerPeopleList?.length > 0" #st [data]="partnerPeopleList" [columns]="columns"
[req]="{ method: 'POST', allInBody: true, reName: { pi: 'pageIndex', ps: 'pageSize' } }"
[res]="{ reName: { list: 'data.records', total: 'data.total' } }"
[page]="{ show: true, showSize: true, pageSizes: [10, 20, 30, 50, 100] }" [loading]="false"
@ -44,22 +44,25 @@
</st>
</sv>
&nbsp;&nbsp;<sv label="优先级" col="1">
<nz-select ngModel="lucy" style="max-width: 400px; min-width: 200px;">
<nz-option nzValue="jack" nzLabel="Jack"></nz-option>
<nz-option nzValue="lucy" nzLabel="Lucy"></nz-option>
<nz-select [(ngModel)]="priority" style="max-width: 400px; min-width: 200px;">
<nz-option nzValue=1 nzLabel="1">1</nz-option>
<nz-option nzValue=2 nzLabel="2">2</nz-option>
<nz-option nzValue=3 nzLabel="3">3</nz-option>
<nz-option nzValue=4 nzLabel="4">4</nz-option>
<nz-option nzValue=5 nzLabel="5">5</nz-option>
</nz-select>
</sv>
&nbsp;&nbsp;<sv label="规则说明" col="1">
<sf #sf mode="edit" [schema]="schema1" [ui]="{ '*': { spanLabelFixed: 10, grid: { span: 16 }} }"
button="none"> </sf>
</sv>
&nbsp;&nbsp;<sv label="规则说明" col="1">
<textarea style="max-width: 400px; min-width: 200px;" rows="4" nz-input [(ngModel)]="inputValue"></textarea>
&nbsp;&nbsp;<sv label="备注" col="1">
<textarea style="max-width: 400px; min-width: 200px;" rows="4" nz-input [(ngModel)]="remarke"></textarea>
</sv>
</sv-container>
<div class="align-center" style="margin-top: 15px;">
<button nz-button nzType="primary" (click)="goBack()">取消</button>
<button nz-button nzType="primary" style="margin-left: 48px" (click)="submit()"
<button nz-button nzType="primary" style="margin-left: 48px" (click)="save()"
acl [acl-ability]="['SUPPLY-VEHICLE-AMEND-submitChange']">提交</button
>
</div>

View File

@ -4,7 +4,7 @@
* @Author : Shiming
* @Date : 2022-03-21 09:26:45
* @LastEditors : Shiming
* @LastEditTime : 2022-03-28 19:47:56
* @LastEditTime : 2022-03-29 10:53:39
* @FilePath : \\tms-obc-web\\src\\app\\routes\\partner\\rebate-management\\components\\rebate-setting\\add\\add.component.ts
* Copyright (C) 2022 huzhenhong. All rights reserved.
*/
@ -24,13 +24,17 @@ import { inRange } from '@delon/util';
templateUrl: './add.component.html'
})
export class ParterRebateManageMentAddComponent implements OnInit {
@ViewChild('table') table!: any;
tabelData: any;
configName: string = '';
accountingRate: Number = 2;
partnerPeople: any;
partnerType: string = '';
remarke: string = '';
accountingRate: Number = 0;
priority: string = '';
partnerPeopleList: any;
peopleStatus: boolean = true;
configType = '1';
precision = 2;
partnerId :Array<string> =[];
inputValue = '';
@ViewChild('st', { static: true })
st!: STComponent;
@ -67,7 +71,7 @@ export class ParterRebateManageMentAddComponent implements OnInit {
initSF(data?: any) {
this.schema1 = {
properties: {
content: {
ruleDescription: {
type: 'string',
title: '',
ui: {
@ -77,7 +81,7 @@ export class ParterRebateManageMentAddComponent implements OnInit {
height: 650
}
},
default: data?.agreementContent || ''
// default: data?.agreementContent || ''
}
}
};
@ -85,7 +89,6 @@ export class ParterRebateManageMentAddComponent implements OnInit {
ngOnInit() {
this.initSF();
}
submit() {}
goBack() {
window.history.go(-1);
}
@ -103,15 +106,19 @@ export class ParterRebateManageMentAddComponent implements OnInit {
nzFooter: null
});
modalRef.afterClose.subscribe((res: any) => {
this.partnerId = [];
if (res) {
console.log(Array.isArray(res));
console.log(res);
if(Array.isArray(res)) {
this.partnerPeopleList = res;
this.peopleStatus = false
res.forEach((ele: any) => {
this.partnerId.push(ele?.id);
})
} else {
this.partnerPeople = res?.enterpriseName;
}
this.partnerPeopleList = [res];
this.partnerId.push(res?.id);
}
}
});
}
@ -123,12 +130,19 @@ export class ParterRebateManageMentAddComponent implements OnInit {
accountingRate: this.accountingRate,
configName: this.configName,
configType: this.configType,
rebateConfigLineDTO: {}
rebateConfigLineDTO: this.table.data,
priority: this.priority,// 优先级
partnerId: this.partnerId.join(','),
ruleDescription: this.sf.value.ruleDescription,
remarke: this.remarke,
partnerType: this.partnerType
}
console.log(params);
this.service.request(this.service.$api_save_rebateConfig, params).subscribe((res: any) => {
if(res) {
console.log(res);
this.service.msgSrv.success('新增成功!')
this.router.navigate(['/partner/rebate/setting'])
}
})
}

View File

@ -4,7 +4,7 @@
* @Author : Shiming
* @Date : 2022-02-24 20:09:49
* @LastEditors : Shiming
* @LastEditTime : 2022-03-22 14:42:27
* @LastEditTime : 2022-03-29 11:14:08
* @FilePath : \\tms-obc-web\\src\\app\\routes\\partner\\rebate-management\\components\\rebate-setting\\rebate-setting.component.html
* Copyright (C) 2022 huzhenhong. All rights reserved.
-->
@ -41,14 +41,24 @@
#st
[data]="service.$api_get_rebateConfig"
[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] }"
[loadingDelay]="500"
[loading]="service.http.loading"
>
<ng-template st-row='name44' let-item let-index='index'>
<div style="color: #f59a23;" (click)="feedback()">1223</div>
<ng-template st-row='configType' let-item let-index='index'>
<div *ngIf="item.configType == 1">按全部等级配置</div>
<div *ngIf="item.configType == 2">按不同等级配置</div>
</ng-template>
<ng-template st-row='partnerType' let-item let-index='index'>
<div *ngIf="item.partnerType == 1">全部合伙人</div>
<div *ngIf="item.partnerType == 2">新注册合伙人</div>
<div *ngIf="item.partnerType == 3">自定义合伙人</div>
</ng-template>
<ng-template st-row='stateLocked' let-item let-index='index'>
<div >{{item?.stateLocked ? '启用' : '禁用'}}</div>
</ng-template>
</st>
</nz-card>

View File

@ -23,7 +23,6 @@ export class ParterRebateManageMentSettingComponent implements OnInit {
sf!: SFComponent;
spuStatus = '1';
_$expand = false;
data = [{ name1: 1111 }];
constructor(
public router: Router,
public ar: ActivatedRoute,
@ -32,30 +31,12 @@ export class ParterRebateManageMentSettingComponent implements OnInit {
public shipperservice: ShipperBaseService,
) {}
/**
* 查询字段个数
*/
get queryFieldCount(): number {
return Object.keys(this.schema?.properties || {}).length;
}
/**
* 伸缩查询条件
*/
expandToggle(): void {
this._$expand = !this._$expand;
this.sf?.setValue('/_$expand', this._$expand);
}
/**
* 查询参数
*/
get reqParams() {
const params: any = Object.assign({}, this.sf?.value || {});
delete params._$expand;
return {
...params,
deadlineTime: {
start: this.sf?.value?.deadlineTime?.[0] || '',
end: this.sf?.value?.deadlineTime?.[1] || '',
},
};
}
ngOnInit() {
@ -66,15 +47,22 @@ export class ParterRebateManageMentSettingComponent implements OnInit {
initSF() {
this.schema = {
properties: {
_$expand: { type: 'boolean', ui: { hidden: true } },
month: {
configName: {
type: 'string',
title: '时间月份',
format: 'month',
title: '配置名称',
},
partnerId: {
stateLocked: {
type: 'string',
title: '合伙人名称'
title: '状态',
enum: [
{label: '全部', value: ''},
{label: '启用', value: 0},
{label: '禁用', value: 1},
],
ui: {
widget: 'select',
},
},
}
};
@ -89,36 +77,45 @@ export class ParterRebateManageMentSettingComponent implements OnInit {
initST() {
this.columns = [
{
title: '月份',
index: '配置名称'
title: '配置名称',
index: 'configName',
width: '200px',
},
{
title: '配置类型',
index: 'configType'
render: 'configType',
width: '200px',
},
{
title: '备注',
index: 'remark'
index: 'remark',
width: '250px',
},
{
title: '关联合伙人范围',
index: 'partnerType'
render: 'partnerType',
width: '200px',
},
{
title: '创建时间',
index: 'enableTime'
index: 'enableTime',
width: '200px',
},
{
title: '启用时间',
index: 'enableTime'
index: 'enableTime',
width: '200px',
},
{
title: '优先级',
index: 'priority'
index: 'priority',
width: '100px',
},
{
title: '状态',
index: 'stateLocked'
render: 'stateLocked',
width: '100px',
},
{
title: '操作',
@ -132,6 +129,12 @@ export class ParterRebateManageMentSettingComponent implements OnInit {
},
{
text: '禁用',
iif: (_record) =>{ return _record.stateLocked == true},
click: _record => this.viewEvaluate(_record),
},
{
text: '启用',
iif: (_record) =>{ return _record.stateLocked == false},
click: _record => this.viewEvaluate(_record),
},
]
@ -142,10 +145,29 @@ export class ParterRebateManageMentSettingComponent implements OnInit {
*禁用
*/
viewEvaluate(item: any) {
console.log(item.stateLocked);
let title = ''
let stateLocked: boolean;
if(item.stateLocked) {
title = '是否禁用该配置?'
stateLocked = false
} else {
title = '是否启用该配置?'
stateLocked = true
}
this.modal.confirm({
nzTitle: '是否禁用该配置?',
nzTitle: title,
nzOnOk: () => {
const params = {
id: item?.id,
stateLocked: stateLocked,
}
this.service.request(this.service.$api_set_updateRebateConfig,params).subscribe((res: any) => {
if(res) {
this.service.msgSrv.success('设置成功!')
this.st.reload();
}
})
}
});
}

View File

@ -4,7 +4,7 @@
* @Author : Shiming
* @Date : 2022-03-10 11:19:00
* @LastEditors : Shiming
* @LastEditTime : 2022-03-10 13:51:05
* @LastEditTime : 2022-03-29 11:26:38
* @FilePath : \\tms-obc-web\\src\\app\\routes\\partner\\rebate-management\\services\\rebate-management.service.ts
* Copyright (C) 2022 huzhenhong. All rights reserved.
*/
@ -21,6 +21,12 @@ export class RebateManagementService extends BaseService {
public $api_get_rebateConfig = '/api/mdc/rebateConfig/list/page';
// 保存返佣配置表
public $api_save_rebateConfig = '/api/mdc/rebateConfig/save';
// 启用/禁用返佣配置
public $api_set_updateRebateConfig = '/api/mdc/rebateConfig/updateRebateConfig';
// 运营端查询合伙人返佣
public $api_get_getIncomeByBillpage = '/api/bpc/partnerIncomeHead/getIncomeByBillpage';
  // 查询合伙人信息-分页
public $api_get_partner_page = '/api/mdc/partner/list/page';
constructor(public injector: Injector) {

View File

@ -247,7 +247,7 @@
</div>
</nz-card>
<nz-modal [(nzVisible)]="isVisible" [nzFooter]="nzModalFooter" [nzTitle]="modalTitle" (nzOnOk)="handleOK()" (nzOnCancel)="handleCancel()">
<nz-modal [(nzVisible)]="isVisible" nzWidth="1000px" [nzFooter]="nzModalFooter" [nzTitle]="modalTitle" (nzOnOk)="handleOK()" (nzOnCancel)="handleCancel()">
<ng-container *nzModalContent>
<div *ngIf="!modalcontent">暂无附件信息</div>
<div [innerHTML]="modalcontent"></div>

View File

@ -1,7 +1,7 @@
<!--
* @Author: your name
* @Date: 2021-12-03 15:31:52
* @LastEditTime : 2022-03-24 13:49:56
* @LastEditTime : 2022-03-29 11:10:08
* @LastEditors : Shiming
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath : \\tms-obc-web\\src\\app\\routes\\waybill-management\\components\\vehicle-detail\\vehicle-detail.component.html
@ -227,7 +227,7 @@
</div>
</nz-card>
<nz-modal [(nzVisible)]="isVisible" [nzFooter]="nzModalFooter" [nzTitle]="modalTitle" (nzOnOk)="handleOK()" (nzOnCancel)="handleCancel()">
<nz-modal [(nzVisible)]="isVisible" nzWidth="1000px" [nzFooter]="nzModalFooter" [nzTitle]="modalTitle" (nzOnOk)="handleOK()" (nzOnCancel)="handleCancel()">
<ng-container *nzModalContent>
<div *ngIf="!modalcontent">暂无附件信息</div>
<div [innerHTML]="modalcontent"></div>

View File

@ -4,7 +4,7 @@
* @Author : Shiming
* @Date : 2022-01-25 20:18:52
* @LastEditors : Shiming
* @LastEditTime : 2022-03-28 20:26:30
* @LastEditTime : 2022-03-29 10:34:14
* @FilePath : \\tms-obc-web\\src\\app\\shared\\components\\rebate-table\\rebate-table.component.html
* Copyright (C) 2022 huzhenhong. All rights reserved.
-->
@ -37,10 +37,9 @@
</td>
<td nzWidth="220px" nzAlign="center" >
<div >
<nz-select ngModel="gradeConfigId">
<nz-option nzValue="jack" nzLabel="Jack154654564654"></nz-option>
<nz-option nzValue="lucy" nzLabel="Lucy"></nz-option>
</nz-select>
<nz-select style="min-width: 150px;" [(ngModel)]="item.gradeConfigId" >
<nz-option *ngFor="let item of grage" [nzValue]="item.id" [nzLabel]="item.gradeName"></nz-option>
</nz-select>
</div>
</td>
<td nzWidth="220px" nzAlign="center" >

View File

@ -1,41 +1,49 @@
import { debounceTime } from 'rxjs/operators';
import { Subject } from 'rxjs';
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, OnInit, ViewChild } from '@angular/core';
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, Input, OnInit, Output, ViewChild } from '@angular/core';
import { BaseService } from '@shared';
import { SFComponent, SFSchema, SFUISchema } from '@delon/form';
import { EventEmitter} from '@angular/core'
@Component({
selector: 'app-rebate-table',
templateUrl: './rebate-table.component.html',
styleUrls: ['./rebate-table.component.less']
})
export class RebateTableComponent implements OnInit {
data: any[] = [
{
gradeConfigId: '',
startAmount: 0,
endAmount: 0,
managementFeeRatio: 0,
}
];
@Input() data: any =[];
@Output()
private dataChange: EventEmitter<any> = new EventEmitter();
emit() {
this.dataChange.emit(this.data)
}
headers: any[] = [];
gradeConfigId: string ='';
grage: any[] = [];
formatterDollar = (value: number): string => `${value}`;
changeSub = new Subject<string>();
constructor(public service: BaseService, private cdr: ChangeDetectorRef) {}
ngOnInit(): void {
this.data = [
{
gradeConfigId: '',
startAmount: 0,
endAmount: 0,
managementFeeRatio: 0,
}
];
this.loadData();
this.changeendAmountAction();
}
loadData() {
// this.service.request('/api/mdc/cuc/insuranceConfig/list').subscribe(res => {
// if (res) {
// console.log(res);
// this.data = res;
// this.cdr.detectChanges();
// }
// });
this.service.request('/api/mdc/partnerGradeConfig/listPartnerGradeConfig').subscribe(res => {
if (res) {
console.log(res);
this.grage = res;
this.cdr.detectChanges();
}
});
// this.service.request('/api/mdc/pbc/sysConfigItem/findItemValueByItemKeys', [
// "rebate.config.minrebatePrice"
// ]).subscribe(res => {
@ -66,12 +74,13 @@ export class RebateTableComponent implements OnInit {
const num = Number(paras[0]);
const i = Number(paras[1]);
if (num <= this.data[i].startAmount) {
if (num <= this.data[i]?.startAmount) {
console.log(this.data[i].endAmount);
this.data[i].endAmount = null;
setTimeout(() => {
this.data[i].endAmount = this.data[i].startAmount + 1 ;
this.data[i].endAmount = this.data[i]?.startAmount + 1 ;
}, 0);
this.changeNextstartAmount(this.data[i].startAmount + 1, i + 1);
this.changeNextstartAmount(this.data[i]?.startAmount + 1, i + 1);
return;
}
this.data[i].endAmount = num;

View File

@ -297,7 +297,7 @@ export class ShipperBaseService extends BaseService {
map(res => {
if (res) {
return res.map((m: any) => {
return { label: `${m.employeeVO?.empName}/${m.employeeVO?.mobile}`, value: m.userAppId };
return { label: `${m.employeeVO?.empName}/${m.employeeVO?.mobile}`, value: m.id };
});
} else {
return [];

View File

@ -3,6 +3,7 @@ import { G2MiniAreaModule } from '@delon/chart/mini-area';
import { G2PieModule } from '@delon/chart/pie';
import { G2TimelineModule } from '@delon/chart/timeline';
import { G2CardModule } from '@delon/chart/card';
import { G2CustomModule } from '@delon/chart/custom';
export const SHARED_G2_MODULES = [G2BarModule, G2PieModule, G2TimelineModule, G2MiniAreaModule, G2CardModule];
export const SHARED_G2_MODULES = [G2BarModule, G2PieModule, G2TimelineModule, G2MiniAreaModule, G2CardModule, G2CustomModule];