From 295fd58ee6be1a9be33290ce639d600d04160946 Mon Sep 17 00:00:00 2001 From: Taric Xin Date: Thu, 28 Apr 2022 21:31:05 +0800 Subject: [PATCH] edit --- .../basic-table/basic-table.component.ts | 15 +++- src/app/routes/commom/less/commom-table.less | 4 +- .../routes/commom/less/common-table-bar.less | 17 ++++ .../payable-order.component.html | 36 ++++----- .../payable-order/payable-order.component.ts | 72 ++++------------- .../platform-account.component.html | 26 +++++-- .../platform-account.component.ts | 24 +++--- .../receivable-order.component.html | 62 +++++++-------- .../receivable-order.component.ts | 78 +++++-------------- 9 files changed, 149 insertions(+), 185 deletions(-) create mode 100644 src/app/routes/commom/less/common-table-bar.less diff --git a/src/app/routes/commom/components/basic-table/basic-table.component.ts b/src/app/routes/commom/components/basic-table/basic-table.component.ts index dfe8a25d..f3645ebf 100644 --- a/src/app/routes/commom/components/basic-table/basic-table.component.ts +++ b/src/app/routes/commom/components/basic-table/basic-table.component.ts @@ -73,22 +73,29 @@ export class BasicTableComponent implements AfterViewInit, OnDestroy { for (let index = 0; index < tabset.length; index++) { tabsetHeight += tabset[index].clientHeight; } - console.log('tabsetHeight', tabsetHeight); if (tabset) { scrollY -= tabsetHeight; } // 剔除高度容器 - // 计算所有tabs高度 const headerBox = document.getElementsByClassName('header_box'); let headerBoxHeight = 0; for (let index = 0; index < headerBox.length; index++) { headerBoxHeight += headerBox[index].clientHeight; } - console.log('headerBoxHeight', headerBoxHeight); - if (headerBox) { scrollY -= headerBoxHeight; } + + // 剔除高度容器 + const heightBox = document.getElementsByClassName('height_box'); + let heightBoxHeight = 0; + for (let index = 0; index < heightBox.length; index++) { + heightBoxHeight += heightBox[index].clientHeight; + } + if (heightBox) { + scrollY -= heightBoxHeight; + } + if (typeof this.deviationHeight === 'number') { scrollY -= this.deviationHeight; } diff --git a/src/app/routes/commom/less/commom-table.less b/src/app/routes/commom/less/commom-table.less index c1256d36..152d7534 100644 --- a/src/app/routes/commom/less/commom-table.less +++ b/src/app/routes/commom/less/commom-table.less @@ -136,4 +136,6 @@ margin-right: 6px; } } -} \ No newline at end of file +} + +.height_box{} \ No newline at end of file diff --git a/src/app/routes/commom/less/common-table-bar.less b/src/app/routes/commom/less/common-table-bar.less new file mode 100644 index 00000000..22e166de --- /dev/null +++ b/src/app/routes/commom/less/common-table-bar.less @@ -0,0 +1,17 @@ +:host::ng-deep { + nz-card { + margin: -8px -8px 0 !important + } + + .height_box { + margin-bottom: 18px !important; + } +} + +.total-footer { + position : absolute; + bottom : 0px; + height : 32px; + margin : 4px 8px; + line-height: 32px; +} \ No newline at end of file diff --git a/src/app/routes/financial-management/components/payable-order/payable-order.component.html b/src/app/routes/financial-management/components/payable-order/payable-order.component.html index e7fc0bc8..cbe647cb 100644 --- a/src/app/routes/financial-management/components/payable-order/payable-order.component.html +++ b/src/app/routes/financial-management/components/payable-order/payable-order.component.html @@ -1,17 +1,10 @@ - - - + - + +
+ +
- + + + - - - + --> + +
+
+
+ +
+
diff --git a/src/app/routes/financial-management/components/payable-order/payable-order.component.ts b/src/app/routes/financial-management/components/payable-order/payable-order.component.ts index 33b73f97..447dfa8f 100644 --- a/src/app/routes/financial-management/components/payable-order/payable-order.component.ts +++ b/src/app/routes/financial-management/components/payable-order/payable-order.component.ts @@ -3,24 +3,21 @@ import { Component, OnInit, ViewChild } from '@angular/core'; import { Router } from '@angular/router'; import { STComponent, STColumn, STRequestOptions, STChange } from '@delon/abc/st'; import { SFComponent, SFSchema, SFDateWidgetSchema } from '@delon/form'; +import { SearchDrawerService } from '@shared'; import { NzModalService } from 'ng-zorro-antd/modal'; +import { BasicTableComponent } from 'src/app/routes/commom'; import { FreightAccountService } from '../../services/freight-account.service'; @Component({ selector: 'app-payable-order', templateUrl: './payable-order.component.html', - styleUrls: ['../../../commom/less/box.less', '../../../commom/less/expend-but.less'], - providers: [CurrencyPipe] + styleUrls: ['../../../commom/less/commom-table.less', '../../../commom/less/common-table-bar.less'] }) -export class PayableOrderComponent implements OnInit { +export class PayableOrderComponent extends BasicTableComponent implements OnInit { @ViewChild('st', { static: true }) st!: STComponent; - @ViewChild('sf', { static: false }) - sf!: SFComponent; columns: STColumn[] = this.initST(); - searchSchema: SFSchema = this.initSF(); - - _$expand = false; + schema: SFSchema = this.initSF(); selectedRows: any[] = []; info: any = {}; @@ -28,10 +25,15 @@ export class PayableOrderComponent implements OnInit { public service: FreightAccountService, private nzModalService: NzModalService, private router: Router, - private currencyPipe: CurrencyPipe - ) {} + public searchDrawerService: SearchDrawerService + ) { + super(searchDrawerService); + } - ngOnInit(): void { + ngOnInit(): void {} + + search() { + this.st?.load(1); } loadInfo() { @@ -76,21 +78,6 @@ export class PayableOrderComponent implements OnInit { } } - /** - * 重置表单 - */ - resetSF() { - this.sf.reset(); - this._$expand = false; - } - - /** - * 伸缩查询条件 - */ - expandToggle() { - this._$expand = !this._$expand; - this.sf?.setValue('/expand', this._$expand); - } private initSF(): SFSchema { return { @@ -133,9 +120,6 @@ export class PayableOrderComponent implements OnInit { ui: { widget: 'select', placeholder: '请选择', - visibleIf: { - expand: (value: boolean) => value - } } }, cno: { @@ -146,9 +130,6 @@ export class PayableOrderComponent implements OnInit { placeholder: '请选择', allowClear: true, asyncData: () => this.service.getCloseAccount(), - visibleIf: { - expand: (value: boolean) => value - } } }, driver2IdName: { @@ -157,9 +138,6 @@ export class PayableOrderComponent implements OnInit { ui: { widget: 'select', placeholder: '请选择', - visibleIf: { - expand: (value: boolean) => value - } } }, sts: { @@ -172,9 +150,6 @@ export class PayableOrderComponent implements OnInit { ui: { widget: 'select', placeholder: '请选择', - visibleIf: { - expand: (value: boolean) => value - } } }, phxdate: { @@ -183,9 +158,6 @@ export class PayableOrderComponent implements OnInit { ui: { widget: 'sl-from-to-search', format: 'yyyy-MM-dd', - visibleIf: { - expand: (value: boolean) => value - } } as SFDateWidgetSchema }, createTime: { @@ -194,9 +166,6 @@ export class PayableOrderComponent implements OnInit { ui: { widget: 'sl-from-to-search', format: 'yyyy-MM-dd', - visibleIf: { - expand: (value: boolean) => value - } } as SFDateWidgetSchema }, billHCode: { @@ -204,9 +173,6 @@ export class PayableOrderComponent implements OnInit { title: '订单号', ui: { placeholder: '请输入', - visibleIf: { - expand: (value: boolean) => value - } } }, feeHCode: { @@ -214,9 +180,6 @@ export class PayableOrderComponent implements OnInit { title: '费用号', ui: { placeholder: '请输入', - visibleIf: { - expand: (value: boolean) => value - } } }, remarks: { @@ -225,9 +188,6 @@ export class PayableOrderComponent implements OnInit { ui: { autocomplete: 'off', placeholder: '请选择', - visibleIf: { - expand: (value: boolean) => value - } } } } @@ -246,15 +206,17 @@ export class PayableOrderComponent implements OnInit { title: '核销金额', index: 'phxmoney', width: 140, + type: 'widget', className: 'text-right', - format: item => `${this.currencyPipe.transform(item.phxmoney || 0)}` + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.phxmoney }) } }, { title: '应付金额', index: 'prmoney', width: 140, + type: 'widget', className: 'text-right', - format: item => `${this.currencyPipe.transform(item.prmoney || 0)}` + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.prmoney }) } }, { title: '银行类型', index: 'banktype', type: 'enum', enum: { '1': '平安', '2': '浦发' }, width: 120 }, { title: '付款类型', index: 'brmtype', type: 'enum', enum: { '1': '费用款项' }, width: 120 }, diff --git a/src/app/routes/financial-management/components/platform-account/platform-account.component.html b/src/app/routes/financial-management/components/platform-account/platform-account.component.html index ccbbcf20..613120d9 100644 --- a/src/app/routes/financial-management/components/platform-account/platform-account.component.html +++ b/src/app/routes/financial-management/components/platform-account/platform-account.component.html @@ -1,7 +1,10 @@ - - + - + +
+ +
- + - + +
+
+
+ + +
+
@@ -60,4 +70,4 @@ -
+
\ No newline at end of file diff --git a/src/app/routes/financial-management/components/platform-account/platform-account.component.ts b/src/app/routes/financial-management/components/platform-account/platform-account.component.ts index e939b50a..3c7c0268 100644 --- a/src/app/routes/financial-management/components/platform-account/platform-account.component.ts +++ b/src/app/routes/financial-management/components/platform-account/platform-account.component.ts @@ -2,7 +2,9 @@ import { Component, OnInit, ViewChild } from '@angular/core'; import { Router } from '@angular/router'; import { STComponent, STColumn, STChange, STRequestOptions } from '@delon/abc/st'; import { SFComponent, SFSchema, SFDateWidgetSchema } from '@delon/form'; +import { SearchDrawerService } from '@shared'; import { NzModalService } from 'ng-zorro-antd/modal'; +import { BasicTableComponent } from 'src/app/routes/commom'; import { FreightAccountService } from '../../services/freight-account.service'; import { CwcBankCardManagementBindComponent } from '../bank-card-management/bind/bind.component'; import { CwcAccountManagementWithdrawDepositComponent } from './withdraw-deposit/withdraw-deposit.component'; @@ -10,14 +12,12 @@ import { CwcAccountManagementWithdrawDepositComponent } from './withdraw-deposit @Component({ selector: 'app-platform-account', templateUrl: './platform-account.component.html', - styleUrls: ['../../../commom/less/box.less'] + styleUrls: ['../../../commom/less/commom-table.less', '../../../commom/less/common-table-bar.less'] }) -export class PlatformAccountComponent implements OnInit { +export class PlatformAccountComponent extends BasicTableComponent implements OnInit { @ViewChild('st', { static: true }) st!: STComponent; - @ViewChild('sf', { static: false }) - sf!: SFComponent; - searchSchema: SFSchema = this.initSF(); + schema: SFSchema = this.initSF(); columns: STColumn[] = this.initST(); info: any = {}; @@ -27,11 +27,16 @@ export class PlatformAccountComponent implements OnInit { public service: FreightAccountService, private router: Router, private nzModalService: NzModalService, - public modal: NzModalService - ) {} + public modal: NzModalService, + public searchDrawerService: SearchDrawerService + ) { + super(searchDrawerService); + } - ngOnInit(): void { - this.loadInfo(); + ngOnInit(): void {} + + search() { + this.st?.load(1); } beforeReq = (requestOptions: STRequestOptions) => { @@ -39,6 +44,7 @@ export class PlatformAccountComponent implements OnInit { Object.assign(requestOptions.body, { ...this.sf?.value }); } this.loadStatistics(requestOptions.body); + this.loadInfo(); return requestOptions; }; diff --git a/src/app/routes/financial-management/components/receivable-order/receivable-order.component.html b/src/app/routes/financial-management/components/receivable-order/receivable-order.component.html index 0755a3f3..ceb5e6f5 100644 --- a/src/app/routes/financial-management/components/receivable-order/receivable-order.component.html +++ b/src/app/routes/financial-management/components/receivable-order/receivable-order.component.html @@ -1,16 +1,29 @@ - - + - + + + +
+ +
- -
-
- -
-
- - - - + +
+
+
+
-
- + [loading]="false" [scroll]="{ x: '1200px',y:scrollY }" (change)="stChange($event)"> \ No newline at end of file diff --git a/src/app/routes/financial-management/components/receivable-order/receivable-order.component.ts b/src/app/routes/financial-management/components/receivable-order/receivable-order.component.ts index 19007ae6..c27928e7 100644 --- a/src/app/routes/financial-management/components/receivable-order/receivable-order.component.ts +++ b/src/app/routes/financial-management/components/receivable-order/receivable-order.component.ts @@ -3,25 +3,22 @@ import { Component, OnInit, ViewChild } from '@angular/core'; import { Router } from '@angular/router'; import { STComponent, STColumn, STRequestOptions, STChange } from '@delon/abc/st'; import { SFComponent, SFSchema, SFDateWidgetSchema } from '@delon/form'; +import { SearchDrawerService } from '@shared'; import { NzModalService } from 'ng-zorro-antd/modal'; +import { BasicTableComponent } from 'src/app/routes/commom'; import { TicketService } from 'src/app/routes/ticket-management/services/ticket.service'; import { FreightAccountService } from '../../services/freight-account.service'; @Component({ selector: 'app-receivable-order', templateUrl: './receivable-order.component.html', - styleUrls: ['../../../commom/less/box.less', '../../../commom/less/expend-but.less'], - providers: [CurrencyPipe] + styleUrls: ['../../../commom/less/commom-table.less','../../../commom/less/common-table-bar.less'] }) -export class ReceivableOrderComponent implements OnInit { +export class ReceivableOrderComponent extends BasicTableComponent implements OnInit { @ViewChild('st', { static: true }) st!: STComponent; - @ViewChild('sf', { static: false }) - sf!: SFComponent; columns: STColumn[] = this.initST(); - searchSchema: SFSchema = this.initSF(); - - _$expand = false; + schema: SFSchema = this.initSF(); selectedRows: any[] = []; @@ -30,10 +27,15 @@ export class ReceivableOrderComponent implements OnInit { public service: FreightAccountService, private nzModalService: NzModalService, private router: Router, - private currencyPipe: CurrencyPipe - ) {} + public searchDrawerService: SearchDrawerService + ) { + super(searchDrawerService); + } - ngOnInit(): void { + ngOnInit(): void {} + + search() { + this.st?.load(1); } loadInfo() { @@ -78,21 +80,6 @@ export class ReceivableOrderComponent implements OnInit { } } - /** - * 重置表单 - */ - resetSF() { - this.sf.reset(); - this._$expand = false; - } - - /** - * 伸缩查询条件 - */ - expandToggle() { - this._$expand = !this._$expand; - this.sf?.setValue('/expand', this._$expand); - } private initSF(): SFSchema { return { @@ -135,9 +122,6 @@ export class ReceivableOrderComponent implements OnInit { widget: 'dict-select', params: { dictKey: 'driverrecord:receive:type' }, placeholder: '请选择', - visibleIf: { - expand: (value: boolean) => value - } } }, arvattype: { @@ -147,9 +131,6 @@ export class ReceivableOrderComponent implements OnInit { widget: 'dict-select', params: { dictKey: 'pay:type' }, placeholder: '请选择', - visibleIf: { - expand: (value: boolean) => value - } } }, cno: { @@ -160,9 +141,6 @@ export class ReceivableOrderComponent implements OnInit { placeholder: '请选择', allowClear: true, asyncData: () => this.service.getCloseAccount(), - visibleIf: { - expand: (value: boolean) => value - } } }, arto: { @@ -175,9 +153,6 @@ export class ReceivableOrderComponent implements OnInit { searchLoadingText: '搜索中...', allowClear: true, onSearch: (q: any) => this.service.getEnterpriceList({ enterpriseName: q }), - visibleIf: { - expand: (value: boolean) => value - } } }, sts: { @@ -190,9 +165,7 @@ export class ReceivableOrderComponent implements OnInit { ui: { widget: 'select', placeholder: '请选择', - visibleIf: { - expand: (value: boolean) => value - } + } }, banktype: { @@ -206,9 +179,7 @@ export class ReceivableOrderComponent implements OnInit { ui: { widget: 'select', placeholder: '请选择', - visibleIf: { - expand: (value: boolean) => value - } + }, default: '' }, @@ -218,9 +189,7 @@ export class ReceivableOrderComponent implements OnInit { ui: { widget: 'sl-from-to-search', format: 'yyyy-MM-dd', - visibleIf: { - expand: (value: boolean) => value - } + } as SFDateWidgetSchema }, createTime: { @@ -229,9 +198,6 @@ export class ReceivableOrderComponent implements OnInit { ui: { widget: 'sl-from-to-search', format: 'yyyy-MM-dd', - visibleIf: { - expand: (value: boolean) => value - } } as SFDateWidgetSchema }, billHCode: { @@ -239,9 +205,6 @@ export class ReceivableOrderComponent implements OnInit { title: '订单号', ui: { placeholder: '请输入', - visibleIf: { - expand: (value: boolean) => value - } } }, // orderS3: { @@ -260,9 +223,6 @@ export class ReceivableOrderComponent implements OnInit { ui: { autocomplete: 'off', placeholder: '请选择', - visibleIf: { - expand: (value: boolean) => value - } } } } @@ -282,15 +242,17 @@ export class ReceivableOrderComponent implements OnInit { title: '核销金额', index: 'ahxmoney', width: 140, + type: 'widget', className: 'text-right', - format: item => `${this.currencyPipe.transform(item.ahxmoney)}` + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.ahxmoney }) } }, { title: '应收金额', index: 'armoney', width: 140, + type: 'widget', className: 'text-right', - format: item => `${this.currencyPipe.transform(item.armoney)}` + widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.armoney }) } }, { title: '银行类型', index: 'banktype', type: 'enum', enum: { '1': '平安', '2': '浦发' }, width: 120 }, { title: '收款类型', index: 'arvattype', type: 'enum', enum: { '1': '费用款项' }, width: 120 },