This commit is contained in:
Taric Xin
2022-02-17 19:59:20 +08:00
parent 13415b9260
commit 2dbcbb6fac
8 changed files with 167 additions and 11 deletions

View File

@ -0,0 +1,23 @@
<page-header-wrapper [title]="'货主配置'"></page-header-wrapper>
<nz-card class="search-box">
<!-- 搜索表单 -->
<div nz-row nzGutter="8">
<div nz-col [nzXl]=" 16" [nzLg]="24" [nzSm]="24" [nzXs]="24">
<sf #sf [schema]="schema" [ui]="{ '*': { spanLabelFixed: 110, grid: { lg: 8, md: 12, sm: 12, xs: 24 } } }"
[compact]="true" [button]="'none'"></sf>
</div>
<div nz-col [nzXl]=" 8" [nzLg]="24" [nzSm]="24" [nzXs]="24" class="text-right">
<button nz-button nzType="primary" [nzLoading]="service.http.loading" (click)="st?.load(1)" acl
[acl-ability]="['USERCENTER-FREIGHT-LIST-list']">查询</button>
<button nz-button nzType="primary" [disabled]="service.http.loading" (click)="exportList()" acl
[acl-ability]="['USERCENTER-FREIGHT-LIST-export']">导出</button>
<button nz-button (click)="resetSF()" [disabled]="service.http.loading">重置</button>
</div>
</div>
</nz-card>
<nz-card>
<!-- 数据列表 -->
<st #st [columns]="columns" [data]='service.$api_freight_config_page' [req]="{ process: beforeReq }"
[loading]="service.http.loading">
</st>
</nz-card>

View File

@ -0,0 +1,129 @@
import { Component, OnInit, ViewChild } from '@angular/core';
import { Router, ActivatedRoute } from '@angular/router';
import { STColumn, STComponent, STRequestOptions, STData } from '@delon/abc/st';
import { SFUISchema, SFSchema, SFComponent } 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';
import { UsermanageService } from '../../../services/usercenter.service';
@Component({
selector: 'app-freight-config',
templateUrl: './freight-config.component.html',
styleUrls: ['../../../../commom/less/box.less']
})
export class FreightConfigComponent implements OnInit {
schema: SFSchema = this.initSF();
columns: STColumn[] = this.initST();
@ViewChild('st', { static: false }) st!: STComponent;
@ViewChild('sf', { static: false }) sf!: SFComponent;
constructor(public service: UsermanageService, private modal: NzModalService, public shipperservice: ShipperBaseService) {}
ngOnInit() {
this.initST();
}
beforeReq = (requestOptions: STRequestOptions) => {
Object.assign(requestOptions.body, { listSource: 1 });
if (this.sf) {
Object.assign(requestOptions.body, {
...this.sf.value
});
}
return requestOptions;
};
settingAction(item?: any) {
this.modal.create({
nzTitle: '配置',
nzContent: DynamicSettingModalComponent,
nzWidth: 900,
nzComponentParams: {
extendType: '2',
businessId: item.id
},
nzFooter: null
});
}
exportList() {
const params = {};
if (this.sf) {
Object.assign(params, {
...this.sf.value
});
}
this.service.downloadFile(this.service.$api_export_enterprise, params);
}
/**
* 重置表单
*/
resetSF() {
this.sf.reset();
this.st.reload();
}
private initSF(): SFSchema {
return {
properties: {
enterpriseName: {
title: '企业名称',
type: 'string',
ui: {
placeholder: '请输入',
showRequired: false
}
},
networkTransporter: {
type: 'string',
title: '网络货运人',
ui: {
widget: 'select',
placeholder: '请选择',
allowClear: true,
asyncData: () => this.shipperservice.getNetworkFreightForwarder()
}
}
}
};
}
initST(): STColumn[] {
return [
// { title: '', type: 'checkbox', className: 'text-center' },
{ title: '企业名称', className: 'text-center', index: 'enterpriseName' },
{ title: '网络货运人', className: 'text-center', index: 'netTranName' },
{ title: '合同单费率', className: 'text-center', index: 'contractSurchargeRatio' },
{ title: '货源单费率', className: 'text-center', index: 'goodsSurchargeRatio' },
{
title: '合同单业务量(元)',
index: 'contractQuota',
width: 100,
type: 'widget',
className: 'text-right',
widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.contractQuota }) }
},
{
title: '货源单业务量(元)',
index: 'goodsQuota',
width: 100,
type: 'widget',
className: 'text-right',
widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.goodsQuota }) }
},
{
title: '操作',
width: '110px',
className: 'text-center',
buttons: [
{
text: '配置',
click: item => this.settingAction(item)
}
]
}
];
}
}

View File

@ -52,7 +52,7 @@
</ng-template>
<ng-template sf-template="tipsD" let-me let-ui="ui" let-schema="schema">
<div class="pr" style="z-index: 999;">
<div class="pr" style="z-index: 999;">
<div>请上传该企业授权您成为本系统企业管理员的文件的高清照片,需加盖公司印章</div>
<div>上传后系统会自动识别并填写</div>
<div></div>
@ -88,7 +88,8 @@
</sf>
<div style="padding-left: 379px">
<button nz-button type="button" nzType="primary" (click)="submitForm()">确认新增</button>
<button nz-button type="button" nzType="primary" (click)="submitForm()"
[nzLoading]="service.http.loading">确认新增</button>
<button nz-button (click)="goBack()">返回</button>
</div>
</nz-card>