edit
This commit is contained in:
		| @ -0,0 +1,5 @@ | ||||
| <sf #sf [compact]="true" [ui]="ui" [schema]="schema" [button]="'none'"> | ||||
|     <ng-template sf-template="creditPhoto" let-me let-ui="ui" let-schema="schema"> | ||||
|         <img [src]="i.creditPhoto" alt="" /> | ||||
|     </ng-template> | ||||
| </sf> | ||||
| @ -0,0 +1,98 @@ | ||||
| import { Component, OnInit, ViewChild } from '@angular/core'; | ||||
| import { SFComponent, SFSchema, SFUISchema } from '@delon/form'; | ||||
| import { EAEnterpriseService } from '@shared'; | ||||
| import { NzMessageService } from 'ng-zorro-antd/message'; | ||||
| import { NzModalRef } from 'ng-zorro-antd/modal'; | ||||
| import { SystemService } from 'src/app/routes/sys-setting/services/system.service'; | ||||
| import { UsermanageService } from 'src/app/routes/usercenter/services/usercenter.service'; | ||||
|  | ||||
| @Component({ | ||||
|   selector: 'app-audit-admin', | ||||
|   templateUrl: './audit-admin.component.html', | ||||
|   styleUrls: ['./audit-admin.component.less'] | ||||
| }) | ||||
| export class AuditAdminComponent implements OnInit { | ||||
|   @ViewChild('sf', { static: false }) | ||||
|   sf!: SFComponent; | ||||
|   i: any; | ||||
|   schema!: SFSchema; | ||||
|   ui: SFUISchema = { | ||||
|     '*': { | ||||
|       spanLabelFixed: 120, | ||||
|       grid: { span: 20 } | ||||
|     } | ||||
|   }; | ||||
|   constructor(public msgSrv: NzMessageService, public service: UsermanageService) {} | ||||
|  | ||||
|   ngOnInit(): void { | ||||
|     this.loadUserInfo(); | ||||
|   } | ||||
|  | ||||
|   loadUserInfo() { | ||||
|     this.service.request(this.service.$api_get_enterprise_user_by_id, { id: this.i.id }).subscribe(res => { | ||||
|       console.log(res); | ||||
|       if (res) { | ||||
|         this.initSF(res); | ||||
|       } | ||||
|     }); | ||||
|   } | ||||
|  | ||||
|   initSF(user?: any) { | ||||
|     console.log(user); | ||||
|     this.schema = { | ||||
|       properties: { | ||||
|         oldAdminName: { | ||||
|           title: '当前管理员', | ||||
|           type: 'string', | ||||
|           ui: { widget: 'text' }, | ||||
|           default: user.oldAdminName | ||||
|         }, | ||||
|         oldAdminMobile: { | ||||
|           title: '手机号', | ||||
|           type: 'string', | ||||
|           ui: { widget: 'text' }, | ||||
|           default: user.oldAdminMobile | ||||
|         }, | ||||
|         oldAdminIdNo: { | ||||
|           title: '身份证号', | ||||
|           type: 'string', | ||||
|           ui: { widget: 'text' }, | ||||
|           default: user.oldAdminIdNo | ||||
|         }, | ||||
|         newAdminName: { | ||||
|           title: '转授对象', | ||||
|           type: 'string', | ||||
|           ui: { widget: 'text' }, | ||||
|           default: user.newAdminName | ||||
|         }, | ||||
|         newAdminMobile: { | ||||
|           title: '手机号', | ||||
|           type: 'string', | ||||
|           ui: { widget: 'text' }, | ||||
|           default: user.newAdminMobile | ||||
|         }, | ||||
|         newAdminIdNo: { | ||||
|           title: '身份证号', | ||||
|           type: 'string', | ||||
|           ui: { widget: 'text' }, | ||||
|           default: user.newAdminIdNo | ||||
|         }, | ||||
|         creditPhoto: { | ||||
|           title: '企业授权函', | ||||
|           type: 'string', | ||||
|           ui: { widget: 'custom' } | ||||
|         }, | ||||
|         approvalOpinion: { | ||||
|           title: '备注', | ||||
|           type: 'string', | ||||
|           maxLength: 100, | ||||
|           ui: { | ||||
|             placeholder: '审核不通过需要说明原因', | ||||
|             widget: 'textarea', | ||||
|             autosize: { minRows: 2, maxRows: 6 } | ||||
|           } | ||||
|         } | ||||
|       } | ||||
|     }; | ||||
|   } | ||||
| } | ||||
| @ -21,7 +21,7 @@ | ||||
|  | ||||
|   <nz-card> | ||||
|     <!-- 数据列表 --> | ||||
|     <st #st multiSort [data]="tabType===1?service.$api_get_freight_list:service.$api_get_freight_list" | ||||
|     <st #st multiSort [data]="tabType===1?service.$api_get_freight_list:service.$api_get_enterprise_admin_list" | ||||
|       [columns]="tabType===1?enterColumns:adminColumns" | ||||
|       [req]="{ method: 'POST', allInBody: true, reName: { pi: 'pageIndex', ps: 'pageSize' }, params: reqParams }" | ||||
|       [res]="{ reName: { list: 'data.records', total: 'data.total' } }" | ||||
|  | ||||
| @ -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' } | ||||
|         } | ||||
|       }, | ||||
|       { | ||||
|  | ||||
| @ -57,51 +57,6 @@ export class FreightComponentsEnterpriseAuditViewComponent implements OnInit { | ||||
|           this.detailData = res; | ||||
|         } | ||||
|       }); | ||||
|     // // 商品资质 | ||||
|     // if (res.enterpriseBusinessJson) { | ||||
|     //   res.enterpriseBusinessJson.aptitudes = res.enterpriseBusinessJson?.aptitudes ? res.enterpriseBusinessJson.aptitudes.split(',') : []; | ||||
|     // } | ||||
|     // // // 申请人身份证证件 | ||||
|     // // res.applyUserJson.imagelist = []; | ||||
|     // // res.applyUserJson.imagelist.push(res.applyUserJson.certificatePhotoFront); | ||||
|     // // res.applyUserJson.imagelist.push(res.applyUserJson.certificatePhotoBack); | ||||
|     // // res.applyUserJson.imagelist.push(res.applyUserJson.handCertificate); | ||||
|  | ||||
|     // 法人身份证证件 | ||||
|     // const imagelist = []; | ||||
|     // imagelist.push(res?.certificatePhotoFront); | ||||
|     // imagelist.push(res?.certificatePhotoBack); | ||||
|     // res.certificatePhoto = imagelist; | ||||
|  | ||||
|     // // 营业执照 | ||||
|     // res.enterpriseQualificationCertificate = res.enterpriseQualificationCertificate | ||||
|     //   ? res.enterpriseQualificationCertificate.split(',') | ||||
|     //   : []; | ||||
|  | ||||
|     // // 返回所在地 | ||||
|     // res.enterpriseAddressCodeStr = await this.getRegionFullName(res.enterpriseAddressCode); | ||||
|  | ||||
|     // this.detailData = res; | ||||
|     // this.suppliersData = { | ||||
|     //   suppliersType: res?.suppliersType, | ||||
|     //   externalSuppliersId: res?.externalSuppliersId | ||||
|     // }; | ||||
|   } | ||||
|  | ||||
|   /** | ||||
|    * 根据地区code查询地区详情 | ||||
|    * @param code 地区代码 | ||||
|    */ | ||||
|   async getRegionFullName(code: any) { | ||||
|     const params = { | ||||
|       regionCode: code | ||||
|     }; | ||||
|     const res = await this.service.asyncRequest(this.service.$api_get_one, params, 'POST', true); | ||||
|     // if (res && res.regionFullName) { | ||||
|     //   const arr = res.regionFullName.split(','); | ||||
|     //   res.regionFullName = arr.reverse().join('-'); | ||||
|     // } | ||||
|     return res && res.regionFullName; | ||||
|   } | ||||
|  | ||||
|   auditPass() { | ||||
|  | ||||
| @ -37,9 +37,9 @@ | ||||
|         </div> | ||||
|       </div> | ||||
|     </ng-template> | ||||
|     <ng-template st-row="contactsPhone" let-item let-index="index"> | ||||
|       <div style="color: #52c41a;" (click)="addPromoter(item)"> | ||||
|         {{ item.contactsPhone }} | ||||
|     <ng-template st-row="promotersTelephone" let-item let-index="index"> | ||||
|       <div style="color: #52c41a;cursor: pointer;" (click)="addPromoter(item)"> | ||||
|         {{ item.promotersTelephone || '添加' }} | ||||
|       </div> | ||||
|     </ng-template> | ||||
|   </st> | ||||
|  | ||||
| @ -11,7 +11,7 @@ import { UsermanageService } from '../../../services/usercenter.service'; | ||||
| }) | ||||
| export class FreightComponentsUserComponent implements OnInit { | ||||
|   _$expand = false; | ||||
|   ui: SFUISchema = { '*': { spanLabelFixed: 120, grid: {lg: 8, md: 12, sm: 12, xs: 24 }, enter: () => this.st.load() } }; | ||||
|   ui: SFUISchema = { '*': { spanLabelFixed: 120, grid: { lg: 8, md: 12, sm: 12, xs: 24 }, enter: () => this.st.load() } }; | ||||
|   schema: SFSchema = this.initSF(); | ||||
|   columns: STColumn[] = this.initST(); | ||||
|   @ViewChild('st', { static: false }) st!: STComponent; | ||||
| @ -190,19 +190,19 @@ export class FreightComponentsUserComponent implements OnInit { | ||||
|     return [ | ||||
|       { title: '用户姓名', className: 'text-center', index: 'name' }, | ||||
|       { title: '手机号', className: 'text-center', index: 'telephone' }, | ||||
|       { title: '身份证件号', className: 'text-center', render: 'certificateNumber' }, | ||||
|       { title: '身份证件号', className: 'text-center', index: 'certificateNumber' }, | ||||
|       { title: '常用服务', className: 'text-center', index: 'unifiedSocialCreditCode' }, | ||||
|       { title: '推广业务员', className: 'text-center', index: 'promotersTelephone', render: 'promotersTelephone' }, | ||||
|       { title: '申请时间', className: 'text-center', index: 'createTime', type: 'date' }, | ||||
|       { | ||||
|         title: '状态', | ||||
|         className: 'text-center', | ||||
|         index: 'stateLocked', | ||||
|         index: 'certificationStatus', | ||||
|         type: 'badge', | ||||
|         badge: { | ||||
|           10: { text: '待审核', color: 'default' }, | ||||
|           20: { text: ' 已成功', color: 'success' }, | ||||
|           30: { text: '已驳回', color: 'warning' } | ||||
|           0: { text: '待审核', color: 'processing' }, | ||||
|           1: { text: '已成功', color: 'success' }, | ||||
|           2: { text: '已驳回', color: 'warning' } | ||||
|         } | ||||
|       }, | ||||
|       { | ||||
| @ -218,10 +218,12 @@ export class FreightComponentsUserComponent implements OnInit { | ||||
|           }, | ||||
|           { | ||||
|             text: '冻结', | ||||
|             iif: item => item.stateLocked === 0, | ||||
|             click: (item: any) => this.userAction(0) | ||||
|           }, | ||||
|           { | ||||
|             text: '启用', | ||||
|             iif: item => item.stateLocked === 1, | ||||
|             click: (item: any) => this.userAction(1) | ||||
|           } | ||||
|         ] | ||||
|  | ||||
| @ -59,6 +59,12 @@ export class UsermanageService extends BaseService { | ||||
|   // 审核驾驶证信息 | ||||
|   $api_approve_driver_license = '/api/mdc/cuc/driver/auditDriverLicense'; | ||||
|  | ||||
|   // 查询企业管理员审核信息 | ||||
|   $api_get_enterprise_admin_list = '/api/mdc/cuc/enterpriseAdmin/operate/list/page'; | ||||
|   // 根据主键ID获取企业管理员审核信息 | ||||
|   $api_get_enterprise_user_by_id = '/api/mdc/cuc/enterpriseAdmin/operate/get'; | ||||
|   // 审核企业管理员 | ||||
|   $api_audit_enterprise_admin = '/api/mdc/cuc/enterpriseAdmin/operate/audit'; | ||||
|  | ||||
|   constructor(public injector: Injector) { | ||||
|     super(injector); | ||||
|  | ||||
| @ -20,6 +20,7 @@ import { FreightComponentsListViewComponent } from './components/freight/list/vi | ||||
| import { FreightComponentsUserDetailComponent } from './components/freight/user/detail/detail.component'; | ||||
| import { FreightComponentsUserComponent } from './components/freight/user/user.component'; | ||||
| import { UsercenterRoutingModule } from './usercenter-routing.module'; | ||||
| import { AuditAdminComponent } from './components/freight/enterprise-audit/audit-admin/audit-admin.component'; | ||||
|  | ||||
| const COMPONENTS = [ | ||||
|   FreightComponentsListComponent, | ||||
| @ -37,6 +38,6 @@ const COMPONENTS = [ | ||||
|  | ||||
| @NgModule({ | ||||
|   imports: [SharedModule, UsercenterRoutingModule], | ||||
|   declarations: [...COMPONENTS], | ||||
|   declarations: [...COMPONENTS, AuditAdminComponent], | ||||
| }) | ||||
| export class UsercenterModule {} | ||||
|  | ||||
| @ -1,25 +0,0 @@ | ||||
| import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||||
|  | ||||
| import { DictSelectComponent } from './dict-select.component'; | ||||
|  | ||||
| describe('DictSelectComponent', () => { | ||||
|   let component: DictSelectComponent; | ||||
|   let fixture: ComponentFixture<DictSelectComponent>; | ||||
|  | ||||
|   beforeEach(async () => { | ||||
|     await TestBed.configureTestingModule({ | ||||
|       declarations: [ DictSelectComponent ] | ||||
|     }) | ||||
|     .compileComponents(); | ||||
|   }); | ||||
|  | ||||
|   beforeEach(() => { | ||||
|     fixture = TestBed.createComponent(DictSelectComponent); | ||||
|     component = fixture.componentInstance; | ||||
|     fixture.detectChanges(); | ||||
|   }); | ||||
|  | ||||
|   it('should create', () => { | ||||
|     expect(component).toBeTruthy(); | ||||
|   }); | ||||
| }); | ||||
| @ -6,6 +6,5 @@ | ||||
|  * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE | ||||
|  * @FilePath: \tms-obc-web\src\app\shared\components\dict-select\index.ts | ||||
|  */ | ||||
| export * from './dict-select.component.spec'; | ||||
| export * from './dict-select.component'; | ||||
| export * from './dict-select.service'; | ||||
|  | ||||
| @ -29,6 +29,7 @@ import { SharedThirdModule } from './shared-third.module'; | ||||
| import { LogisticsTimeLineComponent } from './components/logistics-time-line/logistics-time-line.component'; | ||||
| import { AmapModule } from './components/amap/amap.module'; | ||||
| import { ImageListModule } from './components/imagelist'; | ||||
| import { DictSelectComponent } from './components/dict-select'; | ||||
|  | ||||
| const MODULES = [ | ||||
|   AddressModule, | ||||
| @ -46,7 +47,7 @@ const MODULES = [ | ||||
| ]; | ||||
| // #endregion | ||||
|  | ||||
| const SHAREDCOMPONENTS = [LogisticsTimeLineComponent]; | ||||
| const SHAREDCOMPONENTS = [LogisticsTimeLineComponent, DictSelectComponent]; | ||||
|  | ||||
| @NgModule({ | ||||
|   imports: [ | ||||
|  | ||||
		Reference in New Issue
	
	Block a user