This commit is contained in:
heqinghang
2022-03-22 17:50:56 +08:00
parent 1589bb4c82
commit 95dc8075eb
5 changed files with 40 additions and 30 deletions

View File

@ -60,7 +60,7 @@ export class ParterChannelSalesEditComponent implements OnInit {
ui: { ui: {
widget: 'autocomplete', widget: 'autocomplete',
placeholder:'请选择', placeholder:'请选择',
asyncData: () => this.service.request(this.service.$api_fuzzyQuery).pipe( asyncData: (input:string) => this.service.request(this.service.$api_fuzzyQuery,{name:input}).pipe(
map((res: any) => { map((res: any) => {
console.log('111',res) console.log('111',res)
return []; return [];
@ -81,7 +81,7 @@ export class ParterChannelSalesEditComponent implements OnInit {
default: '0', default: '0',
}, },
roleIds: { roleIds: {
title: '角色', title: '',
type: 'string', type: 'string',
ui: { ui: {
widget: 'select', widget: 'select',
@ -89,6 +89,7 @@ export class ParterChannelSalesEditComponent implements OnInit {
mode: 'multiple', mode: 'multiple',
maxMultipleCount: 5, maxMultipleCount: 5,
asyncData: () => { asyncData: () => {
return this.service.request(this.service.$api_getAppRoleList).pipe( return this.service.request(this.service.$api_getAppRoleList).pipe(
map((res: any) => { map((res: any) => {
return res return res

View File

@ -64,27 +64,27 @@ export class ParterChannelSalesListComponent implements OnInit {
this.columns = [ this.columns = [
{ {
title: '销售渠道姓名', title: '销售渠道姓名',
index: 'name1' index: 'name'
}, },
{ {
title: '手机号', title: '手机号',
index: 'name1' index: 'telephone'
}, },
{ {
title: '所属组织', title: '所属组织',
index: 'name1' index: 'organLable'
}, },
{ {
title: '职级', title: '职级',
index: 'name1' index: 'station'
}, },
{ {
title: '等级', title: '等级',
index: 'name1' index: 'postLevel'
}, },
{ {
title: '省市', title: '省市',
index: 'name1' index: 'residencePlace'
}, },
{ {
title: '邀请码', title: '邀请码',

View File

@ -75,6 +75,7 @@ export class ParterLevelConfigEditComponent implements OnInit {
if(!this.sf.valid) return; if(!this.sf.valid) return;
this.service.request(this.service.$api_save, { ...this.sf.value }).subscribe(res => { this.service.request(this.service.$api_save, { ...this.sf.value }).subscribe(res => {
if (res) { if (res) {
this.service.msgSrv.success('保存成功!')
this.modalRef.destroy(true); this.modalRef.destroy(true);
} else { } else {
this.service.msgSrv.error(res.msg); this.service.msgSrv.error(res.msg);

View File

@ -45,21 +45,22 @@ export class ParterLevelConfigListComponent implements OnInit {
properties: { properties: {
gradeName: { gradeName: {
type: 'string', type: 'string',
title: '等级姓名' title: '等级姓名',
}, },
stateLocked: { stateLocked: {
type: 'string', type: 'string',
title: '状态', title: '状态',
enum:[{label:'',value:'1'},{label:'',value:'2'}], enum:[{label:'启用',value:'1'},{label:'禁用',value:'0'}],
ui:{ ui:{
widget:'select' widget:'select',
} }
}, },
} }
}; };
this.ui = { this.ui = {
'*': { '*': {
grid: { span: 8, gutter: 4 } width:300,
grid: { span: 12, gutter: 4 }
} }
}; };
} }
@ -76,7 +77,7 @@ export class ParterLevelConfigListComponent implements OnInit {
}, },
{ {
title: '创建时间', title: '创建时间',
index: 'name1' index: 'createTime'
}, },
{ {
title: '启用时间', title: '启用时间',
@ -84,7 +85,10 @@ export class ParterLevelConfigListComponent implements OnInit {
}, },
{ {
title: '状态', title: '状态',
index: 'name1' index: 'stateLocked',
format: (item: any) => {
return item.stateLocked ? '禁用':'启用'
}
}, },
{ {
title: '操作', title: '操作',
@ -97,10 +101,12 @@ export class ParterLevelConfigListComponent implements OnInit {
{ {
text: '禁用', text: '禁用',
click: (_record, _modal, _instance) => this.stop(_record), click: (_record, _modal, _instance) => this.stop(_record),
iif:(item)=>!item.stateLocked
}, },
{ {
text: '启用', text: '启用',
click: (_record, _modal, _instance) => this.restart(_record), click: (_record, _modal, _instance) => this.restart(_record),
iif:(item)=>item.stateLocked
} }
] ]
} }
@ -145,30 +151,30 @@ export class ParterLevelConfigListComponent implements OnInit {
}); });
} }
restart(id: any) { restart(item: any) {
this.modalService.confirm({ this.modalService.confirm({
nzTitle: '<i>冻结确认</i>', nzTitle: '<i>冻结确认</i>',
nzContent: `<b>确定启用该账号吗?</br>`, nzContent: `<b>确定启用该账号吗?</br>`,
// nzOnOk: () => nzOnOk: () =>
// this.service.request('', '').subscribe(res => { this.service.request(this.service.$api_updatePartnerGradeConfig, {id:item.id}).subscribe(res => {
// if (res) { if (res) {
// this.service.msgSrv.success('冻结成功!'); this.service.msgSrv.success('启用成功!');
// this.st.reload(); this.st.reload();
// } }
// }) })
}); });
} }
stop(id: any) { stop(item: any) {
this.modalService.confirm({ this.modalService.confirm({
nzTitle: '<i>冻结确认</i>', nzTitle: '<i>冻结确认</i>',
nzContent: `<b>确定禁用该账号吗?</br>`, nzContent: `<b>确定禁用该账号吗?</br>`,
// nzOnOk: () => nzOnOk: () =>
// this.service.request('', '').subscribe(res => { this.service.request(this.service.$api_updatePartnerGradeConfig, {id:item.id}).subscribe(res => {
// if (res) { if (res) {
// this.service.msgSrv.success('冻结成功!'); this.service.msgSrv.success('冻结成功!');
// this.st.reload(); this.st.reload();
// } }
// }) })
}); });
} }

View File

@ -13,6 +13,8 @@ export class ChannelSalesService extends BaseService {
$api_save = '/api/mdc/partnerGradeConfig/save'; $api_save = '/api/mdc/partnerGradeConfig/save';
// 删除合伙人等级配置表 // 删除合伙人等级配置表
$api_del = '/api/mdc/partnerGradeConfig/deletebatch'; $api_del = '/api/mdc/partnerGradeConfig/deletebatch';
// 启用/禁用等级配置
$api_updatePartnerGradeConfig = '/api/mdc/partnerGradeConfig/updatePartnerGradeConfig';
constructor(public injector: Injector) { constructor(public injector: Injector) {
super(injector); super(injector);