From 3aea263ba1b22f5f86ee28dd0b1aed35af600cb0 Mon Sep 17 00:00:00 2001 From: wangshiming Date: Wed, 23 Mar 2022 19:46:34 +0800 Subject: [PATCH] fix bug --- .../receipts-audit.component.html | 6 +-- .../receipts-audit.component.ts | 31 ++++++++++++++- .../components/risk/risk.component.html | 6 +-- .../components/risk/risk.component.ts | 39 ++++++++++++++----- 4 files changed, 66 insertions(+), 16 deletions(-) diff --git a/src/app/routes/order-management/components/receipts-audit/receipts-audit.component.html b/src/app/routes/order-management/components/receipts-audit/receipts-audit.component.html index 706bb060..90e17eac 100644 --- a/src/app/routes/order-management/components/receipts-audit/receipts-audit.component.html +++ b/src/app/routes/order-management/components/receipts-audit/receipts-audit.component.html @@ -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" > diff --git a/src/app/routes/order-management/components/receipts-audit/receipts-audit.component.ts b/src/app/routes/order-management/components/receipts-audit/receipts-audit.component.ts index 1f14ce54..414bb7a0 100644 --- a/src/app/routes/order-management/components/receipts-audit/receipts-audit.component.ts +++ b/src/app/routes/order-management/components/receipts-audit/receipts-audit.component.ts @@ -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) || []; } diff --git a/src/app/routes/order-management/components/risk/risk.component.html b/src/app/routes/order-management/components/risk/risk.component.html index 00a56cc6..a08cc584 100644 --- a/src/app/routes/order-management/components/risk/risk.component.html +++ b/src/app/routes/order-management/components/risk/risk.component.html @@ -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" > diff --git a/src/app/routes/order-management/components/risk/risk.component.ts b/src/app/routes/order-management/components/risk/risk.component.ts index 97339153..20c05ddc 100644 --- a/src/app/routes/order-management/components/risk/risk.component.ts +++ b/src/app/routes/order-management/components/risk/risk.component.ts @@ -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()