This commit is contained in:
Taric Xin
2022-02-16 17:32:07 +08:00
parent c0801a94d6
commit 9e58dddf07
2 changed files with 56 additions and 49 deletions

View File

@ -19,6 +19,7 @@ export class AuditAdminComponent implements OnInit {
grid: { span: 20 } grid: { span: 20 }
} }
}; };
isReadOnly = false;
constructor(public msgSrv: NzMessageService, public service: UsermanageService) {} constructor(public msgSrv: NzMessageService, public service: UsermanageService) {}
ngOnInit(): void { ngOnInit(): void {
@ -38,6 +39,7 @@ export class AuditAdminComponent implements OnInit {
this.schema = { this.schema = {
properties: { properties: {
expand: { type: 'boolean', ui: { hidden: true } },
oldAdminName: { oldAdminName: {
title: '当前管理员', title: '当前管理员',
type: 'string', type: 'string',
@ -87,7 +89,10 @@ export class AuditAdminComponent implements OnInit {
ui: { ui: {
placeholder: '审核不通过需要说明原因', placeholder: '审核不通过需要说明原因',
widget: 'textarea', widget: 'textarea',
autosize: { minRows: 3, maxRows: 6 } autosize: { minRows: 3, maxRows: 6 },
visibleIf: {
expand: (value: boolean) => !this.isReadOnly
}
} }
} }
} }

View File

@ -67,44 +67,46 @@ export class FreightComponentsEnterpriseAuditComponent implements OnInit {
/** /**
* 查看详情 * 查看详情
*/ */
ViewAdimin(record: any) { ViewAdimin(record: any, isReadOnly = false) {
const modal = this.modal.create({ const modal = this.modal.create({
nzContent: AuditAdminComponent, nzContent: AuditAdminComponent,
nzComponentParams: { i: { ...record } }, nzComponentParams: { i: { ...record }, isReadOnly },
nzFooter: [ nzFooter: isReadOnly
{ ? []
label: '驳回', : [
type: 'primary', {
onClick: instance => { label: '驳回',
if (!instance?.sf.value.approvalOpinion) { type: 'primary',
this.service.msgSrv.warning('请填写备注'); onClick: instance => {
return false; 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
);
}
} }
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 => { modal.afterClose.subscribe(res => {
// this.st.load(1); // this.st.load(1);
@ -175,12 +177,7 @@ export class FreightComponentsEnterpriseAuditComponent implements OnInit {
fixed: 'right', fixed: 'right',
width: '180px', width: '180px',
className: 'text-center', className: 'text-center',
buttons: [ buttons: [{ text: '查看', click: _record => this.View(_record), acl: { ability: ['USERCENTER-FREIGHT-ENTERPRISE-view'] } }]
{ text: '查看',
click: _record => this.View(_record),
acl: { ability: ['USERCENTER-FREIGHT-ENTERPRISE-view'] },
}
]
} }
]; ];
} }
@ -209,12 +206,17 @@ export class FreightComponentsEnterpriseAuditComponent implements OnInit {
fixed: 'right', fixed: 'right',
width: '180px', width: '180px',
className: 'text-center', className: 'text-center',
buttons: [{ buttons: [
text: '审核', {
click: _record => this.ViewAdimin(_record), text: '审核',
iif: (item: any) => item.approvalStatus === 10, click: _record => this.ViewAdimin(_record),
acl: { ability: ['USERCENTER-FREIGHT-LIST-audit'] }, iif: (item: any) => item.approvalStatus === 10
}] },
{
text: '查看',
click: _record => this.ViewAdimin(_record, true)
}
]
} }
]; ];
} }