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

This commit is contained in:
wangshiming
2022-01-25 13:10:49 +08:00
18 changed files with 262 additions and 297 deletions

View File

@ -13,16 +13,8 @@
<div nz-row nzGutter="8">
<!-- 查询字段小于或等于3个时不显示伸缩按钮 -->
<div nz-col nzSpan="24" *ngIf="queryFieldCount <= 4">
<sf
#sf
[schema]="schema"
[ui]="ui"
[mode]="'search'"
[disabled]="!sf?.valid"
[loading]="service.http.loading"
(formSubmit)="st?.load(1)"
(formReset)="resetSF()"
></sf>
<sf #sf [schema]="schema" [ui]="ui" [mode]="'search'" [disabled]="!sf?.valid" [loading]="service.http.loading"
(formSubmit)="st?.load(1)" (formReset)="resetSF()"></sf>
</div>
<!-- 查询字段大于3个时根据展开状态调整布局 -->
@ -37,7 +29,8 @@
</sf>
</div>
<div nz-col [nzSpan]="_$expand ? 24 : 6" [class.text-right]="_$expand">
<button nz-button nzType="primary" [disabled]="!sf.valid" [nzLoading]="service.http.loading" (click)="st?.load(1)">查询</button>
<button nz-button nzType="primary" [disabled]="!sf.valid" [nzLoading]="service.http.loading"
(click)="st?.load(1)">查询</button>
<button nz-button (click)="resetSF()">重置</button>
<button nz-button nzType="link" (click)="expandToggle()">
{{ !_$expand ? '展开' : '收起' }}
@ -50,26 +43,13 @@
<nz-card class="content-box" nzBordered>
<div style="position: relative">
<nz-alert
nzType="info"
[nzMessage]="'当前共' + st?.total + '行记录已选择' + selectedRows.length + ''"
nzShowIcon
[ngStyle]="{ margin: '0 0 1rem 0' }"
>
<nz-alert nzType="info" [nzMessage]="'当前共' + st?.total + '行记录已选择' + selectedRows.length + ''" nzShowIcon
[ngStyle]="{ margin: '0 0 1rem 0' }">
</nz-alert>
</div>
<st
#st
[data]="service.$api_listDetailed_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"
[scroll]="{ x: '1200px', y: '370px' }"
(change)="stChange($event)"
>
<st #st [data]="service.$api_listDetailed_page" [columns]="columns" [req]="{ params: reqParams }"
[loading]="service.http.loading" [scroll]="{ x: '1200px', y: '370px' }" (change)="stChange($event)">
<ng-template st-row="contractCode" let-item let-index="index">
<a [routerLink]="'/contract-management/index/detail/' + item.id">{{ item?.contractCode }}</a>
</ng-template>
@ -80,13 +60,9 @@
<div nz-row nzGutter="8">
<div nz-col nzSpan="24" se-container [labelWidth]="80">
<se [col]="1" label="备注">
<textarea
nz-input
rows="3"
placeholder="同意可以不用填写原因 ,拒绝必须说明原因"
style="width: 325px; margin-left: 14px"
></textarea>
<textarea nz-input rows="3" placeholder="同意可以不用填写原因 ,拒绝必须说明原因"
style="width: 325px; margin-left: 14px"></textarea>
</se>
</div>
</div>
</ng-template>
</ng-template>

View File

