Merge branch 'develop' of https://gitlab.eascs.com/tms-ui/tms-obc-web into develop

This commit is contained in:
wangshiming
2022-05-07 16:11:47 +08:00
16 changed files with 46 additions and 40 deletions

View File

@ -1,4 +1,5 @@
import { AfterViewInit, Component, OnDestroy, OnInit } from '@angular/core';
import { OnReuseDestroy } from '@delon/abc/reuse-tab';
import { SFComponent, SFSchema } from '@delon/form';
import { SearchDrawerService } from '@shared';
import { fromEvent, Subscription } from 'rxjs';
@ -24,7 +25,7 @@ import { debounceTime } from 'rxjs/operators';
@Component({
template: ''
})
export class BasicTableComponent implements AfterViewInit, OnDestroy {
export class BasicTableComponent implements AfterViewInit, OnDestroy, OnReuseDestroy {
scrollY = '400px';
sf!: SFComponent;
@ -35,6 +36,9 @@ export class BasicTableComponent implements AfterViewInit, OnDestroy {
deviationHeight = 0;
constructor(public searchDrawerService: SearchDrawerService) {}
_onReuseDestroy(): void {
this.drawer.forEach(sub => sub.unsubscribe());
}
ngAfterViewInit(): void {
setTimeout(() => {

View File

@ -65,6 +65,7 @@ export class RefundRecordComponent extends BasicTableComponent implements OnInit
{
label: '拒绝',
type: 'default',
loading: () => this.service.http.loading,
onClick: () => {
if (!this.msg) {
this.service.msgSrv.warning('请填写原因');
@ -88,6 +89,7 @@ export class RefundRecordComponent extends BasicTableComponent implements OnInit
{
label: '通过',
type: 'primary',
loading: () => this.service.http.loading,
onClick: () => {
this.service
.request(this.service.$api_agree_refund_record, {

View File

@ -144,7 +144,6 @@ export class MenuModalComponent implements OnInit {
i18n: null,
// i18n: this.sf?.value.keyCode,
menuType: 0,
reuse: 0,
shortcut: 0,
hideInBreadcrumb: 0,
functionType: 0,

View File

@ -79,7 +79,9 @@ export class SupplyManagementBulkComponent extends BasicTableComponent implement
beforeReq = (requestOptions: STRequestOptions) => {
const a: any = {};
if (this.resourceStatus) {
a.resourceStatus = this.resourceStatus;
Object.assign(requestOptions.body, {
resourceStatus: this.resourceStatus
});
}
const params: any = Object.assign({}, this.sf?.value || {});
delete params._$expand;

View File

@ -75,7 +75,9 @@ export class SupplyManagementVehicleComponent extends BasicTableComponent implem
...params
};
if (this.resourceStatus) {
a.resourceStatus = this.resourceStatus;
Object.assign(requestOptions.body, {
resourceStatus: this.resourceStatus
});
}
if (this.sf) {
Object.assign(requestOptions.body, {

View File

@ -214,7 +214,7 @@ export class BillingOrderComponent extends BasicTableComponent {
className: 'text-center',
index: 'paymentMethodRate',
width: 130,
format: record => `${record.paymentMethodRate}%`
format: record => `${record.paymentMethodRate*100}%`
},
{ title: '货主名称', index: 'shipperAppUserName', width: '180px', className: 'text-center' },
{ title: '所属项目', index: 'enterpriseProjectName', width: '180px', className: 'text-center' },

View File

@ -58,9 +58,6 @@ export class UserCenterComponentsDriverCaptainComponent extends BasicTableCompon
}
ngOnInit() {
this.ar.url.subscribe(params => {
this.st?.load(1);
});
}
dataProcess(data: STData[]): STData[] {
return data.map((i, index) => {

View File

@ -63,9 +63,6 @@ export class UserCenterComponentsDriverComponent extends BasicTableComponent imp
}
ngOnInit() {
this.ar.url.subscribe(params => {
this.st?.load(1);
});
}
selectChange(e: any) {

View File

@ -25,8 +25,6 @@ export class FreightComponentsListComponent extends BasicTableComponent implemen
loadingList = true;
sfValue = { enterpriseName: '', contactName: '' };
constructor(
public service: UsermanageService,
private modal: NzModalService,
@ -36,14 +34,12 @@ export class FreightComponentsListComponent extends BasicTableComponent implemen
public searchDrawerService: SearchDrawerService
) {
super(searchDrawerService);
this.sfValue = { enterpriseName: '', contactName: '' };
}
ngOnInit() {
this.initSF();
this.initST();
this.ar.url.subscribe(params => {
this.st?.load(1);
});
}
search() {
@ -52,23 +48,23 @@ export class FreightComponentsListComponent extends BasicTableComponent implemen
beforeReq = (requestOptions: STRequestOptions) => {
Object.assign(requestOptions.body, { listSource: 1 });
if (this.sf) {
if (this.sfValue) {
Object.assign(requestOptions.body, {
...this.sf?.value
...this.sfValue
});
if (this.sf?.value.createTime) {
if (this.sfValue.createTime) {
Object.assign(requestOptions.body, {
createTime: {
start: this.sf?.value.createTime[0],
end: this.sf?.value.createTime[1]
start: this.sfValue.createTime[0],
end: this.sfValue.createTime[1]
}
});
}
if (this.sf?.value.approvalTime) {
if (this.sfValue.approvalTime) {
Object.assign(requestOptions.body, {
approvalTime: {
start: this.sf?.value.approvalTime[0],
end: this.sf?.value.approvalTime[1]
start: this.sfValue.approvalTime[0],
end: this.sfValue.approvalTime[1]
}
});
}
@ -521,7 +517,7 @@ export class FreightComponentsListComponent extends BasicTableComponent implemen
const params = { listSource: 1, pageSize: -1 };
if (this.sf) {
Object.assign(params, {
...this.sf?.value
...this.sfValue
});
}
this.service.downloadFile(this.service.$api_export_enterprise, params);

View File

@ -36,11 +36,7 @@ export class FreightComponentsUserComponent extends BasicTableComponent implemen
this.st?.load(1);
}
ngOnInit() {
this.ar.url.subscribe(params => {
this.st?.load(1);
});
}
ngOnInit() {}
beforeReq = (requestOptions: STRequestOptions) => {
Object.assign(requestOptions.body, { certificationStatus: this.resourceStatus });

View File

@ -56,9 +56,6 @@ export class VehicleComponentsAuditComponent extends BasicTableComponent impleme
ngOnInit() {
this.initSF();
this.initST();
this.ar.url.subscribe(params => {
this.st?.load(1);
});
}
search() {

View File

@ -48,9 +48,6 @@ export class VehicleComponentsListComponent extends BasicTableComponent implemen
ngOnInit() {
this.initSF();
this.initST();
this.ar.url.subscribe(params => {
this.st?.load(1);
});
}
dataProcess(data: STData[]): STData[] {
return data.map((i, index) => {