This commit is contained in:
Lingzi
2022-04-02 15:49:24 +08:00
parent 05cb535943
commit 422fe61a53
28 changed files with 275 additions and 104 deletions

View File

@ -39,7 +39,7 @@
<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>
[page]="{ show: true, showSize: true, pageSizes: [20, 50, 100] }" [loading]="service.http.loading"></st>
</nz-card>
<nz-card nzTitle="用户新增报表" [nzExtra]="extraTemplate">
<ng-template #extraTemplate>
@ -55,4 +55,5 @@
</div>
</div>
</ng-template>
<app-operation-curve #curve [chartData]="chartData.lineChart"></app-operation-curve>
</nz-card>

View File

@ -23,6 +23,7 @@ export class DatatableCustomindexComponent implements OnInit {
dateNext: any = null;
modeNext = 'year';
timeNext: any = ['2022-01-01 00:00:00']
chartData: any;
columns: STColumn[] = [

View File

@ -38,8 +38,9 @@
</div>
</div>
</ng-template>
<st #st multiSort [columns]="columns" [ps]="20" [data]="service.$api_listOperationalReportPage"
<st #st multiSort [columns]="columns" [ps]="20" [data]="service.$api_listDriverReportPage"
[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>
[page]="{ show: true, showSize: true, pageSizes: [20, 50, 100] }" [loading]="service.http.loading">
</st>
</nz-card>

View File

@ -1,7 +1,7 @@
import { Component, OnInit, ViewChild } from '@angular/core';
import { STColumn, STComponent } from '@delon/abc/st';
import { SFComponent, SFDateWidgetSchema, SFSchema, SFUISchema } from '@delon/form';
import { DatePipe, _HttpClient } from '@delon/theme';
import { DatePipe, _HttpClient } from '@delon/theme';
import { differenceInCalendarDays } from 'date-fns';
import { DataService } from '../../../services/data.service';
@ -19,79 +19,92 @@ export class DatatableDriverComponent implements OnInit {
mode = 'year';
date: any = null;
defineDate = [];
time: any = ['2022-01-01 00:00:00']
queryTime: any = ''
dateFormat = 'yyyy-MM-dd';
today = new Date();
ui: SFUISchema = {};
schema: SFSchema = {};
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: 'driverName', className: 'text-center' },
{ title: '手机号', index: 'driverPhone', className: 'text-center' },
{ title: '注册时间', index: 'driverRegisterTime', className: 'text-center' },
{
title: '司机状态', index: 'driverStatus', className: 'text-center', type: 'enum', enum: {
0: '未激活',
1: '活跃',
2: '沉默',
3: '流失',
}
},
{ title: '运单数', index: 'wbAllCount', className: 'text-center' },
{ title: '待接单运单', index: 'wbWaitCount', className: 'text-center' },
{ title: '已完成运单', index: 'wbOverCount', className: 'text-center' },
{ title: '运费金额', index: 'wbAllAmount', className: 'text-right', width: '100px', type: 'widget', widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.wbAllAmount }) } },
{ title: '已收运费金额', index: 'wbGetAmount', className: 'text-right', width: '100px', type: 'widget', widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.wbGetAmount }) } },
{ title: '待收运费金额', index: 'wbWaitAmount', className: 'text-right', width: '100px', type: 'widget', widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.wbWaitAmount }) } },
];
/**
* 查询参数
*/
get reqParams() {
if(this.mode === 'year') {
get reqParams() {
if (this.mode === 'year') {
this.type = 1
} else if(this.mode === 'month') {
} else if (this.mode === 'month') {
this.type = 2
} else if(this.mode === 'date') {
} else if (this.mode === 'date') {
this.type = 3
} else {
this.type = 4
}
let params: any = {
time: this.time,
type: this.type,
queryTime: this.queryTime,
...this.sf?.value
};
};
delete params._$expand;
return { ...params };
}
constructor(public service: DataService, private datePipe: DatePipe) { }
ngOnInit(): void {
ngOnInit(): void {
this.initSF();
}
/**
* 初始化查询表单
*/
/**
* 初始化查询表单
*/
initSF() {
this.schema = {
properties: {
_$expand: { type: 'boolean', ui: { hidden: true } },
billCode: {
driverName: {
type: 'string',
title: '司机姓名',
ui: {
placeholder: '请输入',
}
},
resourceCode: {
driverPhone: {
type: 'string',
title: '手机号',
ui: {
placeholder: '请选择',
}
},
loadingPlace: {
driverStatus: {
type: 'string',
title: '司机状态',
ui: {
widget: 'select',
placeholder: '请选择',
}
},
enum: [
{ label: '未激活', value: 0 },
{ label: '活跃', value: 1 },
{ label: '沉默', value: 2 },
{ label: '流失', value: 3 },
]
},
createTime: {
driverRegisterTime: {
title: '注册时间',
type: 'string',
ui: {
@ -105,24 +118,18 @@ export class DatatableDriverComponent implements OnInit {
};
this.ui = { '*': { spanLabelFixed: 110, grid: { span: 8, gutter: 4 } } };
}
changeData(){
if(this.mode === 'year') {
changeData() {
if (this.mode === 'year') {
this.dateFormat = 'yyyy'
} else if(this.mode === 'month') {
} 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']
if (this.mode === 'year') {
this.queryTime = [this.datePipe.transform(this.date, 'yyyy')]
} else if (this.mode === 'month') {
this.queryTime = [this.datePipe.transform(this.date, 'yyyy-MM')]
}
this.st.reload({ ...this.reqParams });
}
@ -130,25 +137,25 @@ export class DatatableDriverComponent implements OnInit {
// Can not select days before today and today
differenceInCalendarDays(current, this.today) > 0;
export() {
// this.service.downloadFile(this.service.$api_exportUploadBill, this.sf.value, {});
}
export() {
// this.service.downloadFile(this.service.$api_exportUploadBill, this.sf.value, {});
}
search() {
this.st?.load(1)
}
/**
* 伸缩查询条件
*/
expandToggle() {
this._$expand = !this._$expand;
this.sf?.setValue('/_$expand', this._$expand);
}
/**
* 伸缩查询条件
*/
expandToggle() {
this._$expand = !this._$expand;
this.sf?.setValue('/_$expand', this._$expand);
}
/**
* 重置表单
*/
resetSF() {
resetSF() {
this.sf.reset();
this._$expand = false;
}

View File

@ -41,5 +41,6 @@
<st #st multiSort [columns]="columns" [ps]="20" [data]="service.$api_listShipperReportPage"
[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>
[page]="{ show: true, showSize: true, pageSizes: [20, 50, 100] }" [loading]="service.http.loading">>
</st>
</nz-card>

View File

@ -26,33 +26,33 @@ export class DatatableOwnerComponent implements OnInit {
schema: SFSchema = {};
columns: STColumn[] = [
{ title: '货主名称', index: 'enterpriseName', className: 'text-center' },
{ title: '注册时间', index: 'registerTime', className: 'text-center' },
{ title: '客户类型', index: 'customerType', className: 'text-center', type: 'enum', enum: {
{ title: '货主名称', index: 'enterpriseName', className: 'text-center', width: '200px' },
{ title: '注册时间', index: 'registerTime', className: 'text-center', width: '200px' },
{ title: '客户类型', index: 'customerType', className: 'text-center', width: '100px', type: 'enum', enum: {
1: '平台客户',
2: '直客',
3: '渠道客户'
}
},
{ title: '业务员', index: 'salesmanName', className: 'text-center' },
{ title: '合伙人', index: 'partnerName', className: 'text-center' },
{ title: '客户状态', index: 'customerStatus', className: 'text-center', type: 'enum', enum: {
{ title: '业务员', index: 'salesmanName', className: 'text-center', width: '100px' },
{ title: '合伙人', index: 'partnerName', className: 'text-center', width: '100px' },
{ title: '客户状态', index: 'customerStatus', className: 'text-center', width: '100px', type: 'enum', enum: {
1: '未激活',
2: '沉默',
3: '流失',
4: '活跃'
} },
{ title: '订单数', index: 'zsl', className: 'text-center' },
{ title: '订单金额', index: 'ddje', className: 'text-center' },
{ title: '应收订单数', index: 'ysdds', className: 'text-center' },
{ title: '应收金额', index: 'yingsje', className: 'text-center' },
{ title: '待开票订单数', index: 'yifyf', className: 'text-center' },
{ title: '待开票金额', index: 'dkpdds', className: 'text-center' },
{ title: '已收金额', render: 'yisje', className: 'text-center' },
{ title: '应收附加费', index: 'yingsfjf', className: 'text-center' },
{ title: '已收附加费', index: 'yisfjf', className: 'text-center' },
{ title: '附加费率', index: 'fjfl', className: 'text-center' },
{ title: '已开票金额', index: 'ykpje', className: 'text-center' }
{ title: '订单数', index: 'zsl', className: 'text-center', width: '100px' },
{ title: '订单金额', index: 'ddje', className: 'text-right', width: '100px', type: 'widget', widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.ddje }) } },
{ title: '应收订单数', index: 'ysdds', className: 'text-center', width: '120px' },
{ title: '应收金额', index: 'yingsje', className: 'text-right', width: '100px', type: 'widget', widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.yingsje }) } },
{ title: '待开票订单数', index: 'yifyf', className: 'text-center', width: '130px' },
{ title: '待开票金额', index: 'dkpdds', className: 'text-right', width: '120px', type: 'widget', widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.dkpdds }) } },
{ title: '已收金额', index: 'yisje', className: 'text-right', width: '100px', type: 'widget', widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.yisje }) } },
{ title: '应收附加费', index: 'yingsfjf', className: 'text-right', width: '120px', type: 'widget', widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.yingsfjf }) } },
{ title: '已收附加费', index: 'yisfjf', className: 'text-right', width: '120px', type: 'widget', widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.yisfjf }) } },
{ title: '附加费率', index: 'fjfl', className: 'text-center', width: '100px' },
{ title: '已开票金额', index: 'ykpje', className: 'text-right', width: '100px', type: 'widget', widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.ykpje }) } },
];
/**
* 查询参数

View File

@ -37,7 +37,7 @@
<st #st multiSort bordered [data]="service.$api_listOperationalReportPage" [columns]="columns" [ps]="20"
[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: [20, 50, 100] }" [loading]="false">
[page]="{ show: true, showSize: true, pageSizes: [20, 50, 100] }" [loading]="service.http.loading">
</st>
</nz-card>