@ -20,7 +20,7 @@ export class BasicSettingComponent implements OnInit {
}
getTypeList() {
this.service.request(this.service.$api_get_config_tree, { configFullKey: 'sys.config' }).subscribe((res: Array<any>) => {
this.service.request(this.service.$api_get_config_tree, { configFullKey: 'sys.config', extendType: 0 }).subscribe((res: Array<any>) => {
if (res?.length > 0) {
const typeData = res.find(config => config.configFullKey === 'sys.config');
if (typeData) {
@ -50,7 +50,6 @@ export class BasicSettingComponent implements OnInit {
}
saveAction(params: any) {
this.service.request(this.service.$api_update_config_batch, params).subscribe(res => {
if (res) {
this.service.msgSrv.success('修改配置成功');

View File

@ -74,11 +74,11 @@ export class RequestedInvoiceModalComponent implements OnInit {
{ title: '承运司机', index: 'driverinfo', width: 170 },
{
title: '总费用',
index: 'vatmoney',
index: 'billkpmoney',
width: 90,
type: 'widget',
className: 'text-right',
widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.vatmoney }) }
widget: { type: 'currency-chy', params: ({ record }) => ({ value: record.billkpmoney }) }
},
{
title: '运输费',

View File

@ -1,31 +0,0 @@
/*
* @Author: your name
* @Date: 2021-12-07 17:30:18
* @LastEditTime: 2021-12-09 17:47:33
* @LastEditors: your name
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: \tms-obc-web\src\app\routes\vehicle\components\list\img-view\img-view.component.spec.ts
*/
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { VehicleImgViewComponent } from './img-view.component';
describe('VehicleImgViewComponent', () => {
let component: VehicleImgViewComponent;
let fixture: ComponentFixture<VehicleImgViewComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [VehicleImgViewComponent],
}).compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(VehicleImgViewComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -7,69 +7,47 @@
* @FilePath: \tms-obc-web\src\app\routes\usercenter\components\freight\list\list.component.html
-->
<!-- 页头 -->
<page-header-wrapper ></page-header-wrapper>
<page-header-wrapper></page-header-wrapper>
<nz-card>
<!-- 搜索区 -->
<!-- 搜索表单 -->
<div nz-row nzGutter="8">
<!-- 查询字段小于或等于3个时不显示伸缩按钮 -->
<div nz-col nzSpan="24" *ngIf="queryFieldCount <= 4">
<sf
#sf
[schema]="schema"
[ui]="ui"
[mode]="'search'"
[disabled]="!sf?.valid"
(formSubmit)="st?.load(1)"
(formReset)="resetSF()"
></sf>
<div nz-col [nzSpan]="_$expand ? 24 : 18">
<sf #sf [schema]="schema" [ui]="ui" [compact]="true" [button]="'none'"></sf>
</div>
<div nz-col [nzSpan]="_$expand ? 24 : 6" class="text-right">
<button nz-button nzType="primary" [nzLoading]="service.http.loading" (click)="st?.load(1)">查询</button>
<button nz-button nzType="primary" [disabled]="service.http.loading" (click)="exportFire()" acl
[acl-ability]="'YUNLI-CART-DAOCHU'">导出</button>
<button nz-button [disabled]="service.http.loading" (click)="resetSF()">重置</button>
<button nz-button nzType="link" (click)="expandToggle()">
{{ !_$expand ? '展开' : '收起' }}
<i nz-icon [nzType]="!_$expand ? 'down' : 'up'"></i>
</button>
</div>
<!-- [loading]="service.http.loading" -->
<!-- 查询字段大于3个时根据展开状态调整布局 -->
<ng-container *ngIf="queryFieldCount > 4">
<div nz-col [nzSpan]="_$expand ? 24 : 18">
<sf #sf [schema]="schema" [ui]="ui" [compact]="true" [button]="'none'"></sf>
</div>
<div nz-col [nzSpan]="_$expand ? 24 : 6" class="text-right">
<button nz-button nzType="primary" [nzLoading]="service.http.loading" (click)="st?.load(1)">查询</button>
<button nz-button nzType="primary" [disabled]="service.http.loading" (click)="exportFire()">导出</button>
<button nz-button [disabled]="service.http.loading"(click)="resetSF()">重置</button>
<button nz-button nzType="link" (click)="expandToggle()">
{{ !_$expand ? '展开' : '收起' }}
<i nz-icon [nzType]="!_$expand ? 'down' : 'up'"></i>
</button>
</div>
</ng-container>
</div>
</nz-card>
<nz-card>
<!-- 数据列表 -->
<!-- [data]="service.$api_get_supplier_page" -->
<st
#st
[bordered]="true"
[scroll]="{ x: '1200px' }"
[columns]="columns"
[data]='service.$api_get_operate_list'
<st #st [bordered]="true" [scroll]="{ x: '1200px' }" [columns]="columns" [data]='service.$api_get_operate_list'
[req]="{ method: 'POST', allInBody: true, reName: { pi: 'pageIndex', ps: 'pageSize' }, params: reqParams }"
[res]="{ reName: { list: 'data.records', total: 'data.total' }, process: dataProcess }"
[page]="{ show: true, showSize: true, pageSizes: [10, 20, 30, 50, 100, 200, 300, 500, 1000] }"
[loading]="service.http.loading"
>
[loading]="service.http.loading">
<ng-template st-row="carLength" let-item let-index="index">
<div>{{item?.carModelLabel }}-{{item?.carLengthLabel? item?.carLengthLabel + '米' : ''}}-{{ item?.carLoad? item?.carLoad + '吨' : ''}}</div>
<div>{{item?.carModelLabel }}-{{item?.carLengthLabel? item?.carLengthLabel + '米' : ''}}-{{ item?.carLoad?
item?.carLoad + '吨' : ''}}</div>
</ng-template>
<ng-template st-row="isSelf" let-item let-index="index">
<div>
{{ item?.isSelf ? '是' : '否' }}
<div>
{{ item?.isSelf ? '是' : '否' }}
</div>
</ng-template>
<ng-template st-row="putOnRecord" let-item let-index="index">
<div>
{{ item?.putOnRecord ? '是' : '否' }}
<div>
{{ item?.putOnRecord ? '是' : '否' }}
</div>
</ng-template>
<ng-template st-row="approvalAuditStatus" let-item let-index="index">
@ -89,4 +67,4 @@
<nz-tag *elseBlock nzColor="success">正常</nz-tag>
</ng-template>
</st>
</nz-card>
</nz-card>

View File

@ -1,31 +0,0 @@
/*
* @Author: your name
* @Date: 2021-12-01 20:05:59
* @LastEditTime: 2021-12-01 20:35:33
* @LastEditors: your name
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: \tms-obc-web\src\app\routes\vehicle\components\list\list.component.spec.ts
*/
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { VehicleComponentsListComponent } from './list.component';
describe('VehicleComponentsListComponent', () => {
let component: VehicleComponentsListComponent;
let fixture: ComponentFixture<VehicleComponentsListComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [VehicleComponentsListComponent],
}).compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(VehicleComponentsListComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -9,11 +9,10 @@ import { map } from 'rxjs/operators';
import { VehicleService } from '../../../vehicle/services/vehicle.service';
@Component({
selector: 'app-Vehicle-components-list',
templateUrl: './list.component.html',
templateUrl: './list.component.html'
})
export class VehicleComponentsListComponent implements OnInit {
_$expand = false;
url = `/rule?_allow_anonymous=true`;
ui!: SFUISchema;
schema!: SFSchema;
@ -22,19 +21,13 @@ export class VehicleComponentsListComponent implements OnInit {
@ViewChild('sf', { static: false }) sf!: SFComponent;
constructor(public service: VehicleService, private modal: NzModalService, private router: Router, private ar: ActivatedRoute) {}
/**
* 查询字段个数navigate
*/
get queryFieldCount(): number {
return Object.keys(this.schema?.properties || {}).length;
}
/**
* 查询参数
*/
get reqParams() {
const params: any = {
...(this.sf && this.sf.value),
...(this.sf && this.sf.value)
};
if (this.sf?.value.effectiveDate) {
params.effectiveDateStart = this.sf?.value.effectiveDate[0];
@ -45,14 +38,10 @@ export class VehicleComponentsListComponent implements OnInit {
return params;
}
get selectedRows() {
return this.st?.list.filter((item) => item.checked) || [];
}
ngOnInit() {
this.initSF();
this.initST();
this.ar.url.subscribe((params) => {
this.ar.url.subscribe(params => {
this.st?.load(1);
});
}
@ -68,8 +57,8 @@ export class VehicleComponentsListComponent implements OnInit {
expand: {
type: 'boolean',
ui: {
hidden: true,
},
hidden: true
}
},
carNo: {
title: '车牌号',
@ -91,9 +80,6 @@ export class VehicleComponentsListComponent implements OnInit {
} else {
return of([]);
}
},
visibleIf: {
_$expand: (value: boolean) => value
}
} as SFSelectWidgetSchema
},
@ -103,20 +89,20 @@ export class VehicleComponentsListComponent implements OnInit {
ui: {
widget: 'dict-select',
containsAllLable: true,
params: { dictKey: 'car:color' },
},
params: { dictKey: 'car:color' }
}
},
carStatus: {
title: '运营状态',
type: 'string',
enum: [
{ label: '空闲', value: 0 },
{ label: '运输中', value: 1 },
{ label: '运输中', value: 1 }
],
ui: {
allowClear: true,
widget: 'select',
},
widget: 'select'
}
},
carModel: {
title: '车型',
@ -126,36 +112,36 @@ export class VehicleComponentsListComponent implements OnInit {
params: { dictKey: 'car:model' },
containsAllLable: true,
visibleIf: {
expand: (value: boolean) => value,
},
},
expand: (value: boolean) => value
}
}
},
carLength: {
title: '车长',
type: 'string',
ui: {
ui: {
widget: 'dict-select',
params: { dictKey: 'car:length' },
containsAllLable: true,
visibleIf: {
expand: (value: boolean) => value,
},
},
expand: (value: boolean) => value
}
}
},
isSelf: {
type: 'string',
title: '是否挂靠',
enum: [
{ label: '是', value: 1 },
{ label: '否', value: 0 },
{ label: '否', value: 0 }
],
ui: {
widget: 'select',
allowClear: true,
visibleIf: {
expand: (value: boolean) => value,
},
},
expand: (value: boolean) => value
}
}
},
driverLicenseStatus: {
type: 'string',
@ -163,16 +149,16 @@ export class VehicleComponentsListComponent implements OnInit {
enum: [
{ label: '正常', value: 1 },
{ label: '即将到期', value: 2 },
{ label: '已到期', value: 3},
{ label: '已到期', value: 3 }
],
default: '',
ui: {
widget: 'select',
allowClear: true,
visibleIf: {
expand: (value: boolean) => value,
},
},
expand: (value: boolean) => value
}
}
},
roadTransportStatus: {
type: 'string',
@ -180,16 +166,16 @@ export class VehicleComponentsListComponent implements OnInit {
enum: [
{ label: '正常', value: 1 },
{ label: '即将到期', value: 2 },
{ label: '已到期', value: 3},
{ label: '已到期', value: 3 }
],
ui: {
widget: 'select',
allowClear: true,
visibleIf: {
expand: (value: boolean) => value,
},
},
},
expand: (value: boolean) => value
}
}
}
// putOnRecord: {
// type: 'string',
// title: '是否已备案',
@ -204,7 +190,7 @@ export class VehicleComponentsListComponent implements OnInit {
// },
// },
// },
},
}
};
this.ui = { '*': { spanLabelFixed: 130, grid: { span: 8, gutter: 4 }, enter: () => this.st.load() } };
}
@ -212,43 +198,47 @@ export class VehicleComponentsListComponent implements OnInit {
initST() {
this.columns = [
// { title: '', type: 'checkbox', className: 'text-center' },
{ title: '车牌号', width:'150px', className: 'text-center', index: 'carNo' },
{ title: '车牌颜色', width:'150px', className: 'text-center', index: 'carNoColorLabel' },
{ title: '车型-车长-载重',width:'150px', className: 'text-center', render: 'carLength' },
{ title: '运营状态',width:'150px', className: 'text-center', index: 'carStatus',
type: 'badge',
badge: {
true: { text: '运输中', color: 'success' },
false: { text: '空闲', color: 'default' },
{ title: '车牌号', width: '150px', className: 'text-center', index: 'carNo' },
{ title: '车牌颜色', width: '150px', className: 'text-center', index: 'carNoColorLabel' },
{ title: '车型-车长-载重', width: '150px', className: 'text-center', render: 'carLength' },
{
title: '运营状态',
width: '150px',
className: 'text-center',
index: 'carStatus',
type: 'badge',
badge: {
true: { text: '运输中', color: 'success' },
false: { text: '空闲', color: 'default' }
}
},
},
{
title: '行驶证到期状态',
width:'180px',
width: '180px',
className: 'text-center',
index: 'driverLicenseStatus',
type: 'badge',
badge: {
1: { text: '正常', color: 'success' },
2: { text: '即将到期', color: 'warning' },
3: { text: '已到期', color: 'error' },
},
3: { text: '已到期', color: 'error' }
}
},
{
title: '道运证到期状态',
width:'180px',
width: '180px',
className: 'text-center',
index: 'roadTransportStatus',
type: 'badge',
badge: {
1: { text: '正常', color: 'success' },
2: { text: '即将到期', color: 'warning' },
3: { text: '已到期', color: 'error' },
},
3: { text: '已到期', color: 'error' }
}
},
{ title: '所有人',width:'150px', className: 'text-center', index: 'carOwner' },
{ title: '是否挂靠', width:'150px', className: 'text-center', render: 'isSelf', },
{ title: '挂靠协议', width:'150px', className: 'text-center', render: 'approvalAuditStatus' },
{ title: '所有人', width: '150px', className: 'text-center', index: 'carOwner' },
{ title: '是否挂靠', width: '150px', className: 'text-center', render: 'isSelf' },
{ title: '挂靠协议', width: '150px', className: 'text-center', render: 'approvalAuditStatus' },
// { title: '是否已备案', className: 'text-center', render: 'putOnRecord', },
{
@ -259,20 +249,19 @@ export class VehicleComponentsListComponent implements OnInit {
buttons: [
{
text: '查看',
click: (item) => {
this.router.navigate(['./detail', item.id], { relativeTo: this.ar,queryParams: { carId: item.carId } });
click: item => {
this.router.navigate(['./detail', item.id], { relativeTo: this.ar, queryParams: { carId: item.carId } });
// this.router.navigate(['./view', item.id], { relativeTo: this.ar, queryParams: { tenantId: item.tenantId } });
},
},
}
}
// {
// text: '申请备案',
// click: (item) => {
// },
// },
],
},
]
}
];
}
expandToggle() {
@ -280,7 +269,7 @@ export class VehicleComponentsListComponent implements OnInit {
this.sf?.setValue('/expand', this._$expand);
}
creat() {
this.router.navigate(['./new',], { relativeTo: this.ar });
this.router.navigate(['./new'], { relativeTo: this.ar });
}
/**
* 重置表单
@ -291,6 +280,6 @@ export class VehicleComponentsListComponent implements OnInit {
}
// 导出
exportFire() {
this.service.downloadFile(this.service.$api_carLicense_export, this.reqParams );
this.service.downloadFile(this.service.$api_carLicense_export, this.reqParams);
}
}

View File

@ -8,23 +8,41 @@
*/
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { ACLGuard, ACLGuardType } from '@delon/acl';
import { AuthGuard } from 'src/app/core/guards/auth.guard';
import { VehicleComponentsAuditComponent } from './components/audit/audit.component';
import { VehicleComponentsAuditDetailComponent } from './components/audit/detail/detail.component';
import { VehicleComponentsListDetailComponent } from './components/list/detail/detail.component';
import { VehicleComponentsListComponent } from './components/list/list.component';
const routes: Routes = [
{ path: 'list', component: VehicleComponentsListComponent },
{ path: 'list/detail/:id', component: VehicleComponentsListDetailComponent },
{ path: 'audit', component: VehicleComponentsAuditComponent },
{ path: 'audit/detail/:id', component: VehicleComponentsAuditDetailComponent },
{
path: '',
canActivate: [AuthGuard],
canActivateChild: [AuthGuard],
children: [
{
path: 'list',
component: VehicleComponentsListComponent,
data: { guard: { ability: ['YUNLI-CART-SEARCH'] } as ACLGuardType }
},
{
path: 'list/detail/:id',
component: VehicleComponentsListDetailComponent,
data: { guard: { ability: ['YUNLI-CART-DETAIL'] } as ACLGuardType }
},
{
path: 'audit',
component: VehicleComponentsAuditComponent,
data: { guard: { ability: ['YUNLI-CART--AUDIT-SEARCH1'] } as ACLGuardType }
},
{ path: 'audit/detail/:id', component: VehicleComponentsAuditDetailComponent }
]
}
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule],
exports: [RouterModule]
})
export class VehicleRoutingModule {}