车辆对接

This commit is contained in:
wangshiming
2021-12-28 10:27:34 +08:00
parent 2d67ea537d
commit c904aeba46
17 changed files with 564 additions and 355 deletions

View File

@ -1,31 +1,43 @@
<!--
* @Author: your name
* @Date: 2021-12-21 10:58:48
* @LastEditTime: 2021-12-28 10:16:29
* @LastEditors: your name
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: \tms-obc-web\src\app\routes\supply-management\components\add-driver\add-driver.component.html
-->
<div class="modal-header">
<div class="modal-title">添加司机</div>
<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()">
<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/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 height="104" 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>
<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="">
@ -39,6 +51,6 @@
</div> -->
</div>
<div class="modal-footer">
<button nz-button type="button" (click)="close()">关闭</button>
<button nz-button type="button" nzType="primary" (click)="submitForm()">确定</button>
<button nz-button type="button" (click)="close()">关闭</button>
<button nz-button type="button" nzType="primary" (click)="submitForm()">确定</button>
</div>

View File

@ -453,18 +453,18 @@ export class CarAddDriverComponent implements OnInit {
};
}
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
// })
// );
return this.service.request(this.service.$api_getRegionByCode, { regionCode: '' }).pipe(
map((res: any) => {
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) {
// 识别身份证 参数side0-正面、1-背面type0-申请人身份证1-法定代表人身份证
@ -472,18 +472,18 @@ export class CarAddDriverComponent implements OnInit {
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);
// }
// }
// }
// });
this.service.request(this.service.$api_checkIdCard, params).subscribe((res: any) => {
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) {
// 识别身份证 参数side0-正面、1-背面type0-申请人身份证1-法定代表人身份证
@ -491,21 +491,21 @@ export class CarAddDriverComponent implements OnInit {
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);
// }
// }
// }
// });
this.service.request(this.service.$api_recognizeDriverLicense, params).subscribe((res: any) => {
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();
@ -546,11 +546,11 @@ export class CarAddDriverComponent implements OnInit {
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()
// }
// })
this.service.request(this.service.$api_enterpriseVehicleSave, params).subscribe((res: any) => {
if(res){
this.service.msgSrv.success('添加成功')
this.modal.close(true)
}
})
}
}