This commit is contained in:
wangshiming
2022-04-24 13:43:23 +08:00
parent f0e17090d5
commit 64371322e3
2 changed files with 32 additions and 32 deletions

View File

@ -4,7 +4,7 @@
* @Author : Shiming
* @Date : 2022-02-24 20:09:49
* @LastEditors : Shiming
* @LastEditTime : 2022-04-22 14:29:23
* @LastEditTime : 2022-04-24 13:42:10
* @FilePath : \\tms-obc-web\\src\\app\\routes\\partner\\rebate-management\\components\\rebate-setting\\add\\add.component.html
* Copyright (C) 2022 huzhenhong. All rights reserved.
-->

View File

@ -8,16 +8,14 @@
* @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';
import { STColumn, STComponent, STData, STRequestOptions } from '@delon/abc/st';
import { SFComponent, SFDateWidgetSchema, SFSchema, SFUISchema } from '@delon/form';
import { processSingleSort, ShipperBaseService } from '@shared';
import { STColumn, STComponent } from '@delon/abc/st';
import { SFComponent, SFSchema } from '@delon/form';
import { ShipperBaseService } from '@shared';
import { NzModalService } from 'ng-zorro-antd/modal';
import { RebateManagementService } from '../../../services/rebate-management.service';
import { ParterRebateManageMentAddPartnerListComponent } from '../add-partnerlist/add-partnerlist.component';
import { inRange } from '@delon/util';
@Component({
selector: 'app-parter-channel-rebate-management-add',
styleUrls: ['./add.component.less'],
@ -35,7 +33,7 @@ export class ParterRebateManageMentAddComponent implements OnInit {
partnerPeopleList: any = [];
configType = '1';
precision = 2;
partnerId :Array<string> =[];
partnerId: Array<string> = [];
inputValue = '';
@ViewChild('st', { static: true })
st!: STComponent;
@ -59,15 +57,17 @@ export class ParterRebateManageMentAddComponent implements OnInit {
{ title: '手机号', index: 'contactMobile', className: 'text-center', width: 150 },
{ title: '类型', index: 'partnerType', className: 'text-center', width: 130, type: 'enum', enum: { 1: '企业', 2: '个人' } },
{
title: '操作', width: '90px', fixed: 'right',
title: '操作',
width: '90px',
fixed: 'right',
buttons: [
{
text: '移除',
click: _record => this.delete(_record),
acl: { ability: ['AbnormalAppear-reply'] }
},
}
]
},
}
];
initSF(data?: any) {
this.schema1 = {
@ -79,16 +79,16 @@ export class ParterRebateManageMentAddComponent implements OnInit {
widget: 'tinymce',
loadingTip: 'loading...',
config: {
height: 500,
height: 500
}
},
}
// default: data?.agreementContent || ''
}
}
};
}
ngOnInit() {
this.addStatus =false
this.addStatus = false;
this.initSF();
}
goBack() {
@ -97,64 +97,64 @@ export class ParterRebateManageMentAddComponent implements OnInit {
/**
*合伙人选择
*/
add(item?: any) {
add(item?: any) {
const modalRef = this.modal.create({
nzTitle: '合伙人选择',
nzWidth: 1000,
nzContent: ParterRebateManageMentAddPartnerListComponent,
nzComponentParams: {
i: item,
i: item
},
nzFooter: null
});
modalRef.afterClose.subscribe((res: any) => {
this.partnerId = [];
if (res) {
if(Array.isArray(res)) {
if (Array.isArray(res)) {
console.log(res);
console.log(this.partnerPeopleList);
this.partnerPeopleList = this.partnerPeopleList.concat(res);
this.partnerPeopleList = this.partnerPeopleList.concat(res);
res.forEach((ele: any) => {
this.partnerId.push(ele?.id);
})
});
} else {
console.log(res);
this.partnerPeopleList = this.partnerPeopleList.concat(res);
this.partnerPeopleList = this.partnerPeopleList.concat(res);
this.partnerId.push(res?.id);
}
}
}
});
}
delete(item: any) {
this.partnerPeopleList = this.partnerPeopleList.filter((d:any, i: any) => {
return item.id != d.id
});
this.partnerPeopleList = this.partnerPeopleList.filter((d: any, i: any) => {
return item.id != d.id;
});
}
save () {
save() {
const params = {
accountingRate: this.accountingRate,
configName: this.configName,
configType: this.configType,
rebateConfigLineDTO: this.table.data,
priority: this.priority,// 优先级
priority: this.priority, // 优先级
partnerId: this.partnerId.join(','),
ruleDescription: this.sf.value.ruleDescription,
remarke: this.remarke,
partnerType: this.partnerType
}
};
console.log(params);
this.service.request(this.service.$api_save_rebateConfig, params).subscribe((res: any) => {
if(res) {
if (res) {
console.log(res);
this.service.msgSrv.success('新增成功!')
this.router.navigate(['/partner/rebate/setting'])
this.service.msgSrv.success('新增成功!');
this.router.navigate(['/partner/rebate/setting']);
}
})
});
}
changePartner(value: any) {
console.log(value);
if(value) {
this.addStatus = true
if (value) {
this.addStatus = true;
}
}
}