货主管理

This commit is contained in:
Taric Xin
2021-12-09 16:15:47 +08:00
parent b074f72593
commit 8091d8e274
28 changed files with 971 additions and 1263 deletions

View File

@ -1,51 +1,32 @@
<page-header-wrapper [title]="'企业审核列表'" [content]="content">
<nz-card>
<nz-card class="mb-md">
<!-- 搜索表单 -->
<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 nz-col [nzXl]="_$expand ? 24 : 16" [nzLg]="24" [nzSm]="24" [nzXs]="24">
<sf #sf [schema]="schema" [ui]="ui" [compact]="true" [button]="'none'"></sf>
</div>
<div nz-col [nzXl]="_$expand ? 24 : 8" [nzLg]="24" [nzSm]="24" [nzXs]="24" class="text-right"
[class.expend-options]="_$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="primary" [nzLoading]="service.http.loading" (click)="st?.load(1)">导出</button>
<button nz-button nzType="link" (click)="expandToggle(!_$expand)">
{{ !_$expand ? '展开' : '收起' }}
<i nz-icon [nzType]="!_$expand ? 'down' : 'up'"></i>
</button>
</div>
<!-- 查询字段大于3个时根据展开状态调整布局 -->
<ng-container *ngIf="queryFieldCount > 4">
<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="primary" [nzLoading]="service.http.loading" (click)="st?.load(1)">导出</button>
<button nz-button nzType="link" (click)="expandToggle()">
{{ !_$expand ? '展开' : '收起' }}
<i nz-icon [nzType]="!_$expand ? 'down' : 'up'"></i>
</button>
</div>
</ng-container>
</div>
</nz-card>
<div style="margin-bottom: 20px; text-align: right"></div>
<nz-card >
<nz-card>
<!-- 数据列表 -->
<st
#st
multiSort
[data]="datalist"
[columns]="columns"
<st #st multiSort [data]="tabType===1?service.$api_get_freight_list:service.$api_get_freight_list"
[columns]="tabType===1?enterColumns:adminColumns"
[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] }"
[loading]="service.http.loading"
>
[loading]="service.http.loading">
</st>
</nz-card>
<ng-template #content>
@ -53,40 +34,4 @@
<nz-tab *ngFor="let tab of tabs" [nzTitle]="tab.name" (nzSelect)="changeTab(tab)"> </nz-tab>
</nz-tabset>
</ng-template>
</page-header-wrapper>
<!-- <nz-modal
[(nzVisible)]="isVisible"
[nzTitle]="mdTitle"
[nzFooter]="modalFooter"
(nzOnCancel)="handleCancel()"
(nzOnOk)="handleOk()"
[nzWidth]="700"
>
<ng-container>
</ng-container>
<ng-template #modalFooter>
<button nz-button nzType="default" (click)="handleCancel()">取消</button>
<button
nz-button
nzType="primary"
*ngIf="mdType === 2"
[disabled]="!sf1?.valid"
(click)="handleOk()"
[nzLoading]="service.http.loading"
>
确定
</button>
<button
nz-button
nzType="primary"
*ngIf="mdType === 3"
[disabled]="!sf1?.valid"
(click)="handleOk()"
[nzLoading]="service.http.loading"
>
重新提交
</button>
<button nz-button nzType="primary" *ngIf="mdType === 4" (click)="handleCancel()">确定</button>
</ng-template>
</nz-modal> -->
</page-header-wrapper>

View File

