This commit is contained in:
Taric Xin
2022-04-25 19:09:33 +08:00
parent c9c1f8108f
commit c5ca59239f
29 changed files with 481 additions and 897 deletions

View File

@ -8,7 +8,7 @@
* @FilePath : \\tms-obc-web\\src\\app\\routes\\financial-management\\components\\cost-management\\cost-management.component.html
* Copyright (C) 2022 huzhenhong. All rights reserved.
-->
<page-header-wrapper title="费用管理"> </page-header-wrapper>
<!-- <page-header-wrapper title="费用管理"> </page-header-wrapper>
<nz-card class="search-box">
<div nz-row nzGutter="8">
@ -20,28 +20,36 @@
<button nz-button nzType="primary" [nzLoading]="service.http.loading" (click)="st?.load(1)" acl
[acl-ability]="['FINANCIAL-COST-list']">查询</button>
<button nz-button (click)="resetSF()">重置</button>
<!-- <button nz-button (click)="exportList()"> 导出</button>
<button nz-button (click)="exportList()"> 导出明细</button> -->
<button nz-button (click)="exportList()"> 导出</button>
<button nz-button (click)="exportList()"> 导出明细</button>
<button nz-button nzType="link" (click)="expandToggle()">
{{ !_$expand ? '展开' : '收起' }}
<i nz-icon [nzType]="!_$expand ? 'down' : 'up'"></i>
</button>
</div>
</div>
</nz-card>
</nz-card> -->
<nz-card class="content-box">
<div nz-row class="mb-sm">
<nz-card class="table-box">
<div class="header_box">
<label class="page_title"> <label class="driver">|</label> 费用管理</label>
<div class="mr-sm">
<button nz-button nzDanger [nzLoading]="service.http.loading" (click)="openDrawer()" acl
[acl-ability]="['FINANCIAL-COST-list']">筛选</button>
<button nz-button nzDanger (click)="exportList()"> 导出</button>
</div>
</div>
<!-- <div nz-row class="mb-sm">
<div nz-col nzSpan="24">
<!-- <button nz-button nzType="primary" [nzLoading]="service.http.loading"
<button nz-button nzType="primary" [nzLoading]="service.http.loading"
(click)="routeTo('/financial-management/cost-management/expenses-receivable/1')">添加应收费用</button>
<button nz-button nzType="primary" [nzLoading]="service.http.loading"
(click)="routeTo('/financial-management/cost-management/expenses-payable/1')">添加应付费用</button>
<button nz-button nzType="primary" [nzLoading]="service.http.loading">导入费用</button> -->
<button nz-button nzType="primary" [nzLoading]="service.http.loading">导入费用</button>
</div>
</div>
</div> -->
<st #st [data]="service.$api_get_cost_page" [columns]="columns" [req]="{ process: beforeReq }" [page]="{}"
[loading]="false" [scroll]="{ x: '2000px' }">
[loading]="false" [scroll]="{ x: '2000px',y:scrollY }">
<ng-template st-row="armoeny" let-item let-index="index">
{{ item.armoeny | currency }}
</ng-template>

View File

