edit
This commit is contained in:
@ -1,23 +0,0 @@
|
|||||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
|
||||||
import { CucRoleEditComponent } from './edit.component';
|
|
||||||
|
|
||||||
describe('CucRoleEditComponent', () => {
|
|
||||||
let component: CucRoleEditComponent;
|
|
||||||
let fixture: ComponentFixture<CucRoleEditComponent>;
|
|
||||||
|
|
||||||
beforeEach(async(() => {
|
|
||||||
TestBed.configureTestingModule({
|
|
||||||
declarations: [CucRoleEditComponent],
|
|
||||||
}).compileComponents();
|
|
||||||
}));
|
|
||||||
|
|
||||||
beforeEach(() => {
|
|
||||||
fixture = TestBed.createComponent(CucRoleEditComponent);
|
|
||||||
component = fixture.componentInstance;
|
|
||||||
fixture.detectChanges();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should create', () => {
|
|
||||||
expect(component).toBeTruthy();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
@ -61,17 +61,17 @@ export class StaffManagementComponent implements OnInit {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: '冻结',
|
text: '冻结',
|
||||||
iif: item => item.stateLocked === 0,
|
iif: item => item.stateLocked === 0 && item.roleCode.split(',').indexOf('Administrator') === -1,
|
||||||
click: item => this.action(item, 1)
|
click: item => this.action(item, 1)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: '超管转授',
|
text: '超管转授',
|
||||||
iif: item => item.status === 0,
|
iif: item => item.stateLocked === 0 && item.roleCode.split(',').indexOf('Administrator') === -1,
|
||||||
click: item => this.transpowerAction(item)
|
click: item => this.transpowerAction(item)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: '删除',
|
text: '删除',
|
||||||
iif: item => item.stateLocked === 0,
|
iif: item => item.stateLocked === 0 && item.roleCode.split(',').indexOf('Administrator') === -1,
|
||||||
click: item => this.action(item, 3)
|
click: item => this.action(item, 3)
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@ -124,12 +124,15 @@ export class StaffManagementComponent implements OnInit {
|
|||||||
|
|
||||||
transpowerAction(item: any) {
|
transpowerAction(item: any) {
|
||||||
const modal = this.nzModalService.create({
|
const modal = this.nzModalService.create({
|
||||||
|
nzTitle: '超级管理员转授',
|
||||||
nzContent: BuyerTranspowerComponent,
|
nzContent: BuyerTranspowerComponent,
|
||||||
nzComponentParams: { i: { ...item } },
|
nzComponentParams: { i: { ...item } },
|
||||||
nzFooter: null
|
nzFooter: null
|
||||||
});
|
});
|
||||||
modal.afterClose.subscribe(res => {
|
modal.afterClose.subscribe(res => {
|
||||||
this.st.load();
|
if (res) {
|
||||||
|
this.st.load();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,23 +2,9 @@
|
|||||||
<div class="modal-title">{{ i.id === 0 ? '添加员工' : '编辑员工' }}</div>
|
<div class="modal-title">{{ i.id === 0 ? '添加员工' : '编辑员工' }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<sf #sf [ui]="ui" [schema]="schema" [button]="'none'">
|
<sf #sf [ui]="ui" [schema]="schema" [button]="'none'"></sf>
|
||||||
<ng-template sf-template="account" let-me let-ui="ui" let-schema="schema">
|
|
||||||
<sv-container labelWidth="1">
|
|
||||||
<sv label="">
|
|
||||||
<div class="staffBox">
|
|
||||||
<!-- <img [src]="i.avatar" alt="" /> -->
|
|
||||||
<dl>
|
|
||||||
<!-- <dt>{{ i.name }}</dt> -->
|
|
||||||
<dd>{{ i.phone }}</dd>
|
|
||||||
</dl>
|
|
||||||
</div>
|
|
||||||
</sv>
|
|
||||||
</sv-container>
|
|
||||||
</ng-template>
|
|
||||||
</sf>
|
|
||||||
</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)="sure()" [disabled]="!sf.valid">保存</button>
|
<button nz-button type="button" nzType="primary" (click)="sure()" [disabled]="!sf.valid">保存</button>
|
||||||
</div>
|
</div>
|
||||||
@ -8,8 +8,7 @@ import { SystemService } from '../../../services/system.service';
|
|||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-system-add',
|
selector: 'app-system-add',
|
||||||
templateUrl: './staff-modal.component.html',
|
templateUrl: './staff-modal.component.html'
|
||||||
styleUrls: ['./staff-modal.less']
|
|
||||||
})
|
})
|
||||||
export class SystemStaffStaffModalComponent implements OnInit {
|
export class SystemStaffStaffModalComponent implements OnInit {
|
||||||
@ViewChild('sf', { static: false })
|
@ViewChild('sf', { static: false })
|
||||||
@ -17,20 +16,12 @@ export class SystemStaffStaffModalComponent implements OnInit {
|
|||||||
i: any;
|
i: any;
|
||||||
schema!: SFSchema;
|
schema!: SFSchema;
|
||||||
ui!: SFUISchema;
|
ui!: SFUISchema;
|
||||||
roleList = [];
|
|
||||||
roleNames: any = [];
|
|
||||||
constructor(private modal: NzModalRef, public msgSrv: NzMessageService, public service: SystemService) {}
|
constructor(private modal: NzModalRef, public msgSrv: NzMessageService, public service: SystemService) {}
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
if (this.i?.userId !== 0) {
|
|
||||||
// this.i.roleIds = this.i.roleId !== '' ? this.i.roleId.split(',') : [];
|
|
||||||
}
|
|
||||||
|
|
||||||
this.initSF(this.i);
|
this.initSF(this.i);
|
||||||
}
|
}
|
||||||
initSF(staff: any) {
|
initSF(staff: any) {
|
||||||
console.log(staff);
|
|
||||||
|
|
||||||
this.schema = {
|
this.schema = {
|
||||||
properties: {
|
properties: {
|
||||||
staffName: {
|
staffName: {
|
||||||
@ -59,10 +50,11 @@ export class SystemStaffStaffModalComponent implements OnInit {
|
|||||||
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) => {
|
||||||
this.roleList = res;
|
return res
|
||||||
return res.map((item: any) => {
|
.filter((role: any) => role.roleCode !== 'Administrator')
|
||||||
return { label: item.roleName, value: item.id };
|
.map((item: any) => {
|
||||||
});
|
return { label: item.roleName, value: item.id };
|
||||||
|
});
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -81,10 +73,10 @@ export class SystemStaffStaffModalComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
sure() {
|
sure() {
|
||||||
// if (!this.sf.value.roleIds || this.sf.value.roleIds.length === 0) {
|
if (!this.sf.value.roleId || this.sf.value.roleId.length === 0) {
|
||||||
// this.service.msgSrv.error('员工角色不能为空!');
|
this.service.msgSrv.error('员工角色不能为空!');
|
||||||
// return;
|
return;
|
||||||
// }
|
}
|
||||||
if (this.i.userId === 0) {
|
if (this.i.userId === 0) {
|
||||||
const params: any = {
|
const params: any = {
|
||||||
...this.sf.value,
|
...this.sf.value,
|
||||||
|
|||||||
@ -1,25 +0,0 @@
|
|||||||
.info {
|
|
||||||
width: 100%;
|
|
||||||
margin: 0 auto 10px auto;
|
|
||||||
color: #333;
|
|
||||||
text-indent: 24px;
|
|
||||||
}
|
|
||||||
.staffBox {
|
|
||||||
display: flex;
|
|
||||||
img {
|
|
||||||
width: 30px;
|
|
||||||
height: 30px;
|
|
||||||
overflow: hidden;
|
|
||||||
border-radius: 50px;
|
|
||||||
}
|
|
||||||
dl {
|
|
||||||
margin: 0 0 0 5px;
|
|
||||||
dt {
|
|
||||||
font-size: 14px;
|
|
||||||
line-height: 28px;
|
|
||||||
}
|
|
||||||
dd {
|
|
||||||
font-size: 12px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,22 +1,17 @@
|
|||||||
<div class="modal-header">
|
<form nz-form #f="ngForm" se-container="1" labelWidth="100">
|
||||||
<div class="modal-title">超级管理员转授</div>
|
<se label="转授对象">{{i.name}}({{i.telephone}})</se>
|
||||||
</div>
|
|
||||||
<form nz-form #f="ngForm" se-container="1">
|
|
||||||
<se label="转授员工">张三(13411223344)</se>
|
|
||||||
<se style="margin:0">
|
<se style="margin:0">
|
||||||
<div class="code">为了账户安全,需超管手机验证({{ superPhone }})</div>
|
<div class="code">为了账户安全,需超管手机验证({{ superPhone }})</div>
|
||||||
</se>
|
</se>
|
||||||
<se label="验证码">
|
<se label="验证码">
|
||||||
<div class="inputBox">
|
<div nz-row [nzGutter]="8">
|
||||||
<div nz-row [nzGutter]="8">
|
<div nz-col [nzSpan]="12">
|
||||||
<div nz-col [nzSpan]="12">
|
<input nz-input name="smsVerifyCode" [(ngModel)]="smsVerifyCode" maxlength="6" placeholder="请输入短信验证码" />
|
||||||
<input nz-input name="smsVerifyCode" [(ngModel)]="smsVerifyCode" maxlength="6" placeholder="请输入短信验证码" />
|
</div>
|
||||||
</div>
|
<div nz-col [nzSpan]="12">
|
||||||
<div nz-col [nzSpan]="12">
|
<button nz-button (click)="sendCode()" [disabled]="count > 0">
|
||||||
<button nz-button (click)="sendCode()" [disabled]="count > 0">
|
{{ count > 0 ? '请等待' + count + 's' : '发送验证码' }}
|
||||||
{{ count > 0 ? '请等待' + count + 's' : '发送验证码' }}
|
</button>
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</se>
|
</se>
|
||||||
|
|||||||
@ -4,24 +4,21 @@ import { interval } from 'rxjs';
|
|||||||
import { take } from 'rxjs/operators';
|
import { take } from 'rxjs/operators';
|
||||||
import { DunHelper } from 'src/app/shared/components/captcha/dun.helper';
|
import { DunHelper } from 'src/app/shared/components/captcha/dun.helper';
|
||||||
import { EACaptchaService } from 'src/app/shared/services/business/captcha.service';
|
import { EACaptchaService } from 'src/app/shared/services/business/captcha.service';
|
||||||
|
import { SystemService } from '../../../services/system.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-buyer-transpower',
|
selector: 'app-buyer-transpower',
|
||||||
templateUrl: './transpower.component.html',
|
templateUrl: './transpower.component.html'
|
||||||
styleUrls: ['./transpower.less']
|
|
||||||
})
|
})
|
||||||
export class BuyerTranspowerComponent implements OnInit {
|
export class BuyerTranspowerComponent implements OnInit {
|
||||||
record: any = {};
|
|
||||||
count = 0;
|
count = 0;
|
||||||
interval$: any;
|
|
||||||
i: any;
|
i: any;
|
||||||
smsVerifyCode = '';
|
smsVerifyCode = '';
|
||||||
superPhone = '';
|
superPhone = '';
|
||||||
staffId = 1;
|
|
||||||
staffList: any = [];
|
|
||||||
constructor(
|
constructor(
|
||||||
private modal: NzModalRef,
|
private modal: NzModalRef,
|
||||||
public captchaService: EACaptchaService,
|
public service: SystemService,
|
||||||
|
public eACaptchaService: EACaptchaService,
|
||||||
private dunHelper: DunHelper,
|
private dunHelper: DunHelper,
|
||||||
private cdr: ChangeDetectorRef
|
private cdr: ChangeDetectorRef
|
||||||
) {}
|
) {}
|
||||||
@ -30,24 +27,24 @@ export class BuyerTranspowerComponent implements OnInit {
|
|||||||
this.getPhone();
|
this.getPhone();
|
||||||
}
|
}
|
||||||
getPhone() {
|
getPhone() {
|
||||||
// this.service.request(this.service.$api_getAppLesseeAdmin).subscribe((res) => {
|
this.service.request(this.service.$api_get_app_admin_info).subscribe(res => {
|
||||||
// console.log(res);
|
if (res) {
|
||||||
// if (res) {
|
this.superPhone = res.telephone;
|
||||||
// this.superPhone = res.telephone;
|
}
|
||||||
// }
|
});
|
||||||
// });
|
|
||||||
}
|
}
|
||||||
sure() {
|
sure() {
|
||||||
const params = {
|
const params = {
|
||||||
appUserId: this.i.appUserId,
|
appUserId: this.i.appUserId,
|
||||||
smsVerifyCode: this.smsVerifyCode
|
smsVerifyCode: this.smsVerifyCode,
|
||||||
|
telephone: this.i.telephone
|
||||||
};
|
};
|
||||||
// this.service.request(this.service.$api_shiftResellerAdmin, params).subscribe((res) => {
|
this.service.request(this.service.$api_set_shift_admin, params).subscribe(res => {
|
||||||
// if (res) {
|
if (res) {
|
||||||
// this.service.msgSrv.success('操作成功!');
|
this.service.msgSrv.success('操作成功!');
|
||||||
// this.modal.close(true);
|
this.modal.close(true);
|
||||||
// }
|
}
|
||||||
// });
|
});
|
||||||
}
|
}
|
||||||
close() {
|
close() {
|
||||||
this.modal.destroy();
|
this.modal.destroy();
|
||||||
@ -56,9 +53,9 @@ export class BuyerTranspowerComponent implements OnInit {
|
|||||||
* 获取手机验证码
|
* 获取手机验证码
|
||||||
*/
|
*/
|
||||||
sendCode() {
|
sendCode() {
|
||||||
this.captchaService.getAppLesseeAdminSMVerificationCode().subscribe(res => {
|
this.eACaptchaService.request(this.eACaptchaService.$api_getAppLesseeAdminSMVerificationCode).subscribe(res => {
|
||||||
if (res.success && res.data.code === '1') {
|
if (res.success && res.data.code === '1') {
|
||||||
this.captchaService.msgSrv.success('发送验证码成功');
|
this.eACaptchaService.msgSrv.success('发送验证码成功');
|
||||||
this.createInterval();
|
this.createInterval();
|
||||||
} else if (res.data.code === '503046') {
|
} else if (res.data.code === '503046') {
|
||||||
this.dunHelper.popUp().subscribe(_ => {
|
this.dunHelper.popUp().subscribe(_ => {
|
||||||
@ -66,7 +63,7 @@ export class BuyerTranspowerComponent implements OnInit {
|
|||||||
this.dunHelper.destory();
|
this.dunHelper.destory();
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.captchaService.msgSrv.warning(res.msg);
|
this.eACaptchaService.msgSrv.warning(res.msg);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,41 +0,0 @@
|
|||||||
.info {
|
|
||||||
width : 90%;
|
|
||||||
margin : 0 auto;
|
|
||||||
color : #333;
|
|
||||||
text-indent: 24px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.staffBox {
|
|
||||||
display : flex;
|
|
||||||
align-items: center;
|
|
||||||
|
|
||||||
img {
|
|
||||||
width : 30px;
|
|
||||||
height : 30px;
|
|
||||||
overflow : hidden;
|
|
||||||
border-radius: 50px;
|
|
||||||
}
|
|
||||||
|
|
||||||
dl {
|
|
||||||
margin: 0 0 0 5px;
|
|
||||||
|
|
||||||
dt {
|
|
||||||
font-size : 14px;
|
|
||||||
line-height: 28px;
|
|
||||||
}
|
|
||||||
|
|
||||||
dd {
|
|
||||||
font-size: 12px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.inputBox {
|
|
||||||
position: relative;
|
|
||||||
|
|
||||||
a {
|
|
||||||
position: absolute;
|
|
||||||
top : 0;
|
|
||||||
right : 5px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -23,6 +23,11 @@ export class SystemService extends BaseService {
|
|||||||
$api_delete_staff = '/api/mdc/cuc/userApp/deleteAppUser';
|
$api_delete_staff = '/api/mdc/cuc/userApp/deleteAppUser';
|
||||||
// 冻结或恢复员工
|
// 冻结或恢复员工
|
||||||
$api_free_or_resume_staff = '/api/mdc/cuc/userApp/freezeOrResumeStaff';
|
$api_free_or_resume_staff = '/api/mdc/cuc/userApp/freezeOrResumeStaff';
|
||||||
|
// 获取应用企业的管理员用户
|
||||||
|
$api_get_app_admin_info = `/api/mdc/cuc/userApp/getAppEnterpriseAdmin`;
|
||||||
|
// 运营管理后台转授超管角色
|
||||||
|
$api_set_shift_admin = `/api/mdc/cuc/userAuthority/shiftAdmin`;
|
||||||
|
|
||||||
|
|
||||||
// 分页获取应用角色列表
|
// 分页获取应用角色列表
|
||||||
$api_get_role_page = '/api/mdc/cuc/roleInfo/getAppRoleInfoList';
|
$api_get_role_page = '/api/mdc/cuc/roleInfo/getAppRoleInfoList';
|
||||||
|
|||||||
@ -10,7 +10,7 @@ import { Observable, Subject } from 'rxjs';
|
|||||||
import { BaseService } from '../core/base.service';
|
import { BaseService } from '../core/base.service';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root',
|
providedIn: 'root'
|
||||||
})
|
})
|
||||||
export class EACaptchaService extends BaseService {
|
export class EACaptchaService extends BaseService {
|
||||||
// 通过手机号发送短信验证码
|
// 通过手机号发送短信验证码
|
||||||
@ -26,7 +26,7 @@ export class EACaptchaService extends BaseService {
|
|||||||
$api_captcha_sms_code = `/scce/pbc/pbc/verification/getSMVerificationCodeByToken`;
|
$api_captcha_sms_code = `/scce/pbc/pbc/verification/getSMVerificationCodeByToken`;
|
||||||
|
|
||||||
// 获取应用租户的管理员用户发送验证码
|
// 获取应用租户的管理员用户发送验证码
|
||||||
$api_getAppLesseeAdminSMVerificationCode = `/chiauserBasicInfo/getAppLesseeAdminSMVerificationCode`;
|
$api_getAppLesseeAdminSMVerificationCode = `/api/mdc/cuc/userAuthority/adminSmverificationCode?_allow_badcode=true`;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据当前登录用户绑定的手机号码获取短信验证码
|
* 根据当前登录用户绑定的手机号码获取短信验证码
|
||||||
@ -34,12 +34,7 @@ export class EACaptchaService extends BaseService {
|
|||||||
getCaptchaBySMSNoPhone(): Observable<any> {
|
getCaptchaBySMSNoPhone(): Observable<any> {
|
||||||
return this.request(this.$api_captcha_sms_code, { appId: this.envSrv.getEnvironment().appId }, 'POST', true, 'FORM');
|
return this.request(this.$api_captcha_sms_code, { appId: this.envSrv.getEnvironment().appId }, 'POST', true, 'FORM');
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* 获取应用租户的管理员用户发送验证码
|
|
||||||
*/
|
|
||||||
getAppLesseeAdminSMVerificationCode(): Observable<any> {
|
|
||||||
return this.request(this.$api_getAppLesseeAdminSMVerificationCode, { appId: this.envSrv.getEnvironment().appId }, 'POST', true, 'FORM');
|
|
||||||
}
|
|
||||||
constructor(public injector: Injector) {
|
constructor(public injector: Injector) {
|
||||||
super(injector);
|
super(injector);
|
||||||
}
|
}
|
||||||
@ -54,7 +49,7 @@ export class EACaptchaService extends BaseService {
|
|||||||
{ appId: this.envSrv.getEnvironment()?.appId, phoneNumber: mobile },
|
{ appId: this.envSrv.getEnvironment()?.appId, phoneNumber: mobile },
|
||||||
'POST',
|
'POST',
|
||||||
true,
|
true,
|
||||||
'FORM',
|
'FORM'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -70,7 +65,7 @@ export class EACaptchaService extends BaseService {
|
|||||||
{ appId: this.envSrv.getEnvironment()?.appId, phoneNumber: mobile, user: mobile, validate },
|
{ appId: this.envSrv.getEnvironment()?.appId, phoneNumber: mobile, user: mobile, validate },
|
||||||
'POST',
|
'POST',
|
||||||
true,
|
true,
|
||||||
'FORM',
|
'FORM'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user