添加保单模块

This commit is contained in:
weiye.cheng
2022-01-04 18:43:43 +08:00
parent fb0b0036be
commit bbfa5d5fb5
7 changed files with 306 additions and 3 deletions

View File

@ -0,0 +1,65 @@
<page-header [action]="phActionTpl">
<ng-template #phActionTpl> </ng-template>
</page-header>
<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"
[loading]="service.http.loading"
(formSubmit)="st?.load(1)"
(formReset)="resetSF()"
></sf>
</div>
<!-- 查询字段大于3个时根据展开状态调整布局 -->
<ng-container>
<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]="_$expand">
<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 ? '展开' : '收起' }}
<i nz-icon [nzType]="!_$expand ? 'down' : 'up'"></i>
</button>
</div>
</ng-container>
</div>
</nz-card>
<nz-card>
<st
#st
[data]="service.$api_get_getPremiumInformationPage"
[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] }"
[loadingDelay]="500"
[loading]="service.http.loading"
>
</st>
</nz-card>
<ng-template #promoterModal>
<div nz-row nzGutter="8">
<div nz-col nzSpan="24" se-container [labelWidth]="80">
<sv-container col="1">
<sv label="传入值" [col]="1">
{{paramValue}}
</sv>
</sv-container>
</div>
</div>
</ng-template>

View File

@ -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<ContractManagementPolicyComponent>;
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
declarations: [ ContractManagementPolicyComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(ContractManagementPolicyComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -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;
}
}
}

View File

@ -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)],

View File

@ -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],

View File

@ -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);
}

View File

@ -380,6 +380,10 @@
"icon": "anticon anticon-dashboard",
"group": true,
"children": [
{
"text": "保单管理",
"link": "/contract-management/policy"
},
{
"text": "合同列表",
"link": "/contract-management/list"