This commit is contained in:
wangshiming
2022-05-10 10:41:01 +08:00
parent de8bb56dad
commit 0936b30387
11 changed files with 284 additions and 100 deletions

View File

@ -41,7 +41,12 @@ export class ETCInvoicedLogsComponent extends BasicTableComponent {
}
return requestOptions;
};
afterRes = (data: any[], rawData?: any) => {
return data.map(item => ({
...item,
disabled: item.isCreationInpinv == '1'
}));
};
routeTo(item: any) {
return;
this.router.navigate(['/ticket/invoice-requested-detail/1']);
@ -135,6 +140,7 @@ export class ETCInvoicedLogsComponent extends BasicTableComponent {
private initST(): STColumn[] {
return [
{ title: '', type: 'checkbox', fixed: 'left', width: '50px', className: 'text-center' },
{ title: '发票号码', index: 'invoiceNum', width: 100, type: 'link', click: item => this.routeTo(item) },
{ title: '发票代码', index: 'invoiceCode', width: 130 },
{ title: '订单号', index: 'billCode', width: 180 },
@ -183,7 +189,46 @@ export class ETCInvoicedLogsComponent extends BasicTableComponent {
{ title: '交易时间', index: 'exTime', type: 'date', width: 150 },
{ title: '开票日期', index: 'invoiceMakeTime', type: 'date', width: 150 },
{ title: '销售方', index: 'sellerName', width: 150 },
{ title: '网络货运人', index: 'enterpriseInfoName', width: 220 }
{ title: '网络货运人', index: 'enterpriseInfoName', width: 220 },
{
title: '操作',
width: '120px',
fixed: 'right',
className: 'text-center',
buttons: [
{
text: '开票',
acl: { ability: ['TICKET-CANCELLATION-view'] },
click: item => {
this.batchInvoice(item)
}
}
]
}
];
}
get selectedRows() {
return this.st?.list.filter(item => item.checked) || [];
}
batchInvoice(item?: { id: any; }) {
let params: any[] = [];
if(item) {
params.push(item.id);
} else {
if (this.selectedRows.length <= 0) {
this.service.msgSrv.error('请选择订单!');
return;
}
this.selectedRows.forEach(item => {
params.push(item.id);
});
}
this.service.request(this.service.$api_createFicoInpinv, params).subscribe(res => {
if (res) {
this.service.msgSrv.success('开票成功!')
this.st.load(1);
}
});
}
}