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

This commit is contained in:
wangshiming
2022-02-22 19:32:10 +08:00
13 changed files with 110 additions and 2017 deletions

View File

@ -80,7 +80,7 @@ export class AuthGuard extends ACLGuard {
}
for (const key of Object.keys(params)) {
if (_route.indexOf(params[key]) > -1) {
_route = _route.replace(params[key], ':id');
_route = _route.replace(params[key], ':' + key);
}
}

View File

@ -1,15 +1,16 @@
<div class="modal-header">
<div class="modal-title">{{ i.id === 0 ? '新增角色' : '编辑角色' }}</div>
<div class="modal-title">{{ params.id === 0 ? '新增角色' : '编辑角色' }}</div>
</div>
<nz-spin *ngIf="!i" class="modal-spin"></nz-spin>
<div *ngIf="i">
<sf #sf [compact]="true" [ui]="ui" [schema]="schema" [button]="'none'"> </sf>
<nz-spin *ngIf="!params" class="modal-spin"></nz-spin>
<div *ngIf="params">
<sf #sf [compact]="true" [ui]="{'*': { spanLabelFixed: 120, grid: { span: 24 } } }" [schema]="schema"
[button]="'none'"> </sf>
</div>
<div class="box">
<se-container se-container="1">
<se label="角色权限" required [labelWidth]="120">
<app-cuc-menu #menu (changeData)="getData($event)" [type]="i.id === 0 ? 'add' : 'edit'" [source]="source"
[roleId]="i.id" [isAuthorityIdDTOList]="roleInfoData.authority || []"
<app-cuc-menu #menu (changeData)="getData($event)" [type]="params.id === 0 ? 'add' : 'edit'" [roleId]="params.id" [appId]="params.appId"
[isAuthorityIdDTOList]="roleInfoData.authority || []"
[authorityAssistId]="roleInfoData.authorityAssistId || []">
</app-cuc-menu>
</se>
@ -17,7 +18,6 @@
</div>
<div class="modal-footer">
<button nz-button type="button" (click)="close()">{{ source === 'onlyAuth' ? '关闭' : '取消' }}</button>
<button nz-button type="button" nzType="primary" (click)="sure()" *ngIf="source !== 'onlyAuth'"
[disabled]="!sf?.valid">确定</button>
<button nz-button type="button" (click)="close()">取消</button>
<button nz-button type="button" nzType="primary" (click)="sure()">确定</button>
</div>

View File

