edit
This commit is contained in:
@ -42,6 +42,8 @@ export class InvoiceDetailComponent implements OnInit {
|
||||
type: any = 1;
|
||||
|
||||
selectedIndex = 0;
|
||||
|
||||
services: any[] = [];
|
||||
constructor(public service: TicketService, private route: ActivatedRoute) {
|
||||
this.isCanEdit = route.snapshot.queryParams.type === '1';
|
||||
const expressno = route.snapshot.queryParams.expressno;
|
||||
@ -54,7 +56,9 @@ export class InvoiceDetailComponent implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
ngOnInit(): void {}
|
||||
ngOnInit(): void {
|
||||
this.getDictByKey();
|
||||
}
|
||||
|
||||
beforeReq = (requestOptions: STRequestOptions) => {
|
||||
Object.assign(requestOptions.body, { vatinvHId: this.id });
|
||||
@ -67,6 +71,12 @@ export class InvoiceDetailComponent implements OnInit {
|
||||
return requestOptions;
|
||||
};
|
||||
|
||||
getDictByKey() {
|
||||
this.service.request('/api/mdc/pbc/dictItems/getDictValue', { dictKey: 'invoice:service:type' }).subscribe(res => {
|
||||
this.services = res;
|
||||
});
|
||||
}
|
||||
|
||||
loadInvoiceHeader(id: string) {
|
||||
this.service.request(this.service.$api_get_invoice_header_detail, { id }).subscribe(res => {
|
||||
if (res) {
|
||||
@ -87,7 +97,23 @@ export class InvoiceDetailComponent implements OnInit {
|
||||
}
|
||||
|
||||
saveInvoices() {
|
||||
this.isEdit = false;
|
||||
const list = this.invoiceST._data.map(item => {
|
||||
const rs = { ...item };
|
||||
delete rs._values;
|
||||
return rs;
|
||||
});
|
||||
this.service
|
||||
.request(this.service.$api_update_evatinh, {
|
||||
id: this.id,
|
||||
updatEvatinvDetailDTO: list
|
||||
})
|
||||
.subscribe(res => {
|
||||
if (res) {
|
||||
this.service.msgSrv.success('修改成功');
|
||||
this.invoiceST.load(1);
|
||||
this.isEdit = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user