edit
This commit is contained in:
@ -263,6 +263,7 @@ export class InvoiceRequestedComponent {
|
|||||||
const modal = this.nzModalService.create({
|
const modal = this.nzModalService.create({
|
||||||
nzTitle: '开票受理',
|
nzTitle: '开票受理',
|
||||||
nzContent: RequestedInvoiceModalComponent,
|
nzContent: RequestedInvoiceModalComponent,
|
||||||
|
nzNoAnimation: true,
|
||||||
nzWidth: 1200,
|
nzWidth: 1200,
|
||||||
nzComponentParams: {
|
nzComponentParams: {
|
||||||
id: item.id
|
id: item.id
|
||||||
|
|||||||
@ -11,20 +11,10 @@
|
|||||||
|
|
||||||
<app-requested-detail [id]="id"></app-requested-detail>
|
<app-requested-detail [id]="id"></app-requested-detail>
|
||||||
|
|
||||||
<st
|
<st #st1 [data]="service.$api_get_invoice_requested_order_detail" [columns]="columns" bordered size="small"
|
||||||
#st1
|
[req]="{ process: beforeReq }" [res]="{ process:afterRes }"
|
||||||
[data]="service.$api_get_invoice_requested_order_detail"
|
[page]="{ show: true, showSize: true, pageSizes: [10, 20, 30, 50, 100, 200, 300, 500, 1000] }" [loading]="false"
|
||||||
[columns]="columns"
|
[scroll]="{ x: '1200px', y: '200px' }" (change)="stChange($event)" class="mt-md">
|
||||||
bordered
|
|
||||||
size="small"
|
|
||||||
[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]="false"
|
|
||||||
[scroll]="{ x: '1200px', y: '200px' }"
|
|
||||||
(change)="stChange($event)"
|
|
||||||
class="mt-md"
|
|
||||||
>
|
|
||||||
<ng-template st-row="billHCode" let-item let-index="index" let-column="column">
|
<ng-template st-row="billHCode" let-item let-index="index" let-column="column">
|
||||||
<a class="text-primary"> {{ item.billHCode }}</a>
|
<a class="text-primary"> {{ item.billHCode }}</a>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
* @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
|
* @FilePath : \\tms-obc-web\\src\\app\\routes\\ticket-management\\components\\invoice-requested\\requested-invoice-modal\\requested-invoice-modal.component.ts
|
||||||
*/
|
*/
|
||||||
import { Component, ViewChild } from '@angular/core';
|
import { ChangeDetectorRef, Component, ViewChild } from '@angular/core';
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
import { STChange, STColumn, STComponent, STRequestOptions } from '@delon/abc/st';
|
import { STChange, STColumn, STComponent, STRequestOptions } from '@delon/abc/st';
|
||||||
import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal';
|
import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal';
|
||||||
@ -24,23 +24,38 @@ export class RequestedInvoiceModalComponent {
|
|||||||
columns: STColumn[] = this.initST();
|
columns: STColumn[] = this.initST();
|
||||||
id: any;
|
id: any;
|
||||||
selectedRows: any[] = [];
|
selectedRows: any[] = [];
|
||||||
constructor(public service: TicketService, private nzModalService: NzModalService, private modal: NzModalRef, private router: Router) {}
|
|
||||||
|
constructor(
|
||||||
|
public service: TicketService,
|
||||||
|
private nzModalService: NzModalService,
|
||||||
|
private modal: NzModalRef,
|
||||||
|
private router: Router,
|
||||||
|
private cdr: ChangeDetectorRef
|
||||||
|
) {}
|
||||||
|
|
||||||
beforeReq = (requestOptions: STRequestOptions) => {
|
beforeReq = (requestOptions: STRequestOptions) => {
|
||||||
Object.assign(requestOptions.body, { vatappHId: this.id });
|
Object.assign(requestOptions.body, { vatappHId: this.id });
|
||||||
return requestOptions;
|
return requestOptions;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
afterRes = (data: any[], rawData?: any) => {
|
||||||
|
return data.map(item => ({ ...item, isDelete: data?.length > 1 }));
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 移除订单
|
* 移除订单
|
||||||
*
|
*
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
removeOrder(item: any[]) {
|
removeOrder(item: any[]) {
|
||||||
if (this.st1._data?.length <= 1) {
|
if (this.st1.total <= 1) {
|
||||||
this.service.msgSrv.warning('开票申请记录不能少于一个订单');
|
this.service.msgSrv.warning('开票申请记录不能少于一个订单');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (item?.length <= 0) {
|
||||||
|
this.service.msgSrv.warning('请选择要移除订单');
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.nzModalService.warning({
|
this.nzModalService.warning({
|
||||||
nzTitle: '确定从当前批次中移除所选订单?',
|
nzTitle: '确定从当前批次中移除所选订单?',
|
||||||
nzContent: '移除后相关订单可以重新提交开票申请',
|
nzContent: '移除后相关订单可以重新提交开票申请',
|
||||||
@ -111,7 +126,7 @@ export class RequestedInvoiceModalComponent {
|
|||||||
{
|
{
|
||||||
text: '移除',
|
text: '移除',
|
||||||
click: (item: any) => this.removeOrder([item]),
|
click: (item: any) => this.removeOrder([item]),
|
||||||
iif: _ => this.st1._data?.length > 1
|
iif: item => item.isDelete
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user