edit
This commit is contained in:
@ -1,9 +1,7 @@
|
||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { STColumn, STComponent, STData, STRequestOptions } from '@delon/abc/st';
|
||||
import { STColumn, STComponent } from '@delon/abc/st';
|
||||
import { SFComponent, SFDateWidgetSchema, SFSchema, SFUISchema } from '@delon/form';
|
||||
import { processSingleSort, ShipperBaseService } from '@shared';
|
||||
import { NzModalService } from 'ng-zorro-antd/modal';
|
||||
import { ShipperBaseService } from '@shared';
|
||||
import { RebateManagementService } from '../../services/rebate-management.service';
|
||||
|
||||
@Component({
|
||||
@ -27,10 +25,7 @@ export class ParterRebateManageMentParticularsComponent implements OnInit {
|
||||
resourceStatus: any;
|
||||
data = this.service.$api_get_searchPageList;
|
||||
constructor(
|
||||
public router: Router,
|
||||
public ar: ActivatedRoute,
|
||||
public service: RebateManagementService,
|
||||
private modalService: NzModalService,
|
||||
public shipperservice: ShipperBaseService
|
||||
) {}
|
||||
/**
|
||||
|
||||
@ -1,6 +1,4 @@
|
||||
import { ModalHelper } from '@delon/theme';
|
||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { STColumn, STComponent, STData, STRequestOptions } from '@delon/abc/st';
|
||||
import { SFComponent, SFDateWidgetSchema, SFSchema, SFUISchema } from '@delon/form';
|
||||
import { processSingleSort, ShipperBaseService } from '@shared';
|
||||
@ -25,8 +23,6 @@ export class ParterRebateManageMentRecordComponent implements OnInit {
|
||||
_$expand = false;
|
||||
data = [{ name1: 1111 }];
|
||||
constructor(
|
||||
public router: Router,
|
||||
public ar: ActivatedRoute,
|
||||
public service: RebateManagementService,
|
||||
private modal: NzModalService,
|
||||
public shipperservice: ShipperBaseService,
|
||||
|
||||
@ -1,12 +1,10 @@
|
||||
import { ModalHelper } from '@delon/theme';
|
||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { STColumn, STComponent, STData, STRequestOptions } from '@delon/abc/st';
|
||||
import { SFComponent, SFDateWidgetSchema, SFSchema, SFUISchema } from '@delon/form';
|
||||
import { processSingleSort, ShipperBaseService } from '@shared';
|
||||
import { Router } from '@angular/router';
|
||||
import { STColumn, STComponent } from '@delon/abc/st';
|
||||
import { SFComponent, SFSchema, SFUISchema } from '@delon/form';
|
||||
import { ShipperBaseService } from '@shared';
|
||||
import { NzModalService } from 'ng-zorro-antd/modal';
|
||||
import { RebateManagementService } from '../../services/rebate-management.service';
|
||||
import { ParterRebateManageMenRecordDetailComponent } from '../../model/record-detail/record-detail.component';
|
||||
import { ParterRebateManageMenAbnormalFeedbackComponent } from '../../model/abnormal-feedback/abnormal-feedback.component';
|
||||
|
||||
@Component({
|
||||
@ -25,19 +23,18 @@ export class ParterRebateManageMentSettingComponent implements OnInit {
|
||||
_$expand = false;
|
||||
constructor(
|
||||
public router: Router,
|
||||
public ar: ActivatedRoute,
|
||||
public service: RebateManagementService,
|
||||
private modal: NzModalService,
|
||||
public shipperservice: ShipperBaseService,
|
||||
public shipperservice: ShipperBaseService
|
||||
) {}
|
||||
/**
|
||||
* 查询参数
|
||||
*/
|
||||
get reqParams() {
|
||||
* 查询参数
|
||||
*/
|
||||
get reqParams() {
|
||||
const params: any = Object.assign({}, this.sf?.value || {});
|
||||
return {
|
||||
...params,
|
||||
};
|
||||
return {
|
||||
...params
|
||||
};
|
||||
}
|
||||
ngOnInit() {
|
||||
this.initSF();
|
||||
@ -49,21 +46,20 @@ export class ParterRebateManageMentSettingComponent implements OnInit {
|
||||
properties: {
|
||||
configName: {
|
||||
type: 'string',
|
||||
title: '模板名称',
|
||||
title: '模板名称'
|
||||
},
|
||||
stateLocked: {
|
||||
type: 'string',
|
||||
title: '状态',
|
||||
enum: [
|
||||
{label: '全部', value: ''},
|
||||
{label: '生效中', value: 1},
|
||||
{label: '失效', value: 0},
|
||||
{ label: '全部', value: '' },
|
||||
{ label: '生效中', value: 1 },
|
||||
{ label: '失效', value: 0 }
|
||||
],
|
||||
ui: {
|
||||
widget: 'select',
|
||||
},
|
||||
|
||||
},
|
||||
widget: 'select'
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
this.ui = {
|
||||
@ -79,43 +75,42 @@ export class ParterRebateManageMentSettingComponent implements OnInit {
|
||||
{
|
||||
title: '模板名称',
|
||||
index: 'configName',
|
||||
width: '200px',
|
||||
width: '200px'
|
||||
},
|
||||
{
|
||||
title: '等级类型',
|
||||
render: 'configType',
|
||||
width: '200px',
|
||||
|
||||
width: '200px'
|
||||
},
|
||||
{
|
||||
title: '备注',
|
||||
index: 'remark',
|
||||
width: '250px',
|
||||
width: '250px'
|
||||
},
|
||||
{
|
||||
title: '合伙人范围',
|
||||
render: 'partnerType',
|
||||
width: '200px',
|
||||
width: '200px'
|
||||
},
|
||||
{
|
||||
title: '创建时间',
|
||||
index: 'enableTime',
|
||||
width: '200px',
|
||||
width: '200px'
|
||||
},
|
||||
{
|
||||
title: '生效时间',
|
||||
index: 'enableTime',
|
||||
width: '200px',
|
||||
width: '200px'
|
||||
},
|
||||
{
|
||||
title: '优先级',
|
||||
index: 'priority',
|
||||
width: '100px',
|
||||
width: '100px'
|
||||
},
|
||||
{
|
||||
title: '状态',
|
||||
render: 'stateLocked',
|
||||
width: '100px',
|
||||
width: '100px'
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
@ -126,20 +121,24 @@ export class ParterRebateManageMentSettingComponent implements OnInit {
|
||||
{
|
||||
text: '查看',
|
||||
acl: { ability: ['REBATE-SETTING-detail'] },
|
||||
click: _record => this.configAction(_record),
|
||||
click: _record => this.configAction(_record)
|
||||
},
|
||||
{
|
||||
text: '禁用',
|
||||
acl: { ability: ['REBATE-SETTING-forbidden'] },
|
||||
iif: (_record) =>{ return _record.stateLocked == true && (_record.partnerType == 3 || _record.partnerType == 2)},
|
||||
click: _record => this.viewEvaluate(_record),
|
||||
iif: _record => {
|
||||
return _record.stateLocked == true && (_record.partnerType == 3 || _record.partnerType == 2);
|
||||
},
|
||||
click: _record => this.viewEvaluate(_record)
|
||||
},
|
||||
{
|
||||
text: '启用',
|
||||
acl: { ability: ['REBATE-SETTING-startUseing'] },
|
||||
iif: (_record) =>{ return _record.stateLocked == false},
|
||||
click: _record => this.viewEvaluate(_record),
|
||||
},
|
||||
iif: _record => {
|
||||
return _record.stateLocked == false;
|
||||
},
|
||||
click: _record => this.viewEvaluate(_record)
|
||||
}
|
||||
]
|
||||
}
|
||||
];
|
||||
@ -147,52 +146,52 @@ export class ParterRebateManageMentSettingComponent implements OnInit {
|
||||
/**
|
||||
*禁用
|
||||
*/
|
||||
viewEvaluate(item: any) {
|
||||
console.log(item.stateLocked);
|
||||
let title = ''
|
||||
let stateLocked: boolean;
|
||||
if(item.stateLocked) {
|
||||
title = '是否禁用该配置?'
|
||||
stateLocked = false
|
||||
} else {
|
||||
title = '是否启用该配置?'
|
||||
stateLocked = true
|
||||
}
|
||||
viewEvaluate(item: any) {
|
||||
console.log(item.stateLocked);
|
||||
let title = '';
|
||||
let stateLocked: boolean;
|
||||
if (item.stateLocked) {
|
||||
title = '是否禁用该配置?';
|
||||
stateLocked = false;
|
||||
} else {
|
||||
title = '是否启用该配置?';
|
||||
stateLocked = true;
|
||||
}
|
||||
this.modal.confirm({
|
||||
nzTitle: title,
|
||||
nzOnOk: () => {
|
||||
const params = {
|
||||
id: item?.id,
|
||||
stateLocked: stateLocked,
|
||||
}
|
||||
this.service.request(this.service.$api_set_updateRebateConfig,params).subscribe((res: any) => {
|
||||
if(res) {
|
||||
this.service.msgSrv.success('设置成功!')
|
||||
this.st.reload();
|
||||
}
|
||||
})
|
||||
stateLocked: stateLocked
|
||||
};
|
||||
this.service.request(this.service.$api_set_updateRebateConfig, params).subscribe((res: any) => {
|
||||
if (res) {
|
||||
this.service.msgSrv.success('设置成功!');
|
||||
this.st.reload();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
/**
|
||||
*查看
|
||||
*/
|
||||
feedback(item?: any) {
|
||||
const modal = this.modal.create({
|
||||
nzTitle: '查看',
|
||||
nzWidth: 580,
|
||||
nzContent: ParterRebateManageMenAbnormalFeedbackComponent,
|
||||
nzComponentParams: { i: item },
|
||||
nzFooter: null
|
||||
});
|
||||
modal.afterClose.subscribe((res: any) => {
|
||||
if (res) {
|
||||
}
|
||||
});
|
||||
feedback(item?: any) {
|
||||
const modal = this.modal.create({
|
||||
nzTitle: '查看',
|
||||
nzWidth: 580,
|
||||
nzContent: ParterRebateManageMenAbnormalFeedbackComponent,
|
||||
nzComponentParams: { i: item },
|
||||
nzFooter: null
|
||||
});
|
||||
modal.afterClose.subscribe((res: any) => {
|
||||
if (res) {
|
||||
}
|
||||
});
|
||||
}
|
||||
configAction(value?: any) {
|
||||
this.router.navigate(['/partner/rebate/setting/add/', '0'], {queryParams: value})
|
||||
}
|
||||
this.router.navigate(['/partner/rebate/setting/add/', '0'], { queryParams: value });
|
||||
}
|
||||
/**
|
||||
* 重置表单
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user