diff --git a/src/app/routes/usercenter/components/driver/captain/captain-detail/captain-detail.component.html b/src/app/routes/usercenter/components/driver/captain/captain-detail/captain-detail.component.html new file mode 100644 index 00000000..9f3f0cfd --- /dev/null +++ b/src/app/routes/usercenter/components/driver/captain/captain-detail/captain-detail.component.html @@ -0,0 +1,142 @@ + + + + + + + + + + + + + + + +
+ + 个人信息 + + +
+ + + + + + + + + +
+
+ + + + + + + +
+ + + + +
+
+
+
+ + + + 银行结算信息 + + + + + + + + +
+ + + +
+
+ + {{ userIdentityDetail?.name }} + + + + +
+
+
+ + + + + +
上传
+
+
+ +
+
+ +
+ +
+
+
+
+
\ No newline at end of file diff --git a/src/app/routes/usercenter/components/driver/captain/captain-detail/captain-detail.component.less b/src/app/routes/usercenter/components/driver/captain/captain-detail/captain-detail.component.less new file mode 100644 index 00000000..c0580085 --- /dev/null +++ b/src/app/routes/usercenter/components/driver/captain/captain-detail/captain-detail.component.less @@ -0,0 +1,24 @@ +@import '../../../../less/edit.less'; + +:host { + ::ng-deep { + + .sv__title { + font-weight: 600; + } + + + .user-info { + display : flex; + font-size: 16px; + + img { + width : 64px; + height : 64px; + margin-right : 15px; + border-radius: 50%; + } + + } + } +} \ No newline at end of file diff --git a/src/app/routes/usercenter/components/driver/captain/captain-detail/captain-detail.component.ts b/src/app/routes/usercenter/components/driver/captain/captain-detail/captain-detail.component.ts new file mode 100644 index 00000000..9ee9acf7 --- /dev/null +++ b/src/app/routes/usercenter/components/driver/captain/captain-detail/captain-detail.component.ts @@ -0,0 +1,215 @@ +import { DatePipe } from '@angular/common'; +import { Component, OnInit, ViewChild } from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; +import { apiConf } from '@conf/api.conf'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { UsermanageService } from 'src/app/routes/usercenter/services/usercenter.service'; +import { ImageViewComponent } from 'src/app/shared/components/imagelist'; + +@Component({ + selector: 'app-captain-detail', + templateUrl: './captain-detail.component.html', + styleUrls: ['./captain-detail.component.less'], + providers: [DatePipe] +}) +export class CaptainDetailComponent implements OnInit { + userDetail: any; + userIdentityDetail: any = {}; + tempalateUserIdentityDetail = { ...this.userIdentityDetail }; + + @ViewChild('redectModal', { static: false }) + redectModal!: any; + @ViewChild('rejectedDriverModal', { static: false }) + rejectedDriverModal!: any; + approvalOpinion = ''; + + isEditUser = false; + + uploadURl = apiConf.waterFileUpload; + disabledUpload = false; + constructor( + private nzModalService: NzModalService, + public service: UsermanageService, + private route: ActivatedRoute, + private datePipe: DatePipe + ) {} + + ngOnInit() { + this.initData(); + } + initData() { + // 获取司机头部信息 + this.service + .request(this.service.$api_get_user_detail, { + appUserId: this.route.snapshot.params.id + }) + .subscribe(res => { + if (res) { + this.userDetail = res; + } + }); + // 获取用户个人信息 + this.service + .request(this.service.$api_get_user_identity, { + id: this.route.snapshot.params.id + }) + .subscribe(res => { + if (res) { + this.userIdentityDetail = res; + this.tempalateUserIdentityDetail = { ...this.userIdentityDetail }; + } + }); + } + + /** 启用/冻结司机 */ + userAction(status: number) { + console.log(this.userDetail); + + this.nzModalService.warning({ + nzTitle: status === 1 ? '确定启用该司机吗?' : '确定冻结该司机吗?', + nzContent: status === 1 ? '启用后,该司机将恢复正常使用功能,请再次确认!' : '冻结后,司机将被限制使用,无法登陆,请谨慎操作!', + nzOnOk: () => { + this.service + .request(this.service.$api_lock_or_free_user, { + appUserId: [this.userDetail.appUserId], + freezeOrResume: !!!status, + pageName: '司机详情', + telephone: this.userDetail.phone + }) + .subscribe(res => { + if (res) { + this.service.msgSrv.success('操作成功'); + } + this.initData(); + }); + } + }); + } + + /** 审核通过个人信息 */ + approveUser() { + this.nzModalService.confirm({ + nzTitle: '审核通过', + nzContent: `是否确认通过(姓名:${this.userIdentityDetail.name})审核`, + nzOnOk: () => { + this.adjuctUser({ auditStatus: 0, auditType: 0, identityId: this.userIdentityDetail?.id }, '审核通过'); + } + }); + } + + /** 驳回个人信息 */ + rejectedUser() { + this.approvalOpinion = ''; + this.nzModalService.create({ + nzTitle: '审核驳回', + nzContent: this.redectModal, + nzOnOk: () => { + if (!this.approvalOpinion) { + return false; + } + this.adjuctUser( + { + auditStatus: 1, + auditType: 0, + identityId: this.userIdentityDetail?.id, + certificationOpinions: this.approvalOpinion + }, + '审核驳回成功' + ); + return; + } + }); + } + + /** 个人信息审核 */ + private adjuctUser(params: any, msg: string) { + this.service.request(this.service.$api_approve_identity, { ...params }).subscribe(res => { + if (res) { + this.service.msgSrv.success(msg); + } + this.initData(); + }); + } + + /** + * 开启修改 + */ + ratify() { + this.isEditUser = true; + } + + /** + * 需求修改 + */ + reset() { + this.userIdentityDetail = { ...this.tempalateUserIdentityDetail }; + this.isEditUser = false; + } + + saveUser() { + const userIdentity = this.userIdentityDetail; + const params = { + certificateNumber: userIdentity.certificateNumber, + certificatePhotoBack: userIdentity.certificatePhotoBack, + certificatePhotoBackWatermark: userIdentity.certificatePhotoBackWatermark, + certificatePhotoFront: userIdentity.certificatePhotoFront, + certificatePhotoFrontWatermark: userIdentity.certificatePhotoFrontWatermark, + certificateType: userIdentity.certificateType, + handCertificate: userIdentity.handCertificate, + id: userIdentity.id, + name: userIdentity.name, + souceType: userIdentity.souceType, + sourceAppId: userIdentity.sourceAppId, + tenantId: userIdentity.tenantId, + userId: userIdentity.userId, + validEndTime: + userIdentity.validEndTime?.length === 10 + ? userIdentity.validEndTime + : this.datePipe.transform(userIdentity.validEndTime, 'yyyy-MM-dd'), + validStartTime: + userIdentity.validStartTime?.length === 10 + ? userIdentity.validStartTime + : this.datePipe.transform(userIdentity.validStartTime, 'yyyy-MM-dd') + }; + this.service.request(this.service.$api_update_driver_identity, params).subscribe(res => { + if (res) { + this.service.msgSrv.success('修改成功'); + this.isEditUser = false; + this.initData(); + } + }); + } + + changeUpload({ file, fileList, type }: any, data: any, key: string, key2: string) { + if (type === 'success') { + data[key] = file.response.data?.fullFileWatermarkPath; + data[key2] = file.response.data?.fullFilePath; + } + } + + showImg(url: any) { + const params = { + imgList: [url], + index: 0 + }; + this.nzModalService.create({ nzContent: ImageViewComponent, nzComponentParams: { params } }); + } + + deleteImg(data: any, key: string, key2: string) { + this.nzModalService.warning({ + nzTitle: '是否确认删除该图片', + nzOnOk: () => { + this.disabledUpload = true; + data[key] = ''; + data[key2] = ''; + setTimeout(() => { + this.disabledUpload = false; + }, 100); + } + }); + } + + goBack() { + window.history.go(-1); + } +} diff --git a/src/app/routes/usercenter/components/driver/captain/captain.component.html b/src/app/routes/usercenter/components/driver/captain/captain.component.html index bcc09f33..9e5942c5 100644 --- a/src/app/routes/usercenter/components/driver/captain/captain.component.html +++ b/src/app/routes/usercenter/components/driver/captain/captain.component.html @@ -7,77 +7,50 @@ * @FilePath: \tms-obc-web\src\app\routes\usercenter\components\freight\list\list.component.html --> - +
- -
- - +
+ +
+
+ + + +
- - - - -
- -
-
- - - - -
-
- - -
-
- {{ 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 @@ - { - // this.st.load(1); - // }, 100); + this.st.data = this.tabType === 1 ? this.service.$api_get_freight_list : this.service.$api_get_enterprise_admin_list; + setTimeout(() => { + this.st.load(1); + }, 100); } private adminAuditUser(params: any, modal: any) { - this.service.request(this.service.$api_audit_enterprise_admin, params, 'POST', false).subscribe(res => { - console.log(res); + this.service.request(this.service.$api_audit_enterprise_admin, params).subscribe(res => { if (res) { this.service.msgSrv.success('审核成功'); modal.destroy(); + this.st.load(1); } }); } @@ -207,7 +206,7 @@ export class FreightComponentsEnterpriseAuditComponent implements OnInit { fixed: 'right', width: '180px', className: 'text-center', - buttons: [{ text: '审核', click: _record => this.ViewAdimin(_record) }] + buttons: [{ text: '审核', click: _record => this.ViewAdimin(_record), iif: (item: any) => item.approvalStatus === 10 }] } ]; } diff --git a/src/app/routes/usercenter/components/freight/enterprise-audit/view/view.component.html b/src/app/routes/usercenter/components/freight/enterprise-audit/view/view.component.html index a41453d6..cfca010c 100644 --- a/src/app/routes/usercenter/components/freight/enterprise-audit/view/view.component.html +++ b/src/app/routes/usercenter/components/freight/enterprise-audit/view/view.component.html @@ -1,5 +1,5 @@ - + - +
- - - - + + + + + + + + + + + + + + + + +
@@ -76,27 +101,37 @@
- + 企业管理员信息 - {{ detailData?.adminUserInfo?.name }} + - {{ detailData?.adminUserInfo?.mobile }} + {{detailData.adminUserInfo?.mobile}} - {{ detailData?.adminUserInfo?.certificateNumber }} + - - +
+ + + + +
- + +
+ @@ -112,85 +147,137 @@ - {{ detailData?.enterpriseName }} + - {{ detailData?.unifiedSocialCreditCode }} + - {{ detailData?.enterpriseType }} + - {{ detailData?.registrationCapital }} + + + + + {{detailData?.registrationCapital}} + 万元 - {{ detailData?.enterpriseRegistrationTime }} + -
- {{ detailData?.operatingStartTime }} 至 {{ detailData?.operatingEndTime }} -
-
长期
-
{{ detailData?.operatingStartTime - }} 至 长期
+ + + - + + + + + + + + +
-
- - {{ detailData?.fullRegionVO?.provinceName }}{{ detailData?.fullRegionVO?.cityName }}{{ - detailData?.fullRegionVO?.areaName }} + + + + + + {{ detailData?.fullRegionVO?.provinceName }}{{ detailData?.fullRegionVO?.cityName }}{{ + detailData?.fullRegionVO?.areaName }} + - - {{ detailData?.enterpriseAddress }} + + - - - - {{ detailData?.businessScope }} + + - - - - {{ detailData?.taxAuthority }} + + - - + + + 法人信息 - {{ detailData?.legalPersonIdentityVO?.name }} + - {{ detailData?.legalPersonIdentityVO?.certificateNumber }} + - {{ detailData?.legalPersonIdentityVO?.validStartTime }} - - {{ detailData?.legalPersonIdentityVO?.validEndTime || '长期' }} + + - + + + + + + + + - - +
+ + + + + + +
企业开票信息 - {{ detailData?.createBank }} + - {{ detailData?.bankAccount }} + - {{ detailData?.registerPhone }} + - {{ detailData?.registerAddress }} +
@@ -204,4 +291,55 @@ {{content}} + + + +
+
+ + {{ detailData?.enterpriseName }} + + + + + + + +
+
+
+ + +
+
+ + {{ detailData?.enterpriseName }} + + + + +
+
+
+ + + + + +
上传
+
+
+ +
+
+ +
+ +
+
+
+
\ No newline at end of file diff --git a/src/app/routes/usercenter/components/freight/list/detail/detail.component.less b/src/app/routes/usercenter/components/freight/list/detail/detail.component.less index ecad9a04..f296f271 100644 --- a/src/app/routes/usercenter/components/freight/list/detail/detail.component.less +++ b/src/app/routes/usercenter/components/freight/list/detail/detail.component.less @@ -1,45 +1,21 @@ -@import '~@delon/theme/index'; -:host { - ::ng-deep { - .ant-steps-dot { - .ant-steps-item-content { - width: 200px; - } - .ant-steps-item-icon { - margin-left: 96px; - } - .ant-steps-item-tail::after { - margin-left: 40px; - } - } - .success { - color: @success-color; - } +@import '../../../../less/edit.less'; - .warning { - color: @warning-color; - } - .error { - color: @error-color; - } +.user-info { + font-size: 16px; + + .enterprise-name { + margin-right: 15px; } - .mt16 { - margin-top: 16px; + + img { + width : 64px; + height : 64px; + margin-right : 15px; + border-radius: 50%; } - .user-info { - font-size: 16px; - .enterprise-name { - margin-right: 15px; - } - img { - width: 64px; - height: 64px; - margin-right: 15px; - border-radius: 50%; - } - .user-info-des { - margin-bottom: 5px; - } + + .user-info-des { + margin-bottom: 5px; } -} +} \ No newline at end of file diff --git a/src/app/routes/usercenter/components/freight/list/detail/detail.component.ts b/src/app/routes/usercenter/components/freight/list/detail/detail.component.ts index dfc6aabb..01293ad1 100644 --- a/src/app/routes/usercenter/components/freight/list/detail/detail.component.ts +++ b/src/app/routes/usercenter/components/freight/list/detail/detail.component.ts @@ -1,21 +1,43 @@ import { Component, OnInit, ViewChild } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; +import { apiConf } from '@conf/api.conf'; import { STColumn, STComponent } from '@delon/abc/st'; import { SFComponent, SFDateWidgetSchema, SFSchema, SFUISchema } from '@delon/form'; -import { ModalHelper, _HttpClient } from '@delon/theme'; +import { DatePipe, ModalHelper, _HttpClient } from '@delon/theme'; import { NzMessageService } from 'ng-zorro-antd/message'; +import { NzModalService } from 'ng-zorro-antd/modal'; import { UsermanageService } from '../../../../services/usercenter.service'; @Component({ selector: 'app-supplier-components-list-view', templateUrl: './detail.component.html', - styleUrls: ['./detail.component.less'] + styleUrls: ['./detail.component.less'], + providers: [DatePipe] }) export class FreightComponentsListDetailComponent implements OnInit { - detailData: any; + @ViewChild('approvedModal', { static: false }) + approvedModal!: any; + @ViewChild('redectModal', { static: false }) + redectModal!: any; + + detailData: any = { adminUserInfo: { name: '' }, legalPersonIdentityVO: { name: '' } }; + tempalateData = { ...this.detailData }; suppliersData: any = {}; - constructor(public service: UsermanageService, private route: ActivatedRoute) {} + isEdit = false; + + uploadURl = apiConf.waterFileUpload; + disabledUpload = false; + enterpriseAddressCode: any = []; + + approvalOpinion = ''; + networkTransporter = null; + constructor( + public service: UsermanageService, + private route: ActivatedRoute, + private nzModalService: NzModalService, + private datePipe: DatePipe + ) {} ngOnInit() { this.initData(); @@ -28,55 +50,17 @@ export class FreightComponentsListDetailComponent implements OnInit { .subscribe(res => { if (res) { this.detailData = res; + this.tempalateData = { ...this.detailData }; + this.enterpriseAddressCode = [ + Number(this.detailData.fullRegionVO?.provinceCode), + Number(this.detailData.fullRegionVO?.cityCode), + Number(this.detailData.fullRegionVO?.areaCode) + ]; } console.log(res); }); - // // 商品资质 - // if (res.enterpriseBusinessJson) { - // res.enterpriseBusinessJson.aptitudes = res.enterpriseBusinessJson?.aptitudes ? res.enterpriseBusinessJson.aptitudes.split(',') : []; - // } - // // // 申请人身份证证件 - // // res.applyUserJson.imagelist = []; - // // res.applyUserJson.imagelist.push(res.applyUserJson.certificatePhotoFront); - // // res.applyUserJson.imagelist.push(res.applyUserJson.certificatePhotoBack); - // // res.applyUserJson.imagelist.push(res.applyUserJson.handCertificate); - - // 法人身份证证件 - // const imagelist = []; - // imagelist.push(res?.certificatePhotoFront); - // imagelist.push(res?.certificatePhotoBack); - // res.certificatePhoto = imagelist; - - // // 营业执照 - // res.enterpriseQualificationCertificate = res.enterpriseQualificationCertificate - // ? res.enterpriseQualificationCertificate.split(',') - // : []; - - // // 返回所在地 - // res.enterpriseAddressCodeStr = await this.getRegionFullName(res.enterpriseAddressCode); - - // this.detailData = res; - // this.suppliersData = { - // suppliersType: res?.suppliersType, - // externalSuppliersId: res?.externalSuppliersId - // }; } - /** - * 根据地区code查询地区详情 - * @param code 地区代码 - */ - async getRegionFullName(code: any) { - const params = { - regionCode: code - }; - const res = await this.service.asyncRequest(this.service.$api_get_one, params, 'POST', true); - // if (res && res.regionFullName) { - // const arr = res.regionFullName.split(','); - // res.regionFullName = arr.reverse().join('-'); - // } - return res && res.regionFullName; - } goBack() { window.history.go(-1); } @@ -125,4 +109,144 @@ export class FreightComponentsListDetailComponent implements OnInit { } }); } + + auditPass() { + this.networkTransporter = null; + this.nzModalService.create({ + nzTitle: '审核通过', + nzContent: this.approvedModal, + nzOnOk: () => { + if (!this.networkTransporter) { + return false; + } + this.auditEnterprise(20); + return; + } + }); + } + auditNo() { + this.approvalOpinion = ''; + this.nzModalService.create({ + nzTitle: '审核驳回', + nzContent: this.redectModal, + nzOnOk: () => { + if (!this.approvalOpinion) { + return false; + } + this.auditEnterprise(30); + return; + } + }); + } + + private auditEnterprise(status: number) { + this.service + .request(this.service.$api_audit_freight, { + approvalStatus: status, + id: this.detailData.id, + approvalOpinion: this.approvalOpinion, + networkTransporter: this.networkTransporter + }) + .subscribe(res => { + if (res) { + this.service.msgSrv.success(status === 20 ? '审核通过' : '驳回成功'); + } + this.initData(); + }); + } + + ratify() { + this.isEdit = true; + } + + deleteImg(data: any, key: string, key2: string) { + this.nzModalService.warning({ + nzTitle: '是否确认删除该图片', + nzOnOk: () => { + this.disabledUpload = true; + data[key] = ''; + data[key2] = ''; + setTimeout(() => { + this.disabledUpload = false; + }, 100); + } + }); + } + changeUpload({ file, fileList, type }: any, data: any, key: string, key2: string) { + if (type === 'success') { + data[key] = file.response.data?.fullFileWatermarkPath; + data[key2] = file.response.data?.fullFilePath; + } + } + + /** + * 级联获取地区数据 + * @param node 节点 + * @param index 层级 + * @returns + */ + loadRegionData = (node: any, index: number) => { + return new Promise(resolve => { + this.service.request(this.service.$api_get_region_by_code, { regionCode: node?.regionCode || '' }).subscribe( + res => { + node.children = res.map((item: any) => ({ ...item, isLeaf: index === 1, value: item.regionCode, label: item.name })); + }, + _ => {}, + () => { + resolve(node); + } + ); + }); + }; + + reset() { + this.detailData = { ...this.tempalateData }; + this.isEdit = false; + } + + save() { + const dateil = { ...this.detailData }; + Object.assign(dateil.legalPersonIdentityVO, { + validStartTime: this.datePipe.transform(dateil.legalPersonIdentityVO.validStartTime, 'yyyy-MM-dd'), + validEndTime: this.datePipe.transform(dateil.legalPersonIdentityVO.validEndTime, 'yyyy-MM-dd') + }); + const params = {}; + Object.assign(params, { + adminMobile: dateil.adminMobile, + adminAppUserId: dateil.adminAppUserId, + adminUserInfo: { ...dateil.adminUserInfo }, + bankAccount: dateil.bankAccount, + businessScope: dateil.businessScope, + createBank: dateil.createBank, + creditPhoto: dateil.creditPhoto, + creditPhotoWatermark: dateil.creditPhotoWatermark, + enterpriseAddress: dateil.enterpriseAddress, + enterpriseAddressCode: this.enterpriseAddressCode[2], + enterpriseLogo: dateil.enterpriseLogo, + enterpriseName: dateil.enterpriseName, + enterpriseRegistrationTime: this.datePipe.transform(dateil.enterpriseRegistrationTime, 'yyyy-MM-dd'), + enterpriseType: dateil.enterpriseType, + id: dateil.id, + legalPersonIdentityDTO: { ...dateil.legalPersonIdentityVO }, + licensePhoto: dateil.licensePhoto, + licensePhotoWatermark: dateil.licensePhotoWatermark, + networkTransporter: dateil.networkTransporter, + oftenUsedServices: dateil.oftenUsedServices, + operatingEndTime: this.datePipe.transform(dateil.operatingEndTime, 'yyyy-MM-dd'), + operatingStartTime: this.datePipe.transform(dateil.operatingStartTime, 'yyyy-MM-dd'), + promotersTelephone: dateil.promotersTelephone, + registerAddress: dateil.registerAddress, + registerPhone: dateil.registerPhone, + registrationCapital: dateil.registrationCapital, + taxAuthority: dateil.taxAuthority, + unifiedSocialCreditCode: dateil.unifiedSocialCreditCode + }); + this.service.request(this.service.$api_save_enterprise_admin, params).subscribe(res => { + if (res) { + this.service.msgSrv.success('企业修改成功'); + this.initData(); + this.isEdit = false; + } + }); + } } diff --git a/src/app/routes/usercenter/components/freight/list/list.component.html b/src/app/routes/usercenter/components/freight/list/list.component.html index 1c24a849..715b7cfd 100644 --- a/src/app/routes/usercenter/components/freight/list/list.component.html +++ b/src/app/routes/usercenter/components/freight/list/list.component.html @@ -1,11 +1,3 @@ - @@ -32,7 +24,7 @@ -
- +
diff --git a/src/app/routes/usercenter/components/freight/list/list.component.ts b/src/app/routes/usercenter/components/freight/list/list.component.ts index cd879981..8eee1718 100644 --- a/src/app/routes/usercenter/components/freight/list/list.component.ts +++ b/src/app/routes/usercenter/components/freight/list/list.component.ts @@ -16,7 +16,7 @@ export class FreightComponentsListComponent implements OnInit { columns!: STColumn[]; @ViewChild('st', { static: false }) st!: STComponent; @ViewChild('sf', { static: false }) sf!: SFComponent; - + @ViewChild('promoterModal', { static: false }) promoterModal!: any; promotersTelephone = ''; @@ -199,6 +199,7 @@ export class FreightComponentsListComponent 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 => { diff --git a/src/app/routes/usercenter/components/freight/list/new/new.component.ts b/src/app/routes/usercenter/components/freight/list/new/new.component.ts index 2818b347..117e6a8b 100644 --- a/src/app/routes/usercenter/components/freight/list/new/new.component.ts +++ b/src/app/routes/usercenter/components/freight/list/new/new.component.ts @@ -123,42 +123,6 @@ export class FreightComponentsListNewComponent implements OnInit { return this.service.request(this.service.$api_get_region_by_code, { regionCode }); } - longTime(i: boolean | SFSchemaEnum[], type: string) { - if (type === 'schema') { - if (i) { - // this.sf?.setValue('/validStartTime', Date); - this.sf?.setValue('/validEndTime', Date); - // this.sf.getProperty('/validStartTime').schema.readOnly = true; - this.sf.getProperty('/validEndTime')!.schema.readOnly = true; - } else { - // this.sf.getProperty('/validStartTime').schema.readOnly = false; - this.sf.getProperty('/validEndTime')!.schema.readOnly = false; - } - } - if (type === 'schema1') { - if (i) { - // this.sf1?.setValue('/operatingStartTime', Date); - this.sf1?.setValue('/operatingEndTime', Date); - // this.sf1.getProperty('/operatingStartTime').schema.readOnly = true; - this.sf1.getProperty('/operatingEndTime')!.schema.readOnly = true; - } else { - // this.sf1.getProperty('/operatingStartTime').schema.readOnly = false; - this.sf1.getProperty('/operatingEndTime')!.schema.readOnly = false; - } - } - if (type === 'schema11') { - if (i) { - // this.sf1?.setValue('/validStartTime', Date); - this.sf1?.setValue('/validEndTime', Date); - // this.sf1.getProperty('/validStartTime').schema.readOnly = true; - this.sf1.getProperty('/validEndTime')!.schema.readOnly = true; - } else { - // this.sf1.getProperty('/validStartTime').schema.readOnly = false; - this.sf1.getProperty('/validEndTime')!.schema.readOnly = false; - } - } - } - checkIdCard(imgurl: any, isFront: number, type: number) { // 识别身份证 参数isFront:0-正面、1-背面;type:0-申请人身份证,1-法定代表人身份证 const params = { diff --git a/src/app/routes/usercenter/components/freight/user/user.component.html b/src/app/routes/usercenter/components/freight/user/user.component.html index f03ede38..3097fea8 100644 --- a/src/app/routes/usercenter/components/freight/user/user.component.html +++ b/src/app/routes/usercenter/components/freight/user/user.component.html @@ -32,7 +32,7 @@ - - + @@ -58,7 +58,7 @@
- +
diff --git a/src/app/routes/usercenter/components/freight/user/user.component.ts b/src/app/routes/usercenter/components/freight/user/user.component.ts index fb7bab4e..769a44b7 100644 --- a/src/app/routes/usercenter/components/freight/user/user.component.ts +++ b/src/app/routes/usercenter/components/freight/user/user.component.ts @@ -65,9 +65,10 @@ export class FreightComponentsUserComponent 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 => { + 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 ? '添加推广员成功' : '修改推广员成功'); } diff --git a/src/app/routes/usercenter/less/edit.less b/src/app/routes/usercenter/less/edit.less index 9652786c..22cfcaf0 100644 --- a/src/app/routes/usercenter/less/edit.less +++ b/src/app/routes/usercenter/less/edit.less @@ -18,6 +18,10 @@ nz-date-picker { min-width: 250px; } + + .calendar { + min-width: 130px; + } } .readOnly-box { diff --git a/src/app/routes/usercenter/services/usercenter.service.ts b/src/app/routes/usercenter/services/usercenter.service.ts index f4fb4fc0..76b69134 100644 --- a/src/app/routes/usercenter/services/usercenter.service.ts +++ b/src/app/routes/usercenter/services/usercenter.service.ts @@ -9,6 +9,8 @@ import { Injectable, Injector } from '@angular/core'; import { _HttpClient } from '@delon/theme'; import { NzMessageService } from 'ng-zorro-antd/message'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { ImageViewComponent } from 'src/app/shared/components/imagelist'; import { BaseService } from 'src/app/shared/services/core/base.service'; import { EAFileUtil } from 'src/app/shared/utils/file.util'; @@ -25,8 +27,14 @@ export class UsermanageService extends BaseService { // 查询企业详情 $api_get_freight_detail = '/api/mdc/cuc/enterpriseInfo/operate/detail'; + // 查询车队长列表-运营后台 + $api_get_user_expand = '/api/mdc/userDriverExpand/list/page'; + // 添加企业业务员 $api_add_salesman = '/api/mdc/cuc/enterpriseInfo/operate/addSalesman'; + + // 添加货主,司机,车队长业务员 + $api_add_user_salesman = '/api/mdc/cuc/user/addPromoter'; // 冻结/启用企业业 $api_lock_freight = '/api/mdc/cuc/enterpriseInfo/operate/lock'; @@ -39,7 +47,7 @@ export class UsermanageService extends BaseService { // 冻结或恢复员工 $api_lock_staff = '/api/mdc/cuc/userApp/freezeOrResumeStaff'; - + // 冻结或恢复应用用户 $api_lock_app_user = '/api/mdc/cuc/userApp/freezeOrResume'; @@ -84,7 +92,15 @@ export class UsermanageService extends BaseService { // 根据地区code查询列表 $api_get_region_by_code = '/api/mdc/pbc/region/getRegionByCode'; - constructor(public injector: Injector) { + constructor(public injector: Injector, private nzModalService: NzModalService) { super(injector); } + + showImg(url: any) { + const params = { + imgList: [url], + index: 0 + }; + this.nzModalService.create({ nzContent: ImageViewComponent, nzComponentParams: { params } }); + } } diff --git a/src/app/routes/usercenter/usercenter-routing.module.ts b/src/app/routes/usercenter/usercenter-routing.module.ts index 0b4a70fb..08c673ec 100644 --- a/src/app/routes/usercenter/usercenter-routing.module.ts +++ b/src/app/routes/usercenter/usercenter-routing.module.ts @@ -8,6 +8,7 @@ */ import { NgModule } from '@angular/core'; import { RouterModule, Routes } from '@angular/router'; +import { CaptainDetailComponent } from './components/driver/captain/captain-detail/captain-detail.component'; import { UserCenterComponentsDriverCaptainComponent } from './components/driver/captain/captain.component'; import { UserCenterComponentsDriverDetailComponent } from './components/driver/detail/detail.component'; import { UserCenterComponentsDriverComponent } from './components/driver/driver.component'; @@ -28,13 +29,14 @@ const routes: Routes = [ { path: 'freight/list/view/:id', component: FreightComponentsListViewComponent }, { path: 'freight/list/new', component: FreightComponentsListNewComponent }, { path: 'freight/list/detail/:id', component: FreightComponentsListDetailComponent }, + { path: 'freight/enterprise/detail/:id', component: FreightComponentsListDetailComponent }, { path: 'freight/enterprise', component: FreightComponentsEnterpriseAuditComponent }, - { path: 'freight/enterprise/view/:id', component: FreightComponentsEnterpriseAuditViewComponent }, { path: 'freight/user', component: FreightComponentsUserComponent }, { path: 'freight/user/view/:id', component: FreightComponentsUserDetailComponent }, { path: 'driver', component: UserCenterComponentsDriverComponent }, { path: 'driver/detail/:id', component: UserCenterComponentsDriverDetailComponent }, { path: 'driver/captain', component: UserCenterComponentsDriverCaptainComponent }, + { path: 'driver/captain/detail/:id', component: CaptainDetailComponent }, ]; @NgModule({ diff --git a/src/app/routes/usercenter/usercenter.module.ts b/src/app/routes/usercenter/usercenter.module.ts index 33ba86e0..7dfe0d5f 100644 --- a/src/app/routes/usercenter/usercenter.module.ts +++ b/src/app/routes/usercenter/usercenter.module.ts @@ -21,6 +21,7 @@ import { FreightComponentsUserDetailComponent } from './components/freight/user/ import { FreightComponentsUserComponent } from './components/freight/user/user.component'; import { UsercenterRoutingModule } from './usercenter-routing.module'; import { AuditAdminComponent } from './components/freight/enterprise-audit/audit-admin/audit-admin.component'; +import { CaptainDetailComponent } from './components/driver/captain/captain-detail/captain-detail.component'; const COMPONENTS = [ FreightComponentsListComponent, @@ -33,11 +34,13 @@ const COMPONENTS = [ FreightComponentsUserDetailComponent, UserCenterComponentsDriverComponent, UserCenterComponentsDriverDetailComponent, - UserCenterComponentsDriverCaptainComponent + UserCenterComponentsDriverCaptainComponent, + CaptainDetailComponent, + AuditAdminComponent ]; @NgModule({ imports: [SharedModule, UsercenterRoutingModule], - declarations: [...COMPONENTS, AuditAdminComponent], + declarations: [...COMPONENTS] }) export class UsercenterModule {}