This commit is contained in:
Taric Xin
2022-03-24 16:14:03 +08:00
parent d8d698125e
commit 3870728572
4 changed files with 57 additions and 34 deletions

View File

@ -79,34 +79,40 @@ export class CancellationInvoiceComponent implements OnInit {
*/
requestedAction(item: any) {
this.openInfo = { invoicedate: null, invoiceno: null, invoiceno2: null };
const modal = this.nzModalService.create({
nzTitle: '发票确认',
nzContent: this.requestedModal,
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),
invoiceno2: this.openInfo.invoiceno2
};
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();
this.service.request(this.service.$api_get_apply_fico_info, { id: item.vatappHId }).subscribe(info => {
if (info) {
console.log(info);
Object.assign(this.openInfo, { ...info });
const modal = this.nzModalService.create({
nzTitle: '发票确认',
nzContent: this.requestedModal,
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),
invoiceno2: this.openInfo.invoiceno2
};
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;
return false;
}
});
}
});
}