-
-
-
-
+
+
+
+
+
+
+
+
-
-
-
-
4">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ item.enterpriseName }}
-
-
-
-
-
- {{ item.contactsPhone }}
-
-
-
- 冻结
- 正常
+ [page]="{ show: true, showSize: true, pageSizes: [10, 20, 30, 50, 100, 200, 300, 500, 1000] }" [loadingDelay]="500"
+ [loading]="service.http.loading">
+
+
+ {{ item.promotersTelephone ||'添加' }}
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/app/routes/usercenter/components/driver/captain/captain.component.less b/src/app/routes/usercenter/components/driver/captain/captain.component.less
index 4d14e2a8..e69de29b 100644
--- a/src/app/routes/usercenter/components/driver/captain/captain.component.less
+++ b/src/app/routes/usercenter/components/driver/captain/captain.component.less
@@ -1,22 +0,0 @@
-.expend-options {
- margin-top: 0px;
-}
-
-
-@media (min-width: 1200px) {
- .expend-options {
- margin-top: -40px;
- max-width : 400px;
- position : absolute;
- right : 0;
- bottom : 30px;
- }
-
-}
-
-:host::ng-deep {
-
- nz-range-picker {
- width: 100%;
- }
-}
\ No newline at end of file
diff --git a/src/app/routes/usercenter/components/driver/captain/captain.component.ts b/src/app/routes/usercenter/components/driver/captain/captain.component.ts
index 24afedcd..69444493 100644
--- a/src/app/routes/usercenter/components/driver/captain/captain.component.ts
+++ b/src/app/routes/usercenter/components/driver/captain/captain.component.ts
@@ -11,49 +11,18 @@ import { UsermanageService } from '../../../services/usercenter.service';
})
export class UserCenterComponentsDriverCaptainComponent 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
- }
- ];
+ ui: SFUISchema = { '*': { spanLabelFixed: 120, grid: { lg: 8, md: 12, sm: 12, xs: 24 } } };
+ schema: SFSchema = this.initSF();
+ columns: STColumn[] = this.initST();
@ViewChild('st', { static: false }) st!: STComponent;
@ViewChild('sf', { static: false }) sf!: SFComponent;
+ @ViewChild('promoterModal', { static: false })
+ promoterModal!: any;
+ promotersTelephone = '';
+
constructor(public service: UsermanageService, private modal: NzModalService, private router: Router, private ar: ActivatedRoute) {}
- /**
- * 查询字段个数navigate
- */
- get queryFieldCount(): number {
- return Object.keys(this.schema?.properties || {}).length;
- }
/**
* 查询参数
@@ -76,8 +45,6 @@ export class UserCenterComponentsDriverCaptainComponent implements OnInit {
}
ngOnInit() {
- this.initSF();
- this.initST();
this.ar.url.subscribe(params => {
this.st?.load(1);
});
@@ -88,8 +55,48 @@ export class UserCenterComponentsDriverCaptainComponent implements OnInit {
return i;
});
}
- initSF() {
- this.schema = {
+
+ addPromoter(item?: any) {
+ this.promotersTelephone = item?.promotersTelephone;
+ const modal = this.modal.create({
+ nzTitle: '推广业务员',
+ nzContent: this.promoterModal,
+ nzOnOk: () => {
+ if (!!!this.promotersTelephone) {
+ return false;
+ }
+ if (typeof this.promotersTelephone === 'string' && !/(^1\d{10}$)/.test(this.promotersTelephone)) {
+ this.service.msgSrv.error('手机格式错误');
+ return false;
+ }
+ this.service
+ .request(this.service.$api_add_user_salesman, { userId: item.userId, mobile: this.promotersTelephone })
+ .subscribe(res => {
+ if (res) {
+ this.service.msgSrv.success(item?.promotersTelephone ? '添加推广员成功' : '修改推广员成功');
+ }
+ this.st.load();
+ });
+ return;
+ }
+ });
+ }
+
+ expandToggle() {
+ this._$expand = !this._$expand;
+ this.sf?.setValue('/expand', this._$expand);
+ }
+
+ /**
+ * 重置表单
+ */
+ resetSF() {
+ this.sf.reset();
+ this._$expand = false;
+ }
+
+ private initSF(): SFSchema {
+ return {
properties: {
expand: {
type: 'boolean',
@@ -97,31 +104,63 @@ export class UserCenterComponentsDriverCaptainComponent implements OnInit {
hidden: true
}
},
- storeName: { title: '司机姓名', type: 'string', ui: { showRequired: false } },
- phone: {
+ name: { title: '司机姓名', type: 'string', ui: { placeholder: '请输入', showRequired: false } },
+ mobile: {
title: '手机号',
type: 'string',
format: 'mobile',
maxLength: 11,
ui: {
- placeholder: '请输入手机号'
+ placeholder: '请输入'
}
},
- phon747e: {
- title: '银行卡号',
+ identityNo: {
+ title: '身份证号',
type: 'string',
ui: {
- placeholder: '请输入银行卡号'
+ placeholder: '请输入'
}
},
-
- phone2: {
+ promotersTelephone: {
title: '业务员手机号',
type: 'string',
format: 'mobile',
maxLength: 11,
ui: {
- placeholder: '请输入手机号',
+ placeholder: '请输入',
+ visibleIf: {
+ expand: (value: boolean) => value
+ }
+ }
+ },
+ identityStatus: {
+ type: 'string',
+ title: '实名认证状态',
+ enum: [
+ { label: '全部', value: '' },
+ { label: '待审核', value: 0 },
+ { label: '审核通过', value: 1 },
+ { label: '驳回', value: 2 }
+ ],
+ default: '',
+ ui: {
+ widget: 'select',
+ visibleIf: {
+ expand: (value: boolean) => value
+ }
+ }
+ },
+ source: {
+ type: 'string',
+ title: '注册渠道',
+ enum: [
+ { label: '全部', value: '' },
+ { label: '自己录入', value: 1 },
+ { label: '货主录', value: 2 }
+ ],
+ default: '',
+ ui: {
+ widget: 'select',
visibleIf: {
expand: (value: boolean) => value
}
@@ -129,18 +168,28 @@ export class UserCenterComponentsDriverCaptainComponent implements OnInit {
}
}
};
- this.ui = { '*': { spanLabelFixed: 110, grid: { span: 8, gutter: 4 }, enter: () => this.st.load() } };
}
- initST() {
- this.columns = [
+ private initST(): STColumn[] {
+ return [
// { 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: 'unifiedSocialCreditCode' },
- { title: '推广业务员', className: 'text-center', index: 'unifiedSocialCreditCode2' },
+ { title: '司机姓名', className: 'text-center', index: 'name' },
+ { title: '手机号', className: 'text-center', index: 'mobile' },
+ { title: '身份证号', className: 'text-center', index: 'identityNo' },
+ {
+ title: '实名认证状态',
+ className: 'text-center',
+ index: 'identityStatus',
+ type: 'badge',
+ badge: {
+ '-1': { text: '未提交', color: 'default' },
+ 0: { text: '待审核', color: 'processing' },
+ 1: { text: '审核通过', color: 'success' },
+ 2: { text: '驳回', color: 'warning' }
+ }
+ },
+ { title: '推广业务员', className: 'text-center', render: 'promotersTelephone' },
+ { title: '注册渠道', className: 'text-center', index: 'source', type: 'enum', enum: { 1: '自己录入', 2: '货主录入' } },
{ title: '注册时间', className: 'text-center', index: 'unifiedSocialCreditCode3' },
{
title: '操作',
@@ -150,29 +199,11 @@ export class UserCenterComponentsDriverCaptainComponent implements OnInit {
{
text: '查看',
click: item => {
- this.router.navigate(['/usercenter/driver/detail', item.tenantId], { relativeTo: this.ar });
- // this.router.navigate(['./view', item.id], { relativeTo: this.ar, queryParams: { tenantId: item.tenantId } });
+ this.router.navigate(['/usercenter/driver/captain/detail', item.appUserId]);
}
}
]
}
];
}
- 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;
- }
}
diff --git a/src/app/routes/usercenter/components/driver/detail/detail.component.ts b/src/app/routes/usercenter/components/driver/detail/detail.component.ts
index 072ebe15..b3491e78 100644
--- a/src/app/routes/usercenter/components/driver/detail/detail.component.ts
+++ b/src/app/routes/usercenter/components/driver/detail/detail.component.ts
@@ -94,11 +94,9 @@ export class UserCenterComponentsDriverDetailComponent implements OnInit {
/** 启用/冻结司机 */
userAction(status: number) {
- console.log( this.userDetail );
-
this.nzModalService.warning({
nzTitle: status === 1 ? '确定启用该司机吗?' : '确定冻结该司机吗?',
- nzContent: status === 1 ? '停用后,司机将被限制使用,无法登陆,请谨慎操作!' : '启用后,该司机将恢复正常使用功能,请再次确认!',
+ nzContent: status === 1 ? '启用后,该司机将恢复正常使用功能,请再次确认!' : '冻结后,司机将被限制使用,无法登陆,请谨慎操作!',
nzOnOk: () => {
this.service
.request(this.service.$api_lock_or_free_user, {
diff --git a/src/app/routes/usercenter/components/driver/driver.component.html b/src/app/routes/usercenter/components/driver/driver.component.html
index e3ed6b81..f16163bc 100644
--- a/src/app/routes/usercenter/components/driver/driver.component.html
+++ b/src/app/routes/usercenter/components/driver/driver.component.html
@@ -23,7 +23,7 @@
-
-
+
diff --git a/src/app/routes/usercenter/components/driver/driver.component.ts b/src/app/routes/usercenter/components/driver/driver.component.ts
index 81bb3cc4..92a7ad9e 100644
--- a/src/app/routes/usercenter/components/driver/driver.component.ts
+++ b/src/app/routes/usercenter/components/driver/driver.component.ts
@@ -61,14 +61,17 @@ export class UserCenterComponentsDriverComponent implements OnInit {
return false;
}
if (typeof this.promotersTelephone === 'string' && !/(^1\d{10}$)/.test(this.promotersTelephone)) {
+ this.service.msgSrv.error('手机格式错误');
return false;
}
- 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();
- });
+ this.service
+ .request(this.service.$api_add_user_salesman, { userId: item.userId, mobile: this.promotersTelephone })
+ .subscribe(res => {
+ if (res) {
+ this.service.msgSrv.success(item?.promotersTelephone ? '添加推广员成功' : '修改推广员成功');
+ }
+ this.st.load();
+ });
return;
}
});
diff --git a/src/app/routes/usercenter/components/freight/enterprise-audit/enterprise-audit.component.html b/src/app/routes/usercenter/components/freight/enterprise-audit/enterprise-audit.component.html
index ce05f63b..39683ab6 100644
--- a/src/app/routes/usercenter/components/freight/enterprise-audit/enterprise-audit.component.html
+++ b/src/app/routes/usercenter/components/freight/enterprise-audit/enterprise-audit.component.html
@@ -21,7 +21,7 @@