edit
This commit is contained in:
@ -11,13 +11,15 @@ import { UsermanageService } from '../../services/usercenter.service';
|
||||
})
|
||||
export class UserCenterComponentsDriverComponent implements OnInit {
|
||||
_$expand = false;
|
||||
url = `/rule?_allow_anonymous=true`;
|
||||
|
||||
ui: SFUISchema = { '*': { spanLabelFixed: 120, grid: { lg: 8, md: 12, sm: 12, xs: 24 }, enter: () => this.st.load() } };
|
||||
schema: SFSchema = this.initSF();
|
||||
columns!: STColumn[];
|
||||
@ViewChild('st', { static: false }) st!: STComponent;
|
||||
@ViewChild('sf', { static: false }) sf!: SFComponent;
|
||||
ui: SFUISchema = { '*': { spanLabelFixed: 120, grid: { lg: 8, md: 12, sm: 12, xs: 24 }, enter: () => this.st.load() } };
|
||||
schema: SFSchema = this.initSF();
|
||||
columns: STColumn[] = this.initST();
|
||||
|
||||
@ViewChild('promoterModal', { static: false })
|
||||
promoterModal!: any;
|
||||
promotersTelephone = '';
|
||||
|
||||
constructor(public service: UsermanageService, private modal: NzModalService, private router: Router, private ar: ActivatedRoute) {}
|
||||
|
||||
@ -44,80 +46,38 @@ export class UserCenterComponentsDriverComponent implements OnInit {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.initST();
|
||||
this.ar.url.subscribe(params => {
|
||||
this.st?.load(1);
|
||||
});
|
||||
}
|
||||
|
||||
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: 'effectiveDateStr',
|
||||
type: 'badge',
|
||||
badge: {
|
||||
正常: { text: '正常', color: 'success' },
|
||||
冻结: { text: '冻结', color: 'warning' },
|
||||
废弃: { text: '废弃', color: 'default' }
|
||||
addPromoter(item?: any) {
|
||||
this.promotersTelephone = item?.promotersTelephone;
|
||||
const modal = this.modal.create({
|
||||
nzTitle: '推广业务员',
|
||||
nzContent: this.promoterModal,
|
||||
nzOnOk: () => {
|
||||
if (!!!this.promotersTelephone) {
|
||||
return false;
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '驾驶证状态',
|
||||
className: 'text-center',
|
||||
index: 'enStatusStr2',
|
||||
type: 'badge',
|
||||
badge: {
|
||||
正常: { text: '正常', color: 'success' },
|
||||
冻结: { text: '冻结', color: 'warning' },
|
||||
废弃: { text: '废弃', color: 'default' }
|
||||
if (typeof this.promotersTelephone === 'string' && !/(^1\d{10}$)/.test(this.promotersTelephone)) {
|
||||
return false;
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '从业资格证状态',
|
||||
className: 'text-center',
|
||||
index: 'enStatusStr3',
|
||||
type: 'badge',
|
||||
badge: {
|
||||
正常: { text: '正常', color: 'success' },
|
||||
冻结: { text: '冻结', color: 'warning' },
|
||||
废弃: { text: '废弃', color: 'default' }
|
||||
}
|
||||
},
|
||||
{ title: '推广业务员', className: 'text-center', index: 'unifiedSocialCreditCode2' },
|
||||
{ title: '注册时间', className: 'text-center', index: 'unifiedSocialCreditCode3' },
|
||||
{
|
||||
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 } });
|
||||
}
|
||||
this.service.request(this.service.$api_add_salesman, { ids: [item.id], salesmanMobile: this.promotersTelephone }).subscribe(res => {
|
||||
if (res) {
|
||||
this.service.msgSrv.success(item?.promotersTelephone ? '添加推广员成功' : '修改推广员成功');
|
||||
}
|
||||
]
|
||||
this.st.load();
|
||||
});
|
||||
return;
|
||||
}
|
||||
];
|
||||
}
|
||||
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 });
|
||||
}
|
||||
/**
|
||||
* 重置表单
|
||||
*/
|
||||
@ -238,4 +198,64 @@ export class UserCenterComponentsDriverComponent implements OnInit {
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private initST(): STColumn[] {
|
||||
return [
|
||||
{ title: '司机姓名', className: 'text-center', index: 'name' },
|
||||
{ title: '手机号', className: 'text-center', index: 'mobile' },
|
||||
{ title: '当前车辆', className: 'text-center', index: 'carNo' },
|
||||
{
|
||||
title: '实名认证状态',
|
||||
className: 'text-center',
|
||||
index: 'identityStatus',
|
||||
type: 'badge',
|
||||
badge: {
|
||||
0: { text: '待审核', color: 'default' },
|
||||
1: { text: '通过', color: 'success' },
|
||||
2: { text: '驳回', color: 'warning' }
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '驾驶证状态',
|
||||
className: 'text-center',
|
||||
index: 'driverLicenseStatus',
|
||||
type: 'badge',
|
||||
badge: {
|
||||
10: { text: '待审核', color: 'default' },
|
||||
20: { text: '审核通过', color: 'success' },
|
||||
30: { text: '驳回', color: 'warning' },
|
||||
40: { text: '证件过期', color: 'error' }
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '从业资格证状态',
|
||||
className: 'text-center',
|
||||
index: 'practiceSenioritLicenseStatus',
|
||||
type: 'badge',
|
||||
badge: {
|
||||
10: { text: '待审核', color: 'default' },
|
||||
20: { text: '审核通过', color: 'success' },
|
||||
30: { text: '驳回', color: 'warning' },
|
||||
40: { text: '证件过期', color: 'error' }
|
||||
}
|
||||
},
|
||||
{ title: '推广业务员', className: 'text-center', render: 'promotersTelephone' },
|
||||
{ title: '注册渠道', className: 'text-center', index: 'source', type: 'enum', enum: { 1: '自己录入', 2: '运营录入' } },
|
||||
{ title: '注册时间', className: 'text-center', index: 'createTime' },
|
||||
{
|
||||
title: '操作',
|
||||
width: '170px',
|
||||
className: 'text-center',
|
||||
buttons: [
|
||||
{
|
||||
text: '查看',
|
||||
click: item => {
|
||||
this.router.navigate(['./detail', item.appUserId], { relativeTo: this.ar });
|
||||
// this.router.navigate(['./view', item.id], { relativeTo: this.ar, queryParams: { tenantId: item.tenantId } });
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user