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

This commit is contained in:
潘晓云
2022-05-06 10:44:12 +08:00
34 changed files with 265 additions and 437 deletions

View File

@ -1,39 +1,14 @@
<!--
* @Author: your name
* @Date: 2021-11-29 15:22:34
* @LastEditTime : 2022-02-16 09:58:52
* @LastEditors : Shiming
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath : \\tms-obc-web\\src\\app\\routes\\usercenter\\components\\driver\\captain\\captain.component.html
-->
<!-- 页头 -->
<page-header-wrapper></page-header-wrapper>
<!-- <page-header-wrapper></page-header-wrapper>
<nz-card>
<!-- 搜索区 -->
<!-- 搜索表单 -->
<div nz-row nzGutter="8">
<div nz-col [nzXl]="_$expand ? 24 : 18" [nzLg]="24" [nzSm]="24" [nzXs]="24">
<sf #sf [schema]="schema" [ui]="ui" [compact]="true" [button]="'none'"></sf>
</div>
<div nz-col [nzXl]="_$expand ? 24 : 6" [nzLg]="24" [nzSm]="24" [nzXs]="24" class="text-right">
<button
nz-button
nzType="primary"
[nzLoading]="service.http.loading"
(click)="st?.load(1)"
acl
[acl-ability]="['USERCENTER-DRIVER-CAPTAIN-list']"
>查询</button
>
<button
nz-button
nzType="primary"
[disabled]="false"
(click)="exportList()"
acl
[acl-ability]="['USERCENTER-DRIVER-CAPTAIN-export']"
>导出</button
>
<button nz-button nzType="primary" [nzLoading]="service.http.loading" (click)="st?.load(1)" acl
[acl-ability]="['USERCENTER-DRIVER-CAPTAIN-list']">查询</button>
<button nz-button nzType="primary" [disabled]="false" (click)="exportList()" acl
[acl-ability]="['USERCENTER-DRIVER-CAPTAIN-export']">导出</button>
<button nz-button (click)="resetSF()" [disabled]="false">重置</button>
<button nz-button nzType="link" (click)="expandToggle()">
{{ !_$expand ? '展开' : '收起' }}
@ -41,23 +16,22 @@
</button>
</div>
</div>
</nz-card>
<nz-card>
<!-- 数据列表 -->
<!-- 工具栏 -->
<div class="toolbar" style="float: right;
padding-bottom: 15px;">
<button nz-button nzType="primary" (click)="add()">添加车队长</button>
</nz-card> -->
<nz-card class="table-box">
<div class="header_box">
<label class="page_title"> <label class="driver">|</label> 车队长列表</label>
<div class="mr-sm">
<button nz-button nzDanger [nzLoading]="service.http.loading" (click)="openDrawer()" acl
[acl-ability]="['USERCENTER-DRIVER-CAPTAIN-list']">筛选</button>
<button nz-button nzDanger (click)="exportList()" acl [acl-ability]="['USERCENTER-DRIVER-CAPTAIN-export']">
导出</button>
<button nz-button nzType="primary" (click)="add()" acl
[acl-ability]="['USERCENTER-DRIVER-CAPTAIN-add']">添加车队长</button>
</div>
</div>
<st
#st
[columns]="columns"
[data]="service.$api_get_user_expand"
[req]="{ method: 'POST', allInBody: true, reName: { pi: 'pageIndex', ps: 'pageSize' }, params: reqParams }"
[res]="{ reName: { list: 'data.records', total: 'data.total' }, process: dataProcess }"
[page]="{ show: true, showSize: true, pageSizes: [10, 20, 30, 50, 100, 200, 300, 500, 1000] }"
[loading]="false"
>
<!-- 数据列表 -->
<st #st [columns]="columns" [data]="service.$api_get_user_expand" [req]="{ params: reqParams }"
[res]="{ process: dataProcess }" [page]="{ }" [loading]="false" [scroll]="{ x: '1200px',y:scrollY }">
<ng-template st-row="promotersTelephone" let-item let-index="index">
<a (click)="addPromoter(item)" acl [acl-ability]="['USERCENTER-DRIVER-CAPTAIN-promoter']">
{{ item.promotersTelephone || '添加' }}
@ -74,4 +48,4 @@
</se>
</div>
</div>
</ng-template>
</ng-template>

View File

