This commit is contained in:
Taric Xin
2022-01-18 15:49:09 +08:00
parent 7775b39bc6
commit 9d1ba35333
28 changed files with 699 additions and 179 deletions

View File

@ -71,10 +71,11 @@
<div nz-row nzGutter="8">
<div nz-col nzSpan="24" se-container [labelWidth]="100">
<se [col]="1" label="开票日期" required>
<input nz-input placeholder="请输入" />
<nz-date-picker [(ngModel)]="openInfo.invoicedate" nzPlaceHolder="请选择" style=" width: 100%;">
</nz-date-picker>
</se>
<se [col]="1" label="开票日期" required>
<input nz-input placeholder="请输入" />
<se [col]="1" label="发票号码" required>
<input nz-input [(ngModel)]="openInfo.invoiceno" placeholder="请输入" />
</se>
</div>
</div>

View File

@ -3,6 +3,7 @@ import { Component, OnInit, ViewChild } from '@angular/core';
import { Router } from '@angular/router';
import { STComponent, STColumn, STRequestOptions, STChange } from '@delon/abc/st';
import { SFComponent, SFSchema, SFDateWidgetSchema, SFSelectWidgetSchema } from '@delon/form';
import { dateTimePickerUtil } from '@delon/util';
import { NzModalService } from 'ng-zorro-antd/modal';
import { TicketService } from '../../services/ticket.service';
import { RequestedInvoiceModalComponent } from '../invoice-requested/requested-invoice-modal/requested-invoice-modal.component';
@ -28,6 +29,8 @@ export class CancellationInvoiceComponent implements OnInit {
selectedRows: any[] = [];
totalCallNo = 0;
openInfo: any = { invoicedate: null, invoiceno: null };
constructor(
public service: TicketService,
private nzModalService: NzModalService,
@ -58,26 +61,47 @@ export class CancellationInvoiceComponent implements OnInit {
};
}
selectChange(e: any) {
console.log(e);
this.resourceStatus = e;
this.initST();
setTimeout(() => {
this.st.load();
}, 500);
}
approval(): void {}
add(): void {}
/**
* 手工开票
* @param item
*/
requestedAction(item: any) {
this.openInfo = { invoicedate: null, invoiceno: null };
const modal = this.nzModalService.create({
nzTitle: '发票确认',
nzContent: this.requestedModal,
nzOnOk: () => {}
nzOnOk: () => {
if (!this.openInfo?.invoicedate || !this.openInfo?.invoiceno) {
this.service.msgSrv.warning('请填开票信息');
return false;
}
const params = {
invoiceno: this.openInfo.invoiceno,
invoicedate: dateTimePickerUtil.format(this.openInfo.invoicedate)
};
this.service
.request(this.service.$api_apply_fico_invoic, {
id: item.id,
vatinvcode: item.vatinvcode,
...params
})
.subscribe(res => {
if (res) {
this.service.msgSrv.success('开票成功');
this.st.load(1);
modal.destroy;
}
});
return false;
}
});
}
@ -262,9 +286,23 @@ export class CancellationInvoiceComponent implements OnInit {
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: 'vatnotax',
width: 100,
type: 'widget',
className: 'text-right',
widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.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: 'vattax',
width: 90,
type: 'widget',
className: 'text-right',
widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.vattax }) }
},
{ title: '服务名称', index: 'vatname', width: 100 },
{ title: '销货清单', index: 'isdetail', width: 90 },
{ title: '票面备注', render: 'vatremarks', width: 250 },