@ -1,10 +1,23 @@
:host {
::ng-deep {
.tabs-wrap > .ant-tabs-nav {
.tabs-wrap>.ant-tabs-nav {
margin-bottom: 0;
}
.myForm .ant-upload.ant-upload-select-picture-card > .ant-upload {
.myForm .ant-upload.ant-upload-select-picture-card>.ant-upload {
flex-direction: column !important;
}
}
}
.expend-options {
margin-top: 0px;
}
@media (min-width: 1200px) {
.expend-options {
margin-top: -40px;
}
}

View File

@ -8,13 +8,14 @@ import { UsermanageService } from '../../../services/usercenter.service';
@Component({
selector: 'app-Freight-components-enterprise-audit',
templateUrl: './enterprise-audit.component.html',
styleUrls: ['./enterprise-audit.component.less'],
styleUrls: ['./enterprise-audit.component.less']
})
export class FreightComponentsEnterpriseAuditComponent implements OnInit {
_$expand = false;
ui!: SFUISchema;
schema!: SFSchema;
columns!: STColumn[];
ui: SFUISchema = { '*': { spanLabelFixed: 90, grid: { lg: 8, md: 12, sm: 12, xs: 24 } } };
schema: SFSchema = this.initSF();
enterColumns: STColumn[] = this.initEnterST();
adminColumns: STColumn[] = this.initAdminST();
@ViewChild('st', { static: false }) st!: STComponent;
@ViewChild('sf', { static: false }) sf!: SFComponent;
tabType = 1;
@ -22,80 +23,32 @@ export class FreightComponentsEnterpriseAuditComponent implements OnInit {
{
name: '企业审核',
type: 1,
isActived: false,
isActived: false
},
{
name: '企业管理员审核',
type: 2,
isActived: false,
},
isActived: false
}
];
datalist = [
{
storeName: '企业名称',
contactsName: '152746565',
enterpriseName: '湖南',
unifiedSocialCreditCode: '45454',
contactsPhone: '*97889461561',
effectiveDateStr: '废弃eww',
enStatusStr2: '已驳回',
enStatusStr3: '正常',
unifiedSocialCreditCode3: '常用服务',
unifiedSocialCreditCode2: '正常',
tenantId: 1,
id: 1
},
{
storeName: '企业名称',
contactsName: '152746565',
enterpriseName: '湖南',
unifiedSocialCreditCode: '45454',
contactsPhone: '*97889461561',
effectiveDateStr: '废弃eww',
enStatusStr2: '待审核',
enStatusStr3: '正常',
unifiedSocialCreditCode3: '常用服务',
unifiedSocialCreditCode2: '正常',
tenantId: 2,
id: 2
},
]
isVisible = false;
mdType!: any;
cateData = [];
// stApi = this.service.$api_get_labelList;
constructor(public service: UsermanageService, private router: Router, private modal: NzModalService,private ar: ActivatedRoute) {}
/**
* 查询字段个数
*/
get queryFieldCount(): number {
return Object.keys(this.schema?.properties || {}).length;
}
constructor(public service: UsermanageService, private router: Router, private modal: NzModalService, private ar: ActivatedRoute) {}
/**
* 查询参数
*/
get reqParams() {
const params = Object.assign({}, this.sf?.value || {}, {
flag: this.tabType,
flag: this.tabType
});
delete params._$expand;
return { ...params };
}
/**
* 选中行
*/
get selectedRows() {
return this.st?.list.filter((item) => item.checked) || [];
return { ...params, listSource: 1 };
}
/**
* 伸缩查询条件
*/
expandToggle() {
this._$expand = !this._$expand;
expandToggle(status: boolean) {
this._$expand = status;
this.sf?.setValue('/expand', this._$expand);
}
@ -109,90 +62,7 @@ export class FreightComponentsEnterpriseAuditComponent implements OnInit {
/**
* 程序初始化入口
*/
ngOnInit() {
this.initSF();
this.initST();
}
/**
* 初始化查询表单
*/
initSF() {
this.schema = {
properties: {
expand: { type: 'boolean', ui: { hidden: true } },
name: { title: '企业名称', type: 'string' },
contactsName: {
title: '联系人',
type: 'string',
ui: {
showRequired: false,
},
},
phone: {
title: '手机号',
type: 'string',
format: 'mobile',
maxLength: 11,
ui: {
placeholder: '请输入手机号',
},
},
enStatus2: {
type: 'string',
title: '状态',
enum: [
{ label: '全部', value: '' },
{ label: '正常', value: 0 },
{ label: '冻结', value: 1 },
{ label: '废弃', value: 2 },
],
default: '',
ui: {
widget: 'select',
visibleIf: {
expand: (value: boolean) => value,
},
},
},
},
};
this.ui = { '*': { spanLabelFixed: 100, grid: { span: 8, gutter: 4 } } };
}
/**
* 初始化数据列表
*/
initST() {
this.columns = [
{ title: '企业名称', className: 'text-center', index: 'storeName' },
{ title: '联系人', className: 'text-center', index: 'contactsName' },
{ title: '手机号', className: 'text-center', render: 'enterpriseName' },
{ title: '申请时间', className: 'text-center', index: 'unifiedSocialCreditCode' },
{
title: '状态',
className: 'text-center',
index: 'enStatusStr2',
type: 'badge',
badge: {
: { text: '待审核', color: 'success' },
: { text: '已驳回', color: 'warning' },
},
},
{ title: '常用服务', className: 'text-center', index: 'unifiedSocialCreditCode3' },
{ title: '推广业务员', className: 'text-center', index: 'unifiedSocialCreditCode2' },
{
title: '操作',
fixed: 'right',
width: '180px',
className: 'text-center',
buttons: [
{ text: '查看', click: (_record) => this.View(_record) },
],
},
];
}
ngOnInit() {}
/**
* 数据列表状态变化事件
@ -202,109 +72,151 @@ export class FreightComponentsEnterpriseAuditComponent implements OnInit {
}
/**
* 新增实例
* 查看详情
*/
View(record: any) {
console.log(record)
// this.router.navigate(['../add'], { relativeTo: this.ar });
this.router.navigate(['./view', record.tenantId], {
relativeTo: this.ar
this.router.navigate(['./view', record.id], {
relativeTo: this.ar
});
}
/**
* 编辑单个实例
* @param record 记录实例
*/
editOne(record: STData) {
// this.router.navigate(['../edit', record.uuid], { relativeTo: this.ar });
}
/**
* 删除单个实例
* @param record 记录实例
*/
delOne(record: STData) {
// let delApi = this.service.$api_label_deletebatch;
// if (this.tabType === 3) {
// delApi = this.service.$api_business_label_delete;
// } else {
// delApi = this.service.$api_label_deletebatch;
// }
this.modal.confirm({
nzTitle: '<i>删除确认</i>',
nzContent: `<b>即将删除 当前行数据,请仔细核对,避免误操作!<br>是否删除?</br>`,
nzOnOk: () =>
console.log('1')
// this.service.http.post(delApi, [record.id]).subscribe((res) => {
// console.log(res, 'del');
// if (res === true || res.data === true) {
// this.service.msgSrv.success('删除成功!');
// setTimeout(() => {
// this.st?.reload();
// }, 500);
// } else {
// this.service.msgSrv.error('删除失败!');
// }
// }),
});
}
/**
* 删除多个实例
*/
delMany(record: STData) {
this.modal.confirm({
nzTitle: '<i>删除确认</i>',
nzContent: `<b>即将删除 当前行数据,请仔细核对,避免误操作!<br>是否删除?</br>`,
nzOnOk: () =>
console.log('')
// this.service.http.post(this.service.$api_label_deletebatch, [record.id]).subscribe((res) => {
// if (res === true) {
// this.service.msgSrv.success('删除成功!');
// this.st?.reload();
// }
// }),
});
/*
const delData = this.st.list.filter((item) => item.checked).map((item) => item.id);
if (delData.length > 0) {
this.modal.confirm({
nzTitle: '<i>删除确认</i>',
nzContent: `<b>即将删除 <i>${delData.length}</i> 条数据,请仔细核对,避免误操作!<br>是否删除?</br>`,
nzOnOk: () =>
this.service.delMany(delData).subscribe((res) => {
if (res === true) {
this.service.msgSrv.success('数据删除成功!');
this.st?.reload();
}
}),
});
}
*/
}
// 切换Tab
changeTab(item: any) {
this.tabType = item.type;
console.log(item)
this.expandToggle(false);
this.sf?.reset();
// if (item.type === 3) {
// this.stApi = this.service.$api_get_business_labelList;
// } else {
// this.stApi = this.service.$api_get_labelList;
// }
// setTimeout(() => {
// this.tabs.forEach((i) => (i.isActived = false));
// item.isActived = !item.isActived;
// this.st.load(1);
// this.st.resetColumns();
// }, 500);
setTimeout(() => {
this.st.load(1);
}, 100);
}
// checkType(): boolean {
// return this.mdType === 2 ? true : false;
// }
/**
* 初始化数据列表
*/
initEnterST(): STColumn[] {
return [
{ title: '企业名称', className: 'text-center', index: 'enterpriseName' },
{ title: '联系人', className: 'text-center', index: 'contacter' },
{ title: '手机号', className: 'text-center', render: 'mobile' },
{ title: '申请时间', className: 'text-center', index: 'createTime' },
{
title: '审核状态',
className: 'text-center',
index: 'approvalStatus',
type: 'badge',
badge: {
10: { text: '待审核', color: 'processing' },
20: { text: '已成功', color: 'success' },
30: { text: '审核失败', color: 'warning' }
}
},
{
title: '常用服务',
className: 'text-center',
index: 'oftenUsedServices',
type: 'enum',
enum: { 10: '整车发货', 20: '大宗发货' }
},
{ title: '推广业务员', className: 'text-center', index: 'promotersTelephone' },
{
title: '操作',
fixed: 'right',
width: '180px',
className: 'text-center',
buttons: [{ text: '查看', click: _record => this.View(_record) }]
}
];
}
initAdminST(): STColumn[] {
return [
{ title: '企业名称', className: 'text-center', index: 'enterpriseName' },
{ title: '当前管理员', className: 'text-center', index: 'contacter' },
{ title: '当前管理员手机号', className: 'text-center', render: 'mobile' },
{ title: '转授对象', className: 'text-center', index: 'promotersTelephone' },
{ title: '转授对象手机号', className: 'text-center', index: 'promotersTelephone' },
{ title: '申请时间', className: 'text-center', index: 'createTime' },
{
title: '状态',
className: 'text-center',
index: 'approvalStatus',
type: 'badge',
badge: {
10: { text: '待审核', color: 'processing' },
20: { text: '已成功', color: 'success' },
30: { text: '审核失败', color: 'warning' }
}
},
{
title: '操作',
fixed: 'right',
width: '180px',
className: 'text-center',
buttons: [{ text: '审核', click: _record => this.View(_record) }]
}
];
}
/**
* 初始化查询表单
*/
initSF(): SFSchema {
return {
properties: {
expand: { type: 'boolean', ui: { hidden: true } },
enterpriseName: {
title: '企业名称',
type: 'string',
ui: {
placeholder: '请输入'
}
},
contactName: {
title: '联系人',
type: 'string',
ui: {
placeholder: '请输入',
visibleIf: {
expand: (value: boolean) => this.tabType === 1
}
}
},
contactName2: {
title: '管理员',
type: 'string',
ui: {
placeholder: '请输入',
visibleIf: {
expand: (value: boolean) => this.tabType !== 1
}
}
},
mobile: {
title: '手机号',
type: 'string',
format: 'mobile',
maxLength: 11,
ui: {
placeholder: '请输入'
}
},
lockedStatus: {
type: 'string',
title: '状态',
enum: [
{ label: '全部', value: '' },
{ label: '正常', value: 0 },
{ label: '冻结', value: 1 }
],
default: '',
ui: {
widget: 'select',
visibleIf: {
expand: (value: boolean) => value
}
}
}
}
};
}
}

View File

@ -1,4 +1,4 @@
<ng-container >
<ng-container>
<!-- 页头 -->
<page-header-wrapper [logo]="logo" [content]="content">
<ng-template #logo>
@ -7,54 +7,82 @@
</button>
</ng-template>
<ng-template #content>
<div class="user-info">
<div style="flex: 1">
<div style="display: flex;">
<p style="padding-right: 80px; width: 400px;">申请编号54545454{{ detailData?.shoppFeignVO?.publicity }}</p>
</div>
<div style="display: flex;">
<p style="padding-right: 80px; width: 400px;">申请时间:{{ detailData?.shoppFeignVO?.introduction }}</p>
<p >申请人:黄龙真人</p>
</div>
<div>
申请人手机号156565656565
</div>
<div style="position: relative;top: -65%;
left: 75%;">
<span>状态</span>
<br />
<span>待审核</span>
<span >审核中</span>
<span>已审核</span>
</div>
<nz-skeleton [nzLoading]="service.http.loading">
<div class="user-info" nz-row>
<div nz-col nzSpan="24" class="d-flex">
<img [src]="detailData?.enterpriseLogo" />
<div style="flex: 1;">
<div nz-row>
<div nz-col [nzLg]="12" [nzSm]="24" [nzXs]="24">
<p style="margin-bottom: 0;">{{ detailData?.enterpriseName }}</p>
</div>
<div nz-col [nzLg]="12" [nzSm]="24" [nzXs]="24" class="text-right mb-sm">
<label style="font-size: 18px;font-weight: 600;">{{statusE[detailData?.approvalStatus] }}</label>
</div>
</div>
<div nz-row>
<div nz-col [nzLg]="8" [nzSm]="24" [nzXs]="24">
<p>{{ detailData?.unifiedSocialCreditCode }}</p>
</div>
<div nz-col [nzLg]="8" [nzSm]="24" [nzXs]="24">
申请时间:{{detailData?.createTime}}
</div>
<div nz-col [nzXl]="8" [nzLg]="8" [nzSm]="24" [nzXs]="24" class="d-flex"
style="justify-content: flex-end;">
<button [nzLoading]="service.http.loading" nz-button nzDanger (click)="auditPass()">
通过
</button>
<button [nzLoading]="service.http.loading" nz-button nzDanger (click)="auditNo()">
驳回
</button>
<button [nzLoading]="service.http.loading" nz-button nzDanger (click)="ratify()">
修改
</button>
</div>
</div>
</div>
</div>
</div>
</div>
</nz-skeleton>
</ng-template>
</page-header-wrapper>
<nz-card>
<nz-card [nzLoading]="service.http.loading">
<sv-container col="3">
<sv-title>申请人信息</sv-title>
<sv label="申请人">
{{ detailData?.contactsName }}
<sv-title>企业管理员信息</sv-title>
<sv label="姓名">
{{ detailData?.adminUserInfo?.name }}
</sv>
<sv label="申请人手机号">
{{ detailData?.contactsPhone }}
<sv label="手机号">
{{ detailData?.adminUserInfo?.mobile }}
</sv>
<sv label="身份证号">
{{ detailData?.contactsPhone }}
<sv label="身份证号">
{{ detailData?.contactadminUserInfo?.certificateNumber }}
</sv>
</sv-container>
<sv-container col="2">
<sv label="身份证照">
<!-- <app-imagelist [imgList]="detailData?.enterpriseQualificationCertificate"></app-imagelist> -->
<app-imagelist
[imgList]="[detailData?.adminUserInfo?.certificatePhotoFrontWatermark,detailData?.adminUserInfo?.certificatePhotoBackWatermark]">
</app-imagelist>
</sv>
<sv label="企业授权函">
<!-- <app-imagelist [imgList]="detailData?.enterpriseQualificationCertificate"></app-imagelist> -->
<app-imagelist [imgList]="[detailData?.adminUserInfo?.certificatePhotoBackWatermark]"></app-imagelist>
</sv>
</sv-container>
<nz-divider></nz-divider>
<sv-container col="3" class="mt16">
<sv-title>公司基本信息</sv-title>
<sv-title>
<label class="mr-md">企业基本信息</label>
<label *ngIf="detailData?.approvalStatus===10" style="color: #1890ff;"><i nz-icon nzType="info-circle"
nzTheme="fill" class="mr-xs"></i>待审核
</label>
<label *ngIf="detailData?.approvalStatus===20" style="color: #52c41a;"><i nz-icon nzType="check-circle"
nzTheme="fill" class="mr-xs"></i>审核通过
</label>
<label *ngIf="detailData?.approvalStatus===30" style="color: #ff4d4f;"><i nz-icon nzType="close-circle"
nzTheme="fill" class="mr-xs"></i>驳回
</label>
</sv-title>
<sv label="公司名称">
{{ detailData?.enterpriseName }}
</sv>
@ -76,12 +104,14 @@
{{ detailData?.operatingStartTime }} 至 {{ detailData?.operatingEndTime }}
</div>
<div *ngIf="!detailData?.operatingStartTime && !detailData?.operatingEndTime">长期</div>
<div *ngIf="!!detailData?.operatingStartTime && !detailData?.operatingEndTime">{{ detailData?.operatingStartTime }} 至 长期</div>
<div *ngIf="!!detailData?.operatingStartTime && !detailData?.operatingEndTime">{{ detailData?.operatingStartTime
}} 至 长期</div>
</sv>
</sv-container>
<sv-container col="2" class="mt16">
<sv label="公司所在地" col="3">
{{ detailData?.enterpriseAddressCodeStr }}
{{ detailData?.fullRegionVO?.provinceName }}{{ detailData?.fullRegionVO?.cityName }}{{
detailData?.fullRegionVO?.areaName }}
</sv>
<sv label="公司详细地址">
{{ detailData?.enterpriseAddress }}
@ -91,63 +121,78 @@
<sv label="经营范围">
{{ detailData?.businessScope }}
</sv>
</sv-container>
<sv-container col="2" class="mt16">
<sv label="税务机关">
{{ detailData?.taxAuthority }}
</sv>
<sv label="营业执照">
<!-- <app-imagelist [imgList]="detailData?.enterpriseQualificationCertificate"></app-imagelist> -->
<app-imagelist [imgList]="[detailData?.licensePhotoWatermark]"></app-imagelist>
</sv>
</sv-container>
<nz-divider></nz-divider>
<sv-container col="3" class="mt16">
<sv-title>法人信息</sv-title>
<sv-title>企业法人信息</sv-title>
<sv label="法定代表人">
{{ detailData?.name }}
{{ detailData?.legalPersonIdentityVO?.name }}
</sv>
<sv label="身份证号">
{{ detailData?.certificateNumber }}
<sv label="身份证号">
{{ detailData?.legalPersonIdentityVO?.certificateNumber }}
</sv>
<sv label="身份证有效期">
{{ detailData?.validStartTime }} -
{{ detailData?.validEndTime ? detailData?.validEndTime : '长期' }}
{{ detailData?.legalPersonIdentityVO?.validStartTime }} -
{{ detailData?.legalPersonIdentityVO?.validEndTime || '长期' }}
</sv>
<sv label="身份证照" col="1">
<!-- <app-imagelist [imgList]="detailData?.certificatePhoto"></app-imagelist> -->
<app-imagelist
[imgList]="[detailData?.legalPersonIdentityVO?.certificatePhotoFrontWatermark,detailData?.legalPersonIdentityVO?.certificatePhotoBackWatermark]">
</app-imagelist>
</sv>
</sv-container>
<nz-divider></nz-divider>
<sv-container col="3" class="mt16">
<sv-title>企业开票信息</sv-title>
<sv label="开户银行">
{{ detailData?.createBank }}
</sv>
<sv label="银行账户">
{{ detailData?.bankAccount }}
</sv>
<sv label="注册电话">
{{ detailData?.registerPhone }}
</sv>
<sv label="注册地址">
{{ detailData?.registerAddress }}
</sv>
</sv-container>
<div>
<div
style="
position: sticky;
bottom: 0;
margin-top: 0.5rem;
padding-top: 0.5rem;
text-align: right;
background-color: #fff;
border-top: 1px solid #eee;
"
>
<button nz-button nzType="default" nzDanger (click)="auditPass()">审核通过</button>
<button nz-button nzType="default" nzDanger (click)="auditNo()">驳回审核</button>
<button nz-button nzType="default" nzDanger (click)="ratify()">修改</button>
</div>
</div>
</nz-card>
</ng-container>
<nz-modal [(nzVisible)]="isVisible" [nzFooter]="nzModalFooter" nzTitle="审核通过" (nzOnOk)="handleOK()" (nzOnCancel)="handleCancel('suppliersType')">
<ng-container *nzModalContent>
<sf #sf [schema]="schema" [ui]="ui" [compact]="false" [button]="'none'" [formData]="suppliersData"></sf>
</ng-container>
<ng-template #nzModalFooter>
<button nz-button nzType="default" (click)="handleCancel('suppliersType')">取消</button>
<button nz-button nzType="primary" (click)="handleOK()" [disabled]="">确认</button>
</ng-template>
</nz-modal>
<nz-modal [(nzVisible)]="isVisibleNo" [nzFooter]="nzModalFooter2" nzTitle="审核驳回" (nzOnOk)="handleOK()" (nzOnCancel)="handleCancel('suppliersTypeNo')">
<ng-container *nzModalContent>
<sf #sf2 [schema]="schema2" [ui]="ui2" [compact]="false" [button]="'none'" [formData]="suppliersData"></sf>
</ng-container>
<ng-template #nzModalFooter2>
<button nz-button nzType="default" (click)="handleCancel('suppliersTypeNo')">取消</button>
<button nz-button nzType="primary" (click)="handleOK()" [disabled]="">确认</button>
</ng-template>
</nz-modal>
<ng-template #approvedModal>
<div nz-row nzGutter="8">
<div nz-col nzSpan="24" se-container [labelWidth]="120">
<se [col]="1" label="公司名称">
{{ detailData?.enterpriseName }}
</se>
<se [col]="1" label="网络货运人" required >
<nz-select nzPlaceHolder="请选择" [(ngModel)]="networkTransporter">
<nz-option [nzValue]="1" nzLabel="Jack"></nz-option>
<nz-option [nzValue]="2" nzLabel="Lucy"></nz-option>
</nz-select>
</se>
</div>
</div>
</ng-template>
<ng-template #redectModal>
<div nz-row nzGutter="8">
<div nz-col nzSpan="24" se-container [labelWidth]="120">
<se [col]="1" label="公司名称">
{{ detailData?.enterpriseName }}
</se>
<se [col]="1" label="备注" required >
<textarea nz-input rows="3" style="width: 325px;margin-left: 14px;" [(ngModel)]="approvalOpinion"></textarea>
</se>
</div>
</div>
</ng-template>

View File

@ -1,31 +0,0 @@
/*
* @Author: your name
* @Date: 2021-11-30 10:25:50
* @LastEditTime: 2021-11-30 10:26:29
* @LastEditors: your name
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: \tms-obc-web\src\app\routes\usercenter\components\freight\enterprise-audit\view\view.component.spec.ts
*/
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { FreightComponentsEnterpriseAuditViewComponent } from './view.component';
describe('FreightComponentsEnterpriseAuditViewComponent', () => {
let component: FreightComponentsEnterpriseAuditViewComponent;
let fixture: ComponentFixture<FreightComponentsEnterpriseAuditViewComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [FreightComponentsEnterpriseAuditViewComponent],
}).compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(FreightComponentsEnterpriseAuditViewComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -4,113 +4,59 @@ import { STColumn, STComponent } from '@delon/abc/st';
import { ModalHelper, _HttpClient } from '@delon/theme';
import { NzMessageService } from 'ng-zorro-antd/message';
import { UsermanageService } from '../../../../services/usercenter.service';
import { SFComponent, SFSchema, SFDateWidgetSchema, SFUISchema, SFUploadWidgetSchema, SFSelectWidgetSchema, SFTextWidgetSchema, SFTagWidgetSchema } from '@delon/form';
import {
SFComponent,
SFSchema,
SFDateWidgetSchema,
SFUISchema,
SFUploadWidgetSchema,
SFSelectWidgetSchema,
SFTextWidgetSchema,
SFTagWidgetSchema
} from '@delon/form';
import { Observable, Observer } from 'rxjs';
import { NzModalService } from 'ng-zorro-antd/modal';
@Component({
selector: 'app-Freight-components-EnterpriseAudit-view',
templateUrl: './view.component.html',
styleUrls: ['./view.component.less'],
styleUrls: ['./view.component.less']
})
export class FreightComponentsEnterpriseAuditViewComponent implements OnInit {
i: any;
url = `/rule?_allow_anonymous=true`;
@ViewChild('st', { static: false }) st!: STComponent;
detailData: any;
isVisible = false;
isVisibleNo = false;
modalTitle = '有效期';
modalName = '';
ui!: SFUISchema;
ui2!: SFUISchema;
schema!: SFSchema;
@ViewChild('sf', { static: false }) sf!: SFComponent;
schema2!: SFSchema;
@ViewChild('sf2', { static: false }) sf2!: SFComponent;
validData: any = ['suppliersType'];
suppliersData: any = {};
@ViewChild('approvedModal', { static: false })
approvedModal!: any;
@ViewChild('redectModal', { static: false })
redectModal!: any;
constructor(
private http: _HttpClient,
private modal: ModalHelper,
public service: UsermanageService,
private route: ActivatedRoute,
private modalHelper: ModalHelper,
private msgSrv: NzMessageService,
) {}
approvalOpinion = '';
networkTransporter = null;
detailData: any;
statusE: any = {
10: '待审核',
20: '审核通过',
30: '审核失败'
};
isEdit = false;
constructor(private nzModalService: NzModalService, public service: UsermanageService, private route: ActivatedRoute) {}
ngOnInit() {
console.log(this.route.snapshot);
// this.initData();
this.initSF();
this.initSFNo();
this.initData();
// this.launchSign();
}
/**
* 初始化查询表单
*/
initSF() {
this.schema = {
properties: {
'公司名称': { type: 'number', ui: { widget: 'text', defaultText: '深圳市星链供应链云科技有限公' } as SFTextWidgetSchema },
status: {
type: 'string',
title: '税源地',
enum: [
{ label: '待支付', value: 'WAIT_BUYER_PAY', otherData: 1 },
{ label: '已支付', value: 'TRADE_SUCCESS' },
{ label: '交易完成', value: 'TRADE_FINISHED' },
],
default: 'WAIT_BUYER_PAY',
ui: {
widget: 'select',
change: (value, orgData) => console.log(value, orgData),
} as SFSelectWidgetSchema,
},
},
required: ['status'],
};
this.ui = { '*': { spanLabelFixed: 120, grid: { span: 24 } } };
}
initSFNo() {
this.schema2 = {
properties: {
'公司名称': { type: 'number', ui: { widget: 'text', defaultText: '深圳市星链供应链云科技有限公' } as SFTextWidgetSchema },
roleDescription: {
title: '地址',
type: 'string',
maxLength: 30,
ui: {
placeholder: '请输入地址',
widget: 'textarea',
},
},
like: {
type: 'number',
title: '兴趣',
enum: [
{ value: 1, label: '电影' },
{ value: 2, label: '书' },
{ value: 3, label: '旅行' },
],
ui: {
widget: 'tag',
} as SFTagWidgetSchema,
default: [1, 2],
},
},
required: ['roleDescription'],
};
this.ui2 = { '*': { spanLabelFixed: 120, grid: { span: 24 } } };
}
async initData() {
console.log(this.route.snapshot, 'this.route.snapshot');
const params = {
tenantId: this.route.snapshot.params.id,
// tenantId: this.route.snapshot.queryParams.tenantId,
};
const res = await this.service.asyncRequest(this.service.$api_get_one, params);
initData() {
this.service
.request(this.service.$api_get_freight_detail, {
id: this.route.snapshot.params.id
})
.subscribe(res => {
if (res) {
this.detailData = res;
}
});
// // 商品资质
// if (res.enterpriseBusinessJson) {
// res.enterpriseBusinessJson.aptitudes = res.enterpriseBusinessJson?.aptitudes ? res.enterpriseBusinessJson.aptitudes.split(',') : [];
@ -122,24 +68,24 @@ export class FreightComponentsEnterpriseAuditViewComponent implements OnInit {
// // res.applyUserJson.imagelist.push(res.applyUserJson.handCertificate);
// 法人身份证证件
const imagelist = [];
imagelist.push(res?.certificatePhotoFront);
imagelist.push(res?.certificatePhotoBack);
res.certificatePhoto = imagelist;
// const imagelist = [];
// imagelist.push(res?.certificatePhotoFront);
// imagelist.push(res?.certificatePhotoBack);
// res.certificatePhoto = imagelist;
// 营业执照
res.enterpriseQualificationCertificate = res.enterpriseQualificationCertificate
? res.enterpriseQualificationCertificate.split(',')
: [];
// // 营业执照
// res.enterpriseQualificationCertificate = res.enterpriseQualificationCertificate
// ? res.enterpriseQualificationCertificate.split(',')
// : [];
// 返回所在地
res.enterpriseAddressCodeStr = await this.getRegionFullName(res.enterpriseAddressCode);
// // 返回所在地
// res.enterpriseAddressCodeStr = await this.getRegionFullName(res.enterpriseAddressCode);
this.detailData = res;
this.suppliersData = {
suppliersType: res?.suppliersType,
externalSuppliersId: res?.externalSuppliersId,
};
// this.detailData = res;
// this.suppliersData = {
// suppliersType: res?.suppliersType,
// externalSuppliersId: res?.externalSuppliersId
// };
}
/**
@ -148,7 +94,7 @@ export class FreightComponentsEnterpriseAuditViewComponent implements OnInit {
*/
async getRegionFullName(code: any) {
const params = {
regionCode: code,
regionCode: code
};
const res = await this.service.asyncRequest(this.service.$api_get_one, params, 'POST', true);
// if (res && res.regionFullName) {
@ -157,36 +103,57 @@ export class FreightComponentsEnterpriseAuditViewComponent implements OnInit {
// }
return res && res.regionFullName;
}
auditPass() {
this.networkTransporter = null;
this.nzModalService.create({
nzTitle: '审核通过',
nzContent: this.approvedModal,
nzOnOk: () => {
if (!this.networkTransporter) {
return false;
}
this.auditEnterprise(20);
return;
}
});
}
auditNo() {
this.approvalOpinion = '';
this.nzModalService.create({
nzTitle: '审核驳回',
nzContent: this.redectModal,
nzOnOk: () => {
if (!this.approvalOpinion) {
return false;
}
this.auditEnterprise(30);
return;
}
});
}
private auditEnterprise(status: number) {
this.service
.request(this.service.$api_audit_freight, {
approvalStatus: status,
id: this.detailData.id,
approvalOpinion: this.approvalOpinion,
networkTransporter: this.networkTransporter
})
.subscribe(res => {
if (res) {
this.service.msgSrv.success(status === 20 ? '审核通过' : '驳回成功');
}
this.initData();
});
}
ratify() {
this.isEdit = true;
}
goBack() {
window.history.go(-1);
}
handleCancel(name: any) {
if (name === 'suppliersTypeNo') {
this.isVisibleNo = false;
} else {
this.isVisible = false;
}
}
handleOK() {
const params: any = {
tenantId: this.route.snapshot.params.id,
// tenantId: this.route.snapshot.queryParams.tenantId,
};
console.log(this.sf.value)
// this.service.http.post(this.service.$api_set_freezeOrResume, params).subscribe((res) => {
// });
}
auditPass() {
this.isVisible = true
}
auditNo() {
this.isVisibleNo = true
}
ratify() {
}
}

View File

@ -6,51 +6,53 @@
</button>
</ng-template>
<ng-template #content>
<div class="user-info" nz-row>
<div nz-col [nzXl]="18" [nzLg]="24" [nzSm]="24" [nzXs]="24" class="d-flex">
<img [src]="detailData?.enterpriseLogo" />
<div style="flex: 1;">
<div nz-row>
<div nz-col [nzLg]="12" [nzSm]="24" [nzXs]="24">
<p style="margin-bottom: 0;">{{ detailData?.enterpriseName }}</p>
<nz-skeleton [nzLoading]="service.http.loading">
<div class="user-info" nz-row>
<div nz-col [nzXl]="18" [nzLg]="24" [nzSm]="24" [nzXs]="24" class="d-flex">
<img [src]="detailData?.enterpriseLogo" />
<div style="flex: 1;">
<div nz-row>
<div nz-col [nzLg]="12" [nzSm]="24" [nzXs]="24">
<p style="margin-bottom: 0;">{{ detailData?.enterpriseName }}</p>
</div>
<div nz-col [nzLg]="12" [nzSm]="24" [nzXs]="24">
<nz-badge nzStatus="success" nzText="正常" *ngIf="detailData?.stateLocked === 0"></nz-badge>
<nz-badge nzStatus="error" nzText="冻结" *ngIf="detailData?.stateLocked === 1"></nz-badge>
</div>
</div>
<div nz-col [nzLg]="12" [nzSm]="24" [nzXs]="24">
<nz-badge nzStatus="success" nzText="正常" *ngIf="detailData?.stateLocked === 0"></nz-badge>
<nz-badge nzStatus="error" nzText="冻结" *ngIf="detailData?.stateLocked === 1"></nz-badge>
<div nz-row>
<div nz-col [nzLg]="12" [nzSm]="24" [nzXs]="24">
<p>{{ detailData?.unifiedSocialCreditCode }}</p>
</div>
<div nz-col [nzLg]="12" [nzSm]="24" [nzXs]="24">
认证时间:{{detailData?.createTime}}
</div>
</div>
</div>
<div nz-row>
<div nz-col [nzLg]="12" [nzSm]="24" [nzXs]="24">
<p>{{ detailData?.unifiedSocialCreditCode }}</p>
<div>
服务评级:<nz-rate [ngModel]="detailData?.serviceLevel" nzDisabled></nz-rate>
</div>
<div nz-col [nzLg]="12" [nzSm]="24" [nzXs]="24">
认证时间:{{detailData?.createTime}}
</div>
</div>
<div>
服务评级:<nz-rate [ngModel]="detailData?.serviceLevel" nzDisabled></nz-rate>
</div>
</div>
<div nz-col [nzXl]="6" [nzLg]="24" [nzSm]="24" [nzXs]="24" class="text-right mt-sm">
<button [nzLoading]="service.http.loading" nz-button nzDanger nz-popconfirm [nzPopconfirmTitle]="enable"
(nzOnConfirm)="freezeOrResume(1)" nzPopconfirmPlacement="bottomRight" *ngIf="detailData?.stateLocked === 1">
启用
</button>
<button [nzLoading]="service.http.loading" nz-button nzDanger nz-popconfirm [nzPopconfirmTitle]="frozen"
(nzOnConfirm)="freezeOrResume(0)" nzPopconfirmPlacement="bottomRight" *ngIf="detailData?.stateLocked === 0">
冻结
</button>
<button [nzLoading]="service.http.loading" nz-button nzDanger nz-popconfirm [nzPopconfirmTitle]="Payfrozen"
(nzOnConfirm)="PayOrResume(0)" nzPopconfirmPlacement="bottomRight" *ngIf="detailData?.createPay === 1">
开通支付权限
</button>
<button [nzLoading]="service.http.loading" nz-button nzDanger nz-popconfirm [nzPopconfirmTitle]="Payenable"
(nzOnConfirm)="PayOrResume(1)" nzPopconfirmPlacement="bottomRight" *ngIf="detailData?.createPay === 0">
关闭支付权限
</button>
</div>
</div>
<div nz-col [nzXl]="6" [nzLg]="24" [nzSm]="24" [nzXs]="24" class="text-right mt-sm">
<button [nzLoading]="service.http.loading" nz-button nzDanger nz-popconfirm [nzPopconfirmTitle]="enable"
(nzOnConfirm)="freezeOrResume(1)" nzPopconfirmPlacement="bottomRight" *ngIf="detailData?.stateLocked === 1">
启用
</button>
<button [nzLoading]="service.http.loading" nz-button nzDanger nz-popconfirm [nzPopconfirmTitle]="frozen"
(nzOnConfirm)="freezeOrResume(0)" nzPopconfirmPlacement="bottomRight" *ngIf="detailData?.stateLocked === 0">
冻结
</button>
<button [nzLoading]="service.http.loading" nz-button nzDanger nz-popconfirm [nzPopconfirmTitle]="Payfrozen"
(nzOnConfirm)="PayOrResume(0)" nzPopconfirmPlacement="bottomRight" *ngIf="detailData?.createPay === 1">
开通支付权限
</button>
<button [nzLoading]="service.http.loading" nz-button nzDanger nz-popconfirm [nzPopconfirmTitle]="Payenable"
(nzOnConfirm)="PayOrResume(1)" nzPopconfirmPlacement="bottomRight" *ngIf="detailData?.createPay === 0">
关闭支付权限
</button>
</div>
</div>
</nz-skeleton>
</ng-template>
<ng-template #frozen>
@ -74,7 +76,7 @@
</ng-template>
</page-header-wrapper>
<nz-card>
<nz-card [nzLoading]="service.http.loading">
<sv-container col="3">
<sv-title>企业管理员信息</sv-title>
<sv label="姓名">
@ -86,13 +88,15 @@
<sv label="身份证号">
{{ detailData?.contactadminUserInfo?.certificateNumber }}
</sv>
</sv-container>
<sv-container col="2">
<sv label="身份证照">
<img [src]="detailData?.adminUserInfo?.certificatePhotoFrontWatermark" alt="">
<img [src]="detailData?.adminUserInfo?.certificatePhotoBackWatermark" alt="">
<app-imagelist
[imgList]="[detailData?.adminUserInfo?.certificatePhotoFrontWatermark,detailData?.adminUserInfo?.certificatePhotoBackWatermark]">
</app-imagelist>
</sv>
<sv label="企业授权函">
<img [src]="detailData?.adminUserInfo?.certificatePhotoBackWatermark" alt="">
<!-- <app-imagelist [imgList]="detailData?.enterpriseQualificationCertificate"></app-imagelist> -->
<app-imagelist [imgList]="[detailData?.adminUserInfo?.certificatePhotoBackWatermark]"></app-imagelist>
</sv>
</sv-container>
<nz-divider></nz-divider>
@ -136,7 +140,8 @@
</sv-container>
<sv-container col="2" class="mt16">
<sv label="公司所在地" col="3">
{{ detailData?.enterpriseAddressCodeStr }}
{{ detailData?.fullRegionVO?.provinceName }}{{ detailData?.fullRegionVO?.cityName }}{{
detailData?.fullRegionVO?.areaName }}
</sv>
<sv label="公司详细地址">
{{ detailData?.enterpriseAddress }}
@ -152,7 +157,7 @@
{{ detailData?.taxAuthority }}
</sv>
<sv label="营业执照">
<!-- <app-imagelist [imgList]="detailData?.enterpriseQualificationCertificate"></app-imagelist> -->
<app-imagelist [imgList]="[detailData?.licensePhotoWatermark]"></app-imagelist>
</sv>
</sv-container>
<nz-divider></nz-divider>
@ -169,7 +174,9 @@
{{ detailData?.legalPersonIdentityVO?.validEndTime || '长期' }}
</sv>
<sv label="身份证照" col="1">
<!-- <app-imagelist [imgList]="detailData?.certificatePhoto"></app-imagelist> -->
<app-imagelist
[imgList]="[detailData?.legalPersonIdentityVO?.certificatePhotoFrontWatermark,detailData?.legalPersonIdentityVO?.certificatePhotoBackWatermark]">
</app-imagelist>
</sv>
</sv-container>
<nz-divider></nz-divider>

View File

@ -12,29 +12,10 @@ import { UsermanageService } from '../../../../services/usercenter.service';
styleUrls: ['./detail.component.less']
})
export class FreightComponentsListDetailComponent implements OnInit {
i: any;
url = `/rule?_allow_anonymous=true`;
@ViewChild('st', { static: false }) st!: STComponent;
detailData: any;
isShow = false;
modalTitle = '有效期';
modalName = '';
ui!: SFUISchema;
schema!: SFSchema;
@ViewChild('sf', { static: false }) sf!: SFComponent;
schema1!: SFSchema;
@ViewChild('sf1', { static: false }) sf1!: SFComponent;
validData: any = ['suppliersType'];
suppliersData: any = {};
constructor(
private http: _HttpClient,
private modal: ModalHelper,
public service: UsermanageService,
private route: ActivatedRoute,
private modalHelper: ModalHelper,
private msgSrv: NzMessageService
) {}
constructor(public service: UsermanageService, private route: ActivatedRoute) {}
ngOnInit() {
this.initData();
@ -96,11 +77,6 @@ export class FreightComponentsListDetailComponent implements OnInit {
// }
return res && res.regionFullName;
}
add() {
// this.modal
// .createStatic(FormEditComponent, { i: { id: 0 } })
// .subscribe(() => this.st.reload());
}
goBack() {
window.history.go(-1);
}
@ -126,23 +102,27 @@ export class FreightComponentsListDetailComponent implements OnInit {
}
});
}
/**
* 支付权限
*/
PayOrResume(type: number) {
this.service.http
.post(this.service.$api_lock_freight, {
id: this.route.snapshot.params.id,
statedLocked: !!type
})
.subscribe(res => {
if (res.data === true) {
if (type === 1) {
this.service.msgSrv.success(`开启成功!`);
.post(this.service.$api_lock_freight, {
id: this.route.snapshot.params.id,
statedLocked: !!type
})
.subscribe(res => {
if (res.data === true) {
if (type === 1) {
this.service.msgSrv.success(`开启成功!`);
} else {
this.service.msgSrv.success(`关闭成功!`);
}
this.initData();
} else {
this.service.msgSrv.success(`关闭成功!`);
this.service.msgSrv.error(res.msg || '操作失败!');
}
this.initData();
} else {
this.service.msgSrv.error(res.msg || '操作失败!');
}
});
});
}
}

View File

@ -1,82 +1,97 @@
<!--
* @Author: your name
* @Date: 2021-11-30 15:09:49
* @LastEditTime: 2021-11-30 16:28:26
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: \tms-obc-web\src\app\routes\usercenter\components\freight\user\detail\detail.component.html
-->
<ng-container >
<ng-container>
<!-- 页头 -->
<page-header-wrapper [title]="'用户列表详情'" [logo]="logo" [content]="content">
<page-header-wrapper [title]="'员工详情'" [logo]="logo" [content]="content">
<ng-template #logo>
<button nz-button nz-tooltip nzTooltipTitle="返回上一页" (click)="goBack()">
<i nz-icon nzType="left" nzTheme="outline"></i>
</button>
</ng-template>
<ng-template #content>
<div class="user-info">
<div style="flex: 1">
<div style="display: flex;">
<p style="padding-right: 80px; width: 400px; font-size: 20px;">申请编号:{{ detailData?.shoppFeignVO?.publicity }}</p>
</div>
<div style="display: flex;">
<p style="padding-right: 80px; width: 400px;">申请时间{{ detailData?.shoppFeignVO?.introduction }}</p>
<p >申请人:黄龙真人</p>
</div>
<div>
申请人手机号6846846416541
</div>
<div style="position: relative;top: -65%;
left: 85%;">
<span style="font-size: 12px;">状态</span>
<br />
<span>待审核</span>
</div>
<nz-skeleton [nzLoading]="service.http.loading">
<div class="user-info" nz-row>
<div nz-col nzSpan="24" class="d-flex">
<img [src]="detailData?.enterpriseLogo" />
<div style="flex: 1;">
<div nz-row>
<div nz-col [nzLg]="12" [nzSm]="24" [nzXs]="24">
<p style="margin-bottom: 0;">{{ detailData?.enterpriseName }}
<nz-badge nzStatus="success" nzText="正常" *ngIf="detailData?.stateLocked" class="ml-sm"></nz-badge>
<nz-badge nzStatus="error" nzText="冻结" *ngIf="!detailData?.stateLocked" class="ml-sm"></nz-badge>
</p>
</div>
</div>
<div nz-row>
<div nz-col [nzLg]="8" [nzSm]="24" [nzXs]="24">
<p>手机号:{{ detailData?.phone }}</p>
</div>
<div nz-col [nzLg]="8" [nzSm]="24" [nzXs]="24">
申请时间:{{detailData?.createTime}}
</div>
<div nz-col [nzXl]="8" [nzLg]="8" [nzSm]="24" [nzXs]="24" class="d-flex"
style="justify-content: flex-end;">
<button [nzLoading]="service.http.loading" nz-button nzType="primary" nzGhost (click)="userAction(1)">
启用
</button>
<button [nzLoading]="service.http.loading" nz-button nzDanger (click)="userAction(0)">
冻结
</button>
</div>
</div>
</div>
</div>
</div>
</div>
</nz-skeleton>
</ng-template>
</page-header-wrapper>
<nz-card>
<sv-container col="1">
<sv-title>申请人信息</sv-title>
<nz-card [nzLoading]="service.http.loading">
<sv-container col="2">
<sv-title>个人信息
<div style="float: right;">
<button nz-button nzType="default" nzDanger (click)="auditPass()">审核通过</button>
<button nz-button nzType="default" nzDanger (click)="auditNo()">驳回审核</button>
<button nz-button nzType="default" nzDanger (click)="ratify()">修改</button>
</div>
</sv-title>
<sv label="姓名">
{{ detailData?.contactsName }}
</sv>
<sv label="身份证号码">
{{ detailData?.contactsPhone }}
</sv>
<sv label="企业授权函">
<!-- <app-imagelist [imgList]="detailData?.enterpriseQualificationCertificate"></app-imagelist> -->
<div style="float: right;">
<button nz-button nzType="default" nzDanger (click)="auditPass()">审核通过</button>
<button nz-button nzType="default" nzDanger (click)="auditNo()">驳回审核</button>
<button nz-button nzType="default" nzDanger (click)="ratify()">修改</button>
</div>
<sv label="身份证照">
<app-imagelist
[imgList]="[detailData?.legalPersonIdentityVO?.certificatePhotoFrontWatermark,detailData?.legalPersonIdentityVO?.certificatePhotoBackWatermark]">
</app-imagelist>
</sv>
</sv-container>
<nz-divider></nz-divider>
<sv-container col="3" class="mt16">
<sv-title>关联企业</sv-title>
<st
#st
[bordered]="true"
[columns]="columns"
[data]="detailData.goodsList"
[ngStyle]="{ margin: '1rem 0' }"
multiSort
size="small"
[page]="{ show: false }"
>
</st>
<!-- <st #st [bordered]="true" [columns]="columns" [data]="detailData.goodsList" [ngStyle]="{ margin: '1rem 0' }"
multiSort size="small" [page]="{ show: false }">
</st> -->
</sv-container>
</nz-card>
</ng-container>
<nz-modal [(nzVisible)]="isVisible" nzTitle="类型" (nzOnOk)="handleOK('suppliersType')">
<sf #sf1 [schema]="schema1" [ui]="ui" [compact]="false" [button]="'none'" [formData]="suppliersData"></sf>
<div *nzModalFooter>
<button nz-button nzType="default" (click)="handleCancel('suppliersType')">取消</button>
<button nz-button nzType="primary" (click)="handleOK('suppliersType')" [disabled]="!sf1.valid">确认</button>
<ng-template #redectModal>
<div nz-row nzGutter="8">
<div nz-col nzSpan="24" se-container [labelWidth]="120">
<se [col]="1" label="姓名">
{{ detailData?.enterpriseName }}
</se>
<se [col]="1" label="备注" required>
<textarea nz-input rows="3" style="width: 325px;margin-left: 14px;"
[(ngModel)]="approvalOpinion.remark"></textarea>
</se>
<se [col]="1" label="可选理由">
<nz-tag *ngFor="let tag of reasonTags" nzColor="default" nzMode="checkable"
[nzChecked]="approvalOpinion?.reason===tag" (nzCheckedChange)="approvalOpinion.reason=tag">
{{ tag }}
</nz-tag>
</se>
</div>
</div>
</nz-modal>
</ng-template>

View File

@ -4,279 +4,87 @@ import { STColumn, STComponent } from '@delon/abc/st';
import { SFComponent, SFDateWidgetSchema, SFSchema, SFUISchema } from '@delon/form';
import { ModalHelper, _HttpClient } from '@delon/theme';
import { NzMessageService } from 'ng-zorro-antd/message';
import { NzModalService } from 'ng-zorro-antd/modal';
import { UsermanageService } from '../../../../services/usercenter.service';
@Component({
selector: 'app-supplier-components-list-view',
templateUrl: './detail.component.html',
styleUrls: ['./detail.component.less'],
styleUrls: ['./detail.component.less']
})
export class FreightComponentsUserDetailComponent implements OnInit {
i: any;
url = `/rule?_allow_anonymous=true`;
@ViewChild('st', { static: false }) st!: STComponent;
@ViewChild('redectModal', { static: false })
redectModal!: any;
detailData: any = {
goodsList: [
{
perPrice: '22323',
goodsQuantity: '项目名称',
totalPrice: '角色',
},
{
perPrice: '2259595',
goodsQuantity: '项目名称2',
totalPrice: '角色',
},
]
};
isShow = false;
isVisible = false;
modalTitle = '有效期';
modalName = '';
ui!: SFUISchema;
schema!: SFSchema;
@ViewChild('sf', { static: false }) sf!: SFComponent;
schema1!: SFSchema;
@ViewChild('sf1', { static: false }) sf1!: SFComponent;
validData: any = ['suppliersType'];
suppliersData: any = {};
detailData: any = {};
@ViewChild('st', { static: false }) st!: STComponent;
columns: STColumn[] = [
{ title: '企业名称', index: 'perPrice', width: 300, className: 'text-center' },
{ title: '项目名称', index: 'goodsQuantity', width: 300, className: 'text-center' },
{ title: '角色', index: 'totalPrice', width: 300, className: 'text-center' },
{ title: '角色', index: 'totalPrice', width: 300, className: 'text-center' }
];
constructor(
private http: _HttpClient,
private modal: ModalHelper,
public service: UsermanageService,
private route: ActivatedRoute,
private modalHelper: ModalHelper,
private msgSrv: NzMessageService,
) {}
approvalOpinion = {
reason: '',
remark: ''
};
reasonTags = ['身份证照片太丑', '姓名与身份证号不匹配'];
constructor(private nzModalService: NzModalService, public service: UsermanageService, private route: ActivatedRoute) {}
ngOnInit() {
console.log(this.route.snapshot);
// this.initData();
this.initSF();
this.initSF1();
this.initData();
// this.launchSign();
}
/**
* 初始化查询表单
*/
initSF() {
this.schema = {
properties: {
_$expand: { type: 'boolean', ui: { hidden: true } },
effectiveDate: {
title: '有效期',
type: 'string',
ui: {
widget: 'date',
format: 'yyyy-MM-dd 00:00:00',
// hidden: this.modalName === 'effectiveDate' ? false : true,
} as SFDateWidgetSchema,
},
},
required: ['effectiveDate'],
};
this.ui = { '*': { spanLabelFixed: 120, grid: { span: 24 } } };
}
initSF1() {
this.schema1 = {
properties: {
_$expand: { type: 'boolean', ui: { hidden: true } },
suppliersType: {
type: 'string',
title: '类型',
enum: [
{ label: '非外部供应商', value: 0 },
{ label: '外部供应商', value: 1 },
],
default: '',
ui: {
widget: 'select',
change: (args: any) => {
console.log(args, 'args');
this.suppliersData.suppliersType = args;
if (args === 1) {
this.validData = ['suppliersType', 'externalSuppliersId'];
} else {
this.validData = ['suppliersType'];
this.suppliersData.externalSuppliersId = '';
}
this.initSF1();
},
},
},
externalSuppliersId: {
title: '外部供应商id',
type: 'string',
default: '',
ui: {
visibleIf: { suppliersType: (value: any) => value === 1 },
},
},
},
required: this.validData,
};
}
showModal(name: any) {
this.modalName = name;
if (name === 'effectiveDate') {
this.isShow = true;
} else {
this.isVisible = true;
}
}
async initData() {
console.log(this.route.snapshot, 'this.route.snapshot');
const params = {
tenantId: this.route.snapshot.params.id,
id: this.route.snapshot.params.id
// tenantId: this.route.snapshot.queryParams.tenantId,
};
const res = await this.service.asyncRequest(this.service.$api_get_one, params);
// // 商品资质
// if (res.enterpriseBusinessJson) {
// res.enterpriseBusinessJson.aptitudes = res.enterpriseBusinessJson?.aptitudes ? res.enterpriseBusinessJson.aptitudes.split(',') : [];
// }
// // // 申请人身份证证件
// // res.applyUserJson.imagelist = [];
// // res.applyUserJson.imagelist.push(res.applyUserJson.certificatePhotoFront);
// // res.applyUserJson.imagelist.push(res.applyUserJson.certificatePhotoBack);
// // res.applyUserJson.imagelist.push(res.applyUserJson.handCertificate);
// 法人身份证证件
const imagelist = [];
imagelist.push(res?.certificatePhotoFront);
imagelist.push(res?.certificatePhotoBack);
res.certificatePhoto = imagelist;
// 营业执照
res.enterpriseQualificationCertificate = res.enterpriseQualificationCertificate
? res.enterpriseQualificationCertificate.split(',')
: [];
// 返回所在地
res.enterpriseAddressCodeStr = await this.getRegionFullName(res.enterpriseAddressCode);
this.detailData = res;
this.suppliersData = {
suppliersType: res?.suppliersType,
externalSuppliersId: res?.externalSuppliersId,
};
}
/**
* 根据地区code查询地区详情
* @param code 地区代码
*/
async getRegionFullName(code: any) {
const params = {
regionCode: code,
};
const res = await this.service.asyncRequest(this.service.$api_get_one, params, 'POST', true);
// if (res && res.regionFullName) {
// const arr = res.regionFullName.split(',');
// res.regionFullName = arr.reverse().join('-');
// }
return res && res.regionFullName;
}
add() {
// this.modal
// .createStatic(FormEditComponent, { i: { id: 0 } })
// .subscribe(() => this.st.reload());
}
goBack() {
window.history.go(-1);
}
/**
* 冻结
*/
freezeOrResume(type: number) {
console.log(type)
// this.service.http
// .post(this.service.$api_set_freezeOrResume, {
// tenantId: this.route.snapshot.params.id,
// // tenantId: this.route.snapshot.queryParams.tenantId,
// status: type,
// })
// .subscribe((res) => {
// if (res.data === true) {
// if (type === 0) {
// this.service.msgSrv.success(`启用成功!`);
// } else if (type === 1) {
// this.service.msgSrv.success(`冻结成功!`);
// }
// this.ngOnInit();
// } else {
// this.service.msgSrv.error(res.msg || '操作失败!');
// }
// });
}
PayOrResume(type: number) {
console.log(type)
// this.service.http
// .post(this.service.$api_set_freezeOrResume, {
// tenantId: this.route.snapshot.params.id,
// // tenantId: this.route.snapshot.queryParams.tenantId,
// status: type,
// })
// .subscribe((res) => {
// if (res.data === true) {
// if (type === 0) {
// this.service.msgSrv.success(`启用成功!`);
// } else if (type === 1) {
// this.service.msgSrv.success(`冻结成功!`);
// }
// this.ngOnInit();
// } else {
// this.service.msgSrv.error(res.msg || '操作失败!');
// }
// });
}
handleCancel(name: any) {
if (name === 'effectiveDate') {
this.isShow = false;
} else {
this.isVisible = false;
}
}
handleOK(name: any) {
const params: any = {
tenantId: this.route.snapshot.params.id,
// tenantId: this.route.snapshot.queryParams.tenantId,
};
if (name === 'effectiveDate') {
params.effectiveDate = this.sf?.value?.effectiveDate;
} else {
Object.assign(params, this.sf1?.value);
}
this.service.http.post(this.service.$api_get_one, params).subscribe((res) => {
if (res.data === true) {
this.service.msgSrv.success(`编辑成功!`);
this.ngOnInit();
} else {
this.service.msgSrv.error(res.msg || '编辑失败!');
}
if (name === 'effectiveDate') {
this.isShow = false;
} else {
this.isVisible = false;
userAction(status: number) {
this.nzModalService.warning({
nzTitle: status === 1 ? '确定启用该用户吗?' : '确定冻结该用户吗?',
nzContent:
status === 1
? '停用后,该用户将被限制使用,不限于访问受限、无法发布货源等,请谨慎操作'
: '启用后,该用户将恢复正常使用功能,请再次确认',
nzOnOk: () => {
// this.service.request(this.service.$api_lock_user)
this.st.reload();
}
});
}
auditPass() {
this.nzModalService.confirm({
nzTitle: '审核通过',
nzContent: `是否确认通过(姓名:黄大仙)审核`,
nzOnOk: () => {}
});
}
auditNo() {
this.approvalOpinion = {
reason: '',
remark: ''
};
this.nzModalService.create({
nzTitle: '审核驳回',
nzContent: this.redectModal,
nzOnOk: () => {
if (!this.approvalOpinion?.remark) {
return false;
}
return;
}
});
}
ratify() {
ratify() {}
goBack() {
window.history.go(-1);
}
}

View File

@ -1,153 +1,57 @@
<!--
* @Author: your name
* @Date: 2021-11-29 15:22:34
* @LastEditTime: 2021-11-30 15:52:31
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: \tms-obc-web\src\app\routes\usercenter\components\freight\list\list.component.html
-->
<!-- 页头 -->
<page-header-wrapper [title]="'用户列表'"></page-header-wrapper>
<page-header-wrapper [title]="'员工列表'"></page-header-wrapper>
<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"
(formSubmit)="st?.load(1)"
(formReset)="resetSF()"
></sf>
<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" [disabled]="!sf.valid" [nzLoading]="service.http.loading"
(click)="st?.load(1)">查询</button>
<button nz-button (click)="resetSF()">重置</button>
<button nz-button nzType="primary" [nzLoading]="service.http.loading" (click)="st?.load(1)">导出</button>
<button nz-button nzType="link" (click)="expandToggle()">
{{ !_$expand ? '展开' : '收起' }}
<i nz-icon [nzType]="!_$expand ? 'down' : 'up'"></i>
</button>
</div>
<!-- [loading]="service.http.loading" -->
<!-- 查询字段大于3个时根据展开状态调整布局 -->
<ng-container *ngIf="queryFieldCount > 4">
<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="primary" [nzLoading]="service.http.loading" (click)="st?.load(1)">导出</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>
<!-- 数据列表 -->
<!-- [data]="service.$api_get_supplier_page" -->
<st
#st
[bordered]="true"
[columns]="columns"
[data]='datalist'
<st #st [bordered]="true" [columns]="columns" [data]='service.$api_get_user_list'
[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] }"
[loadingDelay]="500"
[loading]="service.http.loading"
>
[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">
<ng-template st-row="enterpriseName" let-item let-index="index">
<div nz-tooltip [nzTooltipTitle]="item.enterpriseName">
<div
style="display: inline-block; max-width: 280px; margin: 0 auto; overflow: hidden; white-space: nowrap; text-overflow: ellipsis"
>
style="display: inline-block; max-width: 280px; margin: 0 auto; overflow: hidden; white-space: nowrap; text-overflow: ellipsis">
{{ item.enterpriseName }}
</div>
</div>
</ng-template>
<ng-template st-row="contactsPhone" let-item let-index="index">
<div
style="color: #52c41a;" (click)="daoyun(item)"
>
{{ item.contactsPhone }}
<div style="color: #52c41a;" (click)="addPromoter(item)">
{{ item.contactsPhone }}
</div>
</ng-template>
<ng-template st-row="stateCol" let-item let-index="index">
<nz-tag *ngIf="item.stateLocked" nzColor="error">冻结</nz-tag>
<nz-tag *elseBlock nzColor="success">正常</nz-tag>
</ng-template>
</st>
<nz-modal [(nzVisible)]="isVisible" [nzFooter]="nzModalFooter" nzTitle="推广业务员" (nzOnOk)="handleOK()" (nzOnCancel)="handleCancel()">
<ng-container *nzModalContent>
<sf #sf2 [schema]="schema2" [ui]="ui2" [compact]="false" [button]="'none'" [formData]="suppliersData"></sf>
</ng-container>
<ng-template #nzModalFooter>
<button nz-button nzType="default" (click)="handleCancel()">取消</button>
<button nz-button nzType="primary" (click)="handleOK()" [disabled]="">确认</button>
</ng-template>
</nz-modal>
</nz-card>
<nz-modal [(nzVisible)]="isVisibleFreeze" [nzFooter]="nzModalFooterFreeze" (nzOnOk)="handleOK()" (nzOnCancel)="handleCancel_freeze()">
<ng-container *nzModalContent>
<div class="ant-popover-message">
<i nz-icon="" nztheme="fill" class="anticon anticon-exclamation-circle ng-star-inserted">
<svg
viewBox="64 64 896 896"
focusable="false"
fill="currentColor"
width="1em"
height="1em"
class="ng-tns-c358-1487"
data-icon="exclamation-circle"
aria-hidden="true"
>
<path
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm-32 232c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V296zm32 440a48.01 48.01 0 010-96 48.01 48.01 0 010 96z"
></path>
</svg>
</i>
<div class="ant-popover-message-title ng-star-inserted self-ant-popover-title" style="font-size: 16px">确定冻结该企业吗?</div>
<div class="ant-popover-message-title ng-star-inserted" style="color: red;">
停用后,该企业将被限制使用,不限于访问受限、无法发布货源等,请谨慎操作
</div>
</div>
</ng-container>
<ng-template #nzModalFooterFreeze>
<button nz-button nzType="default" (click)="handleCancel_freeze()">取消</button>
<button nz-button nzType="primary" (click)="handleOK()" [disabled]="">确认</button>
</ng-template>
</nz-modal>
<nz-modal [(nzVisible)]="isVisibleOpen" [nzFooter]="nzModalFooterOpen" (nzOnOk)="handleOK()" (nzOnCancel)="handleCancel_open()">
<ng-container *nzModalContent>
<div class="ant-popover-message">
<i nz-icon="" nztheme="fill" class="anticon anticon-exclamation-circle ng-star-inserted">
<svg
viewBox="64 64 896 896"
focusable="false"
fill="currentColor"
width="1em"
height="1em"
class="ng-tns-c358-1487"
data-icon="exclamation-circle"
aria-hidden="true"
>
<path
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm-32 232c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V296zm32 440a48.01 48.01 0 010-96 48.01 48.01 0 010 96z"
></path>
</svg>
</i>
<div class="ant-popover-message-title ng-star-inserted self-ant-popover-title" style="font-size: 16px">确定启用该企业吗?</div>
<div class="ant-popover-message-title ng-star-inserted" style="color: red;">
启用后,该企业将恢复正常使用功能,请再次确认
</div>
</div>
</ng-container>
<ng-template #nzModalFooterOpen>
<button nz-button nzType="default" (click)="handleCancel_open()">取消</button>
<button nz-button nzType="primary" (click)="handleOK()" [disabled]="">确认</button>
</ng-template>
</nz-modal>
</nz-card>
<ng-template #promoterModal>
<div nz-row nzGutter="8">
<div nz-col nzSpan="24" se-container [labelWidth]="80">
<se [col]="1" label="手机号">
<input nz-input [(ngModel)]="promotersTelephone" />
</se>
</div>
</div>
</ng-template>

View File

@ -0,0 +1,6 @@
:host::ng-deep {
nz-range-picker {
width: 100%;
}
}

View File

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

View File

@ -1,75 +1,44 @@
import { Component, OnInit, ViewChild } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { STColumn, STColumnBadge, STComponent, STData } from '@delon/abc/st';
import { SFComponent, SFSchema, SFUISchema } from '@delon/form';
import { SFComponent, SFDateWidgetSchema, SFSchema, SFUISchema } from '@delon/form';
import { NzModalService } from 'ng-zorro-antd/modal';
import { UsermanageService } from '../../../services/usercenter.service';
@Component({
selector: 'app-Freight-components-user',
templateUrl: './user.component.html',
styleUrls: ['./user.component.less'],
templateUrl: './user.component.html'
})
export class FreightComponentsUserComponent implements OnInit {
_$expand = false;
url = `/rule?_allow_anonymous=true`;
isVisible = false;
isVisibleFreeze = false;
isVisibleOpen = false;
ui!: SFUISchema;
ui2!: SFUISchema;
schema!: SFSchema;
schema2!: SFSchema;
columns!: STColumn[];
suppliersData: any;
datalist = [
{
storeName: '企业名称',
contactsName: '152746565',
enterpriseName: '湖南',
unifiedSocialCreditCode: '45454',
contactsPhone: '*97889461561',
effectiveDateStr: '废弃eww',
enStatusStr2: '正常',
enStatusStr3: '正常',
unifiedSocialCreditCode3: '常用服务',
unifiedSocialCreditCode2: '正常',
tenantId: 1
},
{
storeName: '企业名称',
contactsName: '152746565',
enterpriseName: '湖南',
unifiedSocialCreditCode: '45454',
contactsPhone: '*97889461561',
effectiveDateStr: '废弃eww',
enStatusStr2: '正常',
enStatusStr3: '正常',
unifiedSocialCreditCode3: '常用服务',
unifiedSocialCreditCode2: '正常',
tenantId: 2
},
]
ui: SFUISchema = { '*': { spanLabelFixed: 120, grid: { span: 8, gutter: 4 }, enter: () => this.st.load() } };
schema: SFSchema = this.initSF();
columns: STColumn[] = this.initST();
@ViewChild('st', { static: false }) st!: STComponent;
@ViewChild('sf', { static: false }) sf!: SFComponent;
@ViewChild('sf2', { static: false }) sf2!: SFComponent;
@ViewChild('promoterModal', { static: false })
promoterModal!: any;
promotersTelephone = '';
constructor(public service: UsermanageService, private modal: NzModalService, private router: Router, private ar: ActivatedRoute) {}
/**
* 查询字段个数navigate
*/
get queryFieldCount(): number {
return Object.keys(this.schema?.properties || {}).length;
}
/**
* 查询参数
*/
get reqParams() {
const params: any = {
...(this.sf && this.sf.value),
...(this.sf && this.sf.value)
};
if (this.sf?.value.effectiveDate) {
params.effectiveDateStart = this.sf?.value.effectiveDate[0];
params.effectiveDateEnd = this.sf?.value.effectiveDate[1];
Object.assign(params, {
time: {
start: this.sf?.value.effectiveDate[0],
end: this.sf?.value.effectiveDate[1]
}
});
// params.effectiveDateStart = this.sf?.value.effectiveDate[0];
// params.effectiveDateEnd = this.sf?.value.effectiveDate[1];
}
delete params.effectiveDate;
delete params.expand;
@ -77,120 +46,164 @@ export class FreightComponentsUserComponent implements OnInit {
}
get selectedRows() {
return this.st?.list.filter((item) => item.checked) || [];
return this.st?.list.filter(item => item.checked) || [];
}
ngOnInit() {
this.initSF();
this.initST();
this.initSF2();
this.ar.url.subscribe((params) => {
this.ar.url.subscribe(params => {
this.st?.load(1);
});
}
dataProcess(data: STData[]): STData[] {
return data.map((i, index) => {
i.showSortFlag = false;
return i;
addPromoter(item?: any) {
this.promotersTelephone = item?.promotersTelephone;
const modal = this.modal.create({
nzTitle: '推广业务员',
nzContent: this.promoterModal,
nzOnOk: () => {
if (!!!this.promotersTelephone) {
return false;
}
if (typeof this.promotersTelephone === 'string' && !/(^1\d{10}$)/.test(this.promotersTelephone)) {
return false;
}
this.service.request(this.service.$api_add_salesman, { ids: [item.id], salesmanMobile: this.promotersTelephone }).subscribe(res => {
if (res) {
this.service.msgSrv.success(item?.promotersTelephone ? '添加推广员成功' : '修改推广员成功');
}
this.st.load();
});
return;
}
});
}
initSF() {
this.schema = {
userAction(status: number) {
this.modal.warning({
nzTitle: status === 1 ? '确定启用该用户吗?' : '确定冻结该用户吗?',
nzContent:
status === 1
? '停用后,该用户将被限制使用,不限于访问受限、无法发布货源等,请谨慎操作'
: '启用后,该用户将恢复正常使用功能,请再次确认',
nzOnOk: () => {
// this.service.request(this.service.$api_lock_user)
this.st.reload();
}
});
}
expandToggle() {
this._$expand = !this._$expand;
this.sf?.setValue('/expand', this._$expand);
}
creat() {
this.router.navigate(['./new'], { relativeTo: this.ar });
}
/**
* 重置表单
*/
resetSF() {
this.sf.reset();
this._$expand = false;
}
initSF(): SFSchema {
return {
properties: {
expand: {
type: 'boolean',
ui: {
hidden: true,
},
hidden: true
}
},
name: {
title: '用户姓名',
type: 'string',
ui: {
placeholder: '请输入',
showRequired: false
}
},
storeName: { title: '用户姓名', type: 'string', ui: { showRequired: false } },
contactsName: {
title: '企业名称',
type: 'string',
ui: {
showRequired: false,
},
placeholder: '请输入',
showRequired: false
}
},
phone: {
telephone: {
title: '手机号',
type: 'string',
format: 'mobile',
maxLength: 11,
ui: {
placeholder: '请输入手机号',
},
placeholder: '请输入'
}
},
enStatus: {
stateLocked: {
type: 'string',
title: '货主状态',
title: '状态',
enum: [
{ label: '全部', value: '' },
{ label: '正常', value: 0 },
{ label: '冻结', value: 1 },
{ label: '废弃', value: 2 },
{ label: '冻结', value: 1 }
],
default: '',
ui: {
widget: 'select',
visibleIf: {
expand: (value: boolean) => value,
},
},
expand: (value: boolean) => value
}
}
},
yewuphone: {
title: '业务员手机号',
promotersTelephone: {
title: '推广业务员',
type: 'string',
format: 'mobile',
maxLength: 11,
ui: {
placeholder: '请输入手机号',
visibleIf: {
expand: (value: boolean) => value,
},
},
expand: (value: boolean) => value
}
}
},
},
};
this.ui = { '*': { spanLabelFixed: 180, grid: { span: 8, gutter: 4 }, enter: () => this.st.load() } };
}
initSF2() {
this.schema2 = {
properties: {
phone: {
title: '手机号',
effectiveDate: {
title: '申请时间',
type: 'string',
format: 'mobile',
maxLength: 11,
ui: {
placeholder: '请输入手机号',
},
},
},
widget: 'date',
mode: 'range',
format: 'yyyy-MM-dd',
visibleIf: {
expand: (value: boolean) => value
}
} as SFDateWidgetSchema
}
}
};
this.ui2 = { '*': { spanLabelFixed: 90, grid: { span: 16}, enter: () => this.st.load() } };
}
initST() {
this.columns = [
// { title: '', type: 'checkbox', className: 'text-center' },
{ title: '用户姓名', className: 'text-center', index: 'storeName' },
{ title: '手机号', className: 'text-center', index: 'contactsName' },
{ title: '身份证件号', className: 'text-center', render: 'enterpriseName' },
initST(): STColumn[] {
return [
{ title: '用户姓名', className: 'text-center', index: 'name' },
{ title: '手机号', className: 'text-center', index: 'telephone' },
{ title: '身份证件号', className: 'text-center', render: 'certificateNumber' },
{ title: '常用服务', className: 'text-center', index: 'unifiedSocialCreditCode' },
{ title: '推广业务员', className: 'text-center', index: 'contactsPhone',
render: 'contactsPhone'
},
{ title: '申请时间', className: 'text-center', index: 'unifiedSocialCreditCode2' },
{ title: '推广业务员', className: 'text-center', index: 'promotersTelephone', render: 'promotersTelephone' },
{ title: '申请时间', className: 'text-center', index: 'createTime', type: 'date' },
{
title: '状态',
className: 'text-center',
index: 'enStatusStr2',
index: 'stateLocked',
type: 'badge',
badge: {
: { text: '正常', color: 'success' },
: { text: '冻结', color: 'warning' },
: { text: '废弃', color: 'default' },
},
10: { text: '待审核', color: 'default' },
20: { text: ' 已成功', color: 'success' },
30: { text: '已驳回', color: 'warning' }
}
},
{
title: '操作',
@ -199,54 +212,20 @@ export class FreightComponentsUserComponent implements OnInit {
buttons: [
{
text: '查看',
click: (item) => {
this.router.navigate(['./view', item.tenantId], { relativeTo: this.ar });
},
click: (item: any) => {
this.router.navigate(['./view', item.id], { relativeTo: this.ar });
}
},
{
text: '冻结',
click: (item) => {
this.isVisibleFreeze = true
},
click: (item: any) => this.userAction(0)
},
{
text: '启用',
click: (item) => {
this.isVisibleOpen = true
console.log(item)
},
},
],
},
click: (item: any) => this.userAction(1)
}
]
}
];
}
daoyun(item: any) {
this.isVisible = true
}
expandToggle() {
this._$expand = !this._$expand;
this.sf?.setValue('/expand', this._$expand);
}
creat() {
this.router.navigate(['./new',], { relativeTo: this.ar });
}
/**
* 重置表单
*/
resetSF() {
this.sf.reset();
this._$expand = false;
}
handleOK() {
console.log(this.sf2.value)
}
handleCancel() {
this.isVisible = false
}
handleCancel_open() {
this.isVisibleOpen = false
}
handleCancel_freeze() {
this.isVisibleFreeze = false
}
}

View File

@ -31,6 +31,19 @@ export class UsermanageService extends BaseService {
// 冻结/启用企业业
$api_lock_freight = '/api/mdc/cuc/enterpriseInfo/operate/lock';
// 企业审核
$api_audit_freight = '/api/mdc/cuc/enterpriseInfo/operate/audit';
// 货主员工列表(运营后台)
$api_get_user_list = '/api/mdc/cuc/userApp/getShipperUserList';
// 根据应用用户id获取用户详情
$api_get_user_detail = '/api/mdc/cuc/user/getUserDetailByAppUserId';
// 冻结/启用用户
$api_lock_user = '/api/mdc/cuc/enterpriseInfo/operate/lock';
constructor(public injector: Injector) {
super(injector);
}

View File

@ -0,0 +1,13 @@
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { ImageListComponent } from './imagelist.component';
import { ImageViewComponent } from './imageview/imageview.component';
const COMPONENTS = [ImageListComponent, ImageViewComponent];
@NgModule({
declarations: COMPONENTS,
imports: [CommonModule],
exports: COMPONENTS,
})
export class ImageListModule {}

View File

@ -0,0 +1,3 @@
<div class="imgBox">
<img *ngFor="let item of imgList; let i = index" [src]="item" (click)="showImg(i)" />
</div>

View File

@ -1,18 +1,18 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { CmcComponentsTagsComponent } from './tags.component';
import { ImageListComponent } from './imagelist.component';
describe('CmcComponentsTagsComponent', () => {
let component: CmcComponentsTagsComponent;
let fixture: ComponentFixture<CmcComponentsTagsComponent>;
describe('ImageListComponent', () => {
let component: ImageListComponent;
let fixture: ComponentFixture<ImageListComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [CmcComponentsTagsComponent],
declarations: [ImageListComponent],
}).compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(CmcComponentsTagsComponent);
fixture = TestBed.createComponent(ImageListComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

View File

@ -0,0 +1,23 @@
import { Component, Input, OnInit } from '@angular/core';
import { ModalHelper, _HttpClient } from '@delon/theme';
import { NzMessageService } from 'ng-zorro-antd/message';
import { ImageViewComponent } from './imageview/imageview.component';
@Component({
selector: 'app-imagelist',
templateUrl: './imagelist.component.html',
styleUrls: ['./imagelist.less'],
})
export class ImageListComponent implements OnInit {
@Input() imgList: any = [];
constructor(private modal: ModalHelper, public msgSrv: NzMessageService, public http: _HttpClient) {}
ngOnInit(): void {}
showImg(index: any) {
const params = {
imgList: this.imgList,
index,
};
this.modal.create(ImageViewComponent, { params }).subscribe((res) => {});
}
}

View File

@ -0,0 +1,9 @@
.imgBox {
width: 100%;
overflow: hidden;
img {
width: 100px;
margin: 0 10px;
vertical-align: middle;
}
}

View File

@ -0,0 +1,12 @@
<div class="modal-header">
<div class="modal-title">查看图片</div>
</div>
<div class="imageWrap">
<div class="prev" (click)="prevImg()" *ngIf="params.imgList.length > 1">
<i nz-icon [class.blue]="currentIndex != 0" nzType="vertical-right" nzTheme="outline"></i>
</div>
<div class="imgBox"><img [src]="params.imgList[currentIndex]" /></div>
<div class="next" *ngIf="params.imgList.length > 1" (click)="nextImg()">
<i nz-icon nzType="vertical-left" nzTheme="outline" [class.blue]="currentIndex != params.imgList.length - 1"></i>
</div>
</div>

View File

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

View File

@ -0,0 +1,39 @@
import { Component, OnInit } from '@angular/core';
import { _HttpClient } from '@delon/theme';
import { NzMessageService } from 'ng-zorro-antd/message';
import { NzModalRef } from 'ng-zorro-antd/modal';
@Component({
selector: 'app-imageview',
templateUrl: './imageview.component.html',
styleUrls: ['./imageview.less'],
})
export class ImageViewComponent implements OnInit {
params: any = {};
currentIndex = 0;
constructor(private modal: NzModalRef, public msgSrv: NzMessageService, public http: _HttpClient) {}
ngOnInit(): void {
this.currentIndex = this.params.index;
}
close() {
this.modal.destroy();
}
prevImg() {
if (this.currentIndex === 0) {
this.msgSrv.error('已经是第一张图片!');
return false;
}
this.currentIndex--;
return true;
}
nextImg() {
if (this.currentIndex === this.params.imgList.length - 1) {
this.msgSrv.error('已经是最后一张图片!');
return false;
}
this.currentIndex++;
return true;
}
}

View File

@ -0,0 +1,39 @@
.imageWrap {
position: relative;
width: 95%;
margin: 0 auto;
}
.imgBox {
max-width: 500px;
height: 100%;
max-height: 800px;
margin: 0 auto;
overflow: hidden;
img {
width: 100%;
vertical-align: middle;
}
}
.prev,
.next {
position: absolute;
top: 50%;
width: 50px;
height: 50px;
color: #bbb;
font-size: 30px;
line-height: 50px;
text-align: center;
background: #e2e2e2;
border-radius: 100px;
transform: translateY(-50%);
}
.next {
right: 0;
}
.prev {
left: 0;
}
.blue {
color: #2593e8 !important;
}

View File

@ -0,0 +1,3 @@
export * from './imagelist.component';
export * from './imageview/imageview.component';
export * from './image-list.module';

View File

@ -39,6 +39,7 @@ import { NzCheckboxModule } from 'ng-zorro-antd/checkbox';
import { NzEmptyModule } from 'ng-zorro-antd/empty';
import { NzStatisticModule } from 'ng-zorro-antd/statistic';
import { NzTimelineModule } from 'ng-zorro-antd/timeline';
import { NzSkeletonModule } from 'ng-zorro-antd/skeleton';
export const SHARED_ZORRO_MODULES = [
NzButtonModule,
NzGridModule,
@ -71,5 +72,6 @@ export const SHARED_ZORRO_MODULES = [
NzPopoverModule,
NzEmptyModule,
NzStatisticModule,
NzTimelineModule
NzTimelineModule,
NzSkeletonModule
];

View File

@ -28,6 +28,7 @@ import { StatusLabelModule } from './components/status-label';
import { SharedThirdModule } from './shared-third.module';
import { LogisticsTimeLineComponent } from './components/logistics-time-line/logistics-time-line.component';
import { AmapModule } from './components/amap/amap.module';
import { ImageListModule } from './components/imagelist';
const MODULES = [
AddressModule,
@ -40,6 +41,7 @@ const MODULES = [
StatusLabelModule,
SharedThirdModule,
AmapModule,
ImageListModule,
...PRO_SHARED_MODULES
];
// #endregion

View File

@ -66,7 +66,7 @@
"link": "/usercenter/freight/enterprise/view/:id"
},
{
"text": "用户列表",
"text": "货主员工列表",
"icon": "anticon anticon-dashboard",
"link": "/usercenter/freight/user"
}