货主管理

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,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);
}
}