edit
This commit is contained in:
		| @ -19,6 +19,7 @@ export class AuditAdminComponent implements OnInit { | ||||
|       grid: { span: 20 } | ||||
|     } | ||||
|   }; | ||||
|   isReadOnly = false; | ||||
|   constructor(public msgSrv: NzMessageService, public service: UsermanageService) {} | ||||
|  | ||||
|   ngOnInit(): void { | ||||
| @ -35,9 +36,10 @@ export class AuditAdminComponent implements OnInit { | ||||
|  | ||||
|   initSF(user?: any) { | ||||
|     console.log(user); | ||||
|      | ||||
|  | ||||
|     this.schema = { | ||||
|       properties: { | ||||
|         expand: { type: 'boolean', ui: { hidden: true } }, | ||||
|         oldAdminName: { | ||||
|           title: '当前管理员', | ||||
|           type: 'string', | ||||
| @ -87,7 +89,10 @@ export class AuditAdminComponent implements OnInit { | ||||
|           ui: { | ||||
|             placeholder: '审核不通过需要说明原因', | ||||
|             widget: 'textarea', | ||||
|             autosize: { minRows: 3, maxRows: 6 } | ||||
|             autosize: { minRows: 3, maxRows: 6 }, | ||||
|             visibleIf: { | ||||
|               expand: (value: boolean) => !this.isReadOnly | ||||
|             } | ||||
|           } | ||||
|         } | ||||
|       } | ||||
|  | ||||
| @ -67,44 +67,46 @@ export class FreightComponentsEnterpriseAuditComponent implements OnInit { | ||||
|   /** | ||||
|    * 查看详情 | ||||
|    */ | ||||
|   ViewAdimin(record: any) { | ||||
|   ViewAdimin(record: any, isReadOnly = false) { | ||||
|     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; | ||||
|       nzComponentParams: { i: { ...record }, isReadOnly }, | ||||
|       nzFooter: isReadOnly | ||||
|         ? [] | ||||
|         : [ | ||||
|             { | ||||
|               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 | ||||
|                 ); | ||||
|               } | ||||
|             } | ||||
|             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); | ||||
| @ -175,12 +177,7 @@ 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'] } }] | ||||
|       } | ||||
|     ]; | ||||
|   } | ||||
| @ -209,12 +206,17 @@ export class FreightComponentsEnterpriseAuditComponent implements OnInit { | ||||
|         fixed: 'right', | ||||
|         width: '180px', | ||||
|         className: 'text-center', | ||||
|         buttons: [{  | ||||
|           text: '审核', | ||||
|           click: _record => this.ViewAdimin(_record), | ||||
|           iif: (item: any) => item.approvalStatus === 10, | ||||
|           acl: { ability: ['USERCENTER-FREIGHT-LIST-audit'] }, | ||||
|          }] | ||||
|         buttons: [ | ||||
|           { | ||||
|             text: '审核', | ||||
|             click: _record => this.ViewAdimin(_record), | ||||
|             iif: (item: any) => item.approvalStatus === 10 | ||||
|           }, | ||||
|           { | ||||
|             text: '查看', | ||||
|             click: _record => this.ViewAdimin(_record, true) | ||||
|           } | ||||
|         ] | ||||
|       } | ||||
|     ]; | ||||
|   } | ||||
|  | ||||
		Reference in New Issue
	
	Block a user