edit
This commit is contained in:
@ -23,7 +23,7 @@ export class CancellationInvoiceComponent implements OnInit {
|
||||
requestedModal!: any;
|
||||
columns: STColumn[] = this.initST();
|
||||
searchSchema: SFSchema = this.initSF();
|
||||
resourceStatus = '';
|
||||
resourceStatus: any = '';
|
||||
_$expand = false;
|
||||
|
||||
selectedRows: any[] = [];
|
||||
@ -56,6 +56,15 @@ export class CancellationInvoiceComponent implements OnInit {
|
||||
return data.map(node => ({ ...node, disabled: node.sts === '3' }));
|
||||
};
|
||||
|
||||
stChange(e: STChange): void {
|
||||
switch (e.type) {
|
||||
case 'checkbox':
|
||||
this.selectedRows = e.checkbox!;
|
||||
this.totalCallNo = this.selectedRows.reduce((total, cv) => total + cv.vatmoney, 0).toFixed(2);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
selectChange(e: any) {
|
||||
this.resourceStatus = e;
|
||||
this.initST();
|
||||
@ -103,17 +112,51 @@ export class CancellationInvoiceComponent implements OnInit {
|
||||
|
||||
/**
|
||||
* 批量推送发票
|
||||
* @param item
|
||||
*/
|
||||
batchPush(item?: any) {
|
||||
if (this.selectedRows?.length <= 0 && !item) {
|
||||
batchPush() {
|
||||
if (this.selectedRows?.length <= 0) {
|
||||
this.service.msgSrv.warning('请选择开票申请');
|
||||
return;
|
||||
}
|
||||
if (this.selectedRows.find(item => item.sts !== '1')) {
|
||||
this.service.msgSrv.warning('请勿选择非待处理申请');
|
||||
return;
|
||||
}
|
||||
this.nzModalService.warning({
|
||||
nzTitle: '确定将所选待处理开票申请推送开票?',
|
||||
nzContent: '推送开票后发票信息不可修改,待系统开票完成后会自动返回开票结果',
|
||||
nzOnOk: () => {}
|
||||
nzOnOk: () => {
|
||||
this.service
|
||||
.request(
|
||||
this.service.$api_batch_push_invoic,
|
||||
this.selectedRows.map(row => row.id)
|
||||
)
|
||||
.subscribe(res => {
|
||||
if (res) {
|
||||
this.service.msgSrv.success('推送开票成功');
|
||||
this.st.load(1);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 推送发票
|
||||
* @param item
|
||||
*/
|
||||
pushInvoice(item: any) {
|
||||
this.nzModalService.warning({
|
||||
nzTitle: '确定将所选待处理开票申请推送开票?',
|
||||
nzContent: '推送开票后发票信息不可修改,待系统开票完成后会自动返回开票结果',
|
||||
nzOnOk: () => {
|
||||
this.service.request(this.service.$api_push_invoic, { id: item.id }).subscribe(res => {
|
||||
if (res) {
|
||||
this.service.msgSrv.success('推送开票成功');
|
||||
this.st.load(1);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@ -327,11 +370,11 @@ export class CancellationInvoiceComponent implements OnInit {
|
||||
iif: item => item.sts != '3',
|
||||
click: item => this.requestedAction(item)
|
||||
},
|
||||
// {
|
||||
// text: '推送开票',
|
||||
// iif: item => item.sts != '3',
|
||||
// click: item => this.pushInvoiceAction(item)
|
||||
// },
|
||||
{
|
||||
text: '推送开票',
|
||||
iif: item => item.sts === '1',
|
||||
click: item => this.pushInvoice(item)
|
||||
},
|
||||
// {
|
||||
// text: '移除',
|
||||
// click: item => this.batchRemove(item)
|
||||
|
||||
Reference in New Issue
Block a user