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

This commit is contained in:
wangshiming
2022-01-13 19:22:47 +08:00
14 changed files with 288 additions and 27 deletions

View File

@ -1,10 +1,4 @@
<notice-icon
btnClass="alain-pro__header-item"
btnIconClass="alain-pro__header-item-icon"
[data]="data"
[count]="count"
[loading]="loading"
(select)="select($event)"
(clear)="clear($event)"
(popoverVisibleChange)="loadData()"
></notice-icon>
<notice-icon btnClass="alain-pro__header-item" btnIconClass="alain-pro__header-item-icon" [data]="data" [count]="count"
[loading]="loading" (select)="select($event)" (clear)="clear($event)" (popoverVisibleChange)="loadData()">
</notice-icon>

View File

@ -9,6 +9,10 @@
<!-- <quick-chat-status class="hidden-xs"></quick-chat-status> -->
<!--Notify-->
<layout-pro-notify class="hidden-xs"></layout-pro-notify>
<a nz-tooltip nzTooltipTitle="下载中心" nzTooltipPlacement="bottom" class="hidden-xs" target="_blank" href="/#/download"
rel="noopener noreferrer" class="alain-pro__header-item">
<i nz-icon nzType="cloud-download" nzTheme="outline" style="font-size: 18px;" ></i>
</a>
<!--RTL-->
<!-- <layout-pro-rtl></layout-pro-rtl> -->
<!--User-->

View File

@ -0,0 +1,13 @@
<page-header-wrapper [title]="'下载中心'"></page-header-wrapper>
<nz-card nzSize="small">
<!-- 搜索区 -->
<sf #sf mode="search" [schema]="schema" (formSubmit)="st.load(1)" (formReset)="resetSF()"></sf>
<!-- 数据列表 -->
<st #st multiSort [scroll]="{ x: '1200px' }" [size]="'small'" [data]="service.$api_get_page" [columns]="columns"
[req]="{ method: 'POST', allInBody: true, reName: { pi: 'pageIndex', ps: 'pageSize' }, params: reqParams }"
[res]="{ reName: { list: 'data.records', total: 'data.total' } }"
[page]="{ show: true, showSize: true, pageSizes: [10, 20, 30, 50, 100, 200, 300, 500, 1000] }"
[loading]="service.http.loading">
</st>
</nz-card>

View File

@ -0,0 +1,136 @@
import { Component, OnInit, ViewChild } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { STChange, STColumn, STComponent, STData } from '@delon/abc/st';
import { SFComponent, SFDateWidgetSchema, SFSchema, SFUISchema } from '@delon/form';
import { _HttpClient } from '@delon/theme';
import { NzModalService } from 'ng-zorro-antd/modal';
import { DownloadService } from '../../services/download.service';
@Component({
selector: 'app-download-center-components-list',
templateUrl: './list.component.html',
})
export class DownloadComponentsListComponent implements OnInit {
ui: SFUISchema = {};
schema: SFSchema = {};
columns: STColumn[] = [];
@ViewChild('st', { static: false }) st!: STComponent;
@ViewChild('sf', { static: false }) sf!: SFComponent;
constructor(public service: DownloadService, private modal: NzModalService, private router: Router, private ar: ActivatedRoute) {}
/**
* 查询参数
*/
get reqParams() {
const params = Object.assign({}, this.sf?.value || {});
delete params._$expand;
return { ...params };
}
/**
* 重置表单
*/
resetSF() {
this.sf.reset();
}
/**
* 程序初始化入口
*/
ngOnInit() {
this.initSF();
this.initST();
}
/**
* 初始化查询表单
*/
initSF() {
this.schema = {
properties: {
_$expand: {
type: 'boolean',
ui: { hidden: true },
},
applyStartTime: {
type: 'string',
title: '创建时间',
ui: {
widget: 'date',
format: 'yyyy-MM-dd',
end: 'applyEndTime',
} as SFDateWidgetSchema,
},
applyEndTime: {
type: 'string',
title: '',
ui: { widget: 'date', end: 'end' } as SFDateWidgetSchema,
},
},
};
this.ui = { '*': { spanLabelFixed: 80, grid: { span: 8, gutter: 4 } } };
}
/**
* 初始化数据列表
*/
initST() {
this.columns = [
{ title: '文件名称', index: 'dataSourcesDetail', className: 'text-center' },
{ title: '文件来源', index: 'dataSources', className: 'text-center' },
{ title: '文件大小', index: 'dataSize', width: '120px', className: 'text-center' },
{
title: '生成状态',
index: 'status',
width: '120px',
className: 'text-center',
type: 'enum',
enum: {
0: '生成中',
1: '已完成',
2: '失败',
},
},
{ title: '下载次数', index: 'downloadCount', width: '120px', className: 'text-center' },
{ title: '创建时间', index: 'createTime', width: '120px', className: 'text-center' },
{ title: '生成时间', index: 'completeTime', width: '180px', className: 'text-center' },
{
title: '操作',
fixed: 'right',
width: '170px',
className: 'text-center',
buttons: [
{ text: '下载', click: (_record) => this.download(_record), iif: (item) => item.status === 1 },
{ text: '删除', click: (_record) => this.delOne(_record), iif: (item) => item.status !== 0 },
],
},
];
}
/**
* 删除单个实例
* @param record 记录实例
*/
delOne(record: STData) {
const headers = [{ key: 'Content-Type', value: 'application/json' }];
this.modal.confirm({
nzTitle: '<i>删除确认</i>',
nzContent: `<b>即将删除 当前行数据,请仔细核对,避免误操作!<br>是否删除?</br>`,
nzOnOk: () =>
this.service.request(this.service.encodeUrlHeader(this.service.$api_del_many, headers), { fileKey: record.id }).subscribe((res) => {
if (res) {
this.service.msgSrv.success('数据删除成功!');
this.st?.reload();
}
}),
});
}
download(record: STData) {
const headers = [{ key: 'Content-Type', value: 'application/json' }];
this.service.downloadFile(
this.service.encodeUrlHeader(this.service.$api_download_file, headers),
{},
{ fileKey: record.fileUniqueKey },
'POST',
);
}
}

