666
This commit is contained in:
@ -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>
|
||||
|
||||
<div *nzModalFooter>
|
||||
|
||||
@ -17,7 +17,8 @@ export class ParterChannelSalesEditComponent implements OnInit {
|
||||
ui!: SFUISchema;
|
||||
i: any;
|
||||
type: any;
|
||||
|
||||
record:any;
|
||||
currentOAItem:any;
|
||||
constructor(
|
||||
public http: _HttpClient,
|
||||
private cdr: ChangeDetectorRef,
|
||||
@ -28,7 +29,14 @@ export class ParterChannelSalesEditComponent implements OnInit {
|
||||
) {}
|
||||
|
||||
ngOnInit(): void {
|
||||
this.initSF();
|
||||
|
||||
this.service.request(this.service.$api_getChannelSalesInfo, {id:this.i?.id}).subscribe(res => {
|
||||
if(res){
|
||||
this.record = res;
|
||||
}
|
||||
this.initSF();
|
||||
});
|
||||
|
||||
}
|
||||
initSF() {
|
||||
this.schema = {
|
||||
@ -62,10 +70,14 @@ export class ParterChannelSalesEditComponent implements OnInit {
|
||||
placeholder:'请选择',
|
||||
asyncData: (input:string) => this.service.request(this.service.$api_fuzzyQuery,{name:input}).pipe(
|
||||
map((res: any) => {
|
||||
console.log('111',res)
|
||||
return [];
|
||||
return res.map((item:any)=>{
|
||||
return {label: item.empName+"/"+item.empNo, value: item.empNo, obj: item}
|
||||
})
|
||||
})
|
||||
)
|
||||
),
|
||||
change:(item:any, org:any)=>{
|
||||
this.currentOAItem = org.obj;
|
||||
}
|
||||
} as SFAutoCompleteWidgetSchema,
|
||||
},
|
||||
isAuthorization: {
|
||||
@ -89,7 +101,6 @@ export class ParterChannelSalesEditComponent implements OnInit {
|
||||
mode: 'multiple',
|
||||
maxMultipleCount: 5,
|
||||
asyncData: () => {
|
||||
|
||||
return this.service.request(this.service.$api_getAppRoleList).pipe(
|
||||
map((res: any) => {
|
||||
return res
|
||||
@ -134,7 +145,7 @@ export class ParterChannelSalesEditComponent implements OnInit {
|
||||
save() {
|
||||
this.sf.validator({ emitError: true });
|
||||
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) {
|
||||
this.modalRef.destroy(true);
|
||||
} else {
|
||||
|
||||
@ -98,10 +98,6 @@ export class ParterChannelSalesListComponent implements OnInit {
|
||||
text: '编辑',
|
||||
click: (_record, _modal, _instance) => this.edit(_record),
|
||||
},
|
||||
{
|
||||
text: '查看',
|
||||
click: (_record, _modal, _instance) => this.view(_record),
|
||||
},
|
||||
{
|
||||
text: '冻结',
|
||||
click: (_record, _modal, _instance) => this.stop(_record.id),
|
||||
@ -116,7 +112,6 @@ export class ParterChannelSalesListComponent implements OnInit {
|
||||
nzWidth:600,
|
||||
nzTitle: '新增',
|
||||
nzContent: ParterChannelSalesEditComponent,
|
||||
nzComponentParams: { type: this.spuStatus }
|
||||
});
|
||||
modalRef.afterClose.subscribe(res => {
|
||||
if (res) {
|
||||
@ -131,7 +126,7 @@ export class ParterChannelSalesListComponent implements OnInit {
|
||||
nzWidth:600,
|
||||
nzTitle: '编辑',
|
||||
nzContent: ParterChannelSalesEditComponent,
|
||||
nzComponentParams: { i: record, type: this.spuStatus }
|
||||
nzComponentParams: { i: record }
|
||||
});
|
||||
modalRef.afterClose.subscribe(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) {
|
||||
this.modalService.confirm({
|
||||
|
||||
@ -15,6 +15,10 @@ export class ChannelSalesService extends BaseService {
|
||||
$api_fuzzyQuery = '/api/mdc/channelSalesManagement/fuzzyQuery';
|
||||
// 获取角色列表
|
||||
$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) {
|
||||
|
||||
Reference in New Issue
Block a user