Merge branch 'develop' of https://gitlab.eascs.com/tms-ui/tms-obc-web into develop
This commit is contained in:
@ -1,14 +1,5 @@
|
|||||||
|
<sf #sf [schema]="schema" [ui]="ui" [compact]="true" [button]="'none'"></sf>
|
||||||
<!-- <nz-spin *ngIf="!i" class="modal-spin"></nz-spin> -->
|
|
||||||
<div class="serviceBox">
|
|
||||||
<div class="left"><span style="color:red">* </span>客服人员</div>
|
|
||||||
<div class="right">
|
|
||||||
<nz-select [(ngModel)]="appUserId" style="width: 250px;">
|
|
||||||
<nz-option *ngFor="let item of serviceList" [nzValue]="item.appUserId" [nzLabel]="item.name"></nz-option>
|
|
||||||
</nz-select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button nz-button type="button" (click)="close()">关闭</button>
|
<button nz-button type="button" (click)="close()">关闭</button>
|
||||||
<button nz-button type="button" nzType="primary" (click)="submitForm()" [disabled]="!appUserId">确定</button>
|
<button nz-button type="button" nzType="primary" (click)="submitForm()" [disabled]="!sf?.valid">确定</button>
|
||||||
</div>
|
</div>
|
||||||
@ -1,12 +1,13 @@
|
|||||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||||
import { apiConf } from '@conf/api.conf';
|
import { apiConf } from '@conf/api.conf';
|
||||||
import { cacheConf } from '@conf/cache.conf';
|
import { cacheConf } from '@conf/cache.conf';
|
||||||
import { SFUISchema, SFSchema, SFUploadWidgetSchema, SFComponent, SFSelectWidgetSchema } from '@delon/form';
|
import { SFUISchema, SFSchema, SFUploadWidgetSchema, SFComponent, SFSelectWidgetSchema, SFSchemaEnum } from '@delon/form';
|
||||||
import { _HttpClient } from '@delon/theme';
|
import { _HttpClient } from '@delon/theme';
|
||||||
import { EACacheService, EAEnvironmentService } from '@shared';
|
import { EACacheService, EAEnvironmentService } from '@shared';
|
||||||
import { NzModalRef } from 'ng-zorro-antd/modal';
|
import { NzModalRef } from 'ng-zorro-antd/modal';
|
||||||
import { NzUploadFile } from 'ng-zorro-antd/upload';
|
import { NzUploadFile } from 'ng-zorro-antd/upload';
|
||||||
import { Observable, Observer, of } from 'rxjs';
|
import { Observable, Observer, of } from 'rxjs';
|
||||||
|
import { map } from 'rxjs/operators';
|
||||||
import { UsermanageService } from 'src/app/routes/usercenter/services/usercenter.service';
|
import { UsermanageService } from 'src/app/routes/usercenter/services/usercenter.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@ -19,7 +20,8 @@ export class ShowServiceComponent implements OnInit {
|
|||||||
appUserId = ''
|
appUserId = ''
|
||||||
record: any = {};
|
record: any = {};
|
||||||
i: any;
|
i: any;
|
||||||
serviceList: any = [];
|
ui!: SFUISchema;
|
||||||
|
schema!: SFSchema;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private modal: NzModalRef,
|
private modal: NzModalRef,
|
||||||
@ -27,27 +29,64 @@ export class ShowServiceComponent implements OnInit {
|
|||||||
) { }
|
) { }
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
this.initData()
|
this.initSF()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
initSF() {
|
||||||
close(): void {
|
this.schema = {
|
||||||
this.modal.close(true)
|
properties: {
|
||||||
}
|
_$expand: { type: 'boolean', ui: { hidden: true } },
|
||||||
initData(){
|
customerServiceId: {
|
||||||
this.service.request(this.service.$api_getStaffList).subscribe(res => {
|
title: '客服人员',
|
||||||
this.serviceList = res
|
type: 'string',
|
||||||
})
|
ui: {
|
||||||
}
|
widget: 'select',
|
||||||
submitForm(){
|
asyncData: () => {
|
||||||
const params:any = {
|
const params = {
|
||||||
appUserId: this.appUserId,
|
// enterpriseId: 1,
|
||||||
};
|
// enterpriseProjectId: this.i.mainProjectId,
|
||||||
this.service.request(this.service.$api_getStaffList, params).subscribe(res => {
|
}
|
||||||
if(res){
|
return this.service.request(this.service.$api_getStaffList, params).pipe(
|
||||||
this.service.msgSrv.success('分配成功')
|
map((res: any) => {
|
||||||
this.modal.close(true)
|
return res.map((i: any) => {
|
||||||
}
|
return { label: i.name, value: i.appUserId };
|
||||||
})
|
});
|
||||||
}
|
}),
|
||||||
|
);
|
||||||
|
// serverSearch: true,
|
||||||
|
// searchDebounceTime: 300,
|
||||||
|
// searchLoadingText: '搜索中...',
|
||||||
|
// onSearch: (q: any) => {
|
||||||
|
// if (!!q) {
|
||||||
|
// return this.service
|
||||||
|
// .request(this.service.$api_getStaffList, {
|
||||||
|
// nameOrPhone: q
|
||||||
|
// })
|
||||||
|
// .pipe(map((res: any) => (res?.records as any[]).map(i => ({ name: i.name, value: i.appUserId } as SFSchemaEnum))))
|
||||||
|
// .toPromise();
|
||||||
|
// } else {
|
||||||
|
// return of([]);
|
||||||
|
// }
|
||||||
|
},
|
||||||
|
} as SFSelectWidgetSchema
|
||||||
|
}
|
||||||
|
},
|
||||||
|
required: ['customerServiceId']
|
||||||
|
};
|
||||||
|
}
|
||||||
|
close(): void {
|
||||||
|
this.modal.close(true)
|
||||||
|
}
|
||||||
|
submitForm() {
|
||||||
|
const params: any = {
|
||||||
|
...this.sf.value,
|
||||||
|
enterpriseIdList: [this.i.id]
|
||||||
|
};
|
||||||
|
this.service.request(this.service.$api_distributionCusService, params).subscribe(res => {
|
||||||
|
if (res) {
|
||||||
|
this.service.msgSrv.success('分配成功')
|
||||||
|
this.modal.close(true)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -162,6 +162,8 @@ export class UsermanageService extends ShipperBaseService {
|
|||||||
$api_getEnterpriceRel = '/api/mdc/enterpriceRelLog/getEnterpriceRel';
|
$api_getEnterpriceRel = '/api/mdc/enterpriceRelLog/getEnterpriceRel';
|
||||||
// 员工列表
|
// 员工列表
|
||||||
$api_getStaffList = '/api/mdc/cuc/userApp/getStaffList';
|
$api_getStaffList = '/api/mdc/cuc/userApp/getStaffList';
|
||||||
|
// 分配客服人员
|
||||||
|
$api_distributionCusService = '/api/mdc/cuc/enterpriseInfo/operate/distributionCusService';
|
||||||
|
|
||||||
constructor(public injector: Injector, public nzModalService: NzModalService, private nzImageService: NzImageService) {
|
constructor(public injector: Injector, public nzModalService: NzModalService, private nzImageService: NzImageService) {
|
||||||
super(injector);
|
super(injector);
|
||||||
|
|||||||
Reference in New Issue
Block a user