diff --git a/src/app/routes/partner/partner-list/components/add-etp-partner/add-etp-partner.component.html b/src/app/routes/partner/partner-list/components/add-etp-partner/add-etp-partner.component.html index 60e444bd..4df4ab9b 100644 --- a/src/app/routes/partner/partner-list/components/add-etp-partner/add-etp-partner.component.html +++ b/src/app/routes/partner/partner-list/components/add-etp-partner/add-etp-partner.component.html @@ -15,17 +15,17 @@
万元
- - -
营业执照法人信息
+ + +
营业执照法人信息
- +
请上传身份证原件的高清照片,若上传复印件,则需申请人签字;
上传后系统会自动识别并填写
- +
正面照(人像面)
@@ -34,7 +34,7 @@
- +
背面照(国徽面)
@@ -45,8 +45,8 @@ - -
企业管理员信息
+ +
企业管理员信息
@@ -69,19 +69,17 @@ -
所属城市
+
所属城市
- - -
渠道销售
+ + +
渠道销售
- -
- +
+
- \ No newline at end of file + diff --git a/src/app/routes/partner/partner-list/components/add-etp-partner/add-etp-partner.component.ts b/src/app/routes/partner/partner-list/components/add-etp-partner/add-etp-partner.component.ts index 00540e31..8ad008d2 100644 --- a/src/app/routes/partner/partner-list/components/add-etp-partner/add-etp-partner.component.ts +++ b/src/app/routes/partner/partner-list/components/add-etp-partner/add-etp-partner.component.ts @@ -1,19 +1,19 @@ -import { Component, OnInit, ViewChild } from '@angular/core'; -import { Router } from '@angular/router'; +import { Component, ViewChild } from '@angular/core'; 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'; const IMAGECONFIG = { @@ -43,7 +43,7 @@ const DATECONFIG = { templateUrl: './add-etp-partner.component.html', styleUrls: ['./add-etp-partner.component.less'] }) -export class AddEtpPartnerComponent implements OnInit { +export class AddEtpPartnerComponent { @ViewChild('sf', { static: false }) sf!: SFComponent; schema: SFSchema = this.initBasicInfoSF(); @@ -64,66 +64,54 @@ export class AddEtpPartnerComponent implements OnInit { } }; - constructor(private router: Router, public service: PartnerListService) {} - ngOnInit() {} + constructor(public service: PartnerListService) {} submitForm() { - if (!this.sf.valid ) { + if (!this.sf.valid) { this.sf.validator({ emitError: true }); 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; } - ); - // this.service.request(this.service.$api_save_enterprise_admin, params).subscribe(res => { - // if (res) { - // this.service.msgSrv.success('企业新增成功'); - // this.goBack(); - // } - // }); + } + 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(); + } + }); } /* @@ -146,23 +134,23 @@ export class AddEtpPartnerComponent implements OnInit { 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); } } } @@ -171,10 +159,22 @@ export class AddEtpPartnerComponent implements OnInit { 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); } } } @@ -192,29 +192,15 @@ export class AddEtpPartnerComponent implements OnInit { 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); - } } }); } @@ -308,7 +294,7 @@ export class AddEtpPartnerComponent implements OnInit { }, // 法人信息 - legalPersonIdentityDTO: { + legalPersonIdentity: { type: 'object', properties: { _legalPersontitle: { title: '', type: 'string', ui: { widget: 'custom' } }, @@ -322,7 +308,7 @@ export class AddEtpPartnerComponent implements OnInit { 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); } } @@ -339,7 +325,7 @@ export class AddEtpPartnerComponent implements OnInit { 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); } } @@ -404,7 +390,7 @@ export class AddEtpPartnerComponent implements OnInit { required: '请选择截止日期' }, change: i => { - this.sf?.setValue('/legalPersonIdentityDTO/_isLoingDate', false); + this.sf?.setValue('/legalPersonIdentity/_isLoingDate', false); } } as SFDateWidgetSchema }, @@ -416,7 +402,7 @@ export class AddEtpPartnerComponent implements OnInit { 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 } }, @@ -430,23 +416,23 @@ export class AddEtpPartnerComponent implements OnInit { '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', @@ -465,7 +451,7 @@ export class AddEtpPartnerComponent implements OnInit { 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); } } @@ -487,7 +473,8 @@ export class AddEtpPartnerComponent implements OnInit { 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 @@ -512,7 +499,7 @@ export class AddEtpPartnerComponent implements OnInit { placeholder: '请输入企业管理员身份证号' } }, - operatingStartTime: { + validStartTime: { title: '身份证有效开始日期', type: 'string', ui: { @@ -523,7 +510,7 @@ export class AddEtpPartnerComponent implements OnInit { } } as SFDateWidgetSchema }, - operatingEndTime: { + validEndTime: { title: '身份证有效截止日期', type: 'string', ui: { @@ -545,34 +532,38 @@ export class AddEtpPartnerComponent implements OnInit { 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' } - ]) - } as SFTreeSelectWidgetSchema, + 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, @@ -586,7 +577,16 @@ export class AddEtpPartnerComponent implements OnInit { } } }, - required: ['_licenseTips', 'licensePhotoWatermark', 'unifiedSocialCreditCode', 'enterpriseName', 'operatingStartTime', 'status3','channel'] + required: [ + '_licenseTips', + 'licensePhotoWatermark', + 'unifiedSocialCreditCode', + 'enterpriseName', + 'operatingStartTime', + 'cityCodesList', + 'adminMobile', + 'invitationCode' + ] }; } } diff --git a/src/app/routes/partner/partner-list/components/add-personal-partner/add-personal-partner.component.html b/src/app/routes/partner/partner-list/components/add-personal-partner/add-personal-partner.component.html index e476071d..cb94b51b 100644 --- a/src/app/routes/partner/partner-list/components/add-personal-partner/add-personal-partner.component.html +++ b/src/app/routes/partner/partner-list/components/add-personal-partner/add-personal-partner.component.html @@ -1,44 +1,42 @@ - - - -
合伙人信息
-
- -
-
-
正面照(人像面)
-
示例
-
-
-
-
- -
-
-
背面照(国徽面)
-
示例
-
-
-
-
+ + + +
合伙人信息
+
+ +
+
+
正面照(人像面)
+
示例
+
+
+
+
+ +
+
+
背面照(国徽面)
+
示例
+
+
+
+
- - -
所属城市
-
+ + +
所属城市
+
- - -
渠道销售
-
-
+ + +
渠道销售
+
+
- -
- - -
-
\ No newline at end of file +
+ + +
+ diff --git a/src/app/routes/partner/partner-list/components/add-personal-partner/add-personal-partner.component.ts b/src/app/routes/partner/partner-list/components/add-personal-partner/add-personal-partner.component.ts index ed2eac4f..eca02366 100644 --- a/src/app/routes/partner/partner-list/components/add-personal-partner/add-personal-partner.component.ts +++ b/src/app/routes/partner/partner-list/components/add-personal-partner/add-personal-partner.component.ts @@ -1,9 +1,20 @@ -import { Component, OnInit, ViewChild } from '@angular/core'; +import { Component, ViewChild } from '@angular/core'; import { Router } from '@angular/router'; import { apiConf } from '@conf/api.conf'; -import { SFUploadWidgetSchema, SFComponent, SFSchema, SFUISchema, SFDateWidgetSchema, SFCheckboxWidgetSchema, SFTreeSelectWidgetSchema } from '@delon/form'; +import { + SFUploadWidgetSchema, + SFComponent, + SFSchema, + SFUISchema, + 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'; const IMAGECONFIG = { @@ -33,7 +44,7 @@ const DATECONFIG = { templateUrl: './add-personal-partner.component.html', styleUrls: ['./add-personal-partner.component.less'] }) -export class AddPersonalPartnerComponent implements OnInit { +export class AddPersonalPartnerComponent { @ViewChild('sf', { static: false }) sf!: SFComponent; schema: SFSchema = this.initBasicInfoSF(); @@ -55,7 +66,6 @@ export class AddPersonalPartnerComponent implements OnInit { }; constructor(private router: Router, public service: PartnerListService) {} - ngOnInit() {} submitForm() { if (!this.sf.valid) { @@ -63,57 +73,28 @@ export class AddPersonalPartnerComponent implements OnInit { 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(); - // } - // }); + }); } /* @@ -124,48 +105,34 @@ export class AddPersonalPartnerComponent implements OnInit { } // 识别身份证 参数isFront:front-正面、back-背面;type:0-申请人身份证,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); } } } @@ -179,23 +146,23 @@ export class AddPersonalPartnerComponent implements OnInit { 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', @@ -206,6 +173,7 @@ export class AddPersonalPartnerComponent implements OnInit { }, 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: '', @@ -214,8 +182,8 @@ export class AddPersonalPartnerComponent implements OnInit { 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 @@ -236,7 +204,8 @@ export class AddPersonalPartnerComponent implements OnInit { 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 @@ -261,7 +230,7 @@ export class AddPersonalPartnerComponent implements OnInit { placeholder: '请输入身份证号' } }, - operatingStartTime: { + validStartTime: { title: '身份证有效开始日期', type: 'string', ui: { @@ -272,7 +241,7 @@ export class AddPersonalPartnerComponent implements OnInit { } } as SFDateWidgetSchema }, - operatingEndTime: { + validEndTime: { title: '身份证有效截止日期', type: 'string', ui: { @@ -294,34 +263,38 @@ export class AddPersonalPartnerComponent implements OnInit { 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: '所属城市', - 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, @@ -335,10 +308,7 @@ export class AddPersonalPartnerComponent implements OnInit { } } }, - required: [ - 'status3', - 'channel' - ] + required: ['cityCodesList', 'invitationCode'] }; } } diff --git a/src/app/routes/partner/partner-list/components/index/partner-list.component.html b/src/app/routes/partner/partner-list/components/index/partner-list.component.html index 1e4aa340..b5652c72 100644 --- a/src/app/routes/partner/partner-list/components/index/partner-list.component.html +++ b/src/app/routes/partner/partner-list/components/index/partner-list.component.html @@ -1,95 +1,100 @@ - - + -
-
- -
-
- - - -
+
+
+
+
+ + + +
+
-
- - -
+
+ + +
- - + +
-
-
- - 深圳某某有限公司 - - - - - - - -
+
+
+ 深圳某某有限公司 + + + + + +
-

说明:修改模板后,当月开始返佣收益将会按新模板计算

+
+

说明:修改模板后,当月开始返佣收益将会按新模板计算

-
-
- - 深圳某某有限公司 - - - 张三/13999999999 - - - - - - - - - - - -

已选(0)

- - - - - 客户名称 - - - - - - {{ data.name }} - - - -
- - - - - - -
+
+
+ 深圳某某有限公司 + 张三/13999999999 + + + + + + + + + + +

已选(0)

+ + + + + 客户名称 + + + + + + {{ data.name }} + + + +
+ + + + + +
-

客户转移:客户跟着上级合伙人转移一并到新渠道销售下,会同步发起CRM《客户转移》流程;不转移的,客户会与上级合伙人解绑,成为渠道销售的直客

- \ No newline at end of file +
+

客户转移:客户跟着上级合伙人转移一并到新渠道销售下,会同步发起CRM《客户转移》流程;不转移的,客户会与上级合伙人解绑,成为渠道销售的直客

+ diff --git a/src/app/routes/partner/partner-list/components/index/partner-list.component.ts b/src/app/routes/partner/partner-list/components/index/partner-list.component.ts index 219a9d6b..4f415651 100644 --- a/src/app/routes/partner/partner-list/components/index/partner-list.component.ts +++ b/src/app/routes/partner/partner-list/components/index/partner-list.component.ts @@ -1,9 +1,10 @@ -import { Component, OnInit, ViewChild } from '@angular/core'; +import { Component, ViewChild } from '@angular/core'; import { Router } from '@angular/router'; import { STComponent, STColumn, STRequestOptions, STChange } from '@delon/abc/st'; import { SFComponent, SFSchema, SFDateWidgetSchema } from '@delon/form'; import { NzModalService } from 'ng-zorro-antd/modal'; import { AddCollectionInvoiceModalComponent } from 'src/app/routes/ticket-management/components/input-invoice/add-collection-invoice-modal/add-collection-invoice-modal.component'; + import { PartnerListService } from '../../services/partner-list.service'; import { PartnerAuditModalComponent } from '../partner-audit-modal/partner-audit-modal.component'; @@ -12,7 +13,7 @@ import { PartnerAuditModalComponent } from '../partner-audit-modal/partner-audit templateUrl: './partner-list.component.html', styleUrls: ['../../../../commom/less/box.less'] }) -export class PartnerListComponent implements OnInit { +export class PartnerListComponent { @ViewChild('st', { static: true }) st!: STComponent; @ViewChild('sf', { static: false }) @@ -30,8 +31,6 @@ export class PartnerListComponent implements OnInit { constructor(public service: PartnerListService, private nzModalService: NzModalService, private router: Router) {} - ngOnInit(): void {} - beforeReq = (requestOptions: STRequestOptions) => { if (this.sf) { let params = { ...this.sf.value }; @@ -122,19 +121,19 @@ export class PartnerListComponent implements OnInit { hidden: true } }, - paycode: { + enterpriseName: { type: 'string', title: '合伙人名称' }, - paycode2: { + contactName: { type: 'string', title: '企业管理员' }, - paycod3e: { + contactMobile: { type: 'string', title: '手机号' }, - paycod31e: { + channelId: { type: 'string', title: '渠道销售', ui: { @@ -144,32 +143,37 @@ export class PartnerListComponent implements OnInit { } } }, - orderS2n: { + partnerType: { type: 'string', title: '类型', + enum: [ + { value: '', label: '全部' }, + { value: 1, label: '企业' }, + { value: 2, label: '个人' } + ], ui: { - widget: 'dict-select', - containsAllLabel: true, - params: { dictKey: 'refund:apply:status' }, + widget: 'select', placeholder: '请选择', visibleIf: { expand: (value: boolean) => value } - } + }, + default: '' }, - paytype: { + approvalStatus: { type: 'string', title: '认证审核状态', ui: { widget: 'dict-select', containsAllLabel: true, + params: { dictKey: 'pay:mode' }, placeholder: '请选择', visibleIf: { expand: (value: boolean) => value } } }, - paymode: { + signStatus: { type: 'string', title: '签约状态', ui: { @@ -182,7 +186,7 @@ export class PartnerListComponent implements OnInit { } } }, - paymo1de: { + crmStatus: { type: 'string', title: 'CRM状态', ui: { @@ -198,41 +202,47 @@ export class PartnerListComponent implements OnInit { paymo11de: { type: 'string', title: '注册渠道', + enum: [ + { value: '', label: '全部' }, + { value: 1, label: '合伙人注册' }, + { value: 2, label: '平台添加' } + ], ui: { - widget: 'dict-select', - containsAllLabel: true, - params: { dictKey: 'pay:mode' }, + widget: 'select', placeholder: '请选择', visibleIf: { expand: (value: boolean) => value } - } + }, + default: '' }, - paymo11d1e: { + templateId: { type: 'string', title: '返佣模板', ui: { - widget: 'dict-select', - containsAllLabel: true, - params: { dictKey: 'pay:mode' }, + widget: 'select', placeholder: '请选择', visibleIf: { expand: (value: boolean) => value } } }, - paymo11d11e: { + lockedStatus: { type: 'string', title: '合伙人状态', + enum: [ + { value: '', label: '全部' }, + { value: 0, label: '启用' }, + { value: 1, label: '冻结' } + ], ui: { - widget: 'dict-select', - containsAllLabel: true, - params: { dictKey: 'pay:mode' }, + widget: 'select', placeholder: '请选择', visibleIf: { expand: (value: boolean) => value } - } + }, + default: '' }, createTime: { title: '注册时间', @@ -251,20 +261,63 @@ export class PartnerListComponent implements OnInit { private initST(): STColumn[] { return [ - { title: '合伙人名称', index: 'payCode', width: 180 }, + { title: '合伙人名称', index: 'enterpriseName', width: 180 }, { title: '付款编码', index: 'ltdName', width: 160 }, - { title: '邀请码', index: 'payDate', className: 'text-center', width: 130 }, - { title: '企业管理员', index: 'payDate', width: 150 }, - { title: '手机号', index: 'payDate', className: 'text-center', width: 150 }, - { title: '类型', index: 'payDate', className: 'text-center', width: 130 }, + { title: '邀请码', index: 'invitationCode', className: 'text-center', width: 130 }, + { title: '企业管理员', index: 'contactName', width: 150 }, + { title: '手机号', index: 'contactMobile', className: 'text-center', width: 150 }, + { title: '类型', index: 'partnerType', className: 'text-center', width: 130, type: 'enum', enum: { 1: '企业', 2: '个人' } }, { title: '注册渠道', index: 'payDate', type: 'date', width: 130 }, - { title: '注册时间', index: 'payDate', className: 'text-center', width: 170 }, + { title: '注册时间', index: 'createTime', className: 'text-center', width: 170 }, { title: '渠道销售', index: 'payDate', width: 170 }, - { title: '返佣模板', index: 'payDate', width: 150 }, - { title: '认证审核状态', index: 'payDate', width: 150 }, - { title: '签约状态', index: 'payDate', width: 150 }, - { title: 'CRM状态', index: 'payDate', width: 150 }, - { title: '合伙人状态', index: 'payDate', className: 'text-center', width: 140 }, + { title: '返佣模板', index: 'templateName', width: 150 }, + { + title: '认证审核状态', + index: 'approvalStatus', + width: 150, + type: 'badge', + badge: { + 0: { text: '草稿', color: 'default' }, + 10: { text: '待审核', color: 'processing' }, + 20: { text: '审核通过', color: 'success' }, + 30: { text: '驳回', color: 'error' } + } + }, + { + title: '签约状态', + index: 'signStatus', + width: 150, + type: 'badge', + badge: { + 10: { text: '待合伙人签约', color: 'default' }, + 15: { text: '签约中', color: 'processing' }, + 20: { text: '平台签约完成', color: 'success' }, + 30: { text: '驳回', color: 'error' } + } + }, + { + title: 'CRM状态', + index: 'crmStatus', + width: 150, + type: 'badge', + badge: { + 0: { text: '未发起', color: 'default' }, + 10: { text: '待审核', color: 'processing' }, + 20: { text: '审核通过', color: 'success' }, + 30: { text: '驳回', color: 'error' } + } + }, + { + title: '合伙人状态', + index: 'lockedStatus', + className: 'text-center', + width: 140, + type: 'badge', + badge: { + 0: { text: '启用', color: 'success' }, + 1: { text: '冻结', color: 'error' } + } + }, { title: '操作', fixed: 'right', @@ -273,7 +326,13 @@ export class PartnerListComponent implements OnInit { { type: 'divider' }, { text: '详情
', - click: item => this.router.navigate(['/partner/partner-list/detail/' + item.id]) + click: item => { + if (item.partnerType === 1) { + this.router.navigate([`/partner/partner-list/etp-detail/${item.appUserId}`]); + } else { + this.router.navigate([`/partner/partner-list/personal-detail/${item.appUserId}`]); + } + } }, { text: '修改返佣模板', @@ -289,7 +348,7 @@ export class PartnerListComponent implements OnInit { }, { text: '重发CRM流程', - click: item => this.router.navigate(['/partner/account-management/list/detail/' + item.id]) + click: item => this.router.navigate([`/partner/account-management/list/detail/${item.id}`]) } ] } diff --git a/src/app/routes/partner/partner-list/components/partner-detail/partner-detail.component.html b/src/app/routes/partner/partner-list/components/partner-detail/partner-detail.component.html index f242099c..e00cd880 100644 --- a/src/app/routes/partner/partner-list/components/partner-detail/partner-detail.component.html +++ b/src/app/routes/partner/partner-list/components/partner-detail/partner-detail.component.html @@ -1,328 +1,492 @@ - - - - - - -