From bbfa5d5fb53c50ac1df340f4672404324cf2b559 Mon Sep 17 00:00:00 2001 From: "weiye.cheng" Date: Tue, 4 Jan 2022 18:43:43 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BF=9D=E5=8D=95=E6=A8=A1?= =?UTF-8?q?=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/policy/policy.component.html | 65 ++++++ .../policy/policy.component.spec.ts | 24 ++ .../components/policy/policy.component.ts | 205 ++++++++++++++++++ .../contract-management-routing.module.ts | 3 +- .../contract-management.module.ts | 5 +- .../services/contract-management.service.ts | 3 + src/assets/mocks/menu-data.json | 4 + 7 files changed, 306 insertions(+), 3 deletions(-) create mode 100644 src/app/routes/contract-management/components/policy/policy.component.html create mode 100644 src/app/routes/contract-management/components/policy/policy.component.spec.ts create mode 100644 src/app/routes/contract-management/components/policy/policy.component.ts diff --git a/src/app/routes/contract-management/components/policy/policy.component.html b/src/app/routes/contract-management/components/policy/policy.component.html new file mode 100644 index 00000000..ce3db2d0 --- /dev/null +++ b/src/app/routes/contract-management/components/policy/policy.component.html @@ -0,0 +1,65 @@ + + + + + +
+ +
+ +
+ + + +
+ +
+
+ + + +
+
+
+
+ + + + + + + + + +
+
+ + + {{paramValue}} + + + +
+
+
\ No newline at end of file diff --git a/src/app/routes/contract-management/components/policy/policy.component.spec.ts b/src/app/routes/contract-management/components/policy/policy.component.spec.ts new file mode 100644 index 00000000..b369df96 --- /dev/null +++ b/src/app/routes/contract-management/components/policy/policy.component.spec.ts @@ -0,0 +1,24 @@ +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { ContractManagementPolicyComponent } from './policy.component'; + +describe('ContractManagementPolicyComponent', () => { + let component: ContractManagementPolicyComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ ContractManagementPolicyComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(ContractManagementPolicyComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/contract-management/components/policy/policy.component.ts b/src/app/routes/contract-management/components/policy/policy.component.ts new file mode 100644 index 00000000..6026a506 --- /dev/null +++ b/src/app/routes/contract-management/components/policy/policy.component.ts @@ -0,0 +1,205 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { STColumn, STComponent, STChange } from '@delon/abc/st'; +import { SFComponent, SFSchema, SFDateWidgetSchema, SFUISchema } from '@delon/form'; +import { ModalHelper, _HttpClient } from '@delon/theme'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { TicketService } from '../../services/contract-management.service'; +import { Router } from '@angular/router'; + +@Component({ + selector: 'app-contract-management-policy', + templateUrl: './policy.component.html' +}) +export class ContractManagementPolicyComponent implements OnInit { + @ViewChild('st', { static: true }) + st!: STComponent; + @ViewChild('sf', { static: false }) + sf!: SFComponent; + @ViewChild('auditModal', { static: false }) + auditModal!: any; + schema: SFSchema = {}; + columns: STColumn[] = []; + ui: SFUISchema = {}; + @ViewChild('promoterModal', { static: false }) + promoterModal!: any; + _$expand = false; + + selectedRows: any[] = []; + paramValue = ''; + constructor(public service: TicketService, private modal: NzModalService, private router: Router) {} + + /** + * 查询参数 + */ + get reqParams() { + const params: any = { + ...(this.sf && this.sf.value) + }; + delete params.expand; + return params; + } + + ngOnInit(): void { + this.initST(); + this.initSF(); + } + + openDetail(item?: any) { + this.paramValue = item?.paramValue + const modal = this.modal.create({ + nzTitle: '传入值', + nzContent: this.promoterModal, + nzOnOk: () => { + return; + } + }); + + } + + initST() { + this.columns = [ + { title: '', type: 'checkbox', width: '50px', className: 'text-center' }, + { + title: '订单ID', + width: '100px', + className: 'text-center', + index: 'billId' + }, + { + title: '项目ID', + width: '100px', + className: 'text-center', + index: 'enterpriseProjectId' + }, + { + title: '保险公司', + width: '100px', + className: 'text-center', + index: 'insuranceCompany' + }, + { + title: '投保金额', + width: '100px', + className: 'text-center', + index: 'insureAmount' + }, + + { + title: '保单号', + width: '100px', + className: 'text-center', + index: 'policyNo' + }, + { + title: '保单地址', + width: '100px', + className: 'text-center', + index: 'policyUrl' + }, + { + title: '保费', + width: '100px', + className: 'text-center', + index: 'premium' + }, + { + title: '处理消息', + width: '100px', + className: 'text-center', + index: 'processMessage' + }, + { + title: '处理结果', + width: '100px', + className: 'text-center', + index: 'processResult' + }, + { + title: '操作', + width: '170px', + className: 'text-center', + buttons: [ + { + text: '查看传入值', + click: item => { + this.openDetail(item) + } + } + ] + } + ]; + } + + initSF() { + this.schema = { + properties: { + _$expand: { type: 'boolean', ui: { hidden: true } }, + billId: { + type: 'string', + title: '订单id' + }, + enterpriseProjectId: { + type: 'string', + title: '项目id' + }, + insuranceCompany: { + type: 'string', + title: '保险公司' + }, + policyNo: { + type: 'string', + title: '保单号' + }, + processResult: { + type: 'string', + title: '处理结果', + enum: [ + { label: '全部', value: '' }, + { label: '成功', value: 1 }, + { label: '失败', value: 2 } + ], + ui: { + widget: 'select', + placeholder: '请选择', + visibleIf: { + _$expand: (value: boolean) => value + }, + allowClear: true + } + } + }, + type: 'object' + }; + this.ui = { '*': { spanLabelFixed: 110, grid: { span: 8, gutter: 4 } } }; + } + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + this._$expand = false; + } + + /** + * 伸缩查询条件 + */ + expandToggle(): void { + this._$expand = !this._$expand; + this.sf?.setValue('/_$expand', this._$expand); + } + + get queryFieldCount(): number { + return Object.keys(this.schema?.properties || {}).length; + } + stChange(e: STChange): void { + switch (e.type) { + case 'checkbox': + this.selectedRows = e.checkbox!; + break; + case 'filter': + this.st.load(); + break; + } + } +} diff --git a/src/app/routes/contract-management/contract-management-routing.module.ts b/src/app/routes/contract-management/contract-management-routing.module.ts index 6459588c..a8109ccf 100644 --- a/src/app/routes/contract-management/contract-management-routing.module.ts +++ b/src/app/routes/contract-management/contract-management-routing.module.ts @@ -9,9 +9,10 @@ import { NgModule } from '@angular/core'; import { RouterModule, Routes } from '@angular/router'; import { ContractManagementContractListComponent } from './components/contract-list/contract-list.component'; +import { ContractManagementPolicyComponent } from './components/policy/policy.component'; const routes: Routes = [ { path: 'list', component: ContractManagementContractListComponent }, -]; + { path: 'policy', component: ContractManagementPolicyComponent }]; @NgModule({ imports: [RouterModule.forChild(routes)], diff --git a/src/app/routes/contract-management/contract-management.module.ts b/src/app/routes/contract-management/contract-management.module.ts index 8364e34d..10102991 100644 --- a/src/app/routes/contract-management/contract-management.module.ts +++ b/src/app/routes/contract-management/contract-management.module.ts @@ -11,10 +11,11 @@ import { CommonModule } from '@angular/common'; import { SharedModule } from '@shared'; import { ContractManagementManagementRoutingModule } from './contract-management-routing.module'; import { ContractManagementContractListComponent } from './components/contract-list/contract-list.component'; +import { ContractManagementPolicyComponent } from './components/policy/policy.component'; const COMPONENTS: any = [ - ContractManagementContractListComponent -]; + ContractManagementContractListComponent, + ContractManagementPolicyComponent]; const NOTROUTECOMPONENTS: any = []; @NgModule({ declarations: [...COMPONENTS, ...NOTROUTECOMPONENTS], diff --git a/src/app/routes/contract-management/services/contract-management.service.ts b/src/app/routes/contract-management/services/contract-management.service.ts index 59cef689..c9e912ce 100644 --- a/src/app/routes/contract-management/services/contract-management.service.ts +++ b/src/app/routes/contract-management/services/contract-management.service.ts @@ -5,6 +5,9 @@ import { BaseService } from 'src/app/shared/services'; providedIn: 'root' }) export class TicketService extends BaseService { + + $api_get_getPremiumInformationPage = `/api/sdc/billOperate/listPremiumInformationPage`; + constructor(public injector: Injector) { super(injector); } diff --git a/src/assets/mocks/menu-data.json b/src/assets/mocks/menu-data.json index fd9f7dbe..b690639b 100644 --- a/src/assets/mocks/menu-data.json +++ b/src/assets/mocks/menu-data.json @@ -380,6 +380,10 @@ "icon": "anticon anticon-dashboard", "group": true, "children": [ + { + "text": "保单管理", + "link": "/contract-management/policy" + }, { "text": "合同列表", "link": "/contract-management/list"