This commit is contained in:
wangshiming
2022-03-29 11:10:12 +08:00
parent 4439f94956
commit ed90f4090a
14 changed files with 159 additions and 92 deletions

View File

@ -4,7 +4,7 @@
* @Author : Shiming
* @Date : 2022-03-21 09:26:45
* @LastEditors : Shiming
* @LastEditTime : 2022-03-28 19:47:56
* @LastEditTime : 2022-03-29 10:53:39
* @FilePath : \\tms-obc-web\\src\\app\\routes\\partner\\rebate-management\\components\\rebate-setting\\add\\add.component.ts
* Copyright (C) 2022 huzhenhong. All rights reserved.
*/
@ -24,13 +24,17 @@ import { inRange } from '@delon/util';
templateUrl: './add.component.html'
})
export class ParterRebateManageMentAddComponent implements OnInit {
@ViewChild('table') table!: any;
tabelData: any;
configName: string = '';
accountingRate: Number = 2;
partnerPeople: any;
partnerType: string = '';
remarke: string = '';
accountingRate: Number = 0;
priority: string = '';
partnerPeopleList: any;
peopleStatus: boolean = true;
configType = '1';
precision = 2;
partnerId :Array<string> =[];
inputValue = '';
@ViewChild('st', { static: true })
st!: STComponent;
@ -67,7 +71,7 @@ export class ParterRebateManageMentAddComponent implements OnInit {
initSF(data?: any) {
this.schema1 = {
properties: {
content: {
ruleDescription: {
type: 'string',
title: '',
ui: {
@ -77,7 +81,7 @@ export class ParterRebateManageMentAddComponent implements OnInit {
height: 650
}
},
default: data?.agreementContent || ''
// default: data?.agreementContent || ''
}
}
};
@ -85,7 +89,6 @@ export class ParterRebateManageMentAddComponent implements OnInit {
ngOnInit() {
this.initSF();
}
submit() {}
goBack() {
window.history.go(-1);
}
@ -103,15 +106,19 @@ export class ParterRebateManageMentAddComponent implements OnInit {
nzFooter: null
});
modalRef.afterClose.subscribe((res: any) => {
this.partnerId = [];
if (res) {
console.log(Array.isArray(res));
console.log(res);
if(Array.isArray(res)) {
this.partnerPeopleList = res;
this.peopleStatus = false
res.forEach((ele: any) => {
this.partnerId.push(ele?.id);
})
} else {
this.partnerPeople = res?.enterpriseName;
}
this.partnerPeopleList = [res];
this.partnerId.push(res?.id);
}
}
});
}
@ -123,12 +130,19 @@ export class ParterRebateManageMentAddComponent implements OnInit {
accountingRate: this.accountingRate,
configName: this.configName,
configType: this.configType,
rebateConfigLineDTO: {}
rebateConfigLineDTO: this.table.data,
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) {
console.log(res);
this.service.msgSrv.success('新增成功!')
this.router.navigate(['/partner/rebate/setting'])
}
})
}