This commit is contained in:
Taric Xin
2022-02-24 20:22:42 +08:00
11 changed files with 251 additions and 76 deletions

View File

@ -1,7 +1,7 @@
import { Component, OnInit, ViewChild } from '@angular/core';
import { Router, ActivatedRoute } from '@angular/router';
import { STColumn, STComponent, STRequestOptions, STData, STChange } from '@delon/abc/st';
import { SFUISchema, SFSchema, SFComponent } from '@delon/form';
import { SFUISchema, SFSchema, SFComponent, SFDateWidgetSchema } from '@delon/form';
import { ShipperBaseService, DynamicSettingModalComponent } from '@shared';
import { NzModalService } from 'ng-zorro-antd/modal';
import { AccountDetailComponent } from 'src/app/shared/components/account-detail/account-detail.component';
@ -17,7 +17,6 @@ export class FreightConfigComponent implements OnInit {
columns: STColumn[] = this.initST();
@ViewChild('st', { static: false }) st!: STComponent;
@ViewChild('sf', { static: false }) sf!: SFComponent;
selectedRows: any[] = [];
@ViewChild('IWModal', { static: false })
@ -28,6 +27,7 @@ export class FreightConfigComponent implements OnInit {
roles: any = [];
networkTransporter = null;
roleId = null;
_$expand = false;
constructor(public service: UsermanageService, private modal: NzModalService, public shipperservice: ShipperBaseService) {}
ngOnInit() {
@ -40,7 +40,11 @@ export class FreightConfigComponent implements OnInit {
Object.assign(requestOptions.body, { listSource: 1 });
if (this.sf) {
Object.assign(requestOptions.body, {
...this.sf.value
...this.sf.value,
createTime: {
start: this.sf?.value.effectiveDate[0],
end: this.sf?.value.effectiveDate[1]
}
});
}
return requestOptions;
@ -164,7 +168,6 @@ export class FreightConfigComponent implements OnInit {
}
this.service.downloadFile(this.service.$api_export_enterprise, params);
}
loadltdId() {
this.service.getNetworkFreightForwarder().subscribe(res => {
if (res) {
@ -180,17 +183,25 @@ export class FreightConfigComponent implements OnInit {
});
}
/**
* 伸缩查询条件
*/
expandToggle(): void {
this._$expand = !this._$expand;
this.sf?.setValue('/_$expand', this._$expand);
}
/**
* 重置表单
*/
resetSF() {
resetSF(): void {
this.sf.reset();
this.st.reload();
this._$expand = false;
}
private initSF(): SFSchema {
return {
properties: {
_$expand: { type: 'boolean', ui: { hidden: true } },
enterpriseName: {
title: '企业名称',
type: 'string',
@ -208,6 +219,38 @@ export class FreightConfigComponent implements OnInit {
allowClear: true,
asyncData: () => this.shipperservice.getNetworkFreightForwarder()
}
},
goodsSurchargeRatio: {
title: '货源单费率',
type: 'string',
ui: {
placeholder: '请输入',
showRequired: false
}
},
contractSurchargeRatio: {
title: '合同单费率',
type: 'string',
ui: {
placeholder: '请输入',
showRequired: false,
visibleIf: {
_$expand: (value: boolean) => value
}
}
},
effectiveDate: {
title: '注册时间',
type: 'string',
ui: {
widget: 'date',
mode: 'range',
format: 'yyyy-MM-dd',
visibleIf: {
_$expand: (value: boolean) => value
},
allowClear: true
} as SFDateWidgetSchema
}
}
};
@ -219,14 +262,14 @@ export class FreightConfigComponent implements OnInit {
{ title: '企业名称', className: 'text-center', index: 'enterpriseName', width: 350 },
{ title: '网络货运人', className: 'text-center', index: 'netTranName', width: 160 },
{
title: '合同单费率',
title: '货源单费率',
className: 'text-right',
index: 'contractSurchargeRatio',
width: 130,
format: item => `${item.contractSurchargeRatio}%`
},
{
title: '货源单费率',
title: '合同单费率',
className: 'text-right',
index: 'goodsSurchargeRatio',
width: 130,
@ -235,7 +278,7 @@ export class FreightConfigComponent implements OnInit {
{
title: '合同单业务量(元)',
index: 'contractQuota',
width: 140,
width: 160,
type: 'widget',
className: 'text-right',
widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.contractQuota }) }
@ -243,11 +286,17 @@ export class FreightConfigComponent implements OnInit {
{
title: '货源单业务量(元)',
index: 'goodsQuota',
width: 140,
width: 160,
type: 'widget',
className: 'text-right',
widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.goodsQuota }) }
},
{
title: '注册时间',
index: 'createTime',
width: 180,
className: 'text-right'
},
{
title: '操作',
width: '90px',