fix bug
This commit is contained in:
@ -4,7 +4,7 @@
|
||||
* @Author : Shiming
|
||||
* @Date : 2021-12-15 13:17:42
|
||||
* @LastEditors : Shiming
|
||||
* @LastEditTime : 2022-02-24 10:47:39
|
||||
* @LastEditTime : 2022-03-24 19:17:58
|
||||
* @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\modal\\vehicle\\update-freight\\update-freight.component.html
|
||||
* Copyright (C) 2022 huzhenhong. All rights reserved.
|
||||
-->
|
||||
@ -20,7 +20,7 @@
|
||||
</p>
|
||||
<p>
|
||||
<label nz-checkbox [(ngModel)]="aggreechecked"></label>
|
||||
<span> 确认已阅读并知晓 <a target="_blank" [routerLink]="['/agreement']" [queryParams]="{ type: 11 }">《变更协议》</a></span>
|
||||
<span> 确认已阅读并知晓 <a target="_blank" [routerLink]="['/agreement']" [queryParams]="{ type: 3, data: dataJSON }">《变更协议》</a></span>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
* @Author : Shiming
|
||||
* @Date : 2021-12-15 13:17:42
|
||||
* @LastEditors : Shiming
|
||||
* @LastEditTime : 2022-02-23 14:25:45
|
||||
* @LastEditTime : 2022-03-24 19:17:10
|
||||
* @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\modal\\vehicle\\update-freight\\update-freight.component.ts
|
||||
* Copyright (C) 2022 huzhenhong. All rights reserved.
|
||||
*/
|
||||
@ -30,12 +30,16 @@ export class VehicleUpdateFreightComponent implements OnInit {
|
||||
@Input()
|
||||
data: any;
|
||||
|
||||
dataJSON: any;
|
||||
|
||||
calculateSub!: Subscription;
|
||||
|
||||
constructor(private modal: NzModalRef, private msgSrv: NzMessageService, public service: OrderManagementService) {}
|
||||
|
||||
ngOnInit(): void {
|
||||
console.log(this.data)
|
||||
this.dataJSON = JSON.stringify(this.data)
|
||||
console.log(this.dataJSON)
|
||||
this.initSF(this.data);
|
||||
}
|
||||
initSF(data: any) {
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
* @Author : Shiming
|
||||
* @Date : 2022-03-14 14:17:38
|
||||
* @LastEditors : Shiming
|
||||
* @LastEditTime : 2022-03-24 10:12:00
|
||||
* @LastEditTime : 2022-03-24 19:19:17
|
||||
* @FilePath : \\tms-obc-web\\src\\app\\routes\\passport\\components\\order-agreement\\order-agreement.component.ts
|
||||
* Copyright (C) 2022 huzhenhong. All rights reserved.
|
||||
*/
|
||||
@ -20,24 +20,31 @@ import { PassportService } from '../../services/passport.service';
|
||||
export class OrderAgreementComponent implements OnInit {
|
||||
agreementContent: any;
|
||||
type = 2;
|
||||
data : any;
|
||||
constructor(private ar: ActivatedRoute, private service: PassportService) {
|
||||
ar.queryParams.subscribe((params: Params) => {
|
||||
this.type = params.type || 2;
|
||||
console.log(params);
|
||||
|
||||
this.type = params?.type || 2;
|
||||
this.data = JSON.parse(params?.data) || {};
|
||||
});
|
||||
}
|
||||
ngOnInit() {
|
||||
console.log(this.type);
|
||||
if(this.type == 3) {
|
||||
this.service.request(this.service.$api_get_getSupplementaryAgreement, { type: this.type }).subscribe(res => {
|
||||
console.log(this.data);
|
||||
|
||||
this.service.request(this.service.$api_get_getSupplementaryAgreement, { billId: this.data?.billId, billCode: this.data?.billCode }).subscribe(res => {
|
||||
if (res) {
|
||||
this.agreementContent = res;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.service.request(this.service.$api_get_agreement, { type: this.type }).subscribe(res => {
|
||||
if (res) {
|
||||
this.agreementContent = res;
|
||||
}
|
||||
});
|
||||
}
|
||||
this.service.request(this.service.$api_get_agreement, { type: this.type }).subscribe(res => {
|
||||
if (res) {
|
||||
this.agreementContent = res;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,55 +2,61 @@
|
||||
* @Description :
|
||||
* @Version : 1.0
|
||||
* @Author : Shiming
|
||||
* @Date : 2021-12-21 10:58:48
|
||||
* @Date : 2022-03-14 14:17:38
|
||||
* @LastEditors : Shiming
|
||||
* @LastEditTime : 2022-01-18 17:26:52
|
||||
* @LastEditTime : 2022-03-24 19:31:03
|
||||
* @FilePath : \\tms-obc-web\\src\\app\\routes\\supply-management\\components\\add-driver\\add-driver.component.html
|
||||
* Copyright (C) 2022 huzhenhong. All rights reserved.
|
||||
-->
|
||||
|
||||
<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 height="104" src="./assets/images/usercenter/certificate-demo-front.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 height="104" src="./assets/images/usercenter/certificate-demo-back.png" /></div>
|
||||
</div>
|
||||
</ng-template>
|
||||
<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 height="104" src="./assets/images/usercenter/certificate-demo-front.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 height="104" src="./assets/images/usercenter/certificate-demo-back.png" /></div>
|
||||
</div>
|
||||
</ng-template>
|
||||
</sf>
|
||||
<sf #sf1 [compact]="true" [ui]="ui2" [schema]="schema1" [button]="'none'" *ngIf="schema1">
|
||||
<ng-template sf-template="roadImg" let-me let-ui="ui" let-schema="schema">
|
||||
<img height="104" src="/assets/images/drivercard.png" class="borderImg" />
|
||||
</ng-template>
|
||||
</sf>
|
||||
<sf #sf2 [compact]="true" [ui]="ui3" [schema]="schema2" [button]="'none'" *ngIf="schema2">
|
||||
<ng-template sf-template="agreeImg" let-me let-ui="ui" let-schema="schema">
|
||||
<img height="104" src="/assets/images/jopcard.png" class="borderImg" />
|
||||
</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>
|
||||
<img class="drivercard" height="104" src="/assets/images/drivercard.png" />
|
||||
<img class="jopcard" height="104" src="/assets/images/jopcard.png" />
|
||||
<!-- <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 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>
|
||||
<button nz-button type="button" nzType="primary" (click)="submitForm()" [disabled]="!(sf?.valid && sf1?.valid && sf2?.valid)" [nzLoading]="service.http.loading">确定</button>
|
||||
</div>
|
||||
@ -4,11 +4,12 @@ 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 { AnyRecord } from 'dns';
|
||||
import { NzModalRef } from 'ng-zorro-antd/modal';
|
||||
import { Observable, Observer } from 'rxjs';
|
||||
import { NzUploadFile } from 'ng-zorro-antd/upload';
|
||||
import { Observable, Observer, of } 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',
|
||||
@ -21,6 +22,8 @@ export class CarAddDriverComponent implements OnInit {
|
||||
record: any = {};
|
||||
i: any;
|
||||
ui: SFUISchema = {};
|
||||
ui2: SFUISchema = {};
|
||||
ui3: SFUISchema = {};
|
||||
schema: SFSchema = {};
|
||||
schema1: SFSchema = {};
|
||||
schema2: SFSchema = {};
|
||||
@ -32,17 +35,18 @@ export class CarAddDriverComponent implements OnInit {
|
||||
userPracticeSeniorityDTO: {}
|
||||
};
|
||||
companyData: any = {};
|
||||
mobile = '';
|
||||
mobile = ''
|
||||
checked = false
|
||||
constructor(
|
||||
private modal: NzModalRef,
|
||||
public service: SupplyManagementService,
|
||||
private envSrv: EAEnvironmentService,
|
||||
private eaCacheSrv: EACacheService
|
||||
) {}
|
||||
private eaCacheSrv: EACacheService,
|
||||
) { }
|
||||
|
||||
ngOnInit(): void {
|
||||
this.companyData = this.eaCacheSrv.get(cacheConf.env);
|
||||
this.initSF();
|
||||
this.companyData = this.eaCacheSrv.get(cacheConf.env)
|
||||
this.initSF()
|
||||
}
|
||||
initSF() {
|
||||
this.schema = {
|
||||
@ -51,36 +55,37 @@ export class CarAddDriverComponent implements OnInit {
|
||||
title: '司机信息(必填)',
|
||||
type: 'string',
|
||||
ui: {
|
||||
widget: 'text'
|
||||
widget: 'text',
|
||||
},
|
||||
default: '照片上传后会自动识别文字并填充下列内容栏'
|
||||
},
|
||||
mobile: {
|
||||
title: '手机号',
|
||||
type: 'string',
|
||||
format: 'email',
|
||||
maxLength: 11,
|
||||
ui: {
|
||||
widget: 'text'
|
||||
widget: '',
|
||||
},
|
||||
default: this.mobile
|
||||
},
|
||||
showName: {
|
||||
title: '身份证照片',
|
||||
type: 'string',
|
||||
readOnly: true,
|
||||
ui: {
|
||||
widget: 'text',
|
||||
showRequired: true
|
||||
widget: 'textarea',
|
||||
borderless:true,
|
||||
showRequired: true,
|
||||
},
|
||||
default: '请上传身份证原件的高清照片,若上传复印件,则需加盖公司印章及法人签字;上传后系统会自动识别并填写'
|
||||
default: '请上传身份证原件的高清照片,若上传复印件,则需加盖公司印章及法人签字;上传后系统会自动识别并填写',
|
||||
},
|
||||
tipsA: {
|
||||
title: '',
|
||||
type: 'string',
|
||||
ui: {
|
||||
widget: 'custom',
|
||||
offsetControl: 6
|
||||
}
|
||||
offsetControl: 6,
|
||||
},
|
||||
},
|
||||
certificatePhotoFrontWatermark: {
|
||||
type: 'string',
|
||||
@ -88,7 +93,7 @@ export class CarAddDriverComponent implements OnInit {
|
||||
ui: {
|
||||
offsetControl: 6,
|
||||
action: apiConf.fileUpload,
|
||||
fileType: 'image/png,image/jpeg,image/jpg,image/gif',
|
||||
accept: 'image/png,image/jpeg,image/jpg,image/gif',
|
||||
limit: 1,
|
||||
limitFileCount: 1,
|
||||
resReName: 'data.fullFileWatermarkPath',
|
||||
@ -96,18 +101,20 @@ export class CarAddDriverComponent implements OnInit {
|
||||
widget: 'upload',
|
||||
descriptionI18n: '图片支持jpg、jpeg、png、gif格式,大小不超过2M',
|
||||
data: {
|
||||
appId: this.envSrv.env.appId
|
||||
appId: this.envSrv.env.appId,
|
||||
},
|
||||
name: 'multipartFile',
|
||||
multiple: false,
|
||||
listType: 'picture-card',
|
||||
change: args => {
|
||||
change: (args: any) => {
|
||||
if (args.type === 'success') {
|
||||
this.detailData.certificatePhotoFront = args.file.response.data.fullFilePath;
|
||||
this.detailData.certificatePhotoFront = args.file.response.data.fullFilePath
|
||||
this.checkIdCard(args.file.response.data.fullFilePath, 'front', 0);
|
||||
} else {
|
||||
this.detailData.certificatePhotoFront = ''
|
||||
}
|
||||
},
|
||||
beforeUpload: (file: any, _fileList) => {
|
||||
beforeUpload: (file: any, _fileList: any) => {
|
||||
return new Observable((observer: Observer<boolean>) => {
|
||||
const isLt2M = file.size / 1024 / 1024 < 2;
|
||||
if (!isLt2M) {
|
||||
@ -118,16 +125,17 @@ export class CarAddDriverComponent implements OnInit {
|
||||
observer.next(isLt2M);
|
||||
observer.complete();
|
||||
});
|
||||
}
|
||||
} as SFUploadWidgetSchema
|
||||
},
|
||||
previewFile: (file: NzUploadFile) => of(file.url),
|
||||
},
|
||||
},
|
||||
tipsB: {
|
||||
title: '',
|
||||
type: 'string',
|
||||
ui: {
|
||||
widget: 'custom',
|
||||
offsetControl: 6
|
||||
}
|
||||
offsetControl: 6,
|
||||
},
|
||||
},
|
||||
certificatePhotoBackWatermark: {
|
||||
type: 'string',
|
||||
@ -135,7 +143,7 @@ export class CarAddDriverComponent implements OnInit {
|
||||
ui: {
|
||||
offsetControl: 6,
|
||||
action: apiConf.fileUpload,
|
||||
fileType: 'image/png,image/jpeg,image/jpg,image/gif',
|
||||
accept: 'image/png,image/jpeg,image/jpg,image/gif',
|
||||
limit: 1,
|
||||
limitFileCount: 1,
|
||||
resReName: 'data.fullFileWatermarkPath',
|
||||
@ -143,18 +151,20 @@ export class CarAddDriverComponent implements OnInit {
|
||||
widget: 'upload',
|
||||
descriptionI18n: '图片支持jpg、jpeg、png、gif格式,大小不超过2M',
|
||||
data: {
|
||||
appId: this.envSrv.env.appId
|
||||
appId: this.envSrv.env.appId,
|
||||
},
|
||||
name: 'multipartFile',
|
||||
multiple: false,
|
||||
listType: 'picture-card',
|
||||
change: args => {
|
||||
change: (args: any) => {
|
||||
if (args.type === 'success') {
|
||||
this.detailData.certificatePhotoBack = args.file.response.data.fullFilePath;
|
||||
this.detailData.certificatePhotoBack = args.file.response.data.fullFilePath
|
||||
this.checkIdCard(args.file.response.data.fullFilePath, 'back', 0);
|
||||
} else {
|
||||
this.detailData.certificatePhotoBack = ''
|
||||
}
|
||||
},
|
||||
beforeUpload: (file: any, _fileList) => {
|
||||
beforeUpload: (file: any, _fileList: any) => {
|
||||
return new Observable((observer: Observer<boolean>) => {
|
||||
const isLt2M = file.size / 1024 / 1024 < 2;
|
||||
if (!isLt2M) {
|
||||
@ -165,8 +175,8 @@ export class CarAddDriverComponent implements OnInit {
|
||||
observer.next(isLt2M);
|
||||
observer.complete();
|
||||
});
|
||||
}
|
||||
} as SFUploadWidgetSchema
|
||||
},
|
||||
previewFile: (file: NzUploadFile) => of(file.url),}
|
||||
},
|
||||
name: {
|
||||
title: '姓名',
|
||||
@ -174,8 +184,8 @@ export class CarAddDriverComponent implements OnInit {
|
||||
maxLength: 32,
|
||||
ui: {
|
||||
widget: '',
|
||||
placeholder: '请输入姓名'
|
||||
}
|
||||
placeholder: '请输入姓名',
|
||||
},
|
||||
},
|
||||
certificateNumber: {
|
||||
title: '身份证号',
|
||||
@ -187,12 +197,17 @@ export class CarAddDriverComponent implements OnInit {
|
||||
widget: '',
|
||||
placeholder: '请输入法定代表人证件号',
|
||||
errors: {
|
||||
required: '请输入18位身份证号码'
|
||||
}
|
||||
}
|
||||
}
|
||||
required: '请输入18位身份证号码',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
required: ['certificatePhotoFrontWatermark', 'certificatePhotoBackWatermark', 'name', 'certificateNumber']
|
||||
required: [
|
||||
'certificatePhotoFrontWatermark',
|
||||
'certificatePhotoBackWatermark',
|
||||
'name',
|
||||
'certificateNumber'
|
||||
],
|
||||
};
|
||||
this.schema1 = {
|
||||
properties: {
|
||||
@ -200,7 +215,7 @@ export class CarAddDriverComponent implements OnInit {
|
||||
title: '驾驶证信息(必填)',
|
||||
type: 'string',
|
||||
ui: {
|
||||
widget: 'text'
|
||||
widget: 'text',
|
||||
},
|
||||
default: '照片上传后会自动识别文字并填充下列内容栏'
|
||||
},
|
||||
@ -209,7 +224,7 @@ export class CarAddDriverComponent implements OnInit {
|
||||
title: '驾驶证照片',
|
||||
ui: {
|
||||
action: apiConf.fileUpload,
|
||||
fileType: 'image/png,image/jpeg,image/jpg,image/gif',
|
||||
accept: 'image/png,image/jpeg,image/jpg,image/gif',
|
||||
limit: 1,
|
||||
limitFileCount: 1,
|
||||
resReName: 'data.fullFileWatermarkPath',
|
||||
@ -217,169 +232,80 @@ export class CarAddDriverComponent implements OnInit {
|
||||
widget: 'upload',
|
||||
descriptionI18n: '请上传驾驶证照片,支持JPG、PNG格式,文件小于5M。照片信息缺失、拼凑、过度PS、模糊不清,都不会通过审核。',
|
||||
data: {
|
||||
appId: this.envSrv.env.appId
|
||||
appId: this.envSrv.env.appId,
|
||||
},
|
||||
name: 'multipartFile',
|
||||
multiple: false,
|
||||
listType: 'picture-card',
|
||||
change: args => {
|
||||
change: (args: any) => {
|
||||
if (args.type === 'success') {
|
||||
this.detailData.userDriverLicenseDTO.certificatePhoto = args.file.response.data.fullFilePath;
|
||||
this.detailData.userDriverLicenseDTO.certificatePhoto = args.file.response.data.fullFilePath
|
||||
this.checkDriverCard(args.file.response.data.fullFilePath, 'front', 0);
|
||||
} else {
|
||||
this.detailData.userDriverLicenseDTO.certificatePhoto = ''
|
||||
}
|
||||
},
|
||||
beforeUpload: (file: any, _fileList) => {
|
||||
beforeUpload: (file: any, _fileList: any) => {
|
||||
return new Observable((observer: Observer<boolean>) => {
|
||||
const isLt4M = file.size / 1024 / 1024 < 4;
|
||||
const isLt4M = file.size / 1024 / 1024 < 5;
|
||||
if (!isLt4M) {
|
||||
this.service.msgSrv.warning('图片大小超过4M!');
|
||||
this.service.msgSrv.warning('图片大小超过5M!');
|
||||
observer.complete();
|
||||
return;
|
||||
}
|
||||
observer.next(isLt4M);
|
||||
observer.complete();
|
||||
});
|
||||
}
|
||||
} as SFUploadWidgetSchema
|
||||
},
|
||||
previewFile: (file: NzUploadFile) => of(file.url),}
|
||||
},
|
||||
roadImg: {
|
||||
title: '',
|
||||
type: 'boolean',
|
||||
// enum: [{ label: '长期', value: true }],
|
||||
ui: {
|
||||
widget: 'custom',
|
||||
}
|
||||
},
|
||||
licenseNo: {
|
||||
title: '驾驶证号',
|
||||
type: 'string',
|
||||
ui: {
|
||||
// widget: 'text',
|
||||
placeholder: '请输入'
|
||||
}
|
||||
// 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
|
||||
mode: 'multiple',
|
||||
containsAllLabel: false,
|
||||
placeholder: '请选择准驾车型',
|
||||
asyncData: () =>
|
||||
this.service.request(this.service.$api_getDictValue, { dictKey: 'driverModel' }).pipe(
|
||||
map((data: any) => {
|
||||
return data.map((m: any) => {
|
||||
return { label: m.label, value: m.label };
|
||||
});
|
||||
}),
|
||||
),
|
||||
},
|
||||
},
|
||||
validStartTime: {
|
||||
title: '发证日期',
|
||||
title: '有效期起',
|
||||
type: 'string',
|
||||
ui: {
|
||||
widget: 'date',
|
||||
format: 'yyyy-MM-dd',
|
||||
placeholder: '请选择',
|
||||
errors: {
|
||||
required: '请选择起始日期'
|
||||
required: '请选择起始日期',
|
||||
},
|
||||
change: i => {}
|
||||
} as SFDateWidgetSchema
|
||||
change: (i) => { },
|
||||
} as SFDateWidgetSchema,
|
||||
},
|
||||
validEndTime: {
|
||||
title: '有效期止',
|
||||
@ -389,67 +315,210 @@ export class CarAddDriverComponent implements OnInit {
|
||||
format: 'yyyy-MM-dd',
|
||||
placeholder: '请选择',
|
||||
errors: {
|
||||
required: '请选择起始日期'
|
||||
required: '请选择终止日期',
|
||||
},
|
||||
change: i => {}
|
||||
} as SFDateWidgetSchema
|
||||
}
|
||||
change: (i) => { },
|
||||
} as SFDateWidgetSchema,
|
||||
},
|
||||
signingOrganization: {
|
||||
title: '签发机关',
|
||||
type: 'string',
|
||||
maxLength: 30,
|
||||
ui: {
|
||||
// widget: this.detailData.commitFlag !== 0 ? 'text' : '',
|
||||
placeholder: '请输入',
|
||||
},
|
||||
},
|
||||
},
|
||||
required: []
|
||||
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,
|
||||
accept: '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: any) => {
|
||||
if (args.type === 'success') {
|
||||
this.detailData.userPracticeSeniorityDTO.certificatePhoto = args.file.response.data.fullFilePath
|
||||
this.checkQualificationCertificate(args.file.response.data.fullFilePath);
|
||||
} else{
|
||||
this.detailData.userPracticeSeniorityDTO.certificatePhoto = ''
|
||||
}
|
||||
},
|
||||
beforeUpload: (file: any, _fileList: any) => {
|
||||
return new Observable((observer: Observer<boolean>) => {
|
||||
const isLt2M = file.size / 1024 / 1024 < 5;
|
||||
if (!isLt2M) {
|
||||
this.service.msgSrv.warning('图片大小超过5M!');
|
||||
observer.complete();
|
||||
return;
|
||||
}
|
||||
observer.next(isLt2M);
|
||||
observer.complete();
|
||||
});
|
||||
},
|
||||
previewFile: (file: NzUploadFile) => of(file.url),}
|
||||
},
|
||||
agreeImg: {
|
||||
title: '',
|
||||
type: 'boolean',
|
||||
// enum: [{ label: '长期', value: true }],
|
||||
ui: {
|
||||
widget: 'custom',
|
||||
}
|
||||
},
|
||||
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
|
||||
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 }
|
||||
}
|
||||
};
|
||||
this.ui2 = {
|
||||
'*': {
|
||||
spanLabelFixed: 180,
|
||||
grid: { span: 18 },
|
||||
width: 600,
|
||||
},
|
||||
$titleB:{
|
||||
grid: { span: 24 },
|
||||
},
|
||||
$certificatePhotoWatermark: {
|
||||
grid: { span: 12 },
|
||||
},
|
||||
$roadImg: {
|
||||
grid: { span: 4 },
|
||||
class: 'setCustom'
|
||||
},
|
||||
};
|
||||
this.ui3 = {
|
||||
'*': {
|
||||
spanLabelFixed: 180,
|
||||
grid: { span: 18 },
|
||||
width: 600,
|
||||
},
|
||||
$titleC:{
|
||||
grid: { span: 24 },
|
||||
},
|
||||
$certificatePhotoWatermark: {
|
||||
grid: { span: 12 },
|
||||
},
|
||||
$agreeImg: {
|
||||
grid: { span: 4 },
|
||||
class: 'setCustom'
|
||||
},
|
||||
};
|
||||
}
|
||||
checkQualificationCertificate(imgurl: any) {
|
||||
// 识别从业资格证 参数side:0-正面、1-背面;type:0-申请人身份证,1-法定代表人身份证
|
||||
const params = {
|
||||
qualificationCertificateUrl: imgurl,
|
||||
};
|
||||
this.service.request(this.service.$api_recognizeQualificationCertificate, params).subscribe((res: any) => {
|
||||
if (res) {
|
||||
this.sf2.setValue('/licenseNo', res.certificateNumber);
|
||||
this.sf2.setValue('/regionCode', res.addressRegionCodes[0]);
|
||||
res.qualificationCategoryList.forEach((item: any) => {
|
||||
console.log(item.category.indexOf('道路货物运输驾驶员') !== -1)
|
||||
if (item.category.indexOf('道路货物运输驾驶员') !== -1) {
|
||||
this.sf2.setValue('/validStartTime', item.initialIssueDate.split(' ')[0]);
|
||||
this.sf2.setValue('/validEndTime', item.expiryDate.split(' ')[0]);
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
getProvinceData() {
|
||||
return this.service.request(this.service.$api_getRegionByCode, { regionCode: '' }).pipe(
|
||||
map((res: any) => {
|
||||
const result: any = [];
|
||||
const result: any = []
|
||||
if (res) {
|
||||
res.map((m: any) => {
|
||||
const item = { label: m.name, value: m.regionCode };
|
||||
result.push(item);
|
||||
const item = { label: m.name, value: m.regionCode }
|
||||
result.push(item)
|
||||
});
|
||||
}
|
||||
return result;
|
||||
return result
|
||||
})
|
||||
);
|
||||
}
|
||||
@ -457,9 +526,9 @@ export class CarAddDriverComponent implements OnInit {
|
||||
// 识别身份证 参数side:0-正面、1-背面;type:0-申请人身份证,1-法定代表人身份证
|
||||
const params = {
|
||||
idCardUrl: imgurl,
|
||||
side
|
||||
side,
|
||||
};
|
||||
this.service.request(this.service.$api_checkIdCard, params).subscribe((res: any) => {
|
||||
this.service.request(this.service.$api_checkIdCard, params).subscribe((res: any)=> {
|
||||
if (res) {
|
||||
if (type === 0) {
|
||||
// 法定代表人身份证
|
||||
@ -476,7 +545,7 @@ export class CarAddDriverComponent implements OnInit {
|
||||
// 识别身份证 参数side:0-正面、1-背面;type:0-申请人身份证,1-法定代表人身份证
|
||||
const params = {
|
||||
driverLicenseUrl: imgurl,
|
||||
side
|
||||
side,
|
||||
};
|
||||
this.service.request(this.service.$api_recognizeDriverLicense, params).subscribe((res: any) => {
|
||||
if (res) {
|
||||
@ -485,7 +554,7 @@ export class CarAddDriverComponent implements OnInit {
|
||||
if (side === 'front') {
|
||||
// 正面
|
||||
this.sf1.setValue('/licenseNo', res.number);
|
||||
this.sf1.setValue('/driverModel', res.number);
|
||||
this.sf1.setValue('/driverModel', [(res.classType).toUpperCase()]);
|
||||
this.sf1.setValue('/validStartTime', res.validFrom);
|
||||
this.sf1.setValue('/validEndTime', res.validTo);
|
||||
this.sf1.setValue('/signingOrganization', res.issuingAuthority);
|
||||
@ -497,59 +566,51 @@ export class CarAddDriverComponent implements OnInit {
|
||||
close(): void {
|
||||
this.modal.destroy();
|
||||
}
|
||||
showExample() {
|
||||
this.showCardFlag = !this.showCardFlag;
|
||||
showExample(){
|
||||
this.showCardFlag = !this.showCardFlag
|
||||
}
|
||||
showJopExample() {
|
||||
this.showJopFlag = !this.showJopFlag;
|
||||
showJopExample(){
|
||||
this.showJopFlag = !this.showJopFlag
|
||||
}
|
||||
submitForm() {
|
||||
const params: any = {
|
||||
enterpriseId: this.companyData.enterpriseId,
|
||||
enterpriseProjectId: this.companyData.projectId,
|
||||
submitForm(){
|
||||
const params:any = {
|
||||
source: 1,
|
||||
mobile: this.mobile,
|
||||
identityInfoDTO: {
|
||||
mobile: this.sf.value.mobile,
|
||||
identityInfoDTO:{
|
||||
...this.sf.value,
|
||||
certificatePhotoFront: this.detailData.certificatePhotoFront,
|
||||
certificatePhotoBack: this.detailData.certificatePhotoBack
|
||||
certificatePhotoBack: this.detailData.certificatePhotoBack,
|
||||
},
|
||||
userDriverLicenseDTO: {
|
||||
...this.sf1.value,
|
||||
certificatePhoto: this.detailData.userDriverLicenseDTO.certificatePhoto
|
||||
certificatePhoto: this.detailData.userDriverLicenseDTO.certificatePhoto,
|
||||
},
|
||||
userPracticeSeniorityDTO: {
|
||||
...this.sf2.value,
|
||||
certificatePhoto: this.detailData.userPracticeSeniorityDTO.certificatePhoto
|
||||
}
|
||||
certificatePhoto: this.detailData.userPracticeSeniorityDTO.certificatePhoto,
|
||||
},
|
||||
};
|
||||
Object.assign(params, {
|
||||
identityInfoDTO: {
|
||||
certificatePhotoFrontWatermark: this.sf?.value.certificatePhotoFrontWatermark,
|
||||
certificatePhotoBackWatermark: this.sf?.value.certificatePhotoBackWatermark
|
||||
},
|
||||
userDriverLicenseDTO: {
|
||||
certificatePhotoWatermark: this.sf?.value.certificatePhotoWatermark
|
||||
},
|
||||
userPracticeSeniorityDTO: {
|
||||
certificatePhotoWatermark: this.sf?.value.certificatePhotoWatermark
|
||||
}
|
||||
});
|
||||
// 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;
|
||||
if(params.userPracticeSeniorityDTO.certificatePhoto === '' || params.userPracticeSeniorityDTO.certificatePhotoWatermark === '') {
|
||||
delete params.userPracticeSeniorityDTO.certificatePhotoWatermark
|
||||
delete params.userPracticeSeniorityDTO.certificatePhoto
|
||||
}
|
||||
params.userDriverLicenseDTO.driverModel = params.userDriverLicenseDTO.driverModel.join(',')
|
||||
delete params.identityInfoDTO.showName;
|
||||
delete params.identityInfoDTO.titleA;
|
||||
delete params.identityInfoDTO.titleB;
|
||||
delete params.identityInfoDTO.titleC;
|
||||
delete params.userDriverLicenseDTO.titleB;
|
||||
delete params.userPracticeSeniorityDTO.titleC;
|
||||
delete params.userDriverLicenseDTO.tipsA;
|
||||
delete params.userPracticeSeniorityDTO.tipsC;
|
||||
delete params.showName;
|
||||
if(JSON.stringify(params.userPracticeSeniorityDTO) === '{}') {
|
||||
params.userPracticeSeniorityDTO = null
|
||||
}
|
||||
this.checked = true
|
||||
this.service.request(this.service.$api_enterpriseVehicleSave, params).subscribe((res: any) => {
|
||||
if (res) {
|
||||
this.service.msgSrv.success('添加成功');
|
||||
this.modal.close(true);
|
||||
this.checked = false
|
||||
if(res){
|
||||
this.service.msgSrv.success('添加成功')
|
||||
this.modal.close(true)
|
||||
}
|
||||
});
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
* @Author : Shiming
|
||||
* @Date : 2021-12-03 11:10:14
|
||||
* @LastEditors : Shiming
|
||||
* @LastEditTime : 2022-03-07 13:54:46
|
||||
* @LastEditTime : 2022-03-24 19:35:52
|
||||
* @FilePath : \\tms-obc-web\\src\\app\\routes\\supply-management\\services\\supply-management.service.ts
|
||||
* Copyright (C) 2022 huzhenhong. All rights reserved.
|
||||
*/
|
||||
@ -119,6 +119,8 @@ export class SupplyManagementService extends BaseService {
|
||||
public $api_getContractContent = '/api/sdc/contractTemplate/getContractContent';
|
||||
// 获取运价
|
||||
public $api_getFreight = '/api/mdc/cuc/freightConfig/getFreight';
|
||||
// 从业资格证
|
||||
$api_recognizeQualificationCertificate = '/api/mdc/pbc/hwc/ocr/recognizeQualificationCertificate';
|
||||
/**
|
||||
* 获取车型、车长字典数据
|
||||
* @returns
|
||||
|
||||
Reference in New Issue
Block a user