This commit is contained in:
Taric Xin
2021-12-14 09:14:21 +08:00
parent d1142fecc1
commit 64a3d18c88
3 changed files with 120 additions and 238 deletions

View File

@ -1,7 +1,6 @@
<page-header-wrapper [title]="'新增企业'"></page-header-wrapper> <page-header-wrapper [title]="'新增企业'"></page-header-wrapper>
<nz-card> <nz-card>
<ng-container> <sf #sf1 [ui]="ui" [schema]="schema1" [button]="'none'">
<sf #sf1 [ui]="ui" [schema]="schema1" [button]="'none'" [formData]="infoData1">
<ng-template sf-template="title1" let-me let-ui="ui" let-schema="schema"> <ng-template sf-template="title1" let-me let-ui="ui" let-schema="schema">
<div class="form-title">企业基本信息</div> <div class="form-title">企业基本信息</div>
</ng-template> </ng-template>
@ -44,7 +43,7 @@
</ng-template> </ng-template>
</sf> </sf>
<sf #sf [ui]="ui" [schema]="schema" [button]="'none'" [formData]="infoData"> <sf #sf [ui]="ui" [schema]="schema" [button]="'none'">
<ng-template sf-template="title1" let-me let-ui="ui" let-schema="schema"> <ng-template sf-template="title1" let-me let-ui="ui" let-schema="schema">
<div class="form-title">企业开票信息</div> <div class="form-title">企业开票信息</div>
</ng-template> </ng-template>
@ -84,13 +83,10 @@
<div class="pa"><img width="190" src="./assets/images/usercenter/certificate-demo-back.png" /></div> <div class="pa"><img width="190" src="./assets/images/usercenter/certificate-demo-back.png" /></div>
</div> </div>
</ng-template> </ng-template>
</sf> </sf>
<div style="padding-left: 379px"> <div style="padding-left: 379px">
<button nz-button type="button" nzType="primary" (click)="submitForm()">确认新增</button> <button nz-button type="button" nzType="primary" (click)="submitForm()">确认新增</button>
<button nz-button (click)="goBack()">返回</button> <button nz-button (click)="goBack()">返回</button>
</div> </div>
</ng-container>
</nz-card> </nz-card>

View File

