开票申请

This commit is contained in:
Taric Xin
2021-12-23 16:44:20 +08:00
parent e974ca1593
commit 386271289c
10 changed files with 257 additions and 91 deletions

View File

@ -5,6 +5,7 @@ import { SFComponent, SFSchema, SFDateWidgetSchema, SFUISchema } from '@delon/fo
import { NzMessageService } from 'ng-zorro-antd/message';
import { NzModalService } from 'ng-zorro-antd/modal';
import { TicketService } from '../../services/ticket.service';
import { RequestedInvoiceModalComponent } from './requested-invoice-modal/requested-invoice-modal.component';
@Component({
selector: 'app-invoice-requested',
@ -17,8 +18,8 @@ export class InvoiceRequestedComponent implements OnInit {
st!: STComponent;
@ViewChild('sf', { static: false })
sf!: SFComponent;
@ViewChild('auditModal', { static: false })
auditModal!: any;
@ViewChild('rejectModal', { static: false })
rejectModal!: any;
columns: STColumn[] = this.initST();
searchSchema: SFSchema = this.initSF();
@ -52,14 +53,10 @@ export class InvoiceRequestedComponent implements OnInit {
add(): void {}
routeTo(item: any) {
this.router.navigate(['/ticket/invoice-requested/detail/1']);
}
auditAction(item: any) {
rejectAction(item: any[]) {
const modal = this.nzModalService.create({
nzTitle: '审核',
nzContent: this.auditModal,
nzTitle: '驳回',
nzContent: this.rejectModal,
nzFooter: [
{
label: '拒绝',
@ -98,6 +95,64 @@ export class InvoiceRequestedComponent implements OnInit {
});
}
batchRequested() {
if (this.selectedRows?.length <= 0) {
this.service.msgSrv.warning('请选择订单');
return;
}
const modal = this.nzModalService.create({
nzTitle: '开票',
nzContent: '确认对所有申请单进行批量开票?',
nzFooter: [
{
type: 'default',
label: '手工处理',
onClick: () => {
modal.destroy();
}
},
{
type: 'primary',
label: '自动开票',
onClick: () => {
modal.destroy();
}
}
]
});
}
requestedInvoiceAction(item: any) {
const modal = this.nzModalService.create({
nzTitle: '开票',
nzContent: RequestedInvoiceModalComponent,
nzWidth: 1200,
nzFooter: [
{
type: 'default',
label: '移除',
onClick: (com) => {
com?.removeOrder(com.data)
}
},
{
type: 'default',
label: '手工处理',
onClick: () => {
modal.destroy();
}
},
{
type: 'primary',
label: '自动开票',
onClick: () => {
modal.destroy();
}
}
]
});
}
/**
* 重置表单
*/
@ -242,33 +297,35 @@ export class InvoiceRequestedComponent implements OnInit {
private initST(): STColumn[] {
return [
{ title: '', index: 'key', type: 'checkbox' },
{ title: '申请编号', index: 'no' },
{ title: '网络货运人', index: 'callNo' },
{ title: '购买方', index: 'callNo' },
{ title: '订单数', index: 'callNo' },
{ title: '申请金额', index: 'callNo' },
{ title: '运输费', index: 'callNo' },
{ title: '附加费', index: 'callNo' },
{ title: '已开票金额', index: 'callNo' },
{ title: '开户行', index: 'callNo' },
{ title: '银行账户', index: 'callNo' },
{ title: '注册地址', index: 'callNo' },
{ title: '注册电话', index: 'callNo' },
{ title: '服务名称', index: 'callNo' },
{ title: '销货清单', index: 'callNo' },
{ title: '其他要求', index: 'callNo' },
{ title: '申请人', index: 'callNo' },
{ title: '申请时间', index: 'updatedAt', type: 'date' },
{ title: '申请编号', index: 'no', width: 150, format: item => `VP202110012313</br><label class="text-primary">待受理</label>` },
{ title: '网络货运人', index: 'callNo', width: 120 },
{ title: '购买方', index: 'callNo', width: 90 },
{ title: '订单数', index: 'callNo', width: 90 },
{ title: '申请金额', index: 'callNo', width: 100 },
{ title: '运输费', index: 'callNo', width: 90 },
{ title: '附加费', index: 'callNo', width: 90 },
{ title: '已开票金额', index: 'callNo', width: 120 },
{ title: '开户行', index: 'callNo', width: 90 },
{ title: '银行账户', index: 'callNo', width: 100 },
{ title: '注册地址', index: 'callNo', width: 100 },
{ title: '注册电话', index: 'callNo', width: 100 },
{ title: '服务名称', index: 'callNo', width: 100 },
{ title: '销货清单', index: 'callNo', width: 100 },
{ title: '其他要求', index: 'callNo', width: 100 },
{ title: '申请人', index: 'callNo', width: 90 },
{ title: '申请时间', index: 'updatedAt', type: 'date', width: 150 },
{
title: '操作',
width: 150,
fixed: 'right',
buttons: [
{
text: '开票',
click: item => this.routeTo(item)
click: item => this.requestedInvoiceAction(item)
},
{
text: '驳回',
click: item => this.routeTo(item)
click: item => this.rejectAction([item])
},
{
text: '查看原因',
@ -276,11 +333,11 @@ export class InvoiceRequestedComponent implements OnInit {
},
{
text: '订单明细',
click: item => this.routeTo(item)
click: item => this.router.navigate(['/ticket/invoice-requested/detail/1'])
},
{
text: '下载对账单',
click: item => this.auditAction(item)
text: '下载对账单'
// click: item => this.rejectAction(item)
}
]
}