@ -3,29 +3,39 @@ import { ActivatedRoute, Router } from '@angular/router';
import { STColumn, STColumnBadge, STComponent, STData } from '@delon/abc/st';
import { SFComponent, SFSchema, SFUISchema } from '@delon/form';
import { ModalHelper } from '@delon/theme';
import { DynamicSettingModalComponent } from '@shared';
import { DynamicSettingModalComponent, SearchDrawerService } from '@shared';
import { NzModalService } from 'ng-zorro-antd/modal';
import { BasicTableComponent } from 'src/app/routes/commom';
import { UsermanageService } from '../../../services/usercenter.service';
import { CtcCaptatinAddComponent } from './add/add.component';
@Component({
selector: 'app-usercenter-components-driver-captain',
templateUrl: './captain.component.html',
styleUrls: ['./captain.component.less']
styleUrls: ['../../../../commom/less/commom-table.less']
})
export class UserCenterComponentsDriverCaptainComponent implements OnInit {
_$expand = false;
ui: SFUISchema = { '*': { spanLabelFixed: 120, grid: { lg: 8, md: 12, sm: 12, xs: 24 } } };
export class UserCenterComponentsDriverCaptainComponent extends BasicTableComponent implements OnInit {
schema: SFSchema = this.initSF();
columns: STColumn[] = this.initST();
@ViewChild('st', { static: false }) st!: STComponent;
@ViewChild('sf', { static: false }) sf!: SFComponent;
@ViewChild('promoterModal', { static: false })
promoterModal!: any;
promotersTelephone = '';
constructor(public service: UsermanageService, private modal: NzModalService, private router: Router, private ar: ActivatedRoute, private modalHelper: ModalHelper,) {}
constructor(
public service: UsermanageService,
private modal: NzModalService,
private router: Router,
private ar: ActivatedRoute,
private modalHelper: ModalHelper,
public searchDrawerService: SearchDrawerService
) {
super(searchDrawerService);
}
search() {
this.st?.load(1);
}
/**
* 查询参数
@ -98,22 +108,9 @@ export class UserCenterComponentsDriverCaptainComponent implements OnInit {
});
}
expandToggle() {
this._$expand = !this._$expand;
this.sf?.setValue('/expand', this._$expand);
}
/**
* 重置表单
*/
resetSF() {
this.sf.reset();
this._$expand = false;
}
exportList() {
const params = this.reqParams;
this.service.downloadFile(this.service.$api_export_driver_cap, {...params, pageSize: -1});
this.service.downloadFile(this.service.$api_export_driver_cap, { ...params, pageSize: -1 });
}
private initSF(): SFSchema {
@ -146,10 +143,7 @@ export class UserCenterComponentsDriverCaptainComponent implements OnInit {
type: 'string',
maxLength: 11,
ui: {
placeholder: '请输入',
visibleIf: {
expand: (value: boolean) => value
}
placeholder: '请输入'
}
},
identityStatus: {
@ -163,10 +157,7 @@ export class UserCenterComponentsDriverCaptainComponent implements OnInit {
],
default: '',
ui: {
widget: 'select',
visibleIf: {
expand: (value: boolean) => value
}
widget: 'select'
}
},
source: {
@ -176,14 +167,11 @@ export class UserCenterComponentsDriverCaptainComponent implements OnInit {
{ label: '全部', value: '' },
{ label: '用户注册', value: 1 },
{ label: '货主添加', value: 2 },
{ label: '运营添加', value: 3 },
{ label: '运营添加', value: 3 }
],
default: '',
ui: {
widget: 'select',
visibleIf: {
expand: (value: boolean) => value
}
widget: 'select'
}
}
}
@ -209,7 +197,7 @@ export class UserCenterComponentsDriverCaptainComponent implements OnInit {
}
},
{ title: '推广业务员', className: 'text-center', render: 'promotersTelephone' },
{ title: '注册渠道', className: 'text-center', index: 'source', type: 'enum', enum: { 1: '用户注册', 2: '货主添加' , 3: '运营添加'} },
{ title: '注册渠道', className: 'text-center', index: 'source', type: 'enum', enum: { 1: '用户注册', 2: '货主添加', 3: '运营添加' } },
{ title: '注册时间', className: 'text-center', index: 'createTime' },
{
title: '操作',
@ -222,7 +210,7 @@ export class UserCenterComponentsDriverCaptainComponent implements OnInit {
this.router.navigate(['/usercenter/driver/captain/detail', item.appUserId]);
},
acl: { ability: ['USERCENTER-DRIVER-CAPTAIN-view'] }
},
}
// {
// text: '基础设置',
// click: item => this.settingAction(item),

View File

