This commit is contained in:
Taric Xin
2022-01-17 20:38:28 +08:00
parent f8a55a7068
commit d8b381a4f0
11 changed files with 461 additions and 132 deletions

View File

@ -0,0 +1,56 @@
<page-header-wrapper title="浏览" [logo]="logo">
<ng-template #logo>
<button nz-button nz-tooltip nzTooltipTitle="返回上一页" (click)="goBack()">
<i nz-icon nzType="left" nzTheme="outline"></i>
</button>
</ng-template>
</page-header-wrapper>
<nz-card>
<div se-container labelWidth="150" gutter="32" col="3">
<se-title class="text-center font-weight-bold text-xl">记账凭证
<button nz-button nzType="primary" [nzLoading]="service.http.loading" style="float: right;">打印</button>
</se-title>
<se label="帐套" required>
{{info?.vcltdcode}}
</se>
<se label="凭证类型" required>
{{info?.vctype}}
</se>
<se label="凭证日期" required>
{{info?.vctime}}
</se>
</div>
<st #st [data]="info?.faShowVOList" [columns]="columns" [footer]="footerTpl" bordered
[scroll]="{ x:'1200px',y: '420px' }" [page]="{ show: false }" [loading]="service.http.loading">
<ng-template #footerTpl let-s>
<ng-container *ngIf="st.count > 0">
<div style="display: flex;justify-content: flex-end;">
<div style="flex: 1;" class="text-left">合计:</div>
<div style="width: 150px;" class="text-right">{{info?.drmoney | currency}}</div>
<div style="width: 150px;" class="text-right">{{info?.crmoney | currency}}</div>
</div>
</ng-container>
</ng-template>
<ng-template st-row="auxVOList" let-item let-index="index" let-column="column">
<ng-container *ngFor="let auxVO of item.auxVOList">
{{ auxVO.auxLabel }}: {{ auxVO.auxValue }} <br>
</ng-container>
</ng-template>
</st>
<div se-container labelWidth="150" gutter="32" col="3" class="mt-md">
<se label="摘要">
{{info?.remarks}}
</se>
<se label="凭证流水号">
{{info?.createUserId}}
</se>
<se label="创建人">
{{info?.createUserId}}
</se>
</div>
</nz-card>

View File

@ -0,0 +1,57 @@
import { CurrencyPipe } from '@angular/common';
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { STData, STColumn, STRequestOptions } from '@delon/abc/st';
import { FreightAccountService } from '../../../services/freight-account.service';
@Component({
selector: 'app-voucher-detail',
templateUrl: './voucher-detail.component.html',
providers: [CurrencyPipe]
})
export class VoucherDetailComponent implements OnInit {
columns: STColumn[] = [
{ title: '摘要', index: 'remarks' },
{ title: '会计科目', index: 'subname' },
{ title: '辅助核算', render: 'auxVOList' },
{ title: '币种', index: 'currency', className: 'text-center' },
{
title: '借方金额',
index: 'drlocalmoney',
width: 150,
type: 'currency',
format: item => `${this.currencyPipe.transform(item.drlocalmoney)}`
},
{
title: '贷方金额',
index: 'crlocalmoney',
width: 150,
type: 'currency',
format: item => `${this.currencyPipe.transform(item.crlocalmoney)}`
}
];
id!: string;
info: any = { faShowVOList: [] };
constructor(public service: FreightAccountService, private currencyPipe: CurrencyPipe, private route: ActivatedRoute) {
this.id = route.snapshot.params.id;
}
ngOnInit(): void {
this.loadDetail(this.id);
}
loadDetail(id: string) {
this.service.request(this.service.$api_get_fico_vch__detail, { id }).subscribe(res => {
if (res) {
this.info = res;
}
console.log(res);
});
}
goBack() {
history.go(-1);
}
}

View File

@ -33,7 +33,7 @@
</div>
</div>
<st #st [data]="service.$mock_url" [columns]="columns"
<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] }"

View File

