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-01-25 20:18:52
* @LastEditors : Shiming
* @LastEditTime : 2022-03-28 20:26:30
* @LastEditTime : 2022-03-29 10:34:14
* @FilePath : \\tms-obc-web\\src\\app\\shared\\components\\rebate-table\\rebate-table.component.html
* Copyright (C) 2022 huzhenhong. All rights reserved.
-->
@ -37,10 +37,9 @@
</td>
<td nzWidth="220px" nzAlign="center" >
<div >
<nz-select ngModel="gradeConfigId">
<nz-option nzValue="jack" nzLabel="Jack154654564654"></nz-option>
<nz-option nzValue="lucy" nzLabel="Lucy"></nz-option>
</nz-select>
<nz-select style="min-width: 150px;" [(ngModel)]="item.gradeConfigId" >
<nz-option *ngFor="let item of grage" [nzValue]="item.id" [nzLabel]="item.gradeName"></nz-option>
</nz-select>
</div>
</td>
<td nzWidth="220px" nzAlign="center" >

View File

@ -1,41 +1,49 @@
import { debounceTime } from 'rxjs/operators';
import { Subject } from 'rxjs';
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, OnInit, ViewChild } from '@angular/core';
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, Input, OnInit, Output, ViewChild } from '@angular/core';
import { BaseService } from '@shared';
import { SFComponent, SFSchema, SFUISchema } from '@delon/form';
import { EventEmitter} from '@angular/core'
@Component({
selector: 'app-rebate-table',
templateUrl: './rebate-table.component.html',
styleUrls: ['./rebate-table.component.less']
})
export class RebateTableComponent implements OnInit {
data: any[] = [
{
gradeConfigId: '',
startAmount: 0,
endAmount: 0,
managementFeeRatio: 0,
}
];
@Input() data: any =[];
@Output()
private dataChange: EventEmitter<any> = new EventEmitter();
emit() {
this.dataChange.emit(this.data)
}
headers: any[] = [];
gradeConfigId: string ='';
grage: any[] = [];
formatterDollar = (value: number): string => `${value}`;
changeSub = new Subject<string>();
constructor(public service: BaseService, private cdr: ChangeDetectorRef) {}
ngOnInit(): void {
this.data = [
{
gradeConfigId: '',
startAmount: 0,
endAmount: 0,
managementFeeRatio: 0,
}
];
this.loadData();
this.changeendAmountAction();
}
loadData() {
// this.service.request('/api/mdc/cuc/insuranceConfig/list').subscribe(res => {
// if (res) {
// console.log(res);
// this.data = res;
// this.cdr.detectChanges();
// }
// });
this.service.request('/api/mdc/partnerGradeConfig/listPartnerGradeConfig').subscribe(res => {
if (res) {
console.log(res);
this.grage = res;
this.cdr.detectChanges();
}
});
// this.service.request('/api/mdc/pbc/sysConfigItem/findItemValueByItemKeys', [
// "rebate.config.minrebatePrice"
// ]).subscribe(res => {
@ -66,12 +74,13 @@ export class RebateTableComponent implements OnInit {
const num = Number(paras[0]);
const i = Number(paras[1]);
if (num <= this.data[i].startAmount) {
if (num <= this.data[i]?.startAmount) {
console.log(this.data[i].endAmount);
this.data[i].endAmount = null;
setTimeout(() => {
this.data[i].endAmount = this.data[i].startAmount + 1 ;
this.data[i].endAmount = this.data[i]?.startAmount + 1 ;
}, 0);
this.changeNextstartAmount(this.data[i].startAmount + 1, i + 1);
this.changeNextstartAmount(this.data[i]?.startAmount + 1, i + 1);
return;
}
this.data[i].endAmount = num;