This commit is contained in:
Taric Xin
2021-12-07 20:56:18 +08:00
parent 4ad7282e51
commit 66283ddc3d
11 changed files with 249 additions and 10 deletions

View File

@ -2,7 +2,10 @@ import { Component, OnInit, ViewChild } from '@angular/core';
import { Router } from '@angular/router';
import { STComponent, STColumn, STChange } from '@delon/abc/st';
import { SFComponent, SFSchema, SFDateWidgetSchema } from '@delon/form';
import { NzModalService } from 'ng-zorro-antd/modal';
import { SystemStaffStaffModalComponent } from 'src/app/routes/sys-setting/components/staff-management/staff-modal/staff-modal.component';
import { SystemService } from 'src/app/routes/sys-setting/services/system.service';
import { SettingFinancialComponent } from './setting-financial/setting-financial.component';
@Component({
selector: 'app-main-account',
@ -53,7 +56,7 @@ export class MainAccountComponent implements OnInit {
buttons: [
{
text: '财务设置',
click: item => this.routeTo(item)
click: item => this.settingFinanical(item)
},
{
text: '合同设置',
@ -64,7 +67,7 @@ export class MainAccountComponent implements OnInit {
];
reqParams = { pageIndex: 1, pageSize: 10 };
constructor(public service: SystemService, private router: Router) {}
constructor(public service: SystemService, private router: Router, private nzModalService: NzModalService) {}
ngOnInit(): void {}
@ -76,6 +79,17 @@ export class MainAccountComponent implements OnInit {
}
}
settingFinanical(item: any) {
const modal = this.nzModalService.create({
nzContent: SettingFinancialComponent,
nzComponentParams: item ? { i: { ...item, roleId: '1,2,3', name: '用户名', phone: 18555555555 } } : { i: { id: 0 } },
nzFooter: null
});
modal.afterClose.subscribe(res => {
this.st.load();
});
}
routeTo(item?: any) {
this.router.navigate(['/financial-management/driver-account-detail/1']);
}

View File

@ -0,0 +1,11 @@
<div class="modal-header">
<div class="modal-title">财务设置</div>
</div>
<div>
<sf #sf [compact]="true" [ui]="{'*': { spanLabelFixed: 120, grid: { span: 24 }}}" [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>

View File

@ -0,0 +1,130 @@
import { Component, OnInit, ViewChild } from '@angular/core';
import { SFComponent, SFSchema, SFUISchema } from '@delon/form';
import { EAEnterpriseService } from '@shared';
import { NzMessageService } from 'ng-zorro-antd/message';
import { NzModalRef } from 'ng-zorro-antd/modal';
import { SystemService } from 'src/app/routes/sys-setting/services/system.service';
@Component({
selector: 'app-setting-financial',
templateUrl: './setting-financial.component.html',
styleUrls: ['./setting-financial.component.less']
})
export class SettingFinancialComponent implements OnInit {
@ViewChild('sf', { static: false })
sf!: SFComponent;
i: any;
schema!: SFSchema;
roleList = [];
roleNames: any = [];
constructor(
private modal: NzModalRef,
public msgSrv: NzMessageService,
public service: SystemService,
private enterpriseSrv: EAEnterpriseService
) {}
ngOnInit(): void {
if (this.i?.id !== 0) {
this.i.roleIds = this.i.roleId !== '' ? this.i.roleId.split(',') : [];
}
this.initSF(this.i);
}
initSF(staff: any) {
console.log(staff);
this.schema = {
properties: {
name: {
title: '公司名称',
type: 'string',
ui: { widget: 'string', placeholder: '请输入公司名称' },
default: staff.name
},
phone: {
title: '纳税人识别号',
type: 'string',
format: 'mobile',
ui: { widget: 'string', placeholder: '请输入纳税人识别号' },
default: staff.phone
},
phone2: {
title: '税收分类编码',
type: 'string',
format: 'mobile',
ui: { widget: 'string', placeholder: '请输入税收分类编码' },
default: staff.phone
},
phone3: {
title: '发票税率',
type: 'string',
format: 'mobile',
ui: { widget: 'string', placeholder: '请输入发票税率' },
default: staff.phone
},
phone4: {
title: '附加费比例',
type: 'string',
format: 'mobile',
ui: { widget: 'string', placeholder: '请输入附加费比例' },
default: staff.phone
}
},
required: ['name', 'phone', 'phone2', 'phone3', 'phone4']
};
}
sure() {
if (!this.sf.value.roleIds || this.sf.value.roleIds.length === 0) {
this.service.msgSrv.error('员工角色不能为空!');
return;
}
this.roleNames = [];
this.roleList.forEach((item: { id: any; roleName: string }) => {
this.sf.value.roleIds.forEach((ele: any) => {
if (ele === item.id) {
this.roleNames.push(item.roleName);
}
});
});
if (this.i.id === 0) {
const params: any = {
...this.sf.value,
roleId: this.sf.value.roleIds,
roleNames: this.roleNames.join(','),
telephone: this.sf.value.phone,
staffName: this.sf.value.name
};
// this.service.request(this.service.$api_addStaff, params).subscribe((res) => {
// console.log(res);
// if (res) {
// this.service.msgSrv.success('保存成功!');
// this.modal.close(true);
// }
// // this.showInviteFlag = true;
// // this.inviteCode = res.inviteCode;
// });
} else {
const params: any = {
appUserId: this.i.appUserId,
staffName: this.sf.value.name,
roleId: this.sf.value.roleIds,
telephone: this.i.telephone
};
// this.service.request(this.service.$api_editorStaff, params).subscribe((res) => {
// this.service.msgSrv.success('编辑成功!');
// // this.loadMyIdentity();
// this.modal.close(true);
// });
}
}
loadMyIdentity() {
this.enterpriseSrv.loadEnterpises().subscribe((data: any[]) => {
this.enterpriseSrv.setCache(data);
});
}
close() {
this.modal.destroy();
}
}

View File

@ -0,0 +1,50 @@
<page-header-wrapper [title]="'提现详情'" [logo]="logo">
<ng-template #logo>
<button nz-button nz-tooltip nzTooltipTitle="返回上一页" (click)="goBack()">
<i nz-icon nzType="left" nzTheme="outline"></i>
</button>
</ng-template>
</page-header-wrapper>
<nz-card>
<nz-alert nzType="info" nzMessage="提现信息" class="mb-md"></nz-alert>
<div se-container [labelWidth]="100">
<se label="账户主体">
天津怡亚通物流科技有限公司
</se>
<se label="提现单号">
EA202110012313
</se>
<se label="提现状态">
已完成
</se>
<se label="提现时间">
2021-10-11 08:50:08
</se>
<se label="账户名称">
茅台集团
</se>
<se label="虚拟账户">
6202110111234
</se>
<se label="提现金额">
10000.00
</se>
<se label="提现手续费">
10.00
</se>
<se label="提现至银行卡">
招商银行(8889)
</se>
<se label="银行流水号">
P20181230123012385756
</se>
</div>
<nz-alert nzType="info" nzMessage="提现进度" class="mb-md"></nz-alert>
<div nz-row class="mt-xl">
<div nz-col nzSpan="12" nzOffset="1">
<app-logistics-time-line></app-logistics-time-line>
</div>
</div>
</nz-card>

View File

@ -0,0 +1,17 @@
:host::ng-deep {
.ant-alert-info {
background-color: #f3f3f3;
border : 1px solid #dbdbdb;
.ant-alert-message {
color: rgba(0, 0, 0, 0.85);
font-weight: 600;
font-size: 16px;
}
}
.ant-form-item {
margin-bottom: 15px;
}
}

View File

@ -0,0 +1,17 @@
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-withdrawals-detail',
templateUrl: './withdrawals-detail.component.html',
styleUrls: ['./withdrawals-detail.component.less']
})
export class WithdrawalsDetailComponent implements OnInit {
formDate: any = {};
constructor() {}
ngOnInit(): void {}
goBack() {
history.go(-1);
}
}

View File

@ -164,7 +164,7 @@ export class WithdrawalsRecordComponent implements OnInit {
add(): void {}
routeTo(item: any) {
this.router.navigate(['/ticket/invoice-requested-detail/1']);
this.router.navigate(['/financial-management/withdrawals-detail/1']);
}
auditAction(item: any) {

View File

@ -7,6 +7,7 @@ import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { FreightAccountDetailComponent } from './components/freight-account/freight-account-detail/freight-account-detail.component';
import { DriverAccountDetailComponent } from './components/driver-account/driver-account-detail/driver-account-detail.component';
import { WithdrawalsDetailComponent } from './components/withdrawals-record/withdrawals-detail/withdrawals-detail.component';
const routes: Routes = [
{ path: 'freight-account', component: FreightAccountComponent },
@ -15,6 +16,7 @@ const routes: Routes = [
{ path: 'driver-account-detail/:id', component: DriverAccountDetailComponent },
{ path: 'recharge-record', component: RechargeRecordComponent },
{ path: 'withdrawals-record', component: WithdrawalsRecordComponent },
{ path: 'withdrawals-detail/:id', component: WithdrawalsDetailComponent },
{ path: 'main-account', component: MainAccountComponent }
];

View File

@ -9,16 +9,19 @@ import { SharedModule } from '@shared';
import { FinancialManagementRoutingModule } from './financial-managemen-routing.module';
import { FreightAccountDetailComponent } from './components/freight-account/freight-account-detail/freight-account-detail.component';
import { DriverAccountDetailComponent } from './components/driver-account/driver-account-detail/driver-account-detail.component';
import { SettingFinancialComponent } from './components/main-account/setting-financial/setting-financial.component';
import { WithdrawalsDetailComponent } from './components/withdrawals-record/withdrawals-detail/withdrawals-detail.component';
const ROUTESCOMPONENTS = [
FreightAccountComponent,
DriverAccountComponent,
RechargeRecordComponent,
WithdrawalsRecordComponent,
MainAccountComponent
MainAccountComponent,
WithdrawalsDetailComponent
];
const NOTROUTECOMPONENTS = [DriverAccountDetailComponent, FreightAccountDetailComponent];
const NOTROUTECOMPONENTS = [DriverAccountDetailComponent, FreightAccountDetailComponent, SettingFinancialComponent];
@NgModule({
declarations: [...ROUTESCOMPONENTS, ...NOTROUTECOMPONENTS],

View File

@ -4,11 +4,6 @@
"text": "样例",
"hideInBreadcrumb": true,
"children": [
{
"text": "仪表盘",
"icon": "anticon anticon-dashboard",
"link": "/dashboard"
},
{
"text": "样例",
"icon": "anticon anticon-dashboard",