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-02-24 20:09:49
* @LastEditors : Shiming
* @LastEditTime : 2022-04-26 15:50:41
* @LastEditTime : 2022-04-26 16:04:31
* @FilePath : \\tms-obc-web\\src\\app\\routes\\partner\\rebate-management\\components\\rebate-setting\\add\\add.component.html
* Copyright (C) 2022 huzhenhong. All rights reserved.
-->
@ -37,8 +37,11 @@
</sv>
<sv col="1">
<div style="width: 850px">
<app-rebate-table #table [(data)]="tabelData"></app-rebate-table>
<div style="width: 850px" *ngIf="configType == '1'">
<app-rebate-table #table [(data)]="tabelData" [type]="1"></app-rebate-table>
</div>
<div style="width: 850px" *ngIf="configType == '2'">
<app-rebate-table #table [(data)]="tabelData" [type]="2"></app-rebate-table>
</div>
</sv>

View File

@ -4,7 +4,7 @@
* @Author : Shiming
* @Date : 2022-03-21 09:26:45
* @LastEditors : Shiming
* @LastEditTime : 2022-04-26 15:51:04
* @LastEditTime : 2022-04-26 16:37:57
* @FilePath : \\tms-obc-web\\src\\app\\routes\\partner\\rebate-management\\components\\rebate-setting\\add\\add.component.ts
* Copyright (C) 2022 huzhenhong. All rights reserved.
*/
@ -25,6 +25,7 @@ export class ParterRebateManageMentAddComponent implements OnInit {
@ViewChild('table') table!: any;
titleText :string= '新增';
tabelData: any;
tabelType: any;
formData: any;
addStatus: boolean = false;
hiden: boolean = false;
@ -88,7 +89,6 @@ export class ParterRebateManageMentAddComponent implements OnInit {
text: '移除',
click: _record => this.delete(_record),
iif: ()=> {
console.log(this.hiden);
return !this.hiden
},
acl: { ability: ['AbnormalAppear-reply'] }
@ -98,7 +98,6 @@ export class ParterRebateManageMentAddComponent implements OnInit {
];
}
ngOnInit() {
console.log(this.ar.snapshot.queryParams.id);
if(this.ar.snapshot?.queryParams?.id) {
this.titleText= '查看'
this.hiden= true
@ -128,14 +127,11 @@ export class ParterRebateManageMentAddComponent implements OnInit {
this.partnerId = [];
if (res) {
if (Array.isArray(res)) {
console.log(res);
console.log(this.partnerPeopleList);
this.partnerPeopleList = this.partnerPeopleList.concat(res);
res.forEach((ele: any) => {
this.partnerId.push(ele?.id);
});
} else {
console.log(res);
this.partnerPeopleList = this.partnerPeopleList.concat(res);
this.partnerId.push(res?.id);
}
@ -148,9 +144,6 @@ export class ParterRebateManageMentAddComponent implements OnInit {
});
}
save() {
console.log(this.partnerId);
console.log(this.partnerId.join(','));
const params = {
accountingRate: this.accountingRate,
configName: this.configName,
@ -162,10 +155,8 @@ export class ParterRebateManageMentAddComponent implements OnInit {
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']);
}
@ -173,7 +164,6 @@ export class ParterRebateManageMentAddComponent implements OnInit {
}
initData(id:string) {
this.service.request(this.service.$api_get_getPartnerRebateConfigInfo, {id: id}).subscribe((res: any) => {
console.log(res);
if(res) {
this.configName = res?.configName;
this.accountingRate = res?.accountingRate;
@ -189,7 +179,6 @@ export class ParterRebateManageMentAddComponent implements OnInit {
})
}
changePartner(value: any) {
console.log(value);
if (value == '3') {
this.addStatus = true;
} else {

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