diff --git a/src/app/routes/partner/channel-sales/components/list/list.component.ts b/src/app/routes/partner/channel-sales/components/list/list.component.ts index 9c150c22..c8014d97 100644 --- a/src/app/routes/partner/channel-sales/components/list/list.component.ts +++ b/src/app/routes/partner/channel-sales/components/list/list.component.ts @@ -21,13 +21,13 @@ export class ParterChannelSalesListComponent implements OnInit { sf!: SFComponent; spuStatus = '1'; - data=[{name1:1111}] + data = [{ name1: 1111 }] constructor( public router: Router, public ar: ActivatedRoute, public service: ChannelSalesService, private modalService: NzModalService - ) {} + ) { } /** * 查询参数 @@ -90,6 +90,17 @@ export class ParterChannelSalesListComponent implements OnInit { title: '邀请码', index: 'inviteCode' }, + { + title: '状态', + className: 'text-center', + index: 'stateLocked', + type: 'badge', + badge: { + true: { text: '冻结', color: 'error' }, + false: { text: '正常', color: 'success' } + }, + width: 130 + }, { title: '操作', className: 'text-center', @@ -100,7 +111,7 @@ export class ParterChannelSalesListComponent implements OnInit { }, { text: '冻结', - click: (_record, _modal, _instance) => this.stop(_record.id), + click: (_record, _modal, _instance) => this.stop(_record), } ] } @@ -109,10 +120,10 @@ export class ParterChannelSalesListComponent implements OnInit { add() { const modalRef = this.modalService.create({ - nzWidth:600, + nzWidth: 600, nzTitle: '新增', nzContent: ParterChannelSalesEditComponent, - nzComponentParams: {sts: 'add'} + nzComponentParams: { sts: 'add' } }); modalRef.afterClose.subscribe(res => { if (res) { @@ -124,7 +135,7 @@ export class ParterChannelSalesListComponent implements OnInit { // 编辑 edit(record: STData) { const modalRef = this.modalService.create({ - nzWidth:600, + nzWidth: 600, nzTitle: '编辑', nzContent: ParterChannelSalesEditComponent, nzComponentParams: { i: record } @@ -135,21 +146,23 @@ export class ParterChannelSalesListComponent implements OnInit { } }); } - - - - stop(id: any) { - this.modalService.confirm({ - nzTitle: '冻结确认', - nzContent: `确定冻结该账号吗?
`, - // nzOnOk: () => - // this.service.request('', '').subscribe(res => { - // if (res) { - // this.service.msgSrv.success('冻结成功!'); - // this.st.reload(); - // } - // }) - }); + stop(record: STData) { + if (!record.stateLocked) { + const params = { + id: record.id + } + this.modalService.confirm({ + nzTitle: '冻结确认', + nzContent: `确定冻结该账号吗?
`, + nzOnOk: () => + this.service.request(this.service.$api_frozenChannelSales, params).subscribe(res => { + if (res) { + this.service.msgSrv.success('冻结成功!'); + this.st.reload(); + } + }) + }); + } } /** diff --git a/src/app/routes/partner/channel-sales/services/channel-sales.service.ts b/src/app/routes/partner/channel-sales/services/channel-sales.service.ts index 9382c6a9..6c17a145 100644 --- a/src/app/routes/partner/channel-sales/services/channel-sales.service.ts +++ b/src/app/routes/partner/channel-sales/services/channel-sales.service.ts @@ -19,6 +19,8 @@ export class ChannelSalesService extends BaseService { $api_listChannelSalesManagement = '/api/mdc/channelSalesManagement/list/listChannelSalesManagement'; // 根据渠道销售id获取渠道信息 $api_getChannelSalesInfo = '/api/mdc/channelSalesManagement/getChannelSalesInfo'; + // 冻结渠道销售 + $api_frozenChannelSales = '/api/mdc/channelSalesManagement/frozenChannelSales'; constructor(public injector: Injector) {