edit
This commit is contained in:
@ -1,12 +1,13 @@
|
||||
import { query } from '@angular/animations';
|
||||
import { CurrencyPipe } from '@angular/common';
|
||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { Component, ViewChild } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
import { STComponent, STColumn, STChange, STRequestOptions } from '@delon/abc/st';
|
||||
import { SFComponent, SFSchema, SFDateWidgetSchema, SFUISchema } from '@delon/form';
|
||||
import { isTemplateRef } from 'ng-zorro-antd/core/util';
|
||||
import { NzMessageService } from 'ng-zorro-antd/message';
|
||||
import { NzModalService } from 'ng-zorro-antd/modal';
|
||||
|
||||
import { TicketService } from '../../services/ticket.service';
|
||||
import { PrintOrderModalComponent } from './print-order-modal/print-order-modal.component';
|
||||
import { RequestedInvoiceModalComponent } from './requested-invoice-modal/requested-invoice-modal.component';
|
||||
@ -16,7 +17,7 @@ import { RequestedInvoiceModalComponent } from './requested-invoice-modal/reques
|
||||
templateUrl: './invoice-requested.component.html',
|
||||
styleUrls: ['./invoice-requested.component.less', '../../../commom/less/box.less']
|
||||
})
|
||||
export class InvoiceRequestedComponent implements OnInit {
|
||||
export class InvoiceRequestedComponent {
|
||||
@ViewChild('st', { static: true })
|
||||
st!: STComponent;
|
||||
@ViewChild('sf', { static: false })
|
||||
@ -33,8 +34,6 @@ export class InvoiceRequestedComponent implements OnInit {
|
||||
selectedRows: any[] = [];
|
||||
constructor(public service: TicketService, private nzModalService: NzModalService, private router: Router) {}
|
||||
|
||||
ngOnInit(): void {}
|
||||
|
||||
beforeReq = (requestOptions: STRequestOptions) => {
|
||||
if (this.resourceStatus) {
|
||||
Object.assign(requestOptions.body, { sts: this.resourceStatus });
|
||||
@ -219,6 +218,11 @@ export class InvoiceRequestedComponent implements OnInit {
|
||||
},
|
||||
nzFooter: null
|
||||
});
|
||||
modal.afterClose.subscribe(res => {
|
||||
if (res) {
|
||||
this.st.load(1);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@ -421,7 +425,7 @@ export class InvoiceRequestedComponent implements OnInit {
|
||||
// },
|
||||
{
|
||||
text: '订单明细<br/>',
|
||||
click: item => this.router.navigate(['/ticket/invoice-requested/detail/' + item?.id], { queryParams: { sts: item.sts } })
|
||||
click: item => this.router.navigate([`/ticket/invoice-requested/detail/${item?.id}`], { queryParams: { sts: item.sts } })
|
||||
},
|
||||
{
|
||||
text: '查看原因<br/>',
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
<app-requested-detail [id]="id"></app-requested-detail>
|
||||
|
||||
<st
|
||||
#st
|
||||
#st1
|
||||
[data]="service.$api_get_invoice_requested_order_detail"
|
||||
[columns]="columns"
|
||||
bordered
|
||||
|
||||
@ -6,9 +6,10 @@
|
||||
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
||||
* @FilePath : \\tms-obc-web\\src\\app\\routes\\ticket-management\\components\\invoice-requested\\requested-invoice-modal\\requested-invoice-modal.component.ts
|
||||
*/
|
||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { Component, ViewChild } from '@angular/core';
|
||||
import { STChange, STColumn, STComponent, STRequestOptions } from '@delon/abc/st';
|
||||
import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal';
|
||||
|
||||
import { TicketService } from '../../../services/ticket.service';
|
||||
|
||||
@Component({
|
||||
@ -16,16 +17,14 @@ import { TicketService } from '../../../services/ticket.service';
|
||||
templateUrl: './requested-invoice-modal.component.html',
|
||||
styleUrls: ['./requested-invoice-modal.component.less']
|
||||
})
|
||||
export class RequestedInvoiceModalComponent implements OnInit {
|
||||
@ViewChild('st', { static: false })
|
||||
st!: STComponent;
|
||||
export class RequestedInvoiceModalComponent {
|
||||
@ViewChild('st1', { static: false })
|
||||
st1!: STComponent;
|
||||
columns: STColumn[] = this.initST();
|
||||
id: any;
|
||||
selectedRows: any[] = [];
|
||||
constructor(public service: TicketService, private nzModalService: NzModalService, private modal: NzModalRef) {}
|
||||
|
||||
ngOnInit(): void {}
|
||||
|
||||
beforeReq = (requestOptions: STRequestOptions) => {
|
||||
Object.assign(requestOptions.body, { vatappHId: this.id });
|
||||
return requestOptions;
|
||||
@ -33,6 +32,7 @@ export class RequestedInvoiceModalComponent implements OnInit {
|
||||
|
||||
/**
|
||||
* 移除订单
|
||||
*
|
||||
* @returns
|
||||
*/
|
||||
removeOrder(item: any[]) {
|
||||
@ -45,7 +45,7 @@ export class RequestedInvoiceModalComponent implements OnInit {
|
||||
this.service.request(this.service.$api_remove_bill, ids).subscribe(res => {
|
||||
if (res) {
|
||||
this.service.msgSrv.success('移除成功');
|
||||
this.modal.destroy();
|
||||
this.modal.destroy(true);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -57,7 +57,7 @@ export class RequestedInvoiceModalComponent implements OnInit {
|
||||
this.selectedRows = e.checkbox!;
|
||||
break;
|
||||
case 'filter':
|
||||
this.st.load();
|
||||
this.st1.load();
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -78,7 +78,7 @@ export class RequestedInvoiceModalComponent implements OnInit {
|
||||
width: 90,
|
||||
type: 'widget',
|
||||
className: 'text-right',
|
||||
widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.billkpmoney }) }
|
||||
widget: { type: 'currency-chy', params: ({ record }: any) => ({ value: record.billkpmoney }) }
|
||||
},
|
||||
{
|
||||
title: '运输费',
|
||||
@ -86,7 +86,7 @@ export class RequestedInvoiceModalComponent implements OnInit {
|
||||
width: 90,
|
||||
type: 'widget',
|
||||
className: 'text-right',
|
||||
widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.fjfmoney2 }) }
|
||||
widget: { type: 'currency-chy', params: ({ record }: any) => ({ value: record.fjfmoney2 }) }
|
||||
},
|
||||
{
|
||||
title: '附加费',
|
||||
@ -94,7 +94,7 @@ export class RequestedInvoiceModalComponent implements OnInit {
|
||||
width: 90,
|
||||
type: 'widget',
|
||||
className: 'text-right',
|
||||
widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.fjfmoney }) }
|
||||
widget: { type: 'currency-chy', params: ({ record }: any) => ({ value: record.fjfmoney }) }
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
@ -104,7 +104,7 @@ export class RequestedInvoiceModalComponent implements OnInit {
|
||||
buttons: [
|
||||
{
|
||||
text: '移除',
|
||||
click: item => this.removeOrder([item])
|
||||
click: (item: any) => this.removeOrder([item])
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -116,17 +116,19 @@ export class RequestedInvoiceModalComponent implements OnInit {
|
||||
return;
|
||||
}
|
||||
const selectedRows = this.selectedRows.map(item => {
|
||||
delete item._values;
|
||||
return item;
|
||||
return { ...item };
|
||||
});
|
||||
const params = {
|
||||
ficoVatappBillVOList: selectedRows,
|
||||
ficoVatappBillVOList: selectedRows.map(item => {
|
||||
delete item._values;
|
||||
return item;
|
||||
}),
|
||||
id: this.id
|
||||
};
|
||||
this.service.request(this.service.$api_get_applyFicoVatinv, params).subscribe((res: any) => {
|
||||
if (res) {
|
||||
this.service.msgSrv.success('开票成功');
|
||||
this.modal.destroy();
|
||||
this.modal.destroy(true);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user