This commit is contained in:
Taric Xin
2022-01-19 16:30:12 +08:00
parent ce64b48674
commit 48ce6a1d10
22 changed files with 623 additions and 144 deletions

View File

@ -0,0 +1,31 @@
<page-header-wrapper [title]="'凭证管理'">
</page-header-wrapper>
<nz-card class="search-box" nzBordered>
<div nz-row nzGutter="8">
<div nz-col [nzXl]="_$expand ? 24 : 18" [nzLg]="24" [nzSm]="24" [nzXs]="24">
<sf #sf [schema]="searchSchema"
[ui]="{ '*': { spanLabelFixed: 100,grid: { lg: 8, md: 12, sm: 12, xs: 24 } }}" [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" [nzLoading]="service.http.loading" (click)="st?.load(1)">查询</button>
<button nz-button [disabled]="service.http.loading" (click)="resetSF()">重置</button>
<button nz-button [disabled]="service.http.loading"> 导出</button>
<button nz-button [disabled]="service.http.loading"> 导出明细</button>
<button nz-button nzType="link" (click)="expandToggle()">
{{ !_$expand ? '展开' : '收起' }}
<i nz-icon [nzType]="!_$expand ? 'down' : 'up'"></i>
</button>
</div>
</div>
</nz-card>
<nz-card class="content-box" nzBordered>
<st #st [data]="service.$api_get_fico_vch_page" [columns]="columns"
[req]="{ method: 'POST', allInBody: true, reName: { pi: 'pageIndex', ps: 'pageSize' }, process: beforeReq }"
[res]="{ reName: { list: 'data.records', total: 'data.total' } }"
[page]="{ show: true, showSize: true, pageSizes: [10, 20, 30, 50, 100, 200, 300, 500, 1000] }"
[loading]="service.http.loading" [scroll]="{ x:'1200px',y: '370px' }" (change)="stChange($event)" class="mt-md">
</st>
</nz-card>

View File

@ -0,0 +1,225 @@
import { Component, OnInit, ViewChild } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { STComponent, STColumn, STRequestOptions, STChange } from '@delon/abc/st';
import { SFComponent, SFSchema, SFDateWidgetSchema } from '@delon/form';
import { NzModalService } from 'ng-zorro-antd/modal';
import { FreightAccountService } from '../../../services/freight-account.service';
@Component({
selector: 'app-voucher-list',
templateUrl: './voucher-list.component.html',
styleUrls: ['../../../../commom/less/box.less']
})
export class VoucherListComponent implements OnInit {
@ViewChild('st', { static: true })
st!: STComponent;
@ViewChild('sf', { static: false })
sf!: SFComponent;
@ViewChild('auditModal', { static: false })
auditModal!: any;
columns: STColumn[] = this.initST();
searchSchema: SFSchema = this.initSF();
_$expand = false;
selectedRows: any[] = [];
vc2code = null;
constructor(public service: FreightAccountService, private route: ActivatedRoute, private router: Router) {
this.vc2code = route.snapshot.params.id;
}
ngOnInit(): void {}
beforeReq = (requestOptions: STRequestOptions) => {
Object.assign(requestOptions.body, { vc2code: this.vc2code });
if (this.sf) {
Object.assign(requestOptions.body, {
...this.sf.value
});
if (this.sf.value.createTime) {
Object.assign(requestOptions.body, {
createTime: {
start: this.sf.value.createTime?.[0] || null,
end: this.sf.value.createTime?.[1] || null
}
});
}
if (this.sf.value.vctime) {
Object.assign(requestOptions.body, {
vctime: {
start: this.sf.value.vctime?.[0] || null,
end: this.sf.value.vctime?.[1] || null
}
});
}
}
return requestOptions;
};
stChange(e: STChange): void {
switch (e.type) {
case 'checkbox':
this.selectedRows = e.checkbox!;
break;
}
}
/**
* 重置表单
*/
resetSF() {
this.sf.reset();
this._$expand = false;
}
/**
* 伸缩查询条件
*/
expandToggle() {
this._$expand = !this._$expand;
this.sf?.setValue('/expand', this._$expand);
}
private initSF(): SFSchema {
return {
properties: {
expand: {
type: 'boolean',
ui: {
hidden: true
}
},
vccode: {
type: 'string',
title: '凭证号',
ui: {
autocomplete: 'off',
placeholder: '请输入'
}
},
vctime: {
title: '凭证时间',
type: 'string',
ui: {
widget: 'sl-from-to-search',
format: 'yyyy-MM-dd'
} as SFDateWidgetSchema
},
createTime: {
title: '创建时间',
type: 'string',
ui: {
widget: 'sl-from-to-search',
format: 'yyyy-MM-dd'
} as SFDateWidgetSchema
},
sourceCode: {
type: 'string',
title: '原始单号',
ui: {
autocomplete: 'off',
placeholder: '请输入',
visibleIf: {
expand: (value: boolean) => value
}
}
},
sourceType: {
type: 'string',
title: '原始单类型',
ui: {
widget: 'select',
placeholder: '请选择',
visibleIf: {
expand: (value: boolean) => value
}
}
},
drmoney: {
type: 'string',
title: '借方金额',
ui: {
placeholder: '请输入',
visibleIf: {
expand: (value: boolean) => value
}
}
},
inpinvcosde: {
type: 'string',
title: '凭证摘要',
ui: {
placeholder: '请输入',
visibleIf: {
expand: (value: boolean) => value
}
}
},
subid: {
type: 'string',
title: '科目',
ui: {
widget: 'dict-select',
params: { dictKey: 'refund:apply:status' },
placeholder: '请选择',
visibleIf: {
expand: (value: boolean) => value
}
}
},
crmoney: {
type: 'string',
title: '贷方金额',
ui: {
placeholder: '请输入',
visibleIf: {
expand: (value: boolean) => value
}
}
}
}
};
}
private initST(): STColumn[] {
return [
{ title: '凭证号', index: 'id', type: 'link', width: 150 },
{ title: '帐套', index: 'vcltdid', width: 150 },
{ title: '凭证时间', index: 'vctime', type: 'date', width: 150 },
{ title: '凭证类型', index: 'vctypeLabel', width: 150 },
{ title: '序号', index: 'invmoney', width: 150, format: _ => '1' },
{ title: '摘要', index: 'remarks', width: 300 },
{ title: '币种', index: 'currency', width: 100 },
{
title: '借方金额',
index: 'drmoney',
width: 120,
type: 'widget',
className: 'text-right',
widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.drmoney }) }
},
{
title: '贷方金额',
index: 'crmoney',
width: 120,
type: 'widget',
className: 'text-right',
widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.crmoney }) }
},
{ title: '凭证状态', index: 'stsLabel', width: 120 },
{ title: '创建时间', index: 'createTime', width: 140 },
{ title: '创建人', index: 'createUserId', width: 150 },
{
title: '操作',
width: '130px',
fixed: 'right',
buttons: [
{
text: '浏览',
click: (item: any) => this.router.navigate(['/voucher-summary/list/detail/' + item.id])
}
]
}
];
}
}

View File

@ -320,7 +320,7 @@ export class VoucherSummaryComponent implements OnInit {
},
{
text: '列表',
click: (item: any) => this.router.navigate(['/financial-management/voucher-summary/detail/' + item.id])
click: (item: any) => this.router.navigate(['/financial-management/voucher-summary/list/' + item.vc2code])
}
]
}