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 ed15ef67..4ecdb743 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 @@ -9,49 +9,82 @@ * Copyright (C) 2022 huzhenhong. All rights reserved. --> - - -
-
- -
-
- - - - -
-
-
- - - - - - - - - - -
- -
- -

-
-
-
-
-
\ No newline at end of file + + + +
+
+ +
+
+ + + + +
+
+
+ + + + + + + + + + +
+ +
+ +

+
+
+
+
+ + +
+
+ + {{ detailData?.enterpriseName }} + + + + + + + + + + + +
+
+
+ + +
+
+ + {{ detailData?.enterpriseName }} + + + + +
+
+
\ No newline at end of file diff --git a/src/app/routes/usercenter/components/freight/enterprise-audit/enterprise-audit.component.ts b/src/app/routes/usercenter/components/freight/enterprise-audit/enterprise-audit.component.ts index efb2984d..52c1e11a 100644 --- a/src/app/routes/usercenter/components/freight/enterprise-audit/enterprise-audit.component.ts +++ b/src/app/routes/usercenter/components/freight/enterprise-audit/enterprise-audit.component.ts @@ -32,6 +32,17 @@ export class FreightComponentsEnterpriseAuditComponent implements OnInit { isActived: false } ]; + + @ViewChild('approvedModal', { static: false }) + approvedModal!: any; + @ViewChild('redectModal', { static: false }) + redectModal!: any; + ltdId: any = []; + roles: any = []; + detailData: any = null; + approvalOpinion = ''; + networkTransporter = null; + roleId = null; constructor(public service: UsermanageService, private router: Router, private modal: NzModalService) {} beforeReq = (requestOptions: STRequestOptions) => { @@ -70,7 +81,25 @@ export class FreightComponentsEnterpriseAuditComponent implements OnInit { /** * 程序初始化入口 */ - ngOnInit() {} + ngOnInit() { + this.loadltdId(); + this.loadRoles(); + } + + loadltdId() { + this.service.getNetworkFreightForwarder().subscribe(res => { + if (res) { + this.ltdId = res; + } + }); + } + loadRoles() { + this.service.getRoles({ enterpriseId: 0, projectId: 0 }).subscribe(res => { + if (res) { + this.roles = res; + } + }); + } /** * 查看详情 @@ -123,6 +152,56 @@ export class FreightComponentsEnterpriseAuditComponent implements OnInit { }); } + auditPass(item: any) { + this.detailData = item; + this.networkTransporter = null; + this.roleId = null; + this.modal.create({ + nzTitle: '审核通过', + nzContent: this.approvedModal, + nzOnOk: () => { + if (!this.networkTransporter || !this.roleId) { + return false; + } + this.auditEnterprise(20); + return; + } + }); + } + auditNo(item: any) { + this.detailData = item; + this.approvalOpinion = ''; + this.roleId = null; + this.modal.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, + roleId: this.roleId || null + }) + .subscribe(res => { + if (res) { + this.service.msgSrv.success(status === 20 ? '审核通过' : '驳回成功'); + } + this.st.load(1); + }); + } + View(record: any) { this.router.navigate([`/usercenter/freight/enterprise/detail/${record.id}`]); } @@ -216,7 +295,21 @@ export class FreightComponentsEnterpriseAuditComponent implements OnInit { fixed: 'right', width: '180px', className: 'text-center', - buttons: [{ text: '查看', click: _record => this.View(_record), acl: { ability: ['USERCENTER-FREIGHT-ENTERPRISE-view'] } }] + buttons: [ + { text: '查看', click: _record => this.View(_record), acl: { ability: ['USERCENTER-FREIGHT-ENTERPRISE-view'] } }, + { + text: '通过', + click: _record => this.auditPass(_record), + acl: { ability: ['USERCENTER-FREIGHT-ENTERPRISE-D-audit'] }, + iif: item => item.approvalStatus === 10 + }, + { + text: '驳回', + click: _record => this.auditNo(_record), + acl: { ability: ['USERCENTER-FREIGHT-ENTERPRISE-D-audit'] }, + iif: item => item.approvalStatus === 10 + } + ] } ]; }