This commit is contained in:
Taric Xin
2022-02-28 20:36:57 +08:00
parent 438484699d
commit 2c42d31ea5
3 changed files with 38 additions and 12 deletions

View File

@ -44,17 +44,17 @@
<button [disabled]="service.http.loading" nz-button (click)="reset()">
取消
</button>
<button [disabled]="service.http.loading" nz-button nzDanger (click)="save()">
<button [disabled]="service.http.loading" nz-button nzDanger (click)="save({})">
保存
</button>
<button [disabled]="service.http.loading" nz-button nzDanger (click)="auditPass()" acl
<button [disabled]="service.http.loading" nz-button nzDanger (click)="auditPass(true)" acl
[acl-ability]="['USERCENTER-FREIGHT-ENTERPRISE-D-audit']">
通过
</button>
</ng-container>
<ng-template #editButton>
<ng-container *ngIf="detailData?.approvalStatus===10">
<button [disabled]="service.http.loading" nz-button nzDanger (click)="auditPass()" acl
<button [disabled]="service.http.loading" nz-button nzDanger (click)="auditPass(false)" acl
[acl-ability]="['USERCENTER-FREIGHT-ENTERPRISE-D-audit']">
通过
</button>

View File

@ -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();
}
}
// 识别身份证 参数isFrontfront-正面、back-背面type0-申请人身份证1-法定代表人身份证
checkIdCard(imgurl: any, isFront: string, type: number) {
const params = {

View File

@ -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';