fix bug
This commit is contained in:
		| @ -4,7 +4,7 @@ | |||||||
|  * @Author       : Shiming |  * @Author       : Shiming | ||||||
|  * @Date         : 2022-02-24 20:09:49 |  * @Date         : 2022-02-24 20:09:49 | ||||||
|  * @LastEditors  : Shiming |  * @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 |  * @FilePath     : \\tms-obc-web\\src\\app\\routes\\partner\\rebate-management\\components\\rebate-setting\\add\\add.component.html | ||||||
|  * Copyright (C) 2022 huzhenhong. All rights reserved. |  * Copyright (C) 2022 huzhenhong. All rights reserved. | ||||||
| --> | --> | ||||||
| @ -37,8 +37,11 @@ | |||||||
|     </sv> |     </sv> | ||||||
|  |  | ||||||
|     <sv col="1"> |     <sv col="1"> | ||||||
|       <div style="width: 850px"> |       <div style="width: 850px" *ngIf="configType == '1'"> | ||||||
|         <app-rebate-table #table [(data)]="tabelData"></app-rebate-table> |         <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> |       </div> | ||||||
|     </sv> |     </sv> | ||||||
|  |  | ||||||
|  | |||||||
| @ -4,7 +4,7 @@ | |||||||
|  * @Author       : Shiming |  * @Author       : Shiming | ||||||
|  * @Date         : 2022-03-21 09:26:45 |  * @Date         : 2022-03-21 09:26:45 | ||||||
|  * @LastEditors  : Shiming |  * @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 |  * @FilePath     : \\tms-obc-web\\src\\app\\routes\\partner\\rebate-management\\components\\rebate-setting\\add\\add.component.ts | ||||||
|  * Copyright (C) 2022 huzhenhong. All rights reserved. |  * Copyright (C) 2022 huzhenhong. All rights reserved. | ||||||
|  */ |  */ | ||||||
| @ -25,6 +25,7 @@ export class ParterRebateManageMentAddComponent implements OnInit { | |||||||
|   @ViewChild('table') table!: any; |   @ViewChild('table') table!: any; | ||||||
|   titleText :string=  '新增'; |   titleText :string=  '新增'; | ||||||
|   tabelData: any; |   tabelData: any; | ||||||
|  |   tabelType: any; | ||||||
|   formData: any; |   formData: any; | ||||||
|   addStatus: boolean = false; |   addStatus: boolean = false; | ||||||
|   hiden: boolean = false; |   hiden: boolean = false; | ||||||
| @ -88,7 +89,6 @@ export class ParterRebateManageMentAddComponent implements OnInit { | |||||||
|             text: '移除', |             text: '移除', | ||||||
|             click: _record => this.delete(_record), |             click: _record => this.delete(_record), | ||||||
|             iif: ()=> {   |             iif: ()=> {   | ||||||
|               console.log(this.hiden); |  | ||||||
|               return !this.hiden |               return !this.hiden | ||||||
|             }, |             }, | ||||||
|             acl: { ability: ['AbnormalAppear-reply'] } |             acl: { ability: ['AbnormalAppear-reply'] } | ||||||
| @ -98,7 +98,6 @@ export class ParterRebateManageMentAddComponent implements OnInit { | |||||||
|     ]; |     ]; | ||||||
|   } |   } | ||||||
|   ngOnInit() { |   ngOnInit() { | ||||||
|     console.log(this.ar.snapshot.queryParams.id); |  | ||||||
|     if(this.ar.snapshot?.queryParams?.id) { |     if(this.ar.snapshot?.queryParams?.id) { | ||||||
|       this.titleText= '查看' |       this.titleText= '查看' | ||||||
|       this.hiden= true |       this.hiden= true | ||||||
| @ -128,14 +127,11 @@ export class ParterRebateManageMentAddComponent implements OnInit { | |||||||
|       this.partnerId = []; |       this.partnerId = []; | ||||||
|       if (res) { |       if (res) { | ||||||
|         if (Array.isArray(res)) { |         if (Array.isArray(res)) { | ||||||
|           console.log(res); |  | ||||||
|           console.log(this.partnerPeopleList); |  | ||||||
|           this.partnerPeopleList = this.partnerPeopleList.concat(res); |           this.partnerPeopleList = this.partnerPeopleList.concat(res); | ||||||
|           res.forEach((ele: any) => { |           res.forEach((ele: any) => { | ||||||
|             this.partnerId.push(ele?.id); |             this.partnerId.push(ele?.id); | ||||||
|           }); |           }); | ||||||
|         } else { |         } else { | ||||||
|           console.log(res); |  | ||||||
|           this.partnerPeopleList = this.partnerPeopleList.concat(res); |           this.partnerPeopleList = this.partnerPeopleList.concat(res); | ||||||
|           this.partnerId.push(res?.id); |           this.partnerId.push(res?.id); | ||||||
|         } |         } | ||||||
| @ -148,9 +144,6 @@ export class ParterRebateManageMentAddComponent implements OnInit { | |||||||
|     }); |     }); | ||||||
|   } |   } | ||||||
|   save() { |   save() { | ||||||
|     console.log(this.partnerId); |  | ||||||
|     console.log(this.partnerId.join(',')); |  | ||||||
|      |  | ||||||
|     const params = { |     const params = { | ||||||
|       accountingRate: this.accountingRate, |       accountingRate: this.accountingRate, | ||||||
|       configName: this.configName, |       configName: this.configName, | ||||||
| @ -162,10 +155,8 @@ export class ParterRebateManageMentAddComponent implements OnInit { | |||||||
|       remarke: this.remarke, |       remarke: this.remarke, | ||||||
|       partnerType: this.partnerType |       partnerType: this.partnerType | ||||||
|     }; |     }; | ||||||
|     console.log(params); |  | ||||||
|     this.service.request(this.service.$api_save_rebateConfig, params).subscribe((res: any) => { |     this.service.request(this.service.$api_save_rebateConfig, params).subscribe((res: any) => { | ||||||
|       if (res) { |       if (res) { | ||||||
|         console.log(res); |  | ||||||
|         this.service.msgSrv.success('新增成功!'); |         this.service.msgSrv.success('新增成功!'); | ||||||
|         this.router.navigate(['/partner/rebate/setting']); |         this.router.navigate(['/partner/rebate/setting']); | ||||||
|       } |       } | ||||||
| @ -173,7 +164,6 @@ export class ParterRebateManageMentAddComponent implements OnInit { | |||||||
|   } |   } | ||||||
|   initData(id:string) { |   initData(id:string) { | ||||||
|     this.service.request(this.service.$api_get_getPartnerRebateConfigInfo, {id: id}).subscribe((res: any) => { |     this.service.request(this.service.$api_get_getPartnerRebateConfigInfo, {id: id}).subscribe((res: any) => { | ||||||
|       console.log(res); |  | ||||||
|       if(res) { |       if(res) { | ||||||
|         this.configName = res?.configName; |         this.configName = res?.configName; | ||||||
|         this.accountingRate = res?.accountingRate; |         this.accountingRate = res?.accountingRate; | ||||||
| @ -189,7 +179,6 @@ export class ParterRebateManageMentAddComponent implements OnInit { | |||||||
|     }) |     }) | ||||||
|   } |   } | ||||||
|   changePartner(value: any) { |   changePartner(value: any) { | ||||||
|     console.log(value); |  | ||||||
|     if (value == '3') { |     if (value == '3') { | ||||||
|       this.addStatus = true; |       this.addStatus = true; | ||||||
|     } else { |     } else { | ||||||
|  | |||||||
| @ -4,7 +4,7 @@ | |||||||
|  * @Author       : Shiming |  * @Author       : Shiming | ||||||
|  * @Date         : 2022-01-25 20:18:52 |  * @Date         : 2022-01-25 20:18:52 | ||||||
|  * @LastEditors  : Shiming |  * @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 |  * @FilePath     : \\tms-obc-web\\src\\app\\shared\\components\\rebate-table\\rebate-table.component.html | ||||||
|  * Copyright (C) 2022 huzhenhong. All rights reserved. |  * 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 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> |                 </tr> | ||||||
|             </thead> |             </thead> | ||||||
|             <tbody> |             <tbody> | ||||||
| @ -37,8 +37,11 @@ | |||||||
|                     </td> |                     </td> | ||||||
|                     <td nzWidth="220px" nzAlign="center" > |                     <td nzWidth="220px" nzAlign="center" > | ||||||
|                         <div > |                         <div > | ||||||
|                             <nz-select style="min-width: 150px;" [(ngModel)]="item.gradeConfigId" > |                             <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-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> |                             </nz-select> | ||||||
|                         </div> |                         </div> | ||||||
|                     </td> |                     </td> | ||||||
| @ -72,11 +75,11 @@ | |||||||
|                         </ng-template> |                         </ng-template> | ||||||
|                         </div> |                         </div> | ||||||
|                     </td> |                     </td> | ||||||
|                     <td nzWidth="60px" nzAlign="center" nzRight> |                     <td nzWidth="60px" nzAlign="center" nzRight *ngIf="type == '2'"> | ||||||
|                         <a  nz-popconfirm |                         <a  style=" font-size: 20px;" nz-popconfirm | ||||||
|                             nzPopconfirmTitle="是否新增?" (nzOnConfirm)="add()" |                             nzPopconfirmTitle="是否新增?" (nzOnConfirm)="add()" | ||||||
|                             >+</a> |                             >+</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 |                              nz-popconfirm | ||||||
|                             nzPopconfirmTitle="是否确认删除?" (nzOnConfirm)="deleteRow(i)" |                             nzPopconfirmTitle="是否确认删除?" (nzOnConfirm)="deleteRow(i)" | ||||||
|                             >-</a> |                             >-</a> | ||||||
|  | |||||||
| @ -11,6 +11,7 @@ import { EventEmitter} from '@angular/core' | |||||||
| }) | }) | ||||||
| export class RebateTableComponent implements OnInit { | export class RebateTableComponent implements OnInit { | ||||||
|   @Input() data: any =[]; |   @Input() data: any =[]; | ||||||
|  |   @Input() type: any; | ||||||
|   @Output() |   @Output() | ||||||
|   private dataChange: EventEmitter<any> = new EventEmitter(); |   private dataChange: EventEmitter<any> = new EventEmitter(); | ||||||
|   emit() { |   emit() { | ||||||
| @ -24,15 +25,13 @@ export class RebateTableComponent implements OnInit { | |||||||
|   constructor(public service: BaseService, private cdr: ChangeDetectorRef) {} |   constructor(public service: BaseService, private cdr: ChangeDetectorRef) {} | ||||||
|  |  | ||||||
|   ngOnInit(): void { |   ngOnInit(): void { | ||||||
|    this.data = [ |     if(this.type == '2') { | ||||||
|       { |      this.loadData(); | ||||||
|         gradeConfigId: '', |      | ||||||
|         startAmount: 0, |     } | ||||||
|         endAmount: 0, |     console.log(this.type); | ||||||
|         managementFeeRatio: 0, |     console.log(this.data); | ||||||
|       } |      | ||||||
|     ]; |  | ||||||
|     this.loadData(); |  | ||||||
|     this.changeendAmountAction(); |     this.changeendAmountAction(); | ||||||
|   } |   } | ||||||
|  |  | ||||||
| @ -40,7 +39,7 @@ export class RebateTableComponent implements OnInit { | |||||||
|     this.service.request('/api/mdc/partnerGradeConfig/listPartnerGradeConfig').subscribe(res => { |     this.service.request('/api/mdc/partnerGradeConfig/listPartnerGradeConfig').subscribe(res => { | ||||||
|       if (res) { |       if (res) { | ||||||
|         console.log(res); |         console.log(res); | ||||||
|         this.grage = res; |           this.grage = res; | ||||||
|         this.cdr.detectChanges(); |         this.cdr.detectChanges(); | ||||||
|       } |       } | ||||||
|     }); |     }); | ||||||
| @ -70,6 +69,8 @@ export class RebateTableComponent implements OnInit { | |||||||
|   changeendAmountAction() { |   changeendAmountAction() { | ||||||
|     this.changeSub.pipe(debounceTime(500)).subscribe((res: string) => { |     this.changeSub.pipe(debounceTime(500)).subscribe((res: string) => { | ||||||
|       if (res) { |       if (res) { | ||||||
|  |         console.log(res); | ||||||
|  |          | ||||||
|         const paras = res.split(','); |         const paras = res.split(','); | ||||||
|         const num = Number(paras[0]); |         const num = Number(paras[0]); | ||||||
|         const i = Number(paras[1]); |         const i = Number(paras[1]); | ||||||
| @ -113,22 +114,6 @@ export class RebateTableComponent implements OnInit { | |||||||
|     this.data = [...newArr]; |     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  车长 |    * @param event  车长 | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user