diff --git a/src/app/routes/usercenter/components/freight/list/detail/detail.component.html b/src/app/routes/usercenter/components/freight/list/detail/detail.component.html index 230e4280..7852b908 100644 --- a/src/app/routes/usercenter/components/freight/list/detail/detail.component.html +++ b/src/app/routes/usercenter/components/freight/list/detail/detail.component.html @@ -44,17 +44,17 @@ - - - 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 8021cde5..b36f6b4a 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,5 +1,5 @@ import { Component, OnDestroy, OnInit, ViewChild } from '@angular/core'; -import { ActivatedRoute } from '@angular/router'; +import { ActivatedRoute, Router } from '@angular/router'; import { apiConf } from '@conf/api.conf'; import { DatePipe, _HttpClient } from '@delon/theme'; import { NzModalService } from 'ng-zorro-antd/modal'; @@ -48,6 +48,7 @@ export class FreightComponentsListDetailComponent implements OnInit, OnDestroy { public service: UsermanageService, private route: ActivatedRoute, private nzModalService: NzModalService, + private router: Router, private datePipe: DatePipe ) {} ngOnDestroy(): void { @@ -55,9 +56,11 @@ export class FreightComponentsListDetailComponent implements OnInit, OnDestroy { } ngOnInit() { - this.initData(); - this.loadltdId(); - this.loadRoles(); + this.route.params.subscribe(({ params }) => { + this.initData(); + this.loadltdId(); + this.loadRoles(); + }); this.subscribeScoll = fromEvent(window, 'scroll').subscribe(event => { this.scrollTop = document.documentElement.scrollTop; }); @@ -157,7 +160,7 @@ export class FreightComponentsListDetailComponent implements OnInit, OnDestroy { }); } - auditPass() { + auditPass(isSave: boolean) { this.networkTransporter = null; this.roleId = null; this.nzModalService.create({ @@ -167,7 +170,15 @@ export class FreightComponentsListDetailComponent implements OnInit, OnDestroy { if (!this.networkTransporter || !this.roleId) { return false; } - this.auditEnterprise(20); + if (isSave) { + this.save({ + passSave: true, + roleId: this.roleId, + networkTransporter: this.networkTransporter + }); + } else { + this.auditEnterprise(20); + } return; } }); @@ -200,8 +211,8 @@ export class FreightComponentsListDetailComponent implements OnInit, OnDestroy { .subscribe(res => { if (res) { this.service.msgSrv.success(status === 20 ? '审核通过' : '驳回成功'); + this.refreshData(status); } - this.initData(); }); } @@ -263,7 +274,7 @@ export class FreightComponentsListDetailComponent implements OnInit, OnDestroy { this.isEdit = false; } - save() { + save(data: any) { const dateil = { ...this.detailData }; Object.assign(dateil.legalPersonIdentityVO, { validStartTime: this.datePipe.transform(dateil.legalPersonIdentityVO.validStartTime, 'yyyy-MM-dd'), @@ -300,15 +311,28 @@ export class FreightComponentsListDetailComponent implements OnInit, OnDestroy { taxAuthority: dateil.taxAuthority, unifiedSocialCreditCode: dateil.unifiedSocialCreditCode }); + Object.assign(params, { ...data }); this.service.request(this.service.$api_save_enterprise_admin, params).subscribe(res => { if (res) { this.service.msgSrv.success('企业修改成功'); - this.initData(); + this.refreshData(data.passSave ? 20 : 10); this.isEdit = false; } }); } + private refreshData(status: number) { + if (status === 20) { + this.service.request(this.service.$api_get_next_audit_freight, { id: this.route.snapshot.params.id }).subscribe(res => { + if (res?.id) { + this.router.navigate(['/usercenter/freight/enterprise/detail/' + res.id]); + } + }); + } else { + this.initData(); + } + } + // 识别身份证 参数isFront:front-正面、back-背面;type:0-申请人身份证,1-法定代表人身份证 checkIdCard(imgurl: any, isFront: string, type: number) { const params = { diff --git a/src/app/routes/usercenter/services/usercenter.service.ts b/src/app/routes/usercenter/services/usercenter.service.ts index 10477a2e..dacab70f 100644 --- a/src/app/routes/usercenter/services/usercenter.service.ts +++ b/src/app/routes/usercenter/services/usercenter.service.ts @@ -34,6 +34,8 @@ export class UsermanageService extends ShipperBaseService { $api_lock_freight = '/api/mdc/cuc/enterpriseInfo/operate/lock'; // 企业审核 $api_audit_freight = '/api/mdc/cuc/enterpriseInfo/operate/audit'; + // 查询下一个待审核的企业ID + $api_get_next_audit_freight = '/api/mdc/cuc/enterpriseInfo/operate/getNextWaitAuditId'; // 查询货主配置列表 $api_freight_config_page = '/api/mdc/cuc/enterpriseInfo/operate/list/configPage';