This commit is contained in:
Taric Xin
2022-01-20 13:51:18 +08:00
parent ec285a095b
commit a76a9f0718
6 changed files with 172 additions and 123 deletions

View File

@ -52,8 +52,8 @@
<st #st [scroll]="{ x: '2000px',y:'400px' }" [data]="service.$api_ficoVatinvHList" [columns]="columns"
[req]="{ method: 'POST', allInBody: true, reName: { pi: 'pageIndex', ps: 'pageSize' }, params: reqParams }"
[res]="{ reName: { list: 'data.records', total: 'data.total' } }"
[req]="{ method: 'POST', allInBody: true, reName: { pi: 'pageIndex', ps: 'pageSize' },process: beforeReq }"
[res]="{ reName: { list: 'data.records', total: 'data.total' },process:afterRes }"
[page]="{ show: true, showSize: true, pageSizes: [10, 20, 30, 50, 100, 200, 300, 500, 1000] }"
[loading]="service.http.loading">

View File

@ -34,26 +34,28 @@ export class CancellationInvoiceComponent implements OnInit {
ngOnInit(): void {}
get reqParams() {
// if (this.sf) {
// Object.assign(requestOptions.body, {
// ...this.sf.value,
// sts: this?.resourceStatus,
// createTime: {
// start: this.sf.value.createTime?.[0] || null,
// end: this.sf.value.createTime?.[1] || null
// }
// });
// }
const a: any = {};
if (this.resourceStatus) {
a.sts = this.resourceStatus;
beforeReq = (requestOptions: STRequestOptions) => {
if (this.sf) {
Object.assign(requestOptions.body, {
...this.sf.value,
createTime: {
start: this.sf.value.createTime?.[0] || '',
end: this.sf.value.createTime?.[1] || ''
}
});
}
return {
...a,
...this.sf?.value
};
}
if (this.resourceStatus) {
Object.assign(requestOptions.body, {
sts: this.resourceStatus
});
}
return requestOptions;
};
afterRes = (data: any[], rawData?: any) => {
return data.map(node => ({ ...node, disabled: node.sts === '3' }));
};
selectChange(e: any) {
this.resourceStatus = e;
this.initST();
@ -90,7 +92,7 @@ export class CancellationInvoiceComponent implements OnInit {
if (res) {
this.service.msgSrv.success('开票成功');
this.st.load(1);
modal.destroy;
modal.destroy();
}
});
@ -322,10 +324,12 @@ export class CancellationInvoiceComponent implements OnInit {
},
{
text: '手工开票',
iif: item => item.sts != '3',
click: item => this.requestedAction(item)
},
{
text: '推送开票',
iif: item => item.sts != '3',
click: item => this.pushInvoiceAction(item)
},
{