This commit is contained in:
wangshiming
2022-05-07 16:11:41 +08:00
parent 77d5992ef5
commit 11546c1ff1
4 changed files with 54 additions and 27 deletions

View File

@ -86,6 +86,8 @@ export class DatatableOperationtableComponent implements OnInit {
this.service.request(this.service.$api_operationalReportHistogram, params).subscribe(res => { this.service.request(this.service.$api_operationalReportHistogram, params).subscribe(res => {
if (res) { if (res) {
this.chartData = res this.chartData = res
this.pillar.reRender()
this.curve.reRender()
if(flag) { // 除第一次加载外 if(flag) { // 除第一次加载外
this.pillar.reRender() this.pillar.reRender()
this.curve.reRender() this.curve.reRender()

View File

@ -54,12 +54,24 @@ export class ParterRebateManageMentAddPartnerListComponent implements OnInit {
buttons: [ buttons: [
{ {
text: '添加', text: '添加',
iifBehavior: 'disabled',
iif: (item:any) => {
return this.filterArr(item)
},
click: _record => this.add(_record), click: _record => this.add(_record),
} }
] ]
} }
]; ];
filterArr (item: { id: any; }) {
let real = true
this.i.forEach((element:any) => {
if(element.id == item.id) {
real = false
}
});
return real
}
get reqParams() { get reqParams() {
// signStatus固定传20 代表签约完成 signStatus: 20 // signStatus固定传20 代表签约完成 signStatus: 20
let params: any = { ...this.sf?.value, }; let params: any = { ...this.sf?.value, };
@ -78,6 +90,8 @@ export class ParterRebateManageMentAddPartnerListComponent implements OnInit {
) {} ) {}
ngOnInit(): void { ngOnInit(): void {
console.log(this.i);
this.initSF(); this.initSF();
} }
initSF() { initSF() {

View File

@ -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-05-05 17:04:31 * @LastEditTime : 2022-05-07 15:42:10
* @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.
--> -->
@ -58,7 +58,7 @@
<nz-option nzValue="2" nzLabel="新注册合伙人"></nz-option> <nz-option nzValue="2" nzLabel="新注册合伙人"></nz-option>
<nz-option nzValue="3" nzLabel="自定义合伙人"></nz-option> <nz-option nzValue="3" nzLabel="自定义合伙人"></nz-option>
</nz-select> </nz-select>
<span *ngIf="addStatus" style="padding-left: 15px; color: #0000ff" (click)="add()">添加</span> <span *ngIf="addStatus" style="padding-left: 15px; color: #0000ff" (click)="add(this.partnerPeopleList)">添加</span>
<st <st
*ngIf="partnerPeopleList?.length > 0" *ngIf="partnerPeopleList?.length > 0"
#st #st

View File

@ -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-05-05 14:04:53 * @LastEditTime : 2022-05-07 15:38:49
* @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.
*/ */
@ -127,16 +127,27 @@ export class ParterRebateManageMentAddComponent implements OnInit {
if (res) { if (res) {
if (Array.isArray(res)) { if (Array.isArray(res)) {
this.partnerPeopleList = this.partnerPeopleList.concat(res); this.partnerPeopleList = this.partnerPeopleList.concat(res);
this.partnerPeopleList = [...this.setArr(this.partnerPeopleList, 'id')];
res.forEach((ele: any) => { res.forEach((ele: any) => {
this.partnerId.push(ele?.id); this.partnerId.push(ele?.id);
}); });
} else { } else {
this.partnerPeopleList = this.partnerPeopleList.concat(res); this.partnerPeopleList = this.partnerPeopleList.concat(res);
this.partnerPeopleList = [...this.setArr(this.partnerPeopleList, 'id')];
this.partnerId.push(res?.id); this.partnerId.push(res?.id);
} }
} }
}); });
} }
// 数组去重
setArr(arr: any[], id: string) {
let obj: any = {};
const arrays = arr.reduce((setArr, item) => {
obj[item[id]] ? '' : (obj[item[id]] = true && setArr.push(item));
return setArr;
}, []);
return arrays;
}
delete(item: any) { delete(item: any) {
this.partnerPeopleList = this.partnerPeopleList.filter((d: any, i: any) => { this.partnerPeopleList = this.partnerPeopleList.filter((d: any, i: any) => {
return item.id != d.id; return item.id != d.id;
@ -145,31 +156,31 @@ export class ParterRebateManageMentAddComponent implements OnInit {
save() { save() {
if (!this.configName) { if (!this.configName) {
this.service.msgSrv.warning('请输入配置名称!'); this.service.msgSrv.warning('请输入配置名称!');
return return;
} }
if (!this.accountingRate) { if (!this.accountingRate) {
this.service.msgSrv.warning('请输入固定结算费率!'); this.service.msgSrv.warning('请输入固定结算费率!');
return return;
} }
if (!this.partnerType) { if (!this.partnerType) {
this.service.msgSrv.warning('请选择合伙人范围!'); this.service.msgSrv.warning('请选择合伙人范围!');
return return;
} }
if (!this.priority) { if (!this.priority) {
this.service.msgSrv.warning('请选择优先级!'); this.service.msgSrv.warning('请选择优先级!');
return return;
} }
if (!this.sf?.value.ruleDescription) { if (!this.sf?.value.ruleDescription) {
this.service.msgSrv.warning('请输入规则说明!'); this.service.msgSrv.warning('请输入规则说明!');
return return;
} }
if (!this.remark) { if (!this.remark) {
this.service.msgSrv.warning('请输入备注!'); this.service.msgSrv.warning('请输入备注!');
return return;
} }
if (this.partnerType == '3' && this.partnerPeopleList?.length == 0) { if (this.partnerType == '3' && this.partnerPeopleList?.length == 0) {
this.service.msgSrv.warning('请选择合伙人!'); this.service.msgSrv.warning('请选择合伙人!');
return return;
} }
let real = false; let real = false;
if (this.configType == '2') { if (this.configType == '2') {