车辆对接
This commit is contained in:
		| @ -376,6 +376,7 @@ resourceStatus: any; | |||||||
|             click: (_record) => this.cancellation(_record), |             click: (_record) => this.cancellation(_record), | ||||||
|             iif: item => item.externalSn === '1' || item.externalSn === 1, |             iif: item => item.externalSn === '1' || item.externalSn === 1, | ||||||
|           }, |           }, | ||||||
|  |            | ||||||
|         ], |         ], | ||||||
|       }, |       }, | ||||||
|     ]; |     ]; | ||||||
|  | |||||||
| @ -0,0 +1,44 @@ | |||||||
|  | <div class="modal-header"> | ||||||
|  |   <div class="modal-title">添加司机</div> | ||||||
|  | </div> | ||||||
|  | <!-- <nz-spin *ngIf="!i" class="modal-spin"></nz-spin> --> | ||||||
|  | <div class="sfBox"> | ||||||
|  |   <sf #sf [compact]="true" [ui]="ui" [schema]="schema" [button]="'none'" *ngIf="schema"> | ||||||
|  |     <ng-template sf-template="tipsA" let-me let-ui="ui" let-schema="schema"> | ||||||
|  |       <div class="pr"> | ||||||
|  |           <dl class="tips"> | ||||||
|  |               <dt>正面照</dt> | ||||||
|  |               <dd>示例</dd> | ||||||
|  |           </dl> | ||||||
|  |           <div class="pa"><img width="190" src="/assets/images/eg01.png" /></div> | ||||||
|  |       </div> | ||||||
|  |   </ng-template> | ||||||
|  |   <ng-template sf-template="tipsB" let-me let-ui="ui" let-schema="schema"> | ||||||
|  |       <div class="pr"> | ||||||
|  |           <dl class="tips"> | ||||||
|  |               <dt>背面照</dt> | ||||||
|  |               <dd>示例</dd> | ||||||
|  |           </dl> | ||||||
|  |           <div class="pa"><img width="190" src="/assets/images/eg02.png" /></div> | ||||||
|  |       </div> | ||||||
|  |   </ng-template> | ||||||
|  |   </sf> | ||||||
|  |   <sf #sf1 [compact]="true" [ui]="ui" [schema]="schema1" [button]="'none'" *ngIf="schema1"></sf> | ||||||
|  |   <sf #sf2 [compact]="true" [ui]="ui" [schema]="schema2" [button]="'none'" *ngIf="schema2"></sf> | ||||||
|  |   <!-- <div class="example" (click)="showExample()"> | ||||||
|  |       查看示例 | ||||||
|  |       <div class="popBox" *ngIf="showCardFlag"> | ||||||
|  |           <img src="https://ng.ant.design/assets/img/logo.svg" alt=""> | ||||||
|  |       </div> | ||||||
|  |   </div> | ||||||
|  |   <div class="example positionSet" (click)="showJopExample()"> | ||||||
|  |       查看示例 | ||||||
|  |       <div class="popBox" *ngIf="showJopFlag"> | ||||||
|  |           <img src="https://ng.ant.design/assets/img/logo.svg" alt=""> | ||||||
|  |       </div> | ||||||
|  |   </div> --> | ||||||
|  | </div> | ||||||
|  | <div class="modal-footer"> | ||||||
|  |   <button nz-button type="button" (click)="close()">关闭</button> | ||||||
|  |   <button nz-button type="button" nzType="primary" (click)="submitForm()">确定</button> | ||||||
|  | </div> | ||||||
| @ -0,0 +1,25 @@ | |||||||
|  | .pr { | ||||||
|  |     position: relative; | ||||||
|  |   } | ||||||
|  |  | ||||||
|  |   .pa { | ||||||
|  |     position: absolute; | ||||||
|  |     top: 35px; | ||||||
|  |     left: 150px; | ||||||
|  |   } | ||||||
|  |  | ||||||
|  |   .tips { | ||||||
|  |     display: flex; | ||||||
|  |     margin-bottom: 0; | ||||||
|  |     color: #333; | ||||||
|  |  | ||||||
|  |     dt { | ||||||
|  |       width: 150px; | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     dd { | ||||||
|  |       width: 190px; | ||||||
|  |       margin-bottom: 0; | ||||||
|  |       text-align: center; | ||||||
|  |     } | ||||||
|  |   } | ||||||
| @ -0,0 +1,24 @@ | |||||||
|  | import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; | ||||||
|  | import { CarAddDriverComponent } from './add-driver.component'; | ||||||
|  |  | ||||||
|  | describe('CarAddDriverComponent', () => { | ||||||
|  |   let component: CarAddDriverComponent; | ||||||
|  |   let fixture: ComponentFixture<CarAddDriverComponent>; | ||||||
|  |  | ||||||
|  |   beforeEach(waitForAsync(() => { | ||||||
|  |     TestBed.configureTestingModule({ | ||||||
|  |       declarations: [ CarAddDriverComponent ] | ||||||
|  |     }) | ||||||
|  |     .compileComponents(); | ||||||
|  |   })); | ||||||
|  |  | ||||||
|  |   beforeEach(() => { | ||||||
|  |     fixture = TestBed.createComponent(CarAddDriverComponent); | ||||||
|  |     component = fixture.componentInstance; | ||||||
|  |     fixture.detectChanges(); | ||||||
|  |   }); | ||||||
|  |  | ||||||
|  |   it('should create', () => { | ||||||
|  |     expect(component).toBeTruthy(); | ||||||
|  |   }); | ||||||
|  | }); | ||||||
| @ -0,0 +1,556 @@ | |||||||
|  | import { Component, OnInit, ViewChild } from '@angular/core'; | ||||||
|  | import { apiConf } from '@conf/api.conf'; | ||||||
|  | import { cacheConf } from '@conf/cache.conf'; | ||||||
|  | import { SFComponent, SFUISchema, SFSchema, SFUploadWidgetSchema, SFDateWidgetSchema } from '@delon/form'; | ||||||
|  | import { _HttpClient } from '@delon/theme'; | ||||||
|  | import { EACacheService, EAEnvironmentService } from '@shared'; | ||||||
|  | import { NzModalRef } from 'ng-zorro-antd/modal'; | ||||||
|  | import { Observable, Observer } from 'rxjs'; | ||||||
|  | import { map } from 'rxjs/operators'; | ||||||
|  | import { SupplyManagementService } from '../../services/supply-management.service'; | ||||||
|  |  | ||||||
|  | @Component({ | ||||||
|  |   selector: 'app-car-add-driver', | ||||||
|  |   templateUrl: './add-driver.component.html', | ||||||
|  |   styleUrls: ['./add-driver.component.less'] | ||||||
|  | }) | ||||||
|  | export class CarAddDriverComponent implements OnInit { | ||||||
|  |   @ViewChild('sf', { static: false }) sf!: SFComponent; | ||||||
|  |   @ViewChild('sf1', { static: false }) sf1!: SFComponent; | ||||||
|  |   @ViewChild('sf2', { static: false }) sf2!: SFComponent; | ||||||
|  |   record: any = {}; | ||||||
|  |   i: any; | ||||||
|  |   ui: SFUISchema = {}; | ||||||
|  |   schema: SFSchema = {}; | ||||||
|  |   schema1: SFSchema = {}; | ||||||
|  |   schema2: SFSchema = {}; | ||||||
|  |   showCardFlag = false; | ||||||
|  |   showJopFlag = false; | ||||||
|  |   detailData: any = { | ||||||
|  |     identityInfoDTO: {}, | ||||||
|  |     userDriverLicenseDTO: {}, | ||||||
|  |     userPracticeSeniorityDTO: {} | ||||||
|  |   }; | ||||||
|  |   companyData: any = {}; | ||||||
|  |   mobile = '' | ||||||
|  |   constructor( | ||||||
|  |     private modal: NzModalRef, | ||||||
|  |     public service: SupplyManagementService, | ||||||
|  |     private envSrv: EAEnvironmentService, | ||||||
|  |     private eaCacheSrv: EACacheService, | ||||||
|  |   ) { } | ||||||
|  |  | ||||||
|  |   ngOnInit(): void { | ||||||
|  |     this.companyData = this.eaCacheSrv.get(cacheConf.env) | ||||||
|  |     this.initSF() | ||||||
|  |   } | ||||||
|  |   initSF() { | ||||||
|  |     this.schema = { | ||||||
|  |       properties: { | ||||||
|  |         titleA: { | ||||||
|  |           title: '司机信息(必填)', | ||||||
|  |           type: 'string', | ||||||
|  |           ui: { | ||||||
|  |             widget: 'text', | ||||||
|  |           }, | ||||||
|  |           default: '照片上传后会自动识别文字并填充下列内容栏' | ||||||
|  |         }, | ||||||
|  |         mobile: { | ||||||
|  |           title: '手机号', | ||||||
|  |           type: 'string', | ||||||
|  |           format: 'email', | ||||||
|  |           maxLength: 11, | ||||||
|  |           ui: { | ||||||
|  |             widget: 'text',  | ||||||
|  |           }, | ||||||
|  |           default: this.mobile | ||||||
|  |         }, | ||||||
|  |         showName: { | ||||||
|  |           title: '身份证照片', | ||||||
|  |           type: 'string', | ||||||
|  |           ui: { | ||||||
|  |             widget: 'text', | ||||||
|  |             showRequired: true, | ||||||
|  |           }, | ||||||
|  |           default: '请上传身份证原件的高清照片,若上传复印件,则需加盖公司印章及法人签字;上传后系统会自动识别并填写', | ||||||
|  |         }, | ||||||
|  |         tipsA: { | ||||||
|  |           title: '', | ||||||
|  |           type: 'string', | ||||||
|  |           ui: { | ||||||
|  |             widget: 'custom', | ||||||
|  |             offsetControl: 6, | ||||||
|  |           }, | ||||||
|  |         }, | ||||||
|  |         certificatePhotoFrontWatermark: { | ||||||
|  |           type: 'string', | ||||||
|  |           title: '', | ||||||
|  |           ui: { | ||||||
|  |             offsetControl: 6, | ||||||
|  |             action: apiConf.fileUpload, | ||||||
|  |             fileType: 'image/png,image/jpeg,image/jpg,image/gif', | ||||||
|  |             limit: 1, | ||||||
|  |             limitFileCount: 1, | ||||||
|  |             resReName: 'data.fullFileWatermarkPath', | ||||||
|  |             urlReName: 'data.fullFileWatermarkPath', | ||||||
|  |             widget: 'upload', | ||||||
|  |             descriptionI18n: '图片支持jpg、jpeg、png、gif格式,大小不超过2M', | ||||||
|  |             data: { | ||||||
|  |               appId: this.envSrv.env.appId, | ||||||
|  |             }, | ||||||
|  |             name: 'multipartFile', | ||||||
|  |             multiple: false, | ||||||
|  |             listType: 'picture-card', | ||||||
|  |             change: (args) => { | ||||||
|  |               if (args.type === 'success') { | ||||||
|  |                 this.detailData.certificatePhotoFront = args.file.response.data.fullFilePath | ||||||
|  |                 this.checkIdCard(args.file.response.data.fullFilePath, 'front', 0); | ||||||
|  |               } | ||||||
|  |             }, | ||||||
|  |             beforeUpload: (file: any, _fileList) => { | ||||||
|  |               return new Observable((observer: Observer<boolean>) => { | ||||||
|  |                 const isLt2M = file.size / 1024 / 1024 < 2; | ||||||
|  |                 if (!isLt2M) { | ||||||
|  |                   this.service.msgSrv.warning('图片大小超过2M!'); | ||||||
|  |                   observer.complete(); | ||||||
|  |                   return; | ||||||
|  |                 } | ||||||
|  |                 observer.next(isLt2M); | ||||||
|  |                 observer.complete(); | ||||||
|  |               }); | ||||||
|  |             }, | ||||||
|  |           } as SFUploadWidgetSchema, | ||||||
|  |         }, | ||||||
|  |         tipsB: { | ||||||
|  |           title: '', | ||||||
|  |           type: 'string', | ||||||
|  |           ui: { | ||||||
|  |             widget: 'custom', | ||||||
|  |             offsetControl: 6, | ||||||
|  |           }, | ||||||
|  |         }, | ||||||
|  |         certificatePhotoBackWatermark: { | ||||||
|  |           type: 'string', | ||||||
|  |           title: '', | ||||||
|  |           ui: { | ||||||
|  |             offsetControl: 6, | ||||||
|  |             action: apiConf.fileUpload, | ||||||
|  |             fileType: 'image/png,image/jpeg,image/jpg,image/gif', | ||||||
|  |             limit: 1, | ||||||
|  |             limitFileCount: 1, | ||||||
|  |             resReName: 'data.fullFileWatermarkPath', | ||||||
|  |             urlReName: 'data.fullFileWatermarkPath', | ||||||
|  |             widget: 'upload', | ||||||
|  |             descriptionI18n: '图片支持jpg、jpeg、png、gif格式,大小不超过2M', | ||||||
|  |             data: { | ||||||
|  |               appId: this.envSrv.env.appId, | ||||||
|  |             }, | ||||||
|  |             name: 'multipartFile', | ||||||
|  |             multiple: false, | ||||||
|  |             listType: 'picture-card', | ||||||
|  |             change: (args) => { | ||||||
|  |               if (args.type === 'success') { | ||||||
|  |                 this.detailData.certificatePhotoBack = args.file.response.data.fullFilePath | ||||||
|  |                 this.checkIdCard(args.file.response.data.fullFilePath, 'back', 0); | ||||||
|  |               } | ||||||
|  |             }, | ||||||
|  |             beforeUpload: (file: any, _fileList) => { | ||||||
|  |               return new Observable((observer: Observer<boolean>) => { | ||||||
|  |                 const isLt2M = file.size / 1024 / 1024 < 2; | ||||||
|  |                 if (!isLt2M) { | ||||||
|  |                   this.service.msgSrv.warning('图片大小超过2M!'); | ||||||
|  |                   observer.complete(); | ||||||
|  |                   return; | ||||||
|  |                 } | ||||||
|  |                 observer.next(isLt2M); | ||||||
|  |                 observer.complete(); | ||||||
|  |               }); | ||||||
|  |             }, | ||||||
|  |           } as SFUploadWidgetSchema, | ||||||
|  |         }, | ||||||
|  |         name: { | ||||||
|  |           title: '姓名', | ||||||
|  |           type: 'string', | ||||||
|  |           maxLength: 32, | ||||||
|  |           ui: { | ||||||
|  |             widget: '', | ||||||
|  |             placeholder: '请输入姓名', | ||||||
|  |           }, | ||||||
|  |         }, | ||||||
|  |         certificateNumber: { | ||||||
|  |           title: '身份证号', | ||||||
|  |           type: 'string', | ||||||
|  |           format: 'id-card', | ||||||
|  |           minLength: 1, | ||||||
|  |           maxLength: 18, | ||||||
|  |           ui: { | ||||||
|  |             widget: '', | ||||||
|  |             placeholder: '请输入法定代表人证件号', | ||||||
|  |             errors: { | ||||||
|  |               required: '请输入18位身份证号码', | ||||||
|  |             }, | ||||||
|  |           }, | ||||||
|  |         }, | ||||||
|  |       }, | ||||||
|  |       required: [ | ||||||
|  |         'certificatePhotoFrontWatermark', | ||||||
|  |         'certificatePhotoBackWatermark', | ||||||
|  |         'name', | ||||||
|  |         'certificateNumber' | ||||||
|  |       ], | ||||||
|  |     }; | ||||||
|  |     this.schema1 = { | ||||||
|  |       properties: { | ||||||
|  |         titleB: { | ||||||
|  |           title: '驾驶证信息(必填)', | ||||||
|  |           type: 'string', | ||||||
|  |           ui: { | ||||||
|  |             widget: 'text', | ||||||
|  |           }, | ||||||
|  |           default: '照片上传后会自动识别文字并填充下列内容栏' | ||||||
|  |         }, | ||||||
|  |         certificatePhotoWatermark: { | ||||||
|  |           type: 'string', | ||||||
|  |           title: '驾驶证照片', | ||||||
|  |           ui: { | ||||||
|  |             action: apiConf.fileUpload, | ||||||
|  |             fileType: 'image/png,image/jpeg,image/jpg,image/gif', | ||||||
|  |             limit: 1, | ||||||
|  |             limitFileCount: 1, | ||||||
|  |             resReName: 'data.fullFileWatermarkPath', | ||||||
|  |             urlReName: 'data.fullFileWatermarkPath', | ||||||
|  |             widget: 'upload', | ||||||
|  |             descriptionI18n: '请上传驾驶证照片,支持JPG、PNG格式,文件小于5M。照片信息缺失、拼凑、过度PS、模糊不清,都不会通过审核。', | ||||||
|  |             data: { | ||||||
|  |               appId: this.envSrv.env.appId, | ||||||
|  |             }, | ||||||
|  |             name: 'multipartFile', | ||||||
|  |             multiple: false, | ||||||
|  |             listType: 'picture-card', | ||||||
|  |             change: (args) => { | ||||||
|  |               if (args.type === 'success') { | ||||||
|  |                 this.detailData.userDriverLicenseDTO.certificatePhoto = args.file.response.data.fullFilePath | ||||||
|  |                 this.checkDriverCard(args.file.response.data.fullFilePath, 'front', 0); | ||||||
|  |               } | ||||||
|  |             }, | ||||||
|  |             beforeUpload: (file: any, _fileList) => { | ||||||
|  |               return new Observable((observer: Observer<boolean>) => { | ||||||
|  |                 const isLt4M = file.size / 1024 / 1024 < 4; | ||||||
|  |                 if (!isLt4M) { | ||||||
|  |                   this.service.msgSrv.warning('图片大小超过4M!'); | ||||||
|  |                   observer.complete(); | ||||||
|  |                   return; | ||||||
|  |                 } | ||||||
|  |                 observer.next(isLt4M); | ||||||
|  |                 observer.complete(); | ||||||
|  |               }); | ||||||
|  |             }, | ||||||
|  |           } as SFUploadWidgetSchema, | ||||||
|  |         }, | ||||||
|  |         licenseNo: { | ||||||
|  |           title: '驾驶证号', | ||||||
|  |           type: 'string', | ||||||
|  |           ui: { | ||||||
|  |            // widget: 'text', | ||||||
|  |            placeholder: '请输入', | ||||||
|  |           }, | ||||||
|  |           // default: this.ar.snapshot.queryParams.licenseNo | ||||||
|  |         }, | ||||||
|  |         driverModel: { | ||||||
|  |           title: '准驾车型', | ||||||
|  |           type: 'string', | ||||||
|  |           enum: [ | ||||||
|  |             {label: 'A1', value: 0}, | ||||||
|  |             {label: 'B1', value: 1}, | ||||||
|  |           ], | ||||||
|  |           ui: { | ||||||
|  |             // widget: this.detailData.commitFlag !== 0 ? 'text' : '', | ||||||
|  |             placeholder: '请输入', | ||||||
|  |           }, | ||||||
|  |         }, | ||||||
|  |         validStartTime: { | ||||||
|  |           title: '法人证件有效开始日期', | ||||||
|  |           type: 'string', | ||||||
|  |           ui: { | ||||||
|  |             widget: 'date', | ||||||
|  |             format: 'yyyy-MM-dd', | ||||||
|  |             placeholder: '请选择', | ||||||
|  |             errors: { | ||||||
|  |               required: '请选择起始日期', | ||||||
|  |             }, | ||||||
|  |             change: (i) => { }, | ||||||
|  |           } as SFDateWidgetSchema, | ||||||
|  |         }, | ||||||
|  |         validEndTime: { | ||||||
|  |           title: '法人证件有效开始日期', | ||||||
|  |           type: 'string', | ||||||
|  |           ui: { | ||||||
|  |             widget: 'date', | ||||||
|  |             format: 'yyyy-MM-dd', | ||||||
|  |             placeholder: '请选择', | ||||||
|  |             errors: { | ||||||
|  |               required: '请选择起始日期', | ||||||
|  |             }, | ||||||
|  |             change: (i) => { }, | ||||||
|  |           } as SFDateWidgetSchema, | ||||||
|  |         }, | ||||||
|  |         signingOrganization: { | ||||||
|  |           title: '签发机关', | ||||||
|  |           type: 'string', | ||||||
|  |           maxLength: 30, | ||||||
|  |           ui: { | ||||||
|  |             // widget: this.detailData.commitFlag !== 0 ? 'text' : '', | ||||||
|  |             placeholder: '请输入', | ||||||
|  |           }, | ||||||
|  |         }, | ||||||
|  |       }, | ||||||
|  |       required: [ | ||||||
|  |         'certificatePhotoWatermark', | ||||||
|  |         'licenseNo', | ||||||
|  |         'driverModel', | ||||||
|  |         'validStartTime', | ||||||
|  |         'validEndTime', | ||||||
|  |       ], | ||||||
|  |     }; | ||||||
|  |     this.schema2 = { | ||||||
|  |       properties: { | ||||||
|  |         titleC: { | ||||||
|  |           title: '从业资格证(选填)', | ||||||
|  |           type: 'string', | ||||||
|  |           ui: { | ||||||
|  |             widget: 'text', | ||||||
|  |           }, | ||||||
|  |           default: '照片上传后会自动识别文字并填充下列内容栏', | ||||||
|  |         }, | ||||||
|  |         certificatePhotoWatermark: { | ||||||
|  |           type: 'string', | ||||||
|  |           title: '', | ||||||
|  |           ui: { | ||||||
|  |             offsetControl: 6, | ||||||
|  |             action: apiConf.fileUpload, | ||||||
|  |             fileType: 'image/png,image/jpeg,image/jpg,image/gif', | ||||||
|  |             limit: 1, | ||||||
|  |             limitFileCount: 1, | ||||||
|  |             resReName: 'data.fullFileWatermarkPath', | ||||||
|  |             urlReName: 'data.fullFileWatermarkPath', | ||||||
|  |             widget: 'upload', | ||||||
|  |             descriptionI18n: '图片支持jpg、jpeg、png、gif格式,大小不超过5M', | ||||||
|  |             data: { | ||||||
|  |               appId: this.envSrv.env.appId, | ||||||
|  |             }, | ||||||
|  |             name: 'multipartFile', | ||||||
|  |             multiple: false, | ||||||
|  |             listType: 'picture-card', | ||||||
|  |             change: (args) => { | ||||||
|  |               if (args.type === 'success') { | ||||||
|  |                 this.detailData.userPracticeSeniorityDTO.certificatePhoto = args.file.response.data.fullFilePath | ||||||
|  |                 //this.checkIdCard(args.file.response.data.fullFile, 0, 0); | ||||||
|  |               } | ||||||
|  |             }, | ||||||
|  |             beforeUpload: (file: any, _fileList) => { | ||||||
|  |               return new Observable((observer: Observer<boolean>) => { | ||||||
|  |                 const isLt2M = file.size / 1024 / 1024 < 2; | ||||||
|  |                 if (!isLt2M) { | ||||||
|  |                   this.service.msgSrv.warning('图片大小超过2M!'); | ||||||
|  |                   observer.complete(); | ||||||
|  |                   return; | ||||||
|  |                 } | ||||||
|  |                 observer.next(isLt2M); | ||||||
|  |                 observer.complete(); | ||||||
|  |               }); | ||||||
|  |             }, | ||||||
|  |           } as SFUploadWidgetSchema, | ||||||
|  |         }, | ||||||
|  |         licenseNo: { | ||||||
|  |           title: '从业资格证号', | ||||||
|  |           type: 'string', | ||||||
|  |           maxLength: 30, | ||||||
|  |           ui: { | ||||||
|  |             // widget: this.detailData.commitFlag !== 0 ? 'text' : '', | ||||||
|  |             placeholder: '请输入', | ||||||
|  |           }, | ||||||
|  |         }, | ||||||
|  |         regionCode: { | ||||||
|  |           title: '签发省份', | ||||||
|  |           type: 'string', | ||||||
|  |           ui: { | ||||||
|  |             widget: 'select', | ||||||
|  |             placeholder: '请选择', | ||||||
|  |             asyncData: () => this.getProvinceData(), | ||||||
|  |           } as SFDateWidgetSchema, | ||||||
|  |         }, | ||||||
|  |         validStartTime: { | ||||||
|  |           title: '发证日期', | ||||||
|  |           type: 'string', | ||||||
|  |           ui: { | ||||||
|  |             widget: 'date', | ||||||
|  |             format: 'yyyy-MM-dd', | ||||||
|  |             placeholder: '请选择', | ||||||
|  |             errors: { | ||||||
|  |               required: '请选择起始日期', | ||||||
|  |             }, | ||||||
|  |             change: (i) => { }, | ||||||
|  |           } as SFDateWidgetSchema, | ||||||
|  |         }, | ||||||
|  |         validEndTime: { | ||||||
|  |           title: '有效期止', | ||||||
|  |           type: 'string', | ||||||
|  |           ui: { | ||||||
|  |             widget: 'date', | ||||||
|  |             format: 'yyyy-MM-dd', | ||||||
|  |             placeholder: '请选择', | ||||||
|  |             errors: { | ||||||
|  |               required: '请选择起始日期', | ||||||
|  |             }, | ||||||
|  |             change: (i) => { }, | ||||||
|  |           } as SFDateWidgetSchema, | ||||||
|  |         }, | ||||||
|  |       }, | ||||||
|  |       required: [ | ||||||
|  |          | ||||||
|  |       ], | ||||||
|  |     }; | ||||||
|  |     this.ui = { | ||||||
|  |       '*': { | ||||||
|  |         spanLabelFixed: 180, | ||||||
|  |         grid: { span: 24 }, | ||||||
|  |         width: 700, | ||||||
|  |       }, | ||||||
|  |       $title1: { | ||||||
|  |         spanLabelFixed: 0, | ||||||
|  |       }, | ||||||
|  |       $title2: { | ||||||
|  |         spanLabelFixed: 0, | ||||||
|  |       }, | ||||||
|  |       $title3: { | ||||||
|  |         spanLabelFixed: 0, | ||||||
|  |       }, | ||||||
|  |       $title4: { | ||||||
|  |         spanLabelFixed: 0, | ||||||
|  |       }, | ||||||
|  |       $enterpriseRegistrationTime: { | ||||||
|  |         width: 680, | ||||||
|  |       }, | ||||||
|  |       $operatingEndTime: { | ||||||
|  |         grid: { span: 9 }, | ||||||
|  |       }, | ||||||
|  |       $dateType: { | ||||||
|  |         grid: { span: 4 }, | ||||||
|  |       }, | ||||||
|  |       $validEndTime: { | ||||||
|  |         grid: { span: 9 }, | ||||||
|  |       }, | ||||||
|  |       $dateType01: { | ||||||
|  |         grid: { span: 4 }, | ||||||
|  |       }, | ||||||
|  |       $registrationCapital: { | ||||||
|  |         grid: { span: 12 }, | ||||||
|  |       }, | ||||||
|  |       $unit: { | ||||||
|  |         spanLabelFixed: 20, | ||||||
|  |         grid: { span: 3 }, | ||||||
|  |       }, | ||||||
|  |     }; | ||||||
|  |   } | ||||||
|  |   getProvinceData() { | ||||||
|  |     // return this.service.request(this.service.$api_getRegionByCode, { regionCode: '' }).pipe( | ||||||
|  |     //   map(res => { | ||||||
|  |     //     const result: any = [] | ||||||
|  |     //     if (res) { | ||||||
|  |     //       res.map((m: any) => { | ||||||
|  |     //         const item = { label: m.name, value: m.regionCode } | ||||||
|  |     //         result.push(item) | ||||||
|  |     //       }); | ||||||
|  |     //     } | ||||||
|  |     //     return result | ||||||
|  |     //   }) | ||||||
|  |     // ); | ||||||
|  |   } | ||||||
|  |   checkIdCard(imgurl: any, side: any, type: any) { | ||||||
|  |     // 识别身份证 参数side:0-正面、1-背面;type:0-申请人身份证,1-法定代表人身份证 | ||||||
|  |     const params = { | ||||||
|  |       idCardUrl: imgurl, | ||||||
|  |       side, | ||||||
|  |     }; | ||||||
|  |     // this.service.request(this.service.$api_checkIdCard, params).subscribe((res) => { | ||||||
|  |     //   if (res) { | ||||||
|  |     //     if (type === 0) { | ||||||
|  |     //       // 法定代表人身份证 | ||||||
|  |     //       if (side === 'front') { | ||||||
|  |     //         // 正面 | ||||||
|  |     //         this.sf.setValue('/name', res.name); | ||||||
|  |     //         this.sf.setValue('/certificateNumber', res.number); | ||||||
|  |     //       } | ||||||
|  |     //     } | ||||||
|  |     //   } | ||||||
|  |     // }); | ||||||
|  |   } | ||||||
|  |   checkDriverCard(imgurl: any, side: any, type: any) { | ||||||
|  |     // 识别身份证 参数side:0-正面、1-背面;type:0-申请人身份证,1-法定代表人身份证 | ||||||
|  |     const params = { | ||||||
|  |       driverLicenseUrl: imgurl, | ||||||
|  |       side, | ||||||
|  |     }; | ||||||
|  |     // this.service.request(this.service.$api_recognizeDriverLicense, params).subscribe((res) => { | ||||||
|  |     //   if (res) { | ||||||
|  |     //     if (type === 0) { | ||||||
|  |     //       // 法定代表人身份证 | ||||||
|  |     //       if (side === 'front') { | ||||||
|  |     //         // 正面 | ||||||
|  |     //         this.sf1.setValue('/licenseNo', res.number); | ||||||
|  |     //         this.sf1.setValue('/driverModel', res.number); | ||||||
|  |     //         this.sf1.setValue('/validStartTime', res.validFrom); | ||||||
|  |     //         this.sf1.setValue('/validEndTime', res.validTo); | ||||||
|  |     //         this.sf1.setValue('/signingOrganization', res.issuingAuthority); | ||||||
|  |     //       } | ||||||
|  |     //     } | ||||||
|  |     //   } | ||||||
|  |     // }); | ||||||
|  |   } | ||||||
|  |   close(): void { | ||||||
|  |     this.modal.destroy(); | ||||||
|  |   } | ||||||
|  |   showExample(){ | ||||||
|  |     this.showCardFlag = !this.showCardFlag | ||||||
|  |   } | ||||||
|  |   showJopExample(){ | ||||||
|  |     this.showJopFlag = !this.showJopFlag | ||||||
|  |   } | ||||||
|  |   submitForm(){ | ||||||
|  |     const params:any = { | ||||||
|  |       enterpriseId: this.companyData.enterpriseId, | ||||||
|  |       enterpriseProjectId: this.companyData.projectId, | ||||||
|  |       source: 1, | ||||||
|  |       mobile: this.mobile, | ||||||
|  |       identityInfoDTO:{ | ||||||
|  |         ...this.sf.value, | ||||||
|  |         certificatePhotoFront: this.detailData.certificatePhotoFront, | ||||||
|  |         certificatePhotoBack: this.detailData.certificatePhotoBack, | ||||||
|  |       }, | ||||||
|  |       userDriverLicenseDTO: { | ||||||
|  |         ...this.sf1.value, | ||||||
|  |         certificatePhoto: this.detailData.userDriverLicenseDTO.certificatePhoto, | ||||||
|  |       }, | ||||||
|  |       userPracticeSeniorityDTO: { | ||||||
|  |         ...this.sf2.value, | ||||||
|  |         certificatePhoto: this.detailData.userPracticeSeniorityDTO.certificatePhoto, | ||||||
|  |       }, | ||||||
|  |     }; | ||||||
|  |     params.identityInfoDTO.certificatePhotoFrontWatermark = this.sf?.value.certificatePhotoFrontWatermark | ||||||
|  |     params.identityInfoDTO.certificatePhotoBackWatermark = this.sf?.value.certificatePhotoBackWatermark | ||||||
|  |     params.userDriverLicenseDTO.certificatePhotoWatermark = this.sf1?.value.certificatePhotoWatermark | ||||||
|  |     params.userPracticeSeniorityDTO.certificatePhotoWatermark = this.sf2?.value.certificatePhotoWatermark | ||||||
|  |     delete params.identityInfoDTO.titleA; | ||||||
|  |     delete params.identityInfoDTO.titleB; | ||||||
|  |     delete params.identityInfoDTO.titleC; | ||||||
|  |     delete params.userDriverLicenseDTO.tipsA; | ||||||
|  |     delete params.userPracticeSeniorityDTO.tipsC; | ||||||
|  |     delete params.showName | ||||||
|  |     // this.service.request(this.service.$api_enterpriseVehicleSave, params).subscribe(res => { | ||||||
|  |     //   if(res){ | ||||||
|  |     //     this.service.msgSrv.success('添加成功') | ||||||
|  |     //     this.close() | ||||||
|  |     //   } | ||||||
|  |     // }) | ||||||
|  |   } | ||||||
|  | } | ||||||
| @ -0,0 +1,48 @@ | |||||||
|  | <div class="modal-header"> | ||||||
|  |     <div class="modal-title">新增</div> | ||||||
|  | </div> | ||||||
|  | <!-- <nz-spin *ngIf="!i" class="modal-spin"></nz-spin> --> | ||||||
|  | <div> | ||||||
|  |     <!-- 搜索表单 --> | ||||||
|  |     <div nz-row nzGutter="8"> | ||||||
|  |         <!-- 查询字段小于或等于3个时,不显示伸缩按钮 --> | ||||||
|  |         <div nz-col nzSpan="24" *ngIf="queryFieldCount <= 4"> | ||||||
|  |             <sf #sf [schema]="schema" [ui]="ui" [mode]="'search'" [disabled]="!sf?.valid" [loading]="service.http.loading" (formSubmit)="initData(true)" (formReset)="resetSF()"></sf> | ||||||
|  |         </div> | ||||||
|  |  | ||||||
|  |         <!-- 查询字段大于3个时,根据展开状态调整布局 --> | ||||||
|  |         <ng-container *ngIf="queryFieldCount > 4"> | ||||||
|  |             <div nz-col [nzSpan]="_$expand ? 24 : 18"> | ||||||
|  |                 <sf #sf [schema]="schema" [ui]="ui" [compact]="true" [button]="'none'"></sf> | ||||||
|  |             </div> | ||||||
|  |             <div nz-col [nzSpan]="_$expand ? 24 : 6" [class.text-right]="_$expand"> | ||||||
|  |                 <button nz-button nzType="primary" [disabled]="!sf.valid" [nzLoading]="service.http.loading" (click)="initData(true)">查询</button> | ||||||
|  |                 <button nz-button (click)="resetSF()">重置</button> | ||||||
|  |                 <button nz-button nzType="link" (click)="expandToggle()"> | ||||||
|  |               {{ !_$expand ? '展开' : '收起' }} | ||||||
|  |               <i nz-icon [nzType]="!_$expand ? 'down' : 'up'"></i> | ||||||
|  |           </button> | ||||||
|  |             </div> | ||||||
|  |         </ng-container> | ||||||
|  |     </div> | ||||||
|  |     <!-- 数据列表 --> | ||||||
|  |     <!-- [data]="service.$api_getCarCaptainByMobile" --> | ||||||
|  |     <div *ngIf="sf?.value?.mobile && tableData?.length > 0"> | ||||||
|  |         <st #st multiSort bordered [columns]="columns" [ps]="20" [req]="{ method: 'POST', allInBody: true, reName: { pi: '', ps: '' }, params: reqParams }" [res]="{ reName: { list: 'data', total: 'data.total' } }" [page]="{ show: true, showSize: true, pageSizes: [20, 50, 100] }" | ||||||
|  |         [loading]="service.http.loading" [data]="tableData"> | ||||||
|  |  | ||||||
|  |     <ng-template st-row="carModel" let-item let-index="index"> | ||||||
|  |         <span>{{item.carModel}};{{item.carLength}};{{item.carLoad}};</span> | ||||||
|  |     </ng-template> | ||||||
|  | </st> | ||||||
|  |     </div> | ||||||
|  |     | ||||||
|  |  | ||||||
|  |     <div class="noContent" *ngIf="sf?.value?.mobile && tableData?.length === 0 && flag"> | ||||||
|  |         抱歉,该手机号还未注册,仍然需要添加请点击 <span (click)="addModal()">继续添加 | ||||||
|  |         </span> | ||||||
|  |     </div> | ||||||
|  | </div> | ||||||
|  | <div class="modal-footer"> | ||||||
|  |     <button nz-button type="button" (click)="close()">关闭</button> | ||||||
|  | </div> | ||||||
| @ -0,0 +1,38 @@ | |||||||
|  |  | ||||||
|  | :host{ | ||||||
|  |     ::ng-deep{ | ||||||
|  |         .ant-card-meta-title{ | ||||||
|  |             display: flex; | ||||||
|  |             align-items: center; | ||||||
|  |             justify-content: space-between; | ||||||
|  |         } | ||||||
|  |         .nameBox { | ||||||
|  |             display: flex; | ||||||
|  |             align-items: baseline; | ||||||
|  |             .name{ | ||||||
|  |              margin: 0 10px 0 0; | ||||||
|  |             } | ||||||
|  |         } | ||||||
|  |         .ant-badge-status{ | ||||||
|  |             color: #666 | ||||||
|  |         } | ||||||
|  |          | ||||||
|  |     } | ||||||
|  |     .title{ | ||||||
|  |         clear: both; | ||||||
|  |         margin: 10px 0; | ||||||
|  |         font-weight: bold; | ||||||
|  |         font-size: 14px; | ||||||
|  |     } | ||||||
|  |     .noContent{ | ||||||
|  |         width: 100%; | ||||||
|  |         min-height: 300px; | ||||||
|  |         font-size: 16px; | ||||||
|  |         line-height: 300px; | ||||||
|  |         text-align: center; | ||||||
|  |         span { | ||||||
|  |             color: #1890ff; | ||||||
|  |             cursor: pointer; | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  | } | ||||||
| @ -0,0 +1,24 @@ | |||||||
|  | import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; | ||||||
|  | import { CarAddmodalComponent } from './addmodal.component'; | ||||||
|  |  | ||||||
|  | describe('CarAddmodalComponent', () => { | ||||||
|  |   let component: CarAddmodalComponent; | ||||||
|  |   let fixture: ComponentFixture<CarAddmodalComponent>; | ||||||
|  |  | ||||||
|  |   beforeEach(waitForAsync(() => { | ||||||
|  |     TestBed.configureTestingModule({ | ||||||
|  |       declarations: [ CarAddmodalComponent ] | ||||||
|  |     }) | ||||||
|  |     .compileComponents(); | ||||||
|  |   })); | ||||||
|  |  | ||||||
|  |   beforeEach(() => { | ||||||
|  |     fixture = TestBed.createComponent(CarAddmodalComponent); | ||||||
|  |     component = fixture.componentInstance; | ||||||
|  |     fixture.detectChanges(); | ||||||
|  |   }); | ||||||
|  |  | ||||||
|  |   it('should create', () => { | ||||||
|  |     expect(component).toBeTruthy(); | ||||||
|  |   }); | ||||||
|  | }); | ||||||
| @ -0,0 +1,179 @@ | |||||||
|  | import { Component, OnInit, ViewChild } from '@angular/core'; | ||||||
|  | import { Router, ActivatedRoute } from '@angular/router'; | ||||||
|  | import { cacheConf } from '@conf/cache.conf'; | ||||||
|  | import { STColumn, STComponent, STChange, STData } from '@delon/abc/st'; | ||||||
|  | import { SFUISchema, SFSchema, SFComponent } from '@delon/form'; | ||||||
|  | import { ModalHelper, _HttpClient } from '@delon/theme'; | ||||||
|  | import { EACacheService } from '@shared'; | ||||||
|  | import { NzModalRef } from 'ng-zorro-antd/modal'; | ||||||
|  | import { SupplyManagementService } from '../../services/supply-management.service'; | ||||||
|  | import { CarAddDriverComponent } from '../add-driver/add-driver.component'; | ||||||
|  |  | ||||||
|  | @Component({ | ||||||
|  |   selector: 'app-car-addmodal', | ||||||
|  |   templateUrl: './addmodal.component.html', | ||||||
|  |   styleUrls: ['./addmodal.component.less'] | ||||||
|  | }) | ||||||
|  | export class CarAddmodalComponent implements OnInit { | ||||||
|  |   @ViewChild('st', { static: false }) st!: STComponent; | ||||||
|  |   @ViewChild('sf', { static: false }) sf!: SFComponent; | ||||||
|  |   _$expand = false; | ||||||
|  |   ui!: SFUISchema; | ||||||
|  |   schema!: SFSchema; | ||||||
|  |   columns!: STColumn[]; | ||||||
|  |   tableData: any = []; | ||||||
|  |   companyData: any = {}; | ||||||
|  |   flag = false | ||||||
|  |   constructor( | ||||||
|  |     private modal: NzModalRef, | ||||||
|  |     private eaCacheSrv: EACacheService, | ||||||
|  |     public service: SupplyManagementService, private router: Router, private ar: ActivatedRoute, | ||||||
|  |     private modalHelper: ModalHelper | ||||||
|  |   ) { } | ||||||
|  |  | ||||||
|  |   /** | ||||||
|  |     * 查询字段个数 | ||||||
|  |     */ | ||||||
|  |   get queryFieldCount(): number { | ||||||
|  |     return Object.keys(this.schema?.properties || {}).length; | ||||||
|  |   } | ||||||
|  |  | ||||||
|  |   /** | ||||||
|  |    * 查询参数 | ||||||
|  |    */ | ||||||
|  |   get reqParams() { | ||||||
|  |     const params = Object.assign({}, this.sf?.value || {}); | ||||||
|  |     delete params._$expand; | ||||||
|  |     return { ...params }; | ||||||
|  |   } | ||||||
|  |  | ||||||
|  |   /** | ||||||
|  |    * 选中行 | ||||||
|  |    */ | ||||||
|  |   get selectedRows() { | ||||||
|  |     return this.st?.list.filter((item: any) => item.checked) || []; | ||||||
|  |   } | ||||||
|  |  | ||||||
|  |   /** | ||||||
|  |    * 伸缩查询条件 | ||||||
|  |    */ | ||||||
|  |   expandToggle() { | ||||||
|  |     this._$expand = !this._$expand; | ||||||
|  |     this.sf?.setValue('/_$expand', this._$expand); | ||||||
|  |   } | ||||||
|  |  | ||||||
|  |   /** | ||||||
|  |    * 重置表单 | ||||||
|  |    */ | ||||||
|  |   resetSF() { | ||||||
|  |     this.sf.reset(); | ||||||
|  |     this._$expand = false; | ||||||
|  |   } | ||||||
|  |   /** | ||||||
|  |    * 程序初始化入口 | ||||||
|  |    */ | ||||||
|  |   ngOnInit() { | ||||||
|  |     this.companyData = this.eaCacheSrv.get(cacheConf.env) | ||||||
|  |     this.initSF(); | ||||||
|  |     this.initST() | ||||||
|  |     this.initData() | ||||||
|  |   } | ||||||
|  |  | ||||||
|  |   /** | ||||||
|  |    * 初始化查询表单 | ||||||
|  |    */ | ||||||
|  |   initSF() { | ||||||
|  |     this.schema = { | ||||||
|  |       properties: { | ||||||
|  |         _$expand: { type: 'boolean', ui: { hidden: true } }, | ||||||
|  |         mobile: { title: '司机手机号', type: 'string', maxLength: 11, ui: { showRequired: false, placeholder: '请输入司机手机号', } }, | ||||||
|  |       }, | ||||||
|  |     }; | ||||||
|  |     this.ui = { | ||||||
|  |       '*': { spanLabelFixed: 120, grid: { span: 8, gutter: 4 }, enter: () => this.st?.load(1) }, | ||||||
|  |       $time: { grid: { span: 24 } }, | ||||||
|  |     }; | ||||||
|  |   } | ||||||
|  |  | ||||||
|  |   /** | ||||||
|  |    * 初始化数据列表 | ||||||
|  |    */ | ||||||
|  |   initST() { | ||||||
|  |     this.columns = [ | ||||||
|  |       { title: '司机头像', type: 'img', index: 'avatar', className: 'text-center' }, | ||||||
|  |       { title: '司机姓名', index: 'name', className: 'text-center' }, | ||||||
|  |       { title: '当前车辆', index: 'carNo', className: 'text-center' }, | ||||||
|  |       { title: '车辆信息', render: 'carModel', className: 'text-center' }, | ||||||
|  |       { | ||||||
|  |         title: '个人认证状态', | ||||||
|  |         index: 'identityStatus', | ||||||
|  |         className: 'text-center', | ||||||
|  |         type: 'enum', | ||||||
|  |         enum: { | ||||||
|  |           10: '待审核', | ||||||
|  |           20: '已成功', | ||||||
|  |           30: '已驳回', | ||||||
|  |           40: '证件过期', | ||||||
|  |         } | ||||||
|  |       }, | ||||||
|  |       { title: '驾驶证类型', index: 'createTime', className: 'text-center' }, | ||||||
|  |       { | ||||||
|  |         title: '操作', | ||||||
|  |         width: '180px', | ||||||
|  |         className: 'text-center', | ||||||
|  |         buttons: [ | ||||||
|  |           { text: '添加', click: (_record: any) => this.add(_record) }, | ||||||
|  |         ], | ||||||
|  |       }, | ||||||
|  |     ]; | ||||||
|  |   } | ||||||
|  |   initData(flag?: any) { | ||||||
|  |     if (this.sf?.value.mobile) { | ||||||
|  |       this.flag = flag | ||||||
|  |       // this.service.request(this.service.$api_getCarCaptainByMobile, { mobile: this.sf?.value.mobile }).subscribe(res => { | ||||||
|  |       //   if (res.userId) { | ||||||
|  |       //     this.tableData = [res]; | ||||||
|  |       //   } else { | ||||||
|  |       //     this.tableData = [] | ||||||
|  |       //   } | ||||||
|  |       //   this.st.reload() | ||||||
|  |       // }) | ||||||
|  |     } | ||||||
|  |   } | ||||||
|  |   /** | ||||||
|  |    * 数据列表状态变化事件 | ||||||
|  |    */ | ||||||
|  |   change(change: STChange) { | ||||||
|  |     // console.log(change); | ||||||
|  |   } | ||||||
|  |  | ||||||
|  |   /** | ||||||
|  |    * 新增 | ||||||
|  |    */ | ||||||
|  |   add(item: any) { | ||||||
|  |     const params: any = { | ||||||
|  |       enterpriseId: this.companyData.enterpriseId, | ||||||
|  |       enterpriseProjectId: this.companyData.projectId, | ||||||
|  |       source: 1, | ||||||
|  |       appUserId: item.appUserId ? item.appUserId : '', | ||||||
|  |       mobile: item.mobile | ||||||
|  |     } | ||||||
|  |     // this.service.request(this.service.$api_enterpriseVehicleSave, params).subscribe(res => { | ||||||
|  |     //   if (res.data) { | ||||||
|  |     //     this.service.msgSrv.success('添加成功') | ||||||
|  |     //   } | ||||||
|  |     // }) | ||||||
|  |   } | ||||||
|  |   addModal() { | ||||||
|  |     this.modalHelper.create(CarAddDriverComponent, {mobile: this.sf?.value.mobile}, { size: 900 }).subscribe((res) => { | ||||||
|  |       this.initData() | ||||||
|  |     }); | ||||||
|  |     //this.router.navigate(['/car/add']) | ||||||
|  |   } | ||||||
|  |   goBack() { | ||||||
|  |     window.history.go(-1); | ||||||
|  |   } | ||||||
|  |   close(): void { | ||||||
|  |     this.modal.destroy(); | ||||||
|  |   } | ||||||
|  | } | ||||||
| @ -1,15 +1,59 @@ | |||||||
| <!-- | <!-- | ||||||
|  * @Author: your name |  * @Author: your name | ||||||
|  * @Date: 2021-12-03 11:10:14 |  * @Date: 2021-12-03 11:10:14 | ||||||
|  * @LastEditTime: 2021-12-07 19:51:34 |  * @LastEditTime: 2021-12-21 10:56:30 | ||||||
|  * @LastEditors: your name |  * @LastEditors: your name | ||||||
|  * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE |  * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE | ||||||
|  * @FilePath: \tms-obc-web\src\app\routes\supply-management\components\assigned-car\assigned-car.component.html |  * @FilePath: \tms-obc-web\src\app\routes\supply-management\components\assigned-car\assigned-car.component.html | ||||||
| --> | --> | ||||||
| <div> | <div> | ||||||
|   <sf #sf [schema]="schema" [ui]="ui" [compact]="true" [button]="'none'"></sf> |   <div nz-row> | ||||||
|  |     <div nz-col nzSpan="18"> | ||||||
|  |       <sf #sf [schema]="schema" mode="search" [ui]="ui" [compact]="true" (formSubmit)="st.load(1)" | ||||||
|  |         (formReset)="reset()"></sf> | ||||||
|  |     </div> | ||||||
|  |     <div nz-col nzSpan="6"> | ||||||
|  |       <button nz-button nzType="primary" style="margin-bottom: 24px" (click)="addDriver()"><i nz-icon | ||||||
|  |           nzType="plus"></i>添加司机</button> | ||||||
|  |     </div> | ||||||
|  |   </div> | ||||||
|  |  | ||||||
|   <div> |   <div> | ||||||
|     <!-- <st #st [data]="service.$api_get_catalogue_member" [columns]="columns"> --> |     <st #st [data]="service.$api_get_catalogue_member" | ||||||
|     <!-- </st> --> |       [req]="{ method: 'POST', allInBody: true, reName: { pi: 'pageIndex', ps: 'pageSize' }, params: reqParams }" | ||||||
|  |       [columns]="columns" [res]="{ reName: { list: 'data.records', total: 'data.total' },process:dataProcess }" | ||||||
|  |       [page]="{ show: true, showSize: true, pageSizes: [10, 20, 30, 50, 100, 200, 300, 500, 1000] }" | ||||||
|  |       (change)="changeSt($event)"> | ||||||
|  |       <ng-template st-row="carId" let-item let-index="index"> | ||||||
|  |         <nz-select [(ngModel)]="item.carId" style="width: 280px;"> | ||||||
|  |           <nz-option [nzValue]="''" nzLabel="不限"></nz-option> | ||||||
|  |           <nz-option [nzValue]="car.carId" [nzLabel]="car.carNo" | ||||||
|  |             *ngFor="let car of item.userCarLicenseDesensitizationVOList" [nzCustomContent]="true"> | ||||||
|  |             <span>{{car.carNo}} -</span> | ||||||
|  |             <span>{{car.carLength}}米,{{car.carLoad}}顿 -</span> | ||||||
|  |             <span *ngIf="car?.approvalStatus === '20' && car.carStatus === '0'" class="text-success-dark">空闲</span> | ||||||
|  |             <span *ngIf="car?.approvalStatus === '20' && car.carStatus === '1'" class="text-warning-dark">已被指派</span> | ||||||
|  |             <span *ngIf="car?.approvalStatus !== '20'" class="text-red-dark">未认证</span> | ||||||
|  |             <!-- <span [ngClass]="cardBADGE[car.carStatus]?.color">{{cardBADGE[car.carStatus]?.text}}</span> --> | ||||||
|  |           </nz-option> | ||||||
|  |         </nz-select> | ||||||
|  |       </ng-template> | ||||||
|  |       <ng-template st-row="carCaptain" let-item let-index> | ||||||
|  |         <span>{{item.name}} {{item.phone}}</span> | ||||||
|  |         <a (click)="setCarCaptain(item)">设置</a> | ||||||
|  |       </ng-template> | ||||||
|  |       <ng-template st-row="driverStatus" let-item let-index> | ||||||
|  |         <span *ngIf="item?.certificationStatus === '20' && item.driverStatus === '0'" | ||||||
|  |           class="text-success-dark">空闲</span> | ||||||
|  |         <span *ngIf="item?.certificationStatus === '20' && item.driverStatus === '1'" | ||||||
|  |           class="text-warning-dark">已被指派</span> | ||||||
|  |         <span *ngIf="item?.certificationStatus !== '20'" class="text-red-dark">未认证</span> | ||||||
|  |       </ng-template> | ||||||
|  |     </st> | ||||||
|  |   </div> | ||||||
|  |   <div class="modal-footer"> | ||||||
|  |     <button nz-button type="button" (click)="close()">关闭</button> | ||||||
|  |     <button nz-button type="submit" nzType="primary" (click)="save()" [disabled]="!selectedRows" | ||||||
|  |       [nzLoading]="service.http.loading">发布并指派给司机</button> | ||||||
|   </div> |   </div> | ||||||
| </div> | </div> | ||||||
| @ -1,10 +1,19 @@ | |||||||
| import { Component, OnInit } from '@angular/core'; | import { Component, OnInit, ViewChild } from '@angular/core'; | ||||||
| import { STColumn } from '@delon/abc/st'; | import { STChange, STColumn, STColumnBadge, STComponent, STData } from '@delon/abc/st'; | ||||||
| import { SFSchema, SFUISchema } from '@delon/form'; | import { SFComponent, SFSchema, SFUISchema } from '@delon/form'; | ||||||
| import { _HttpClient } from '@delon/theme'; | import { ModalHelper, _HttpClient } from '@delon/theme'; | ||||||
| import { NzMessageService } from 'ng-zorro-antd/message'; | import { NzMessageService } from 'ng-zorro-antd/message'; | ||||||
| import { NzModalRef } from 'ng-zorro-antd/modal'; | import { NzModalRef } from 'ng-zorro-antd/modal'; | ||||||
| import { SupplyManagementService } from '../../services/supply-management.service'; | import { SupplyManagementService } from '../../services/supply-management.service'; | ||||||
|  | import { SupplyManagementAddDriversComponent } from '../add-drivers/add-drivers.component'; | ||||||
|  |  | ||||||
|  | import { CarAddmodalComponent } from '../addmodal/addmodal.component'; | ||||||
|  |  | ||||||
|  | const BADGE: STColumnBadge = { | ||||||
|  |   1: { text: '空闲', color: 'success' }, | ||||||
|  |   2: { text: '未实名', color: 'error' }, | ||||||
|  |   3: { text: '在途', color: 'warning' }, | ||||||
|  | }; | ||||||
|  |  | ||||||
| @Component({ | @Component({ | ||||||
|   selector: 'app-supply-management-assigned-car', |   selector: 'app-supply-management-assigned-car', | ||||||
| @ -16,15 +25,38 @@ export class SupplyManagementAssignedCarComponent implements OnInit { | |||||||
|   schema: SFSchema = {}; |   schema: SFSchema = {}; | ||||||
|   ui: SFUISchema = {}; |   ui: SFUISchema = {}; | ||||||
|   columns: STColumn[] = []; |   columns: STColumn[] = []; | ||||||
|  |  | ||||||
|  |   @ViewChild('st') st!: STComponent; | ||||||
|  |   @ViewChild('sf', { static: false }) sf!: SFComponent; | ||||||
|  |   status: string = 'anew'; | ||||||
|  |   url = ''; // 请求的api地址 | ||||||
|  |   params: any = {}; // 传进来的参数 | ||||||
|  |   cardBADGE: STColumnBadge | any = { | ||||||
|  |     0: { text: '空闲', color: 'success' }, | ||||||
|  |     1: { text: '在途', color: 'warning' }, | ||||||
|  |     2: { text: '未认证', color: 'error' }, | ||||||
|  |   }; | ||||||
|  |   selectedRows: any = null; // 已选行 | ||||||
|   constructor( |   constructor( | ||||||
|     private modal: NzModalRef, |     private modal: NzModalRef, | ||||||
|     private msgSrv: NzMessageService, |     private msgSrv: NzMessageService, | ||||||
|     public service: SupplyManagementService |     public service: SupplyManagementService, | ||||||
|  |     private modalHelper: ModalHelper, | ||||||
|   ) { |   ) { | ||||||
|     this.initSF(); |     this.initSF(); | ||||||
|     this.initSt(); |     this.initSt(); | ||||||
|   } |   } | ||||||
|  |  | ||||||
|  |   /** | ||||||
|  | * 查询参数 | ||||||
|  | */ | ||||||
|  |   get reqParams() { | ||||||
|  |     return { | ||||||
|  |       ...this.sf?.value, | ||||||
|  |     }; | ||||||
|  |   } | ||||||
|  |  | ||||||
|  |  | ||||||
|   /** |   /** | ||||||
| * 初始化查询表单 | * 初始化查询表单 | ||||||
| */ | */ | ||||||
| @ -32,24 +64,24 @@ export class SupplyManagementAssignedCarComponent implements OnInit { | |||||||
|     this.schema = { |     this.schema = { | ||||||
|       properties: { |       properties: { | ||||||
|         _$expand: { type: 'boolean', ui: { hidden: true } }, |         _$expand: { type: 'boolean', ui: { hidden: true } }, | ||||||
|         no: { |         nameOrPhone: { | ||||||
|           type: 'string', |           type: 'string', | ||||||
|           title: '', |           title: '', | ||||||
|           ui: { |           ui: { | ||||||
|             placholder: '请输入司机姓名/手机号' |             placeholder: '请输入司机姓名/手机号' | ||||||
|           } |           } | ||||||
|         }, |         }, | ||||||
|         no2: { |         carNo: { | ||||||
|           type: 'string', |           type: 'string', | ||||||
|           title: '', |           title: '', | ||||||
|           ui: { |           ui: { | ||||||
|             placholder: '请输入车牌号' |             placeholder: '请输入车牌号' | ||||||
|           } |           } | ||||||
|         }, |         }, | ||||||
|       }, |       }, | ||||||
|       type: 'object', |       type: 'object', | ||||||
|     }; |     }; | ||||||
|     this.ui = { '*': { spanLabelFixed: 80, grid: { span: 12, gutter: 4 } } }; |     this.ui = { '*': { spanLabelFixed: 10, grid: { span: 8, gutter: 1 } } }; | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   /** |   /** | ||||||
| @ -57,25 +89,79 @@ export class SupplyManagementAssignedCarComponent implements OnInit { | |||||||
|    */ |    */ | ||||||
|   initSt() { |   initSt() { | ||||||
|     this.columns = [ |     this.columns = [ | ||||||
|       { width: 50, type: 'checkbox', className: 'text-center' }, |       { width: 50, type: 'radio', className: 'text-center' }, | ||||||
|       { title: '司机姓名', width: 80, index: 'owner', className: 'text-center' }, |       { title: '司机姓名', width: 120, index: 'name', className: 'text-center' }, | ||||||
|       { title: '手机号', index: 'goodsQuantity', width: 100, className: 'text-center' }, |       { title: '手机号', index: 'telephone', width: 200, className: 'text-center' }, | ||||||
|       { title: '车牌号', width: 100, index: 'carNo', className: 'text-center' }, |       { title: '车队长', render: 'carCaptain', className: 'text-center' }, | ||||||
|       { title: '状态', index: 'status', width: 100, className: 'text-center' }, |       { title: '指定车辆', width: 300, render: 'carId', className: 'text-center' }, | ||||||
|  |       { title: '状态', render: 'driverStatus', className: 'text-center', type: 'badge', badge: BADGE }, | ||||||
|     ]; |     ]; | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   ngOnInit(): void { |   ngOnInit(): void { | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   save(value: any): void { |   dataProcess(data: STData[]): STData[] { | ||||||
|     this.service.request(`/user/${this.record.id}`, value).subscribe(res => { |     return data.map((i, index) => { | ||||||
|       this.msgSrv.success('保存成功'); |       i.carId = ''; | ||||||
|       this.modal.close(true); |       i.disabled = i.carStatus === '1'; | ||||||
|  |       const defaultCar = i?.userCarLicenseDesensitizationVOList?.filter((item: any) => item.isDefault); | ||||||
|  |       if (defaultCar.length > 0) { | ||||||
|  |         i.carId = defaultCar[0].carId; | ||||||
|  |       } | ||||||
|  |       return i; | ||||||
|  |     }); | ||||||
|  |   } | ||||||
|  |  | ||||||
|  |   save(): void { | ||||||
|  |     console.log(this.selectedRows); | ||||||
|  |     if (this.selectedRows) { | ||||||
|  |       const { carId, userId: driverId } = this.selectedRows; | ||||||
|  |       const params: any = { carId, driverId }; | ||||||
|  |       this.service.request(this.url, { ...params, ...this.params }).subscribe((res: any) => { | ||||||
|  |         if (res) { | ||||||
|  |           this.modal.close(res); | ||||||
|  |         } | ||||||
|  |       }) | ||||||
|  |  | ||||||
|  |     } | ||||||
|  |   } | ||||||
|  |  | ||||||
|  |   changeSt(e: STChange): void { | ||||||
|  |     if (e?.type === 'loaded') this.selectedRows = null; | ||||||
|  |     if (e?.type === 'radio') this.selectedRows = e?.radio; | ||||||
|  |     console.log(this.selectedRows); | ||||||
|  |  | ||||||
|  |   } | ||||||
|  |   /** | ||||||
|  |    * 添加司机 | ||||||
|  |    * @param item | ||||||
|  |    */ | ||||||
|  |   addDriver() { | ||||||
|  |     this.modalHelper.create(CarAddmodalComponent, {}, { size: 900, modalOptions: { nzMaskClosable: false } }).subscribe((res) => { | ||||||
|  |       if (res) this.st.reload(); | ||||||
|  |     }); | ||||||
|  |   } | ||||||
|  |  | ||||||
|  |   /** | ||||||
|  |    * 设置车队长 | ||||||
|  |    */ | ||||||
|  |   setCarCaptain(item: any) { | ||||||
|  |     this.modalHelper.create(SupplyManagementAddDriversComponent, { dirvierInfo: item }, { | ||||||
|  |       size: 900, | ||||||
|  |       modalOptions: { nzMaskClosable: false, nzTitle: '设置' } | ||||||
|  |     } | ||||||
|  |     ).subscribe((res) => { | ||||||
|  |       if (res) this.st.reload(); | ||||||
|     }); |     }); | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   close(): void { |   close(): void { | ||||||
|     this.modal.destroy(); |     this.modal.destroy(); | ||||||
|   } |   } | ||||||
|  |  | ||||||
|  |   reset() { | ||||||
|  |     this.sf.reset(); | ||||||
|  |     this.st.load(1); | ||||||
|  |   } | ||||||
| } | } | ||||||
|  | |||||||
| @ -288,7 +288,7 @@ export class SupplyManagementVehicleComponent implements OnInit { | |||||||
|           }, |           }, | ||||||
|           { |           { | ||||||
|             text: '重新指派', |             text: '重新指派', | ||||||
|             // click: (_record) => this.assignedCar(_record), |             click: (_record) => this.assignedCar(_record), | ||||||
|             // iif: item =>  item.auditStatus === 2, |             // iif: item =>  item.auditStatus === 2, | ||||||
|           }, |           }, | ||||||
|         ], |         ], | ||||||
| @ -377,17 +377,28 @@ export class SupplyManagementVehicleComponent implements OnInit { | |||||||
|   /** |   /** | ||||||
|   * 重新指派 |   * 重新指派 | ||||||
|   */ |   */ | ||||||
|   assignedCar(item: any) { |    assignedCar(item: any) { | ||||||
|  |     const { resourceId } = item; | ||||||
|     const modalRef = this.modal.create({ |     const modalRef = this.modal.create({ | ||||||
|       nzTitle: '指派熟车', |       nzTitle: '指派熟车', | ||||||
|       nzWidth: '800px', |       nzWidth: '1200px', | ||||||
|       nzContent: SupplyManagementAssignedCarComponent, |       nzContent: SupplyManagementAssignedCarComponent, | ||||||
|       nzComponentParams: { |       nzComponentParams: { | ||||||
|         i: item, |         i: item, | ||||||
|  |         status: 'anew', | ||||||
|  |         // url: this.service.$api_save_assign_vehicle, | ||||||
|  |         params: { resourceId } | ||||||
|       }, |       }, | ||||||
|       nzFooter: null, |       nzFooter: null, | ||||||
|  |  | ||||||
|  |     }); | ||||||
|  |     modalRef.afterClose.subscribe((result) => { | ||||||
|  |       if (result) { | ||||||
|  |         this.st.reload(); | ||||||
|  |       } | ||||||
|     }); |     }); | ||||||
|   } |   } | ||||||
|  |  | ||||||
|    /** |    /** | ||||||
|   * 审核 |   * 审核 | ||||||
|   */ |   */ | ||||||
|  | |||||||
| @ -1,7 +1,7 @@ | |||||||
| /* | /* | ||||||
|  * @Author: your name |  * @Author: your name | ||||||
|  * @Date: 2021-12-03 11:10:14 |  * @Date: 2021-12-03 11:10:14 | ||||||
|  * @LastEditTime: 2021-12-20 13:38:26 |  * @LastEditTime: 2021-12-21 11:04:45 | ||||||
|  * @LastEditors: Please set LastEditors |  * @LastEditors: Please set LastEditors | ||||||
|  * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE |  * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE | ||||||
|  * @FilePath: \tms-obc-web\src\app\routes\supply-management\supply-management.module.ts |  * @FilePath: \tms-obc-web\src\app\routes\supply-management\supply-management.module.ts | ||||||
| @ -26,6 +26,8 @@ import { PublishchooseFamifiarAddComponent } from './components/choose-famifiar/ | |||||||
| import { SupplyManagementBulkPublishComponent } from './components/bulk-publish/bulk-publish.component'; | import { SupplyManagementBulkPublishComponent } from './components/bulk-publish/bulk-publish.component'; | ||||||
| import { PublishAddressListComponent } from './components/onecar-publish/address-list/address-list.component'; | import { PublishAddressListComponent } from './components/onecar-publish/address-list/address-list.component'; | ||||||
| import { PublishSuccessComponent } from './components/onecar-publish/publish-success/publish-success.component'; | import { PublishSuccessComponent } from './components/onecar-publish/publish-success/publish-success.component'; | ||||||
|  | import { CarAddDriverComponent } from './components/add-driver/add-driver.component'; | ||||||
|  | import { CarAddmodalComponent } from './components/addmodal/addmodal.component'; | ||||||
|  |  | ||||||
|  |  | ||||||
| const COMPONENTS: Type<void>[] = [ | const COMPONENTS: Type<void>[] = [ | ||||||
| @ -45,8 +47,9 @@ const COMPONENTS: Type<void>[] = [ | |||||||
|   PublishchooseFamifiarAddComponent, |   PublishchooseFamifiarAddComponent, | ||||||
|   SupplyManagementBulkPublishComponent, |   SupplyManagementBulkPublishComponent, | ||||||
|   PublishAddressListComponent, |   PublishAddressListComponent, | ||||||
|   PublishSuccessComponent |   PublishSuccessComponent, | ||||||
|    |   CarAddDriverComponent, | ||||||
|  |   CarAddmodalComponent | ||||||
| ]; | ]; | ||||||
|  |  | ||||||
| @NgModule({ | @NgModule({ | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user