This commit is contained in:
Taric Xin
2022-01-07 13:54:36 +08:00
parent 4400e545aa
commit b39118da5e
6 changed files with 217 additions and 29 deletions

View File

@ -14,26 +14,42 @@
[button]="'none'"></sf>
</div>
<div nz-col [nzXl]="24" [nzLg]="24" [nzSm]="24" [nzXs]="24" class="text-right">
<button nz-button nzType="primary" [nzLoading]="service.http.loading" >保 存</button>
<button nz-button nzType="primary" [nzLoading]="service.http.loading" >提 交</button>
<button nz-button nzType="primary" [nzLoading]="service.http.loading">保 存</button>
<button nz-button nzType="primary" [nzLoading]="service.http.loading">提 交</button>
</div>
</div>
</nz-card>
<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 #searchSf [schema]="searchSchema"
[ui]="{ '*': { spanLabelFixed: 90,grid: { lg: 8, md: 12, sm: 12, xs: 24 } }}" [compact]="true"
[button]="'none'"></sf>
<nz-card class="search-box" nzBordered nzTitle="费用信息">
<nz-card class="search-box">
<div nz-row nzGutter="8">
<div nz-col [nzXl]="_$expand ? 24 : 18" [nzLg]="24" [nzSm]="24" [nzXs]="24">
<sf #searchSf [schema]="searchSchema"
[ui]="{ '*': { spanLabelFixed: 90,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.expend-options]="_$expand"
class="text-right">
<button nz-button nzType="primary" [nzLoading]="service.http.loading" (click)="st?.load(1)">查询</button>
<button nz-button nzType="link" (click)="expandToggle()">
{{ !_$expand ? '展开' : '收起' }}
<i nz-icon [nzType]="!_$expand ? 'down' : 'up'"></i>
</button>
</div>
</div>
<div nz-col [nzXl]="_$expand ? 24 : 6" [nzLg]="24" [nzSm]="24" [nzXs]="24" [class.expend-options]="_$expand"
class="text-right">
<button nz-button nzType="primary" [nzLoading]="service.http.loading" (click)="st?.load(1)">查询</button>
<button nz-button nzType="link" (click)="expandToggle()">
{{ !_$expand ? '展开' : '收起' }}
<i nz-icon [nzType]="!_$expand ? 'down' : 'up'"></i>
</button>
</nz-card>
<nz-card class="content-box">
<div class="d-flex align-items-center mb-md mt-sm">
<button nz-button nzType="primary" (click)="addCostDetailAction()">添 加</button>
<button nz-button nzType="primary">删 除</button>
</div>
</div>
<st #st [data]="service.$api_get_invoice_requested_order_detail" [columns]="columns" size="small" bordered
[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: '200px' }" (change)="stChange($event)">
</st>
</nz-card>
</nz-card>

View File

@ -1,9 +1,10 @@
import { Component, OnInit, ViewChild } from '@angular/core';
import { Router } from '@angular/router';
import { STComponent, STColumn } from '@delon/abc/st';
import { STComponent, STColumn, STRequestOptions, STChange } from '@delon/abc/st';
import { SFComponent, SFSchema, SFDateWidgetSchema } from '@delon/form';
import { NzModalService } from 'ng-zorro-antd/modal';
import { TicketService } from '../../../services/ticket.service';
import { AddCostDetailComponent } from '../add-cost-detail/add-cost-detail.component';
@Component({
selector: 'app-edit-collection-invoice',
@ -28,6 +29,38 @@ export class EditCollectionInvoiceComponent implements OnInit {
ngOnInit(): void {}
beforeReq = (requestOptions: STRequestOptions) => {
if (this.searchSf) {
Object.assign(requestOptions.body, { ...this.searchSf.value });
}
return requestOptions;
};
stChange(e: STChange): void {
switch (e.type) {
case 'checkbox':
this.selectedRows = e.checkbox!;
break;
}
}
addCostDetailAction() {
const modal = this.nzModalService.create({
nzTitle: '添加核销明细',
nzContent: AddCostDetailComponent,
nzWidth: 850,
nzOkText: '保存',
nzOnOk: com => {
return false;
}
});
modal.afterClose.subscribe(res => {
if (res) {
this.st.load();
}
});
}
goBack() {
history.go(-1);
}
@ -161,17 +194,16 @@ export class EditCollectionInvoiceComponent implements OnInit {
private initST(): STColumn[] {
return [
{ title: '', index: 'key', type: 'checkbox' },
{ title: '收票单号', index: 'no', type: 'link' },
{ title: '网络货运人', index: 'no' },
{ title: '发票日期', index: 'no', type: 'date' },
{ title: '发票号', index: 'callNo' },
{ title: '发票金额', index: 'callNo' },
{ title: '税额', render: 'call1No' },
{ title: '发票类型', render: 'call1N2o' },
{ title: '销售方', index: 'callNo' },
{ title: '创建时间', index: 'updatedAt', type: 'date' },
{ title: '创建人', index: 'updatedAt' },
{ title: '收票状态', index: 'updatedAt' }
{ title: '号', index: 'no', type: 'link' },
{ title: '费用号', index: 'no' },
{ title: '费用日期', index: 'no', type: 'date' },
{ title: '订单号', index: 'callNo' },
{ title: '订单日期', index: 'callNo' },
{ title: '结算客户', render: 'call1No' },
{ title: '费用科目', render: 'call1N2o' },
{ title: '费用金额', index: 'callNo' },
{ title: '收票金额', index: 'updatedAt', type: 'date' },
{ title: '收票税额', index: 'updatedAt' }
];
}
}