This commit is contained in:
Taric Xin
2022-01-17 15:55:48 +08:00
parent 7f20f59b0e
commit 0b5b638964
7 changed files with 121 additions and 81 deletions

View File

@ -1,3 +1,4 @@
import { CurrencyPipe } from '@angular/common';
import { Component, OnInit, ViewChild } from '@angular/core';
import { Router } from '@angular/router';
import { STComponent, STColumn, STRequestOptions, STChange } from '@delon/abc/st';
@ -10,7 +11,8 @@ import { PushInvoiceComponent } from './push-invoice/push-invoice.component';
@Component({
selector: 'app-cancellation-invoice',
templateUrl: './cancellation-invoice.component.html',
styleUrls: ['./cancellation-invoice.component.less']
styleUrls: ['./cancellation-invoice.component.less'],
providers: [CurrencyPipe]
})
export class CancellationInvoiceComponent implements OnInit {
@ViewChild('st', { static: true })
@ -21,16 +23,21 @@ export class CancellationInvoiceComponent implements OnInit {
requestedModal!: any;
columns: STColumn[] = this.initST();
searchSchema: SFSchema = this.initSF();
resourceStatus = ''
resourceStatus = '';
_$expand = false;
selectedRows: any[] = [];
totalCallNo = 0;
constructor(public service: TicketService, private nzModalService: NzModalService, private router: Router) {}
constructor(
public service: TicketService,
private nzModalService: NzModalService,
private router: Router,
private currencyPipe: CurrencyPipe
) {}
ngOnInit(): void {}
get reqParams() {
get reqParams() {
// if (this.sf) {
// Object.assign(requestOptions.body, {
// ...this.sf.value,
@ -41,17 +48,17 @@ export class CancellationInvoiceComponent implements OnInit {
// }
// });
// }
const a:any = {};
if(this.resourceStatus) {
a.sts = this.resourceStatus
const a: any = {};
if (this.resourceStatus) {
a.sts = this.resourceStatus;
}
return {
...a,
...this.sf?.value,
...this.sf?.value
};
};
}
selectChange(e: any) {
console.log(e)
console.log(e);
this.resourceStatus = e;
this.initST();
setTimeout(() => {
@ -126,13 +133,23 @@ export class CancellationInvoiceComponent implements OnInit {
/**
* 推送发票
* @param item
* @param item
*/
pushInvoiceAction(item: any) {
const modal = this.nzModalService.create({
nzTitle: '推送开票',
nzContent: PushInvoiceComponent,
nzComponentParams: { id: item.id },
nzWidth: 1200,
nzOnOk: () => {
this.service.request(this.service.$api_apply_fico, { vatinvHid: item.id }).subscribe(res => {
if (res) {
this.service.msgSrv.success('开票成功');
modal.destroy;
}
});
return false;
}
});
}
@ -197,11 +214,11 @@ export class CancellationInvoiceComponent implements OnInit {
widget: 'dict-select',
containsAllLable: true,
params: { dictKey: 'vatinv:status' },
containAllLable:true,
containAllLable: true,
visibleIf: {
_$expand: (value: boolean) => value,
},
} as SFSelectWidgetSchema,
_$expand: (value: boolean) => value
}
} as SFSelectWidgetSchema
},
// or2derSn: {
// type: 'string',
@ -231,17 +248,23 @@ export class CancellationInvoiceComponent implements OnInit {
private initST(): STColumn[] {
return [
{ title: '', index: 'key', type: 'checkbox' },
{ title: '', index: 'key', type: 'checkbox', fixed: 'left', width: 50, className: 'text-center' },
{ title: '分票编号', render: 'vatinvcode', width: 150 },
{ title: '申请编号', index: 'vatappHId', width: 120 },
{ title: '申请时间', index: 'createTime', type: 'date', width: 150 },
{ title: '网络货运人', index: 'ltdName', width: 120 },
{ title: '购买人', index: 'artoName', width: 90 },
{ title: '订单数', index: 'ordlines', width: 90 },
{ title: '价税合计', index: 'vatmoney', width: 90 },
{ title: '金额', index: 'vatnotax', width: 100 },
{ title: '税率', index: 'billvatrate', width: 90 },
{ title: '税额', index: 'vattax', width: 90 },
{ title: '订单数', index: 'ordlines', width: 90, className: 'text-right' },
{
title: '价税合计',
index: 'vatmoney',
width: 90,
type: 'currency',
format: item => `${this.currencyPipe.transform(item.vatmoney)}`
},
{ title: '金额', index: 'vatnotax', width: 100, type: 'currency', format: item => `${this.currencyPipe.transform(item.vatnotax)}` },
{ title: '税率', index: 'billvatrate', width: 90, className: 'text-right' },
{ title: '税额', index: 'vattax', width: 90, type: 'currency', format: item => `${this.currencyPipe.transform(item.vattax)}` },
{ title: '服务名称', index: 'vatname', width: 100 },
{ title: '销货清单', index: 'isdetail', width: 90 },
{ title: '票面备注', render: 'vatremarks', width: 250 },
@ -264,15 +287,15 @@ export class CancellationInvoiceComponent implements OnInit {
click: item => this.pushInvoiceAction(item)
},
{
text: '移除  ',
text: '移除',
click: item => this.batchRemove(item)
},
{
text: '确认  '
text: '确认'
// click: item => this.rejectAction(item)
},
{
text: '撤回  ',
text: '撤回',
click: item => this.batchWithdraw(item)
}
]