This commit is contained in:
Taric Xin
2022-03-25 17:24:19 +08:00
parent a51ed2559c
commit 27df213f2b
8 changed files with 185 additions and 21 deletions

View File

@ -1,4 +1,10 @@
<page-header-wrapper [title]="'新增企业合伙人'"></page-header-wrapper> <page-header-wrapper [logo]="logo" [title]="'新增企业合伙人'">
<ng-template #logo>
<button nz-button nz-tooltip nzTooltipTitle="返回上一页" (click)="goBack()">
<i nz-icon nzType="left" nzTheme="outline"></i>
</button>
</ng-template>
</page-header-wrapper>
<nz-card> <nz-card>
<sf #sf [ui]="ui" [schema]="schema" [button]="'none'"> <sf #sf [ui]="ui" [schema]="schema" [button]="'none'">
<!-- 企业基本信 --> <!-- 企业基本信 -->

View File

@ -11,7 +11,7 @@ import {
} from '@delon/form'; } from '@delon/form';
import { NzTreeNode } from 'ng-zorro-antd/tree'; import { NzTreeNode } from 'ng-zorro-antd/tree';
import { NzUploadFile } from 'ng-zorro-antd/upload'; import { NzUploadFile } from 'ng-zorro-antd/upload';
import { of } from 'rxjs'; import { of, Subscription } from 'rxjs';
import { map } from 'rxjs/operators'; import { map } from 'rxjs/operators';
import { PartnerListService } from '../../services/partner-list.service'; import { PartnerListService } from '../../services/partner-list.service';
@ -64,6 +64,9 @@ export class AddEtpPartnerComponent {
} }
}; };
getIdentityInfoSub = new Subscription();
loadingIdentityInfoSub = false;
constructor(public service: PartnerListService) {} constructor(public service: PartnerListService) {}
submitForm() { submitForm() {
@ -426,7 +429,28 @@ export class AddEtpPartnerComponent {
ui: { ui: {
grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, grid: { xxl: 13, xl: 18, lg: 24, md: 24 },
placeholder: '请输入企业管理员手机号', placeholder: '请输入企业管理员手机号',
errors: { required: '请输入企业管理员手机号', format: '手机号格式错误' } errors: { required: '请输入企业管理员手机号', format: '手机号格式错误' },
change: (mobile: any) => {
// 根据手机号获取实名信息
if (mobile?.length === 11) {
if (this.loadingIdentityInfoSub) {
this.getIdentityInfoSub.unsubscribe();
}
this.loadingIdentityInfoSub = true;
this.getIdentityInfoSub = this.service.request(this.service.$api_get_identityInfo_by_mobile, { mobile }).subscribe(
res => {
if (res) {
this.setInfo(res);
this.sf.setValue('/adminUserInfo/id', res.id);
this.sf.setValue('/adminUserInfo/userId', res.userId);
}
this.loadingIdentityInfoSub = false;
},
_ => {},
() => (this.loadingIdentityInfoSub = false)
);
}
}
} }
}, },
// 企业管理员信息 // 企业管理员信息
@ -441,6 +465,8 @@ export class AddEtpPartnerComponent {
}, },
default: true default: true
}, },
id: { title: '', type: 'string', ui: { hidden: true } },
userId: { title: '', type: 'string', ui: { hidden: true } },
certificatePhotoFront: { title: '', type: 'string', ui: { hidden: true } }, certificatePhotoFront: { title: '', type: 'string', ui: { hidden: true } },
certificatePhotoBack: { title: '', type: 'string', ui: { hidden: true } }, certificatePhotoBack: { title: '', type: 'string', ui: { hidden: true } },
certificatePhotoFrontWatermark: { certificatePhotoFrontWatermark: {
@ -589,4 +615,52 @@ export class AddEtpPartnerComponent {
] ]
}; };
} }
private setInfo(info: any) {
if (info.name) {
this.sf.setValue('/adminUserInfo/name', info.name);
}
if (info.certificatePhotoFront) {
this.sf.setValue('/adminUserInfo/certificatePhotoFront', info.certificatePhotoFront);
}
if (info.certificatePhotoFrontWatermark) {
console.log(this.sf.getProperty('/adminUserInfo/certificatePhotoFrontWatermark'));
this.sf.setValue('/adminUserInfo/certificatePhotoFrontWatermark', [
{
uid: -1,
name: '文件',
status: 'done',
url: info.certificatePhotoFrontWatermark,
response: info.certificatePhotoFrontWatermark
}
]);
}
if (info.certificatePhotoBack) {
this.sf.setValue('/adminUserInfo/certificatePhotoBack', info.certificatePhotoBack);
}
if (info.certificatePhotoBackWatermark) {
this.sf.setValue('/adminUserInfo/certificatePhotoBackWatermark', [
{
uid: -1,
name: '文件',
status: 'done',
url: info.certificatePhotoBackWatermark,
response: info.certificatePhotoBackWatermark
}
]);
}
if (info.certificateNumber) {
this.sf.setValue('/adminUserInfo/certificateNumber', info.certificateNumber);
}
if (info.validStartTime) {
this.sf.setValue('/adminUserInfo/validStartTime', info.validStartTime);
}
if (info.validEndTime) {
this.sf.setValue('/adminUserInfo/validEndTime', info.validEndTime);
this.sf.setValue('/adminUserInfo/_isLoingDate', false);
} else {
this.sf.setValue('/adminUserInfo/_isLoingDate', true);
}
}
} }