@ -1,33 +1,6 @@
:host { :host {
::ng-deep { ::ng-deep {
nz-card { nz-card {
.page-title {
margin-bottom: 39px;
color : #333;
font-weight : 500;
font-size : 20px;
line-height : 28px;
text-align : center;
}
.step-title {
display: block;
width : 800px !important;
margin : 0 auto;
}
.myForm {
width : 680px;
margin: 5rem auto;
}
.steps-content {
min-height: 250px;
}
.btn-submit {
margin-top: 16px;
}
.pr { .pr {
position: relative; position: relative;
@ -65,46 +38,10 @@
border-left : solid 3px #1890ff; border-left : solid 3px #1890ff;
} }
.form-content {
padding: 48px 32px;
}
.apply-sv {
margin : 16px 0;
padding : 20px;
background : #f8f8f8;
border-radius: 2px;
}
.result-date {
font-size: 12px;
}
.result-tips {
color : #ff4d4f;
font-size: 14px;
}
.sv-img {
display : inline-block;
width : 104px;
height : 104px;
margin-right : 20px;
padding : 8px;
background : #fff;
border : 1px solid rgba(0, 0, 0, 0.15);
border-radius: 2px;
img {
width : 100%;
height: 100%;
}
}
} }
.ant-form-item { .ant-form-item {
margin-left: 180px; margin-left: 180px;
} }
nz-date-picker, nz-date-picker,

View File

@ -8,29 +8,14 @@ import {
SFDateWidgetSchema, SFDateWidgetSchema,
SFSchema, SFSchema,
SFSchemaEnum, SFSchemaEnum,
SFSelectWidgetSchema,
SFTextareaWidgetSchema, SFTextareaWidgetSchema,
SFUISchema, SFUISchema,
SFUploadWidgetSchema SFUploadWidgetSchema
} from '@delon/form'; } from '@delon/form';
import { ModalHelper } from '@delon/theme';
import { EnvironmentService } from '@env/environment.service';
import { NzCascaderOption } from 'ng-zorro-antd/cascader';
import { NzMessageService } from 'ng-zorro-antd/message'; import { NzMessageService } from 'ng-zorro-antd/message';
import { NzModalService } from 'ng-zorro-antd/modal';
import { of } from 'rxjs';
import { map } from 'rxjs/operators';
import { UsermanageService } from 'src/app/routes/usercenter/services/usercenter.service'; import { UsermanageService } from 'src/app/routes/usercenter/services/usercenter.service';
// import { AccountService } from '../../services/account.service';
// import { AccountComponentsImgViewComponent } from '../img-view/img-view.component';
@Component({ const IMAGECONFIG = {
selector: 'app-account-components-freight-new',
templateUrl: './new.component.html',
styleUrls: ['./new.component.less']
})
export class FreightComponentsListNewComponent implements OnInit {
private imageConfig = {
action: apiConf.waterFileUpload, action: apiConf.waterFileUpload,
fileType: 'image/png,image/jpeg,image/jpg,image/gif', fileType: 'image/png,image/jpeg,image/jpg,image/gif',
fileSize: 5120, fileSize: 5120,
@ -44,13 +29,19 @@ export class FreightComponentsListNewComponent implements OnInit {
listType: 'picture-card' listType: 'picture-card'
}; };
private dateConfig = { const DATECONFIG = {
grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, grid: { xxl: 13, xl: 18, lg: 24, md: 24 },
widget: 'date', widget: 'date',
format: 'yyyy-MM-dd', format: 'yyyy-MM-dd',
placeholder: '请选择' placeholder: '请选择'
}; };
@Component({
selector: 'app-account-components-freight-new',
templateUrl: './new.component.html',
styleUrls: ['./new.component.less']
})
export class FreightComponentsListNewComponent implements OnInit {
@ViewChild('sf', { static: false }) @ViewChild('sf', { static: false })
sf!: SFComponent; sf!: SFComponent;
@ViewChild('sf1', { static: false }) @ViewChild('sf1', { static: false })
@ -85,15 +76,7 @@ export class FreightComponentsListNewComponent implements OnInit {
} }
}; };
infoData: any = {}; constructor(private router: Router, private service: UsermanageService) {}
infoData1: any = {};
enterpriseAddressCodeStr = '';
enterpriseAddressCode: any;
enterpriseBusinessAddressCodeStr = '';
enterpriseBusinessAddressCode = '';
regionData: any = [];
constructor(public msg: NzMessageService, private router: Router, private service: UsermanageService) {}
ngOnInit() {} ngOnInit() {}
submitForm() { submitForm() {
@ -123,7 +106,6 @@ export class FreightComponentsListNewComponent implements OnInit {
} }
); );
this.service.request(this.service.$api_save_enterprise_admin, params).subscribe(res => { this.service.request(this.service.$api_save_enterprise_admin, params).subscribe(res => {
console.log(res);
if (res) { if (res) {
this.service.msgSrv.success('企业新增成功'); this.service.msgSrv.success('企业新增成功');
this.goBack(); this.goBack();
@ -141,6 +123,7 @@ export class FreightComponentsListNewComponent implements OnInit {
// 根据地区code查询地区详情 // 根据地区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 });
} }
longTime(i: boolean | SFSchemaEnum[], type: string) { longTime(i: boolean | SFSchemaEnum[], type: string) {
if (type === 'schema') { if (type === 'schema') {
if (i) { if (i) {
@ -177,16 +160,6 @@ export class FreightComponentsListNewComponent implements OnInit {
} }
} }
goPage(page: string) {
if (page === 'list') {
this.router.navigate(['./account/role']);
} else {
this.router.navigate(['./account/apply-list']);
}
}
goBack() {
window.history.go(-1);
}
checkIdCard(imgurl: any, isFront: number, type: number) { checkIdCard(imgurl: any, isFront: number, type: number) {
// 识别身份证 参数isFront0-正面、1-背面type0-申请人身份证1-法定代表人身份证 // 识别身份证 参数isFront0-正面、1-背面type0-申请人身份证1-法定代表人身份证
const params = { const params = {
@ -287,6 +260,10 @@ export class FreightComponentsListNewComponent implements OnInit {
// }); // });
} }
goBack() {
window.history.go(-1);
}
private initBasicInfoSF(): SFSchema { private initBasicInfoSF(): SFSchema {
return { return {
properties: { properties: {
@ -297,11 +274,8 @@ export class FreightComponentsListNewComponent implements OnInit {
type: 'string', type: 'string',
title: '营业执照', title: '营业执照',
ui: { ui: {
...this.imageConfig, ...IMAGECONFIG,
descriptionI18n: '图片支持jpg、jpeg、png、gif格式大小不超过5M', descriptionI18n: '图片支持jpg、jpeg、png、gif格式大小不超过5M',
data: {
appId: this.service.envSrv.getEnvironment().appId
},
change: args => { change: args => {
if (args.type === 'success') { if (args.type === 'success') {
this.sf1.setValue('/licensePhoto', args.fileList[0].response.data.fullFilePath); this.sf1.setValue('/licensePhoto', args.fileList[0].response.data.fullFilePath);
@ -354,7 +328,6 @@ export class FreightComponentsListNewComponent implements OnInit {
enterpriseAddressCode: { enterpriseAddressCode: {
type: 'number', type: 'number',
title: '营业执照所在地', title: '营业执照所在地',
// default: [110000, 110100, 110105],
ui: { ui: {
grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, grid: { xxl: 13, xl: 18, lg: 24, md: 24 },
widget: 'cascader', widget: 'cascader',
@ -372,9 +345,6 @@ export class FreightComponentsListNewComponent implements OnInit {
} }
); );
}); });
},
change: (ngModel: string | any[]) => {
console.log(ngModel);
} }
} as SFCascaderWidgetSchema } as SFCascaderWidgetSchema
}, },
@ -412,12 +382,9 @@ export class FreightComponentsListNewComponent implements OnInit {
title: '成立日期', title: '成立日期',
type: 'string', type: 'string',
ui: { ui: {
...this.dateConfig, ...DATECONFIG,
errors: { errors: {
required: '请选择开始日期' required: '请选择开始日期'
},
change: i => {
// this.sf1?.setValue('/dateType1', false);
} }
} as SFDateWidgetSchema } as SFDateWidgetSchema
}, },
@ -425,7 +392,7 @@ export class FreightComponentsListNewComponent implements OnInit {
title: '营业期限', title: '营业期限',
type: 'string', type: 'string',
ui: { ui: {
...this.dateConfig, ...DATECONFIG,
errors: { errors: {
required: '请选择截止日期' required: '请选择截止日期'
}, },
@ -478,11 +445,8 @@ export class FreightComponentsListNewComponent implements OnInit {
type: 'string', type: 'string',
title: '', title: '',
ui: { ui: {
...this.imageConfig, ...IMAGECONFIG,
descriptionI18n: '图片支持jpg、jpeg、png、gif格式大小不超过5M', descriptionI18n: '图片支持jpg、jpeg、png、gif格式大小不超过5M',
data: {
// appId: this.envSrv.getEnvironment().appId,
},
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);
@ -498,11 +462,8 @@ export class FreightComponentsListNewComponent implements OnInit {
type: 'string', type: 'string',
title: '', title: '',
ui: { ui: {
...this.imageConfig, ...IMAGECONFIG,
descriptionI18n: '图片支持jpg、jpeg、png、gif格式大小不超过5M', descriptionI18n: '图片支持jpg、jpeg、png、gif格式大小不超过5M',
data: {
// appId: this.envSrv.getEnvironment().appId,
},
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);
@ -555,9 +516,6 @@ export class FreightComponentsListNewComponent implements OnInit {
placeholder: '请选择', placeholder: '请选择',
errors: { errors: {
required: '请选择开始日期' required: '请选择开始日期'
},
change: i => {
// this.sf1?.setValue('/dateType1', false);
} }
} as SFDateWidgetSchema } as SFDateWidgetSchema
}, },
@ -661,11 +619,8 @@ export class FreightComponentsListNewComponent implements OnInit {
type: 'string', type: 'string',
title: '', title: '',
ui: { ui: {
...this.imageConfig, ...IMAGECONFIG,
descriptionI18n: '图片支持jpg、jpeg、png、gif格式大小不超过5M', descriptionI18n: '图片支持jpg、jpeg、png、gif格式大小不超过5M',
data: {
// appId: this.envSrv.getEnvironment().appId,
},
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);
@ -686,11 +641,8 @@ export class FreightComponentsListNewComponent implements OnInit {
type: 'string', type: 'string',
title: '', title: '',
ui: { ui: {
...this.imageConfig, ...IMAGECONFIG,
descriptionI18n: '图片支持jpg、jpeg、png、gif格式大小不超过5M', descriptionI18n: '图片支持jpg、jpeg、png、gif格式大小不超过5M',
data: {
// appId: this.envSrv.getEnvironment().appId,
},
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);
@ -725,11 +677,8 @@ export class FreightComponentsListNewComponent implements OnInit {
type: 'string', type: 'string',
title: '', title: '',
ui: { ui: {
...this.imageConfig, ...IMAGECONFIG,
descriptionI18n: '图片支持jpg、jpeg、png、gif格式大小不超过5M', descriptionI18n: '图片支持jpg、jpeg、png、gif格式大小不超过5M',
data: {
// appId: this.envSrv.getEnvironment().appId,
},
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);