This commit is contained in:
TaricXin
2022-03-18 17:12:33 +08:00
parent 634c4bc6cc
commit 57e18b18b1
5 changed files with 215 additions and 270 deletions

View File

@ -15,17 +15,17 @@
<div class="pr">万元</div>
</ng-template>
<!-- 企业法人信息 -->
<ng-template sf-template="legalPersonIdentityDTO/_legalPersontitle" let-me let-ui="ui" let-schema="schema">
<div class="form-title" style="margin-top: 40px;margin-left: -180px;">营业执照法人信息</div>
<!-- 企业法人信息 -->
<ng-template sf-template="legalPersonIdentity/_legalPersontitle" let-me let-ui="ui" let-schema="schema">
<div class="form-title" style="margin-top: 40px; margin-left: -180px">营业执照法人信息</div>
</ng-template>
<ng-template sf-template="legalPersonIdentityDTO/_certificatePhototips" let-me let-ui="ui" let-schema="schema">
<ng-template sf-template="legalPersonIdentity/_certificatePhototips" let-me let-ui="ui" let-schema="schema">
<div class="pr">
<div>请上传身份证原件的高清照片,若上传复印件,则需申请人签字;</div>
<div>上传后系统会自动识别并填写</div>
</div>
</ng-template>
<ng-template sf-template="legalPersonIdentityDTO/_certificatePhotoExmplateA" let-me let-ui="ui" let-schema="schema">
<ng-template sf-template="legalPersonIdentity/_certificatePhotoExmplateA" let-me let-ui="ui" let-schema="schema">
<div class="pr">
<dl class="tips">
<dt>正面照(人像面)</dt>
@ -34,7 +34,7 @@
<div class="pa"><img width="190" src="./assets/images/usercenter/certificate-demo-front.png" /></div>
</div>
</ng-template>
<ng-template sf-template="legalPersonIdentityDTO/_certificatePhotoExmplateB" let-me let-ui="ui" let-schema="schema">
<ng-template sf-template="legalPersonIdentity/_certificatePhotoExmplateB" let-me let-ui="ui" let-schema="schema">
<div class="pr">
<dl class="tips">
<dt>背面照(国徽面)</dt>
@ -45,8 +45,8 @@
</ng-template>
<!-- 企业管理员信息 -->
<ng-template sf-template="adminUserInfo/_adminTitle" let-me let-ui="ui" let-schema="schema">
<div class="form-title" style="margin-top: 40px;margin-left: -180px;">企业管理员信息</div>
<ng-template sf-template="_adminTitle" let-me let-ui="ui" let-schema="schema">
<div class="form-title" style="margin-top: 40px; margin-left: -180px">企业管理员信息</div>
</ng-template>
<ng-template sf-template="adminUserInfo/_adminCertificatePhotoTipsA" let-me let-ui="ui" let-schema="schema">
<div class="pr">
@ -69,19 +69,17 @@
<!-- 所属城市 -->
<ng-template sf-template="_addressTitle" let-me let-ui="ui" let-schema="schema">
<div class="form-title" style="margin-top: 40px;margin-left: -180px;">所属城市</div>
<div class="form-title" style="margin-top: 40px; margin-left: -180px">所属城市</div>
</ng-template>
<!-- 渠道销售 -->
<ng-template sf-template="_channelTitle" let-me let-ui="ui" let-schema="schema">
<div class="form-title" style="margin-top: 40px;margin-left: -180px;">渠道销售</div>
<!-- 渠道销售 -->
<ng-template sf-template="_channelTitle" let-me let-ui="ui" let-schema="schema">
<div class="form-title" style="margin-top: 40px; margin-left: -180px">渠道销售</div>
</ng-template>
</sf>
<div style="display: flex;justify-content: center;">
<button nz-button type="button" nzType="primary" (click)="submitForm()"
[nzLoading]="service.http.loading">确认新增</button>
<div style="display: flex; justify-content: center">
<button nz-button type="button" nzType="primary" (click)="submitForm()" [nzLoading]="service.http.loading">确认新增</button>
<button nz-button (click)="goBack()">返回</button>
</div>
</nz-card>
</nz-card>

View File

