diff --git a/src/app/routes/usercenter/components/driver/captain/add/add.component.html b/src/app/routes/usercenter/components/driver/captain/add/add.component.html new file mode 100644 index 00000000..77904f23 --- /dev/null +++ b/src/app/routes/usercenter/components/driver/captain/add/add.component.html @@ -0,0 +1,30 @@ + +
+ + +
+
+
正面照
+
示例
+
+
+
+
+ +
+
+
背面照
+
示例
+
+
+
+
+
+
+ diff --git a/src/app/routes/usercenter/components/driver/captain/add/add.component.less b/src/app/routes/usercenter/components/driver/captain/add/add.component.less new file mode 100644 index 00000000..bfa10586 --- /dev/null +++ b/src/app/routes/usercenter/components/driver/captain/add/add.component.less @@ -0,0 +1,36 @@ +.pr { + position: relative; + } + + .pa { + position: absolute; + top: 35px; + left: 150px; + img{border: solid 1px #ebf0fb;} + } + + .tips { + display: flex; + margin-bottom: 0; + color: #333; + + dt { + width: 150px; + } + + dd { + width: 190px; + margin-bottom: 0; + text-align: center; + } + } + :host{ + ::ng-deep { + .ant-input-borderless{ + padding: 0; + padding-top: 4px; + color: black; + resize:none; + } + } + } \ No newline at end of file diff --git a/src/app/routes/usercenter/components/driver/captain/add/add.component.spec.ts b/src/app/routes/usercenter/components/driver/captain/add/add.component.spec.ts new file mode 100644 index 00000000..763d7784 --- /dev/null +++ b/src/app/routes/usercenter/components/driver/captain/add/add.component.spec.ts @@ -0,0 +1,24 @@ +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { CtcCaptatinAddComponent } from './add.component'; + +describe('CtcCaptatinAddComponent', () => { + let component: CtcCaptatinAddComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ CtcCaptatinAddComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(CtcCaptatinAddComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/usercenter/components/driver/captain/add/add.component.ts b/src/app/routes/usercenter/components/driver/captain/add/add.component.ts new file mode 100644 index 00000000..be248207 --- /dev/null +++ b/src/app/routes/usercenter/components/driver/captain/add/add.component.ts @@ -0,0 +1,384 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { apiConf } from '@conf/api.conf'; +import { SFComponent, SFSchema, SFUISchema, SFUploadWidgetSchema } from '@delon/form'; +import { _HttpClient } from '@delon/theme'; +import { EAEnvironmentService } from '@shared'; +import { NzModalRef } from 'ng-zorro-antd/modal'; +import { Observable, Observer } from 'rxjs'; +import { UsermanageService } from 'src/app/routes/usercenter/services/usercenter.service'; + + +@Component({ + selector: 'app-ctc-add', + templateUrl: './add.component.html', + styleUrls: ['./add.component.less'] +}) +export class CtcCaptatinAddComponent implements OnInit { + @ViewChild('sf', { static: false }) + sf!: SFComponent; + record: any = {}; + i: any; + schema!: SFSchema; + ui!: SFUISchema; + readFlag = false; + detailData: any = { + bankCardNo: '', + bankName: '', + mobile: '', + remark: '', + identityInfoDTO: { + certificatePhotoBackWatermark: '', + certificatePhotoFrontWatermark: '', + certificatePhotoFront: '', + certificatePhotoBack: '', + certificateNumber: '', + name: '', + } + } + + constructor( + private modal: NzModalRef, + private envSrv: EAEnvironmentService, + public service: UsermanageService + ) { } + + ngOnInit(): void { + this.initData() + this.initSF(); + } + initData() { + if (this.i && this.i.id) { + this.service.request(this.service.$api_captainrDetail, { id: this.i.id }).subscribe(res => { + if (res) { + this.detailData = res + this.detailData.identityInfoDTO.certificatePhotoFrontWatermark = [ + { + uid: -1, + name: 'LOGO', + status: 'done', + url: this.detailData.identityInfoDTO.certificatePhotoFrontWatermark, + response: this.detailData.identityInfoDTO.certificatePhotoFrontWatermark, + }, + ]; + this.detailData.identityInfoDTO.certificatePhotoBackWatermark = [ + { + uid: -1, + name: 'LOGO', + status: 'done', + url: this.detailData.identityInfoDTO.certificatePhotoBackWatermark, + response: this.detailData.identityInfoDTO.certificatePhotoBackWatermark, + }, + ]; + this.initSF(); + } + }) + } + + } + initSF() { + this.schema = { + properties: { + mobile: { + title: '手机号', + type: 'string', + format: 'mobile', + maxLength: 11, + ui: { + widget: this.i.id ? 'text' : '', + placeholder: '请输入手机号', + blur: () => { + this.service.request(this.service.$api_getByMobile, { mobile: this.sf.value.mobile }).subscribe(res => { + if (res.certificateNumber) { + this.readFlag = true + this.detailData = { + ...res, + mobile: this.sf.value.mobile, + bankName: this.sf.value.bankName, + bankCardNo: this.sf.value.bankCardNo, + remark: this.sf.value.remark, + identityInfoDTO: { + certificatePhotoFrontWatermark: [ + { + uid: -1, + name: 'LOGO', + status: 'done', + url: res.certificatePhotoFrontWatermark, + response: res.certificatePhotoFrontWatermark, + }], + certificatePhotoBackWatermark: [ + { + uid: -1, + name: 'LOGO', + status: 'done', + url: res.certificatePhotoBackWatermark, + response: res.certificatePhotoBackWatermark, + }], + name: res.name, + certificateNumber: res.certificateNumber, + certificatePhotoFront: res.certificatePhotoFront, + certificatePhotoBack: res.certificatePhotoBack, + } + } + this.initSF() + } else { + this.readFlag = false + this.detailData = {} + } + }) + } + }, + default: this.detailData.mobile + }, + name: { + title: '姓名', + type: 'string', + ui: { + widget: this.i.id ? 'text' : '', + placeholder: '请输入姓名', + }, + readOnly: this.readFlag, + default: this.detailData.identityInfoDTO.name + }, + bankCardNo: { + title: '银行卡号', + type: 'string', + ui: { + widget: this.i.id ? 'text' : '', + placeholder: '请输入银行卡号', + change: (val: any) =>{ + const value = val.replace(/\D/g,'') + this.sf.setValue('/bankCardNo', value) + }, + errors: { + required: '请输入银行账号', + }, + }, + default: this.detailData.bankCardNo + }, + bankName: { + title: '开户行', + type: 'string', + ui: { + widget: this.i.id ? 'text' : '', + placeholder: '请输入开户行', + }, + default: this.detailData.bankName + }, + showName: { + title: '身份证照片', + type: 'string', + readOnly: true, + ui: { + widget: 'textarea', + showRequired: true, + borderless:true, + }, + default: '请上传身份证原件的高清照片,若上传复印件,则需加盖公司印章及法人签字;上传后系统会自动识别并填写', + }, + tipsA: { + title: '', + type: 'string', + ui: { + widget: 'custom', + offsetControl: 6, + }, + }, + certificatePhotoFrontWatermark: { + type: 'string', + title: '', + readOnly: this.i.id || this.readFlag, + 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: any) => { + if (args.type === 'success') { + this.detailData.certificatePhotoFront = args.file.response.data.fullFilePath + this.checkIdCard(args.file.response.data.fullFilePath, 'front'); + } else { + this.detailData.certificatePhotoFront = '' + } + }, + beforeUpload: (file: any, _fileList: any) => { + return new Observable((observer: Observer) => { + const isLt2M = file.size / 1024 / 1024 < 2; + if (!isLt2M) { + this.service.msgSrv.warning('图片大小超过2M!'); + observer.complete(); + return; + } + observer.next(isLt2M); + observer.complete(); + }); + }, + previewFile: (file: any) => { } + }, + default: this.detailData.identityInfoDTO.certificatePhotoFrontWatermark + }, + tipsB: { + title: '', + type: 'string', + ui: { + widget: 'custom', + offsetControl: 6, + }, + }, + certificatePhotoBackWatermark: { + type: 'string', + title: '', + readOnly: this.i.id || this.readFlag, + 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: any) => { + if (args.type === 'success') { + this.detailData.certificatePhotoBack = args.file.response.data.fullFilePath + } else { + this.detailData.certificatePhotoBack = '' + } + }, + beforeUpload: (file: any, _fileList: any) => { + return new Observable((observer: Observer) => { + const isLt2M = file.size / 1024 / 1024 < 2; + if (!isLt2M) { + this.service.msgSrv.warning('图片大小超过2M!'); + observer.complete(); + return; + } + observer.next(isLt2M); + observer.complete(); + }); + }, + previewFile: (file: any) => { } + }, + default: this.detailData.identityInfoDTO.certificatePhotoBackWatermark + }, + certificateNumber: { + title: '身份证号', + type: 'string', + readOnly: this.readFlag, + ui: { + widget: this.i.id ? 'text' : '', + placeholder: '请输入身份证号', + }, + default: this.detailData.identityInfoDTO.certificateNumber + }, + remark: { + title: '备注', + type: 'string', + maxLength: 100, + ui: { + widget: this.i.id ? 'text' : 'textarea', + placeholder: '请输入备注', + autosize: { minRows: 2, maxRows: 6 }, + }, + default: this.detailData.remark + }, + }, + required: ['name', 'mobile', 'bankCardNo', 'certificateNumber', 'certificatePhotoBackWatermark', 'certificatePhotoFrontWatermark'], + }; + this.ui = { + '*': { + spanLabelFixed: 120, + grid: { span: 24 }, + }, + }; + // setTimeout(() => { + // if (this.readFlag) { + // this.detailData.identityInfoDTO.certificatePhotoFrontWatermark = [ + // { + // uid: -1, + // name: 'LOGO', + // status: 'done', + // url: this.detailData.certificatePhotoFrontWatermark, + // response: this.detailData.certificatePhotoFrontWatermark, + // }, + // ]; + // this.detailData.identityInfoDTO.certificatePhotoBackWatermark = [ + // { + // uid: -1, + // name: 'LOGO', + // status: 'done', + // url: this.detailData.certificatePhotoBackWatermark, + // response: this.detailData.certificatePhotoBackWatermark, + // }, + // ]; + // this.sf.setValue('/mobile', this.detailData.mobile) + // this.sf.setValue('/name', this.detailData.name) + // this.sf.setValue('/certificateNumber', this.detailData.certificateNumber) + // this.sf.setValue('/certificatePhotoFrontWatermark', this.detailData.identityInfoDTO.certificatePhotoFrontWatermark) + // this.sf.setValue('/certificatePhotoBackWatermark', this.detailData.identityInfoDTO.certificatePhotoBackWatermark) + // } + // }, 500) + + } + + checkIdCard(imgurl: any, side: any) { + // 识别身份证 参数side:0-正面、1-背面;type:0-申请人身份证,1-法定代表人身份证 + const params = { + idCardUrl: imgurl, + side, + }; + this.service.request(this.service.$api_checkIdCard, params).subscribe((res) => { + if (res) { + this.sf.setValue('/name', res.name); + this.sf.setValue('/certificateNumber', res.number); + } + }); + } + close(): void { + this.modal.destroy(); + } + sure() { + const params: any = { + bankCardNo: this.sf.value.bankCardNo, + bankName: this.sf.value.bankName, + mobile: this.sf.value.mobile, + remark: this.sf.value.remark, + identityInfoDTO: { + certificatePhotoBackWatermark: this.sf.value.certificatePhotoBackWatermark, + certificatePhotoFrontWatermark: this.sf.value.certificatePhotoFrontWatermark, + certificatePhotoFront: this.detailData.certificatePhotoFront, + certificatePhotoBack: this.detailData.certificatePhotoBack, + certificateNumber: this.sf.value.certificateNumber, + name: this.sf.value.name, + } + } + if (this.i.id) { + params.id = this.i.id + } + delete params.showName + this.service.request(this.service.$api_saveCaptainr, params).subscribe(res => { + if (res) { + this.service.msgSrv.success('保存成功') + this.modal.close(true) + } + }) + + } +} diff --git a/src/app/routes/usercenter/components/driver/captain/captain.component.html b/src/app/routes/usercenter/components/driver/captain/captain.component.html index 273281de..6c22cbdc 100644 --- a/src/app/routes/usercenter/components/driver/captain/captain.component.html +++ b/src/app/routes/usercenter/components/driver/captain/captain.component.html @@ -1,10 +1,10 @@ @@ -16,8 +16,24 @@
- - + + +
+ + [loading]="service.http.loading" + > - - {{ item.promotersTelephone ||'添加' }} + + {{ item.promotersTelephone || '添加' }} -
@@ -52,4 +74,4 @@
-
\ No newline at end of file + diff --git a/src/app/routes/usercenter/components/driver/captain/captain.component.ts b/src/app/routes/usercenter/components/driver/captain/captain.component.ts index 239ffc5a..123aaa9d 100644 --- a/src/app/routes/usercenter/components/driver/captain/captain.component.ts +++ b/src/app/routes/usercenter/components/driver/captain/captain.component.ts @@ -2,9 +2,11 @@ import { Component, OnInit, ViewChild } from '@angular/core'; import { ActivatedRoute, Router } from '@angular/router'; import { STColumn, STColumnBadge, STComponent, STData } from '@delon/abc/st'; import { SFComponent, SFSchema, SFUISchema } from '@delon/form'; +import { ModalHelper } from '@delon/theme'; import { DynamicSettingModalComponent } from '@shared'; import { NzModalService } from 'ng-zorro-antd/modal'; import { UsermanageService } from '../../../services/usercenter.service'; +import { CtcCaptatinAddComponent } from './add/add.component'; @Component({ selector: 'app-usercenter-components-driver-captain', templateUrl: './captain.component.html', @@ -23,7 +25,7 @@ export class UserCenterComponentsDriverCaptainComponent implements OnInit { promoterModal!: any; promotersTelephone = ''; - constructor(public service: UsermanageService, private modal: NzModalService, private router: Router, private ar: ActivatedRoute) {} + constructor(public service: UsermanageService, private modal: NzModalService, private router: Router, private ar: ActivatedRoute, private modalHelper: ModalHelper,) {} /** * 查询参数 @@ -218,15 +220,23 @@ export class UserCenterComponentsDriverCaptainComponent implements OnInit { click: item => { this.router.navigate(['/usercenter/driver/captain/detail', item.appUserId]); }, - acl: { ability: ['USERCENTER-DRIVER-CAPTAIN-view'] }, + acl: { ability: ['USERCENTER-DRIVER-CAPTAIN-view'] } }, { text: '基础设置', click: item => this.settingAction(item), - acl: { ability: ['USERCENTER-DRIVER-CAPTAIN-basicSetting'] }, + acl: { ability: ['USERCENTER-DRIVER-CAPTAIN-basicSetting'] } } ] } ]; } + /** + * 新增单个实例 + */ + add() { + this.modalHelper.create(CtcCaptatinAddComponent, { i: { id: '' } }, { size: 900 }).subscribe(res => { + this.st.reload(); + }); + } } diff --git a/src/app/routes/usercenter/services/usercenter.service.ts b/src/app/routes/usercenter/services/usercenter.service.ts index ab814107..a9017fb5 100644 --- a/src/app/routes/usercenter/services/usercenter.service.ts +++ b/src/app/routes/usercenter/services/usercenter.service.ts @@ -1,10 +1,10 @@ /* * @Author: your name * @Date: 2021-11-29 15:22:34 - * @LastEditTime: 2022-01-05 10:30:26 - * @LastEditors: Please set LastEditors + * @LastEditTime : 2022-02-16 09:55:50 + * @LastEditors : Shiming * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE - * @FilePath: \tms-obc-web\src\app\routes\usercenter\services\usercenter.service.ts + * @FilePath : \\tms-obc-web\\src\\app\\routes\\usercenter\\services\\usercenter.service.ts */ import { Injectable, Injector } from '@angular/core'; import { cacheConf } from '@conf/cache.conf'; @@ -115,6 +115,13 @@ export class UsermanageService extends ShipperBaseService { $api_getRegionByCode = '/api/mdc/pbc/region/getRegionByCode'; // 新增熟车 $api_enterpriseVehicleSave = `/api/mdc/cuc/enterpriseVehicle/save`; + + // 结算单-新增车队长 + $api_saveCaptainr = '/api/mdc/cuc/enterpriseSettleDriver/saveCaptainr'; + // 结算单-车队长详情 + $api_captainrDetail = '/api/mdc/cuc/enterpriseSettleDriver/captainrDetail'; + // 根据手机号码查询结算单司机 + $api_getByMobile = '/api/mdc/cuc/identityInfo/getByMobile'; constructor(public injector: Injector, private nzModalService: NzModalService, public eaCacheSrv: EACacheService) { super(injector, eaCacheSrv); } diff --git a/src/app/routes/usercenter/usercenter.module.ts b/src/app/routes/usercenter/usercenter.module.ts index dd8d6579..b79e4650 100644 --- a/src/app/routes/usercenter/usercenter.module.ts +++ b/src/app/routes/usercenter/usercenter.module.ts @@ -23,6 +23,7 @@ import { UsercenterRoutingModule } from './usercenter-routing.module'; import { AuditAdminComponent } from './components/freight/enterprise-audit/audit-admin/audit-admin.component'; import { CaptainDetailComponent } from './components/driver/captain/captain-detail/captain-detail.component'; import { CarSettleAddDriverComponent } from './components/driver/add-driver/add-driver.component'; +import { CtcCaptatinAddComponent } from './components/driver/captain/add/add.component'; const COMPONENTS = [ FreightComponentsListComponent, @@ -38,7 +39,8 @@ const COMPONENTS = [ UserCenterComponentsDriverCaptainComponent, CaptainDetailComponent, AuditAdminComponent, - CarSettleAddDriverComponent + CarSettleAddDriverComponent, + CtcCaptatinAddComponent ]; @NgModule({ diff --git a/src/app/routes/vehicle/components/list/carauth/carauth.component.html b/src/app/routes/vehicle/components/list/carauth/carauth.component.html new file mode 100644 index 00000000..150b90d0 --- /dev/null +++ b/src/app/routes/vehicle/components/list/carauth/carauth.component.html @@ -0,0 +1,43 @@ + + + +
+ + +
+
+
行驶证首页
+
示例
+
+
+
+
+ +
+
+
行驶证副页
+
示例
+
+
+
+
+
+ + + +
+ \ No newline at end of file diff --git a/src/app/routes/vehicle/components/list/carauth/carauth.component.less b/src/app/routes/vehicle/components/list/carauth/carauth.component.less new file mode 100644 index 00000000..e3f1fc3f --- /dev/null +++ b/src/app/routes/vehicle/components/list/carauth/carauth.component.less @@ -0,0 +1,123 @@ +.sfBox { + position: relative; + .example { + position: absolute; + top: 215px; + right: 265px; + color: #1890ff; + cursor: pointer; + .popBox { + position: absolute; + top: -170px; + left: -125px; + width: 300px; + padding: 20px; + text-align: center; + background: #fff; + border: solid 1px #eee; + border-radius: 6px; + box-shadow: 0 1px 5px 1px #ececec; + &::before { + position: absolute; + bottom: -5px; + left: 50%; + width: 10px; + height: 10px; + margin-left: -5px; + background: #fff; + box-shadow: 0 1px 5px 1px #ececec; + transform: rotate(45deg); + content: ''; + } + &::after { + position: absolute; + bottom: 0; + left: 0; + z-index: 10; + width: 100%; + height: 10px; + background: #fff; + content: ''; + } + img { + max-width: 100%; + max-height: 200px; + } + } + } + .positionSet{ + top: 356px; + right: 235px; + } + .positionSet01{ + top: 500px; + right: 200px; + } + .positionSet02{ + top: 664px; + right: 265px; + } + .positionSet03{ + top: 808px; + right: 205px; + + } +} +.exaA{ + position: absolute; + top: 0; + left: 300px +} +.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; + } +} +.drivercard{ + position: absolute; + top: 0; + left: 330px; + border: solid 1px #ebf0fb; +} +.jopcard{ + position: absolute; + top: 1356px; + left: 330px; + border: solid 1px #ebf0fb; +} +.agreement{ + position: absolute; + top: 425px; + left: 330px; + border: solid 1px #ebf0fb; +} +:host{ + ::ng-deep { + .ant-input-borderless{ + padding: 0; + padding-top: 4px; + color: black; + resize:none; + } + } + } \ No newline at end of file diff --git a/src/app/routes/vehicle/components/list/carauth/carauth.component.spec.ts b/src/app/routes/vehicle/components/list/carauth/carauth.component.spec.ts new file mode 100644 index 00000000..3d248eed --- /dev/null +++ b/src/app/routes/vehicle/components/list/carauth/carauth.component.spec.ts @@ -0,0 +1,24 @@ +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { CarSettleCarauthComponent } from './carauth.component'; + +describe('CarSettleCarauthComponent', () => { + let component: CarSettleCarauthComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ CarSettleCarauthComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(CarSettleCarauthComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/vehicle/components/list/carauth/carauth.component.ts b/src/app/routes/vehicle/components/list/carauth/carauth.component.ts new file mode 100644 index 00000000..29126791 --- /dev/null +++ b/src/app/routes/vehicle/components/list/carauth/carauth.component.ts @@ -0,0 +1,651 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { apiConf } from '@conf/api.conf'; +import { cacheConf } from '@conf/cache.conf'; +import { SFUISchema, SFSchema, SFUploadWidgetSchema, SFComponent, SFSelectWidgetSchema } from '@delon/form'; +import { _HttpClient } from '@delon/theme'; +import { EACacheService, EAEnvironmentService } from '@shared'; +import { NzModalRef } from 'ng-zorro-antd/modal'; +import { NzUploadFile } from 'ng-zorro-antd/upload'; +import { Observable, Observer, of } from 'rxjs'; +import { VehicleService } from '../../../services/vehicle.service'; + +@Component({ + selector: 'app-car-carauth', + templateUrl: './carauth.component.html', + styleUrls: ['./carauth.component.less'] +}) +export class CarSettleCarauthComponent implements OnInit { + @ViewChild('sf', { static: false }) sf!: SFComponent; + record: any = {}; + i: any; + ui: SFUISchema = {}; + schema: SFSchema = {}; + showCardFlag = false; + showJopFlag = false; + companyData: any = {}; + detailData: any = {}; + carNo = ''; + + constructor( + private modal: NzModalRef, + public service: VehicleService, + private envSrv: EAEnvironmentService, + private eaCacheSrv: EACacheService + ) {} + + ngOnInit(): void { + console.log(this.i) + this.initData(); + this.initSF(); + } + initData() { + if (this.i?.id) { + this.companyData = this.eaCacheSrv.get(cacheConf.env); + const params = { + id: this.i?.id + }; + this.service.request(this.service.$api_shipperCarGet, params).subscribe(res => { + this.detailData = res; + this.detailData.isSelf = res.isSelf ? 1 : 0; + this.detailData.isTrailer = res.isTrailer ? 1 : 0; + this.detailData.carFrontPhotoWatermark = [ + { + uid: -1, + name: 'LOGO', + status: 'done', + url: this.detailData.carFrontPhotoWatermark, + response: this.detailData.carFrontPhotoWatermark + } + ]; + this.detailData.carProtocalWatermark = [ + { + uid: -1, + name: 'LOGO', + status: 'done', + url: this.detailData.carProtocalWatermark, + response: this.detailData.carProtocalWatermark + } + ]; + this.detailData.certificatePhotoFrontWatermark = [ + { + uid: -1, + name: 'LOGO', + status: 'done', + url: this.detailData.certificatePhotoFrontWatermark, + response: this.detailData.certificatePhotoFrontWatermark + } + ]; + this.detailData.certificatePhotoBackWatermark = [ + { + uid: -1, + name: 'LOGO', + status: 'done', + url: this.detailData.certificatePhotoBackWatermark, + response: this.detailData.certificatePhotoBackWatermark + } + ]; + this.detailData.roadTransportPhotoWatermark = [ + { + uid: -1, + name: 'LOGO', + status: 'done', + url: this.detailData.roadTransportPhotoWatermark, + response: this.detailData.roadTransportPhotoWatermark + } + ]; + }); + } + } + initSF() { + this.schema = { + properties: { + carFrontPhotoWatermark: { + 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。', + data: { + appId: this.envSrv.env.appId + }, + name: 'multipartFile', + multiple: false, + listType: 'picture-card', + change: (args: any) => { + if (args.type === 'success') { + this.detailData.carFrontPhoto = args.file.response.data.fullFilePath; + } + }, + beforeUpload: (file: any, _fileList: any) => { + return new Observable((observer: Observer) => { + const isLt2M = file.size / 1024 / 1024 < 2; + if (!isLt2M) { + this.service.msgSrv.warning('图片大小超过2M!'); + observer.complete(); + return; + } + observer.next(isLt2M); + observer.complete(); + }); + }, + // previewFile: (file: NzUploadFile) => of(file.url) + } + }, + carNo: { + title: '车牌号', + maxLength: 9, + type: 'string', + ui: { + placeholder: '请输入' + } + }, + carNoColor: { + title: '车牌颜色', + type: 'string', + ui: { + widget: 'dict-select', + params: { dictKey: 'car:color' }, + placeholder: '请选择车型', + containsAllLabel: false + } as SFSelectWidgetSchema + }, + carModel: { + title: '车型', + type: 'string', + ui: { + widget: 'dict-select', + params: { dictKey: 'car:model' }, + placeholder: '请选择车型', + containsAllLabel: false + } as SFSelectWidgetSchema + }, + carLength: { + title: '车长', + type: 'string', + ui: { + widget: 'dict-select', + params: { dictKey: 'car:length' }, + placeholder: '请选择车长', + containsAllLabel: false + } as SFSelectWidgetSchema + }, + carLoad: { + title: '载重', + type: 'string', + maxLength: 6, + ui: { + placeholder: '请输入', + change: (val: any) => { + const value = val.replace(/\D/g, ''); + this.sf.setValue('/carLoad', value); + } + } + }, + isSelf: { + title: '是否挂靠', + type: 'string', + enum: [ + { label: '否', value: 0 }, + { label: '是', value: 1 } + ], + ui: { + widget: 'select', + placeholder: '请选择' + } + }, + isTrailer: { + title: '是否为挂车', + type: 'string', + enum: [ + { label: '否', value: 0 }, + { label: '是', value: 1 } + ], + ui: { + widget: 'select', + placeholder: '请选择' + } + }, + carProtocalWatermark: { + 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。', + data: { + appId: this.envSrv.env.appId + }, + name: 'multipartFile', + multiple: false, + listType: 'picture-card', + change: (args: any) => { + if (args.type === 'success') { + this.detailData.certificatePhotoFront = args.file.response.data.fullFilePath; + } + }, + beforeUpload: (file: any, _fileList: any) => { + return new Observable((observer: Observer) => { + const isLt2M = file.size / 1024 / 1024 < 2; + if (!isLt2M) { + this.service.msgSrv.warning('图片大小超过2M!'); + observer.complete(); + return; + } + observer.next(isLt2M); + observer.complete(); + }); + }, + // previewFile: (file: NzUploadFile) => of(file.url) + } + }, + titleA: { + title: '行驶证信息(必填)', + type: 'string', + ui: { + widget: 'text' + }, + default: '照片上传后会自动识别文字并填充下列内容栏' + }, + tipsA: { + title: '', + type: 'string', + ui: { + widget: 'custom', + offsetControl: 6 + } + }, + certificatePhotoFrontWatermark: { + 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: any) => { + if (args.type === 'success') { + this.detailData.certificatePhotoFront = args.file.response.data.fullFilePath; + this.checkCarCard(args.file.response.data.fullFilePath, 'front'); + } else { + this.detailData.certificatePhotoFront = ''; + } + }, + beforeUpload: (file: any, _fileList: any) => { + return new Observable((observer: Observer) => { + const isLt2M = file.size / 1024 / 1024 < 2; + if (!isLt2M) { + this.service.msgSrv.warning('图片大小超过2M!'); + observer.complete(); + return; + } + observer.next(isLt2M); + observer.complete(); + }); + }, + // previewFile: (file: NzUploadFile) => of(file.url) + } + }, + tipsB: { + title: '', + type: 'string', + ui: { + widget: 'custom', + offsetControl: 6 + } + }, + certificatePhotoBackWatermark: { + 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。', + data: { + appId: this.envSrv.env.appId + }, + name: 'multipartFile', + multiple: false, + listType: 'picture-card', + change: (args: any) => { + if (args.type === 'success') { + this.detailData.certificatePhotoBack = args.file.response.data.fullFilePath; + this.checkCarCard(args.file.response.data.fullFilePath, 'back'); + } else { + this.detailData.certificatePhotoBack = ''; + } + }, + beforeUpload: (file: any, _fileList: any) => { + return new Observable((observer: Observer) => { + const isLt2M = file.size / 1024 / 1024 < 2; + if (!isLt2M) { + this.service.msgSrv.warning('图片大小超过2M!'); + observer.complete(); + return; + } + observer.next(isLt2M); + observer.complete(); + }); + }, + // previewFile: (file: NzUploadFile) => of(file.url) + } + }, + driverLicenseRegisterTime: { + title: '行驶证注册日期', + type: 'string', + format: 'date', + ui: { + placeholder: '请输入' + } + }, + driverLicenseGetTime: { + title: '行驶证发证日期', + type: 'string', + format: 'date', + ui: { + placeholder: '请输入' + } + }, + driverLicenseEndTime: { + title: '行驶证到期日期', + type: 'string', + format: 'date', + maxLength: 30, + ui: { + placeholder: '请输入' + } + }, + driverLicenseSigningOrg: { + title: '行驶证签发机关', + type: 'string', + maxLength: 30, + ui: { + placeholder: '请输入' + } + }, + carDistinguishCode: { + title: '车辆识别代码', + type: 'string', + maxLength: 30, + ui: { + placeholder: '请输入' + } + }, + useNature: { + title: '使用性质', + type: 'string', + maxLength: 30, + enum: [ + { label: '非营运', value: 0 }, + { label: '营运', value: 1 } + ], + ui: { + widget: 'select', + placeholder: '请选择' + } + }, + curbWeight: { + title: '整备质量', + type: 'string', + ui: { + placeholder: '请输入' + } + }, + carOwner: { + title: '所有人', + type: 'string', + maxLength: 30, + ui: { + placeholder: '请输入' + } + }, + titleB: { + title: '道运证(选填)', + type: 'string', + ui: { + widget: 'text' + }, + default: '照片上传后会自动识别文字并填充下列内容栏' + }, + roadTransportPhotoWatermark: { + 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。蓝牌绿牌车辆,可不用传道运证', + data: { + appId: this.envSrv.env.appId + }, + name: 'multipartFile', + multiple: false, + listType: 'picture-card', + change: (args: any) => { + if (args.type === 'success') { + this.detailData.roadTransportPhoto = args.file.response.data.fullFilePath; + this.checkTransCard(args.file.response.data.fullFilePath); + } else { + this.detailData.roadTransportPhoto = ''; + } + }, + beforeUpload: (file: any, _fileList: any) => { + return new Observable((observer: Observer) => { + const isLt2M = file.size / 1024 / 1024 < 2; + if (!isLt2M) { + this.service.msgSrv.warning('图片大小超过2M!'); + observer.complete(); + return; + } + observer.next(isLt2M); + observer.complete(); + }); + }, + // previewFile: (file: NzUploadFile) => of(file.url) + } + }, + roadTransportNo: { + title: '道运证号码', + type: 'string', + maxLength: 30, + ui: { + // widget: this.detailData.commitFlag !== 0 ? 'text' : '', + placeholder: '请输入' + } + }, + roadTransportLicenceNo: { + title: '经营许可证号', + type: 'string', + maxLength: 30, + ui: { + // widget: this.detailData.commitFlag !== 0 ? 'text' : '', + placeholder: '请输入' + } + }, + roadTransportStartTime: { + title: '发证日期', + type: 'string', + format: 'date', + ui: { + placeholder: '请输入' + } + }, + roadTransportEndTime: { + title: '有效期至', + type: 'string', + format: 'date', + ui: { + placeholder: '请输入' + } + } + }, + required: [ + 'carFrontPhotoWatermark', + 'carNo', + 'carNoColor', + 'carModel', + 'carLength', + 'carLoad', + 'isSelf', + 'isTrailer', + 'certificatePhotoFrontWatermark', + 'certificatePhotoBackWatermark', + 'driverLicenseRegisterTime', + 'driverLicenseGetTime', + 'driverLicenseEndTime', + 'driverLicenseSigningOrg', + 'carDistinguishCode', + 'useNature', + 'carOwner' + ] + }; + + this.ui = { + '*': { + spanLabelFixed: 180, + grid: { span: 18 }, + width: 600 + }, + $title1: { + spanLabelFixed: 0 + }, + $title2: { + spanLabelFixed: 0 + }, + $title3: { + 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 } + } + }; + } + // 道路运输证识别 + checkTransCard(imgurl: any) { + const params = { + transportationLicenseUrl: imgurl + }; + this.service.request(this.service.$api_recognizeTransportationLicense, params).subscribe(res => { + if (res) { + this.sf.setValue('/roadTransportNo', res.number); + this.sf.setValue('/roadTransportLicenceNo', res.businessCertificate); + this.sf.setValue('/roadTransportStartTime', res.issueDate); + if (this.carNo === '') { + this.carNo = res.number; + } else if (this.carNo && res.vehicleNumber.indexOf(this.carNo) === -1) { + this.service.msgSrv.warning('请上传同一认证车辆的相关证件'); + } + } + }); + } + // 行驶证识别 + checkCarCard(imgurl: any, side: any) { + const params = { + vehicleLicenseUrl: imgurl, + side + }; + this.service.request(this.service.$api_recognizeVehicleLicense, params).subscribe(res => { + if (res) { + if (side === 'front') { + // 正面 + this.sf.setValue('/driverLicenseRegisterTime', res.registerDate); + this.sf.setValue('/carNo', res.number); + this.sf.setValue('/driverLicenseGetTime', res.issueDate); + this.sf.setValue('/driverLicenseSigningOrg', res.issuingAuthority); + this.sf.setValue('/carDistinguishCode', res.vin); + this.sf.setValue('/carOwner', res.name); + this.sf.setValue('/useNature', res.useCharacter === '非营运' ? 0 : 1); + } else { + this.sf.setValue('/curbWeight', res.unladenMass); + } + if (this.carNo === '') { + this.carNo = res.number; + } else if (this.carNo && this.carNo !== res.number) { + this.service.msgSrv.warning('请上传同一认证车辆的相关证件'); + } + } + }); + } + + close(): void { + this.modal.destroy(); + } + showExample() { + this.showCardFlag = !this.showCardFlag; + } + showJopExample() { + this.showJopFlag = !this.showJopFlag; + } + submitForm() { + const params: any = { + appUserId: this.i.appUserId, + ...this.sf.value + }; + params.carFrontPhoto = this.detailData.carFrontPhoto; + params.carProtocal = this.detailData.carProtocal; + params.certificatePhotoFront = this.detailData.certificatePhotoFront; + params.certificatePhotoBack = this.detailData.certificatePhotoBack; + params.roadTransportPhoto = this.detailData.roadTransportPhoto; + params.carFrontPhotoWatermark = this.sf.value.carFrontPhotoWatermark.data.fullFilePath + params.carProtocalWatermark = this.sf.value.carProtocalWatermark.data.fullFilePath + params.certificatePhotoBackWatermark = this.sf.value.certificatePhotoBackWatermark.data.fullFilePath + params.certificatePhotoFrontWatermark = this.sf.value.certificatePhotoFrontWatermark.data.fullFilePath + params.roadTransportPhotoWatermark = this.sf.value.roadTransportPhotoWatermark.data.fullFilePath + delete params.titleA; + delete params.titleB; + this.service.request(this.service.$api_saveUpdateShipperCar, params).subscribe(res => { + if (res) { + this.service.msgSrv.success('添加成功'); + this.modal.close(true); + } + }); + } +} diff --git a/src/app/routes/vehicle/components/list/list.component.html b/src/app/routes/vehicle/components/list/list.component.html index 618b5ffd..4179d935 100644 --- a/src/app/routes/vehicle/components/list/list.component.html +++ b/src/app/routes/vehicle/components/list/list.component.html @@ -37,8 +37,11 @@ - - + +
+ +
{ + this.st.load() + }); + } } diff --git a/src/app/routes/vehicle/services/vehicle.service.ts b/src/app/routes/vehicle/services/vehicle.service.ts index 938e65a6..f82bc175 100644 --- a/src/app/routes/vehicle/services/vehicle.service.ts +++ b/src/app/routes/vehicle/services/vehicle.service.ts @@ -13,7 +13,7 @@ import { BaseService } from 'src/app/shared/services/core/base.service'; import { EAFileUtil } from 'src/app/shared/utils/file.util'; @Injectable({ - providedIn: 'root', + providedIn: 'root' }) export class VehicleService extends BaseService { // 查询车辆认证表 @@ -35,28 +35,35 @@ export class VehicleService extends BaseService { // 审核司机挂靠协议(审核列表) $api_get_auditCarProtocal_audit = `/api/mdc/cuc/carLicenseAudit/operate/auditCarProtocal`; - // 更新司机车辆审核信息(审核列表) $api_get_update_audit = `/api/mdc/cuc/carLicenseAudit/operate/update`; // 更新司机车辆审核信息 - $api_get_update= `/api/mdc/cuc/carLicense/operate/update`; + $api_get_update = `/api/mdc/cuc/carLicense/operate/update`; // 上传司机挂靠协议 - $api_get_upLoadCarProtocal= `/api/mdc/cuc/carLicenseAudit/operate/upLoadCarProtocal`; + $api_get_upLoadCarProtocal = `/api/mdc/cuc/carLicenseAudit/operate/upLoadCarProtocal`; // 根据车牌号查询车辆信息(车辆认证表) - $api_get_getCarLicenseListByCarNo= `/api/mdc/cuc/carLicense/findCarLicenseByCarNo`; + $api_get_getCarLicenseListByCarNo = `/api/mdc/cuc/carLicense/findCarLicenseByCarNo`; // /api/mdc/cuc/carLicense/findCarLicenseByCarNo // 根据车牌号查询车辆信息(车辆审核认证表) - $api_get_getCarLicenseListByCarNo_audit= `/api/mdc/cuc/carLicenseAudit/operate/findCarLicenseAuditListByCarNo`; + $api_get_getCarLicenseListByCarNo_audit = `/api/mdc/cuc/carLicenseAudit/operate/findCarLicenseAuditListByCarNo`; // 导出(车辆认证表) - $api_carLicense_export= `/api/mdc/cuc/carLicense/operate/export`; + $api_carLicense_export = `/api/mdc/cuc/carLicense/operate/export`; // 导出(车辆审核认证表) - $api_carLicenseAudit_export= `/api/mdc/cuc/carLicenseAudit/operate/export`; - - + $api_carLicenseAudit_export = `/api/mdc/cuc/carLicenseAudit/operate/export`; + // 获取货主车辆信息 + $api_shipperCarGet = '/api/mdc/shipperCar/get'; + // 根据地区code查询列表 + $api_getRegionByCode = '/api/mdc/pbc/region/getRegionByCode'; + // 道路运输证识别 + $api_recognizeTransportationLicense = '/api/mdc/pbc/hwc/ocr/recognizeTransportationLicense'; + // 行驶证识别 + $api_recognizeVehicleLicense = '/api/mdc/pbc/hwc/ocr/recognizeVehicleLicense'; + // 保存货主车辆关联表 + $api_saveUpdateShipperCar = '/api/mdc/shipperCar/saveUpdateShipperCar'; constructor(public injector: Injector) { super(injector); } diff --git a/src/app/routes/vehicle/vehicle.module.ts b/src/app/routes/vehicle/vehicle.module.ts index ce0609f6..72ab6e09 100644 --- a/src/app/routes/vehicle/vehicle.module.ts +++ b/src/app/routes/vehicle/vehicle.module.ts @@ -10,6 +10,7 @@ import { NgModule } from '@angular/core'; import { SharedModule } from '@shared'; import { VehicleComponentsAuditComponent } from './components/audit/audit.component'; import { VehicleComponentsAuditDetailComponent } from './components/audit/detail/detail.component'; +import { CarSettleCarauthComponent } from './components/list/carauth/carauth.component'; import { VehicleComponentsListDetailComponent } from './components/list/detail/detail.component'; import { VehicleComponentsListEditComponent } from './components/list/edit/edit.component'; import { VehicleImgViewComponent } from './components/list/img-view/img-view.component'; @@ -24,6 +25,7 @@ const COMPONENTS = [ VehicleImgViewComponent, VehicleComponentsAuditComponent, VehicleComponentsAuditDetailComponent, + CarSettleCarauthComponent ]; @NgModule({ diff --git a/src/assets/images/vehicle/agree.png b/src/assets/images/vehicle/agree.png new file mode 100644 index 00000000..53ee1c1a Binary files /dev/null and b/src/assets/images/vehicle/agree.png differ diff --git a/src/assets/images/vehicle/agreement.png b/src/assets/images/vehicle/agreement.png new file mode 100644 index 00000000..fbb98ea9 Binary files /dev/null and b/src/assets/images/vehicle/agreement.png differ diff --git a/src/assets/images/vehicle/car.png b/src/assets/images/vehicle/car.png new file mode 100644 index 00000000..036ac2b4 Binary files /dev/null and b/src/assets/images/vehicle/car.png differ diff --git a/src/assets/images/vehicle/driverback.png b/src/assets/images/vehicle/driverback.png new file mode 100644 index 00000000..8fea60cf Binary files /dev/null and b/src/assets/images/vehicle/driverback.png differ diff --git a/src/assets/images/vehicle/driverfront.png b/src/assets/images/vehicle/driverfront.png new file mode 100644 index 00000000..96d378d6 Binary files /dev/null and b/src/assets/images/vehicle/driverfront.png differ diff --git a/src/assets/images/vehicle/road.png b/src/assets/images/vehicle/road.png new file mode 100644 index 00000000..290a1e26 Binary files /dev/null and b/src/assets/images/vehicle/road.png differ