This commit is contained in:
Taric Xin
2022-04-13 14:16:49 +08:00
parent e8172b12b1
commit 29b289b07c
3 changed files with 19 additions and 8 deletions

View File

@ -8,7 +8,8 @@
[button]="'none'"></sf>
</div>
<div nz-col [nzSpan]="8" nzOffset="1">
<button nz-button nzType="primary" [nzLoading]="service.http.loading" (click)="st?.load(1)" acl [acl-ability]="['SYSTEM-STAFF-list']">查询</button>
<button nz-button nzType="primary" [nzLoading]="service.http.loading" (click)="st?.load(1)" acl
[acl-ability]="['SYSTEM-STAFF-list']">查询</button>
<button nz-button (click)="resetSF()">重置</button>
</div>
</div>
@ -18,8 +19,9 @@
<div class="d-flex justify-content-between mb-sm">
<label style="font-size: 18px;"></label>
<div>
<button nz-button nzType="primary" (click)="staffAction()" acl [acl-ability]="['SYSTEM-STAFF-add']">添加员工</button>
<button nz-button acl [acl-ability]="['SYSTEM-STAFF-export']">导出</button>
<button nz-button nzType="primary" (click)="staffAction()" acl
[acl-ability]="['SYSTEM-STAFF-add']">添加员工</button>
<button nz-button acl [acl-ability]="['SYSTEM-STAFF-export']" (click)="exportList()">导出</button>
</div>
</div>
@ -33,6 +35,6 @@
</div>
<st #st [data]="service.$api_get_enterprise_staff_page" [columns]="columns" [page]="{}"
[req]="{ params: {nameOrPhone: this.sf.value?.nameOrPhone} }" [loading]="false"
[scroll]="{ y: '370px' }" (change)="stChange($event)"></st>
[req]="{ params: {nameOrPhone: this.sf.value?.nameOrPhone} }" [loading]="false" [scroll]="{ y: '370px' }"
(change)="stChange($event)"></st>
</nz-card>

View File

@ -67,7 +67,8 @@ export class StaffManagementComponent implements OnInit {
},
{
text: '冻结',
iif: item => item.stateLocked === 0 && item.roleCode.split(',').indexOf('Administrator') === -1 && item.telephone !== this.user.phone,
iif: item =>
item.stateLocked === 0 && item.roleCode.split(',').indexOf('Administrator') === -1 && item.telephone !== this.user.phone,
click: item => this.action(item, 1),
acl: { ability: ['SYSTEM-STAFF-lock'] }
},
@ -79,7 +80,8 @@ export class StaffManagementComponent implements OnInit {
},
{
text: '删除',
iif: item => item.stateLocked === 0 && item.roleCode.split(',').indexOf('Administrator') === -1 && item.telephone !== this.user.phone,
iif: item =>
item.stateLocked === 0 && item.roleCode.split(',').indexOf('Administrator') === -1 && item.telephone !== this.user.phone,
click: item => this.action(item, 3),
acl: { ability: ['SYSTEM-STAFF-delete'] }
}
@ -167,6 +169,11 @@ export class StaffManagementComponent implements OnInit {
this.sf.reset();
}
exportList() {
const params = { nameOrPhone: this.sf.value?.nameOrPhone };
this.service.downloadFile(this.service.$api_export_staff, { ...params, pageSize: -1 });
}
private deleteStaff(params: any) {
this.service.request(this.service.$api_delete_staff, params).subscribe(res => {
if (res) {

View File

@ -15,6 +15,8 @@ import { BaseService } from 'src/app/shared/services';
export class SystemService extends BaseService {
// 分页查询企业项目员工列表
$api_get_enterprise_staff_page = '/api/mdc/cuc/userApp/getEnterpriseProjectStaffListPage';
// 分页查询企业项目员工列表
$api_export_staff = '/api/mdc/cuc/userApp/enterpriseProjectStaffExport';
// 添加员工
$api_add_staff = '/api/mdc/cuc/userApp/addStaff';
// 编辑员工