This commit is contained in:
wangshiming
2022-03-28 20:29:22 +08:00
parent cb50d0c36b
commit ac7eb6e3db
9 changed files with 191 additions and 240 deletions

View File

@ -4,7 +4,7 @@
* @Author : Shiming
* @Date : 2022-03-21 09:26:45
* @LastEditors : Shiming
* @LastEditTime : 2022-03-28 14:45:41
* @LastEditTime : 2022-03-28 19:47:56
* @FilePath : \\tms-obc-web\\src\\app\\routes\\partner\\rebate-management\\components\\rebate-setting\\add\\add.component.ts
* Copyright (C) 2022 huzhenhong. All rights reserved.
*/
@ -17,17 +17,23 @@ import { processSingleSort, 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'],
templateUrl: './add.component.html'
})
export class ParterRebateManageMentAddComponent implements OnInit {
setValue: string = '';
toFixedValue: Number = 2;
radioValue = 'A';
configName: string = '';
accountingRate: Number = 2;
partnerPeople: any;
partnerPeopleList: any;
peopleStatus: boolean = true;
configType = '1';
precision = 2;
inputValue = '';
@ViewChild('st', { static: true })
st!: STComponent;
@ViewChild('sf', { static: false }) sf!: SFComponent;
schema1!: SFSchema;
constructor(
@ -37,6 +43,27 @@ export class ParterRebateManageMentAddComponent implements OnInit {
private modal: NzModalService,
public shipperservice: ShipperBaseService
) {}
columns: STColumn[] = [
{
title: '合伙人名称',
index: 'enterpriseName',
width: 180,
format: item => (item.partnerType ? `${item.enterpriseName || item.contactName}` : '')
},
{ title: '联系人', index: 'contactName', width: 150, format: item => (item.partnerType ? `${item.contactName}` : '') },
{ 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',
buttons: [
{
text: '移除',
click: _record => this.delete(_record),
acl: { ability: ['AbnormalAppear-reply'] }
},
]
},
];
initSF(data?: any) {
this.schema1 = {
properties: {
@ -63,21 +90,46 @@ export class ParterRebateManageMentAddComponent implements OnInit {
window.history.go(-1);
}
/**
*申请退款
*合伙人选择
*/
add(item?: any) {
const modalRef = this.modal.create({
nzTitle: '申请退款',
nzTitle: '合伙人选择',
nzWidth: 1000,
nzContent: ParterRebateManageMentAddPartnerListComponent,
nzComponentParams: {
i: item,
},
nzFooter: null
});
modalRef.afterClose.subscribe((res: boolean) => {
modalRef.afterClose.subscribe((res: any) => {
if (res) {
console.log(Array.isArray(res));
console.log(res);
if(Array.isArray(res)) {
this.partnerPeopleList = res;
this.peopleStatus = false
} else {
this.partnerPeople = res?.enterpriseName;
}
}
});
}
delete(item: any) {
console.log(item);
}
save () {
const params = {
accountingRate: this.accountingRate,
configName: this.configName,
configType: this.configType,
rebateConfigLineDTO: {}
}
this.service.request(this.service.$api_save_rebateConfig, params).subscribe((res: any) => {
if(res) {
console.log(res);
}
})
}
}