This commit is contained in:
Taric Xin
2022-01-13 15:49:58 +08:00
parent a917c83275
commit 08617ecfa1
12 changed files with 348 additions and 69 deletions

View File

@ -1,14 +1,18 @@
import { CurrencyPipe } from '@angular/common';
import { Component, OnInit, ViewChild } from '@angular/core';
import { Router } from '@angular/router';
import { STComponent, STColumn, STChange, STRequestOptions } from '@delon/abc/st';
import { SFComponent, SFSchema, SFDateWidgetSchema } from '@delon/form';
import { ShipperBaseService } from '@shared';
import { NzModalService } from 'ng-zorro-antd/modal';
import { AccountDetailComponent } from 'src/app/shared/components/account-detail/account-detail.component';
import { FreightAccountService } from '../../services/freight-account.service';
@Component({
selector: 'app-driver-account',
templateUrl: './driver-account.component.html',
styleUrls: ['./driver-account.component.less']
styleUrls: ['./driver-account.component.less'],
providers: [CurrencyPipe]
})
export class DriverAccountComponent implements OnInit {
@ViewChild('st', { static: true })
@ -20,7 +24,12 @@ export class DriverAccountComponent implements OnInit {
columns: STColumn[] = this.initST();
_$expand = false;
constructor(public service: FreightAccountService, private router: Router) {}
constructor(
public service: FreightAccountService,
private router: Router,
private modal: NzModalService,
private currencyPipe: CurrencyPipe
) {}
ngOnInit(): void {}
@ -32,6 +41,16 @@ export class DriverAccountComponent implements OnInit {
return requestOptions;
};
showAccountDetail(item: any) {
this.modal.create({
nzTitle: '账户明细',
nzContent: AccountDetailComponent,
nzWidth: 600,
nzComponentParams: {},
nzFooter: null
});
}
/**
* 重置表单
*/
@ -146,10 +165,33 @@ export class DriverAccountComponent implements OnInit {
{ title: '网络货运人', index: 'ltdName' },
{ title: '银行类型', index: 'bankTypeLabel' },
{ title: '虚拟账户', index: 'virtualAccount' },
{ title: '可用余额', index: 'availableBalance' },
{ title: '冻结余额', index: 'freezeBalance' },
{ title: '本月累计提现金额', index: 'withdrawBalance', width: 150 },
{ title: '账户总余额', index: 'availableBalance' },
{
title: '可用余额',
index: 'availableBalance',
type: 'currency',
format: item => `${this.currencyPipe.transform(item.availableBalance)}`
},
{
title: '冻结余额',
index: 'freezeBalance',
type: 'currency',
format: item => `${this.currencyPipe.transform(item.availableBalance)}`
},
{
title: '本月累计提现金额',
index: 'withdrawBalance',
width: 150,
type: 'currency',
format: item => `${this.currencyPipe.transform(item.availableBalance)}`
},
{
title: '账户总余额',
index: 'availableBalance',
className: 'text-right',
type: 'link',
format: item => `${this.currencyPipe.transform(item.availableBalance)}`,
click: item => this.showAccountDetail(item)
},
{ title: '创建时间', index: 'createTime', type: 'date', width: 150 },
{
title: '操作',

View File

@ -50,6 +50,7 @@ export class FreightAccountComponent implements OnInit {
this.modal.create({
nzTitle: '账户明细',
nzContent: AccountDetailComponent,
nzWidth: 600,
nzComponentParams: {},
nzFooter: null
});

View File

@ -10,9 +10,9 @@
</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 (click)="resetSF()">重置</button>
<button nz-button> 导出</button>
<button nz-button> 导出明细</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>
@ -24,7 +24,8 @@
<nz-card class="content-box" nzBordered>
<div class="d-flex align-items-center mb-md mt-md">
<button nz-button (click)="this.addInvoice()" nzType="primary">添加发票</button>
<button nz-button nzType="primary">新建凭证</button>
<button nz-button nzType="primary">凭证导入</button>
<div class="ml-md">
已选择
<strong class="text-primary">{{ selectedRows.length }}</strong> 张发票

View File

@ -102,7 +102,7 @@ export class VoucherManagementComponent implements OnInit {
},
ltdid: {
type: 'string',
title: '网络货运人',
title: '客户',
ui: {
widget: 'select',
placeholder: '请选择',
@ -111,37 +111,37 @@ export class VoucherManagementComponent implements OnInit {
},
default: ''
},
invoiceno: {
createtime: {
title: '凭证时间',
type: 'string',
title: '发票号码',
ui: {
widget: 'sl-from-to-search',
format: 'yyyy-MM-dd'
} as SFDateWidgetSchema
},
inpinvc2ode: {
type: 'string',
title: '原始单号',
ui: {
autocomplete: 'off',
placeholder: '请输入'
}
},
invtype: {
type: 'string',
title: '发票类型',
ui: {
widget: 'dict-select',
params: { dictKey: 'refund:apply:status' },
placeholder: '请选择',
visibleIf: {
expand: (value: boolean) => value
}
}
},
hrto: {
type: 'string',
title: '销售方',
ui: {
placeholder: '请输入',
visibleIf: {
expand: (value: boolean) => value
}
}
},
createtime: {
invtype: {
type: 'string',
title: '原始单类型',
ui: {
widget: 'select',
placeholder: '请选择',
visibleIf: {
expand: (value: boolean) => value
}
}
},
createtim2e: {
title: '创建时间',
type: 'string',
ui: {
@ -152,9 +152,19 @@ export class VoucherManagementComponent implements OnInit {
}
} as SFDateWidgetSchema
},
inpinvcosde: {
type: 'string',
title: '凭证摘要',
ui: {
placeholder: '请输入',
visibleIf: {
expand: (value: boolean) => value
}
}
},
sts: {
type: 'string',
title: '收票状态',
title: '凭证类型',
ui: {
widget: 'dict-select',
params: { dictKey: 'refund:apply:status' },
@ -164,12 +174,13 @@ export class VoucherManagementComponent implements OnInit {
}
}
},
invdate: {
s2ts: {
type: 'string',
title: '发票日期',
title: '科目',
ui: {
widget: 'sl-from-to-search',
format: 'yyyy-MM-dd',
widget: 'dict-select',
params: { dictKey: 'refund:apply:status' },
placeholder: '请选择',
visibleIf: {
expand: (value: boolean) => value
}
@ -177,7 +188,7 @@ export class VoucherManagementComponent implements OnInit {
},
remarks: {
type: 'string',
title: '收票备注',
title: '借方金额',
ui: {
placeholder: '请输入',
visibleIf: {
@ -187,7 +198,7 @@ export class VoucherManagementComponent implements OnInit {
},
billCode: {
type: 'string',
title: '订单号',
title: '贷方金额',
ui: {
placeholder: '请输入',
visibleIf: {
@ -195,15 +206,72 @@ export class VoucherManagementComponent implements OnInit {
}
}
},
s2t2s: {
type: 'string',
title: '帐套',
ui: {
widget: 'dict-select',
params: { dictKey: 'refund:apply:status' },
placeholder: '请选择',
visibleIf: {
expand: (value: boolean) => value
}
}
},
s22t2s: {
type: 'string',
title: '凭证状态',
ui: {
widget: 'dict-select',
params: { dictKey: 'refund:apply:status' },
placeholder: '请选择',
visibleIf: {
expand: (value: boolean) => value
}
}
},
feecode: {
type: 'string',
title: '费用号',
title: 'NC凭证',
ui: {
placeholder: '请输入',
visibleIf: {
expand: (value: boolean) => value
}
}
},
feecsode: {
type: 'string',
title: '汇总凭证号',
ui: {
placeholder: '请输入',
visibleIf: {
expand: (value: boolean) => value
}
}
},
s22t2ss: {
type: 'string',
title: '导入NC',
ui: {
widget: 'dict-select',
params: { dictKey: 'refund:apply:status' },
placeholder: '请选择',
visibleIf: {
expand: (value: boolean) => value
}
}
},
s22t2s1s: {
type: 'string',
title: '是否汇总',
ui: {
widget: 'select',
placeholder: '请选择',
visibleIf: {
expand: (value: boolean) => value
}
}
}
}
};
@ -212,27 +280,34 @@ 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: '创建人', index: 'createbyname' },
{ title: '收票状态', index: 'sts' },
{ 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' },
{ title: '凭证状态', index: 'sts' },
{ title: '创建时间', index: 'sts' },
{ title: '创建人', index: 'sts' },
{
title: '操作',
buttons: [
{
text: '浏览',
click: item => this.router.navigate(['/ticket/input-invoice/detail/' + item.id])
text: '浏览'
},
{
text: '修改',
click: item => this.router.navigate(['/ticket/input-invoice/edit/1'])
text: '修改'
},
{
text: '删除 '
},
{
text: '提交'
}
]
}