This commit is contained in:
Taric Xin
2022-01-12 10:47:36 +08:00
parent 9d8da4f37e
commit 75808bbaf5
27 changed files with 330 additions and 395 deletions

View File

@ -16,10 +16,9 @@
<sf #sf [schema]="schema" [ui]="ui" [compact]="true" [button]="'none'"></sf>
</div>
<div nz-col [nzXl]="_$expand ? 24 : 6" [nzLg]="24" [nzSm]="24" [nzXs]="24" class="text-right">
<button nz-button nzType="primary" [disabled]="!sf.valid" [nzLoading]="service.http.loading"
(click)="st?.load(1)">查询</button>
<button nz-button (click)="resetSF()">重置</button>
<button nz-button nzType="primary" [nzLoading]="service.http.loading" (click)="st?.load(1)">导出</button>
<button nz-button nzType="primary" [nzLoading]="service.http.loading" (click)="st?.load(1)">查询</button>
<button nz-button nzType="primary" [disabled]="service.http.loading" (click)="st?.load(1)">导出</button>
<button nz-button (click)="resetSF()" [disabled]="service.http.loading">重置</button>
<button nz-button nzType="link" (click)="expandToggle()">
{{ !_$expand ? '展开' : '收起' }}
<i nz-icon [nzType]="!_$expand ? 'down' : 'up'"></i>
@ -28,14 +27,20 @@
</div>
</nz-card>
<nz-card>
<nz-card class="content-box">
<nz-tabset [nzSelectedIndex]="1">
<nz-tab nzTitle="全部" (nzClick)="selectChange(null)"></nz-tab>
<nz-tab nzTitle="待审核" (nzClick)="selectChange(0)"></nz-tab>
<nz-tab nzTitle="已成功" (nzClick)="selectChange(1)"></nz-tab>
<nz-tab nzTitle="已驳回" (nzClick)="selectChange(2)"></nz-tab>
</nz-tabset>
<!-- 数据列表 -->
<!-- [data]="service.$api_get_supplier_page" -->
<st #st [columns]="columns" [data]='service.$api_get_user_list'
[req]="{ method: 'POST', allInBody: true, reName: { pi: 'pageIndex', ps: 'pageSize' }, params: reqParams }"
[res]="{ reName: { list: 'data.records', total: 'data.total' } }"
[page]="{ show: true, showSize: true, pageSizes: [10, 20, 30, 50, 100, 200, 300, 500, 1000] }" [loadingDelay]="500"
<st #st [columns]="columns" [data]='service.$api_get_user_list'
[req]="{ method: 'POST', allInBody: true, reName: { pi: 'pageIndex', ps: 'pageSize' }, process: beforeReq }"
[res]="{ reName: { list: 'data.records', total: 'data.total' } }" [scroll]="{ x:'1200px',y: '400px' }"
[page]="{ show: true, showSize: true, pageSizes: [10, 20, 30, 50, 100, 200, 300, 500, 1000] }"
[loading]="service.http.loading">
<ng-template st-row="enterpriseName" let-item let-index="index">
<div nz-tooltip [nzTooltipTitle]="item.enterpriseName">

View File

@ -3,4 +3,10 @@
nz-range-picker {
width: 100%;
}
.content-box {
.ant-card-body {
padding-top: 6px;
}
}
}

View File

@ -1,6 +1,6 @@
import { Component, OnInit, ViewChild } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { STColumn, STColumnBadge, STComponent, STData } from '@delon/abc/st';
import { STColumn, STColumnBadge, STComponent, STData, STRequestOptions } from '@delon/abc/st';
import { SFComponent, SFDateWidgetSchema, SFSchema, SFUISchema } from '@delon/form';
import { NzModalService } from 'ng-zorro-antd/modal';
import { UsermanageService } from '../../../services/usercenter.service';
@ -21,40 +21,41 @@ export class FreightComponentsUserComponent implements OnInit {
promoterModal!: any;
promotersTelephone = '';
resourceStatus: any = 0;
constructor(public service: UsermanageService, private modal: NzModalService, private router: Router, private ar: ActivatedRoute) {}
/**
* 查询参数
*/
get reqParams() {
const params: any = {
...(this.sf && this.sf.value)
};
if (this.sf?.value.effectiveDate) {
Object.assign(params, {
time: {
start: this.sf?.value.effectiveDate[0],
end: this.sf?.value.effectiveDate[1]
}
});
// params.effectiveDateStart = this.sf?.value.effectiveDate[0];
// params.effectiveDateEnd = this.sf?.value.effectiveDate[1];
}
delete params.effectiveDate;
delete params.expand;
return params;
}
get selectedRows() {
return this.st?.list.filter(item => item.checked) || [];
}
ngOnInit() {
this.ar.url.subscribe(params => {
this.st?.load(1);
});
}
beforeReq = (requestOptions: STRequestOptions) => {
Object.assign(requestOptions.body, { certificationStatus: this.resourceStatus });
if (this.sf) {
Object.assign(requestOptions.body, {
...this.sf.value
});
if (this.sf?.value.effectiveDate) {
Object.assign(requestOptions.body, {
time: {
start: this.sf?.value.effectiveDate[0],
end: this.sf?.value.effectiveDate[1]
}
});
}
delete requestOptions.body.effectiveDate;
delete requestOptions.body.expand;
}
return requestOptions;
};
selectChange(e: any) {
this.resourceStatus = e;
this.st.load();
}
addPromoter(item?: any) {
this.promotersTelephone = item?.promotersTelephone;
const modal = this.modal.create({
@ -109,9 +110,6 @@ export class FreightComponentsUserComponent implements OnInit {
this._$expand = !this._$expand;
this.sf?.setValue('/expand', this._$expand);
}
creat() {
this.router.navigate(['./new'], { relativeTo: this.ar });
}
/**
* 重置表单