This commit is contained in:
wangshiming
2022-03-23 19:46:34 +08:00
parent 2023fd2b75
commit 3aea263ba1
4 changed files with 66 additions and 16 deletions

View File

@ -4,7 +4,7 @@
* @Author : Shiming
* @Date : 2022-01-12 10:52:50
* @LastEditors : Shiming
* @LastEditTime : 2022-03-22 17:54:50
* @LastEditTime : 2022-03-23 19:43:26
* @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\components\\receipts-audit\\receipts-audit.component.html
* Copyright (C) 2022 huzhenhong. All rights reserved.
-->
@ -59,8 +59,8 @@
[scroll]="{ x: '2000px' }"
[data]="service.$api_get_billExamine_page"
[columns]="columns"
[req]="{ method: 'POST', allInBody: true, reName: { pi: 'pageIndex', ps: 'pageSize' }, params: reqParams }"
[res]="{ reName: { list: 'data.records', total: 'data.total' } }"
[req]="{ 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]="false"
>

View File

@ -1,5 +1,5 @@
import { Component, OnInit, ViewChild } from '@angular/core';
import { STColumn, STComponent } from '@delon/abc/st';
import { STColumn, STComponent, STRequestOptions } from '@delon/abc/st';
import { SFComponent, SFDateWidgetSchema, SFSchema, SFSchemaEnum, SFSelectWidgetSchema, SFUISchema } from '@delon/form';
import { ModalHelper, _HttpClient } from '@delon/theme';
import { NzModalService } from 'ng-zorro-antd/modal';
@ -30,6 +30,7 @@ export class OrderManagementReceiptsAuditComponent implements OnInit {
@ViewChild('st') private readonly st!: STComponent;
@ViewChild('sf', { static: false }) sf!: SFComponent;
columns: STColumn[] = [];
loading: boolean = true;
resourceStatus: any;
tabs = {
receivedQuantity: 0,
@ -62,6 +63,34 @@ export class OrderManagementReceiptsAuditComponent implements OnInit {
}
};
}
beforeReq = (requestOptions: STRequestOptions) => {
const a: any = {};
if (this.resourceStatus) {
a.auditStatus = this.resourceStatus;
}
const params: any = Object.assign({}, this.sf?.value || {});
delete params._$expand;
if (this.sf) {
Object.assign(requestOptions.body, {
...a,
...params,
createTime: {
start: this.sf?.value?.createTime?.[0] || '',
end: this.sf?.value?.createTime?.[1] || ''
}
});
}
this.loading = true;
return requestOptions;
};
afterRes = (data: any[], rawData?: any) => {
console.log(data)
this.loading = false
return data.map(item => ({
...item,
// disabled: item.billStatus !== '4'
}));
};
get selectedRows() {
return this.st?.list.filter(item => item.checked) || [];
}

View File

@ -4,7 +4,7 @@
* @Author : Shiming
* @Date : 2022-01-12 10:52:50
* @LastEditors : Shiming
* @LastEditTime : 2022-03-22 09:42:03
* @LastEditTime : 2022-03-23 19:45:45
* @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\components\\risk\\risk.component.html
* Copyright (C) 2022 huzhenhong. All rights reserved.
-->
@ -59,8 +59,8 @@
[scroll]="{ x: '2000px' }"
[data]="service.$api_get_listRiskPage"
[columns]="columns"
[req]="{ method: 'POST', allInBody: true, reName: { pi: 'pageIndex', ps: 'pageSize' }, params: reqParams }"
[res]="{ reName: { list: 'data.records', total: 'data.total' } }"
[req]="{ 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]="false"
>

View File

@ -1,7 +1,7 @@
import { registerLocaleData } from '@angular/common';
import { Router } from '@angular/router';
import { Component, OnInit, ViewChild } from '@angular/core';
import { STColumn, STComponent } from '@delon/abc/st';
import { STColumn, STComponent, STRequestOptions } from '@delon/abc/st';
import { SFComponent, SFDateWidgetSchema, SFSchema, SFSchemaEnum, SFSelectWidgetSchema, SFUISchema } from '@delon/form';
import { ModalHelper, _HttpClient } from '@delon/theme';
import { ShipperBaseService } from '@shared';
@ -21,6 +21,7 @@ export class OrderManagementRiskComponent implements OnInit {
schema: SFSchema = {};
schemaView: SFSchema = {};
auditMany = false;
loading: boolean = true;
auditId: any;
auditIdR: any;
isVisibleRE = false;
@ -47,14 +48,6 @@ export class OrderManagementRiskComponent implements OnInit {
* 查询参数
*/
get reqParams() {
// const a:any = {};
// if(this.resourceStatus) {
// a.representationsStatus = this.resourceStatus
// }
// return {
// ...a,
// ...this.sf?.value,
// };
const a: any = {};
if (this.resourceStatus) {
a.representationsStatus = this.resourceStatus
@ -70,6 +63,34 @@ export class OrderManagementRiskComponent implements OnInit {
},
};
}
beforeReq = (requestOptions: STRequestOptions) => {
const a: any = {};
if (this.resourceStatus) {
a.representationsStatus = this.resourceStatus
}
const params: any = Object.assign({}, this.sf?.value || {});
delete params._$expand;
if (this.sf) {
Object.assign(requestOptions.body, {
...a,
...params,
createTime: {
start: this.sf?.value?.createTime?.[0] || '',
end: this.sf?.value?.createTime?.[1] || '',
},
});
}
this.loading = true;
return requestOptions;
};
afterRes = (data: any[], rawData?: any) => {
console.log(data)
this.loading = false
return data.map(item => ({
...item,
disabled: item.auditStatus !== '1'
}));
};
search() {
this.st?.load(1);
this.getGoodsSourceStatistical()