diff --git a/src/app/routes/sys-setting/components/network-freight/new/new.component.ts b/src/app/routes/sys-setting/components/network-freight/new/new.component.ts index f9100693..6cafd5b9 100644 --- a/src/app/routes/sys-setting/components/network-freight/new/new.component.ts +++ b/src/app/routes/sys-setting/components/network-freight/new/new.component.ts @@ -89,7 +89,6 @@ export class NetworkFreightNewComponent implements OnInit { constructor(private router: Router, public service: SystemService, private route: ActivatedRoute) {} ngOnInit() { - console.log(this.route.snapshot.params.id == 'undefined') if(this.route.snapshot.params.id !== 'undefined') { this.dataListInit(this.route.snapshot.params.id) this.subText = '确认编辑' @@ -101,6 +100,7 @@ export class NetworkFreightNewComponent implements OnInit { console.log(res); this.sf2FormData = res this.sf1FormData = res.enterpriseInfoVO + this.sf1FormData.legalPersonIdentityVO.isLoingDate = this.sf1FormData.legalPersonIdentityVO.validEndTime !== null ? false : true; this.sf1FormData.licensePhotoWatermark = [ { uid: -1, @@ -182,9 +182,16 @@ export class NetworkFreightNewComponent implements OnInit { delete params.enterpriseInfoDTO.legalPersonIdentityVO console.log(params); params.enterpriseInfoDTO.enterpriseAddressCode = this.sf1.value?.enterpriseAddressCode?.[2]; + if(this.route.snapshot.params.id !== 'undefined') { + params.id = this.route.snapshot.params.id + } this.service.request(this.service.$api_networkTransporter_save, params).subscribe(res => { if (res) { - this.service.msgSrv.success('网络货运人新增成功'); + if(this.route.snapshot.params.id !== 'undefined') { + this.service.msgSrv.success('修改成功'); + } else { + this.service.msgSrv.success('新增成功'); + } this.goBack(); } }); diff --git a/src/app/routes/usercenter/components/driver/add-driver/add-driver.component.ts b/src/app/routes/usercenter/components/driver/add-driver/add-driver.component.ts index 20a4d5d3..123da432 100644 --- a/src/app/routes/usercenter/components/driver/add-driver/add-driver.component.ts +++ b/src/app/routes/usercenter/components/driver/add-driver/add-driver.component.ts @@ -477,6 +477,15 @@ export class CarSettleAddDriverComponent implements OnInit { } }; } + getRegionToThree() { + // 获取一、二、三级地区详情 + this.service.http.post(this.service.$api_getRegionToThree).subscribe((res) => { + if(this.sf1){ + this.sf1.getProperty('/enterpriseAddressCode')!.schema.enum = res.data; + this.sf1?.getProperty('/enterpriseAddressCode')?.widget.reset(res.data); + } + }); + } getProvinceData() { return this.service.request(this.service.$api_getRegionByCode, { regionCode: '' }).pipe( map(res => { @@ -520,7 +529,7 @@ export class CarSettleAddDriverComponent implements OnInit { if (res) { this.sf2.setValue('/licenseNo', res.certificateNumber); - //this.sf.setValue('/validStartTime', res.continuingEducationInfo); + this.sf2.setValue('/regionCode', res.addressRegionCodes?.[0]); } }); } @@ -558,12 +567,12 @@ export class CarSettleAddDriverComponent implements OnInit { } submitForm() { const items: any = this.sf.value; - items.certificatePhotoFrontWatermark = this.sf.value?.certificatePhotoFrontWatermark.data.fullFilePath; - items.certificatePhotoBackWatermark = this.sf.value?.certificatePhotoBackWatermark.data.fullFilePath; + items.certificatePhotoFrontWatermark = this.sf.value?.certificatePhotoFrontWatermark?.data?.fullFilePath || this.sf.value?.certificatePhotoFrontWatermark; + items.certificatePhotoBackWatermark = this.sf.value?.certificatePhotoBackWatermark?.data?.fullFilePath || this.sf.value?.certificatePhotoBackWatermark; const items2: any = this.sf1.value; - items2.certificatePhotoWatermark = this.sf1.value?.certificatePhotoWatermark.data.fullFilePath; + items2.certificatePhotoWatermark = this.sf1.value?.certificatePhotoWatermark?.data?.fullFilePath || this.sf1.value?.certificatePhotoWatermark; const items3: any = this.sf2.value; - items3.certificatePhotoWatermark = this.sf2.value?.certificatePhotoWatermark.data.fullFilePath; + items3.certificatePhotoWatermark = this.sf2.value?.certificatePhotoWatermark?.data?.fullFilePath || this.sf2.value?.certificatePhotoWatermark; const params: any = { source: 2, mobile: this.sf.value.mobile, diff --git a/src/app/routes/usercenter/services/usercenter.service.ts b/src/app/routes/usercenter/services/usercenter.service.ts index 112e3ce3..c42a9b3d 100644 --- a/src/app/routes/usercenter/services/usercenter.service.ts +++ b/src/app/routes/usercenter/services/usercenter.service.ts @@ -16,6 +16,8 @@ import { ImageViewComponent } from 'src/app/shared/components/imagelist'; providedIn: 'root' }) export class UsermanageService extends ShipperBaseService { + // 获取一、二、三级地区详情 + $api_getRegionToThree = '/api/mdc/pbc/region/getRegionToThree'; // 查询企业列表 $api_get_freight_list = '/api/mdc/cuc/enterpriseInfo/operate/list/page'; // 导出企业列表 @@ -130,10 +132,10 @@ export class UsermanageService extends ShipperBaseService { $api_driver_add = '/api/mdc/cuc/driver/add'; // 添加车队长 $api_saveCaptainr_new = '/api/mdc/userDriverExpand/saveCaptainr'; - + // 查询司机配置列表 - $api_configPage= '/api/mdc/cuc/driver/list/configPage'; - + $api_configPage = '/api/mdc/cuc/driver/list/configPage'; + constructor(public injector: Injector, private nzModalService: NzModalService, public eaCacheSrv: EACacheService) { super(injector, eaCacheSrv); }