@ -1,16 +1,5 @@
<!--
* @Author: your name
* @Date: 2021-11-29 15:22:34
* @LastEditTime : 2022-03-09 16:04:08
* @LastEditors : Shiming
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath : \\tms-obc-web\\src\\app\\routes\\usercenter\\components\\driver\\driver-config\\driver-config.component.html
-->
<!-- 页头 -->
<page-header-wrapper></page-header-wrapper>
<!-- <page-header-wrapper></page-header-wrapper>
<nz-card>
<!-- 搜索区 -->
<!-- 搜索表单 -->
<div nz-row nzGutter="8">
<div nz-col [nzXl]=" 18" [nzLg]="24" [nzSm]="24" [nzXs]="24">
<sf #sf [schema]="schema" [ui]="{ '*': { spanLabelFixed: 120, grid: { lg: 8, md: 12, sm: 12, xs: 24 } } }" [compact]="true" [button]="'none'"></sf>
@ -21,17 +10,22 @@
<button nz-button nzType="primary" [disabled]="false" (click)="exportList()" acl
[acl-ability]="['USERCENTER-DRIVER-CONFIG-export']">导出</button>
<button nz-button (click)="resetSF()" [disabled]="false">重置</button>
<!-- <button nz-button nzType="link" (click)="expandToggle()">
{{ !_$expand ? '展开' : '收起' }}
<i nz-icon [nzType]="!_$expand ? 'down' : 'up'"></i>
</button> -->
</div>
</div>
</nz-card>
<nz-card>
</nz-card> -->
<nz-card class="table-box">
<div class="header_box">
<label class="page_title"> <label class="driver">|</label> 司机配置</label>
<div class="mr-sm">
<button nz-button nzDanger [nzLoading]="service.http.loading" (click)="openDrawer()" acl
[acl-ability]="['USERCENTER-DRIVER-CONFIG-search']">筛选</button>
<button nz-button nzDanger (click)="exportList()" acl [acl-ability]="['USERCENTER-DRIVER-CONFIG-export']">
导出</button>
</div>
</div>
<!-- 数据列表 -->
<st #st [columns]="columns" [scroll]="{ x: '1200px' }"[data]="service.$api_configPage" [req]="{ params: reqParams }"
[loading]="false" [page]={}>
<st #st [columns]="columns" [scroll]="{ x: '1200px',y:scrollY }" [data]="service.$api_configPage" [req]="{ params: reqParams }"
[loading]="false" [page]="{}">
<ng-template st-row="monthFreightAmount" let-item let-index="index">
<div>{{item?.monthFreightAmount | currency}}</div>
</ng-template>

View File

