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 => {
if (res) {
this.chartData = res
this.pillar.reRender()
this.curve.reRender()
if(flag) { // 除第一次加载外
this.pillar.reRender()
this.curve.reRender()

View File

@ -54,12 +54,24 @@ export class ParterRebateManageMentAddPartnerListComponent implements OnInit {
buttons: [
{
text: '添加',
iifBehavior: 'disabled',
iif: (item:any) => {
return this.filterArr(item)
},
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() {
// signStatus固定传20 代表签约完成 signStatus: 20
let params: any = { ...this.sf?.value, };
@ -78,6 +90,8 @@ export class ParterRebateManageMentAddPartnerListComponent implements OnInit {
) {}
ngOnInit(): void {
console.log(this.i);
this.initSF();
}
initSF() {

View File

@ -4,7 +4,7 @@
* @Author : Shiming
* @Date : 2022-02-24 20:09:49
* @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
* Copyright (C) 2022 huzhenhong. All rights reserved.
-->
@ -58,7 +58,7 @@
<nz-option nzValue="2" nzLabel="新注册合伙人"></nz-option>
<nz-option nzValue="3" nzLabel="自定义合伙人"></nz-option>
</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
*ngIf="partnerPeopleList?.length > 0"
#st

View File

@ -4,7 +4,7 @@
* @Author : Shiming
* @Date : 2022-03-21 09:26:45
* @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
* Copyright (C) 2022 huzhenhong. All rights reserved.
*/
@ -127,59 +127,70 @@ export class ParterRebateManageMentAddComponent implements OnInit {
if (res) {
if (Array.isArray(res)) {
this.partnerPeopleList = this.partnerPeopleList.concat(res);
this.partnerPeopleList = [...this.setArr(this.partnerPeopleList, 'id')];
res.forEach((ele: any) => {
this.partnerId.push(ele?.id);
});
} else {
this.partnerPeopleList = this.partnerPeopleList.concat(res);
this.partnerPeopleList = [...this.setArr(this.partnerPeopleList, '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) {
this.partnerPeopleList = this.partnerPeopleList.filter((d: any, i: any) => {
return item.id != d.id;
});
}
save() {
if(!this.configName) {
if (!this.configName) {
this.service.msgSrv.warning('请输入配置名称!');
return
return;
}
if(!this.accountingRate) {
if (!this.accountingRate) {
this.service.msgSrv.warning('请输入固定结算费率!');
return
return;
}
if(!this.partnerType) {
if (!this.partnerType) {
this.service.msgSrv.warning('请选择合伙人范围!');
return
return;
}
if(!this.priority) {
if (!this.priority) {
this.service.msgSrv.warning('请选择优先级!');
return
return;
}
if(!this.sf?.value.ruleDescription) {
if (!this.sf?.value.ruleDescription) {
this.service.msgSrv.warning('请输入规则说明!');
return
return;
}
if(!this.remark) {
if (!this.remark) {
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('请选择合伙人!');
return
return;
}
let real = false;
if(this.configType == '2') {
this.table.data.forEach((element: any) => {
if (element.startAmount > element.endAmount) {
real = true;
return;
}
});
}
if (this.configType == '2') {
this.table.data.forEach((element: any) => {
if (element.startAmount > element.endAmount) {
real = true;
return;
}
});
}
if (real) {
this.service.msgSrv.warning('初始业务量不能超过到达业务量!');
return;
@ -197,7 +208,7 @@ export class ParterRebateManageMentAddComponent implements OnInit {
partnerType: this.partnerType
};
console.log(params);
this.service.request(this.service.$api_save_rebateConfig, params).subscribe((res: any) => {
if (res) {
this.service.msgSrv.success('新增成功!');