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(); } });