@ -2,21 +2,23 @@ import { Component, OnInit, ViewChild } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { STColumn, STComponent } from '@delon/abc/st';
import { SFComponent, SFSchema } from '@delon/form';
import { DynamicSettingModalComponent } from '@shared';
import { DynamicSettingModalComponent, SearchDrawerService } from '@shared';
import { NzModalService } from 'ng-zorro-antd/modal';
import { BasicTableComponent } from 'src/app/routes/commom';
import { UsermanageService } from '../../../services/usercenter.service';
@Component({
selector: 'app-usercenter-components-driver-config',
templateUrl: './driver-config.component.html',
styleUrls: ['./driver-config.component.less']
styleUrls: ['../../../../commom/less/commom-table.less']
})
export class UserCenterComponentsDriverConfigComponent implements OnInit {
export class UserCenterComponentsDriverConfigComponent extends BasicTableComponent implements OnInit {
schema: SFSchema = this.initSF();
columns: STColumn[] = this.initST();
@ViewChild('st', { static: false }) st!: STComponent;
@ViewChild('sf', { static: false }) sf!: SFComponent;
constructor(public service: UsermanageService, private modal: NzModalService) {}
constructor(public service: UsermanageService, private modal: NzModalService, public searchDrawerService: SearchDrawerService) {
super(searchDrawerService);
}
/**
* 查询参数
@ -33,6 +35,10 @@ export class UserCenterComponentsDriverConfigComponent implements OnInit {
ngOnInit() {}
search() {
this.st?.load(1);
}
settingAction(item?: any) {
const modal = this.modal.create({
nzTitle: '配置',
@ -105,7 +111,7 @@ export class UserCenterComponentsDriverConfigComponent implements OnInit {
// { title: '', type: 'checkbox', className: 'text-center' },
{ title: '司机姓名', className: 'text-center', width: '170px', index: 'name' },
{ title: '手机号', className: 'text-center', width: '170px', index: 'mobile' },
{ title: '类型', className: 'text-center', width: '170px',render: 'isCaptain' },
{ title: '类型', className: 'text-center', width: '170px', render: 'isCaptain' },
{ title: '月承运金额上限(元)', className: 'text-center', width: '200px', render: 'monthFreightAmount' },
{ title: '日提现金额上限(元)', className: 'text-center', width: '200px', render: 'dayWithdrawalAmount' },
{ title: '月提现金额上限(元)', className: 'text-center', width: '200px', render: 'monthWithdrawalAmount' },

View File

@ -32,7 +32,7 @@
<div class="mr-sm">
<button nz-button nzDanger [nzLoading]="service.http.loading" acl [acl-ability]="['USERCENTER-FREIGHT-USER-list']"
(click)="openDrawer()">筛选</button>
<button nz-button nzDanger (click)="st?.load(1)" acl [acl-ability]="['USERCENTER-FREIGHT-ENTERPRISE-export']">
<button nz-button nzDanger (click)="exportList()" acl [acl-ability]="['USERCENTER-FREIGHT-ENTERPRISE-export']">
导出</button>
</div>
</ng-template>

View File

@ -1,12 +0,0 @@
:host::ng-deep {
nz-range-picker {
width: 100%;
}
.content-box {
.ant-card-body {
padding-top: 6px;
}
}
}

View File

@ -22,7 +22,11 @@ export class FreightComponentsUserComponent extends BasicTableComponent implemen
resourceStatus: any = 0;
constructor(public service: UsermanageService, private modal: NzModalService, private router: Router, private ar: ActivatedRoute,
constructor(
public service: UsermanageService,
private modal: NzModalService,
private router: Router,
private ar: ActivatedRoute,
public searchDrawerService: SearchDrawerService
) {
super(searchDrawerService);
@ -32,7 +36,6 @@ export class FreightComponentsUserComponent extends BasicTableComponent implemen
this.st?.load(1);
}
ngOnInit() {
this.ar.url.subscribe(params => {
this.st?.load(1);
@ -114,6 +117,16 @@ export class FreightComponentsUserComponent extends BasicTableComponent implemen
});
}
exportList() {
const params = { certificationStatus: this.resourceStatus, pageSize: -1 };
if (this.sf) {
Object.assign(params, {
...this.sf?.value
});
}
this.service.downloadFile(this.service.$api_get_user_list_export, params);
}
private initSF(): SFSchema {
return {
properties: {
@ -157,7 +170,7 @@ export class FreightComponentsUserComponent extends BasicTableComponent implemen
],
default: '',
ui: {
widget: 'select',
widget: 'select'
}
},
promotersTelephone: {
@ -165,7 +178,7 @@ export class FreightComponentsUserComponent extends BasicTableComponent implemen
type: 'string',
maxLength: 11,
ui: {
placeholder: '请输入手机号',
placeholder: '请输入手机号'
}
},
effectiveDate: {
@ -174,7 +187,7 @@ export class FreightComponentsUserComponent extends BasicTableComponent implemen
ui: {
widget: 'date',
mode: 'range',
format: 'yyyy-MM-dd',
format: 'yyyy-MM-dd'
} as SFDateWidgetSchema
}
}
@ -212,19 +225,19 @@ export class FreightComponentsUserComponent extends BasicTableComponent implemen
click: (item: any) => {
this.router.navigate(['./view', item.appUserId], { relativeTo: this.ar });
},
acl: { ability: ['USERCENTER-FREIGHT-USER-view'] },
acl: { ability: ['USERCENTER-FREIGHT-USER-view'] }
},
{
text: '冻结',
iif: item => item.stateLocked === 0,
click: (item: any) => this.userAction(0, [item.appUserId]),
acl: { ability: ['USERCENTER-FREIGHT-USER-lock'] },
acl: { ability: ['USERCENTER-FREIGHT-USER-lock'] }
},
{
text: '启用',
iif: item => item.stateLocked === 1,
click: (item: any) => this.userAction(1, [item.appUserId]),
acl: { ability: ['USERCENTER-FREIGHT-USER-lock'] },
acl: { ability: ['USERCENTER-FREIGHT-USER-lock'] }
}
]
}

View File

@ -49,6 +49,8 @@ export class UsermanageService extends ShipperBaseService {
// 货主员工列表(运营后台)
$api_get_user_list = '/api/mdc/cuc/userApp/getShipperUserInfoList';
// 货主员工列表(运营后台)
$api_get_user_list_export = '/api/mdc/cuc/userApp/getShipperUserInfoList';
// 冻结或恢复员工
$api_lock_staff = '/api/mdc/cuc/userApp/freezeOrResumeStaff';
// 冻结或恢复应用用户