This commit is contained in:
wangshiming
2022-04-15 16:49:09 +08:00
parent 792598efd4
commit ff7a5a80fc
5 changed files with 128 additions and 26 deletions

View File

@ -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 {