@ -18,25 +18,18 @@ export class SettingRoleEditComponent implements OnInit {
sf!: SFComponent;
@ViewChild('menu', { static: false })
menu!: SettingMenuComponent;
record: any = {};
roleInfoData: any = {};
authorityAssistId: any[] = [];
appList: any[] = [];
source = '';
i: any;
params: any;
schema!: SFSchema;
authority: any[] = [];
roleTplData: any[] = [];
ui!: SFUISchema;
constructor(private modal: NzModalRef, public service: SystemService, private envSrv: EAEnvironmentService) {}
constructor(private modal: NzModalRef, public service: SystemService) {}
ngOnInit(): void {
if (this.i.id) {
this.initSF();
if (this.params.id) {
this.getRoleInfo();
}
if (this.source === '') {
this.initSF();
}
}
initSF() {
this.schema = {
@ -57,7 +50,7 @@ export class SettingRoleEditComponent implements OnInit {
default: this.roleInfoData.roleDescription,
ui: {
autosize: { minRows: 3 },
hidden: this.i.lookType === 'detail',
hidden: this.params.lookType === 'detail',
placeholder: '请输入角色描述',
widget: 'textarea'
}
@ -65,46 +58,15 @@ export class SettingRoleEditComponent implements OnInit {
},
required: ['roleName']
};
this.ui = {
'*': {
spanLabelFixed: 120,
grid: { span: 24 }
}
};
}
getAppList() {
const params = {
pageSize: 10000,
pageIndex: 1
};
return this.service.request(this.service.$api_getAppList, params).pipe(
map(res => {
this.appList = res;
const versionArr: any[] = [];
const resArr = res;
if (resArr && resArr.length) {
resArr.forEach((item: any) => {
versionArr.push({
label: item.appName,
value: item.appId
});
});
}
return versionArr;
})
);
}
getRoleInfo() {
const params = {
id: this.i.id
id: this.params.id
};
this.service.request(this.service.$api_getRoleInfo, params).subscribe(res => {
this.service.request(this.params.infoUrl, params).subscribe(res => {
if (res) {
this.roleInfoData = res;
}
if (this.source === '') {
this.initSF();
}
});
@ -117,6 +79,10 @@ export class SettingRoleEditComponent implements OnInit {
this.modal.destroy();
}
sure() {
if (!this.sf?.valid) {
this.service.msgSrv.warning('校验错误');
return;
}
// this.menu.washTree();
// if (this.authorityAssistId.length === 0) {
// this.service.msgSrv.warning('请选择权限!');
@ -124,28 +90,20 @@ export class SettingRoleEditComponent implements OnInit {
// }
const auths = this.menu?.washTree();
const params: any = {
id: this.i.id,
id: this.params.id,
...this.sf.value,
authority: auths.authority,
authorityAssistId: auths.authorityAssistId
};
// if (this.sf) {
// this.appList.forEach(item => {
// if (item.appId === this.sf.value.appId) {
// params.tenantId = item.tenantId;
// }
// });
// }
// delete params.tplId;
if (this.i.id === 0) {
if (this.params.id === 0) {
delete params.id;
}
if (this.i.id) {
this.service.request(this.service.$api_update_role, params).subscribe(res => {
if (this.params.id) {
this.service.request(this.params.updateUrl, params).subscribe(res => {
this.modal.close(true);
});
} else {
this.service.request(this.service.$api_save_role, params).subscribe(res => {
this.service.request(this.params.addUrl, params).subscribe(res => {
this.modal.close(true);
});
}

View File

@ -1,10 +1,8 @@
import { ChangeDetectorRef, Component, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges, ViewChild } from '@angular/core';
import { ModalHelper, _HttpClient } from '@delon/theme';
import { EAEnvironmentService } from '@shared';
import { NzFormatEmitEvent, NzTreeNode, NzTreeNodeOptions } from 'ng-zorro-antd/core/tree';
import { NzTreeComponent } from 'ng-zorro-antd/tree';
import { SystemService } from '../../../services/system.service';
import { Funcs } from './funcs';
@Component({
selector: 'app-cuc-menu',
@ -20,17 +18,14 @@ export class SettingMenuComponent implements OnInit, OnChanges {
defaultExpandedKeys: any[] = [];
defaultCheckedKeys: any[] = [];
functionList: any[] = [];
selectProject: any = {};
selectApp: any = {};
@Input() type = 'edit';
@Input() source = '';
@Input() appId = this.envSrv.env.appId;
@Input() isAuthorityIdDTOList: any[] = [];
@Input() authorityAssistId: any[] = [];
@Input() roleId: any;
@Output() changeData = new EventEmitter();
constructor(public service: SystemService, private cdr: ChangeDetectorRef, private envSrv: EAEnvironmentService) {
this.getAllFunction();
}
constructor(public service: SystemService, private cdr: ChangeDetectorRef, private envSrv: EAEnvironmentService) {}
ngOnChanges(changes: SimpleChanges): void {
if (changes.isAuthorityIdDTOList) {
if (this.type === 'edit') {
@ -42,10 +37,12 @@ export class SettingMenuComponent implements OnInit, OnChanges {
}
}
ngOnInit() {}
ngOnInit() {
this.getAllFunction();
}
getAllFunction() {
this.service
.request(this.service.$api_getAllFunctionInfoByAppId, { appId: this.envSrv.env.appId }, 'POST', true, 'FORM')
.request(this.service.$api_getAllFunctionInfoByAppId, { appId: this.appId || this.envSrv.env.appId }, 'POST', true, 'FORM')
.subscribe(res => {
// if (this.source === 'onlyRelationAuth') {
// this.addDisabledTree(res);
@ -207,7 +204,7 @@ export class SettingMenuComponent implements OnInit, OnChanges {
}
});
}
addDisabledTree(arr: any[]) {
arr.forEach((item: any) => {
item.disableCheckbox = true;
@ -283,7 +280,7 @@ export class SettingMenuComponent implements OnInit, OnChanges {
}
});
}
initButtonList(id: any, origin: any) {
const params = {
id

View File

@ -1,4 +1,4 @@
<page-header-wrapper title="角色管理">
<page-header-wrapper [title]="params.title">
</page-header-wrapper>
<nz-card class="search-box">
@ -14,13 +14,12 @@
</div>
</nz-card>
<nz-card class="content-box">
<nz-card>
<div class="d-flex justify-content-end mb-sm">
<div>
<button nz-button nzType="primary" (click)="roleAction()">新建角色</button>
</div>
</div>
<st #st [data]="service.$api_get_role_page" [columns]="columns" [req]="{ process: beforeReq }"
[loading]="service.http.loading" [scroll]="{ y: '370px' }" (change)="stChange($event)"></st>
<st #st [data]="params.listUrl" [columns]="columns" [req]="{ process: beforeReq }" [loading]="service.http.loading"
[scroll]="{ y: '370px' }"></st>
</nz-card>

View File

@ -1,4 +1,5 @@
import { Component, OnInit, ViewChild } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { STComponent, STColumn, STChange, STRequestOptions } from '@delon/abc/st';
import { SFComponent, SFSchema } from '@delon/form';
import { NzModalService } from 'ng-zorro-antd/modal';
@ -8,7 +9,7 @@ import { SettingRoleEditComponent } from './edit/edit.component';
@Component({
selector: 'app-role-management',
templateUrl: './role-management.component.html',
styleUrls: ['./role-management.component.less']
styleUrls: ['../../../commom/less/box.less']
})
export class RoleManagementComponent implements OnInit {
@ViewChild('st', { static: true })
@ -29,12 +30,13 @@ export class RoleManagementComponent implements OnInit {
columns: STColumn[] = [
{ title: '角色名称', index: 'roleName' },
{ title: '角色描述', index: 'roleDescription' },
{ title: '企业数量', index: 'roleDescription', iif: _ => this.type === 'freight' },
{ title: '创建人手机号', index: 'telephone' },
{
title: '创建时间',
index: 'createTime',
className: 'text-left',
type: 'date',
className: 'text-left',
sort: true
},
{
@ -43,7 +45,7 @@ export class RoleManagementComponent implements OnInit {
{
text: '编辑',
click: item => this.roleAction(item),
// iif: item => item.roleName !== '超级管理员'
iif: item => item.roleName !== '超级管理员'
},
{
text: '删除',
@ -54,9 +56,34 @@ export class RoleManagementComponent implements OnInit {
}
];
selectedRows: any[] = [];
type = 'user';
params: any = {
listUrl: this.service.$api_get_role_page,
deleteUrl: this.service.$api_dalete_role,
infoUrl: this.service.$api_getRoleInfo,
addUrl: this.service.$api_save_role,
updateUrl: this.service.$api_update_role,
title:'角色管理'
};
constructor(public service: SystemService, private nzModalService: NzModalService) {}
constructor(public service: SystemService, private nzModalService: NzModalService, private route: ActivatedRoute) {
route.params.subscribe(({ type }) => {
if (type) {
this.type = type;
if (type !== 'user') {
this.params = {
listUrl: this.service.$api_get_role_page,
deleteUrl: this.service.$api_dalete_role,
infoUrl: this.service.$api_getRoleInfo,
addUrl: this.service.$api_save_role,
updateUrl: this.service.$api_update_role,
appId: 'A48F72F0A304427F921794BAD86B3522',
title:'企业角色管理'
};
}
}
});
}
ngOnInit(): void {}
@ -70,23 +97,17 @@ export class RoleManagementComponent implements OnInit {
return requestOptions;
};
stChange(e: STChange): void {
switch (e.type) {
case 'sort':
this.selectedRows = e.checkbox!;
break;
}
}
roleAction(item?: any) {
const modal = this.nzModalService.create({
nzContent: SettingRoleEditComponent,
nzWidth: 900,
nzComponentParams: item ? { i: { ...item } } : { i: { id: 0 } },
nzComponentParams: item ? { params: { ...item, ...this.params } } : { params: { id: 0 } },
nzFooter: null
});
modal.afterClose.subscribe(res => {
this.st.load();
if (res) {
this.st.load();
}
});
}
@ -96,7 +117,7 @@ export class RoleManagementComponent implements OnInit {
nzClosable: false,
nzCancelText: '取消',
nzOnOk: () => {
this.service.request(this.service.$api_dalete_role, [item.id]).subscribe(res => {
this.service.request(this.params.deleteUrl, [item.id]).subscribe(res => {
if (res) {
this.service.msgSrv.success('删除角色成功');
this.st.load();

View File

@ -27,7 +27,8 @@ import { NetworkFreightNewComponent } from './components/network-freight/new/new
const routes: Routes = [
{ path: 'staff-management', component: StaffManagementComponent },
{ path: 'role-management', component: RoleManagementComponent },
{ path: 'role-management/user/:type', component: RoleManagementComponent },
{ path: 'role-management/freight/:type', component: RoleManagementComponent },
{ path: 'basic-setting', component: BasicSettingComponent },
{ path: 'basic-config', component: BasicConfigComponent },
{ path: 'audit-reason-config', component: AuditReasonConfigComponent },
@ -41,7 +42,7 @@ const routes: Routes = [
{ path: 'close-account', component: CloseAccountComponent },
// { path: 'btn-management', component: BtnManagementComponent },
{ path: 'announcement-message', component: AnnouncementMessageComponent },
{ path: 'insurance-set', component: InsuranceSetComponent },
{ path: 'insurance-set', component: InsuranceSetComponent }
];
@NgModule({

View File

@ -22,7 +22,7 @@
{{headerInfo?.vatinvHAmount}} / {{headerInfo?.vatinvHAmount}}
</se>
<se label="已开发票张数">
2
{{headerInfo?.vatinvHNum}}
</se>
</div>
<div nz-col [nzXl]="8" [nzLg]="8" [nzSm]="8" [nzXs]="8" se-container [labelWidth]="100" col="1">
@ -50,7 +50,7 @@
{{headerInfo?.vatname}}
</se>
<se label="销货清单">
{{headerInfo?.isdetail}}
{{headerInfo?.isdetail?'是':'否'}}
</se>
<se label="其他要求">
{{headerInfo?.otherremarks}}
@ -96,15 +96,13 @@
<strong class="text-red">{{ selectedRows.length }}</strong> 条数据&nbsp;&nbsp; 开票金额总计 <strong
class="text-red">{{
totalCallNo }}</strong>
<a *ngIf="totalCallNo > 0" (click)="st.clearCheck()" class="ml-lg">清空</a>
<a *ngIf="selectedRows.length > 0" (click)="st.clearCheck()" class="ml-lg">清空</a>
</div>
</div>
<st #st [data]="service.$api_get_invoice_requested_order_detail" [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] }"
[loading]="service.http.loading" [scroll]="{ x:'1200px',y: '200px' }" (change)="stChange($event)">
<st #st [data]="service.$api_get_invoice_requested_order_detail" [columns]="columns" [req]="{ process: beforeReq }"
[res]="{ process: afterRes }" [loading]="service.http.loading" [scroll]="{ x:'1200px',y: '200px' }"
(change)="stChange($event)">
<ng-template st-row="billHCode" let-item let-index="index" let-column="column">
<a class="text-primary" (click)="routeToOrder(item)"> {{ item.billHCode }}</a>
</ng-template>

View File

@ -5,7 +5,6 @@ import { SFComponent, SFSchema, SFDateWidgetSchema, SFTextWidgetSchema } from '@
import { NzModalService } from 'ng-zorro-antd/modal';
import { TicketService } from '../../../services/ticket.service';
import { RequestedDetailComponent } from '../requested-detail/requested-detail.component';
import { RequestedInvoiceModalComponent } from '../requested-invoice-modal/requested-invoice-modal.component';
@Component({
selector: 'app-invoice-requested-detail',
@ -23,7 +22,7 @@ export class InvoiceRequestedDetailComponent implements OnInit {
detail: any = {};
selectedRows: any[] = [];
totalCallNo = 0;
totalCallNo = '0';
_$expand = false;
id = null;
@ -56,11 +55,22 @@ export class InvoiceRequestedDetailComponent implements OnInit {
return requestOptions;
};
afterRes = (data: any[], rawData?: any) => {
this.totalCallNo = data.reduce((total, cv) => total + cv.billkpmoney, 0).toFixed(2);
return data.map(item => ({
...item
}));
};
stChange(e: STChange): void {
switch (e.type) {
case 'checkbox':
this.selectedRows = e.checkbox!;
this.totalCallNo = (this.selectedRows.reduce((total, cv) => total + cv.billkpmoney, 0)).toFixed(2);;
if (this.selectedRows?.length > 0) {
this.totalCallNo = this.selectedRows.reduce((total, cv) => total + cv.billkpmoney, 0).toFixed(2);
} else {
this.totalCallNo = this.st._data.reduce((total, cv) => total + cv.billkpmoney, 0).toFixed(2);
}
break;
case 'filter':
this.st.load();

View File

@ -375,7 +375,7 @@ export class InvoiceRequestedComponent implements OnInit {
{ title: '银行账户', index: 'bankAccount', width: 140 },
{ title: '注册地址', index: 'registerAddr', width: 140 },
{ title: '注册电话', index: 'registerPhone', width: 120 },
{ title: '服务名称', index: 'vatname', width: 100 },
{ title: '服务名称', index: 'vatnameLabel', width: 150 },
{
title: '销货清单',
index: 'isdetail',

View File

@ -38,13 +38,13 @@
{{headerInfo?.ordlines}}
</se>
<se label="开票金额">
{{headerInfo?.vatinvHAmount}}
{{headerInfo?.vatinvHNumAmount}}
</se>
<se label="服务名称">
{{headerInfo?.vatname}}
{{headerInfo?.vatnameLabel}}
</se>
<se label="销货清单">
{{headerInfo?.isdetail}}
{{headerInfo?.isdetail?'是':'否'}}
</se>
<se label="其他要求">
{{headerInfo?.otherremarks}}

View File

@ -77,8 +77,14 @@ export class FreightComponentsListComponent implements OnInit {
nzWidth: 600,
nzComponentParams: {
isCanCreate: true,
url: '/api/fcc/accountBalance/getShipperAccountBalanceDetailByOperator',
params: { accountType: 1, roleId: item.id, ctfId: item.unifiedSocialCreditCode, clientName: item.enterpriseName }
url: '/api/fcc/accountBalance/getShipperAccountDetailByOperator',
params: {
accountType: 1,
roleId: item.id,
ctfId: item.unifiedSocialCreditCode,
clientName: item.enterpriseName,
ltdId: item.networkTransporter
}
},
nzFooter: null
});
@ -138,7 +144,7 @@ export class FreightComponentsListComponent implements OnInit {
{ label: '全部', value: '' },
{ label: '用户注册', value: 1 },
{ label: '货主添加', value: 2 },
{ label: '运营添加', value: 3},
{ label: '运营添加', value: 3 }
],
default: '',
ui: {