This commit is contained in:
Taric Xin
2021-12-13 10:46:19 +08:00
parent cc7f7c7649
commit c4b249fe94
13 changed files with 188 additions and 97 deletions

View File

@ -4,6 +4,7 @@ import { STChange, STColumn, STComponent, STData } from '@delon/abc/st';
import { SFComponent, SFSchema, SFUISchema } from '@delon/form';
import { NzModalService } from 'ng-zorro-antd/modal';
import { UsermanageService } from '../../../services/usercenter.service';
import { AuditAdminComponent } from './audit-admin/audit-admin.component';
@Component({
selector: 'app-Freight-components-enterprise-audit',
@ -75,8 +76,46 @@ export class FreightComponentsEnterpriseAuditComponent implements OnInit {
* 查看详情
*/
View(record: any) {
this.router.navigate(['./view', record.id], {
relativeTo: this.ar
const modal = this.modal.create({
nzContent: AuditAdminComponent,
nzComponentParams: { i: { ...record } },
nzFooter: [
{
label: '驳回',
type: 'primary',
onClick: instance => {
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' }
}
},
{