View File

@ -1,4 +1,10 @@
<page-header-wrapper [title]="'新增个人合伙人'"></page-header-wrapper> <page-header-wrapper [logo]="logo" [title]="'新增个人合伙人'">
<ng-template #logo>
<button nz-button nz-tooltip nzTooltipTitle="返回上一页" (click)="goBack()">
<i nz-icon nzType="left" nzTheme="outline"></i>
</button>
</ng-template>
</page-header-wrapper>
<nz-card> <nz-card>
<sf #sf [ui]="ui" [schema]="schema" [button]="'none'"> <sf #sf [ui]="ui" [schema]="schema" [button]="'none'">
<!-- 合伙人信息 --> <!-- 合伙人信息 -->
@ -36,7 +42,8 @@
</sf> </sf>
<div style="display: flex; justify-content: center"> <div style="display: flex; justify-content: center">
<button nz-button type="button" nzType="primary" (click)="submitForm()" [nzLoading]="service.http.loading">确认新增</button> <button nz-button type="button" nzType="primary" (click)="submitForm()"
[nzLoading]="service.http.loading">确认新增</button>
<button nz-button (click)="goBack()">返回</button> <button nz-button (click)="goBack()">返回</button>
</div> </div>
</nz-card> </nz-card>

View File

@ -12,7 +12,7 @@ import {
} from '@delon/form'; } from '@delon/form';
import { NzTreeNode } from 'ng-zorro-antd/tree'; import { NzTreeNode } from 'ng-zorro-antd/tree';
import { NzUploadFile } from 'ng-zorro-antd/upload'; import { NzUploadFile } from 'ng-zorro-antd/upload';
import { of } from 'rxjs'; import { of, Subscription } from 'rxjs';
import { map } from 'rxjs/operators'; import { map } from 'rxjs/operators';
import { PartnerListService } from '../../services/partner-list.service'; import { PartnerListService } from '../../services/partner-list.service';
@ -65,6 +65,9 @@ export class AddPersonalPartnerComponent {
} }
}; };
getIdentityInfoSub = new Subscription();
loadingIdentityInfoSub = false;
constructor(private router: Router, public service: PartnerListService) {} constructor(private router: Router, public service: PartnerListService) {}
submitForm() { submitForm() {
@ -156,7 +159,28 @@ export class AddPersonalPartnerComponent {
ui: { ui: {
grid: { xxl: 13, xl: 18, lg: 24, md: 24 }, grid: { xxl: 13, xl: 18, lg: 24, md: 24 },
placeholder: '请输入手机号', placeholder: '请输入手机号',
errors: { required: '请输入手机号', format: '手机号格式错误' } errors: { required: '请输入手机号', format: '手机号格式错误' },
change: (mobile: any) => {
// 根据手机号获取实名信息
if (mobile?.length === 11) {
if (this.loadingIdentityInfoSub) {
this.getIdentityInfoSub.unsubscribe();
}
this.loadingIdentityInfoSub = true;
this.getIdentityInfoSub = this.service.request(this.service.$api_get_identityInfo_by_mobile, { mobile }).subscribe(
res => {
if (res) {
this.setInfo(res);
this.sf.setValue('/adminUserInfo/id', res.id);
this.sf.setValue('/adminUserInfo/userId', res.userId);
}
this.loadingIdentityInfoSub = false;
},
_ => {},
() => (this.loadingIdentityInfoSub = false)
);
}
}
} }
}, },
// 合伙人信息 // 合伙人信息
@ -172,6 +196,8 @@ export class AddPersonalPartnerComponent {
default: true default: true
}, },
certificatePhotoFront: { title: '', type: 'string', ui: { hidden: true } }, certificatePhotoFront: { title: '', type: 'string', ui: { hidden: true } },
id: { title: '', type: 'string', ui: { hidden: true } },
userId: { title: '', type: 'string', ui: { hidden: true } },
certificatePhotoBack: { title: '', type: 'string', ui: { hidden: true } }, certificatePhotoBack: { title: '', type: 'string', ui: { hidden: true } },
certificateType: { title: '', type: 'string', ui: { hidden: true }, default: 0 }, certificateType: { title: '', type: 'string', ui: { hidden: true }, default: 0 },
certificatePhotoFrontWatermark: { certificatePhotoFrontWatermark: {
@ -311,4 +337,52 @@ export class AddPersonalPartnerComponent {
required: ['cityCodesList', 'invitationCode'] required: ['cityCodesList', 'invitationCode']
}; };
} }
private setInfo(info: any) {
if (info.name) {
this.sf.setValue('/adminUserInfo/name', info.name);
}
if (info.certificatePhotoFront) {
this.sf.setValue('/adminUserInfo/certificatePhotoFront', info.certificatePhotoFront);
}
if (info.certificatePhotoFrontWatermark) {
console.log(this.sf.getProperty('/adminUserInfo/certificatePhotoFrontWatermark'));
this.sf.setValue('/adminUserInfo/certificatePhotoFrontWatermark', [
{
uid: -1,
name: '文件',
status: 'done',
url: info.certificatePhotoFrontWatermark,
response: info.certificatePhotoFrontWatermark
}
]);
}
if (info.certificatePhotoBack) {
this.sf.setValue('/adminUserInfo/certificatePhotoBack', info.certificatePhotoBack);
}
if (info.certificatePhotoBackWatermark) {
this.sf.setValue('/adminUserInfo/certificatePhotoBackWatermark', [
{
uid: -1,
name: '文件',
status: 'done',
url: info.certificatePhotoBackWatermark,
response: info.certificatePhotoBackWatermark
}
]);
}
if (info.certificateNumber) {
this.sf.setValue('/adminUserInfo/certificateNumber', info.certificateNumber);
}
if (info.validStartTime) {
this.sf.setValue('/adminUserInfo/validStartTime', info.validStartTime);
}
if (info.validEndTime) {
this.sf.setValue('/adminUserInfo/validEndTime', info.validEndTime);
this.sf.setValue('/adminUserInfo/_isLoingDate', false);
} else {
this.sf.setValue('/adminUserInfo/_isLoingDate', true);
}
}
} }

