This commit is contained in:
heqinghang
2022-03-21 10:15:29 +08:00
parent f18d53130a
commit ba4310e079
4 changed files with 57 additions and 27 deletions

View File

@ -1,6 +1,6 @@
import { AfterViewInit, ChangeDetectorRef, Component, OnChanges, OnInit, ViewChild } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { SFComponent, SFRadioWidgetSchema, SFSchema, SFSchemaEnumType, SFSelectWidgetSchema, SFTextareaWidgetSchema, SFUISchema } from '@delon/form';
import { SFAutoCompleteWidgetSchema, SFComponent, SFRadioWidgetSchema, SFSchema, SFSchemaEnumType, SFSelectWidgetSchema, SFTextareaWidgetSchema, SFUISchema } from '@delon/form';
import { _HttpClient } from '@delon/theme';
import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal';
import { map } from 'rxjs/operators';
@ -38,18 +38,37 @@ export class ParterChannelSalesEditComponent implements OnInit {
title: '',
ui: { hidden: true }
},
name1: {
title: '业务员选择',
name: {
title: '渠道销售姓名',
type: 'string',
enum: [
{ label: '王武', value: '1'},
],
maxLength: 12,
ui: {
widget: 'select',
placeholder:'请选择'
} as SFSelectWidgetSchema,
placeholder:'请输入'
}
},
name2: {
phoneNumber: {
title: '手机号',
type: 'string',
maxLength: 11,
ui: {
placeholder:'请输入'
}
},
employeeVO: {
title: '关联OA员工',
type: 'string',
ui: {
widget: 'autocomplete',
placeholder:'请选择',
asyncData: () => this.service.request(this.service.$api_fuzzyQuery).pipe(
map((res: any) => {
console.log('111',res)
return [];
})
)
} as SFAutoCompleteWidgetSchema,
},
isAuthorization: {
type: 'string',
title: '授权登录运营后台',
enum: [
@ -59,9 +78,9 @@ export class ParterChannelSalesEditComponent implements OnInit {
ui: {
widget: 'radio',
} as SFRadioWidgetSchema,
default: 'A',
default: '0',
},
name: {
roleIds: {
title: '',
type: 'string',
enum: [
@ -70,10 +89,10 @@ export class ParterChannelSalesEditComponent implements OnInit {
ui: {
widget: 'select',
placeholder:'授权角色',
visibleIf: { name2: (value: string) => value === '1' }
visibleIf: { isAuthorization: (value: string) => value === '1' }
} as SFSelectWidgetSchema,
},
name3: {
remark: {
type: 'string',
title: '备注',
maxLength: 50,
@ -84,15 +103,16 @@ export class ParterChannelSalesEditComponent implements OnInit {
} as SFTextareaWidgetSchema,
},
},
required: ['name1', 'name2']
required: ['name', 'phoneNumber', 'employeeVO', 'roleIds', 'remark']
};
this.ui = {
'*': {
spanLabelFixed: 150,
grid: { span: 24 }
},
$name:{ spanLabelFixed: 10, grid: { span: 12 }},
$name2:{ grid: { span: 12 }},
$isAuthorization:{ grid: { span: 12 }},
$roleIds:{ spanLabelFixed: 10, grid: { span: 12 }},
};
}
@ -103,12 +123,12 @@ export class ParterChannelSalesEditComponent implements OnInit {
save() {
this.sf.validator({ emitError: true });
if(!this.sf.valid) return;
// this.service.request('', { ...this.sf.value }).subscribe(res => {
// if (res) {
// this.modalRef.destroy(true);
// } else {
// this.service.msgSrv.error(res.msg);
// }
// });
this.service.request(this.service.$api_save, { ...this.sf.value }).subscribe(res => {
if (res) {
this.modalRef.destroy(true);
} else {
this.service.msgSrv.error(res.msg);
}
});
}
}

View File

@ -15,7 +15,7 @@
<!-- 数据列表 -->
<st
#st
[data]="data"
[data]="service.$api_getPage"
[columns]="columns"
[req]="{ method: 'POST', allInBody: true, reName: { pi: 'pageIndex', ps: 'pageSize' }, params: reqParams }"
[res]="{ reName: { list: 'data.records', total: 'data.total' } }"

View File

@ -47,7 +47,7 @@ export class ParterChannelSalesListComponent implements OnInit {
type: 'string',
title: '销售渠道姓名'
},
phone: {
telephone: {
type: 'string',
title: '手机号'
},
@ -88,7 +88,7 @@ export class ParterChannelSalesListComponent implements OnInit {
},
{
title: '邀请码',
index: 'name1'
index: 'inviteCode'
},
{
title: '操作',

View File

@ -5,6 +5,16 @@ import { BaseService } from '@shared';
providedIn: 'root',
})
export class ChannelSalesService extends BaseService {
// 保存渠道销售管理
$api_save = '/api/mdc/channelSalesManagement/save';
// 查询渠道销售管理表
$api_getPage = '/api/mdc/channelSalesManagement/list/page';
// OA员工模糊查询
$api_fuzzyQuery = '/api/mdc/channelSalesManagement/fuzzyQuery';
constructor(public injector: Injector) {
super(injector);