diff --git a/src/app/routes/usercenter/components/freight/enterprise-audit/audit-admin/audit-admin.component.html b/src/app/routes/usercenter/components/freight/enterprise-audit/audit-admin/audit-admin.component.html new file mode 100644 index 00000000..6af7e0d5 --- /dev/null +++ b/src/app/routes/usercenter/components/freight/enterprise-audit/audit-admin/audit-admin.component.html @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/src/app/routes/usercenter/components/freight/enterprise-audit/audit-admin/audit-admin.component.less b/src/app/routes/usercenter/components/freight/enterprise-audit/audit-admin/audit-admin.component.less new file mode 100644 index 00000000..e69de29b diff --git a/src/app/routes/usercenter/components/freight/enterprise-audit/audit-admin/audit-admin.component.ts b/src/app/routes/usercenter/components/freight/enterprise-audit/audit-admin/audit-admin.component.ts new file mode 100644 index 00000000..f32ed35d --- /dev/null +++ b/src/app/routes/usercenter/components/freight/enterprise-audit/audit-admin/audit-admin.component.ts @@ -0,0 +1,98 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { SFComponent, SFSchema, SFUISchema } from '@delon/form'; +import { EAEnterpriseService } from '@shared'; +import { NzMessageService } from 'ng-zorro-antd/message'; +import { NzModalRef } from 'ng-zorro-antd/modal'; +import { SystemService } from 'src/app/routes/sys-setting/services/system.service'; +import { UsermanageService } from 'src/app/routes/usercenter/services/usercenter.service'; + +@Component({ + selector: 'app-audit-admin', + templateUrl: './audit-admin.component.html', + styleUrls: ['./audit-admin.component.less'] +}) +export class AuditAdminComponent implements OnInit { + @ViewChild('sf', { static: false }) + sf!: SFComponent; + i: any; + schema!: SFSchema; + ui: SFUISchema = { + '*': { + spanLabelFixed: 120, + grid: { span: 20 } + } + }; + constructor(public msgSrv: NzMessageService, public service: UsermanageService) {} + + ngOnInit(): void { + this.loadUserInfo(); + } + + loadUserInfo() { + this.service.request(this.service.$api_get_enterprise_user_by_id, { id: this.i.id }).subscribe(res => { + console.log(res); + if (res) { + this.initSF(res); + } + }); + } + + initSF(user?: any) { + console.log(user); + this.schema = { + properties: { + oldAdminName: { + title: '当前管理员', + type: 'string', + ui: { widget: 'text' }, + default: user.oldAdminName + }, + oldAdminMobile: { + title: '手机号', + type: 'string', + ui: { widget: 'text' }, + default: user.oldAdminMobile + }, + oldAdminIdNo: { + title: '身份证号', + type: 'string', + ui: { widget: 'text' }, + default: user.oldAdminIdNo + }, + newAdminName: { + title: '转授对象', + type: 'string', + ui: { widget: 'text' }, + default: user.newAdminName + }, + newAdminMobile: { + title: '手机号', + type: 'string', + ui: { widget: 'text' }, + default: user.newAdminMobile + }, + newAdminIdNo: { + title: '身份证号', + type: 'string', + ui: { widget: 'text' }, + default: user.newAdminIdNo + }, + creditPhoto: { + title: '企业授权函', + type: 'string', + ui: { widget: 'custom' } + }, + approvalOpinion: { + title: '备注', + type: 'string', + maxLength: 100, + ui: { + placeholder: '审核不通过需要说明原因', + widget: 'textarea', + autosize: { minRows: 2, maxRows: 6 } + } + } + } + }; + } +} 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 45e077a6..ce05f63b 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 @@ - { + if (!instance?.sf.value.approvalOpinion) { + this.service.msgSrv.warning('请填写备注'); + return false; + } + this.adminAuditUser( + { + id: record.id, + approvalStatus: '30', + approvalOpinion: instance?.sf.value.approvalOpinion + }, + modal + ); + return; + } + }, + { + label: '通过', + type: 'primary', + onClick: () => { + this.adminAuditUser( + { + id: record.id, + approvalStatus: '20' + }, + modal + ); + } + } + ] + }); + modal.afterClose.subscribe(res => { + // this.st.load(1); }); } @@ -85,9 +124,19 @@ export class FreightComponentsEnterpriseAuditComponent implements OnInit { this.tabType = item.type; this.expandToggle(false); this.sf?.reset(); - setTimeout(() => { - this.st.load(1); - }, 100); + // 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); + if (res) { + this.service.msgSrv.success('审核成功'); + modal.destroy(); + } + }); } /** @@ -97,7 +146,7 @@ export class FreightComponentsEnterpriseAuditComponent implements OnInit { return [ { title: '企业名称', className: 'text-center', index: 'enterpriseName' }, { title: '联系人', className: 'text-center', index: 'contacter' }, - { title: '手机号', className: 'text-center', render: 'mobile' }, + { title: '手机号', className: 'text-center', index: 'mobile' }, { title: '申请时间', className: 'text-center', index: 'createTime' }, { title: '审核状态', @@ -131,10 +180,10 @@ export class FreightComponentsEnterpriseAuditComponent implements OnInit { initAdminST(): STColumn[] { return [ { title: '企业名称', className: 'text-center', index: 'enterpriseName' }, - { title: '当前管理员', className: 'text-center', index: 'contacter' }, - { title: '当前管理员手机号', className: 'text-center', render: 'mobile' }, - { title: '转授对象', className: 'text-center', index: 'promotersTelephone' }, - { title: '转授对象手机号', className: 'text-center', index: 'promotersTelephone' }, + { title: '当前管理员', className: 'text-center', index: 'oldAdminName' }, + { title: '当前管理员手机号', className: 'text-center', index: 'oldAdminMobile' }, + { title: '转授对象', className: 'text-center', index: 'newAdminName' }, + { title: '转授对象手机号', className: 'text-center', index: 'newAdminMobile' }, { title: '申请时间', className: 'text-center', index: 'createTime' }, { title: '状态', @@ -144,7 +193,7 @@ export class FreightComponentsEnterpriseAuditComponent implements OnInit { badge: { 10: { text: '待审核', color: 'processing' }, 20: { text: '已成功', color: 'success' }, - 30: { text: '审核失败', color: 'warning' } + 30: { text: '已驳回', color: 'warning' } } }, { diff --git a/src/app/routes/usercenter/components/freight/enterprise-audit/view/view.component.ts b/src/app/routes/usercenter/components/freight/enterprise-audit/view/view.component.ts index 9c264f67..5dcca082 100644 --- a/src/app/routes/usercenter/components/freight/enterprise-audit/view/view.component.ts +++ b/src/app/routes/usercenter/components/freight/enterprise-audit/view/view.component.ts @@ -57,51 +57,6 @@ export class FreightComponentsEnterpriseAuditViewComponent implements OnInit { this.detailData = 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; } auditPass() { @@ -152,7 +107,7 @@ export class FreightComponentsEnterpriseAuditViewComponent implements OnInit { ratify() { this.isEdit = true; } - + goBack() { window.history.go(-1); } 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 f45c7565..27431f72 100644 --- a/src/app/routes/usercenter/components/freight/user/user.component.html +++ b/src/app/routes/usercenter/components/freight/user/user.component.html @@ -37,9 +37,9 @@ - -
- {{ item.contactsPhone }} + +
+ {{ item.promotersTelephone || '添加' }}
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 f1d1cc49..80dd4355 100644 --- a/src/app/routes/usercenter/components/freight/user/user.component.ts +++ b/src/app/routes/usercenter/components/freight/user/user.component.ts @@ -11,7 +11,7 @@ import { UsermanageService } from '../../../services/usercenter.service'; }) export class FreightComponentsUserComponent implements OnInit { _$expand = false; - ui: SFUISchema = { '*': { spanLabelFixed: 120, grid: {lg: 8, md: 12, sm: 12, xs: 24 }, enter: () => this.st.load() } }; + 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('st', { static: false }) st!: STComponent; @@ -190,19 +190,19 @@ export class FreightComponentsUserComponent implements OnInit { return [ { title: '用户姓名', className: 'text-center', index: 'name' }, { title: '手机号', className: 'text-center', index: 'telephone' }, - { title: '身份证件号', className: 'text-center', render: 'certificateNumber' }, + { title: '身份证件号', className: 'text-center', index: 'certificateNumber' }, { title: '常用服务', className: 'text-center', index: 'unifiedSocialCreditCode' }, { title: '推广业务员', className: 'text-center', index: 'promotersTelephone', render: 'promotersTelephone' }, { title: '申请时间', className: 'text-center', index: 'createTime', type: 'date' }, { title: '状态', className: 'text-center', - index: 'stateLocked', + index: 'certificationStatus', type: 'badge', badge: { - 10: { text: '待审核', color: 'default' }, - 20: { text: ' 已成功', color: 'success' }, - 30: { text: '已驳回', color: 'warning' } + 0: { text: '待审核', color: 'processing' }, + 1: { text: '已成功', color: 'success' }, + 2: { text: '已驳回', color: 'warning' } } }, { @@ -218,10 +218,12 @@ export class FreightComponentsUserComponent implements OnInit { }, { text: '冻结', + iif: item => item.stateLocked === 0, click: (item: any) => this.userAction(0) }, { text: '启用', + iif: item => item.stateLocked === 1, click: (item: any) => this.userAction(1) } ] diff --git a/src/app/routes/usercenter/services/usercenter.service.ts b/src/app/routes/usercenter/services/usercenter.service.ts index 8b836af6..6232602f 100644 --- a/src/app/routes/usercenter/services/usercenter.service.ts +++ b/src/app/routes/usercenter/services/usercenter.service.ts @@ -42,7 +42,7 @@ export class UsermanageService extends BaseService { // 查询司机列表 $api_get_driver_list = '/api/mdc/cuc/driver/list/page'; - + // 根据应用用户id获取用户详情 $api_get_user_detail = '/api/mdc/cuc/user/getUserDetailByAppUserId'; // 根据应用用户ID获取身份信息表 @@ -53,12 +53,18 @@ export class UsermanageService extends BaseService { $api_get_driver_practice_seniority = '/api/mdc/cuc/driver/getDriversPracticeSeniority'; // 司机详情查看-载具信息 $api_get_driver_car_license = '/api/mdc/cuc/driver/getUserCarLicense'; - + // 人工审核实名认证 $api_approve_identity = '/api/mdc/cuc/identityInfo/identityAudit'; // 审核驾驶证信息 $api_approve_driver_license = '/api/mdc/cuc/driver/auditDriverLicense'; + // 查询企业管理员审核信息 + $api_get_enterprise_admin_list = '/api/mdc/cuc/enterpriseAdmin/operate/list/page'; + // 根据主键ID获取企业管理员审核信息 + $api_get_enterprise_user_by_id = '/api/mdc/cuc/enterpriseAdmin/operate/get'; + // 审核企业管理员 + $api_audit_enterprise_admin = '/api/mdc/cuc/enterpriseAdmin/operate/audit'; constructor(public injector: Injector) { super(injector); diff --git a/src/app/routes/usercenter/usercenter.module.ts b/src/app/routes/usercenter/usercenter.module.ts index 294a49c2..33ba86e0 100644 --- a/src/app/routes/usercenter/usercenter.module.ts +++ b/src/app/routes/usercenter/usercenter.module.ts @@ -20,6 +20,7 @@ import { FreightComponentsListViewComponent } from './components/freight/list/vi import { FreightComponentsUserDetailComponent } from './components/freight/user/detail/detail.component'; 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'; const COMPONENTS = [ FreightComponentsListComponent, @@ -37,6 +38,6 @@ const COMPONENTS = [ @NgModule({ imports: [SharedModule, UsercenterRoutingModule], - declarations: [...COMPONENTS], + declarations: [...COMPONENTS, AuditAdminComponent], }) export class UsercenterModule {} diff --git a/src/app/shared/components/dict-select/dict-select.component.spec.ts b/src/app/shared/components/dict-select/dict-select.component.spec.ts deleted file mode 100644 index d5aa71e4..00000000 --- a/src/app/shared/components/dict-select/dict-select.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; - -import { DictSelectComponent } from './dict-select.component'; - -describe('DictSelectComponent', () => { - let component: DictSelectComponent; - let fixture: ComponentFixture; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - declarations: [ DictSelectComponent ] - }) - .compileComponents(); - }); - - beforeEach(() => { - fixture = TestBed.createComponent(DictSelectComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/shared/components/dict-select/index.ts b/src/app/shared/components/dict-select/index.ts index 446b7507..e217fb6b 100644 --- a/src/app/shared/components/dict-select/index.ts +++ b/src/app/shared/components/dict-select/index.ts @@ -6,6 +6,5 @@ * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @FilePath: \tms-obc-web\src\app\shared\components\dict-select\index.ts */ -export * from './dict-select.component.spec'; export * from './dict-select.component'; export * from './dict-select.service'; diff --git a/src/app/shared/shared.module.ts b/src/app/shared/shared.module.ts index d59b0484..e77a54ec 100644 --- a/src/app/shared/shared.module.ts +++ b/src/app/shared/shared.module.ts @@ -29,6 +29,7 @@ import { SharedThirdModule } from './shared-third.module'; import { LogisticsTimeLineComponent } from './components/logistics-time-line/logistics-time-line.component'; import { AmapModule } from './components/amap/amap.module'; import { ImageListModule } from './components/imagelist'; +import { DictSelectComponent } from './components/dict-select'; const MODULES = [ AddressModule, @@ -46,7 +47,7 @@ const MODULES = [ ]; // #endregion -const SHAREDCOMPONENTS = [LogisticsTimeLineComponent]; +const SHAREDCOMPONENTS = [LogisticsTimeLineComponent, DictSelectComponent]; @NgModule({ imports: [