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

@ -4,7 +4,7 @@
* @Author : Shiming
* @Date : 2022-01-25 20:18:52
* @LastEditors : Shiming
* @LastEditTime : 2022-04-22 14:09:16
* @LastEditTime : 2022-04-26 16:20:47
* @FilePath : \\tms-obc-web\\src\\app\\shared\\components\\rebate-table\\rebate-table.component.html
* Copyright (C) 2022 huzhenhong. All rights reserved.
-->
@ -23,7 +23,7 @@
<th nzWidth="160px" nzAlign="center" >初始业务量(万/月)</th>
<th nzWidth="160px" nzAlign="center" >到达业务量(万/月)</th>
<th nzWidth="160px" nzAlign="center" >管理费比例%</th>
<th rowspan="2" nzWidth="60px" nzAlign="center" nzRight>操作</th>
<th rowspan="2" nzWidth="60px" nzAlign="center" nzRight *ngIf="type == '2'">操作</th>
</tr>
</thead>
<tbody>
@ -37,8 +37,11 @@
</td>
<td nzWidth="220px" nzAlign="center" >
<div >
<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 *ngIf="type == '2'" style="min-width: 150px;" [(ngModel)]="item.gradeConfigId" >
<nz-option *ngFor="let item of grage" [nzValue]="item.id" [nzLabel]="item.gradeName" ></nz-option>
</nz-select>
<nz-select *ngIf="type == '1'" style="min-width: 150px;" [(ngModel)]="item.gradeConfigId" >
<nz-option [nzValue]="0" nzLabel="全部等级" ></nz-option>
</nz-select>
</div>
</td>
@ -72,11 +75,11 @@
</ng-template>
</div>
</td>
<td nzWidth="60px" nzAlign="center" nzRight>
<a nz-popconfirm
<td nzWidth="60px" nzAlign="center" nzRight *ngIf="type == '2'">
<a style=" font-size: 20px;" nz-popconfirm
nzPopconfirmTitle="是否新增?" (nzOnConfirm)="add()"
>+</a>
<a *ngIf="i === groupingTable.data.length-1 && groupingTable.data.length>1"
<a style="margin-left: 10px; font-size: 20px;" *ngIf="i === groupingTable.data.length-1 && groupingTable.data.length>1"
nz-popconfirm
nzPopconfirmTitle="是否确认删除?" (nzOnConfirm)="deleteRow(i)"
>-</a>

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 车长