From c2bba55a4887fa2fe99bf9a0356186d52b4ce972 Mon Sep 17 00:00:00 2001 From: Taric Xin Date: Thu, 6 Jan 2022 13:32:48 +0800 Subject: [PATCH] edit --- .../basic-setting.component.html | 2 +- .../basic-setting/basic-setting.component.ts | 2 +- .../add-owner/add-owner.component.html | 15 ++-- .../add-owner/add-owner.component.ts | 28 ++++--- .../etc-blacklist.component.html | 2 +- .../etc-blacklist/etc-blacklist.component.ts | 75 ++++++++++++++----- .../services/ticket.service.ts | 10 +++ .../dict-select/dict-select.component.spec.ts | 25 ------- src/app/shared/shared.module.ts | 7 -- 9 files changed, 93 insertions(+), 73 deletions(-) delete mode 100644 src/app/shared/components/dict-select/dict-select.component.spec.ts diff --git a/src/app/routes/sys-setting/components/basic-setting/basic-setting.component.html b/src/app/routes/sys-setting/components/basic-setting/basic-setting.component.html index 7ab9b34d..fbd7880f 100644 --- a/src/app/routes/sys-setting/components/basic-setting/basic-setting.component.html +++ b/src/app/routes/sys-setting/components/basic-setting/basic-setting.component.html @@ -1,4 +1,4 @@ - +
    diff --git a/src/app/routes/sys-setting/components/basic-setting/basic-setting.component.ts b/src/app/routes/sys-setting/components/basic-setting/basic-setting.component.ts index f40d2acc..c6b8dce2 100644 --- a/src/app/routes/sys-setting/components/basic-setting/basic-setting.component.ts +++ b/src/app/routes/sys-setting/components/basic-setting/basic-setting.component.ts @@ -14,7 +14,7 @@ export class BasicSettingComponent implements OnInit { configList: any = []; - constructor(private service: SystemService) {} + constructor(public service: SystemService) {} ngOnInit() { this.getTypeList(); diff --git a/src/app/routes/ticket-management/components/etc-blacklist/add-owner/add-owner.component.html b/src/app/routes/ticket-management/components/etc-blacklist/add-owner/add-owner.component.html index d862483c..3f80d138 100644 --- a/src/app/routes/ticket-management/components/etc-blacklist/add-owner/add-owner.component.html +++ b/src/app/routes/ticket-management/components/etc-blacklist/add-owner/add-owner.component.html @@ -1,16 +1,15 @@
    - +
    +
    - -
\ No newline at end of file + \ No newline at end of file diff --git a/src/app/routes/ticket-management/components/etc-blacklist/add-owner/add-owner.component.ts b/src/app/routes/ticket-management/components/etc-blacklist/add-owner/add-owner.component.ts index 1d63fcef..4209fce7 100644 --- a/src/app/routes/ticket-management/components/etc-blacklist/add-owner/add-owner.component.ts +++ b/src/app/routes/ticket-management/components/etc-blacklist/add-owner/add-owner.component.ts @@ -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 diff --git a/src/app/routes/ticket-management/components/etc-blacklist/etc-blacklist.component.html b/src/app/routes/ticket-management/components/etc-blacklist/etc-blacklist.component.html index 0486b87c..52edb998 100644 --- a/src/app/routes/ticket-management/components/etc-blacklist/etc-blacklist.component.html +++ b/src/app/routes/ticket-management/components/etc-blacklist/etc-blacklist.component.html @@ -31,7 +31,7 @@ 清空
- { - 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 = []; + 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' }, { diff --git a/src/app/routes/ticket-management/services/ticket.service.ts b/src/app/routes/ticket-management/services/ticket.service.ts index bf322d48..e9cafc40 100644 --- a/src/app/routes/ticket-management/services/ticket.service.ts +++ b/src/app/routes/ticket-management/services/ticket.service.ts @@ -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); } diff --git a/src/app/shared/components/dict-select/dict-select.component.spec.ts b/src/app/shared/components/dict-select/dict-select.component.spec.ts deleted file mode 100644 index d5aa71e4..00000000 --- a/src/app/shared/components/dict-select/dict-select.component.spec.ts +++ /dev/null @@ -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; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - declarations: [ DictSelectComponent ] - }) - .compileComponents(); - }); - - beforeEach(() => { - fixture = TestBed.createComponent(DictSelectComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/shared/shared.module.ts b/src/app/shared/shared.module.ts index 1bfce680..7cd39308 100644 --- a/src/app/shared/shared.module.ts +++ b/src/app/shared/shared.module.ts @@ -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