ediot
This commit is contained in:
@ -7,12 +7,10 @@ import {
|
|||||||
SFComponent,
|
SFComponent,
|
||||||
SFDateWidgetSchema,
|
SFDateWidgetSchema,
|
||||||
SFSchema,
|
SFSchema,
|
||||||
SFSchemaEnum,
|
|
||||||
SFTextareaWidgetSchema,
|
SFTextareaWidgetSchema,
|
||||||
SFUISchema,
|
SFUISchema,
|
||||||
SFUploadWidgetSchema
|
SFUploadWidgetSchema
|
||||||
} from '@delon/form';
|
} from '@delon/form';
|
||||||
import { NzMessageService } from 'ng-zorro-antd/message';
|
|
||||||
import { UsermanageService } from 'src/app/routes/usercenter/services/usercenter.service';
|
import { UsermanageService } from 'src/app/routes/usercenter/services/usercenter.service';
|
||||||
|
|
||||||
const IMAGECONFIG = {
|
const IMAGECONFIG = {
|
||||||
@ -79,6 +77,13 @@ export class FreightComponentsListNewComponent implements OnInit {
|
|||||||
ngOnInit() {}
|
ngOnInit() {}
|
||||||
|
|
||||||
submitForm() {
|
submitForm() {
|
||||||
|
if (!this.sf1.valid || !this.sf.valid) {
|
||||||
|
this.sf.validator({ emitError: true });
|
||||||
|
this.sf1.validator({ emitError: true });
|
||||||
|
this.service.msgSrv.warning('请修改填写错误信息');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const sfVlaue = this.sf.value;
|
const sfVlaue = this.sf.value;
|
||||||
const params = {};
|
const params = {};
|
||||||
Object.assign(
|
Object.assign(
|
||||||
@ -113,114 +118,99 @@ export class FreightComponentsListNewComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 根据地区code查询地区详情
|
* 根据地区code查询地区列表
|
||||||
* code:请求参数
|
|
||||||
* type:参数 name:获取省市区名称,fullcode:获取省市区code
|
|
||||||
* num:参数 1:第一个地区选择,2:第二个地区选择
|
|
||||||
*/
|
*/
|
||||||
getRegionDetailByCode(regionCode: any) {
|
getRegionDetailByCode(regionCode: any) {
|
||||||
// 根据地区code查询地区详情
|
|
||||||
return this.service.request(this.service.$api_get_region_by_code, { regionCode });
|
return this.service.request(this.service.$api_get_region_by_code, { regionCode });
|
||||||
}
|
}
|
||||||
|
|
||||||
checkIdCard(imgurl: any, isFront: number, type: number) {
|
// 识别身份证 参数isFront:front-正面、back-背面;type:0-申请人身份证,1-法定代表人身份证
|
||||||
// 识别身份证 参数isFront:0-正面、1-背面;type:0-申请人身份证,1-法定代表人身份证
|
checkIdCard(imgurl: any, isFront: string, type: number) {
|
||||||
const params = {
|
const params = {
|
||||||
idCardImagePath: imgurl,
|
idCardUrl: imgurl,
|
||||||
isFront
|
side: isFront
|
||||||
};
|
};
|
||||||
// this.service.request(this.service.$api_checkIdCard, params).subscribe((res) => {
|
this.service.request(this.service.$api_ocr_recognize_id_card, params).subscribe(res => {
|
||||||
// if (res) {
|
if (res) {
|
||||||
// if (type === 0) {
|
if (type === 1) {
|
||||||
// // 申请人身份证
|
// 法定代表人证件照
|
||||||
// if (isFront === 0) {
|
if (isFront === 'front') {
|
||||||
// // 正面
|
// 正面
|
||||||
// if (res.name) {
|
if (res.name) {
|
||||||
// this.sf.setValue('/name', res.name);
|
this.sf1.setValue('/legalPersonIdentityDTO/name', res.name);
|
||||||
// }
|
|
||||||
// if (res.idCardNumber) {
|
|
||||||
// this.sf.setValue('/certificateNumber', res.idCardNumber);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// if (isFront === 1) {
|
|
||||||
// // 背面
|
|
||||||
// if (res.validFrom) {
|
|
||||||
// this.sf.setValue('/validStartTime', res.validFrom);
|
|
||||||
// }
|
|
||||||
// if (res.validTo) {
|
|
||||||
// this.sf.setValue('/validEndTime', res.validTo);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// if (type === 1) {
|
|
||||||
// // 法定代表人身份证
|
|
||||||
// if (isFront === 0) {
|
|
||||||
// // 正面
|
|
||||||
// if (res.name) {
|
|
||||||
// this.sf1.setValue('/name', res.name);
|
|
||||||
// }
|
|
||||||
// if (res.idCardNumber) {
|
|
||||||
// this.sf1.setValue('/certificateNumber', res.idCardNumber);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// if (isFront === 1) {
|
|
||||||
// // 背面
|
|
||||||
// if (res.validFrom) {
|
|
||||||
// this.sf1.setValue('/validStartTime', res.validFrom);
|
|
||||||
// }
|
|
||||||
// if (res.validTo) {
|
|
||||||
// this.sf1.setValue('/validEndTime', res.validTo);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
}
|
}
|
||||||
checkBusinessLicense(imgurl: any) {
|
if (res.number) {
|
||||||
|
this.sf1.setValue('/legalPersonIdentityDTO/certificateType', 0);
|
||||||
|
this.sf1.setValue('/legalPersonIdentityDTO/certificateNumber', res.number);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (isFront === 'back') {
|
||||||
|
// 背面
|
||||||
|
if (res.validFrom) {
|
||||||
|
this.sf1.setValue('/legalPersonIdentityDTO/validStartTime', res.validFrom);
|
||||||
|
}
|
||||||
|
if (res.validTo) {
|
||||||
|
this.sf1.setValue('/legalPersonIdentityDTO/validEndTime', res.validTo);
|
||||||
|
this.sf1.setValue('/legalPersonIdentityDTO/isLoingDate', false);
|
||||||
|
} else {
|
||||||
|
this.sf1.setValue('/legalPersonIdentityDTO/isLoingDate', true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 企业管理员证件照
|
||||||
|
if (type === 0) {
|
||||||
|
if (isFront === 'front') {
|
||||||
|
// 正面
|
||||||
|
if (res.name) {
|
||||||
|
this.sf.setValue('/name', res.name);
|
||||||
|
}
|
||||||
|
if (res.number) {
|
||||||
|
this.sf.setValue('/certificateNumber', res.number);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// 识别营业执照
|
// 识别营业执照
|
||||||
const params = {
|
checkBusinessLicense(imgurl: any) {
|
||||||
licenseImagePath: imgurl
|
this.service.request(this.service.$api_ocr_recognize_business_license, { businessLicenseUrl: imgurl }).subscribe(res => {
|
||||||
};
|
if (res) {
|
||||||
// this.service.request(this.service.$api_checkBusinessLicense, params).subscribe((res) => {
|
if (res.registrationNumber) {
|
||||||
// if (res) {
|
this.sf1.setValue('/unifiedSocialCreditCode', res.registrationNumber);
|
||||||
// if (res.unifiedSocialCreditCode) {
|
}
|
||||||
// this.sf1.setValue('/unifiedSocialCreditCode', res.unifiedSocialCreditCode);
|
if (res.name) {
|
||||||
// }
|
this.sf1.setValue('/enterpriseName', res.name);
|
||||||
// if (res.enterpriseName) {
|
}
|
||||||
// this.sf1.setValue('/enterpriseName', res.enterpriseName);
|
if (res.type) {
|
||||||
// }
|
this.sf1.setValue('/enterpriseType', res.type);
|
||||||
// if (res.enterpriseType) {
|
}
|
||||||
// this.sf1.setValue('/enterpriseType', res.enterpriseType);
|
if (res.addressRegionCodes) {
|
||||||
// }
|
this.sf1.setValue('/enterpriseAddressCode', res.addressRegionCodes);
|
||||||
// if (res.addressRegionCodes) {
|
}
|
||||||
// this.sf1.setValue('/region', res.addressRegionCodes);
|
if (res.address) {
|
||||||
// }
|
this.sf1.setValue('/enterpriseAddress', res.address);
|
||||||
// if (res.address) {
|
}
|
||||||
// this.sf1.setValue('/enterpriseAddress', res.address);
|
if (res.registeredCapital) {
|
||||||
// }
|
this.sf1.setValue('/registrationCapital', res.registeredCapital);
|
||||||
// if (res.foundDate) {
|
}
|
||||||
// this.sf1.setValue('/enterpriseRegistrationTime', res.foundDate);
|
if (res.foundDate) {
|
||||||
// }
|
this.sf1.setValue('/enterpriseRegistrationTime', res.foundDate);
|
||||||
// if (res.registeredCapital) {
|
}
|
||||||
// this.sf1.setValue('/registrationCapital', res.registeredCapital);
|
if (res.businessTermStartDate) {
|
||||||
// }
|
this.sf1.setValue('/operatingStartTime', res.businessTermStartDate);
|
||||||
// if (res.businessTermStartDate) {
|
}
|
||||||
// this.sf1.setValue('/operatingStartTime', res.businessTermStartDate);
|
if (res.businessTermEndDate) {
|
||||||
// }
|
this.sf1.setValue('/operatingEndTime', res.businessTermEndDate);
|
||||||
// if (res.businessTermEndDate) {
|
} else {
|
||||||
// this.sf1.setValue('/operatingEndTime', res.businessTermEndDate);
|
this.sf1.setValue('/isLoingDate', true);
|
||||||
// }
|
}
|
||||||
// if (res.businessScope) {
|
if (res.businessScope) {
|
||||||
// this.sf1.setValue('/businessScope', res.businessScope);
|
this.sf1.setValue('/businessScope', res.businessScope);
|
||||||
// }
|
}
|
||||||
// const len = res.addressRegionCodes.length - 1;
|
}
|
||||||
// this.enterpriseAddressCode = res.addressRegionCodes[len];
|
});
|
||||||
// this.enterpriseAddressCodeStr = res.addressRegionNames;
|
|
||||||
// if (!res.businessTermEndDate) {
|
|
||||||
// this.sf1.setValue('/dateType', true);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
goBack() {
|
goBack() {
|
||||||
@ -438,7 +428,7 @@ export class FreightComponentsListNewComponent implements OnInit {
|
|||||||
change: args => {
|
change: args => {
|
||||||
if (args.type === 'success') {
|
if (args.type === 'success') {
|
||||||
this.sf1.setValue('/legalPersonIdentityDTO/certificatePhotoFront', args.fileList[0].response.data.fullFilePath);
|
this.sf1.setValue('/legalPersonIdentityDTO/certificatePhotoFront', args.fileList[0].response.data.fullFilePath);
|
||||||
this.checkIdCard(args.fileList[0].response.data.fullFileWatermarkPath, 0, 1);
|
this.checkIdCard(args.fileList[0].response.data.fullFilePath, 'front', 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} as SFUploadWidgetSchema
|
} as SFUploadWidgetSchema
|
||||||
@ -455,7 +445,7 @@ export class FreightComponentsListNewComponent implements OnInit {
|
|||||||
change: args => {
|
change: args => {
|
||||||
if (args.type === 'success') {
|
if (args.type === 'success') {
|
||||||
this.sf1.setValue('/legalPersonIdentityDTO/certificatePhotoBack', args.fileList[0].response.data.fullFilePath);
|
this.sf1.setValue('/legalPersonIdentityDTO/certificatePhotoBack', args.fileList[0].response.data.fullFilePath);
|
||||||
this.checkIdCard(args.fileList[0].response.data.fullFileWatermarkPath, 0, 1);
|
this.checkIdCard(args.fileList[0].response.data.fullFilePath, 'back', 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} as SFUploadWidgetSchema
|
} as SFUploadWidgetSchema
|
||||||
@ -531,19 +521,11 @@ export class FreightComponentsListNewComponent implements OnInit {
|
|||||||
grid: { span: 6 },
|
grid: { span: 6 },
|
||||||
class: 'input-back',
|
class: 'input-back',
|
||||||
widget: 'checkbox',
|
widget: 'checkbox',
|
||||||
change: i=> this.sf1?.setValue('/legalPersonIdentityDTO/validEndTime', null),
|
change: i => this.sf1?.setValue('/legalPersonIdentityDTO/validEndTime', null)
|
||||||
} as SFCheckboxWidgetSchema
|
} as SFCheckboxWidgetSchema
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
required: [
|
required: ['certificatePhotoFront', 'certificatePhotoBack', 'name', 'certificateType', 'certificateNumber', 'validStartTime']
|
||||||
'tipsC',
|
|
||||||
'certificatePhotoFront',
|
|
||||||
'certificatePhotoBack',
|
|
||||||
'name',
|
|
||||||
'certificateType',
|
|
||||||
'certificateNumber',
|
|
||||||
'validStartTime',
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
required: [
|
required: [
|
||||||
@ -610,7 +592,7 @@ export class FreightComponentsListNewComponent implements OnInit {
|
|||||||
change: args => {
|
change: args => {
|
||||||
if (args.type === 'success') {
|
if (args.type === 'success') {
|
||||||
this.sf.setValue('/certificatePhotoFront', args.fileList[0].response.data.fullFilePath);
|
this.sf.setValue('/certificatePhotoFront', args.fileList[0].response.data.fullFilePath);
|
||||||
this.checkIdCard(args.fileList[0].response.data.fullFileWatermarkPath, 0, 1);
|
this.checkIdCard(args.fileList[0].response.data.fullFilePath, 'front', 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} as SFUploadWidgetSchema
|
} as SFUploadWidgetSchema
|
||||||
@ -632,7 +614,6 @@ export class FreightComponentsListNewComponent implements OnInit {
|
|||||||
change: args => {
|
change: args => {
|
||||||
if (args.type === 'success') {
|
if (args.type === 'success') {
|
||||||
this.sf.setValue('/certificatePhotoBack', args.fileList[0].response.data.fullFilePath);
|
this.sf.setValue('/certificatePhotoBack', args.fileList[0].response.data.fullFilePath);
|
||||||
this.checkIdCard(args.fileList[0].response.data.fullFileWatermarkPath, 0, 1);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} as SFUploadWidgetSchema
|
} as SFUploadWidgetSchema
|
||||||
@ -668,7 +649,6 @@ export class FreightComponentsListNewComponent implements OnInit {
|
|||||||
change: args => {
|
change: args => {
|
||||||
if (args.type === 'success') {
|
if (args.type === 'success') {
|
||||||
this.sf.setValue('/creditPhoto', args.fileList[0].response.data.fullFilePath);
|
this.sf.setValue('/creditPhoto', args.fileList[0].response.data.fullFilePath);
|
||||||
this.checkIdCard(args.fileList[0].response.data.fullFileWatermarkPath, 0, 1);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} as SFUploadWidgetSchema
|
} as SFUploadWidgetSchema
|
||||||
@ -705,21 +685,17 @@ export class FreightComponentsListNewComponent implements OnInit {
|
|||||||
networkTransporter: {
|
networkTransporter: {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
title: '网络货运人',
|
title: '网络货运人',
|
||||||
enum: [
|
|
||||||
{ label: '全部', value: 0 },
|
|
||||||
{ label: '大宗发货', value: 20 }
|
|
||||||
],
|
|
||||||
default: 0,
|
|
||||||
ui: {
|
ui: {
|
||||||
grid: { xxl: 13, xl: 18, lg: 24, md: 24 },
|
grid: { xxl: 13, xl: 18, lg: 24, md: 24 },
|
||||||
widget: 'select',
|
widget: 'select',
|
||||||
visibleIf: {
|
placeholder: '请选择',
|
||||||
expand: (value: boolean) => value
|
allowClear: true,
|
||||||
}
|
asyncData: () => this.service.getNetworkFreightForwarder()
|
||||||
}
|
},
|
||||||
|
default: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
required: ['createBank', '银行账号', 'adminMobile', 'name', 'certificateNumber', 'tipsD', 'creditPhoto']
|
required: ['createBank', 'bankAccount', 'adminMobile', 'name', 'certificateNumber', 'tipsD', 'creditPhoto']
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,16 +8,14 @@
|
|||||||
*/
|
*/
|
||||||
import { Injectable, Injector } from '@angular/core';
|
import { Injectable, Injector } from '@angular/core';
|
||||||
import { _HttpClient } from '@delon/theme';
|
import { _HttpClient } from '@delon/theme';
|
||||||
import { NzMessageService } from 'ng-zorro-antd/message';
|
import { ShipperBaseService } from '@shared';
|
||||||
import { NzModalService } from 'ng-zorro-antd/modal';
|
import { NzModalService } from 'ng-zorro-antd/modal';
|
||||||
import { ImageViewComponent } from 'src/app/shared/components/imagelist';
|
import { ImageViewComponent } from 'src/app/shared/components/imagelist';
|
||||||
import { BaseService } from 'src/app/shared/services/core/base.service';
|
|
||||||
import { EAFileUtil } from 'src/app/shared/utils/file.util';
|
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
})
|
})
|
||||||
export class UsermanageService extends BaseService {
|
export class UsermanageService extends ShipperBaseService {
|
||||||
// 查询企业列表
|
// 查询企业列表
|
||||||
$api_get_freight_list = '/api/mdc/cuc/enterpriseInfo/operate/list/page';
|
$api_get_freight_list = '/api/mdc/cuc/enterpriseInfo/operate/list/page';
|
||||||
|
|
||||||
@ -93,6 +91,8 @@ export class UsermanageService extends BaseService {
|
|||||||
|
|
||||||
// 根据地区code查询列表
|
// 根据地区code查询列表
|
||||||
$api_get_region_by_code = '/api/mdc/pbc/region/getRegionByCode';
|
$api_get_region_by_code = '/api/mdc/pbc/region/getRegionByCode';
|
||||||
|
// 根据地区code查询地区详情
|
||||||
|
$api_get_region_detail_by_code = '/api/mdc/pbc/region/getRegionDetailByCode';
|
||||||
|
|
||||||
// 导出企业
|
// 导出企业
|
||||||
$api_export_enterprise = '/api/mdc/cuc/enterpriseInfo/operate/export';
|
$api_export_enterprise = '/api/mdc/cuc/enterpriseInfo/operate/export';
|
||||||
@ -101,6 +101,11 @@ export class UsermanageService extends BaseService {
|
|||||||
// 车队长导出-运营后台
|
// 车队长导出-运营后台
|
||||||
$api_export_driver_cap = '/api/mdc/userDriverExpand/export';
|
$api_export_driver_cap = '/api/mdc/userDriverExpand/export';
|
||||||
|
|
||||||
|
// 营业执照识别
|
||||||
|
$api_ocr_recognize_business_license = '/api/mdc/pbc/hwc/ocr/recognizeBusinessLicense';
|
||||||
|
// 身份证识别
|
||||||
|
$api_ocr_recognize_id_card = '/api/mdc/pbc/hwc/ocr/recognizeIdCard';
|
||||||
|
|
||||||
constructor(public injector: Injector, private nzModalService: NzModalService) {
|
constructor(public injector: Injector, private nzModalService: NzModalService) {
|
||||||
super(injector);
|
super(injector);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user