This commit is contained in:
wangshiming
2022-04-26 16:46:46 +08:00
parent 0c18408b3d
commit 9fd75c3dde
4 changed files with 29 additions and 49 deletions

View File

@ -11,6 +11,7 @@ import { EventEmitter} from '@angular/core'
})
export class RebateTableComponent implements OnInit {
@Input() data: any =[];
@Input() type: any;
@Output()
private dataChange: EventEmitter<any> = new EventEmitter();
emit() {
@ -24,15 +25,13 @@ export class RebateTableComponent implements OnInit {
constructor(public service: BaseService, private cdr: ChangeDetectorRef) {}
ngOnInit(): void {
this.data = [
{
gradeConfigId: '',
startAmount: 0,
endAmount: 0,
managementFeeRatio: 0,
}
];
this.loadData();
if(this.type == '2') {
this.loadData();
}
console.log(this.type);
console.log(this.data);
this.changeendAmountAction();
}
@ -40,7 +39,7 @@ export class RebateTableComponent implements OnInit {
this.service.request('/api/mdc/partnerGradeConfig/listPartnerGradeConfig').subscribe(res => {
if (res) {
console.log(res);
this.grage = res;
this.grage = res;
this.cdr.detectChanges();
}
});
@ -70,6 +69,8 @@ export class RebateTableComponent implements OnInit {
changeendAmountAction() {
this.changeSub.pipe(debounceTime(500)).subscribe((res: string) => {
if (res) {
console.log(res);
const paras = res.split(',');
const num = Number(paras[0]);
const i = Number(paras[1]);
@ -113,22 +114,6 @@ export class RebateTableComponent implements OnInit {
this.data = [...newArr];
}
save() {
console.log(this.data)
let params= {
rebateConfigDTOS: this.data
}
console.log(params);
this.service.request('/api/mdc/cuc/rebateConfig/saveBatch', params).subscribe(res => {
if (res) {
console.log(res);
this.service.msgSrv.success('修改成功');
this.loadData();
}
});
}
/**
* 遍历同步后置位公里数
* @param event 车长