This commit is contained in:
Taric Xin
2022-01-06 13:32:48 +08:00
parent a777f43a56
commit c2bba55a48
9 changed files with 93 additions and 73 deletions

View File

@ -1,4 +1,4 @@
<nz-card>
<nz-card [nzLoading]="service.http.loading">
<div nz-row [nzGutter]="8">
<div nz-col nzSpan="4">
<ul nz-menu nzMode="inline" class="card-height">

View File

@ -14,7 +14,7 @@ export class BasicSettingComponent implements OnInit {
configList: any = [];
constructor(private service: SystemService) {}
constructor(public service: SystemService) {}
ngOnInit() {
this.getTypeList();

View File

@ -1,16 +1,15 @@
<div nz-row nzGutter="8">
<div nz-col nzSpan="19">
<sf #sf [schema]="searchSchema" [ui]="{ '*': {grid: { span: 8 } }}" [compact]="true"
[button]="'none'"></sf>
<sf #sf [schema]="searchSchema" [ui]="{ '*': {grid: { span: 8 } }}" [compact]="true" [button]="'none'"></sf>
</div>
<div nz-col [nzSpan]="5" class="text-right mb-md">
<button nz-button nzType="primary" [nzLoading]="service.http.loading" (click)="st?.load(1)">查询</button>
<button nz-button (click)="resetSF()">重置</button>
</div>
</div>
<st #st [data]="service.$mock_url" [columns]="columns" bordered size="small"
[req]="{ method: 'POST', allInBody: true, reName: { pi: 'pageIndex', ps: 'pageSize' }, process: beforeReq }"
[res]="{ reName: { list: 'data.records', total: 'data.total' } }"
[page]="{ show: true, showSize: true, pageSizes: [10, 20, 30, 50, 100] }"
[loading]="service.http.loading" [scroll]="{ x:'810px',y: '400px' }" (change)="stChange($event)"></st>
</div>
<st #st [data]="service.$api_get_etc_list" [columns]="columns" bordered size="small"
[req]="{ method: 'POST', allInBody: true, reName: { pi: 'pageIndex', ps: 'pageSize' }, process: beforeReq }"
[res]="{ reName: { list: 'data.records', total: 'data.total' } }"
[page]="{ show: true, showSize: true, pageSizes: [10, 20, 30, 50, 100] }" [loading]="service.http.loading"
[scroll]="{ x:'810px',y: '400px' }" (change)="stChange($event)"></st>

View File

@ -1,8 +1,6 @@
import { Component, OnInit, ViewChild } from '@angular/core';
import { Router } from '@angular/router';
import { STComponent, STColumn, STRequestOptions, STChange } from '@delon/abc/st';
import { SFComponent, SFSchema, SFDateWidgetSchema } from '@delon/form';
import { NzModalService } from 'ng-zorro-antd/modal';
import { SFComponent, SFSchema } from '@delon/form';
import { TicketService } from '../../../services/ticket.service';
@Component({
@ -18,28 +16,33 @@ export class AddOwnerComponent implements OnInit {
sf!: SFComponent;
columns: STColumn[] = [
{ title: '', index: 'key', type: 'checkbox' },
{ title: '企业名称', index: 'no' },
{ title: '联系人姓名', index: 'callNo' },
{ title: '联系人手机号', index: 'callNo' },
{ title: '认证状态', index: 'callNo' }
{ title: '企业名称', index: 'enterpriseName' },
{ title: '联系人姓名', index: 'contacter' },
{ title: '联系人手机号', index: 'mobile' },
{
title: '认证状态',
index: 'approvalStatus',
type: 'enum',
enum: { 1: '未上传', 0: '草稿', 10: '待审核', 20: '已审核', 30: '已驳回', 40: '证件过期' }
}
];
searchSchema: SFSchema = {
properties: {
params1: {
enterpriseName: {
title: '',
type: 'string',
ui: {
placeholder: '请输入企业名称'
}
},
params2: {
contactName: {
title: '',
type: 'string',
ui: {
placeholder: '请输入姓名'
}
},
params3: {
mobile: {
title: '',
type: 'string',
ui: {
@ -49,11 +52,14 @@ export class AddOwnerComponent implements OnInit {
}
};
constructor(public service: TicketService, private nzModalService: NzModalService, private router: Router) {}
constructor(public service: TicketService) {}
ngOnInit(): void {}
beforeReq = (requestOptions: STRequestOptions) => {
Object.assign(requestOptions.body, {
listSource: 2
});
if (this.sf) {
Object.assign(requestOptions.body, {
...this.sf.value

View File

@ -31,7 +31,7 @@
<a *ngIf="selectedRows.length > 0" (click)="st.clearCheck()" class="ml-lg">清空</a>
</div>
</div>
<st #st [data]="service.$mock_url" [columns]="columns"
<st #st [data]="service.$api_get_etc_shipper_list" [columns]="columns"
[req]="{ method: 'POST', allInBody: true, reName: { pi: 'pageIndex', ps: 'pageSize' }, process: beforeReq }"
[res]="{ reName: { list: 'data.records', total: 'data.total' } }"
[page]="{ show: true, showSize: true, pageSizes: [10, 20, 30, 50, 100, 200, 300, 500, 1000] }"

View File

@ -87,7 +87,19 @@ export class ETCBlacklistComponent implements OnInit {
nzWidth: 850,
nzComponentParams: { data: [] },
nzOnOk: com => {
console.log(com.selectedData);
if (com.selectedData?.length <= 0) {
this.service.msgSrv.warning('请选择货主');
return false;
}
const ids = com.selectedData.map(node => node.id);
this.service.request(this.service.$api_save_etc_shipper, { shipperAppUserIdList: ids }).subscribe(res => {
if (res) {
this.service.msgSrv.success('添加成功');
modal.destroy();
this.st.load(1);
}
});
return false;
}
});
modal.afterClose.subscribe(res => {
@ -115,11 +127,41 @@ export class ETCBlacklistComponent implements OnInit {
}
deleteAction(item?: any) {
this.nzModalService.warning({
let ids: Array<string> = [];
if (item) {
ids = [item.id];
} else {
ids = this.selectedRows.map(node => node.id);
}
if (ids?.length <= 0) {
this.service.msgSrv.warning('请选择ETC白名单');
return;
}
const modal = this.nzModalService.warning({
nzTitle: this.tabType === 1 ? '确定将所选货主从ETC白名单中剔除' : '确定将所选车辆从ETC白名单中剔除',
nzClosable: false,
nzCancelText: '取消',
nzOnOk: () => {},
nzOnOk: () => {
if (this.tabType === 1) {
this.service.request(this.service.$api_delete_etc_shipper, ids).subscribe(res => {
if (res) {
this.service.msgSrv.success('删除成功');
this.st.load(1);
modal.destroy();
}
});
} else {
this.service.request(this.service.$api_delete_etc_shipper, ids).subscribe(res => {
if (res) {
this.service.msgSrv.success('删除成功');
this.st.load(1);
modal.destroy();
}
});
}
return false;
},
nzOkText: '确定'
});
}
@ -139,7 +181,7 @@ export class ETCBlacklistComponent implements OnInit {
hidden: true
}
},
params1: {
shipperAppUserName: {
title: '企业名称',
type: 'string',
ui: {
@ -149,7 +191,7 @@ export class ETCBlacklistComponent implements OnInit {
}
}
},
params2: {
contactName: {
title: '联系人姓名',
type: 'string',
ui: {
@ -159,7 +201,7 @@ export class ETCBlacklistComponent implements OnInit {
}
}
},
params3: {
contactPhoneNumber: {
title: '联系人手机号',
type: 'string',
ui: {
@ -206,28 +248,23 @@ export class ETCBlacklistComponent implements OnInit {
private initST(): STColumn[] {
return [
{ title: '', index: 'key', type: 'checkbox' },
{ title: '企业名称', index: 'no', iif: () => this.tabType === 1 },
{ title: '联系人姓名', index: 'no', iif: () => this.tabType === 1 },
{ title: '联系人手机号', index: 'no' },
{ title: '企业名称', index: 'shipperAppUserName', iif: () => this.tabType === 1 },
{ title: '联系人姓名', index: 'contactName', iif: () => this.tabType === 1 },
{ title: '联系人手机号', index: 'contactPhoneNumber' },
{
title: '认证状态',
className: 'text-center',
index: 'status',
type: 'badge',
badge: {
0: { text: '启用', color: 'success' },
2: { text: '禁用', color: 'error' },
3: { text: '禁用', color: 'error' },
1: { text: '禁用', color: 'error' }
},
index: 'certificationStatus',
type: 'enum',
enum: { 1: '未上传', 0: '草稿', 10: '待审核', 20: '已审核', 30: '已驳回', 40: '证件过期' },
iif: () => this.tabType === 1
},
{ title: '车牌号', index: 'no', iif: () => this.tabType === 2 },
{ title: '车辆所有人', index: 'no', iif: () => this.tabType === 2 },
{ title: '创建者', index: 'no' },
{ title: '创建者', index: 'createUserIdLabel' },
{
title: '创建时间',
index: 'updatedAt',
index: 'createTime',
type: 'date'
},
{

View File

@ -47,6 +47,16 @@ export class TicketService extends ShipperBaseService {
// 保存开票申请费用明细
$api_ficoVatappFee_save = '/api/fcc/ficoVatappFee/save';
// 查询ETC白名单货主
$api_get_etc_shipper_list = '/api/fcc/ficoShipperWhiteList/list/page';
// 删除ETC白名单货主
$api_delete_etc_shipper = '/api/fcc/ficoShipperWhiteList/deleteBatch';
// 保存ETC白名单货主
$api_save_etc_shipper = '/api/fcc/ficoShipperWhiteList/save';
// 查询ETC企业列表
$api_get_etc_list = '/api/mdc/cuc/enterpriseInfo/operate/etcList';
constructor(public injector: Injector,public eaCacheSrv: EACacheService) {
super(injector, eaCacheSrv);
}

View File

@ -1,25 +0,0 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { DictSelectComponent } from './dict-select.component';
describe('DictSelectComponent', () => {
let component: DictSelectComponent;
let fixture: ComponentFixture<DictSelectComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ DictSelectComponent ]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(DictSelectComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -10,11 +10,6 @@ import { AlainThemeModule } from '@delon/theme';
import { SHARED_DELON_MODULES } from './shared-delon.module';
import { SHARED_ZORRO_MODULES } from './shared-zorro.module';
// #region third libs
import { DragDropModule } from '@angular/cdk/drag-drop';
const THIRDMODULES = [DragDropModule];
// #endregion
// #region your componets & directives
import { PRO_SHARED_MODULES } from '../layout/pro';
import { AddressModule } from './components/address';
@ -64,7 +59,6 @@ const SHAREDCOMPONENTS = [LogisticsTimeLineComponent, DictSelectComponent];
...SHARED_ZORRO_MODULES,
...MODULES,
// third libs
...THIRDMODULES
],
exports: [
CommonModule,
@ -79,7 +73,6 @@ const SHAREDCOMPONENTS = [LogisticsTimeLineComponent, DictSelectComponent];
...SHARED_ZORRO_MODULES,
...MODULES,
// third libs
...THIRDMODULES,
...SHAREDCOMPONENTS
],
declarations: SHAREDCOMPONENTS