diff --git a/src/app/routes/partner/channel-sales/components/edit/edit.component.ts b/src/app/routes/partner/channel-sales/components/edit/edit.component.ts index 5e5d6e85..3ba33a79 100644 --- a/src/app/routes/partner/channel-sales/components/edit/edit.component.ts +++ b/src/app/routes/partner/channel-sales/components/edit/edit.component.ts @@ -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,21 +78,31 @@ export class ParterChannelSalesEditComponent implements OnInit { ui: { widget: 'radio', } as SFRadioWidgetSchema, - default: 'A', + default: '0', }, - name: { - title: '', + roleIds: { + title: '角色', type: 'string', - enum: [ - { label: '管理员', value: '1'}, - ], ui: { widget: 'select', - placeholder:'授权角色', - visibleIf: { name2: (value: string) => value === '1' } - } as SFSelectWidgetSchema, + placeholder: '授权角色', + mode: 'multiple', + maxMultipleCount: 5, + asyncData: () => { + return this.service.request(this.service.$api_getAppRoleList).pipe( + map((res: any) => { + return res + .filter((role: any) => role.roleCode !== 'Administrator') + .map((item: any) => { + return { label: item.roleName, value: item.id }; + }); + }) + ); + }, + visibleIf: { isAuthorization: (value: string) => value === '1' } + }, }, - name3: { + remark: { type: 'string', title: '备注', maxLength: 50, @@ -84,15 +113,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 +133,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); + } + }); } } diff --git a/src/app/routes/partner/channel-sales/components/list/list.component.html b/src/app/routes/partner/channel-sales/components/list/list.component.html index fd0078d8..589c32e9 100644 --- a/src/app/routes/partner/channel-sales/components/list/list.component.html +++ b/src/app/routes/partner/channel-sales/components/list/list.component.html @@ -15,7 +15,7 @@ value === '1' } - } as SFSelectWidgetSchema, }, - name3: { + sortId: { + title: '排序', + type: 'string', + }, + remark: { type: 'string', title: '备注', maxLength: 50, @@ -61,7 +57,7 @@ export class ParterLevelConfigEditComponent implements OnInit { } as SFTextareaWidgetSchema, }, }, - required: ['name1', 'name2'] + required: ['gradeName', 'sortId', 'remark'] }; this.ui = { '*': { @@ -77,12 +73,12 @@ export class ParterLevelConfigEditComponent 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); + } + }); } } diff --git a/src/app/routes/partner/level-config/components/list/list.component.html b/src/app/routes/partner/level-config/components/list/list.component.html index fd0078d8..e6f50f99 100644 --- a/src/app/routes/partner/level-config/components/list/list.component.html +++ b/src/app/routes/partner/level-config/components/list/list.component.html @@ -15,7 +15,7 @@ - + +
+ - 12121212 - + +    + 固定结算费率配置 +     % + 业务量和管理费比例配置 +    + + + + + + +    + + 关联合伙人配置 +    + + + + +   添加 + +    + + + + + +    + + +    + + + + +
diff --git a/src/app/routes/partner/rebate-management/components/rebate-setting/add/add.component.less b/src/app/routes/partner/rebate-management/components/rebate-setting/add/add.component.less new file mode 100644 index 00000000..0c812cac --- /dev/null +++ b/src/app/routes/partner/rebate-management/components/rebate-setting/add/add.component.less @@ -0,0 +1,10 @@ +:host { + ::ng-deep { + .sv__label { + color: #000; + } + .sv__title { + font-weight: 700; + } + } +} diff --git a/src/app/routes/partner/rebate-management/components/rebate-setting/add/add.component.ts b/src/app/routes/partner/rebate-management/components/rebate-setting/add/add.component.ts index ebfe0bce..3edd7ef2 100644 --- a/src/app/routes/partner/rebate-management/components/rebate-setting/add/add.component.ts +++ b/src/app/routes/partner/rebate-management/components/rebate-setting/add/add.component.ts @@ -1,3 +1,13 @@ +/* + * @Description : + * @Version : 1.0 + * @Author : Shiming + * @Date : 2022-03-21 09:26:45 + * @LastEditors : Shiming + * @LastEditTime : 2022-03-21 13:44:34 + * @FilePath : \\tms-obc-web\\src\\app\\routes\\partner\\rebate-management\\components\\rebate-setting\\add\\add.component.ts + * Copyright (C) 2022 huzhenhong. All rights reserved. + */ import { ModalHelper } from '@delon/theme'; import { Component, OnInit, ViewChild } from '@angular/core'; import { ActivatedRoute, Router } from '@angular/router'; @@ -8,10 +18,17 @@ import { NzModalService } from 'ng-zorro-antd/modal'; import { RebateManagementService } from '../../../services/rebate-management.service'; @Component({ selector: 'app-parter-channel-rebate-management-add', + styleUrls: ['./add.component.less'], templateUrl: './add.component.html' }) export class ParterRebateManageMentAddComponent implements OnInit { - + setValue: string = ''; + toFixedValue: Number = 2; + radioValue = 'A'; + precision = 2; + inputValue= ''; + @ViewChild('sf', { static: false }) sf!: SFComponent; + schema1!: SFSchema; constructor( public router: Router, public ar: ActivatedRoute, @@ -19,7 +36,25 @@ export class ParterRebateManageMentAddComponent implements OnInit { private modal: NzModalService, public shipperservice: ShipperBaseService, ) {} - + initSF(data?: any) { + this.schema1 = { + properties: { + content: { + type: 'string', + title: '', + ui: { + widget: 'tinymce', + loadingTip: 'loading...', + config: { + height: 650 + } + }, + default: data?.agreementContent || '' + } + } + }; + } ngOnInit() { + this.initSF() } }