车队长列表
This commit is contained in:
228
src/app/routes/vehicle/components/list/list.component.ts
Normal file
228
src/app/routes/vehicle/components/list/list.component.ts
Normal file
@ -0,0 +1,228 @@
|
||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { STColumn, STColumnBadge, STComponent, STData } from '@delon/abc/st';
|
||||
import { SFComponent, SFSchema, SFUISchema } from '@delon/form';
|
||||
import { NzModalService } from 'ng-zorro-antd/modal';
|
||||
import { UsermanageService } from '../../../vehicle/services/vehicle.service';
|
||||
@Component({
|
||||
selector: 'app-Freight-components-list',
|
||||
templateUrl: './list.component.html',
|
||||
})
|
||||
export class VehicleComponentsListComponent implements OnInit {
|
||||
_$expand = false;
|
||||
url = `/rule?_allow_anonymous=true`;
|
||||
|
||||
ui!: SFUISchema;
|
||||
schema!: SFSchema;
|
||||
columns!: STColumn[];
|
||||
datalist = [
|
||||
{
|
||||
storeName: '企业名称',
|
||||
contactsName: '152746565',
|
||||
enterpriseName: '湖南',
|
||||
unifiedSocialCreditCode: '45454',
|
||||
contactsPhone: '*97889461561',
|
||||
effectiveDateStr: '废弃eww',
|
||||
enStatusStr2: '正常',
|
||||
enStatusStr3: '正常',
|
||||
unifiedSocialCreditCode3: '常用服务',
|
||||
unifiedSocialCreditCode2: '正常',
|
||||
tenantId: 1
|
||||
},
|
||||
{
|
||||
storeName: '企业名称',
|
||||
contactsName: '152746565',
|
||||
enterpriseName: '湖南',
|
||||
unifiedSocialCreditCode: '45454',
|
||||
contactsPhone: '*97889461561',
|
||||
effectiveDateStr: '废弃eww',
|
||||
enStatusStr2: '正常',
|
||||
enStatusStr3: '正常',
|
||||
unifiedSocialCreditCode3: '常用服务',
|
||||
unifiedSocialCreditCode2: '正常',
|
||||
tenantId: 2
|
||||
},
|
||||
]
|
||||
@ViewChild('st', { static: false }) st!: STComponent;
|
||||
@ViewChild('sf', { static: false }) sf!: SFComponent;
|
||||
|
||||
constructor(public service: UsermanageService, private modal: NzModalService, private router: Router, private ar: ActivatedRoute) {}
|
||||
/**
|
||||
* 查询字段个数navigate
|
||||
*/
|
||||
get queryFieldCount(): number {
|
||||
return Object.keys(this.schema?.properties || {}).length;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询参数
|
||||
*/
|
||||
get reqParams() {
|
||||
const params: any = {
|
||||
...(this.sf && this.sf.value),
|
||||
};
|
||||
if (this.sf?.value.effectiveDate) {
|
||||
params.effectiveDateStart = this.sf?.value.effectiveDate[0];
|
||||
params.effectiveDateEnd = this.sf?.value.effectiveDate[1];
|
||||
}
|
||||
delete params.effectiveDate;
|
||||
delete params.expand;
|
||||
return params;
|
||||
}
|
||||
|
||||
get selectedRows() {
|
||||
return this.st?.list.filter((item) => item.checked) || [];
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.initSF();
|
||||
this.initST();
|
||||
this.ar.url.subscribe((params) => {
|
||||
this.st?.load(1);
|
||||
});
|
||||
}
|
||||
dataProcess(data: STData[]): STData[] {
|
||||
return data.map((i, index) => {
|
||||
i.showSortFlag = false;
|
||||
return i;
|
||||
});
|
||||
}
|
||||
initSF() {
|
||||
this.schema = {
|
||||
properties: {
|
||||
expand: {
|
||||
type: 'boolean',
|
||||
ui: {
|
||||
hidden: true,
|
||||
},
|
||||
},
|
||||
storeName: { title: '企业名称', type: 'string', ui: { showRequired: false } },
|
||||
contactsName: {
|
||||
title: '联系人',
|
||||
type: 'string',
|
||||
ui: {
|
||||
showRequired: false,
|
||||
},
|
||||
},
|
||||
unifiedSocialCreditCode: {
|
||||
title: '税源地',
|
||||
type: 'string',
|
||||
ui: {
|
||||
showRequired: false,
|
||||
},
|
||||
},
|
||||
enStatus: {
|
||||
type: 'string',
|
||||
title: '货主状态',
|
||||
enum: [
|
||||
{ label: '全部', value: '' },
|
||||
{ label: '正常', value: 0 },
|
||||
{ label: '冻结', value: 1 },
|
||||
{ label: '废弃', value: 2 },
|
||||
],
|
||||
default: '',
|
||||
ui: {
|
||||
widget: 'select',
|
||||
visibleIf: {
|
||||
expand: (value: boolean) => value,
|
||||
},
|
||||
},
|
||||
},
|
||||
enStatus2: {
|
||||
type: 'string',
|
||||
title: 'CRM审核状态',
|
||||
enum: [
|
||||
{ label: '全部', value: '' },
|
||||
{ label: '正常', value: 0 },
|
||||
{ label: '冻结', value: 1 },
|
||||
{ label: '废弃', value: 2 },
|
||||
],
|
||||
default: '',
|
||||
ui: {
|
||||
widget: 'select',
|
||||
visibleIf: {
|
||||
expand: (value: boolean) => value,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
this.ui = { '*': { spanLabelFixed: 90, grid: { span: 8, gutter: 4 }, enter: () => this.st.load() } };
|
||||
}
|
||||
|
||||
initST() {
|
||||
this.columns = [
|
||||
// { title: '', type: 'checkbox', className: 'text-center' },
|
||||
{ title: '企业名称', className: 'text-center', index: 'storeName' },
|
||||
{ title: '联系人', className: 'text-center', index: 'contactsName' },
|
||||
{ title: '税源地', className: 'text-center', render: 'enterpriseName' },
|
||||
{ title: '累计运单金额', className: 'text-center', index: 'unifiedSocialCreditCode' },
|
||||
{ title: '道运证', className: 'text-center', index: 'contactsPhone',
|
||||
render: 'contactsPhone'
|
||||
},
|
||||
{ title: '企业状态', className: 'text-center', index: 'effectiveDateStr',
|
||||
type: 'badge',
|
||||
badge: {
|
||||
正常: { text: '正常', color: 'success' },
|
||||
冻结: { text: '冻结', color: 'warning' },
|
||||
废弃: { text: '废弃', color: 'default' },
|
||||
},
|
||||
},
|
||||
{
|
||||
title: 'CRM审核状态',
|
||||
className: 'text-center',
|
||||
index: 'enStatusStr2',
|
||||
type: 'badge',
|
||||
badge: {
|
||||
正常: { text: '正常', color: 'success' },
|
||||
冻结: { text: '冻结', color: 'warning' },
|
||||
废弃: { text: '废弃', color: 'default' },
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '代收权限',
|
||||
className: 'text-center',
|
||||
index: 'enStatusStr3',
|
||||
type: 'badge',
|
||||
badge: {
|
||||
正常: { text: '正常', color: 'success' },
|
||||
冻结: { text: '冻结', color: 'warning' },
|
||||
废弃: { text: '废弃', color: 'default' },
|
||||
},
|
||||
},
|
||||
{ title: '常用服务', className: 'text-center', index: 'unifiedSocialCreditCode3' },
|
||||
{ title: '推广业务员', className: 'text-center', index: 'unifiedSocialCreditCode2' },
|
||||
{
|
||||
title: '操作',
|
||||
width: '170px',
|
||||
className: 'text-center',
|
||||
buttons: [
|
||||
{
|
||||
text: '查看',
|
||||
click: (item) => {
|
||||
this.router.navigate(['./detail', item.tenantId], { relativeTo: this.ar });
|
||||
// this.router.navigate(['./view', item.id], { relativeTo: this.ar, queryParams: { tenantId: item.tenantId } });
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
}
|
||||
daoyun(item: any) {
|
||||
this.router.navigate(['./view', item.tenantId], { relativeTo: this.ar });
|
||||
}
|
||||
expandToggle() {
|
||||
this._$expand = !this._$expand;
|
||||
this.sf?.setValue('/expand', this._$expand);
|
||||
}
|
||||
creat() {
|
||||
this.router.navigate(['./new',], { relativeTo: this.ar });
|
||||
}
|
||||
/**
|
||||
* 重置表单
|
||||
*/
|
||||
resetSF() {
|
||||
this.sf.reset();
|
||||
this._$expand = false;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user