This commit is contained in:
heqinghang
2022-03-28 17:59:42 +08:00
parent 2023fd2b75
commit f2c9ad8982
4 changed files with 25 additions and 22 deletions

View File

@ -1,4 +1,4 @@
<sf #sf [ui]="ui" [schema]="schema" [button]="'none'" [formData]="i"> <sf #sf [ui]="ui" [schema]="schema" [button]="'none'" [formData]="record">
</sf> </sf>
<div *nzModalFooter> <div *nzModalFooter>

View File

@ -17,7 +17,8 @@ export class ParterChannelSalesEditComponent implements OnInit {
ui!: SFUISchema; ui!: SFUISchema;
i: any; i: any;
type: any; type: any;
record:any;
currentOAItem:any;
constructor( constructor(
public http: _HttpClient, public http: _HttpClient,
private cdr: ChangeDetectorRef, private cdr: ChangeDetectorRef,
@ -28,7 +29,14 @@ export class ParterChannelSalesEditComponent implements OnInit {
) {} ) {}
ngOnInit(): void { ngOnInit(): void {
this.service.request(this.service.$api_getChannelSalesInfo, {id:this.i?.id}).subscribe(res => {
if(res){
this.record = res;
}
this.initSF(); this.initSF();
});
} }
initSF() { initSF() {
this.schema = { this.schema = {
@ -62,10 +70,14 @@ export class ParterChannelSalesEditComponent implements OnInit {
placeholder:'请选择', placeholder:'请选择',
asyncData: (input:string) => this.service.request(this.service.$api_fuzzyQuery,{name:input}).pipe( asyncData: (input:string) => this.service.request(this.service.$api_fuzzyQuery,{name:input}).pipe(
map((res: any) => { map((res: any) => {
console.log('111',res) return res.map((item:any)=>{
return []; return {label: item.empName+"/"+item.empNo, value: item.empNo, obj: item}
}) })
) })
),
change:(item:any, org:any)=>{
this.currentOAItem = org.obj;
}
} as SFAutoCompleteWidgetSchema, } as SFAutoCompleteWidgetSchema,
}, },
isAuthorization: { isAuthorization: {
@ -89,7 +101,6 @@ export class ParterChannelSalesEditComponent implements OnInit {
mode: 'multiple', mode: 'multiple',
maxMultipleCount: 5, maxMultipleCount: 5,
asyncData: () => { asyncData: () => {
return this.service.request(this.service.$api_getAppRoleList).pipe( return this.service.request(this.service.$api_getAppRoleList).pipe(
map((res: any) => { map((res: any) => {
return res return res
@ -134,7 +145,7 @@ export class ParterChannelSalesEditComponent implements OnInit {
save() { save() {
this.sf.validator({ emitError: true }); this.sf.validator({ emitError: true });
if(!this.sf.valid) return; if(!this.sf.valid) return;
this.service.request(this.service.$api_save, { ...this.sf.value }).subscribe(res => { this.service.request(this.service.$api_save, { ...this.sf.value, employeeVO: this.currentOAItem}).subscribe(res => {
if (res) { if (res) {
this.modalRef.destroy(true); this.modalRef.destroy(true);
} else { } else {

View File

@ -98,10 +98,6 @@ export class ParterChannelSalesListComponent implements OnInit {
text: '编辑', text: '编辑',
click: (_record, _modal, _instance) => this.edit(_record), click: (_record, _modal, _instance) => this.edit(_record),
}, },
{
text: '查看',
click: (_record, _modal, _instance) => this.view(_record),
},
{ {
text: '冻结', text: '冻结',
click: (_record, _modal, _instance) => this.stop(_record.id), click: (_record, _modal, _instance) => this.stop(_record.id),
@ -116,7 +112,6 @@ export class ParterChannelSalesListComponent implements OnInit {
nzWidth:600, nzWidth:600,
nzTitle: '新增', nzTitle: '新增',
nzContent: ParterChannelSalesEditComponent, nzContent: ParterChannelSalesEditComponent,
nzComponentParams: { type: this.spuStatus }
}); });
modalRef.afterClose.subscribe(res => { modalRef.afterClose.subscribe(res => {
if (res) { if (res) {
@ -131,7 +126,7 @@ export class ParterChannelSalesListComponent implements OnInit {
nzWidth:600, nzWidth:600,
nzTitle: '编辑', nzTitle: '编辑',
nzContent: ParterChannelSalesEditComponent, nzContent: ParterChannelSalesEditComponent,
nzComponentParams: { i: record, type: this.spuStatus } nzComponentParams: { i: record }
}); });
modalRef.afterClose.subscribe(res => { modalRef.afterClose.subscribe(res => {
if (res) { if (res) {
@ -140,14 +135,7 @@ export class ParterChannelSalesListComponent implements OnInit {
}); });
} }
// 编辑
view(record: STData) {
const modalRef = this.modalService.create({
nzTitle: '查看',
nzContent: ParterChannelSalesEditComponent,
nzComponentParams: { i: record }
});
}
stop(id: any) { stop(id: any) {
this.modalService.confirm({ this.modalService.confirm({

View File

@ -15,6 +15,10 @@ export class ChannelSalesService extends BaseService {
$api_fuzzyQuery = '/api/mdc/channelSalesManagement/fuzzyQuery'; $api_fuzzyQuery = '/api/mdc/channelSalesManagement/fuzzyQuery';
// 获取角色列表 // 获取角色列表
$api_getAppRoleList = '/api/mdc/cuc/roleInfo/getRoleList'; $api_getAppRoleList = '/api/mdc/cuc/roleInfo/getRoleList';
// 获取渠道销售管理详情
$api_listChannelSalesManagement = '/api/mdc/channelSalesManagement/list/listChannelSalesManagement';
// 根据渠道销售id获取渠道信息
$api_getChannelSalesInfo = '/api/mdc/channelSalesManagement/getChannelSalesInfo';
constructor(public injector: Injector) { constructor(public injector: Injector) {