View File

@ -367,12 +367,12 @@ export class PartnerListComponent {
}, },
{ title: '付款编码', index: 'payCode', width: 160 }, { title: '付款编码', index: 'payCode', width: 160 },
{ title: '邀请码', index: 'invitationCode', className: 'text-center', width: 130 }, { title: '邀请码', index: 'invitationCode', className: 'text-center', width: 130 },
{ title: '企业管理员', index: 'contactName', width: 150 }, { title: '企业管理员', index: 'contactName', width: 150, format: item => (item.partnerType ? `${item.contactName}` : '') },
{ title: '手机号', index: 'contactMobile', className: 'text-center', 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: 'partnerType', className: 'text-center', width: 130, type: 'enum', enum: { 1: '企业', 2: '个人' } },
{ title: '注册渠道', index: 'source', type: 'enum', enum: { 1: '合伙人注册', 2: '平台添加' }, width: 130 }, { title: '注册渠道', index: 'source', type: 'enum', enum: { 1: '合伙人注册', 2: '平台添加' }, width: 130 },
{ title: '注册时间', index: 'createTime', className: 'text-center', width: 170 }, { title: '注册时间', index: 'createTime', className: 'text-center', width: 170 },
{ title: '渠道销售', index: 'channelId', width: 170 }, { title: '渠道销售', index: 'channelIdLabel', width: 170 },
{ title: '返佣模板', index: 'templateName', width: 150 }, { title: '返佣模板', index: 'templateName', width: 150 },
{ {
title: '认证审核状态', title: '认证审核状态',
@ -380,7 +380,7 @@ export class PartnerListComponent {
width: 150, width: 150,
type: 'badge', type: 'badge',
badge: { badge: {
0: { text: '草稿', color: 'default' }, '-1': { text: '未提交', color: 'default' },
10: { text: '待审核', color: 'processing' }, 10: { text: '待审核', color: 'processing' },
20: { text: '审核通过', color: 'success' }, 20: { text: '审核通过', color: 'success' },
30: { text: '驳回', color: 'error' } 30: { text: '驳回', color: 'error' }
@ -428,7 +428,12 @@ export class PartnerListComponent {
buttons: [ buttons: [
{ type: 'divider' }, { type: 'divider' },
{ {
text: '详情', text: '审核',
iif: item => item.id && item.approvalStatus === 10,
click: item => this.auditPartner(item)
},
{
text: '详情<br>',
iif: item => item.id, iif: item => item.id,
click: item => { click: item => {
if (item.partnerType === 1) { if (item.partnerType === 1) {
@ -438,11 +443,6 @@ export class PartnerListComponent {
} }
} }
}, },
{
text: '审核<br>',
iif: item => item.id,
click: item => this.auditPartner(item)
},
{ {
text: '修改返佣模板', text: '修改返佣模板',
iif: item => item.id, iif: item => item.id,

View File

@ -40,7 +40,7 @@
<button [disabled]="service.http.loading" nz-button nzDanger (click)="save()"> 保存 </button> <button [disabled]="service.http.loading" nz-button nzDanger (click)="save()"> 保存 </button>
</ng-container> </ng-container>
<ng-template #editButton> <ng-template #editButton>
<ng-container> <ng-container *ngIf="detailData?.approvalStatus === 10">
<button [disabled]="service.http.loading" nz-button nzDanger (click)="auditPartner(true)"> 通过 </button> <button [disabled]="service.http.loading" nz-button nzDanger (click)="auditPartner(true)"> 通过 </button>
<button [disabled]="service.http.loading" nz-button nzDanger (click)="auditPartner(false)"> 驳回 </button> <button [disabled]="service.http.loading" nz-button nzDanger (click)="auditPartner(false)"> 驳回 </button>
</ng-container> </ng-container>
@ -87,8 +87,9 @@
[nzBorderless]="!isEdit" [placeholder]="isEdit ? '' : '-'" /> [nzBorderless]="!isEdit" [placeholder]="isEdit ? '' : '-'" />
</sv> </sv>
<sv label="手机号"> <sv label="手机号">
<input nz-input type="text" [(ngModel)]="detailData.adminUserInfo.mobile" [readonly]="!isEdit" <!-- <input nz-input type="text" [(ngModel)]="detailData.adminUserInfo.mobile" [readonly]="!isEdit"
[nzBorderless]="!isEdit" [placeholder]="isEdit ? '' : '-'" /> [nzBorderless]="!isEdit" [placeholder]="isEdit ? '' : '-'" /> -->
{{detailData.adminUserInfo.mobile}}
</sv> </sv>
<sv label="身份证号"> <sv label="身份证号">
<input nz-input type="text" [(ngModel)]="detailData.adminUserInfo.certificateNumber" [readonly]="!isEdit" <input nz-input type="text" [(ngModel)]="detailData.adminUserInfo.certificateNumber" [readonly]="!isEdit"

View File

@ -40,7 +40,7 @@
<button [disabled]="service.http.loading" nz-button nzDanger (click)="save()"> 保存 </button> <button [disabled]="service.http.loading" nz-button nzDanger (click)="save()"> 保存 </button>
</ng-container> </ng-container>
<ng-template #editButton> <ng-template #editButton>
<ng-container> <ng-container *ngIf="detailData?.approvalStatus === 10">
<button [disabled]="service.http.loading" nz-button nzDanger (click)="auditPartner(true)"> 通过 </button> <button [disabled]="service.http.loading" nz-button nzDanger (click)="auditPartner(true)"> 通过 </button>
<button [disabled]="service.http.loading" nz-button nzDanger (click)="auditPartner(false)"> 驳回 </button> <button [disabled]="service.http.loading" nz-button nzDanger (click)="auditPartner(false)"> 驳回 </button>
</ng-container> </ng-container>

View File

@ -33,6 +33,8 @@ export class PartnerListService extends ShipperBaseService {
$api_get_enterprice_rel_list = '/api/mdc/EnterpriseRelLog/list'; $api_get_enterprice_rel_list = '/api/mdc/EnterpriseRelLog/list';
// 校验合伙人是否可修改渠道销售 true:可以修改 false不可以修改 // 校验合伙人是否可修改渠道销售 true:可以修改 false不可以修改
$api_check_partenr_change_channel = '/api/mdc/partner/updateChannelCheck'; $api_check_partenr_change_channel = '/api/mdc/partner/updateChannelCheck';
// 根据手机号查询实名信息
$api_get_identityInfo_by_mobile= '/api/mdc/cuc/identityInfo/getByMobile';
// 渠道销售修改详情 // 渠道销售修改详情
$api_get_partner_change_list = '/api/mdc/partnerChannelRelLog/partnerChannelUpdateDetaiList'; $api_get_partner_change_list = '/api/mdc/partnerChannelRelLog/partnerChannelUpdateDetaiList';
// 冻结/启用企业业 // 冻结/启用企业业