fix bug
This commit is contained in:
@ -111,7 +111,7 @@ export class NetworkFreightComponent implements OnInit {
|
||||
buttons: [
|
||||
{
|
||||
text: '基础设置',
|
||||
click: item => this.ticket(item)
|
||||
click: item => this.creat(item)
|
||||
},
|
||||
{
|
||||
text: '财务设置',
|
||||
@ -534,7 +534,8 @@ export class NetworkFreightComponent implements OnInit {
|
||||
}
|
||||
}
|
||||
// 新增
|
||||
creat() {
|
||||
this.router.navigate(['./new'], { relativeTo: this.ar });
|
||||
creat(value?: any) {
|
||||
console.log(value)
|
||||
this.router.navigate(['./new/'+ value?.id], { relativeTo: this.ar });
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
-->
|
||||
<page-header-wrapper [title]="'新增网络货运人'"></page-header-wrapper>
|
||||
<nz-card>
|
||||
<sf #sf1 [ui]="ui" [schema]="schema1" [button]="'none'">
|
||||
<sf #sf1 [ui]="ui" [schema]="schema1" [formData]="sf1FormData" [button]="'none'">
|
||||
<ng-template sf-template="title1" let-me let-ui="ui" let-schema="schema">
|
||||
<div class="form-title">企业基本信息</div>
|
||||
</ng-template>
|
||||
@ -53,7 +53,7 @@
|
||||
</ng-template>
|
||||
</sf>
|
||||
|
||||
<sf #sf [ui]="ui" [schema]="schema" [button]="'none'">
|
||||
<sf #sf [ui]="ui" [schema]="schema" [formData]="sf2FormData" [button]="'none'">
|
||||
<ng-template sf-template="title99" let-me let-ui="ui" let-schema="schema">
|
||||
<div class="form-title">其他信息</div>
|
||||
</ng-template>
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
import { query } from '@angular/animations';
|
||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { apiConf } from '@conf/api.conf';
|
||||
@ -48,6 +49,11 @@ export class NetworkFreightNewComponent implements OnInit {
|
||||
sf!: SFComponent;
|
||||
@ViewChild('sf1', { static: false })
|
||||
sf1!: SFComponent;
|
||||
sf1FormData: any = {
|
||||
legalPersonIdentityDTO: {
|
||||
},
|
||||
};;
|
||||
sf2FormData: any = {};
|
||||
schema: SFSchema = this.initOthersSF();
|
||||
schema1: SFSchema = this.initBasicInfoSF();
|
||||
ui: SFUISchema = {
|
||||
@ -77,9 +83,63 @@ export class NetworkFreightNewComponent implements OnInit {
|
||||
}
|
||||
};
|
||||
|
||||
constructor(private router: Router, public service: SystemService) {}
|
||||
ngOnInit() {}
|
||||
|
||||
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)
|
||||
}
|
||||
}
|
||||
dataListInit(id: any) {
|
||||
this.service.request(this.service.$api_get_networkTransporter_getDetail,{id: id}).subscribe((res) => {
|
||||
console.log(res);
|
||||
this.sf2FormData = res
|
||||
this.sf1FormData = res.enterpriseInfoVO
|
||||
this.sf1FormData.licensePhotoWatermark = [
|
||||
{
|
||||
uid: -1,
|
||||
name: 'LOGO',
|
||||
status: 'done',
|
||||
url: this.sf1FormData.licensePhotoWatermark,
|
||||
response: this.sf1FormData.licensePhotoWatermark
|
||||
},
|
||||
];
|
||||
// 营业执照法人信息
|
||||
console.log(this.sf1FormData.legalPersonIdentityVO.certificatePhotoFrontWatermark)
|
||||
// this.sf1FormData.legalPersonIdentityDTO.certificatePhotoFrontWatermark = [
|
||||
// {
|
||||
// uid: -1,
|
||||
// name: 'LOGO',
|
||||
// status: 'done',
|
||||
// url: this.sf1FormData.legalPersonIdentityDTO.certificatePhotoFrontWatermark,
|
||||
// response: this.sf1FormData.legalPersonIdentityDTO.certificatePhotoFrontWatermark
|
||||
// },
|
||||
// ];
|
||||
this.sf1FormData.certificatePhotoBackWatermark = [
|
||||
{
|
||||
uid: -1,
|
||||
name: 'LOGO',
|
||||
status: 'done',
|
||||
url: this.sf1FormData.certificatePhotoBackWatermark,
|
||||
response: this.sf1FormData.certificatePhotoBackWatermark,
|
||||
},
|
||||
];
|
||||
const province = this.sf1FormData.fullRegionVO.provinceCode
|
||||
const city = this.sf1FormData.fullRegionVO.cityCode
|
||||
const area = this.sf1FormData.fullRegionVO.areaCode
|
||||
this.sf1FormData.enterpriseAddressCode = [parseInt(province), parseInt(city), parseInt(area)];
|
||||
this.getRegionToThree();
|
||||
})
|
||||
}
|
||||
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);
|
||||
}
|
||||
});
|
||||
}
|
||||
submitForm() {
|
||||
if (!this.sf1.valid || !this.sf.valid) {
|
||||
this.sf.validator({ emitError: true });
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* @Author: your name
|
||||
* @Date: 2021-12-20 17:18:43
|
||||
* @LastEditTime : 2022-02-18 09:49:06
|
||||
* @LastEditTime : 2022-02-18 13:42:49
|
||||
* @LastEditors : Shiming
|
||||
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
||||
* @FilePath : \\tms-obc-web\\src\\app\\routes\\sys-setting\\services\\system.service.ts
|
||||
@ -67,6 +67,8 @@ export class SystemService extends BaseService {
|
||||
$api_networkTransporter_page = '/api/mdc/cuc/networkTransporter/list/page';
|
||||
// 获取网络货运信息表(id)
|
||||
$api_get_networkTransporter = '/api/mdc/cuc/networkTransporter/get';
|
||||
// 获取网络货运信息表(id)
|
||||
$api_get_networkTransporter_getDetail = '/api/mdc/cuc/networkTransporter/getDetail';
|
||||
// 批量获取网络货运信息
|
||||
$api_findNetworkTransporterByIds = '/api/mdc/cuc/networkTransporter/findNetworkTransporterByIds';
|
||||
// 查找所有网络货运信息(下拉)
|
||||
@ -167,7 +169,8 @@ export class SystemService extends BaseService {
|
||||
$api_ocr_recognize_id_card = '/api/mdc/pbc/hwc/ocr/recognizeIdCard';
|
||||
// 获取字典
|
||||
$api_getDictValue = '/api/mdc/pbc/dictItems/getDictValue';
|
||||
|
||||
// 获取一、二、三级地区详情
|
||||
$api_getRegionToThree = '/api/mdc/pbc/region/getRegionToThree';
|
||||
$api_getRoleTemplateInfo: string = '';
|
||||
$api_getFunctionButtonInfo: string = '/api/mdc/cuc/functionButton/getFunctionButtonByFunctionId';
|
||||
$api_getFunctionDataInfo: string = '';
|
||||
|
||||
@ -37,7 +37,7 @@ const routes: Routes = [
|
||||
{ path: 'goods-name-config', component: GoodsNameConfigComponent },
|
||||
{ path: 'crm-management', component: CrmManagementComponent },
|
||||
{ path: 'network-freight', component: NetworkFreightComponent },
|
||||
{ path: 'network-freight/new', component: NetworkFreightNewComponent },
|
||||
{ path: 'network-freight/new/:id', component: NetworkFreightNewComponent },
|
||||
{ path: 'close-account', component: CloseAccountComponent },
|
||||
// { path: 'btn-management', component: BtnManagementComponent },
|
||||
{ path: 'announcement-message', component: AnnouncementMessageComponent },
|
||||
|
||||
Reference in New Issue
Block a user