fix bug
This commit is contained in:
@ -1,6 +1,46 @@
|
||||
<!--
|
||||
* @Description :
|
||||
* @Version : 1.0
|
||||
* @Author : Shiming
|
||||
* @Date : 2022-03-30 13:55:41
|
||||
* @LastEditors : Shiming
|
||||
* @LastEditTime : 2022-04-15 16:40:11
|
||||
* @FilePath : \\tms-obc-web\\src\\app\\routes\\datatable\\components\\compliance\\customer\\customer.component.html
|
||||
* Copyright (C) 2022 huzhenhong. All rights reserved.
|
||||
-->
|
||||
<!-- 页头 -->
|
||||
<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>
|
||||
<sf #sf mode="search" [schema]="searchSchema" (formSubmit)="st.reset($event)" (formReset)="st.reset($event)"></sf>
|
||||
<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>
|
||||
<st
|
||||
#st
|
||||
[bordered]="true"
|
||||
[scroll]="{ x: '2000px' }"
|
||||
[data]="service.$api_listCusComplianceReportPage"
|
||||
[columns]="columns"
|
||||
[req]="{ process: beforeReq }"
|
||||
[res]="{ reName: { list: 'data.records', total: 'data.total' } , process: afterRes}"
|
||||
[page]="{ show: true, showSize: true, pageSizes: [10, 20, 30, 50, 100, 200, 300, 500, 1000] }"
|
||||
[loading]="false"
|
||||
>
|
||||
<ng-template st-row="freightPrice" let-item let-index="index">
|
||||
{{ item.freightPrice | currency }}
|
||||
</ng-template>
|
||||
</st>
|
||||
</nz-card>
|
||||
|
||||
@ -1,39 +1,89 @@
|
||||
import { SFComponent } from '@delon/form';
|
||||
/*
|
||||
* @Description :
|
||||
* @Version : 1.0
|
||||
* @Author : Shiming
|
||||
* @Date : 2022-03-30 13:55:41
|
||||
* @LastEditors : Shiming
|
||||
* @LastEditTime : 2022-04-15 16:35:10
|
||||
* @FilePath : \\tms-obc-web\\src\\app\\routes\\datatable\\components\\compliance\\customer\\customer.component.ts
|
||||
* Copyright (C) 2022 huzhenhong. All rights reserved.
|
||||
*/
|
||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { STColumn, STComponent } from '@delon/abc/st';
|
||||
import { STColumn, STComponent, STRequestOptions } from '@delon/abc/st';
|
||||
import { SFSchema } from '@delon/form';
|
||||
import { ModalHelper, _HttpClient } from '@delon/theme';
|
||||
import { DataService } from '../../../services/data.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-datatable-compliance-customer',
|
||||
templateUrl: './customer.component.html',
|
||||
})
|
||||
export class DatatableComplianceCustomerComponent implements OnInit {
|
||||
url = `/user`;
|
||||
@ViewChild('sf', {static: false}) sf!: SFComponent
|
||||
mode = 'year';
|
||||
date: any = null;
|
||||
defineDate = [];
|
||||
time: any = ['2022-01-01 00:00:00']
|
||||
dateFormat = 'yyyy';
|
||||
dateNext: any = null;
|
||||
modeNext = 'year';
|
||||
timeNext: any = ['2022-01-01 00:00:00']
|
||||
today = new Date();
|
||||
searchSchema: SFSchema = {
|
||||
properties: {
|
||||
no: {
|
||||
type: 'string',
|
||||
title: '编号'
|
||||
}
|
||||
title: '客户名称'
|
||||
},
|
||||
no2: {
|
||||
type: 'string',
|
||||
title: '业务员'
|
||||
},
|
||||
no3: {
|
||||
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' },
|
||||
]
|
||||
}
|
||||
{ title: '公司名称', index: 'enterpriseName' ,},
|
||||
{ title: '注册时间', index: 'registerTime' },
|
||||
{ title: '客户类型', width: '100px', index: 'customerType' },
|
||||
{ title: '业务员', index: 'salesmanName' },
|
||||
{ title: '合伙人', index: 'partnerName' },
|
||||
{ title: '订单数', index: 'billCounts' },
|
||||
{ title: '订单不合格数', index: 'billQuaCounts' },
|
||||
{ title: '订单不合格率', index: 'billQuaCountsPer' },
|
||||
{ title: '货源单订单数', index: 'gsourceCounts' },
|
||||
{ title: '合同单数', index: 'billConCounts' },
|
||||
{ title: '货源单个', index: 'gsourceCounts' },
|
||||
{ title: '运费直付单数', index: 'freightDirPayCounts' },
|
||||
{ title: '运费代收单数', index: 'freightRepPayCounts' },
|
||||
{ title: '手机直付', index: 'updatedAt' },
|
||||
{ title: '汇款单数', index: 'updatedAt' },
|
||||
{ title: '及时付款', index: 'timelyPayPer' },
|
||||
|
||||
];
|
||||
|
||||
constructor(private http: _HttpClient, private modal: ModalHelper) { }
|
||||
|
||||
constructor(private http: _HttpClient, private modal: ModalHelper,public service: DataService,) { }
|
||||
beforeReq = (requestOptions: STRequestOptions) => {
|
||||
const params: any = Object.assign({}, this.sf?.value || {});
|
||||
delete params._$expand;
|
||||
console.log(params);
|
||||
if (this.sf) {
|
||||
Object.assign(requestOptions.body, {
|
||||
...params,
|
||||
});
|
||||
}
|
||||
return requestOptions;
|
||||
};
|
||||
afterRes = (data: any[], rawData?: any) => {
|
||||
return data.map(item => ({
|
||||
...item,
|
||||
}));
|
||||
};
|
||||
ngOnInit(): void { }
|
||||
|
||||
add(): void {
|
||||
|
||||
Reference in New Issue
Block a user