@ -1,3 +1,4 @@
import { CurrencyPipe } from '@angular/common';
import { Component, OnInit, ViewChild } from '@angular/core';
import { Router } from '@angular/router';
import { STComponent, STColumn, STRequestOptions, STChange } from '@delon/abc/st';
@ -10,7 +11,8 @@ import { FreightAccountService } from '../../services/freight-account.service';
@Component({
selector: 'app-voucher-management',
templateUrl: './voucher-management.component.html',
styleUrls: ['../../../commom/less/box.less']
styleUrls: ['../../../commom/less/box.less'],
providers: [CurrencyPipe]
})
export class VoucherManagementComponent implements OnInit {
@ViewChild('st', { static: true })
@ -25,23 +27,36 @@ export class VoucherManagementComponent implements OnInit {
_$expand = false;
selectedRows: any[] = [];
constructor(public service: FreightAccountService, private nzModalService: NzModalService, private router: Router) {}
constructor(
public service: FreightAccountService,
private nzModalService: NzModalService,
private router: Router,
private currencyPipe: CurrencyPipe
) {}
ngOnInit(): void {}
beforeReq = (requestOptions: STRequestOptions) => {
if (this.sf) {
Object.assign(requestOptions.body, {
...this.sf.value,
createtime: {
start: this.sf.value.createtime?.[0] || null,
end: this.sf.value.createtime?.[1] || null
},
invdate: {
start: this.sf.value.invdate?.[0] || null,
end: this.sf.value.invdate?.[1] || null
}
...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;
};
@ -54,19 +69,6 @@ export class VoucherManagementComponent implements OnInit {
}
}
addInvoice() {
if (this.selectedRows?.length <= 0) {
this.service.msgSrv.warning('请选择申请记录');
return;
}
const modal = this.nzModalService.create({
nzTitle: '收票信息',
nzContent: AddCollectionInvoiceModalComponent,
nzComponentParams: { i: { userId: 0 } },
nzFooter: null
});
}
/**
* 重置表单
*/
@ -92,7 +94,7 @@ export class VoucherManagementComponent implements OnInit {
hidden: true
}
},
inpinvcode: {
vccode: {
type: 'string',
title: '凭证号',
ui: {
@ -100,7 +102,7 @@ export class VoucherManagementComponent implements OnInit {
placeholder: '请输入'
}
},
ltdid: {
cno: {
type: 'string',
title: '客户',
ui: {
@ -111,7 +113,7 @@ export class VoucherManagementComponent implements OnInit {
},
default: ''
},
createtime: {
vctime: {
title: '凭证时间',
type: 'string',
ui: {
@ -119,7 +121,7 @@ export class VoucherManagementComponent implements OnInit {
format: 'yyyy-MM-dd'
} as SFDateWidgetSchema
},
inpinvc2ode: {
sourceCode: {
type: 'string',
title: '原始单号',
ui: {
@ -130,7 +132,7 @@ export class VoucherManagementComponent implements OnInit {
}
}
},
invtype: {
sourceType: {
type: 'string',
title: '原始单类型',
ui: {
@ -141,7 +143,7 @@ export class VoucherManagementComponent implements OnInit {
}
}
},
createtim2e: {
createTime: {
title: '创建时间',
type: 'string',
ui: {
@ -162,19 +164,25 @@ export class VoucherManagementComponent implements OnInit {
}
}
},
sts: {
vctype: {
type: 'string',
title: '凭证类型',
enum: [
{ value: null, label: '全部' },
{ value: 'WLW', label: 'WLW' },
{ value: 'CH', label: 'CH' },
{ value: 'YHY', label: 'YHY' },
{ value: 'KP', label: 'KP' }
],
ui: {
widget: 'dict-select',
params: { dictKey: 'refund:apply:status' },
widget: 'select',
placeholder: '请选择',
visibleIf: {
expand: (value: boolean) => value
}
}
},
s2ts: {
subid: {
type: 'string',
title: '科目',
ui: {
@ -186,8 +194,8 @@ export class VoucherManagementComponent implements OnInit {
}
}
},
remarks: {
type: 'string',
drmoney: {
type: 'number',
title: '借方金额',
ui: {
placeholder: '请输入',
@ -196,8 +204,8 @@ export class VoucherManagementComponent implements OnInit {
}
}
},
billCode: {
type: 'string',
crmoney: {
type: 'number',
title: '贷方金额',
ui: {
placeholder: '请输入',
@ -206,7 +214,7 @@ export class VoucherManagementComponent implements OnInit {
}
}
},
s2t2s: {
vcltdid: {
type: 'string',
title: '帐套',
ui: {
@ -218,19 +226,24 @@ export class VoucherManagementComponent implements OnInit {
}
}
},
s22t2s: {
sts: {
type: 'string',
title: '凭证状态',
enum: [
{ value: null, label: '全部' },
{ value: 0, label: '新建' },
{ value: 1, label: '待审核' },
{ value: 2, label: '已通过' }
],
ui: {
widget: 'dict-select',
params: { dictKey: 'refund:apply:status' },
widget: 'select',
placeholder: '请选择',
visibleIf: {
expand: (value: boolean) => value
}
}
},
feecode: {
importncnotes: {
type: 'string',
title: 'NC凭证',
ui: {
@ -240,7 +253,7 @@ export class VoucherManagementComponent implements OnInit {
}
}
},
feecsode: {
vc2code: {
type: 'string',
title: '汇总凭证号',
ui: {
@ -250,7 +263,7 @@ export class VoucherManagementComponent implements OnInit {
}
}
},
s22t2ss: {
importnc: {
type: 'string',
title: '导入NC',
ui: {
@ -262,9 +275,14 @@ export class VoucherManagementComponent implements OnInit {
}
}
},
s22t2s1s: {
isvc2: {
type: 'string',
title: '是否汇总',
enum: [
{ value: null, label: '全部' },
{ value: 0, label: '否' },
{ value: 1, label: '是' }
],
ui: {
widget: 'select',
placeholder: '请选择',
@ -279,28 +297,41 @@ export class VoucherManagementComponent implements OnInit {
private initST(): STColumn[] {
return [
{ title: '', index: 'key', type: 'checkbox' },
{ title: '凭证号', index: 'inpinvcode', type: 'link' },
{ title: '帐套', index: 'ltdid' },
{ title: '凭证时间', index: 'invdate', type: 'date' },
{ title: '凭证类型', index: 'invoiceno' },
{ title: '序号', index: 'invmoney' },
{ title: '摘要', index: 'invtax' },
{ title: '币种', index: 'invtype' },
{ title: '借方金额', index: 'hrto' },
{ title: '方金额', index: 'createtime', type: 'date' },
{ title: 'NC凭证', index: 'createbyname' },
{ title: '汇总凭证号', index: 'sts', width: 150 },
{ title: '凭证状态', index: 'sts' },
{ title: '创建时间', index: 'sts' },
{ title: '创建人', index: 'sts' },
{ title: '', index: 'key', type: 'checkbox', width: 60, className: 'text-center', fixed: 'left' },
{ title: '凭证号', index: 'id', type: 'link', width: 150 },
{ title: '帐套', index: 'vcltdid', width: 150 },
{ title: '凭证时间', index: 'vctime', type: 'date', width: 150 },
{ title: '凭证类型', index: 'vctype', enum: { WLW: 'WLW', CH: 'CH', YHY: 'YHY', KP: 'KP' }, width: 150 },
{ title: '序号', index: 'invmoney', width: 150, format: _ => '1' },
{ title: '摘要', index: 'remarks', width: 300 },
{ title: '币种', index: 'currency', width: 100 },
{
title: '方金额',
index: 'drmoney',
width: 120,
className: 'text-right',
format: item => `${this.currencyPipe.transform(item.armoney || 0)}`
},
{
title: '贷方金额',
index: 'crmoney',
width: 120,
className: 'text-right',
format: item => `${this.currencyPipe.transform(item.armoney || 0)}`
},
{ title: 'NC凭证', index: 'importncnotes', width: 150 },
{ title: '汇总凭证号', index: 'vc2id', width: 150 },
{ title: '凭证状态', index: 'sts', enum: { 0: '新建', 1: '待审核', 2: '已通过' }, width: 120 },
{ title: '创建时间', index: 'createTime', width: 140 },
{ title: '创建人', index: 'createUserId', width: 150 },
{
title: '操作',
width: '130px',
fixed: 'right',
buttons: [
{
text: '浏览'
text: '浏览',
click: (item: any) => this.router.navigate(['/financial-management/voucher-management/detail/' + item.id])
},
{
text: '修改'