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

View File

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

View File

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

View File

@ -5,6 +5,16 @@ import { BaseService } from '@shared';
providedIn: 'root', providedIn: 'root',
}) })
export class ChannelSalesService extends BaseService { 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) { constructor(public injector: Injector) {
super(injector); super(injector);