@ -1,19 +1,18 @@
import { Component, ViewChild } from '@angular/core';
import { Router } from '@angular/router';
import { apiConf } from '@conf/api.conf';
import {
SFUploadWidgetSchema,
SFComponent,
SFSchema,
SFUISchema,
SFCascaderWidgetSchema,
SFTextareaWidgetSchema,
SFDateWidgetSchema,
SFCheckboxWidgetSchema,
SFTreeSelectWidgetSchema
} from '@delon/form';
import { NzTreeNode } from 'ng-zorro-antd/tree';
import { NzUploadFile } from 'ng-zorro-antd/upload';
import { of } from 'rxjs';
import { map } from 'rxjs/operators';
import { PartnerListService } from '../../services/partner-list.service';
@ -65,7 +64,7 @@ export class AddEtpPartnerComponent {
}
};
constructor(private router: Router, public service: PartnerListService) {}
constructor(public service: PartnerListService) {}
submitForm() {
if (!this.sf.valid) {
@ -73,59 +72,46 @@ export class AddEtpPartnerComponent {
this.service.msgSrv.warning('请修改填写错误信息');
return;
}
const enterpriseRegistrationTime = new Date(this.sf.value.enterpriseRegistrationTime);
const operatingStartTime = new Date(this.sf.value.operatingStartTime);
if (enterpriseRegistrationTime.getTime() > operatingStartTime.getTime()) {
this.service.msgSrv.warning('营业期限不能小于成立日期');
if (this.sf.value.cityCodesList?.length > 3) {
this.sf.validator({ emitError: true });
this.service.msgSrv.warning('所属城市不能超过3个');
return;
}
if (this.sf.value.operatingEndTime) {
const operatingEndTime = new Date(this.sf.value.operatingEndTime);
if (operatingStartTime.getTime() > operatingEndTime.getTime()) {
this.service.msgSrv.warning('营业期限不能小于期限开始日期');
return;
}
// 校验企业营业期限
const operatingStartTime = new Date(this.sf.value.operatingStartTime);
const operatingEndTime = new Date(this.sf.value.operatingEndTime);
if (operatingStartTime.getTime() > operatingEndTime.getTime()) {
this.service.msgSrv.warning('营业截止日期不能小于开始日期');
return;
}
const validStartTime = new Date(this.sf.value.legalPersonIdentityDTO.validStartTime);
if (this.sf.value.legalPersonIdentityDTO.validEndTime) {
const validEndTime = new Date(this.sf.value.legalPersonIdentityDTO.validEndTime);
// 校验法人证件有效期限
if (this.sf.value.legalPersonIdentity.validEndTime) {
const validStartTime = new Date(this.sf.value.legalPersonIdentity.validStartTime);
const validEndTime = new Date(this.sf.value.legalPersonIdentity.validEndTime);
if (validStartTime.getTime() > validEndTime.getTime()) {
this.service.msgSrv.warning('法人证件有效截止日期小于开始日期');
this.service.msgSrv.warning('法人证件有效截止日期不能小于开始日期');
return;
}
}
const sfVlaue = this.sf.value;
const params = {};
Object.assign(
params,
{ ...this.sf.value },
{
enterpriseAddressCode: this.sf.value.enterpriseAddressCode[2],
oftenUsedServices: sfVlaue.oftenUsedServices,
registerAddress: sfVlaue.registerAddress,
registerPhone: sfVlaue.registerPhone,
creditPhoto: sfVlaue.creditPhoto,
creditPhotoWatermark: sfVlaue.creditPhotoWatermark,
promotersTelephone: sfVlaue.promotersTelephone,
networkTransporter: sfVlaue.networkTransporter,
adminUserInfo: {
certificateNumber: sfVlaue.certificateNumber,
certificatePhotoBack: sfVlaue.certificatePhotoBack,
certificatePhotoBackWatermark: sfVlaue.certificatePhotoBackWatermark,
certificatePhotoFront: sfVlaue.certificatePhotoFront,
certificatePhotoFrontWatermark: sfVlaue.certificatePhotoFrontWatermark,
name: sfVlaue.name
}
// 校验管理员证件有效期限
if (this.sf.value.adminUserInfo.validEndTime) {
const validStartTime = new Date(this.sf.value.adminUserInfo.validStartTime);
const validEndTime = new Date(this.sf.value.adminUserInfo.validEndTime);
if (validStartTime.getTime() > validEndTime.getTime()) {
this.service.msgSrv.warning('管理员证件有效截止日期小于开始日期');
return;
}
);
console.log(params);
}
const params = {};
Object.assign(params, { ...this.sf.value, source: 2 });
// console.log(params);
// this.service.request(this.service.$api_save_entp_partner, params).subscribe(res => {
// if (res) {
// this.service.msgSrv.success('企业新增成功');
// this.goBack();
// }
// });
this.service.request(this.service.$api_save_entp_partner, params).subscribe(res => {
if (res) {
this.service.msgSrv.success('新增企业合伙人成功');
this.goBack();
}
});
}
/*
@ -148,23 +134,23 @@ export class AddEtpPartnerComponent {
if (isFront === 'front') {
// 正面
if (res.name) {
this.sf.setValue('/legalPersonIdentityDTO/name', res.name);
this.sf.setValue('/legalPersonIdentity/name', res.name);
}
if (res.number) {
this.sf.setValue('/legalPersonIdentityDTO/certificateType', 0);
this.sf.setValue('/legalPersonIdentityDTO/certificateNumber', res.number);
this.sf.setValue('/legalPersonIdentity/certificateType', 0);
this.sf.setValue('/legalPersonIdentity/certificateNumber', res.number);
}
}
if (isFront === 'back') {
// 背面
if (res.validFrom) {
this.sf.setValue('/legalPersonIdentityDTO/validStartTime', res.validFrom);
this.sf.setValue('/legalPersonIdentity/validStartTime', res.validFrom);
}
if (res.validTo) {
this.sf.setValue('/legalPersonIdentityDTO/validEndTime', res.validTo);
this.sf.setValue('/legalPersonIdentityDTO/_isLoingDate', false);
this.sf.setValue('/legalPersonIdentity/validEndTime', res.validTo);
this.sf.setValue('/legalPersonIdentity/_isLoingDate', false);
} else {
this.sf.setValue('/legalPersonIdentityDTO/_isLoingDate', true);
this.sf.setValue('/legalPersonIdentity/_isLoingDate', true);
}
}
}
@ -173,10 +159,22 @@ export class AddEtpPartnerComponent {
if (isFront === 'front') {
// 正面
if (res.name) {
this.sf.setValue('/name', res.name);
this.sf.setValue('/adminUserInfo/name', res.name);
}
if (res.number) {
this.sf.setValue('/certificateNumber', res.number);
this.sf.setValue('/adminUserInfo/certificateNumber', res.number);
}
}
if (isFront === 'back') {
// 背面
if (res.validFrom) {
this.sf.setValue('/adminUserInfo/validStartTime', res.validFrom);
}
if (res.validTo) {
this.sf.setValue('/adminUserInfo/validEndTime', res.validTo);
this.sf.setValue('/adminUserInfo/_isLoingDate', false);
} else {
this.sf.setValue('/adminUserInfo/_isLoingDate', true);
}
}
}
@ -194,29 +192,15 @@ export class AddEtpPartnerComponent {
if (res.name) {
this.sf.setValue('/enterpriseName', res.name);
}
if (res.type) {
this.sf.setValue('/enterpriseType', res.type);
}
if (res.addressRegionCodes) {
this.sf.setValue('/enterpriseAddressCode', res.addressRegionCodes);
}
if (res.address) {
this.sf.setValue('/enterpriseAddress', res.address);
}
if (res.foundDate) {
this.sf.setValue('/enterpriseRegistrationTime', res.foundDate);
}
if (res.businessTermStartDate) {
this.sf.setValue('/operatingStartTime', res.businessTermStartDate);
}
if (res.businessTermEndDate) {
this.sf.setValue('/operatingEndTime', res.businessTermEndDate);
this.sf.setValue('/_isLoingDate', false);
} else {
this.sf.setValue('/_isLoingDate', true);
}
if (res.businessScope) {
this.sf.setValue('/businessScope', res.businessScope);
}
}
});
}
@ -310,7 +294,7 @@ export class AddEtpPartnerComponent {
},
// 法人信息
legalPersonIdentityDTO: {
legalPersonIdentity: {
type: 'object',
properties: {
_legalPersontitle: { title: '', type: 'string', ui: { widget: 'custom' } },
@ -324,7 +308,7 @@ export class AddEtpPartnerComponent {
descriptionI18n: '图片支持jpg、jpeg、png、gif格式大小不超过5M',
change: args => {
if (args.type === 'success') {
this.sf.setValue('/legalPersonIdentityDTO/certificatePhotoFront', args.fileList[0].response.data.fullFilePath);
this.sf.setValue('/legalPersonIdentity/certificatePhotoFront', args.fileList[0].response.data.fullFilePath);
this.checkIdCard(args.fileList[0].response.data.fullFilePath, 'front', 1);
}
}
@ -341,7 +325,7 @@ export class AddEtpPartnerComponent {
descriptionI18n: '图片支持jpg、jpeg、png、gif格式大小不超过5M',
change: args => {
if (args.type === 'success') {
this.sf.setValue('/legalPersonIdentityDTO/certificatePhotoBack', args.fileList[0].response.data.fullFilePath);
this.sf.setValue('/legalPersonIdentity/certificatePhotoBack', args.fileList[0].response.data.fullFilePath);
this.checkIdCard(args.fileList[0].response.data.fullFilePath, 'back', 1);
}
}
@ -406,7 +390,7 @@ export class AddEtpPartnerComponent {
required: '请选择截止日期'
},
change: i => {
this.sf?.setValue('/legalPersonIdentityDTO/_isLoingDate', false);
this.sf?.setValue('/legalPersonIdentity/_isLoingDate', false);
}
} as SFDateWidgetSchema
},
@ -418,7 +402,7 @@ export class AddEtpPartnerComponent {
grid: { span: 6 },
class: 'input-back',
widget: 'checkbox',
change: i => this.sf?.setValue('/legalPersonIdentityDTO/validEndTime', null)
change: i => this.sf?.setValue('/legalPersonIdentity/validEndTime', null)
} as SFCheckboxWidgetSchema
}
},
@ -432,23 +416,23 @@ export class AddEtpPartnerComponent {
'validStartTime'
]
},
_adminTitle: { title: '', type: 'string', ui: { widget: 'custom' } },
adminMobile: {
title: ' 企业管理员手机号',
type: 'string',
minLength: 1,
format: 'mobile',
maxLength: 11,
ui: {
grid: { xxl: 13, xl: 18, lg: 24, md: 24 },
placeholder: '请输入企业管理员手机号',
errors: { required: '请输入企业管理员手机号', format: '手机号格式错误' }
}
},
// 企业管理员信息
adminUserInfo: {
type: 'object',
properties: {
_adminTitle: { title: '', type: 'string', ui: { widget: 'custom' } },
adminMobile: {
title: ' 企业管理员手机号',
type: 'string',
minLength: 1,
format: 'mobile',
maxLength: 11,
ui: {
grid: { xxl: 13, xl: 18, lg: 24, md: 24 },
placeholder: '请输入企业管理员手机号',
errors: { required: '请输入企业管理员手机号', format: '手机号格式错误' }
}
},
_adminCertificatePhotoTipsA: {
title: '企业管理员证件照',
type: 'string',
@ -467,7 +451,7 @@ export class AddEtpPartnerComponent {
descriptionI18n: '图片支持jpg、jpeg、png、gif格式大小不超过5M',
change: args => {
if (args.type === 'success') {
this.sf.setValue('/certificatePhotoFront', args.fileList[0].response.data.fullFilePath);
this.sf.setValue('/adminUserInfo/certificatePhotoFront', args.fileList[0].response.data.fullFilePath);
this.checkIdCard(args.fileList[0].response.data.fullFilePath, 'front', 0);
}
}
@ -489,7 +473,8 @@ export class AddEtpPartnerComponent {
descriptionI18n: '图片支持jpg、jpeg、png、gif格式大小不超过5M',
change: args => {
if (args.type === 'success') {
this.sf.setValue('/certificatePhotoBack', args.fileList[0].response.data.fullFilePath);
this.sf.setValue('/adminUserInfo/certificatePhotoBack', args.fileList[0].response.data.fullFilePath);
this.checkIdCard(args.fileList[0].response.data.fullFilePath, 'back', 0);
}
}
} as SFUploadWidgetSchema
@ -514,7 +499,7 @@ export class AddEtpPartnerComponent {
placeholder: '请输入企业管理员身份证号'
}
},
operatingStartTime: {
validStartTime: {
title: '身份证有效开始日期',
type: 'string',
ui: {
@ -525,7 +510,7 @@ export class AddEtpPartnerComponent {
}
} as SFDateWidgetSchema
},
operatingEndTime: {
validEndTime: {
title: '身份证有效截止日期',
type: 'string',
ui: {
@ -547,34 +532,38 @@ export class AddEtpPartnerComponent {
grid: { span: 6 },
class: 'input-back',
widget: 'checkbox',
change: i => this.sf?.setValue('/adminUserInfo/operatingEndTime', null)
change: i => this.sf?.setValue('/adminUserInfo/validEndTime', null)
} as SFCheckboxWidgetSchema
}
},
required: ['_adminCertificatePhotoTipsA', 'adminMobile', 'name', 'certificateNumber', 'operatingStartTime']
required: ['_adminCertificatePhotoTipsA', 'name', 'certificateNumber', 'operatingStartTime']
},
// 所属城市
_addressTitle: { title: '', type: 'string', ui: { widget: 'custom' } },
status3: {
cityCodesList: {
type: 'string',
title: '所属城市',
default: ['WAIT_BUYER_PAY', 'TRADE_FINISHED'],
ui: {
widget: 'tree-select',
grid: { xxl: 13, xl: 18, lg: 24, md: 24 },
placeholder: '请选择城市(最多3个)',
checkable: true,
class: 'city-tree-select',
asyncData: () =>
of([
{ title: '待支付', key: 'WAIT_BUYER_PAY' },
{ title: '已支付', key: 'TRADE_SUCCESS' },
{ title: '交易完成', key: 'TRADE_FINISHED' }
])
this.getRegionDetailByCode('').pipe(
map((res: any) =>
res.map((item: any) => ({ ...item, title: item.name, key: item.regionCode, disabled: true, isDisableCheckbox: true }))
)
),
expandChange: ({ node }: { node: NzTreeNode }) =>
this.getRegionDetailByCode(node.key).pipe(
map((res: any) => res.map((item: any) => ({ ...item, title: item.name, key: item.regionCode, isLeaf: true })))
)
} as SFTreeSelectWidgetSchema
},
// 渠道销售
_channelTitle: { title: '', type: 'string', ui: { widget: 'custom' } },
channel: {
invitationCode: {
title: '渠道销售邀请码',
type: 'string',
minLength: 1,
@ -594,8 +583,9 @@ export class AddEtpPartnerComponent {
'unifiedSocialCreditCode',
'enterpriseName',
'operatingStartTime',
'status3',
'channel'
'cityCodesList',
'adminMobile',
'invitationCode'
]
};
}

View File

@ -1,44 +1,42 @@
<page-header-wrapper [title]="'新增个人合伙人'"></page-header-wrapper>
<nz-card>
<sf #sf [ui]="ui" [schema]="schema" [button]="'none'">
<!-- 合伙人信息 -->
<ng-template sf-template="adminUserInfo/_adminTitle" let-me let-ui="ui" let-schema="schema">
<div class="form-title" style="margin-top: 40px;margin-left: -180px;">合伙人信息</div>
</ng-template>
<ng-template sf-template="adminUserInfo/_adminCertificatePhotoTipsA" let-me let-ui="ui" let-schema="schema">
<div class="pr">
<dl class="tips">
<dt>正面照(人像面)</dt>
<dd>示例</dd>
</dl>
<div class="pa"><img width="190" src="./assets/images/usercenter/certificate-demo-front.png" /></div>
</div>
</ng-template>
<ng-template sf-template="adminUserInfo/_adminCertificatePhotoTipsB" let-me let-ui="ui" let-schema="schema">
<div class="pr">
<dl class="tips">
<dt>背面照(国徽面)</dt>
<dd>示例</dd>
</dl>
<div class="pa"><img width="190" src="./assets/images/usercenter/certificate-demo-back.png" /></div>
</div>
</ng-template>
<sf #sf [ui]="ui" [schema]="schema" [button]="'none'">
<!-- 合伙人信息 -->
<ng-template sf-template="adminUserInfo/_adminTitle" let-me let-ui="ui" let-schema="schema">
<div class="form-title" style="margin-top: 40px; margin-left: -180px">合伙人信息</div>
</ng-template>
<ng-template sf-template="adminUserInfo/_adminCertificatePhotoTipsA" let-me let-ui="ui" let-schema="schema">
<div class="pr">
<dl class="tips">
<dt>正面照(人像面)</dt>
<dd>示例</dd>
</dl>
<div class="pa"><img width="190" src="./assets/images/usercenter/certificate-demo-front.png" /></div>
</div>
</ng-template>
<ng-template sf-template="adminUserInfo/_adminCertificatePhotoTipsB" let-me let-ui="ui" let-schema="schema">
<div class="pr">
<dl class="tips">
<dt>背面照(国徽面)</dt>
<dd>示例</dd>
</dl>
<div class="pa"><img width="190" src="./assets/images/usercenter/certificate-demo-back.png" /></div>
</div>
</ng-template>
<!-- 所属城市 -->
<ng-template sf-template="_addressTitle" let-me let-ui="ui" let-schema="schema">
<div class="form-title" style="margin-top: 40px;margin-left: -180px;">所属城市</div>
</ng-template>
<!-- 所属城市 -->
<ng-template sf-template="_addressTitle" let-me let-ui="ui" let-schema="schema">
<div class="form-title" style="margin-top: 40px; margin-left: -180px">所属城市</div>
</ng-template>
<!-- 渠道销售 -->
<ng-template sf-template="_channelTitle" let-me let-ui="ui" let-schema="schema">
<div class="form-title" style="margin-top: 40px;margin-left: -180px;">渠道销售</div>
</ng-template>
</sf>
<!-- 渠道销售 -->
<ng-template sf-template="_channelTitle" let-me let-ui="ui" let-schema="schema">
<div class="form-title" style="margin-top: 40px; margin-left: -180px">渠道销售</div>
</ng-template>
</sf>
<div style="display: flex;justify-content: center;">
<button nz-button type="button" nzType="primary" (click)="submitForm()"
[nzLoading]="service.http.loading">确认新增</button>
<button nz-button (click)="goBack()">返回</button>
</div>
</nz-card>
<div style="display: flex; justify-content: center">
<button nz-button type="button" nzType="primary" (click)="submitForm()" [nzLoading]="service.http.loading">确认新增</button>
<button nz-button (click)="goBack()">返回</button>
</div>
</nz-card>

View File

@ -73,57 +73,28 @@ export class AddPersonalPartnerComponent {
this.service.msgSrv.warning('请修改填写错误信息');
return;
}
const enterpriseRegistrationTime = new Date(this.sf.value.enterpriseRegistrationTime);
const operatingStartTime = new Date(this.sf.value.operatingStartTime);
if (enterpriseRegistrationTime.getTime() > operatingStartTime.getTime()) {
this.service.msgSrv.warning('营业期限不能小于成立日期');
if (this.sf.value.cityCodesList?.length > 3) {
this.sf.validator({ emitError: true });
this.service.msgSrv.warning('所属城市不能超过3个');
return;
}
if (this.sf.value.operatingEndTime) {
const operatingEndTime = new Date(this.sf.value.operatingEndTime);
if (operatingStartTime.getTime() > operatingEndTime.getTime()) {
this.service.msgSrv.warning('营业期限不能小于期限开始日期');
return;
}
}
const validStartTime = new Date(this.sf.value.legalPersonIdentityDTO.validStartTime);
if (this.sf.value.legalPersonIdentityDTO.validEndTime) {
const validEndTime = new Date(this.sf.value.legalPersonIdentityDTO.validEndTime);
if (this.sf.value.validEndTime) {
const validStartTime = new Date(this.sf.value.validStartTime);
const validEndTime = new Date(this.sf.value.validEndTime);
if (validStartTime.getTime() > validEndTime.getTime()) {
this.service.msgSrv.warning('法人证件有效截止日期小于开始日期');
this.service.msgSrv.warning('身份证有效截止日期不能小于开始日期');
return;
}
}
const sfVlaue = this.sf.value;
const params = {};
Object.assign(
params,
{ ...this.sf.value },
{
enterpriseAddressCode: this.sf.value.enterpriseAddressCode[2],
oftenUsedServices: sfVlaue.oftenUsedServices,
registerAddress: sfVlaue.registerAddress,
registerPhone: sfVlaue.registerPhone,
creditPhoto: sfVlaue.creditPhoto,
creditPhotoWatermark: sfVlaue.creditPhotoWatermark,
promotersTelephone: sfVlaue.promotersTelephone,
networkTransporter: sfVlaue.networkTransporter,
adminUserInfo: {
certificateNumber: sfVlaue.certificateNumber,
certificatePhotoBack: sfVlaue.certificatePhotoBack,
certificatePhotoBackWatermark: sfVlaue.certificatePhotoBackWatermark,
certificatePhotoFront: sfVlaue.certificatePhotoFront,
certificatePhotoFrontWatermark: sfVlaue.certificatePhotoFrontWatermark,
name: sfVlaue.name
}
Object.assign(params, { ...this.sf.value, source: 2 });
this.service.request(this.service.$api_save_personal_partner, params).subscribe(res => {
if (res) {
this.service.msgSrv.success('新增个人合伙人成功');
this.goBack();
}
);
// this.service.request(this.service.$api_save_enterprise_admin, params).subscribe(res => {
// if (res) {
// this.service.msgSrv.success('企业新增成功');
// this.goBack();
// }
// });
});
}
/*
@ -134,48 +105,34 @@ export class AddPersonalPartnerComponent {
}
// 识别身份证 参数isFrontfront-正面、back-背面type0-申请人身份证1-法定代表人身份证
checkIdCard(imgurl: any, isFront: string, type: number) {
checkIdCard(imgurl: any, isFront: string) {
const params = {
idCardUrl: imgurl,
side: isFront
};
this.service.request(this.service.$api_ocr_recognize_id_card, params).subscribe(res => {
if (res) {
if (type === 1) {
// 法定代表人证件照
if (isFront === 'front') {
// 正面
if (res.name) {
this.sf.setValue('/legalPersonIdentityDTO/name', res.name);
}
if (res.number) {
this.sf.setValue('/legalPersonIdentityDTO/certificateType', 0);
this.sf.setValue('/legalPersonIdentityDTO/certificateNumber', res.number);
}
// 法定代表人证件照
if (isFront === 'front') {
// 正面
if (res.name) {
this.sf.setValue('/adminUserInfo/name', res.name);
}
if (isFront === 'back') {
// 背面
if (res.validFrom) {
this.sf.setValue('/legalPersonIdentityDTO/validStartTime', res.validFrom);
}
if (res.validTo) {
this.sf.setValue('/legalPersonIdentityDTO/validEndTime', res.validTo);
this.sf.setValue('/legalPersonIdentityDTO/_isLoingDate', false);
} else {
this.sf.setValue('/legalPersonIdentityDTO/_isLoingDate', true);
}
if (res.number) {
this.sf.setValue('/adminUserInfo/certificateType', 0);
this.sf.setValue('/adminUserInfo/certificateNumber', res.number);
}
}
// 企业管理员证件照
if (type === 0) {
if (isFront === 'front') {
// 正面
if (res.name) {
this.sf.setValue('/name', res.name);
}
if (res.number) {
this.sf.setValue('/certificateNumber', res.number);
}
if (isFront === 'back') {
// 背面
if (res.validFrom) {
this.sf.setValue('/adminUserInfo/validStartTime', res.validFrom);
}
if (res.validTo) {
this.sf.setValue('/adminUserInfo/validEndTime', res.validTo);
this.sf.setValue('/adminUserInfo/_isLoingDate', false);
} else {
this.sf.setValue('/adminUserInfo/_isLoingDate', true);
}
}
}
@ -189,23 +146,23 @@ export class AddPersonalPartnerComponent {
private initBasicInfoSF(): SFSchema {
return {
properties: {
_adminTitle: { title: '', type: 'string', ui: { widget: 'custom' } },
mobile: {
title: ' 手机号',
type: 'string',
minLength: 1,
format: 'mobile',
maxLength: 11,
ui: {
grid: { xxl: 13, xl: 18, lg: 24, md: 24 },
placeholder: '请输入手机号',
errors: { required: '请输入手机号', format: '手机号格式错误' }
}
},
// 合伙人信息
adminUserInfo: {
type: 'object',
properties: {
_adminTitle: { title: '', type: 'string', ui: { widget: 'custom' } },
adminMobile: {
title: ' 手机号',
type: 'string',
minLength: 1,
format: 'mobile',
maxLength: 11,
ui: {
grid: { xxl: 13, xl: 18, lg: 24, md: 24 },
placeholder: '请输入手机号',
errors: { required: '请输入手机号', format: '手机号格式错误' }
}
},
_adminCertificatePhotoTipsA: {
title: '证件照',
type: 'string',
@ -216,6 +173,7 @@ export class AddPersonalPartnerComponent {
},
certificatePhotoFront: { title: '', type: 'string', ui: { hidden: true } },
certificatePhotoBack: { title: '', type: 'string', ui: { hidden: true } },
certificateType: { title: '', type: 'string', ui: { hidden: true }, default: 0 },
certificatePhotoFrontWatermark: {
type: 'string',
title: '',
@ -224,8 +182,8 @@ export class AddPersonalPartnerComponent {
descriptionI18n: '图片支持jpg、jpeg、png、gif格式大小不超过5M',
change: args => {
if (args.type === 'success') {
this.sf.setValue('/certificatePhotoFront', args.fileList[0].response.data.fullFilePath);
this.checkIdCard(args.fileList[0].response.data.fullFilePath, 'front', 0);
this.sf.setValue('/adminUserInfo/certificatePhotoFront', args.fileList[0].response.data.fullFilePath);
this.checkIdCard(args.fileList[0].response.data.fullFilePath, 'front');
}
}
} as SFUploadWidgetSchema
@ -246,7 +204,8 @@ export class AddPersonalPartnerComponent {
descriptionI18n: '图片支持jpg、jpeg、png、gif格式大小不超过5M',
change: args => {
if (args.type === 'success') {
this.sf.setValue('/certificatePhotoBack', args.fileList[0].response.data.fullFilePath);
this.sf.setValue('/adminUserInfo/certificatePhotoBack', args.fileList[0].response.data.fullFilePath);
this.checkIdCard(args.fileList[0].response.data.fullFilePath, 'back');
}
}
} as SFUploadWidgetSchema
@ -271,7 +230,7 @@ export class AddPersonalPartnerComponent {
placeholder: '请输入身份证号'
}
},
operatingStartTime: {
validStartTime: {
title: '身份证有效开始日期',
type: 'string',
ui: {
@ -282,7 +241,7 @@ export class AddPersonalPartnerComponent {
}
} as SFDateWidgetSchema
},
operatingEndTime: {
validEndTime: {
title: '身份证有效截止日期',
type: 'string',
ui: {
@ -304,15 +263,15 @@ export class AddPersonalPartnerComponent {
grid: { span: 6 },
class: 'input-back',
widget: 'checkbox',
change: i => this.sf?.setValue('/adminUserInfo/operatingEndTime', null)
change: i => this.sf?.setValue('/adminUserInfo/validEndTime', null)
} as SFCheckboxWidgetSchema
}
},
required: ['_adminCertificatePhotoTipsA', 'adminMobile', 'name', 'certificateNumber', 'operatingStartTime']
required: ['_adminCertificatePhotoTipsA', 'adminMobile', 'name', 'certificateNumber', 'validStartTime']
},
// 所属城市
_addressTitle: { title: '', type: 'string', ui: { widget: 'custom' } },
status3: {
cityCodesList: {
type: 'string',
title: '所属城市',
ui: {
@ -335,7 +294,7 @@ export class AddPersonalPartnerComponent {
},
// 渠道销售
_channelTitle: { title: '', type: 'string', ui: { widget: 'custom' } },
channel: {
invitationCode: {
title: '渠道销售邀请码',
type: 'string',
minLength: 1,
@ -349,7 +308,7 @@ export class AddPersonalPartnerComponent {
}
}
},
required: ['status3', 'channel']
required: ['cityCodesList', 'invitationCode']
};
}
}

View File

@ -108,7 +108,7 @@
<input
nz-input
type="text"
[(ngModel)]="detailData.legalPersonIdentity.name"
[(ngModel)]="detailData.adminUserInfo.name"
[readonly]="!isEdit"
[nzBorderless]="!isEdit"
[placeholder]="isEdit ? '' : '-'"
@ -118,7 +118,7 @@
<input
nz-input
type="text"
[(ngModel)]="detailData.legalPersonIdentity.certificateNumber"
[(ngModel)]="detailData.adminUserInfo.certificateNumber"
[readonly]="!isEdit"
[nzBorderless]="!isEdit"
[placeholder]="isEdit ? '' : '-'"
@ -136,7 +136,7 @@
</sv>
<sv label="身份证有效期" col="1">
<nz-date-picker
[(ngModel)]="detailData.legalPersonIdentity.validStartTime"
[(ngModel)]="detailData.adminUserInfo.validStartTime"
[nzDisabled]="!isEdit"
nzPlaceHolder=" "
[nzBorderless]="!isEdit"
@ -145,11 +145,11 @@
class="calendar"
></nz-date-picker>
-
<ng-container *ngIf="!isEdit && !detailData?.legalPersonIdentity?.validEndTime && detailData.legalPersonIdentity.validStartTime">
<ng-container *ngIf="!isEdit && !detailData?.adminUserInfo?.validEndTime && detailData.adminUserInfo.validStartTime">
<label style="padding-left: 11px">长期</label>
</ng-container>
<nz-date-picker
[(ngModel)]="detailData.legalPersonIdentity.validEndTime"
[(ngModel)]="detailData.adminUserInfo.validEndTime"
[nzDisabled]="!isEdit"
nzPlaceHolder=" "
[nzBorderless]="!isEdit"
@ -160,8 +160,8 @@
<ng-container *ngIf="isEdit">
<label
nz-checkbox
[ngModel]="!!!detailData.legalPersonIdentity.validEndTime"
(ngModelChange)="$event ? (detailData.legalPersonIdentity.validEndTime = '') : ''"
[ngModel]="!!!detailData.adminUserInfo.validEndTime"
(ngModelChange)="$event ? (detailData.adminUserInfo.validEndTime = '') : ''"
class="ml-sm"
>长期</label
>
@ -173,7 +173,7 @@
*ngTemplateOutlet="
uploadTemplate;
context: {
data: detailData?.legalPersonIdentity,
data: detailData?.adminUserInfo,
status: isEdit,
key: 'certificatePhotoFrontWatermark',
key2: 'certificatePhotoFront',
@ -186,7 +186,7 @@
*ngTemplateOutlet="
uploadTemplate;
context: {
data: detailData?.legalPersonIdentity,
data: detailData?.adminUserInfo,
status: isEdit,
key: 'certificatePhotoBackWatermark',
key2: 'certificatePhotoBack',