@ -2,34 +2,43 @@ import { Component, OnInit, ViewChild } from '@angular/core';
import { Router } from '@angular/router';
import { STComponent, STColumn, STRequestOptions } from '@delon/abc/st';
import { SFComponent, SFSchema, SFDateWidgetSchema, SFSelectWidgetSchema, SFSchemaEnum } from '@delon/form';
import { SearchDrawerService } from '@shared';
import { NzModalService } from 'ng-zorro-antd/modal';
import { of } from 'rxjs';
import { map } from 'rxjs/operators';
import { BasicTableComponent } from 'src/app/routes/commom';
import { FreightAccountService } from '../../services/freight-account.service';
@Component({
selector: 'app-cost-management',
templateUrl: './cost-management.component.html',
styleUrls: ['../../../commom/less/box.less']
styleUrls: ['../../../commom/less/commom-table.less']
})
export class CostManagementComponent implements OnInit {
export class CostManagementComponent extends BasicTableComponent implements OnInit {
@ViewChild('st', { static: true })
st!: STComponent;
@ViewChild('sf', { static: false })
sf!: SFComponent;
@ViewChild('auditModal', { static: false })
auditModal!: any;
searchSchema: SFSchema = this.initSF();
schema: SFSchema = this.initSF();
columns: STColumn[] = this.initST();
selectedRows: any[] = [];
_$expand = false;
constructor(public service: FreightAccountService, private nzModalService: NzModalService, private router: Router) {}
constructor(
public service: FreightAccountService,
private nzModalService: NzModalService,
private router: Router,
public searchDrawerService: SearchDrawerService
) {
super(searchDrawerService);
}
ngOnInit(): void {}
search() {
this.st?.load(1);
}
beforeReq = (requestOptions: STRequestOptions) => {
if (this.sf) {
Object.assign(requestOptions.body, {
@ -73,24 +82,9 @@ export class CostManagementComponent implements OnInit {
});
}
/**
* 重置表单
*/
resetSF() {
this.sf.reset();
this._$expand = false;
}
/**
* 伸缩查询条件
*/
expandToggle() {
this._$expand = !this._$expand;
this.sf?.setValue('/expand', this._$expand);
}
exportList() {
this.service.exportStart( { ...this.sf.value, pageSize: -1 }, this.service.$api_get_exportPlatformAccountBalanceByOperator,);
this.service.exportStart({ ...this.sf.value, pageSize: -1 }, this.service.$api_get_exportPlatformAccountBalanceByOperator);
}
routeTo(url: string, params?: any, status?: any) {
@ -100,12 +94,6 @@ export class CostManagementComponent implements OnInit {
private initSF(): SFSchema {
return {
properties: {
expand: {
type: 'boolean',
ui: {
hidden: true
}
},
feecode: {
type: 'string',
title: '费用单号',
@ -131,9 +119,6 @@ export class CostManagementComponent implements OnInit {
format: 'yyyy-MM-dd',
placeholder: '请选择',
nzShowTime: true,
visibleIf: {
expand: (value: boolean) => value
}
} as SFDateWidgetSchema
},
feetype: {
@ -147,9 +132,6 @@ export class CostManagementComponent implements OnInit {
ui: {
widget: 'select',
placeholder: '请选择',
visibleIf: {
expand: (value: boolean) => value
}
},
default: ''
},
@ -159,14 +141,11 @@ export class CostManagementComponent implements OnInit {
enum: [
{ label: '全部', value: '全部' },
{ label: '运输费', value: '1475197820443299842' },
{ label: '附加费', value: '1476197820443299842 ' },
{ label: '附加费', value: '1476197820443299842 ' }
],
ui: {
widget: 'select',
placeholder: '请选择',
visibleIf: {
expand: (value: boolean) => value
}
}
},
ltdId: {
@ -177,9 +156,6 @@ export class CostManagementComponent implements OnInit {
placeholder: '请选择',
allowClear: true,
asyncData: () => this.service.getNetworkFreightForwarder(),
visibleIf: {
expand: (value: boolean) => value
}
}
},
hrto: {
@ -202,9 +178,6 @@ export class CostManagementComponent implements OnInit {
return of([]);
}
},
visibleIf: {
expand: (value: boolean) => value
}
} as SFSelectWidgetSchema
},
arto: {
@ -227,9 +200,6 @@ export class CostManagementComponent implements OnInit {
return of([]);
}
},
visibleIf: {
expand: (value: boolean) => value
}
} as SFSelectWidgetSchema
},
createTime: {
@ -240,9 +210,6 @@ export class CostManagementComponent implements OnInit {
format: 'yyyy-MM-dd',
placeholder: '请选择',
nzShowTime: true,
visibleIf: {
expand: (value: boolean) => value
}
} as SFDateWidgetSchema
},
ishrhx: {
@ -256,9 +223,6 @@ export class CostManagementComponent implements OnInit {
ui: {
widget: 'select',
placeholder: '请选择',
visibleIf: {
expand: (value: boolean) => value
}
},
default: ''
},
@ -270,9 +234,6 @@ export class CostManagementComponent implements OnInit {
placeholder: '请选择',
allowClear: true,
asyncData: () => this.service.getCloseAccount(),
visibleIf: {
expand: (value: boolean) => value
}
}
}
}