This commit is contained in:
Taric Xin
2022-02-15 10:01:07 +08:00
parent 2220c62f00
commit 386bcccae8
11 changed files with 427 additions and 158 deletions

View File

@ -1,12 +1,9 @@
import { Component, OnInit, ViewChild } from '@angular/core';
import { Router } from '@angular/router';
import { STComponent, STColumn, STChange } from '@delon/abc/st';
import { STComponent, STColumn, STChange, STRequestOptions } from '@delon/abc/st';
import { SFComponent, SFSchema, SFDateWidgetSchema } from '@delon/form';
import { NzModalService } from 'ng-zorro-antd/modal';
import { SystemStaffStaffModalComponent } from 'src/app/routes/sys-setting/components/staff-management/staff-modal/staff-modal.component';
import { SystemService } from 'src/app/routes/sys-setting/services/system.service';
import { FreightAccountService } from '../../services/freight-account.service';
import { SettingFinancialComponent } from './setting-financial/setting-financial.component';
@Component({
selector: 'app-platform-account',
@ -18,40 +15,22 @@ export class PlatformAccountComponent implements OnInit {
st!: STComponent;
@ViewChild('sf', { static: false })
sf!: SFComponent;
searchSchema: SFSchema = this.initSF();
columns: STColumn[] = this.initST();
url = `/rule?_allow_anonymous=true`;
searchSchema: SFSchema = this.initSF();
columns: STColumn[] = this.initST();
reqParams = { pageIndex: 1, pageSize: 10 };
constructor(public service: FreightAccountService, private router: Router, private nzModalService: NzModalService) {}
ngOnInit(): void {}
stChange(e: STChange): void {
switch (e.type) {
case 'filter':
this.st.load();
break;
beforeReq = (requestOptions: STRequestOptions) => {
if (this.sf) {
Object.assign(requestOptions.body, { ...this.sf.value });
}
}
settingFinanical(item: any) {
const modal = this.nzModalService.create({
nzContent: SettingFinancialComponent,
nzComponentParams: item ? { i: { ...item, roleId: '1,2,3', name: '用户名', phone: 18555555555 } } : { i: { id: 0 } },
nzFooter: null
});
modal.afterClose.subscribe(res => {
this.st.load();
});
}
routeTo(item?: any) {
this.router.navigate(['/financial-management/driver-account-detail/1']);
}
return requestOptions;
};
/**
* 重置表单
@ -192,7 +171,7 @@ export class PlatformAccountComponent implements OnInit {
buttons: [
{
text: '查看明细',
click: item => this.routeTo(item)
click: item => this.router.navigate(['/financial-management/platform-account/detail/' + item.id])
}
]
}