From c6e3be24f1c115b6b9a7ae0d983bbefedb89d57a Mon Sep 17 00:00:00 2001 From: Taric Xin Date: Mon, 21 Mar 2022 14:18:43 +0800 Subject: [PATCH] edit --- .../feedback-detail.component.less | 20 +- .../channel-detail.component.less | 2 +- .../partner-detail.component.less | 23 +- .../index/partner-list.component.html | 36 +- .../index/partner-list.component.ts | 87 +++-- .../partner-audit-modal.component.html | 2 +- .../partner-audit-modal.component.ts | 70 ++-- .../partner-detail.component.html | 347 +++++------------- .../partner-detail.component.ts | 144 ++++++-- .../personal-partner-detail.component.html | 169 +++------ .../personal-partner-detail.component.ts | 121 ++++-- .../services/partner-list.service.ts | 10 + src/app/shared/shared-zorro.module.ts | 4 +- src/styles.less | 18 + 14 files changed, 511 insertions(+), 542 deletions(-) diff --git a/src/app/routes/partner/advice-feedback/components/feedback-detail/feedback-detail.component.less b/src/app/routes/partner/advice-feedback/components/feedback-detail/feedback-detail.component.less index e62642d0..403e7692 100644 --- a/src/app/routes/partner/advice-feedback/components/feedback-detail/feedback-detail.component.less +++ b/src/app/routes/partner/advice-feedback/components/feedback-detail/feedback-detail.component.less @@ -1,27 +1,29 @@ :host { .head-box { img { - width: 80px; - height: 80px; + width : 80px; + height : 80px; padding: 8px; } - .right-h{ + + .right-h { font-size: 16px; } - .right-s{ + + .right-s { color: #7f7f7f; } .left-rt { font-weight: bold; - font-size: 16px; - text-align: right; + font-size : 16px; + text-align : right; } .left-rb { - display: flex; - justify-content: end; - padding-top: 16px; + display : flex; + justify-content: flex-end; + padding-top : 16px; } } } \ No newline at end of file diff --git a/src/app/routes/partner/claim-audit/components/channel-detail/channel-detail.component.less b/src/app/routes/partner/claim-audit/components/channel-detail/channel-detail.component.less index e62642d0..7d4ae911 100644 --- a/src/app/routes/partner/claim-audit/components/channel-detail/channel-detail.component.less +++ b/src/app/routes/partner/claim-audit/components/channel-detail/channel-detail.component.less @@ -20,7 +20,7 @@ .left-rb { display: flex; - justify-content: end; + justify-content: flex-end; padding-top: 16px; } } diff --git a/src/app/routes/partner/claim-audit/components/partner-detail/partner-detail.component.less b/src/app/routes/partner/claim-audit/components/partner-detail/partner-detail.component.less index 06d8b068..403e7692 100644 --- a/src/app/routes/partner/claim-audit/components/partner-detail/partner-detail.component.less +++ b/src/app/routes/partner/claim-audit/components/partner-detail/partner-detail.component.less @@ -1,26 +1,29 @@ :host { .head-box { img { - width: 80px; - height: 80px; + width : 80px; + height : 80px; padding: 8px; } - .right-h{ + + .right-h { font-size: 16px; } - .right-s{ + + .right-s { color: #7f7f7f; } + .left-rt { font-weight: bold; - font-size: 16px; - text-align: right; + font-size : 16px; + text-align : right; } .left-rb { - display: flex; - justify-content: end; - padding-top: 16px; + display : flex; + justify-content: flex-end; + padding-top : 16px; } } -} +} \ No newline at end of file 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 b5652c72..5d4e7feb 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 @@ -3,15 +3,11 @@
- +
-
+
- +
- +
- 深圳某某有限公司 + {{selectItem?.enterpriseName}} - + @@ -94,7 +84,5 @@
-

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

-
+

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

+ \ No newline at end of file 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 4f415651..64b10e7a 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 @@ -24,11 +24,14 @@ export class PartnerListComponent { @ViewChild('editTemplate', { static: true }) editTemplate: any; + templateId: any; @ViewChild('editCannel', { static: true }) editCannel: any; customers: any[] = []; + selectItem: any = {}; + constructor(public service: PartnerListService, private nzModalService: NzModalService, private router: Router) {} beforeReq = (requestOptions: STRequestOptions) => { @@ -46,12 +49,13 @@ export class PartnerListComponent { const modal = this.nzModalService.create({ nzTitle: '审核', nzContent: PartnerAuditModalComponent, - nzComponentParams: { info: item }, + nzComponentParams: { info: { ...item, enterpriseName: item.enterpriseName || item.contactName } }, nzFooter: null }); } editTemplateAction(item: any) { + this.selectItem = item; const modal = this.nzModalService.create({ nzTitle: '修改返佣模板', nzContent: this.editTemplate, @@ -66,24 +70,36 @@ export class PartnerListComponent { const modal = this.nzModalService.confirm({ nzTitle: '确定要修改返佣模板吗?', nzOnOk: () => { - this.nzModalService.closeAll(); - } - }); - } - - editCannelAction(item: any) { - const modal = this.nzModalService.create({ - nzTitle: '修改返佣模板', - nzWidth: 650, - nzContent: this.editCannel, - nzOnOk: () => { - this.confirmEditCannel(); + this.service + .request(this.service.$api_update_partner_template, { + id: this.selectItem.id, + templateId: this.templateId + }) + .subscribe(res => { + if (res) { + this.service.msgSrv.success('修改成功'); + this.nzModalService.closeAll(); + } + }); return false; } }); } - confirmEditCannel() { + editCannelAction(item: any) { + this.selectItem = item; + const modal = this.nzModalService.create({ + nzTitle: '修改渠道销售', + nzWidth: 650, + nzContent: this.editCannel, + nzOnOk: () => { + this.confirmEditCannel(item); + return false; + } + }); + } + + confirmEditCannel(item: any) { const modal = this.nzModalService.confirm({ nzTitle: '确定提交吗?', nzOnOk: () => { @@ -92,6 +108,29 @@ export class PartnerListComponent { }); } + /** + * 重新发起crm + * @param item + */ + reSendCRM(item: any) { + const modal = this.nzModalService.confirm({ + nzTitle: '是否确定重新发起CRM?', + nzOnOk: () => { + this.service + .request(this.service.$api_resend_crm, { + id: item.id + }) + .subscribe(res => { + if (res) { + this.service.msgSrv.success('发起成功'); + } else { + this.service.msgSrv.warning('发起失败'); + } + }); + } + }); + } + routeTo(route: string) { this.router.navigate([route]); } @@ -261,15 +300,15 @@ export class PartnerListComponent { private initST(): STColumn[] { return [ - { title: '合伙人名称', index: 'enterpriseName', width: 180 }, - { title: '付款编码', index: 'ltdName', width: 160 }, + { title: '合伙人名称', index: 'enterpriseName', width: 180, format: item => `${item.enterpriseName || item.contactName}` }, + { title: '付款编码', index: 'payCode', width: 160 }, { 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: 'source', type: 'enum', enum: { 1: '合伙人注册', 2: '平台添加' }, width: 130 }, { title: '注册时间', index: 'createTime', className: 'text-center', width: 170 }, - { title: '渠道销售', index: 'payDate', width: 170 }, + { title: '渠道销售', index: 'channelId', width: 170 }, { title: '返佣模板', index: 'templateName', width: 150 }, { title: '认证审核状态', @@ -325,7 +364,7 @@ export class PartnerListComponent { buttons: [ { type: 'divider' }, { - text: '详情
', + text: '详情', click: item => { if (item.partnerType === 1) { this.router.navigate([`/partner/partner-list/etp-detail/${item.appUserId}`]); @@ -334,6 +373,10 @@ export class PartnerListComponent { } } }, + { + text: '审核
', + click: item => this.auditPartner(item) + }, { text: '修改返佣模板', click: item => this.editTemplateAction(item) @@ -342,13 +385,9 @@ export class PartnerListComponent { text: '修改渠道销售', click: item => this.editCannelAction(item) }, - { - text: '审核
', - click: item => this.auditPartner(item) - }, { text: '重发CRM流程', - click: item => this.router.navigate([`/partner/account-management/list/detail/${item.id}`]) + click: item => this.reSendCRM(item) } ] } diff --git a/src/app/routes/partner/partner-list/components/partner-audit-modal/partner-audit-modal.component.html b/src/app/routes/partner/partner-list/components/partner-audit-modal/partner-audit-modal.component.html index 8ea7c9f8..fc8043d6 100644 --- a/src/app/routes/partner/partner-list/components/partner-audit-modal/partner-audit-modal.component.html +++ b/src/app/routes/partner/partner-list/components/partner-audit-modal/partner-audit-modal.component.html @@ -3,5 +3,5 @@
\ No newline at end of file diff --git a/src/app/routes/partner/partner-list/components/partner-audit-modal/partner-audit-modal.component.ts b/src/app/routes/partner/partner-list/components/partner-audit-modal/partner-audit-modal.component.ts index ab86de05..8c2586a8 100644 --- a/src/app/routes/partner/partner-list/components/partner-audit-modal/partner-audit-modal.component.ts +++ b/src/app/routes/partner/partner-list/components/partner-audit-modal/partner-audit-modal.component.ts @@ -34,7 +34,7 @@ export class PartnerAuditModalComponent implements OnInit { title: '合伙人名称', type: 'string', ui: { widget: 'text' }, - default: user.name + default: user.enterpriseName }, status: { title: '审核结果', @@ -50,7 +50,7 @@ export class PartnerAuditModalComponent implements OnInit { }, default: true }, - a: { + channelId: { title: '渠道销售', type: 'string', enum: [ @@ -70,7 +70,7 @@ export class PartnerAuditModalComponent implements OnInit { }, default: '' }, - b: { + approvalOpinion: { title: '备注', type: 'string', maxLength: 100, @@ -88,43 +88,41 @@ export class PartnerAuditModalComponent implements OnInit { } } }, - required: ['a', 'b'] + required: ['channelId', 'approvalOpinion'] }; } sure() { - this.nzModalService.confirm({ - nzTitle: `确定以“${this.info.userName}/${this.info.mobile}”的名义重新发起CRM《付款对象合同管理》吗?`, - nzOnOk: () => { - this.close(); - } - }); - // if (!this.sf.value.roleId || this.sf.value.roleId.length === 0) { - // this.service.msgSrv.error('员工角色不能为空!'); - // return; - // } - // if (this.i.userId === 0) { - // const params: any = { - // ...this.sf.value - // }; - // this.service.request(this.service.$api_add_staff, params).subscribe(res => { - // if (res) { - // this.service.msgSrv.success('保存成功!'); - // this.modal.close(true); - // } - // }); - // } else { - // const params: any = { - // appUserId: this.i.appUserId, - // ...this.sf.value - // }; - // this.service.request(this.service.$api_edit_staff, params).subscribe(res => { - // if (res) { - // this.service.msgSrv.success('编辑成功!'); - // this.modal.close(true); - // } - // }); - // } + if (this.info.isPass || this.sf.value.status) { + this.nzModalService.confirm({ + nzTitle: `确定以“${this.info.channelIdLabel}”的名义重新发起CRM《付款对象合同管理》吗?`, + nzOnOk: () => { + this.audit(); + } + }); + } else { + this.audit(); + } + } + + audit() { + const params: any = { + ...this.sf.value, + id: this.info.id, + auditStatusEnum: this.info.isPass || this.sf.value.status ? '20' : '30' + }; + this.service + .request(this.service.$api_audit_partner, { + auditStatusEnum: params.auditStatusEnum, + id: params.id, + approvalOpinion: params.approvalOpinion + }) + .subscribe(res => { + if (res) { + this.service.msgSrv.success('审核成功!'); + this.close(); + } + }); } close() { 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 e00cd880..759de850 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 @@ -29,7 +29,7 @@
注册时间:{{ detailData?.createTime }}
- 所属城市:{{ detailData?.cityCodesList?.provinceName }}{{ detailData?.cityCodesList?.cityName }} + 所属城市:{{enterpriseDefaultCityName}}
@@ -45,32 +45,14 @@ - - @@ -82,21 +64,17 @@ - + context: { title: '确定冻结该合伙人吗?', content: '停用后,该合伙人将被限制使用,不限于访问受限、邀请客户、佣金收益等,请谨慎操作' } + "> - + context: { title: '确定启用该合伙人吗?', content: '启用后,该该合伙人将恢复正常使用功能,请再次确认' } + "> @@ -105,39 +83,20 @@ 企业管理员信息 - + - + - +
- + "> - + ">
- + - - + - +
@@ -205,91 +142,58 @@ - - + - + - + "> - + - - + - + @@ -297,62 +201,33 @@ 企业法人信息 - + - + - + - - + - + + - +
- + "> - + ">
- + + - {{ detailData?.fullRegionVO?.provinceName }}{{ detailData?.fullRegionVO?.cityName }}{{ detailData?.fullRegionVO?.areaName }} + {{ enterpriseDefaultCityName || '-' }}
@@ -392,9 +268,9 @@ 渠道销售信息 - 张学友 - 13999999999 - 2021-09-23 14:43:31 + {{ detailData?.channelName }} + {{ detailData?.channelMobile }} + {{ detailData?.bindChannelTime }}
@@ -402,16 +278,8 @@ 修改渠道销售记录 - + @@ -420,7 +288,8 @@
-
{{ title }}
+
{{ title }} +
{{ content }}
@@ -428,27 +297,15 @@ - +
上传
-
+
@@ -463,30 +320,14 @@

转移客户数:10

- +

不转移客户数:10

- +

客户转移:客户跟着上级合伙人转移一并到新渠道销售下,会同步发起CRM《客户转移》流程;不转移的,客户会与上级合伙人解绑,修改成功后,修改时间也是合伙人与客户的结算结束时间,成为原来渠道销售的直客。

-
+ \ No newline at end of file diff --git a/src/app/routes/partner/partner-list/components/partner-detail/partner-detail.component.ts b/src/app/routes/partner/partner-list/components/partner-detail/partner-detail.component.ts index cd51553b..eefd57bc 100644 --- a/src/app/routes/partner/partner-list/components/partner-detail/partner-detail.component.ts +++ b/src/app/routes/partner/partner-list/components/partner-detail/partner-detail.component.ts @@ -4,6 +4,8 @@ import { ActivatedRoute } from '@angular/router'; import { apiConf } from '@conf/api.conf'; import { STColumn } from '@delon/abc/st'; import { NzModalService } from 'ng-zorro-antd/modal'; +import { NzFormatEmitEvent, NzTreeNode, NzTreeNodeOptions } from 'ng-zorro-antd/tree'; +import { NzTreeSelectComponent } from 'ng-zorro-antd/tree-select'; import { Subscription, fromEvent } from 'rxjs'; import { PartnerListService } from '../../services/partner-list.service'; @@ -18,6 +20,8 @@ import { PartnerAuditModalComponent } from '../partner-audit-modal/partner-audit export class PartnerDetailComponent implements OnInit, OnDestroy { @ViewChild('logModal') logModal: any; + @ViewChild('areaTreeSelect') + areaTreeSelect!: NzTreeSelectComponent; columns: { logsColumn: STColumn[]; changeColumn: STColumn[]; beChangeColumn: STColumn[] } = this.initST(); @@ -28,8 +32,10 @@ export class PartnerDetailComponent implements OnInit, OnDestroy { uploadURl = apiConf.waterFileUpload; disabledUpload = false; - enterpriseAddressCode: any = []; - ltdId: any = []; + enterpriseAddressCode: string[] = []; + enterpriseDefaultAddressCode: string[] = []; + enterpriseDefaultCityName: string = ''; + areaList = []; esignCheckStatus: any = { 0: '不通过', @@ -51,17 +57,25 @@ export class PartnerDetailComponent implements OnInit, OnDestroy { ngOnInit() { this.initData(); - this.loadltdId(); + this.loadlAreaList(); this.subscribeScoll = fromEvent(window, 'scroll').subscribe(event => { this.scrollTop = document.documentElement.scrollTop; }); } - loadltdId() { - // this.service.getNetworkFreightForwarder().subscribe(res => { - // if (res) { - // this.ltdId = res; - // } - // }); + + loadlAreaList() { + this.service.request(this.service.$api_get_region_by_code, { regionCode: '' }).subscribe(res => { + if (res) { + this.areaList = res.map((item: any) => ({ + ...item, + isLeaf: false, + title: item.name, + key: item.regionCode.toString(), + disabled: true, + isDisableCheckbox: true + })); + } + }); } initData() { @@ -72,11 +86,23 @@ export class PartnerDetailComponent implements OnInit, OnDestroy { .subscribe(res => { if (res) { this.detailData = res; - console.log(this.detailData); - + // 存储数据源 this.tempalateData = { ...this.detailData }; - if (this.detailData?.cityCodes) { - this.enterpriseAddressCode = JSON.parse(this.detailData.cityCodes); + // 拼接所属城市 + if (this.detailData?.cityCodesList?.length > 0) { + this.enterpriseAddressCode = (this.detailData?.cityCodesList as any[]).map(city => city.cityCode); + this.enterpriseDefaultCityName = (this.detailData?.cityCodesList as any[]).map(city => city.cityName).join('、'); + this.enterpriseDefaultAddressCode = [ + ...new Set((this.detailData?.cityCodesList as any[]).map(city => city.provinceCode)) + ]; + } + // 拼接渠道销售信息 + if (this.detailData?.channelIdLabel) { + const channel = (this.detailData.channelIdLabel as string).split('/'); + Object.assign(this.detailData, { + channelName: channel[0], + channelMobile: channel[1] + }); } } }); @@ -89,23 +115,23 @@ export class PartnerDetailComponent implements OnInit, OnDestroy { * 冻结 */ freezeOrResume(type: number) { - // this.service.http - // .post(this.service.$api_lock_freight, { - // id: this.route.snapshot.params.id, - // statedLocked: !!type - // }) - // .subscribe(res => { - // if (res.data === true) { - // if (type === 0) { - // this.service.msgSrv.success(`启用成功!`); - // } else { - // this.service.msgSrv.success(`冻结成功!`); - // } - // this.initData(); - // } else { - // this.service.msgSrv.error(res.msg || '操作失败!'); - // } - // }); + this.service.http + .post(this.service.$api_lock_freight, { + id: this.route.snapshot.params.id, + statedLocked: !!type + }) + .subscribe(res => { + if (res.data === true) { + if (type === 0) { + this.service.msgSrv.success(`启用成功!`); + } else { + this.service.msgSrv.success(`冻结成功!`); + } + this.initData(); + } else { + this.service.msgSrv.error(res.msg || '操作失败!'); + } + }); } auditPartner(isPass: boolean) { @@ -129,6 +155,18 @@ export class PartnerDetailComponent implements OnInit, OnDestroy { ratify() { this.isEdit = true; + // 搜索展开省份并选中节点 + setTimeout(() => { + if (this.enterpriseDefaultAddressCode?.length > 0 && this.areaTreeSelect) { + this.enterpriseDefaultAddressCode.forEach(code => { + const node = this.areaTreeSelect.getTreeNodeByKey(code); + if (node) { + node.setExpanded(true); + this.onExpandChange(node); + } + }); + } + }, 500); } deleteImg(data: any, key: string, key2: string) { @@ -160,6 +198,25 @@ export class PartnerDetailComponent implements OnInit, OnDestroy { } } + onExpandChange(node: NzTreeNode | null | undefined): void { + if (node && node.getChildren().length === 0 && node.isExpanded) { + this.loadRegionData(node).then(data => { + node.addChildren(data); + // 更新选中数据 + this.areaTreeSelect.updateSelectedNodes(true); + // 修改子节点选中状态 + const children = node.getChildren(); + if (children?.length > 0) { + children.forEach(childNode => { + if (this.enterpriseAddressCode.find(area => area === childNode.key)) { + childNode.setChecked(true); + } + }); + } + }); + } + } + /** * 级联获取地区数据 * @@ -167,19 +224,28 @@ export class PartnerDetailComponent implements OnInit, OnDestroy { * @param index 层级 * @returns */ - loadRegionData = (node: any, index: number) => { + loadRegionData(node: NzTreeNode): Promise { + let rs: any[] = []; return new Promise(resolve => { - this.service.request(this.service.$api_get_region_by_code, { regionCode: node?.regionCode || '' }).subscribe( + this.service.request(this.service.$api_get_region_by_code, { regionCode: node?.origin.regionCode || '' }).subscribe( res => { - node.children = res.map((item: any) => ({ ...item, isLeaf: index === 1, value: item.regionCode, label: item.name })); + rs = res.map((item: any) => ({ + ...item, + isLeaf: true, + title: item.name, + key: item.regionCode.toString(), + isSelectable: true, + isSelected: true, + isChecked: true + })); }, _ => {}, () => { - resolve(node); + resolve(rs); } ); }); - }; + } reset() { this.detailData = { ...this.tempalateData }; @@ -322,13 +388,13 @@ export class PartnerDetailComponent implements OnInit, OnDestroy { private initST(): { logsColumn: STColumn[]; changeColumn: STColumn[]; beChangeColumn: STColumn[] } { return { logsColumn: [ - { title: '修改后渠道销售', index: 'newChannelId', width: 180 }, - { title: '修改前渠道销售', index: 'originalChannelId', width: 160 }, + { title: '修改后渠道销售', index: 'newChannelName', width: 180 }, + { title: '修改前渠道销售', index: 'originalChannelName', width: 160 }, { title: '转移客户数', index: 'quantity', className: 'text-center', width: 130 }, { title: '生效节点', index: 'effectiveNode', width: 150, type: 'enum', enum: { 1: '立即生效', 2: 'CRM审核后生效' } }, { title: '备注', index: 'remark', className: 'text-center', width: 150 }, - { title: '修改时间', index: 'modifyTime', className: 'text-center', width: 130 }, - { title: '操作人', index: 'modifyUserId', type: 'date', width: 130 }, + { title: '修改时间', index: 'effectiveTime', className: 'text-center', width: 130, type: 'date' }, + { title: '操作人', index: 'modifyUserId', width: 130 }, { title: '操作', fixed: 'right', diff --git a/src/app/routes/partner/partner-list/components/personal-partner-detail/personal-partner-detail.component.html b/src/app/routes/partner/partner-list/components/personal-partner-detail/personal-partner-detail.component.html index d78dc5fd..143b4be1 100644 --- a/src/app/routes/partner/partner-list/components/personal-partner-detail/personal-partner-detail.component.html +++ b/src/app/routes/partner/partner-list/components/personal-partner-detail/personal-partner-detail.component.html @@ -13,7 +13,7 @@
-

{{ detailData?.enterpriseName }}

+

{{ detailData?.adminUserInfo?.name }}

@@ -22,14 +22,14 @@
-

{{ detailData?.unifiedSocialCreditCode }}

+

{{ detailData?.adminUserInfo?.certificateNumber }}

个人合伙人
注册时间:{{ detailData?.createTime }}
- 所属城市:{{ detailData?.cityCodesList?.provinceName }}{{ detailData?.cityCodesList?.cityName }} + 所属城市:{{enterpriseDefaultCityName}}
@@ -45,32 +45,14 @@ - - @@ -82,21 +64,17 @@ - + - + @@ -105,72 +83,37 @@ 合伙人信息 - + - + - + - + + - - + - + + - +
- + "> - + ">
- + + - {{ detailData?.fullRegionVO?.provinceName }}{{ detailData?.fullRegionVO?.cityName }}{{ detailData?.fullRegionVO?.areaName }} + {{ enterpriseDefaultCityName || '-' }}
@@ -211,7 +155,8 @@
-
{{ title }}
+
{{ title }} +
{{ content }}
@@ -219,27 +164,15 @@ - +
上传
-
+
@@ -250,4 +183,4 @@
- + \ No newline at end of file diff --git a/src/app/routes/partner/partner-list/components/personal-partner-detail/personal-partner-detail.component.ts b/src/app/routes/partner/partner-list/components/personal-partner-detail/personal-partner-detail.component.ts index a39fb28e..218439d0 100644 --- a/src/app/routes/partner/partner-list/components/personal-partner-detail/personal-partner-detail.component.ts +++ b/src/app/routes/partner/partner-list/components/personal-partner-detail/personal-partner-detail.component.ts @@ -4,6 +4,8 @@ import { ActivatedRoute } from '@angular/router'; import { apiConf } from '@conf/api.conf'; import { STColumn } from '@delon/abc/st'; import { NzModalService } from 'ng-zorro-antd/modal'; +import { NzTreeNode, NzTreeNodeOptions } from 'ng-zorro-antd/tree'; +import { NzTreeSelectComponent } from 'ng-zorro-antd/tree-select'; import { Subscription, fromEvent } from 'rxjs'; import { PartnerListService } from '../../services/partner-list.service'; @@ -16,6 +18,9 @@ import { PartnerAuditModalComponent } from '../partner-audit-modal/partner-audit providers: [DatePipe] }) export class PersonalPartnerDetailComponent implements OnInit { + @ViewChild('areaTreeSelect') + areaTreeSelect!: NzTreeSelectComponent; + detailData: any = { adminUserInfo: { name: '' }, legalPersonIdentity: { name: '' } }; tempalateData = { ...this.detailData }; @@ -23,7 +28,10 @@ export class PersonalPartnerDetailComponent implements OnInit { uploadURl = apiConf.waterFileUpload; disabledUpload = false; - enterpriseAddressCode: any = []; + enterpriseAddressCode: string[] = []; + enterpriseDefaultAddressCode: string[] = []; + enterpriseDefaultCityName: string = ''; + areaList = []; constructor( public service: PartnerListService, @@ -34,6 +42,22 @@ export class PersonalPartnerDetailComponent implements OnInit { ngOnInit() { this.initData(); + this.loadlAreaList(); + } + + loadlAreaList() { + this.service.request(this.service.$api_get_region_by_code, { regionCode: '' }).subscribe(res => { + if (res) { + this.areaList = res.map((item: any) => ({ + ...item, + isLeaf: false, + title: item.name, + key: item.regionCode.toString(), + disabled: true, + isDisableCheckbox: true + })); + } + }); } initData() { @@ -47,8 +71,13 @@ export class PersonalPartnerDetailComponent implements OnInit { console.log(this.detailData); this.tempalateData = { ...this.detailData }; - if (this.detailData?.cityCodes) { - this.enterpriseAddressCode = JSON.parse(this.detailData.cityCodes); + // 拼接所属城市 + if (this.detailData?.cityCodesList?.length > 0) { + this.enterpriseAddressCode = (this.detailData?.cityCodesList as any[]).map(city => city.cityCode); + this.enterpriseDefaultCityName = (this.detailData?.cityCodesList as any[]).map(city => city.cityName).join('、'); + this.enterpriseDefaultAddressCode = [ + ...new Set((this.detailData?.cityCodesList as any[]).map(city => city.provinceCode)) + ]; } } }); @@ -61,36 +90,48 @@ export class PersonalPartnerDetailComponent implements OnInit { * 冻结 */ freezeOrResume(type: number) { - // this.service.http - // .post(this.service.$api_lock_freight, { - // id: this.route.snapshot.params.id, - // statedLocked: !!type - // }) - // .subscribe(res => { - // if (res.data === true) { - // if (type === 0) { - // this.service.msgSrv.success(`启用成功!`); - // } else { - // this.service.msgSrv.success(`冻结成功!`); - // } - // this.initData(); - // } else { - // this.service.msgSrv.error(res.msg || '操作失败!'); - // } - // }); + this.service.http + .post(this.service.$api_lock_freight, { + id: this.route.snapshot.params.id, + statedLocked: !!type + }) + .subscribe(res => { + if (res.data === true) { + if (type === 0) { + this.service.msgSrv.success(`启用成功!`); + } else { + this.service.msgSrv.success(`冻结成功!`); + } + this.initData(); + } else { + this.service.msgSrv.error(res.msg || '操作失败!'); + } + }); } auditPartner(isPass: boolean) { const modal = this.nzModalService.create({ nzTitle: '审核', nzContent: PartnerAuditModalComponent, - nzComponentParams: { info: { ...this.detailData, isPass } }, + nzComponentParams: { info: { ...this.detailData, isPass, enterpriseName: this.detailData.adminUserInfo?.name } }, nzFooter: null }); } ratify() { this.isEdit = true; + // 搜索展开省份并选中节点 + setTimeout(() => { + if (this.enterpriseDefaultAddressCode?.length > 0 && this.areaTreeSelect) { + this.enterpriseDefaultAddressCode.forEach(code => { + const node = this.areaTreeSelect.getTreeNodeByKey(code); + if (node) { + node.setExpanded(true); + this.onExpandChange(node); + } + }); + } + }, 500); } deleteImg(data: any, key: string, key2: string) { @@ -119,6 +160,25 @@ export class PersonalPartnerDetailComponent implements OnInit { } } + onExpandChange(node: NzTreeNode | null | undefined): void { + if (node && node.getChildren().length === 0 && node.isExpanded) { + this.loadRegionData(node).then(data => { + node.addChildren(data); + // 更新选中数据 + this.areaTreeSelect.updateSelectedNodes(true); + // 修改子节点选中状态 + const children = node.getChildren(); + if (children?.length > 0) { + children.forEach(childNode => { + if (this.enterpriseAddressCode.find(area => area === childNode.key)) { + childNode.setChecked(true); + } + }); + } + }); + } + } + /** * 级联获取地区数据 * @@ -126,19 +186,28 @@ export class PersonalPartnerDetailComponent implements OnInit { * @param index 层级 * @returns */ - loadRegionData = (node: any, index: number) => { + loadRegionData(node: NzTreeNode): Promise { + let rs: any[] = []; return new Promise(resolve => { - this.service.request(this.service.$api_get_region_by_code, { regionCode: node?.regionCode || '' }).subscribe( + this.service.request(this.service.$api_get_region_by_code, { regionCode: node?.origin.regionCode || '' }).subscribe( res => { - node.children = res.map((item: any) => ({ ...item, isLeaf: index === 1, value: item.regionCode, label: item.name })); + rs = res.map((item: any) => ({ + ...item, + isLeaf: true, + title: item.name, + key: item.regionCode.toString(), + isSelectable: true, + isSelected: true, + isChecked: true + })); }, _ => {}, () => { - resolve(node); + resolve(rs); } ); }); - }; + } reset() { this.detailData = { ...this.tempalateData }; diff --git a/src/app/routes/partner/partner-list/services/partner-list.service.ts b/src/app/routes/partner/partner-list/services/partner-list.service.ts index a916f8b4..9756c19f 100644 --- a/src/app/routes/partner/partner-list/services/partner-list.service.ts +++ b/src/app/routes/partner/partner-list/services/partner-list.service.ts @@ -17,8 +17,18 @@ export class PartnerListService extends BaseService { $api_get_ent_partner_detail = '/api/mdc/partner/getEnterprise'; // 获取合伙人信息 $api_get_personal_partner_detail = '/api/mdc/partner/getPersonally'; + // 审核合伙人 + $api_audit_partner= '/api/mdc/partner/audit'; + // 修改返佣模板 + $api_update_partner_template= '/api/mdc/partner/updateTemplate'; + // 更新渠道销售 + $api_update_partner_channel= '/api/mdc/partner/updateChannelSale'; + // 重新发起CRM + $api_resend_crm= '/api/mdc/partner/reSendCrm'; // 查询合伙人修改渠道渠道销售记录 $api_get_personal_channel_list = '/api/mdc/partnerChannelRelLog/list/page'; + // 冻结/启用企业业 + $api_lock_freight = '/api/mdc/cuc/enterpriseInfo/operate/lock'; // 根据地区code查询列表 $api_get_region_by_code = '/api/mdc/pbc/region/getRegionByCode'; diff --git a/src/app/shared/shared-zorro.module.ts b/src/app/shared/shared-zorro.module.ts index bb75f8c0..ed9a1985 100644 --- a/src/app/shared/shared-zorro.module.ts +++ b/src/app/shared/shared-zorro.module.ts @@ -47,6 +47,7 @@ import { NzAffixModule } from 'ng-zorro-antd/affix'; import { NzTypographyModule } from 'ng-zorro-antd/typography'; import { NzSwitchModule } from 'ng-zorro-antd/switch'; import { NzImageModule } from 'ng-zorro-antd/image'; +import { NzTreeSelectModule } from 'ng-zorro-antd/tree-select'; export const SHARED_ZORRO_MODULES = [ NzButtonModule, @@ -88,5 +89,6 @@ export const SHARED_ZORRO_MODULES = [ NzAffixModule, NzTypographyModule, NzSwitchModule, - NzImageModule + NzImageModule, + NzTreeSelectModule ]; diff --git a/src/styles.less b/src/styles.less index 8426983a..cf7ad9c6 100644 --- a/src/styles.less +++ b/src/styles.less @@ -63,4 +63,22 @@ input[type="number"] { color : unset; cursor: not-allowed; } +} + +.area-tree-select { + .ant-select-tree .ant-select-tree-treenode-disabled { + .ant-select-tree-checkbox { + margin: 0; + + .ant-select-tree-checkbox-inner { + width : 0px; + border-color: #ffffff !important; + } + } + + .ant-select-tree-node-content-wrapper { + color : unset; + cursor: not-allowed; + } + } } \ No newline at end of file