This commit is contained in:
Taric Xin
2022-01-18 17:00:48 +08:00
parent 7d0d2fb7da
commit 09e1dd38f1
13 changed files with 369 additions and 64 deletions

View File

@ -1 +1,42 @@
<p>receipt-order works!</p>
<page-header-wrapper [title]="'收款单'">
</page-header-wrapper>
<nz-card class="search-box" nzBordered>
<div nz-row nzGutter="8">
<div nz-col [nzXl]="_$expand ? 24 : 17" [nzLg]="24" [nzSm]="24" [nzXs]="24">
<sf #sf [schema]="searchSchema"
[ui]="{ '*': { spanLabelFixed: 110,grid: { lg: 8, md: 12, sm: 12, xs: 24 } }}" [compact]="true"
[button]="'none'"></sf>
</div>
<div nz-col [nzXl]="_$expand ? 24 : 7" [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 nzType="primary" > 导出</button>
<button nz-button nzType="primary" > 导出核销</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>
<div class="d-flex align-items-center mb-md mt-md">
<button nz-button (click)="this.addInvoice()" nzType="primary">添加收款</button>
<button nz-button (click)="this.addInvoice()" nzType="primary">导入收款</button>
<div class="ml-md">
已选择
<strong class="text-primary">{{ selectedRows.length }}</strong> 张单
<a *ngIf="selectedRows.length > 0" (click)="st.clearCheck()" class="ml-lg">清空</a>
</div>
</div>
<st #st [data]="service.$api_get_payment_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)">
</st>
</nz-card>

View File

@ -1,25 +0,0 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { ReceiptOrderComponent } from './receipt-order.component';
describe('ReceiptOrderComponent', () => {
let component: ReceiptOrderComponent;
let fixture: ComponentFixture<ReceiptOrderComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ ReceiptOrderComponent ]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(ReceiptOrderComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -1,15 +1,270 @@
import { Component, OnInit } from '@angular/core';
import { Component, OnInit, ViewChild } from '@angular/core';
import { 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 { AddCollectionInvoiceModalComponent } from 'src/app/routes/ticket-management/components/input-invoice/add-collection-invoice-modal/add-collection-invoice-modal.component';
import { FreightAccountService } from '../../services/freight-account.service';
@Component({
selector: 'app-receipt-order',
templateUrl: './receipt-order.component.html',
styleUrls: ['./receipt-order.component.less']
styleUrls: ['../../../commom/less/box.less']
})
export class ReceiptOrderComponent implements OnInit {
@ViewChild('st', { static: true })
st!: STComponent;
@ViewChild('sf', { static: false })
sf!: SFComponent;
columns: STColumn[] = this.initST();
searchSchema: SFSchema = this.initSF();
constructor() { }
_$expand = false;
ngOnInit(): void {
selectedRows: any[] = [];
constructor(public service: FreightAccountService, private nzModalService: NzModalService, private router: Router) {}
ngOnInit(): void {}
beforeReq = (requestOptions: STRequestOptions) => {
if (this.sf) {
Object.assign(requestOptions.body, {
...this.sf.value
});
}
return requestOptions;
};
stChange(e: STChange): void {
switch (e.type) {
case 'checkbox':
this.selectedRows = e.checkbox!;
break;
}
}
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
});
}
/**
* 重置表单
*/
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
}
},
paycodes: {
type: 'string',
title: '收款单号',
ui: {
widget: 'select',
placeholder: '请选择'
}
},
ltdid: {
type: 'string',
title: '网络货运人',
ui: {
widget: 'select',
placeholder: '请选择',
allowClear: true,
asyncData: () => this.service.getNetworkFreightForwarder()
},
default: null
},
paycod1es: {
type: 'string',
title: '银行水单',
ui: {
widget: 'select',
placeholder: '请选择'
}
},
paytype: {
type: 'string',
title: '收款类型',
ui: {
widget: 'select',
placeholder: '请选择',
visibleIf: {
expand: (value: boolean) => value
}
}
},
paymode: {
type: 'string',
title: '收款方式',
ui: {
widget: 'select',
placeholder: '请选择',
visibleIf: {
expand: (value: boolean) => value
}
}
},
arto: {
type: 'string',
title: '付款人',
ui: {
widget: 'select',
placeholder: '请选择',
visibleIf: {
expand: (value: boolean) => value
}
}
},
orderS2n: {
type: 'string',
title: '收款状态',
ui: {
widget: 'dict-select',
params: { dictKey: 'refund:apply:status' },
placeholder: '请选择',
visibleIf: {
expand: (value: boolean) => value
}
}
},
paydate: {
title: '到账日期',
type: 'string',
ui: {
widget: 'sl-from-to-search',
format: 'yyyy-MM-dd',
visibleIf: {
expand: (value: boolean) => value
}
} as SFDateWidgetSchema
},
createTi1me: {
title: '创建时间',
type: 'string',
ui: {
widget: 'sl-from-to-search',
format: 'yyyy-MM-dd',
visibleIf: {
expand: (value: boolean) => value
}
} as SFDateWidgetSchema
},
billHCodes: {
type: 'string',
title: '订单号',
ui: {
widget: 'select',
placeholder: '请选择',
visibleIf: {
expand: (value: boolean) => value
}
}
},
feeHCodes: {
type: 'string',
title: '费用号',
ui: {
widget: 'select',
placeholder: '请选择',
visibleIf: {
expand: (value: boolean) => value
}
}
},
remarks: {
type: 'string',
title: '付款备注',
ui: {
placeholder: '请选择',
visibleIf: {
expand: (value: boolean) => value
}
}
}
}
};
}
private initST(): STColumn[] {
return [
{ title: '', index: 'key', type: 'checkbox' },
{ title: '收款单号', index: 'paycode', type: 'link' },
{ title: '网络货运人', index: 'ltdId' },
{ title: '到账日期', index: 'paydate', type: 'date', width: 140 },
{ title: '收款账户', index: 'call1N2o' },
{
title: '到账金额',
index: 'paymoney',
width: 120,
type: 'widget',
className: 'text-right',
widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.paymoney }) }
},
{
title: '核销金额',
index: 'paytype',
width: 120,
type: 'widget',
className: 'text-right',
widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.paymoney }) }
},
{
title: '预收金额',
index: 'paytype',
width: 120,
type: 'widget',
className: 'text-right',
widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.paymoney }) }
},
{ title: '银行类型', index: 'paytype' },
{ title: '收款类型', index: 'paymode' },
{ title: '收款方式', index: 'paymode' },
{ title: '付款人', index: 'hrto' },
{ title: '银行水单', index: 'callNo' },
{ title: '创建时间', index: 'createTime', type: 'date' },
{ title: '创建人', index: 'createUserId' },
{ title: '收款状态', index: 'payremarks' },
{ title: '收款备注', index: 'payremarks' },
{
title: '操作',
width: '90px',
buttons: [
{
text: '浏览',
click: item => this.router.navigate(['/ticket/input-invoice/detail/' + item.id])
},
{
text: '修改',
click: item => this.router.navigate(['/ticket/input-invoice/edit/1'])
}
]
}
];
}
}