View File

@ -0,0 +1,14 @@
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { DownloadComponentsListComponent } from './components/list/list.component';
const routes: Routes = [
{ path: '', redirectTo: 'list', pathMatch: 'full' },
{ path: 'list', component: DownloadComponentsListComponent, data: { reuse: true } },
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule],
})
export class DownloadRoutingModule {}

View File

@ -0,0 +1,12 @@
import { NgModule, Type } from '@angular/core';
import { SharedModule } from '@shared';
import { DownloadComponentsListComponent } from './components/list/list.component';
import { DownloadRoutingModule } from './download-routing.module';
const COMPONENTS: Type<void>[] = [DownloadComponentsListComponent];
@NgModule({
imports: [SharedModule, DownloadRoutingModule],
declarations: COMPONENTS,
})
export class DownloadModule {}

View File

@ -0,0 +1,18 @@
import { Injectable, Injector } from '@angular/core';
import { BaseService } from '@shared';
@Injectable({
providedIn: 'root',
})
export class DownloadService extends BaseService {
// 删除多个实例接口地址
$api_del_many = '/scm/cms/cms/deleteRecordInfo/file';
// 获取实例分页数据接口地址
$api_get_page = '/api/mdc/pbc/asynExportInfo/getAsynExportInfoListPage';
// 下载文件
$api_download_file = '/api/mdc/pbc/download/file';
constructor(public injector: Injector) {
super(injector);
}
}

View File

