edit
This commit is contained in:
@ -3,24 +3,35 @@
|
||||
|
||||
<nz-card class="search-box" nzBordered>
|
||||
<div nz-row nzGutter="8">
|
||||
<div nz-col [nzXl]="18" [nzLg]="24" [nzSm]="24" [nzXs]="24">
|
||||
<div nz-col [nzXl]="_$expand ? 24 : 18" [nzLg]="24" [nzSm]="24" [nzXs]="24">
|
||||
<sf #sf [schema]="searchSchema"
|
||||
[ui]="{ '*': { spanLabelFixed: 90,grid: { lg: 8, md: 12, sm: 12, xs: 24 } }}" [compact]="true"
|
||||
[button]="'none'"></sf>
|
||||
</div>
|
||||
<div nz-col [nzXl]="6" [nzLg]="24" [nzMd]="24" [nzSm]="24" [nzXs]="24" class="text-right">
|
||||
<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 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]="url" [columns]="columns"
|
||||
[req]="{ method: 'POST', allInBody: true, reName: { pi: 'pageIndex', ps: 'pageSize' }, params: reqParams }"
|
||||
<st #st [data]="service.$mock_url" [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: '400px' }" (change)="stChange($event)"></st>
|
||||
[loading]="service.http.loading" [scroll]="{ x:'1200px',y: '400px' }">
|
||||
<ng-template st-row="call1No" let-item let-index="index" let-column="column">
|
||||
张三<br>13812345678
|
||||
</ng-template>
|
||||
<ng-template st-row="call12No" let-item let-index="index" let-column="column">
|
||||
粤B88888<br>张三
|
||||
</ng-template>
|
||||
</st>
|
||||
</nz-card>
|
||||
@ -1,13 +0,0 @@
|
||||
:host::ng-deep {
|
||||
.search-box {
|
||||
.ant-card-body {
|
||||
padding-bottom: 18px;
|
||||
}
|
||||
}
|
||||
|
||||
.content-box {
|
||||
.ant-card-body {
|
||||
padding-top: 16px;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,6 +1,6 @@
|
||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
import { STComponent, STColumn, STChange } from '@delon/abc/st';
|
||||
import { STComponent, STColumn, STChange, STRequestOptions } from '@delon/abc/st';
|
||||
import { SFComponent, SFSchema } from '@delon/form';
|
||||
import { NzModalService } from 'ng-zorro-antd/modal';
|
||||
import { TicketService } from '../../services/ticket.service';
|
||||
@ -9,107 +9,35 @@ import { TransactionDetailsComponent } from './transaction-details/transaction-d
|
||||
@Component({
|
||||
selector: 'app-etc-invoiced-list',
|
||||
templateUrl: './etc-invoiced-list.component.html',
|
||||
styleUrls: ['./etc-invoiced-list.component.less']
|
||||
styleUrls: ['../../../commom/less/box.less']
|
||||
})
|
||||
export class ETCInvoicedListComponent implements OnInit {
|
||||
url = `/rule?_allow_anonymous=true`;
|
||||
@ViewChild('st', { static: true })
|
||||
st!: STComponent;
|
||||
@ViewChild('sf', { static: false })
|
||||
sf!: SFComponent;
|
||||
columns: STColumn[] = [
|
||||
{ title: '运单号', index: 'no' },
|
||||
{ title: '开票状态', index: 'callNo' },
|
||||
{ title: '业务方', index: 'callNo' },
|
||||
{ title: '业务方税号', index: 'callNo' },
|
||||
{ title: '开票金额', index: 'callNo' },
|
||||
{ title: '发票张数', index: 'callNo' },
|
||||
{ title: '申请时间', index: 'updatedAt', type: 'date' },
|
||||
{
|
||||
title: '操作',
|
||||
buttons: [
|
||||
{
|
||||
text: '交易明细',
|
||||
click: item => this.showDetail(item)
|
||||
}
|
||||
]
|
||||
}
|
||||
];
|
||||
searchSchema: SFSchema = {
|
||||
properties: {
|
||||
orderSn: {
|
||||
type: 'string',
|
||||
title: '运单号',
|
||||
ui: {
|
||||
autocomplete: 'off'
|
||||
}
|
||||
},
|
||||
receiveName: {
|
||||
type: 'string',
|
||||
title: '开票状态',
|
||||
enum: [
|
||||
{ label: '全部', value: '' },
|
||||
{ label: '待受理', value: '待受理' },
|
||||
{ label: '待开票', value: '待开票' },
|
||||
{ label: '开票中', value: '开票中' },
|
||||
{ label: '已开票', value: '已开票' },
|
||||
{ label: '已撤销', value: '已撤销' },
|
||||
{ label: '已拒绝', value: '已拒绝' }
|
||||
],
|
||||
ui: {
|
||||
widget: 'select',
|
||||
placeholder: '请选择',
|
||||
change: (i: any) => {
|
||||
this.sf.value.receiveName = i;
|
||||
this.sf?.setValue('/receiveName', i);
|
||||
}
|
||||
},
|
||||
default: ''
|
||||
},
|
||||
receiveName2: {
|
||||
type: 'string',
|
||||
title: '业务方',
|
||||
enum: [
|
||||
{ label: '全部', value: '' },
|
||||
{ label: '待受理', value: '待受理' },
|
||||
{ label: '待开票', value: '待开票' },
|
||||
{ label: '开票中', value: '开票中' },
|
||||
{ label: '已开票', value: '已开票' },
|
||||
{ label: '已撤销', value: '已撤销' },
|
||||
{ label: '已拒绝', value: '已拒绝' }
|
||||
],
|
||||
ui: {
|
||||
widget: 'select',
|
||||
placeholder: '请选择',
|
||||
change: (i: any) => {
|
||||
this.sf.value.receiveName = i;
|
||||
this.sf?.setValue('/receiveName', i);
|
||||
}
|
||||
},
|
||||
default: ''
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
reqParams = {};
|
||||
columns: STColumn[] = this.initST();
|
||||
searchSchema: SFSchema = this.initSF();
|
||||
|
||||
_$expand = false;
|
||||
constructor(public service: TicketService, private nzModalService: NzModalService, private router: Router) {}
|
||||
|
||||
ngOnInit(): void {}
|
||||
|
||||
stChange(e: STChange): void {
|
||||
switch (e.type) {
|
||||
case 'filter':
|
||||
this.st.load();
|
||||
break;
|
||||
beforeReq = (requestOptions: STRequestOptions) => {
|
||||
if (this.sf) {
|
||||
Object.assign(requestOptions.body, {
|
||||
...this.sf.value
|
||||
});
|
||||
}
|
||||
}
|
||||
return requestOptions;
|
||||
};
|
||||
|
||||
showDetail(item: any) {
|
||||
const modal = this.nzModalService.create({
|
||||
nzTitle: '运单交易明细',
|
||||
nzContent: TransactionDetailsComponent,
|
||||
nzWidth: 800,
|
||||
nzWidth: 900,
|
||||
nzComponentParams: { data: [] },
|
||||
nzOnOk: com => {
|
||||
console.log(com.selectedData);
|
||||
@ -126,5 +54,117 @@ export class ETCInvoicedListComponent implements OnInit {
|
||||
*/
|
||||
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
|
||||
}
|
||||
},
|
||||
orderSn: {
|
||||
type: 'string',
|
||||
title: '运单号',
|
||||
ui: {
|
||||
autocomplete: 'off'
|
||||
}
|
||||
},
|
||||
order2Sn: {
|
||||
type: 'string',
|
||||
title: '订单号',
|
||||
ui: {
|
||||
autocomplete: 'off'
|
||||
}
|
||||
},
|
||||
order2S2n: {
|
||||
type: 'string',
|
||||
title: '订单类型',
|
||||
ui: {
|
||||
widget: 'dict-select',
|
||||
params: { dictKey: 'refund:apply:status' },
|
||||
placeholder: '请选择'
|
||||
}
|
||||
},
|
||||
receiveName: {
|
||||
type: 'string',
|
||||
title: '开票状态',
|
||||
ui: {
|
||||
widget: 'dict-select',
|
||||
params: { dictKey: 'refund:apply:status' },
|
||||
placeholder: '请选择',
|
||||
visibleIf: {
|
||||
expand: (value: boolean) => value
|
||||
}
|
||||
},
|
||||
default: ''
|
||||
},
|
||||
receiveName2: {
|
||||
type: 'string',
|
||||
title: '托运人',
|
||||
enum: [{ label: '全部', value: '' }],
|
||||
ui: {
|
||||
widget: 'select',
|
||||
placeholder: '请选择',
|
||||
visibleIf: {
|
||||
expand: (value: boolean) => value
|
||||
}
|
||||
},
|
||||
default: ''
|
||||
},
|
||||
ltdId: {
|
||||
type: 'string',
|
||||
title: '网络货运人',
|
||||
ui: {
|
||||
widget: 'select',
|
||||
placeholder: '请选择',
|
||||
allowClear: true,
|
||||
visibleIf: {
|
||||
expand: (value: boolean) => value
|
||||
},
|
||||
asyncData: () => this.service.getNetworkFreightForwarder()
|
||||
},
|
||||
default: ''
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private initST(): STColumn[] {
|
||||
return [
|
||||
{ title: '运单号', index: 'no' },
|
||||
{ title: '订单号', index: 'no' },
|
||||
{ title: '开票状态', index: 'callNo' },
|
||||
{ title: '订单类型', index: 'callNo' },
|
||||
{ title: '装货地', index: 'callNo' },
|
||||
{ title: '卸货地', index: 'callNo' },
|
||||
{ title: '司机信息', render: 'call1No' },
|
||||
{ title: '车辆信息', render: 'call12No' },
|
||||
{ title: '托运人', index: 'callNo' },
|
||||
{ title: '网络货运人', index: 'callNo' },
|
||||
{ title: '开票金额', index: 'callNo' },
|
||||
{ title: '开票张数', index: 'callNo' },
|
||||
{ title: '申请时间', index: 'updatedAt', type: 'date' },
|
||||
{
|
||||
title: '操作',
|
||||
buttons: [
|
||||
{
|
||||
text: '交易明细',
|
||||
click: item => this.showDetail(item)
|
||||
}
|
||||
]
|
||||
}
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@ -9,8 +9,8 @@
|
||||
</div>
|
||||
|
||||
<st #st [data]="url" [columns]="columns" bordered size="small"
|
||||
[req]="{ method: 'POST', allInBody: true, reName: { pi: 'pageIndex', ps: 'pageSize' }, params: reqParams }"
|
||||
[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:'756px',y: '400px' }" (change)="stChange($event)"></st>
|
||||
[loading]="service.http.loading" [scroll]="{ x:'860px',y: '400px' }"></st>
|
||||
</div>
|
||||
@ -1,14 +1,13 @@
|
||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
import { STComponent, STColumn, STChange } from '@delon/abc/st';
|
||||
import { STComponent, STColumn, STChange, STRequestOptions } from '@delon/abc/st';
|
||||
import { SFComponent, SFDateWidgetSchema, SFSchema } from '@delon/form';
|
||||
import { NzModalService } from 'ng-zorro-antd/modal';
|
||||
import { TicketService } from '../../../services/ticket.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-transaction-details',
|
||||
templateUrl: './transaction-details.component.html',
|
||||
styleUrls: ['./transaction-details.component.less']
|
||||
templateUrl: './transaction-details.component.html'
|
||||
})
|
||||
export class TransactionDetailsComponent implements OnInit {
|
||||
data = [];
|
||||
@ -41,11 +40,7 @@ export class TransactionDetailsComponent implements OnInit {
|
||||
],
|
||||
ui: {
|
||||
widget: 'select',
|
||||
placeholder: '请选择',
|
||||
change: (i: any) => {
|
||||
this.sf.value.receiveName = i;
|
||||
this.sf?.setValue('/receiveName', i);
|
||||
}
|
||||
placeholder: '请选择'
|
||||
},
|
||||
default: ''
|
||||
},
|
||||
@ -53,8 +48,7 @@ export class TransactionDetailsComponent implements OnInit {
|
||||
title: '交易时间',
|
||||
type: 'string',
|
||||
ui: {
|
||||
widget: 'date',
|
||||
mode: 'range',
|
||||
widget: 'sl-from-to-search',
|
||||
format: 'yyyy-MM-dd'
|
||||
} as SFDateWidgetSchema
|
||||
}
|
||||
@ -67,13 +61,14 @@ export class TransactionDetailsComponent implements OnInit {
|
||||
|
||||
ngOnInit(): void {}
|
||||
|
||||
stChange(e: STChange): void {
|
||||
switch (e.type) {
|
||||
case 'filter':
|
||||
this.st.load();
|
||||
break;
|
||||
beforeReq = (requestOptions: STRequestOptions) => {
|
||||
if (this.sf) {
|
||||
Object.assign(requestOptions.body, {
|
||||
...this.sf.value
|
||||
});
|
||||
}
|
||||
}
|
||||
return requestOptions;
|
||||
};
|
||||
|
||||
/**
|
||||
* 重置表单
|
||||
|
||||
Reference in New Issue
Block a user