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

This commit is contained in:
wangshiming
2022-01-04 21:05:49 +08:00
25 changed files with 632 additions and 252 deletions

View File

@ -62,7 +62,7 @@ export class BusinessInterceptor implements HttpInterceptor {
const header: any = {
appId: this.envSrv.env.appId,
tenantId: this.envSrv.env.tenantId,
enterpriseId: '0',
enterpriseId: this.envSrv.env.enterpriseId,
...position
};

View File

@ -1,8 +1,10 @@
import { HttpClient } from '@angular/common/http';
import { Inject, Injectable } from '@angular/core';
import { cacheConf } from '@conf/cache.conf';
import { sysConf } from '@conf/sys.conf';
import { ACLService } from '@delon/acl';
import { MenuService, SettingsService, TitleService, _HttpClient } from '@delon/theme';
import { AmapService, EAUserService } from '@shared';
import { AmapService, EACacheService, EAUserService } from '@shared';
import { NzSafeAny } from 'ng-zorro-antd/core/types';
import { NzIconService } from 'ng-zorro-antd/icon';
import { Observable, zip } from 'rxjs';
@ -27,6 +29,7 @@ export class StartupService {
private httpClient: _HttpClient,
private userSrv: EAUserService,
private amapService: AmapService,
public cacheSrv: EACacheService,
private coreSrv: CoreService
) {
iconSrv.addIcon(...ICONS_AUTO, ...ICONS);
@ -83,6 +86,11 @@ export class StartupService {
this.settingService.setApp(appData);
// 用户信息:包括姓名、头像、邮箱地址
this.settingService.setUser(userData);
this.cacheSrv.set(cacheConf.env, {
appId: sysConf.appId,
tenantId: userData?.tenantId || sysConf.tenantId,
enterpriseId: userData?.enterpriseId || sysConf.enterpriseId
});
// ACL设置权限为全量
this.aclService.setFull(true);
// 初始化菜单

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

@ -0,0 +1,166 @@
<nz-card>
<div nz-row [nzGutter]="8">
<div nz-col nzSpan="4">
<ul nz-menu nzMode="inline" class="card-height">
<li nz-menu-item [nzSelected]="idx === 0" (click)="changeType(idx)"
*ngFor="let item of tabs; let idx = index">
{{ item.name }}
</li>
</ul>
</div>
<div nz-col nzSpan="20" style="overflow: scroll">
<nz-card class="card-height" [nzBordered]="null" nzSize="small" *ngIf="selectedTab===0 || selectedTab===1">
<h2 style="font-weight: 800;">货主提现设置</h2>
<div nz-row nzGutter="8">
<div nz-col nzSpan="24" se-container [labelWidth]="100">
<se label="提现审核">
<nz-radio-group [(ngModel)]="formDate.isAudit">
<label nz-radio [nzValue]="false" class="ml-xl">关闭</label>
<label nz-radio [nzValue]="true" class="ml-xl">开启</label>
</nz-radio-group>
</se>
<se label="审核时间" style="margin-bottom: 0;">
<nz-radio-group [(ngModel)]="formDate.isEveryDay">
<label nz-radio [nzValue]="false" class="ml-xl block-radio">全天</label>
<label nz-radio [nzValue]="true" class="ml-xl block-radio">自定义</label>
</nz-radio-group>
</se>
<se [col]="1">
<nz-radio-group [(ngModel)]="formDate.isEveryWeek">
<label nz-radio [nzValue]="false" class="ml-xxl block-radio">
<div class="d-flex">
每天
<div class="ml-md" style="cursor:default">
<p style="color: #1890ff;cursor: pointer;">添加时间段</p>
<div class="mb-md">
<nz-time-picker nzFormat="HH:mm" nzPlaceHolder="开始时间"></nz-time-picker>
--
<nz-time-picker nzFormat="HH:mm" nzPlaceHolder="结束时间"></nz-time-picker>
<label style="color: #1890ff;cursor: pointer;" class="ml-md">删除</label>
</div>
</div>
</div>
</label>
<label nz-radio [nzValue]="true" class="ml-xxl block-radio mt-md">
<div class="d-flex">
每周
<div class="ml-md" style="cursor:default">
<p style="color: #1890ff;cursor: pointer;">添加星期</p>
<div class="mb-md">
<nz-checkbox-group [(ngModel)]="checkOptionsOne"></nz-checkbox-group>
</div>
<div>
<div class="mb-md">
<nz-time-picker nzFormat="HH:mm" nzPlaceHolder="开始时间">
</nz-time-picker>
--
<nz-time-picker nzFormat="HH:mm" nzPlaceHolder="结束时间">
</nz-time-picker>
<label style="color: #1890ff;cursor: pointer;"
class="ml-md">删除</label>
</div>
<p style="color: #1890ff;cursor: pointer;"> 添加时间段</p>
</div>
</div>
</div>
</label>
</nz-radio-group>
</se>
<se label="提现限额">
<div class="d-flex align-items-center ml-xl mb-md">
<label nz-checkbox>每日最多可提现</label>
<nz-input-group nzAddOnAfter="元" style="width: 150px;">
<input type="number" nz-input placeholder="请输入" />
</nz-input-group>
</div>
<div class="d-flex align-items-center ml-xl">
<label nz-checkbox>每月最多可提现</label>
<nz-input-group nzAddOnAfter="元" style="width: 150px;">
<input type="number" nz-input placeholder="请输入" />
</nz-input-group>
</div>
</se>
</div>
</div>
</nz-card>
<nz-card class="card-height" [nzBordered]="null" nzSize="small" *ngIf="selectedTab===2">
<h2 style="font-weight: 800;">路桥发票设置</h2>
<div nz-row nzGutter="8">
<div nz-col nzSpan="24" se-container [labelWidth]="100">
<se label="发票申请" style="margin-bottom: 0;">
<nz-radio-group [(ngModel)]="formDate.isAudit">
<label nz-radio [nzValue]="false" class="ml-xl">手动申请</label>
<label nz-radio [nzValue]="true" class="ml-xl">自动申请</label>
</nz-radio-group>
</se>
<se>
<p class="ml-xl" style="color: #7e7c7c;">开启自动申请后运单完成卸货后会自动根据运单信息申请ETC发票。</p>
</se>
</div>
</div>
</nz-card>
<nz-card class="card-height" [nzBordered]="null" nzSize="small" *ngIf="selectedTab===3">
<h2 style="font-weight: 800;">风险单监控</h2>
<div nz-row nzGutter="8">
<div nz-col nzSpan="24" se-container [labelWidth]="180">
<se [col]="1" label="早/晚于计划出发时间" style="margin-bottom: 8px;">
<nz-radio-group [(ngModel)]="formDate.isAudit">
<label nz-radio [nzValue]="false" class="ml-xl mt-sm">不限定</label>
<label nz-radio [nzValue]="true" class="ml-xl mt-sm">范围外报异常</label>
</nz-radio-group>
<nz-input-group nzAddOnAfter="小时" style="width: 200px;">
<input type="number" nz-input placeholder="请输入允许时间差" />
</nz-input-group>
</se>
<se [col]="1">
<p class="ml-xl" style="color: #7e7c7c;">当前时间与计划时间对比,允许如上合理范围内执行不报异常,差异在范围外则报异常</p>
</se>
<se [col]="1" label="早/晚于计划到达时间" style="margin-bottom: 8px;">
<nz-radio-group [(ngModel)]="formDate.isAudit">
<label nz-radio [nzValue]="false" class="ml-xl mt-sm">不限定</label>
<label nz-radio [nzValue]="true" class="ml-xl mt-sm">范围外报异常</label>
</nz-radio-group>
<nz-input-group nzAddOnAfter="小时" style="width: 200px;">
<input type="number" nz-input placeholder="请输入允许时间差" />
</nz-input-group>
</se>
<se [col]="1">
<p class="ml-xl" style="color: #7e7c7c;">当前时间与计划时间对比,允许如上合理范围内执行不报异常,差异在范围外则报异常</p>
</se>
<se [col]="1" label="损耗量" style="margin-bottom: 8px;">
<nz-radio-group [(ngModel)]="formDate.isAudit">
<label nz-radio [nzValue]="false" class="ml-xl mt-sm">不限定</label>
<label nz-radio [nzValue]="true" class="ml-xl mt-sm">范围外报异常</label>
</nz-radio-group>
<nz-input-group nzAddOnAfter="%" style="width: 200px;">
<input type="number" nz-input placeholder="请输入允许时间差" />
</nz-input-group>
</se>
<se [col]="1">
<p class="ml-xl" style="color: #7e7c7c;">签收量与装运量对比,允许如上合理范围内损耗不报异常,差异在范围外则报异常</p>
</se>
<se [col]="1" label="装货/卸货地距离范围" style="margin-bottom: 8px;">
<nz-radio-group [(ngModel)]="formDate.isAudit">
<label nz-radio [nzValue]="false" class="ml-xl mt-sm">不限定</label>
<label nz-radio [nzValue]="true" class="ml-xl mt-sm">范围外报异常</label>
</nz-radio-group>
<nz-input-group nzAddOnAfter="KM" style="width: 200px;">
<input type="number" nz-input placeholder="请输入允许时间差" />
</nz-input-group>
</se>
<se [col]="1">
<p class="ml-xl" style="color: #7e7c7c;">装货地和发货地、签收地和收货地距离对比,允许如上合理范围内执行不报异常,差异在范围外则报异常</p>
</se>
</div>
</div>
</nz-card>
<div class="mb-md save-btn">
<button class="ml-lg" nz-button nzSize="large" nzType="primary">保存</button>
</div>
</div>
</div>
</nz-card>

View File

@ -13,73 +13,24 @@
<nz-card class="card-height" [nzBordered]="null" nzSize="small" *ngIf="selectedTab===0 || selectedTab===1">
<h2 style="font-weight: 800;">货主提现设置</h2>
<div nz-row nzGutter="8">
<div nz-col nzSpan="24" se-container [labelWidth]="100">
<se label="提现审核">
<nz-radio-group [(ngModel)]="formDate.isAudit">
<label nz-radio [nzValue]="false" class="ml-xl">关闭</label>
<label nz-radio [nzValue]="true" class="ml-xl">开启</label>
</nz-radio-group>
</se>
<se label="审核时间" style="margin-bottom: 0;">
<nz-radio-group [(ngModel)]="formDate.isEveryDay">
<label nz-radio [nzValue]="false" class="ml-xl block-radio">全天</label>
<label nz-radio [nzValue]="true" class="ml-xl block-radio">自定义</label>
</nz-radio-group>
</se>
<se [col]="1">
<nz-radio-group [(ngModel)]="formDate.isEveryWeek">
<label nz-radio [nzValue]="false" class="ml-xxl block-radio">
<div class="d-flex">
每天
<div class="ml-md" style="cursor:default">
<p style="color: #1890ff;cursor: pointer;">添加时间段</p>
<div class="mb-md">
<nz-time-picker nzFormat="HH:mm" nzPlaceHolder="开始时间"></nz-time-picker>
--
<nz-time-picker nzFormat="HH:mm" nzPlaceHolder="结束时间"></nz-time-picker>
<label style="color: #1890ff;cursor: pointer;" class="ml-md">删除</label>
</div>
</div>
</div>
</label>
<label nz-radio [nzValue]="true" class="ml-xxl block-radio mt-md">
<div class="d-flex">
每周
<div class="ml-md" style="cursor:default">
<p style="color: #1890ff;cursor: pointer;">添加星期</p>
<div class="mb-md">
<nz-checkbox-group [(ngModel)]="checkOptionsOne"></nz-checkbox-group>
</div>
<div>
<div class="mb-md">
<nz-time-picker nzFormat="HH:mm" nzPlaceHolder="开始时间">
</nz-time-picker>
--
<nz-time-picker nzFormat="HH:mm" nzPlaceHolder="结束时间">
</nz-time-picker>
<label style="color: #1890ff;cursor: pointer;"
class="ml-md">删除</label>
</div>
<p style="color: #1890ff;cursor: pointer;"> 添加时间段</p>
</div>
</div>
</div>
</label>
</nz-radio-group>
</se>
<se label="提现限额">
<div class="d-flex align-items-center ml-xl mb-md">
<label nz-checkbox>每日最多可提现</label>
<nz-input-group nzAddOnAfter="元" style="width: 150px;">
<input type="number" nz-input placeholder="请输入" />
</nz-input-group>
</div>
<div class="d-flex align-items-center ml-xl">
<label nz-checkbox>每月最多可提现</label>
<nz-input-group nzAddOnAfter="元" style="width: 150px;">
<input type="number" nz-input placeholder="请输入" />
</nz-input-group>
</div>
<div nz-col nzSpan="24" se-container [labelWidth]="250">
<se [label]="item.name" *ngFor="let item of configList">
<ng-container [ngSwitch]="item.itemValue?.type">
<ng-container *ngSwitchCase="'radio'">
<nz-radio-group [(ngModel)]="item.itemValue.data">
<label nz-radio [nzValue]="false"
class="ml-xl">{{item.itemValue.falseLable}}</label>
<label nz-radio [nzValue]="true"
class="ml-xl">{{item.itemValue.trueLable}}</label>
</nz-radio-group>
</ng-container>
<ng-container *ngSwitchCase="'input'">
<nz-input-group [nzAddOnAfter]="item.itemValue.afterLable" style="width: 150px;" class="ml-md">
<input type="number" nz-input [(ngModel)]="item.itemValue.data"
placeholder="请输入" />
</nz-input-group>
</ng-container>
</ng-container>
</se>
</div>
</div>

View File

@ -39,13 +39,71 @@ export class BasicSettingComponent implements OnInit {
{ label: '周日', value: '周日' }
];
configList: any = [
{
configId: '1475393700370898945',
itemKey: 'goods.name.config.type.3.3',
itemType: 1,
itemValue: '{"data":false,"type":"radio","trueLable":"开启","falseLable":"关闭"}',
name: '货主是否可以设置车队长',
parentId: '0',
remark: ''
},
{
configId: '1475393700370898945',
itemKey: 'goods.name.config.type.3.4',
itemType: 1,
itemValue: '{"data":false,"type":"radio","trueLable":"开启","falseLable":"关闭"}',
name: '货主企业四要素校验开关',
parentId: '0',
remark: ''
},
{
configId: '1475393700370898945',
itemKey: 'goods.name.config.type.3.5',
itemType: 1,
itemValue: '{"data":false,"type":"radio","trueLable":"开启","falseLable":"关闭"}',
name: '货主提现功能开关',
parentId: '0',
remark: ''
},
{
configId: '1475393700370898945',
itemKey: 'goods.name.config.type.3.5',
itemType: 1,
itemValue: '{"data":"","type":"input","afterLable":"%"}',
name: '货主费率配置',
parentId: '0',
remark: ''
},
{
configId: '1475393700370898945',
itemKey: 'goods.name.config.type.3.5',
itemType: 1,
itemValue: '{"data":"5","type":"input","afterLable":"次"}',
name: '单个用户每天最大发送短信次数',
parentId: '0',
remark: ''
},
{
configId: '1475393700370898945',
itemKey: 'goods.name.config.type.3.5',
itemType: 1,
itemValue: '{"data":true,"type":"radio","trueLable":"开启","falseLable":"关闭","isCustom":true}',
name: '合同单权限',
parentId: '0',
remark: ''
}
];
constructor(private service: SystemService) {}
ngOnInit() {}
ngOnInit() {
this.configList = this.configList.map((item: any) => ({ ...item, itemValue: JSON.parse(item.itemValue) }));
}
changeType(type: number): void {
this.selectedTab = type;
console.log(type);
}
}

View File

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

View File

@ -61,17 +61,17 @@ export class StaffManagementComponent implements OnInit {
},
{
text: '冻结',
iif: item => item.stateLocked === 0,
iif: item => item.stateLocked === 0 && item.roleCode.split(',').indexOf('Administrator') === -1,
click: item => this.action(item, 1)
},
{
text: '超管转授',
iif: item => item.status === 0,
iif: item => item.stateLocked === 0 && item.roleCode.split(',').indexOf('Administrator') === -1,
click: item => this.transpowerAction(item)
},
{
text: '删除',
iif: item => item.stateLocked === 0,
iif: item => item.stateLocked === 0 && item.roleCode.split(',').indexOf('Administrator') === -1,
click: item => this.action(item, 3)
}
]
@ -124,12 +124,15 @@ export class StaffManagementComponent implements OnInit {
transpowerAction(item: any) {
const modal = this.nzModalService.create({
nzTitle: '超级管理员转授',
nzContent: BuyerTranspowerComponent,
nzComponentParams: { i: { ...item } },
nzFooter: null
});
modal.afterClose.subscribe(res => {
this.st.load();
if (res) {
this.st.load();
}
});
}

View File

@ -2,23 +2,9 @@
<div class="modal-title">{{ i.id === 0 ? '添加员工' : '编辑员工' }}</div>
</div>
<div>
<sf #sf [ui]="ui" [schema]="schema" [button]="'none'">
<ng-template sf-template="account" let-me let-ui="ui" let-schema="schema">
<sv-container labelWidth="1">
<sv label="">
<div class="staffBox">
<!-- <img [src]="i.avatar" alt="" /> -->
<dl>
<!-- <dt>{{ i.name }}</dt> -->
<dd>{{ i.phone }}</dd>
</dl>
</div>
</sv>
</sv-container>
</ng-template>
</sf>
<sf #sf [ui]="ui" [schema]="schema" [button]="'none'"></sf>
</div>
<div class="modal-footer">
<button nz-button type="button" (click)="close()">取消</button>
<button nz-button type="button" nzType="primary" (click)="sure()" [disabled]="!sf.valid">保存</button>
</div>
</div>

View File

@ -8,8 +8,7 @@ import { SystemService } from '../../../services/system.service';
@Component({
selector: 'app-system-add',
templateUrl: './staff-modal.component.html',
styleUrls: ['./staff-modal.less']
templateUrl: './staff-modal.component.html'
})
export class SystemStaffStaffModalComponent implements OnInit {
@ViewChild('sf', { static: false })
@ -17,20 +16,12 @@ export class SystemStaffStaffModalComponent implements OnInit {
i: any;
schema!: SFSchema;
ui!: SFUISchema;
roleList = [];
roleNames: any = [];
constructor(private modal: NzModalRef, public msgSrv: NzMessageService, public service: SystemService) {}
ngOnInit(): void {
if (this.i?.userId !== 0) {
// this.i.roleIds = this.i.roleId !== '' ? this.i.roleId.split(',') : [];
}
this.initSF(this.i);
}
initSF(staff: any) {
console.log(staff);
this.schema = {
properties: {
staffName: {
@ -59,10 +50,11 @@ export class SystemStaffStaffModalComponent implements OnInit {
asyncData: () => {
return this.service.request(this.service.$api_getAppRoleList).pipe(
map((res: any) => {
this.roleList = res;
return res.map((item: any) => {
return { label: item.roleName, value: item.id };
});
return res
.filter((role: any) => role.roleCode !== 'Administrator')
.map((item: any) => {
return { label: item.roleName, value: item.id };
});
})
);
}
@ -81,10 +73,10 @@ export class SystemStaffStaffModalComponent implements OnInit {
}
sure() {
// if (!this.sf.value.roleIds || this.sf.value.roleIds.length === 0) {
// this.service.msgSrv.error('员工角色不能为空!');
// return;
// }
if (!this.sf.value.roleId || this.sf.value.roleId.length === 0) {
this.service.msgSrv.error('员工角色不能为空!');
return;
}
if (this.i.userId === 0) {
const params: any = {
...this.sf.value,

View File

@ -1,25 +0,0 @@
.info {
width: 100%;
margin: 0 auto 10px auto;
color: #333;
text-indent: 24px;
}
.staffBox {
display: flex;
img {
width: 30px;
height: 30px;
overflow: hidden;
border-radius: 50px;
}
dl {
margin: 0 0 0 5px;
dt {
font-size: 14px;
line-height: 28px;
}
dd {
font-size: 12px;
}
}
}

View File

@ -1,22 +1,17 @@
<div class="modal-header">
<div class="modal-title">超级管理员转授</div>
</div>
<form nz-form #f="ngForm" se-container="1">
<se label="转授员工">张三13411223344</se>
<form nz-form #f="ngForm" se-container="1" labelWidth="100">
<se label="转授对象">{{i.name}}{{i.telephone}}</se>
<se style="margin:0">
<div class="code">为了账户安全,需超管手机验证({{ superPhone }}</div>
</se>
<se label="验证码">
<div class="inputBox">
<div nz-row [nzGutter]="8">
<div nz-col [nzSpan]="12">
<input nz-input name="smsVerifyCode" [(ngModel)]="smsVerifyCode" maxlength="6" placeholder="请输入短信验证码" />
</div>
<div nz-col [nzSpan]="12">
<button nz-button (click)="sendCode()" [disabled]="count > 0">
{{ count > 0 ? '请等待' + count + 's' : '发送验证码' }}
</button>
</div>
<div nz-row [nzGutter]="8">
<div nz-col [nzSpan]="12">
<input nz-input name="smsVerifyCode" [(ngModel)]="smsVerifyCode" maxlength="6" placeholder="请输入短信验证码" />
</div>
<div nz-col [nzSpan]="12">
<button nz-button (click)="sendCode()" [disabled]="count > 0">
{{ count > 0 ? '请等待' + count + 's' : '发送验证码' }}
</button>
</div>
</div>
</se>

View File

@ -4,24 +4,21 @@ import { interval } from 'rxjs';
import { take } from 'rxjs/operators';
import { DunHelper } from 'src/app/shared/components/captcha/dun.helper';
import { EACaptchaService } from 'src/app/shared/services/business/captcha.service';
import { SystemService } from '../../../services/system.service';
@Component({
selector: 'app-buyer-transpower',
templateUrl: './transpower.component.html',
styleUrls: ['./transpower.less']
templateUrl: './transpower.component.html'
})
export class BuyerTranspowerComponent implements OnInit {
record: any = {};
count = 0;
interval$: any;
i: any;
smsVerifyCode = '';
superPhone = '';
staffId = 1;
staffList: any = [];
constructor(
private modal: NzModalRef,
public captchaService: EACaptchaService,
public service: SystemService,
public eACaptchaService: EACaptchaService,
private dunHelper: DunHelper,
private cdr: ChangeDetectorRef
) {}
@ -30,24 +27,24 @@ export class BuyerTranspowerComponent implements OnInit {
this.getPhone();
}
getPhone() {
// this.service.request(this.service.$api_getAppLesseeAdmin).subscribe((res) => {
// console.log(res);
// if (res) {
// this.superPhone = res.telephone;
// }
// });
this.service.request(this.service.$api_get_app_admin_info).subscribe(res => {
if (res) {
this.superPhone = res.telephone;
}
});
}
sure() {
const params = {
appUserId: this.i.appUserId,
smsVerifyCode: this.smsVerifyCode
smsVerifyCode: this.smsVerifyCode,
telephone: this.i.telephone
};
// this.service.request(this.service.$api_shiftResellerAdmin, params).subscribe((res) => {
// if (res) {
// this.service.msgSrv.success('操作成功!');
// this.modal.close(true);
// }
// });
this.service.request(this.service.$api_set_shift_admin, params).subscribe(res => {
if (res) {
this.service.msgSrv.success('操作成功!');
this.modal.close(true);
}
});
}
close() {
this.modal.destroy();
@ -56,9 +53,9 @@ export class BuyerTranspowerComponent implements OnInit {
* 获取手机验证码
*/
sendCode() {
this.captchaService.getAppLesseeAdminSMVerificationCode().subscribe(res => {
this.eACaptchaService.request(this.eACaptchaService.$api_getAppLesseeAdminSMVerificationCode).subscribe(res => {
if (res.success && res.data.code === '1') {
this.captchaService.msgSrv.success('发送验证码成功');
this.eACaptchaService.msgSrv.success('发送验证码成功');
this.createInterval();
} else if (res.data.code === '503046') {
this.dunHelper.popUp().subscribe(_ => {
@ -66,7 +63,7 @@ export class BuyerTranspowerComponent implements OnInit {
this.dunHelper.destory();
});
} else {
this.captchaService.msgSrv.warning(res.msg);
this.eACaptchaService.msgSrv.warning(res.msg);
}
});
}

View File

@ -1,41 +0,0 @@
.info {
width : 90%;
margin : 0 auto;
color : #333;
text-indent: 24px;
}
.staffBox {
display : flex;
align-items: center;
img {
width : 30px;
height : 30px;
overflow : hidden;
border-radius: 50px;
}
dl {
margin: 0 0 0 5px;
dt {
font-size : 14px;
line-height: 28px;
}
dd {
font-size: 12px;
}
}
}
.inputBox {
position: relative;
a {
position: absolute;
top : 0;
right : 5px;
}
}

View File

@ -23,6 +23,11 @@ export class SystemService extends BaseService {
$api_delete_staff = '/api/mdc/cuc/userApp/deleteAppUser';
// 冻结或恢复员工
$api_free_or_resume_staff = '/api/mdc/cuc/userApp/freezeOrResumeStaff';
// 获取应用企业的管理员用户
$api_get_app_admin_info = `/api/mdc/cuc/userApp/getAppEnterpriseAdmin`;
// 运营管理后台转授超管角色
$api_set_shift_admin = `/api/mdc/cuc/userAuthority/shiftAdmin`;
// 分页获取应用角色列表
$api_get_role_page = '/api/mdc/cuc/roleInfo/getAppRoleInfoList';

View File

@ -10,7 +10,7 @@ import { Observable, Subject } from 'rxjs';
import { BaseService } from '../core/base.service';
@Injectable({
providedIn: 'root',
providedIn: 'root'
})
export class EACaptchaService extends BaseService {
// 通过手机号发送短信验证码
@ -26,7 +26,7 @@ export class EACaptchaService extends BaseService {
$api_captcha_sms_code = `/scce/pbc/pbc/verification/getSMVerificationCodeByToken`;
// 获取应用租户的管理员用户发送验证码
$api_getAppLesseeAdminSMVerificationCode = `/chiauserBasicInfo/getAppLesseeAdminSMVerificationCode`;
$api_getAppLesseeAdminSMVerificationCode = `/api/mdc/cuc/userAuthority/adminSmverificationCode?_allow_badcode=true`;
/**
* 根据当前登录用户绑定的手机号码获取短信验证码
@ -34,12 +34,7 @@ export class EACaptchaService extends BaseService {
getCaptchaBySMSNoPhone(): Observable<any> {
return this.request(this.$api_captcha_sms_code, { appId: this.envSrv.getEnvironment().appId }, 'POST', true, 'FORM');
}
/**
* 获取应用租户的管理员用户发送验证码
*/
getAppLesseeAdminSMVerificationCode(): Observable<any> {
return this.request(this.$api_getAppLesseeAdminSMVerificationCode, { appId: this.envSrv.getEnvironment().appId }, 'POST', true, 'FORM');
}
constructor(public injector: Injector) {
super(injector);
}
@ -54,7 +49,7 @@ export class EACaptchaService extends BaseService {
{ appId: this.envSrv.getEnvironment()?.appId, phoneNumber: mobile },
'POST',
true,
'FORM',
'FORM'
);
}
@ -70,7 +65,7 @@ export class EACaptchaService extends BaseService {
{ appId: this.envSrv.getEnvironment()?.appId, phoneNumber: mobile, user: mobile, validate },
'POST',
true,
'FORM',
'FORM'
);
}
}

View File

@ -5,7 +5,7 @@ import { BaseService } from '../core/base.service';
import { EACacheService } from './../core/cache.service';
@Injectable({
providedIn: 'root',
providedIn: 'root'
})
export class EAEnvironmentService extends BaseService {
constructor(public injector: Injector, private eaCacheSrv: EACacheService) {
@ -15,12 +15,13 @@ export class EAEnvironmentService extends BaseService {
/**
* 环境信息
*/
public get env(): { appId: string; tenantId: string } {
public get env(): { appId: string; tenantId: string; enterpriseId: string } {
const cacheEnv: any = this.eaCacheSrv.get(cacheConf.env);
// 附加环境变量
const env: { appId: string; tenantId: string } = {
const env: { appId: string; tenantId: string; enterpriseId: string } = {
appId: cacheEnv?.appId || sysConf.appId,
tenantId: cacheEnv?.tenantId || sysConf.tenantId,
enterpriseId: cacheEnv?.enterpriseId || sysConf.enterpriseId
};
return env;
}

View File

@ -135,6 +135,11 @@ export class EAUserService extends BaseService {
*/
async loadUserInfo() {
return this.asyncRequest(this.$api_get_user_by_token).then(res => {
this.cacheSrv.set(cacheConf.env, {
appId: sysConf.appId,
tenantId: res?.tenantId || sysConf.tenantId,
enterpriseId: res?.enterpriseId || sysConf.enterpriseId
});
this.cacheSrv.set(cacheConf.user, res);
this.settings.setUser(res);
});

View File

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

View File

@ -12,6 +12,10 @@ export const sysConf = {
* 租户ID
*/
tenantId: `1`,
/**
* 企业ID
*/
enterpriseId: `0`,
/**
* 登录路径
*/