666
This commit is contained in:
		| @ -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); | ||||
|       } | ||||
|     }); | ||||
|   } | ||||
| } | ||||
|  | ||||
| @ -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' } }" | ||||
|  | ||||
| @ -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: '操作', | ||||
|  | ||||
| @ -6,6 +6,16 @@ import { BaseService } from '@shared'; | ||||
| }) | ||||
| 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); | ||||
|   } | ||||
|  | ||||
		Reference in New Issue
	
	Block a user