This commit is contained in:
Taric Xin
2022-04-19 09:52:41 +08:00
parent dd35b3e786
commit a42cbf248b
3 changed files with 26 additions and 20 deletions

View File

@ -263,6 +263,7 @@ export class InvoiceRequestedComponent {
const modal = this.nzModalService.create({
nzTitle: '开票受理',
nzContent: RequestedInvoiceModalComponent,
nzNoAnimation: true,
nzWidth: 1200,
nzComponentParams: {
id: item.id

View File

@ -11,26 +11,16 @@
<app-requested-detail [id]="id"></app-requested-detail>
<st
#st1
[data]="service.$api_get_invoice_requested_order_detail"
[columns]="columns"
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"
>
<st #st1 [data]="service.$api_get_invoice_requested_order_detail" [columns]="columns" bordered size="small"
[req]="{ process: beforeReq }" [res]="{ process:afterRes }"
[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">
<a class="text-primary"> {{ item.billHCode }}</a>
</ng-template>
</st>
<div class="modal-footer text-center">
<button nz-button type="button"(click)="removeOrder(selectedRows)">移除</button>
<button nz-button type="button" (click)="removeOrder(selectedRows)">移除</button>
<button nz-button type="button" (click)="saveManage()">手工处理</button>
<!-- <button nz-button type="submit" nzType="primary" [nzLoading]="service.http.loading" (click)="saveManage()">自动开票</button> -->
</div>

View File

@ -6,7 +6,7 @@
* @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, ViewChild } from '@angular/core';
import { ChangeDetectorRef, Component, ViewChild } from '@angular/core';
import { Router } from '@angular/router';
import { STChange, STColumn, STComponent, STRequestOptions } from '@delon/abc/st';
import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal';
@ -24,23 +24,38 @@ export class RequestedInvoiceModalComponent {
columns: STColumn[] = this.initST();
id: 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) => {
Object.assign(requestOptions.body, { vatappHId: this.id });
return requestOptions;
};
afterRes = (data: any[], rawData?: any) => {
return data.map(item => ({ ...item, isDelete: data?.length > 1 }));
};
/**
* 移除订单
*
* @returns
*/
removeOrder(item: any[]) {
if (this.st1._data?.length <= 1) {
if (this.st1.total <= 1) {
this.service.msgSrv.warning('开票申请记录不能少于一个订单');
return;
}
if (item?.length <= 0) {
this.service.msgSrv.warning('请选择要移除订单');
return;
}
this.nzModalService.warning({
nzTitle: '确定从当前批次中移除所选订单?',
nzContent: '移除后相关订单可以重新提交开票申请',
@ -111,7 +126,7 @@ export class RequestedInvoiceModalComponent {
{
text: '移除',
click: (item: any) => this.removeOrder([item]),
iif: _ => this.st1._data?.length > 1
iif: item => item.isDelete
}
]
}