200 lines
5.5 KiB
TypeScript
200 lines
5.5 KiB
TypeScript
import { Component, OnInit, ViewChild } from '@angular/core';
|
|
import { Router } from '@angular/router';
|
|
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';
|
|
import { TransactionDetailsComponent } from './transaction-details/transaction-details.component';
|
|
|
|
@Component({
|
|
selector: 'app-etc-invoiced-list',
|
|
templateUrl: './etc-invoiced-list.component.html',
|
|
styleUrls: ['../../../commom/less/box.less']
|
|
})
|
|
export class ETCInvoicedListComponent implements OnInit {
|
|
@ViewChild('st', { static: true })
|
|
st!: STComponent;
|
|
@ViewChild('sf', { static: false })
|
|
sf!: SFComponent;
|
|
columns: STColumn[] = this.initST();
|
|
searchSchema: SFSchema = this.initSF();
|
|
|
|
_$expand = false;
|
|
constructor(public service: TicketService, private nzModalService: NzModalService, private router: Router) {}
|
|
|
|
ngOnInit(): void {}
|
|
|
|
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: 900,
|
|
nzComponentParams: { data: [] },
|
|
nzOnOk: com => {
|
|
console.log(com.selectedData);
|
|
},
|
|
nzOkText: '导出'
|
|
});
|
|
modal.afterClose.subscribe(res => {
|
|
if (res) {
|
|
this.st.load();
|
|
}
|
|
});
|
|
}
|
|
|
|
/**
|
|
* 重置表单
|
|
*/
|
|
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
|
|
}
|
|
},
|
|
wayBillCode: {
|
|
type: 'string',
|
|
title: '运单号',
|
|
ui: {
|
|
autocomplete: 'off'
|
|
}
|
|
},
|
|
billCode: {
|
|
type: 'string',
|
|
title: '订单号',
|
|
ui: {
|
|
autocomplete: 'off'
|
|
}
|
|
},
|
|
billType: {
|
|
type: 'string',
|
|
title: '订单类型',
|
|
ui: {
|
|
widget: 'dict-select',
|
|
params: { dictKey: 'bill:type' },
|
|
placeholder: '请选择'
|
|
}
|
|
},
|
|
invoicingStatus: {
|
|
type: 'string',
|
|
title: '开票状态',
|
|
ui: {
|
|
widget: 'dict-select',
|
|
params: { dictKey: 'etc:invoicing:status' },
|
|
placeholder: '请选择',
|
|
visibleIf: {
|
|
expand: (value: boolean) => value
|
|
}
|
|
},
|
|
default: ''
|
|
},
|
|
shipperId: {
|
|
type: 'string',
|
|
title: '托运人',
|
|
ui: {
|
|
widget: 'select',
|
|
serverSearch: true,
|
|
searchDebounceTime: 300,
|
|
searchLoadingText: '搜索中...',
|
|
allowClear: true,
|
|
onSearch: (q: any) => this.service.getEnterpriceList({ enterpriseName: q }),
|
|
visibleIf: {
|
|
expand: (value: boolean) => value
|
|
}
|
|
}
|
|
},
|
|
enterpriseInfoId: {
|
|
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: 'wayBillCode' },
|
|
{ title: '订单号', index: 'billCode' },
|
|
{
|
|
title: '开票状态',
|
|
index: 'invoicingStatus',
|
|
type: 'enum',
|
|
enum: { '0': '待开票', '1': '开票中', '2': '已开票', '3': '开票失败' },
|
|
width: 120
|
|
},
|
|
{ title: '订单类型', index: 'billTypeLabel', width: 120 },
|
|
{ title: '装货地', index: 'loadingPlace' },
|
|
{ title: '卸货地', index: 'dischargePlace' },
|
|
{ title: '司机信息', render: 'call1No' },
|
|
{ title: '车辆信息', render: 'call12No' },
|
|
{ title: '托运人', index: 'shipperAppUserName' },
|
|
{ title: '网络货运人', index: 'enterpriseInfoName' },
|
|
{
|
|
title: '开票金额',
|
|
index: 'invoicingAmount',
|
|
width: 100,
|
|
type: 'widget',
|
|
className: 'text-right',
|
|
widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.invoicingAmount }) }
|
|
},
|
|
{
|
|
title: '开票张数',
|
|
index: 'invoicingNumber',
|
|
width: 100,
|
|
type: 'widget',
|
|
className: 'text-right',
|
|
widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.invoicingNumber }) }
|
|
},
|
|
{ title: '申请时间', index: 'orderReceivingTime', type: 'date' },
|
|
{
|
|
title: '操作',
|
|
className: 'text-center',
|
|
buttons: [
|
|
{
|
|
text: '交易明细',
|
|
click: item => this.showDetail(item)
|
|
}
|
|
]
|
|
}
|
|
];
|
|
}
|
|
// 导出
|
|
exprot() {
|
|
this.service.exportStart({ ...this.sf?.value, pageSize: -1 }, this.service.$api_get_asyncExportEtcApplyRecordList);
|
|
}
|
|
}
|