This commit is contained in:
wangshiming
2022-04-26 16:52:20 +08:00
parent c7f22dbde0
commit c9afdb19d4
2 changed files with 36 additions and 25 deletions

View File

@ -4,7 +4,7 @@
* @Author : Shiming
* @Date : 2022-02-24 20:09:49
* @LastEditors : Shiming
* @LastEditTime : 2022-04-26 16:04:31
* @LastEditTime : 2022-04-26 16:51:07
* @FilePath : \\tms-obc-web\\src\\app\\routes\\partner\\rebate-management\\components\\rebate-setting\\add\\add.component.html
* Copyright (C) 2022 huzhenhong. All rights reserved.
-->
@ -38,10 +38,10 @@
<sv col="1">
<div style="width: 850px" *ngIf="configType == '1'">
<app-rebate-table #table [(data)]="tabelData" [type]="1"></app-rebate-table>
<app-rebate-table #table [(data)]="tabelData" [type]="1" [hiden]="hiden"></app-rebate-table>
</div>
<div style="width: 850px" *ngIf="configType == '2'">
<app-rebate-table #table [(data)]="tabelData" [type]="2"></app-rebate-table>
<app-rebate-table #table [(data)]="tabelData" [type]="2" [hiden]="hiden"></app-rebate-table>
</div>
</sv>

View File

@ -3,7 +3,7 @@ import { Subject } from 'rxjs';
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'
import { EventEmitter } from '@angular/core';
@Component({
selector: 'app-rebate-table',
templateUrl: './rebate-table.component.html',
@ -12,10 +12,11 @@ import { EventEmitter} from '@angular/core'
export class RebateTableComponent implements OnInit {
@Input() data: any = [];
@Input() type: any;
@Input() hiden!: boolean;
@Output()
private dataChange: EventEmitter<any> = new EventEmitter();
emit() {
this.dataChange.emit(this.data)
this.dataChange.emit(this.data);
}
headers: any[] = [];
gradeConfigId: string = '';
@ -27,8 +28,27 @@ export class RebateTableComponent implements OnInit {
ngOnInit(): void {
if (this.type == '2') {
this.loadData();
}
if (!this.hiden && this.type == '2') {
this.data = [
{
gradeConfigId: '',
startAmount: 0,
endAmount: 0,
managementFeeRatio: 0,
}
];
} else if (!this.hiden && this.type == '1'){
this.data = [
{
gradeConfigId: 0,
startAmount: 0,
endAmount: 0,
managementFeeRatio: 0,
}
];
}
console.log(this.type);
console.log(this.data);
@ -43,17 +63,8 @@ export class RebateTableComponent implements OnInit {
this.cdr.detectChanges();
}
});
// this.service.request('/api/mdc/pbc/sysConfigItem/findItemValueByItemKeys', [
// "rebate.config.minrebatePrice"
// ]).subscribe(res => {
// if (res) {
// console.log(res);
// }
// });
}
/**
* 修改结束公里数
* @param event 车长
@ -99,7 +110,7 @@ export class RebateTableComponent implements OnInit {
gradeConfigId: '',
startAmount: 0,
endAmount: 0,
managementFeeRatio: 0,
managementFeeRatio: 0
});
this.data = [...this.data];
}
@ -108,7 +119,7 @@ export class RebateTableComponent implements OnInit {
deleteRow(index: number) {
console.log(index);
var newArr = this.data.concat();
newArr.splice(this.data.length-1,1)
newArr.splice(this.data.length - 1, 1);
// this.data = this.data.pop()
console.log(newArr);
this.data = [...newArr];