@ -50,6 +50,7 @@ export class FreightAccountComponent implements OnInit {
this.modal.create({
nzTitle: '账户明细',
nzContent: AccountDetailComponent,
nzNoAnimation: true,
nzWidth: 600,
nzComponentParams: {},
nzFooter: null

View File

@ -38,12 +38,31 @@ const routes: Routes = [
{ path: 'ticket', loadChildren: () => import('./ticket-management/ticket-management.module').then(m => m.TicketManagementModule) },
{ path: 'supplygoods', loadChildren: () => import('./supply-goods/supply-goods.module').then(m => m.SupplyGoodsModule) },
{ path: 'vehicle', loadChildren: () => import('./vehicle/vehicle.module').then(m => m.VehicleModule) },
{ path: 'supply-management', loadChildren: () => import('./supply-management/supply-management.module').then((m) => m.SupplyManagementModule) },
{ path: 'order-management', loadChildren: () => import('./order-management/order-management.module').then((m) => m.OrderManagementModule) },
{ path: 'waybill-management', loadChildren: () => import('./waybill-management/waybill-management.module').then((m) => m.WaybillManagementModule) },
{ path: 'financial-management', loadChildren: () => import('./financial-management/financial-management.module').then((m) => m.FinancialManagementModule) },
{ path: 'contract-management', loadChildren: () => import('./contract-management/contract-management.module').then((m) => m.ContractManagementManagementModule) },
{ path: 'menu-management', loadChildren: () => import('./menu-manager/menu-manager.module').then((m) => m.MenuManagerModule) },
{
path: 'supply-management',
loadChildren: () => import('./supply-management/supply-management.module').then(m => m.SupplyManagementModule)
},
{
path: 'order-management',
loadChildren: () => import('./order-management/order-management.module').then(m => m.OrderManagementModule)
},
{
path: 'waybill-management',
loadChildren: () => import('./waybill-management/waybill-management.module').then(m => m.WaybillManagementModule)
},
{
path: 'financial-management',
loadChildren: () => import('./financial-management/financial-management.module').then(m => m.FinancialManagementModule)
},
{
path: 'contract-management',
loadChildren: () => import('./contract-management/contract-management.module').then(m => m.ContractManagementManagementModule)
},
{ path: 'menu-management', loadChildren: () => import('./menu-manager/menu-manager.module').then(m => m.MenuManagerModule) },
{
path: 'download',
loadChildren: () => import('./download/download.module').then(m => m.DownloadModule)
}
]
},
// passport

View File

@ -4,6 +4,7 @@ import { STColumn, STColumnBadge, STComponent, STData } from '@delon/abc/st';
import { SFComponent, SFDateWidgetSchema, SFSchema, SFUISchema } from '@delon/form';
import { 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-usercenter-components-driver',
@ -100,6 +101,17 @@ export class UserCenterComponentsDriverComponent implements OnInit {
});
}
showAccountDetail(item: any) {
this.modal.create({
nzTitle: '资金账户',
nzContent: AccountDetailComponent,
nzNoAnimation: true,
nzWidth: 600,
nzComponentParams: { isCanCreate: true },
nzFooter: null
});
}
expandToggle() {
this._$expand = !this._$expand;
this.sf?.setValue('/expand', this._$expand);
@ -291,6 +303,10 @@ export class UserCenterComponentsDriverComponent implements OnInit {
{
text: '基础设置',
click: item => this.settingAction(item)
},
{
text: '资金账户',
click: item => this.showAccountDetail(item)
}
]
}

View File

@ -4,6 +4,7 @@ import { STColumn, STColumnBadge, STComponent, STData } from '@delon/abc/st';
import { SFComponent, SFSchema, SFUISchema } from '@delon/form';
import { 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-components-list',
@ -67,6 +68,17 @@ export class FreightComponentsListComponent implements OnInit {
});
}
showAccountDetail(item: any) {
this.modal.create({
nzTitle: '资金账户',
nzContent: AccountDetailComponent,
nzNoAnimation: true,
nzWidth: 600,
nzComponentParams: { isCanCreate: true },
nzFooter: null
});
}
initSF() {
this.schema = {
properties: {
@ -199,6 +211,10 @@ export class FreightComponentsListComponent implements OnInit {
{
text: '基础设置',
click: item => this.settingAction(item)
},
{
text: '资金账户',
click: item => this.showAccountDetail(item)
}
]
}

View File

@ -3,4 +3,20 @@
[res]="{ reName: { list: 'data.records', total: 'data.total' } }"
[page]="{ show: true, showSize: true, pageSizes: [10, 20, 30, 50, 100, 200, 300, 500, 1000] }"
[loading]="service.http.loading" [scroll]="{ y: '370px' }">
<ng-template st-row="ltdName" let-item let-index="index">
<ng-container *ngIf="isCanCreate; else elsePATemplate">
<a (click)="createPA(item)">{{ item.promotersTelephone || '添加' }}</a>
</ng-container>
<ng-template #elsePATemplate>
{{ item.promotersTelephone }}
</ng-template>
</ng-template>
<ng-template st-row="bankTypeLabel" let-item let-index="index">
<ng-container *ngIf="isCanCreate; else elsePFTemplate">
<a (click)="createPF(item)">{{ item.promotersTelephone || '添加' }}</a>
</ng-container>
<ng-template #elsePFTemplate>
{{ item.promotersTelephone }}
</ng-template>
</ng-template>
</st>

View File

@ -6,7 +6,7 @@ import { BaseService } from '../../services';
@Component({
selector: 'app-account-detail',
templateUrl: './account-detail.component.html',
providers:[CurrencyPipe]
providers: [CurrencyPipe]
})
export class AccountDetailComponent implements OnInit {
@ViewChild('st', { static: true })
@ -16,14 +16,14 @@ export class AccountDetailComponent implements OnInit {
url = '';
isCanCreate = false;
constructor(public service: BaseService, private currencyPipe: CurrencyPipe) {}
ngOnInit(): void {
setTimeout(() => {
this.initST();
}, 200);
constructor(public service: BaseService, private currencyPipe: CurrencyPipe) {
this.initST();
}
ngOnInit(): void {}
createPA(item: any) {}
createPF(item: any) {}
beforeReq = (requestOptions: STRequestOptions) => {
return requestOptions;
};
@ -33,13 +33,13 @@ export class AccountDetailComponent implements OnInit {
{ title: '网络货运人', index: 'phone', className: 'text-center' },
{
title: '平安账户余额',
index: 'ltdName',
render: 'ltdName',
type: 'currency',
format: item => `${this.currencyPipe.transform(item.availableBalance)}`
},
{
title: '浦发账户余额',
index: 'bankTypeLabel',
render: 'bankTypeLabel',
type: 'currency',
format: item => `${this.currencyPipe.transform(item.availableBalance)}`
}

View File

@ -60,7 +60,8 @@ import {
EyeInvisibleFill,
SolutionOutline,
MinusCircleOutline,
FileTwoTone
FileTwoTone,
CloudDownloadOutline
} from '@ant-design/icons-angular/icons';
export const ICONS_AUTO = [
@ -120,5 +121,6 @@ export const ICONS_AUTO = [
SwapOutline,
SolutionOutline,
MinusCircleOutline,
FileTwoTone
FileTwoTone,
CloudDownloadOutline
];