This commit is contained in:
Taric Xin
2022-03-02 14:30:37 +08:00
parent 62e15f69ea
commit ab6f1c6865
13 changed files with 232 additions and 243 deletions

View File

@ -11,34 +11,17 @@
<img [src]="userDetail?.avatar" /> <img [src]="userDetail?.avatar" />
<div style="flex: 1"> <div style="flex: 1">
<div style="display: flex; width: 100%; justify-content: space-between"> <div style="display: flex; width: 100%; justify-content: space-between">
<p style="padding-right: 80px; width: 400px" <p style="padding-right: 80px; width: 400px">{{ userDetail?.name }}
>{{ userDetail?.name }}
<nz-badge nzStatus="success" nzText="正常" *ngIf="!userDetail?.stateLocked" class="ml-xl"> </nz-badge> <nz-badge nzStatus="success" nzText="正常" *ngIf="!userDetail?.stateLocked" class="ml-xl"> </nz-badge>
<nz-badge nzStatus="warning" nzText="冻结" *ngIf="userDetail?.stateLocked" class="ml-xl"> </nz-badge> <nz-badge nzStatus="warning" nzText="冻结" *ngIf="userDetail?.stateLocked" class="ml-xl"> </nz-badge>
</p> </p>
<div style="margin-right: 24px"> <div style="margin-right: 24px">
<button <button *ngIf="userDetail?.stateLocked" [nzLoading]="service.http.loading" nz-button nzType="primary"
*ngIf="userDetail?.stateLocked" nzGhost (click)="userAction(1)" acl [acl-ability]="['USERCENTER-DRIVER-CAPTAIN-DETAIL-lock']">
[nzLoading]="service.http.loading"
nz-button
nzType="primary"
nzGhost
(click)="userAction(1)"
acl
[acl-ability]="['USERCENTER-DRIVER-CAPTAIN-DETAIL-lock']"
>
启用 启用
</button> </button>
<button <button *ngIf="!userDetail?.stateLocked" [nzLoading]="service.http.loading" nz-button nzDanger nzGhost
*ngIf="!userDetail?.stateLocked" (click)="userAction(0)" acl [acl-ability]="['USERCENTER-DRIVER-CAPTAIN-DETAIL-lock']">
[nzLoading]="service.http.loading"
nz-button
nzDanger
nzGhost
(click)="userAction(0)"
acl
[acl-ability]="['USERCENTER-DRIVER-CAPTAIN-DETAIL-lock']"
>
冻结 冻结
</button> </button>
</div> </div>
@ -56,13 +39,12 @@
<nz-card [nzLoading]="service.http.loading"> <nz-card [nzLoading]="service.http.loading">
<div [class]="isEditUser ? 'edit-box' : 'readOnly-box'"> <div [class]="isEditUser ? 'edit-box' : 'readOnly-box'">
<sv-container col="2"> <sv-container col="2">
<sv-title <sv-title>个人信息
>个人信息 <label *ngIf="userIdentityDetail?.certificationStatus === 1" style="color: #52c41a" class="ml-md"><i nz-icon
<label *ngIf="userIdentityDetail?.certificationStatus === 1" style="color: #52c41a" class="ml-md" nzType="check-circle" nzTheme="fill" class="mr-xs"></i>审核通过
><i nz-icon nzType="check-circle" nzTheme="fill" class="mr-xs"></i>审核通过
</label> </label>
<label *ngIf="userIdentityDetail?.certificationStatus === 2" style="color: #ff4d4f" class="ml-md" <label *ngIf="userIdentityDetail?.certificationStatus === 2" style="color: #ff4d4f" class="ml-md"><i nz-icon
><i nz-icon nzType="close-circle" nzTheme="fill" class="mr-xs"></i>驳回 nzType="close-circle" nzTheme="fill" class="mr-xs"></i>驳回
</label> </label>
<div style="float: right"> <div style="float: right">
<ng-container *ngIf="isEditUser; else elseTemplate"> <ng-container *ngIf="isEditUser; else elseTemplate">
@ -70,40 +52,28 @@
<button [nzLoading]="service.http.loading" nz-button nzDanger (click)="saveUser()"> 保存 </button> <button [nzLoading]="service.http.loading" nz-button nzDanger (click)="saveUser()"> 保存 </button>
</ng-container> </ng-container>
<ng-template #elseTemplate> <ng-template #elseTemplate>
<button nz-button nzType="default" nzDanger (click)="approveUser()" *ngIf="userIdentityDetail?.certificationStatus === 0" <button nz-button nzType="default" nzDanger (click)="approveUser()"
acl [acl-ability]="['USERCENTER-DRIVER-CAPTAIN-DETAIL-audit']">审核通过</button *ngIf="userIdentityDetail?.certificationStatus === 0" acl
> [acl-ability]="['USERCENTER-DRIVER-CAPTAIN-DETAIL-audit']">审核通过</button>
<button nz-button nzType="default" nzDanger (click)="rejectedUser()" *ngIf="userIdentityDetail?.certificationStatus === 0" <button nz-button nzType="default" nzDanger (click)="rejectedUser()"
acl [acl-ability]="['USERCENTER-DRIVER-CAPTAIN-DETAIL-audit']" >驳回审核</button *ngIf="userIdentityDetail?.certificationStatus === 0" acl
> [acl-ability]="['USERCENTER-DRIVER-CAPTAIN-DETAIL-audit']">驳回审核</button>
<button nz-button nzType="default" nzDanger (click)="ratify()" acl [acl-ability]="['USERCENTER-DRIVER-CAPTAIN-DETAIL-edit']">修改</button> <button nz-button nzType="default" nzDanger (click)="ratify()" acl
[acl-ability]="['USERCENTER-DRIVER-CAPTAIN-DETAIL-edit']">修改</button>
</ng-template> </ng-template>
</div> </div>
</sv-title> </sv-title>
<sv label="姓名"> <sv label="姓名">
<input <input nz-input type="text" [(ngModel)]="userIdentityDetail.name" [readonly]="!isEditUser"
nz-input [nzBorderless]="!isEditUser" [placeholder]="isEditUser ? '' : '-'" />
type="text"
[(ngModel)]="userIdentityDetail.name"
[readonly]="!isEditUser"
[nzBorderless]="!isEditUser"
[placeholder]="isEditUser ? '' : '-'"
/>
</sv> </sv>
<sv label="身份证号"> <sv label="身份证号">
<input <input nz-input type="text" [(ngModel)]="userIdentityDetail.certificateNumber" [readonly]="!isEditUser"
nz-input [nzBorderless]="!isEditUser" [placeholder]="isEditUser ? '' : '-'" />
type="text"
[(ngModel)]="userIdentityDetail.certificateNumber"
[readonly]="!isEditUser"
[nzBorderless]="!isEditUser"
[placeholder]="isEditUser ? '' : '-'"
/>
</sv> </sv>
<sv label="身份证照" col="1"> <sv label="身份证照" col="1">
<div class="d-flex"> <div class="d-flex">
<ng-container <ng-container *ngTemplateOutlet="
*ngTemplateOutlet="
uploadTemplate; uploadTemplate;
context: { context: {
data: userIdentityDetail, data: userIdentityDetail,
@ -112,11 +82,9 @@
key2: 'certificatePhotoFront', key2: 'certificatePhotoFront',
hover: 'certificateBackFront' hover: 'certificateBackFront'
} }
" ">
>
</ng-container> </ng-container>
<ng-container <ng-container *ngTemplateOutlet="
*ngTemplateOutlet="
uploadTemplate; uploadTemplate;
context: { context: {
data: userIdentityDetail, data: userIdentityDetail,
@ -125,8 +93,7 @@
key2: 'certificatePhotoBack', key2: 'certificatePhotoBack',
hover: 'certificateBack' hover: 'certificateBack'
} }
" ">
>
</ng-container> </ng-container>
</div> </div>
</sv> </sv>
@ -158,28 +125,16 @@
</ng-template> </ng-template>
<ng-template #uploadTemplate let-data="data" let-status="status" let-key="key" let-key2="key2" let-hover="hover"> <ng-template #uploadTemplate let-data="data" let-status="status" let-key="key" let-key2="key2" let-hover="hover">
<nz-upload <nz-upload class="avatar-uploader" [nzAction]="uploadURl" nzName="multipartFile" nzListType="picture-card"
class="avatar-uploader" [nzShowUploadList]="false" nzFileType="image/png,image/jpeg,image/jpg,image/gif"
[nzAction]="uploadURl" [nzDisabled]="!status || disabledUpload" (nzChange)="changeUpload($event, data, key, key2)">
nzName="multipartFile"
nzListType="picture-card"
[nzShowUploadList]="false"
nzFileType="image/png,image/jpeg,image/jpg,image/gif"
[nzDisabled]="!status || disabledUpload"
(nzChange)="changeUpload($event, data, key, key2)"
>
<ng-container *ngIf="!data[key] && status"> <ng-container *ngIf="!data[key] && status">
<i class="upload-icon" nz-icon [nzType]="service.http.loading ? 'loading' : 'plus'"></i> <i class="upload-icon" nz-icon [nzType]="service.http.loading ? 'loading' : 'plus'"></i>
<div class="ant-upload-text">上传</div> <div class="ant-upload-text">上传</div>
</ng-container> </ng-container>
<div <div *ngIf="data[key]" (mouseover)="data[hover] = true" (mouseleave)="data[hover] = false"
*ngIf="data[key]" (click)="$event.cancelBubble = true" class="image-hover">
(mouseover)="data[hover] = true" <img nz-image [nzSrc]="data[key]" style="width: 200px; height: 160px" />
(mouseleave)="data[hover] = false"
(click)="$event.cancelBubble = true"
class="image-hover"
>
<img [src]="data[key]" style="width: 200px; height: 160px" (click)="showImg(data[key])" />
<div class="mask" *ngIf="data[hover] && status"></div> <div class="mask" *ngIf="data[hover] && status"></div>
<div class="mask-over" *ngIf="data[hover] && status"> <div class="mask-over" *ngIf="data[hover] && status">
<i nz-icon nzType="close-circle" nzTheme="fill" class="delete-icon" (click)="deleteImg(data, key, key2)"></i> <i nz-icon nzType="close-circle" nzTheme="fill" class="delete-icon" (click)="deleteImg(data, key, key2)"></i>
@ -189,4 +144,4 @@
</div> </div>
</div> </div>
</nz-upload> </nz-upload>
</ng-template> </ng-template>

View File

@ -2,6 +2,7 @@ import { DatePipe } from '@angular/common';
import { Component, OnInit, ViewChild } from '@angular/core'; import { Component, OnInit, ViewChild } from '@angular/core';
import { ActivatedRoute } from '@angular/router'; import { ActivatedRoute } from '@angular/router';
import { apiConf } from '@conf/api.conf'; import { apiConf } from '@conf/api.conf';
import { NzImageService } from 'ng-zorro-antd/image';
import { NzModalService } from 'ng-zorro-antd/modal'; import { NzModalService } from 'ng-zorro-antd/modal';
import { UsermanageService } from 'src/app/routes/usercenter/services/usercenter.service'; import { UsermanageService } from 'src/app/routes/usercenter/services/usercenter.service';
import { ImageViewComponent } from 'src/app/shared/components/imagelist'; import { ImageViewComponent } from 'src/app/shared/components/imagelist';
@ -31,7 +32,8 @@ export class CaptainDetailComponent implements OnInit {
private nzModalService: NzModalService, private nzModalService: NzModalService,
public service: UsermanageService, public service: UsermanageService,
private route: ActivatedRoute, private route: ActivatedRoute,
private datePipe: DatePipe private datePipe: DatePipe,
private nzImageService: NzImageService
) {} ) {}
ngOnInit() { ngOnInit() {
@ -192,7 +194,8 @@ export class CaptainDetailComponent implements OnInit {
imgList: [url], imgList: [url],
index: 0 index: 0
}; };
this.nzModalService.create({ nzContent: ImageViewComponent, nzComponentParams: { params } }); this.nzImageService.preview([{ src: url }]);
// this.nzModalService.create({ nzContent: ImageViewComponent, nzComponentParams: { params } });
} }
deleteImg(data: any, key: string, key2: string) { deleteImg(data: any, key: string, key2: string) {

View File

@ -318,7 +318,7 @@
</ng-container> </ng-container>
<div *ngIf="data[key]" (mouseover)="data[hover]=true" (mouseleave)="data[hover]=false" <div *ngIf="data[key]" (mouseover)="data[hover]=true" (mouseleave)="data[hover]=false"
(click)="$event.cancelBubble=true" class="image-hover"> (click)="$event.cancelBubble=true" class="image-hover">
<img [src]="data[key]" style="width: 200px;height: 160px;" (click)="showImg(data[key])" /> <img nz-image [nzSrc]="data[key]" style="width: 200px;height: 160px;" />
<div class="mask" *ngIf="data[hover] && status"></div> <div class="mask" *ngIf="data[hover] && status"></div>
<div class="mask-over" *ngIf="data[hover] && status"> <div class="mask-over" *ngIf="data[hover] && status">
<i nz-icon nzType="close-circle" nzTheme="fill" class="delete-icon" (click)="deleteImg(data,key,key2)"></i> <i nz-icon nzType="close-circle" nzTheme="fill" class="delete-icon" (click)="deleteImg(data,key,key2)"></i>

View File

@ -5,6 +5,7 @@ import { apiConf } from '@conf/api.conf';
import { STColumn, STComponent } from '@delon/abc/st'; import { STColumn, STComponent } from '@delon/abc/st';
import { SFComponent, SFDateWidgetSchema, SFSchema, SFTagWidgetSchema, SFTextWidgetSchema, SFUISchema } from '@delon/form'; import { SFComponent, SFDateWidgetSchema, SFSchema, SFTagWidgetSchema, SFTextWidgetSchema, SFUISchema } from '@delon/form';
import { ModalHelper, _HttpClient } from '@delon/theme'; import { ModalHelper, _HttpClient } from '@delon/theme';
import { NzImageService } from 'ng-zorro-antd/image';
import { NzMessageService } from 'ng-zorro-antd/message'; import { NzMessageService } from 'ng-zorro-antd/message';
import { NzModalService } from 'ng-zorro-antd/modal'; import { NzModalService } from 'ng-zorro-antd/modal';
import { ImageViewComponent } from 'src/app/shared/components/imagelist'; import { ImageViewComponent } from 'src/app/shared/components/imagelist';
@ -65,7 +66,8 @@ export class UserCenterComponentsDriverDetailComponent implements OnInit {
private nzModalService: NzModalService, private nzModalService: NzModalService,
public service: UsermanageService, public service: UsermanageService,
public route: ActivatedRoute, public route: ActivatedRoute,
private datePipe: DatePipe private datePipe: DatePipe,
private nzImageService: NzImageService
) {} ) {}
ngOnInit() { ngOnInit() {
@ -423,11 +425,7 @@ export class UserCenterComponentsDriverDetailComponent implements OnInit {
} }
showImg(url: any) { showImg(url: any) {
const params = { this.nzImageService.preview([{ src: url }]);
imgList: [url],
index: 0
};
this.nzModalService.create({ nzContent: ImageViewComponent, nzComponentParams: { params } });
} }
deleteImg(data: any, key: string, key2: string) { deleteImg(data: any, key: string, key2: string) {

View File

@ -19,6 +19,7 @@ import { NzModalService } from 'ng-zorro-antd/modal';
import { apiConf } from '@conf/api.conf'; import { apiConf } from '@conf/api.conf';
import { ImageViewComponent } from 'src/app/shared/components/imagelist'; import { ImageViewComponent } from 'src/app/shared/components/imagelist';
import { NzCascaderOption } from 'ng-zorro-antd/cascader'; import { NzCascaderOption } from 'ng-zorro-antd/cascader';
import { NzImageService } from 'ng-zorro-antd/image';
@Component({ @Component({
selector: 'app-Freight-components-EnterpriseAudit-view', selector: 'app-Freight-components-EnterpriseAudit-view',
templateUrl: './view.component.html', templateUrl: './view.component.html',
@ -49,7 +50,12 @@ export class FreightComponentsEnterpriseAuditViewComponent implements OnInit {
values: string[] | null = null; values: string[] | null = null;
ltdId: any[] = []; ltdId: any[] = [];
constructor(private nzModalService: NzModalService, public service: UsermanageService, private route: ActivatedRoute) {} constructor(
private nzModalService: NzModalService,
public service: UsermanageService,
private route: ActivatedRoute,
private nzImageService: NzImageService
) {}
ngOnInit() { ngOnInit() {
this.initData(); this.initData();
@ -127,7 +133,8 @@ export class FreightComponentsEnterpriseAuditViewComponent implements OnInit {
imgList: [url], imgList: [url],
index: 0 index: 0
}; };
this.nzModalService.create({ nzContent: ImageViewComponent, nzComponentParams: { params } }); this.nzImageService.preview([{ src: url }]);
// this.nzModalService.create({ nzContent: ImageViewComponent, nzComponentParams: { params } });
} }
deleteImg(key: string) { deleteImg(key: string) {

View File

@ -4,6 +4,7 @@ import { apiConf } from '@conf/api.conf';
import { STColumn, STComponent } from '@delon/abc/st'; import { STColumn, STComponent } from '@delon/abc/st';
import { SFComponent, SFDateWidgetSchema, SFSchema, SFUISchema } from '@delon/form'; import { SFComponent, SFDateWidgetSchema, SFSchema, SFUISchema } from '@delon/form';
import { ModalHelper, _HttpClient } from '@delon/theme'; import { ModalHelper, _HttpClient } from '@delon/theme';
import { NzImageService } from 'ng-zorro-antd/image';
import { NzMessageService } from 'ng-zorro-antd/message'; import { NzMessageService } from 'ng-zorro-antd/message';
import { NzModalService } from 'ng-zorro-antd/modal'; import { NzModalService } from 'ng-zorro-antd/modal';
import { ImageViewComponent } from 'src/app/shared/components/imagelist'; import { ImageViewComponent } from 'src/app/shared/components/imagelist';
@ -34,7 +35,12 @@ export class FreightComponentsUserDetailComponent implements OnInit {
isEditUser = false; isEditUser = false;
uploadURl = apiConf.waterFileUpload; uploadURl = apiConf.waterFileUpload;
disabledUpload = false; disabledUpload = false;
constructor(private nzModalService: NzModalService, public service: UsermanageService, public route: ActivatedRoute) {} constructor(
private nzModalService: NzModalService,
public service: UsermanageService,
public route: ActivatedRoute,
private nzImageService: NzImageService
) {}
ngOnInit() { ngOnInit() {
this.initData(); this.initData();
@ -170,7 +176,8 @@ export class FreightComponentsUserDetailComponent implements OnInit {
imgList: [url], imgList: [url],
index: 0 index: 0
}; };
this.nzModalService.create({ nzContent: ImageViewComponent, nzComponentParams: { params } }); this.nzImageService.preview([{ src: url }]);
// this.nzModalService.create({ nzContent: ImageViewComponent, nzComponentParams: { params } });
} }
deleteImg(data: any, key: string, key2: string) { deleteImg(data: any, key: string, key2: string) {

View File

@ -10,6 +10,7 @@ import { Injectable, Injector } from '@angular/core';
import { cacheConf } from '@conf/cache.conf'; import { cacheConf } from '@conf/cache.conf';
import { _HttpClient } from '@delon/theme'; import { _HttpClient } from '@delon/theme';
import { EACacheService, ShipperBaseService } from '@shared'; import { EACacheService, ShipperBaseService } from '@shared';
import { NzImageService } from 'ng-zorro-antd/image';
import { NzModalService } from 'ng-zorro-antd/modal'; import { NzModalService } from 'ng-zorro-antd/modal';
import { ImageViewComponent } from 'src/app/shared/components/imagelist'; import { ImageViewComponent } from 'src/app/shared/components/imagelist';
@Injectable({ @Injectable({
@ -144,7 +145,12 @@ export class UsermanageService extends ShipperBaseService {
// 查询司机配置列表 // 查询司机配置列表
$api_configPage = '/api/mdc/cuc/driver/list/configPage'; $api_configPage = '/api/mdc/cuc/driver/list/configPage';
constructor(public injector: Injector, private nzModalService: NzModalService, public eaCacheSrv: EACacheService) { constructor(
public injector: Injector,
private nzModalService: NzModalService,
public eaCacheSrv: EACacheService,
private nzImageService: NzImageService
) {
super(injector, eaCacheSrv); super(injector, eaCacheSrv);
} }
@ -153,6 +159,7 @@ export class UsermanageService extends ShipperBaseService {
imgList: [url], imgList: [url],
index: 0 index: 0
}; };
this.nzModalService.create({ nzContent: ImageViewComponent, nzComponentParams: { params } }); this.nzImageService.preview([{ src: url }]);
// this.nzModalService.create({ nzContent: ImageViewComponent, nzComponentParams: { params } });
} }
} }

View File

@ -14,6 +14,7 @@ import { VehicleService } from '../../../services/vehicle.service';
import { EADateUtil } from '@shared'; import { EADateUtil } from '@shared';
import { VehicleImgViewComponent } from '../../list/img-view/img-view.component'; import { VehicleImgViewComponent } from '../../list/img-view/img-view.component';
import { VehicleComponentsListEditComponent } from '../../list/edit/edit.component'; import { VehicleComponentsListEditComponent } from '../../list/edit/edit.component';
import { NzImageService } from 'ng-zorro-antd/image';
@Component({ @Component({
selector: 'app-Vehicle-components-Audit-detail', selector: 'app-Vehicle-components-Audit-detail',
@ -25,7 +26,7 @@ export class VehicleComponentsAuditDetailComponent implements OnInit {
@ViewChild('redectModal', { static: false }) redectModal!: any; @ViewChild('redectModal', { static: false }) redectModal!: any;
columns!: STColumn[]; columns!: STColumn[];
detailData: any = this.initData(); detailData: any = this.initData();
tempalateData :any; tempalateData: any;
contenCarNoColor: any; contenCarNoColor: any;
contencarModel: any; contencarModel: any;
contenCarLength: any; contenCarLength: any;
@ -33,21 +34,26 @@ export class VehicleComponentsAuditDetailComponent implements OnInit {
approvalOpinion = ''; approvalOpinion = '';
uploadURl = apiConf.waterFileUpload; uploadURl = apiConf.waterFileUpload;
disabledUpload = false; disabledUpload = false;
constructor(public service: VehicleService, private route: ActivatedRoute, private nzModalService: NzModalService, private modal: ModalHelper,) {} constructor(
public service: VehicleService,
private route: ActivatedRoute,
private nzModalService: NzModalService,
private modal: ModalHelper,
private nzImageService: NzImageService
) {}
ngOnInit() { ngOnInit() {
this.getSelectList(); this.getSelectList();
console.log(this.route.snapshot.params)
this.getDetailList(); this.getDetailList();
this.initST(); this.initST();
} }
initST() { initST() {
this.columns = [ this.columns = [
{ title: '司机姓名', index: 'name', className: 'text-center' }, { title: '司机姓名', index: 'name', className: 'text-center' },
{ title: '司机手机号', index: 'mobile', className: 'text-center' }, { title: '司机手机号', index: 'mobile', className: 'text-center' },
{ title: '身份证号', index: 'idCardNo', className: 'text-center' }, { title: '身份证号', index: 'idCardNo', className: 'text-center' },
{ title: '挂靠协议', render: 'auditStatusEnum', className: 'text-center' }, { title: '挂靠协议', render: 'auditStatusEnum', className: 'text-center' },
{ {
title: '车主申明/挂靠协议', title: '车主申明/挂靠协议',
fixed: 'right', fixed: 'right',
@ -56,21 +62,20 @@ export class VehicleComponentsAuditDetailComponent implements OnInit {
buttons: [ buttons: [
{ {
text: '查看协议', text: '查看协议',
click: (_record) => this.viewEvaluate(_record), click: _record => this.viewEvaluate(_record),
iif: item => item.auditStatusEnum == 10 || item.auditStatusEnum == 20, iif: item => item.auditStatusEnum == 10 || item.auditStatusEnum == 20
}, },
{ {
text: '上传协议', text: '上传协议',
click: (_record) => this.updateEvaluate(_record), click: _record => this.updateEvaluate(_record),
iif: item => item.auditStatusEnum == -1, iif: item => item.auditStatusEnum == -1
}, }
] ]
} }
]; ];
} }
getDetailList() { getDetailList() {
console.log(this.route.snapshot.queryParams.carId);
const params = { const params = {
id: this.route.snapshot?.params?.id id: this.route.snapshot?.params?.id
}; };
@ -88,7 +93,7 @@ export class VehicleComponentsAuditDetailComponent implements OnInit {
this.adjuctUser( this.adjuctUser(
{ {
approvalStatus: 20, approvalStatus: 20,
id: this.route.snapshot?.params?.id, id: this.route.snapshot?.params?.id
}, },
'审核成功' '审核成功'
); );
@ -125,23 +130,21 @@ export class VehicleComponentsAuditDetailComponent implements OnInit {
save() { save() {
this.isEdit = false; this.isEdit = false;
this.detailData.driverLicenseRegisterTime = EADateUtil.yearToDate(this.detailData?.driverLicenseRegisterTime) this.detailData.driverLicenseRegisterTime = EADateUtil.yearToDate(this.detailData?.driverLicenseRegisterTime);
this.detailData.driverLicenseEndTime = EADateUtil.yearToDate(this.detailData?.driverLicenseEndTime) this.detailData.driverLicenseEndTime = EADateUtil.yearToDate(this.detailData?.driverLicenseEndTime);
this.detailData.driverLicenseGetTime = EADateUtil.yearToDate(this.detailData?.driverLicenseGetTime) this.detailData.driverLicenseGetTime = EADateUtil.yearToDate(this.detailData?.driverLicenseGetTime);
this.detailData.roadTransportStartTime = EADateUtil.yearToDate(this.detailData?.roadTransportStartTime) this.detailData.roadTransportStartTime = EADateUtil.yearToDate(this.detailData?.roadTransportStartTime);
this.detailData.roadTransportEndTime = EADateUtil.yearToDate(this.detailData?.roadTransportEndTime) this.detailData.roadTransportEndTime = EADateUtil.yearToDate(this.detailData?.roadTransportEndTime);
console.log(this.detailData) this.service.request(this.service.$api_get_update_audit, this.detailData).subscribe(res => {
this.service.request(this.service.$api_get_update_audit, this.detailData).subscribe((res)=>{ if (res) {
console.log(res) this.getDetailList();
if(res) { this.service.msgSrv.success('修改成功!');
this.getDetailList()
this.service.msgSrv.success('修改成功!')
} }
}) });
} }
ratify() { ratify() {
@ -149,7 +152,6 @@ export class VehicleComponentsAuditDetailComponent implements OnInit {
} }
changeUpload({ file, fileList, type }: any, key: string) { changeUpload({ file, fileList, type }: any, key: string) {
console.log({ file, fileList, type });
if (type === 'success') { if (type === 'success') {
this.detailData[key] = file.response.data.fullFileWatermarkPath; this.detailData[key] = file.response.data.fullFileWatermarkPath;
} }
@ -158,18 +160,19 @@ export class VehicleComponentsAuditDetailComponent implements OnInit {
goBack() { goBack() {
window.history.go(-1); window.history.go(-1);
} }
/** /**
* 查询参数 * 查询参数
*/ */
get reqParams() { get reqParams() {
return { id: this.route.snapshot.queryParams.carId }; return { id: this.route.snapshot.queryParams.carId };
} }
showImg(url: any) { showImg(url: any) {
const params = { const params = {
imgList: [url], imgList: [url],
index: 0 index: 0
}; };
this.nzModalService.create({ nzContent: ImageViewComponent, nzComponentParams: { params } }); this.nzImageService.preview([{ src: url }]);
// this.nzModalService.create({ nzContent: ImageViewComponent, nzComponentParams: { params } });
} }
deleteImg(key: string) { deleteImg(key: string) {
@ -218,38 +221,39 @@ export class VehicleComponentsAuditDetailComponent implements OnInit {
carFrontPhotoWatermark: '' carFrontPhotoWatermark: ''
}; };
} }
// 获取录单员 // 获取录单员
getSelectList() { getSelectList() {
this.Serveice("car:color") this.Serveice('car:color');
this.Serveice("car:model") this.Serveice('car:model');
this.Serveice("car:length") this.Serveice('car:length');
} }
Serveice(param :any) { Serveice(param: any) {
let value: any; let value: any;
this.service.request(`${this.service.$api_get_getDictValue}`, this.service
{ .request(`${this.service.$api_get_getDictValue}`, {
dictKey: param dictKey: param
}).subscribe((res) => { })
if(param === 'car:color') { .subscribe(res => {
if (param === 'car:color') {
this.contenCarNoColor = res; this.contenCarNoColor = res;
} else if(param === 'car:model') { } else if (param === 'car:model') {
this.contencarModel = res; this.contencarModel = res;
} else if(param === 'car:length') { } else if (param === 'car:length') {
this.contenCarLength = res; this.contenCarLength = res;
} }
})
return value;
}
viewEvaluate(item: any) {
this.modal.createStatic(VehicleImgViewComponent, { i: item } ).subscribe((i) => {
this.st.reload();
this.getDetailList()
}); });
} return value;
updateEvaluate(item: any) { }
this.modal.createStatic(VehicleComponentsListEditComponent, { i: item }).subscribe((i) => { viewEvaluate(item: any) {
this.st.reload(); this.modal.createStatic(VehicleImgViewComponent, { i: item }).subscribe(i => {
this.getDetailList() this.st.reload();
}); this.getDetailList();
} });
}
updateEvaluate(item: any) {
this.modal.createStatic(VehicleComponentsListEditComponent, { i: item }).subscribe(i => {
this.st.reload();
this.getDetailList();
});
}
} }

View File

@ -11,11 +11,12 @@ import { apiConf } from '@conf/api.conf';
import { NzModalService } from 'ng-zorro-antd/modal'; import { NzModalService } from 'ng-zorro-antd/modal';
import { ImageViewComponent } from 'src/app/shared/components/imagelist'; import { ImageViewComponent } from 'src/app/shared/components/imagelist';
import { EADateUtil } from '@shared'; import { EADateUtil } from '@shared';
import { NzImageService } from 'ng-zorro-antd/image';
@Component({ @Component({
selector: 'app-supplier-components-list-view', selector: 'app-supplier-components-list-view',
templateUrl: './detail.component.html', templateUrl: './detail.component.html',
styleUrls: ['./detail.component.less'], styleUrls: ['./detail.component.less']
}) })
export class VehicleComponentsListDetailComponent implements OnInit { export class VehicleComponentsListDetailComponent implements OnInit {
i: any; i: any;
@ -36,7 +37,7 @@ export class VehicleComponentsListDetailComponent implements OnInit {
suppliersData: any = {}; suppliersData: any = {};
disabledUpload = false; disabledUpload = false;
detailData: any = this.initData(); detailData: any = this.initData();
tempalateData :any; tempalateData: any;
contenCarNoColor: any; contenCarNoColor: any;
contencarModel: any; contencarModel: any;
contenCarLength: any; contenCarLength: any;
@ -49,6 +50,7 @@ export class VehicleComponentsListDetailComponent implements OnInit {
private modalHelper: ModalHelper, private modalHelper: ModalHelper,
private msgSrv: NzMessageService, private msgSrv: NzMessageService,
private nzModalService: NzModalService, private nzModalService: NzModalService,
private nzImageService: NzImageService
) {} ) {}
ngOnInit() { ngOnInit() {
@ -57,14 +59,13 @@ export class VehicleComponentsListDetailComponent implements OnInit {
this.initSF(); this.initSF();
this.initSF1(); this.initSF1();
this.initST(); this.initST();
} }
/** /**
* 查询参数 * 查询参数
*/ */
get reqParams() { get reqParams() {
return { id: this.route.snapshot?.params?.id }; return { id: this.route.snapshot?.params?.id };
} }
/** /**
* 初始化查询表单 * 初始化查询表单
*/ */
@ -77,17 +78,17 @@ export class VehicleComponentsListDetailComponent implements OnInit {
type: 'string', type: 'string',
ui: { ui: {
widget: 'date', widget: 'date',
format: 'yyyy-MM-dd 00:00:00', format: 'yyyy-MM-dd 00:00:00'
// hidden: this.modalName === 'effectiveDate' ? false : true, // hidden: this.modalName === 'effectiveDate' ? false : true,
} as SFDateWidgetSchema, } as SFDateWidgetSchema
}, }
}, },
required: ['effectiveDate'], required: ['effectiveDate']
}; };
this.ui = { '*': { spanLabelFixed: 120, grid: { span: 24 } } }; this.ui = { '*': { spanLabelFixed: 120, grid: { span: 24 } } };
} }
initST() { initST() {
this.columns =[ this.columns = [
{ title: '司机姓名', index: 'name', width: 300, className: 'text-center' }, { title: '司机姓名', index: 'name', width: 300, className: 'text-center' },
{ title: '司机手机号', index: 'mobile', width: 300, className: 'text-center' }, { title: '司机手机号', index: 'mobile', width: 300, className: 'text-center' },
{ title: '挂靠协议', render: 'auditStatusEnum', className: 'text-center' }, { title: '挂靠协议', render: 'auditStatusEnum', className: 'text-center' },
@ -100,17 +101,17 @@ export class VehicleComponentsListDetailComponent implements OnInit {
buttons: [ buttons: [
{ {
text: '查看协议', text: '查看协议',
click: (_record) => this.viewEvaluate(_record), click: _record => this.viewEvaluate(_record),
iif: item => item.auditStatusEnum == 10 || item.auditStatusEnum == 20, iif: item => item.auditStatusEnum == 10 || item.auditStatusEnum == 20
}, },
{ {
text: '上传协议', text: '上传协议',
click: (_record) => this.updateEvaluate(_record), click: _record => this.updateEvaluate(_record),
iif: item => item.auditStatusEnum == -1, iif: item => item.auditStatusEnum == -1
}, }
], ]
}, }
] ];
} }
initSF1() { initSF1() {
this.schema1 = { this.schema1 = {
@ -121,7 +122,7 @@ export class VehicleComponentsListDetailComponent implements OnInit {
title: '类型', title: '类型',
enum: [ enum: [
{ label: '非外部供应商', value: 0 }, { label: '非外部供应商', value: 0 },
{ label: '外部供应商', value: 1 }, { label: '外部供应商', value: 1 }
], ],
default: '', default: '',
ui: { ui: {
@ -136,85 +137,81 @@ export class VehicleComponentsListDetailComponent implements OnInit {
this.suppliersData.externalSuppliersId = ''; this.suppliersData.externalSuppliersId = '';
} }
this.initSF1(); this.initSF1();
}, }
}, }
}, },
externalSuppliersId: { externalSuppliersId: {
title: '外部供应商id', title: '外部供应商id',
type: 'string', type: 'string',
default: '', default: '',
ui: { ui: {
visibleIf: { suppliersType: (value: any) => value === 1 }, visibleIf: { suppliersType: (value: any) => value === 1 }
}, }
}, }
}, },
required: this.validData, required: this.validData
}; };
} }
// 获取录单员 // 获取录单员
getSelectList() { getSelectList() {
this.Serveice("car:color") this.Serveice('car:color');
this.Serveice("car:model") this.Serveice('car:model');
this.Serveice("car:length") this.Serveice('car:length');
} }
Serveice(param :any) { Serveice(param: any) {
let value: any; let value: any;
this.service.request(`${this.service.$api_get_getDictValue}`, this.service
{ .request(`${this.service.$api_get_getDictValue}`, {
dictKey: param dictKey: param
}).subscribe((res) => { })
if(param === 'car:color') { .subscribe(res => {
this.contenCarNoColor = res; if (param === 'car:color') {
} else if(param === 'car:model') { this.contenCarNoColor = res;
this.contencarModel = res; } else if (param === 'car:model') {
} else if(param === 'car:length') { this.contencarModel = res;
this.contenCarLength = res; } else if (param === 'car:length') {
} this.contenCarLength = res;
}) }
});
return value; return value;
} }
// //
getDetailList() { getDetailList() {
console.log( this.route.snapshot?.params?.id) console.log(this.route.snapshot?.params?.id);
const params = { const params = {
id: this.route.snapshot?.params?.id id: this.route.snapshot?.params?.id
}; };
this.service.request(`${this.service.$api_get_operate_get}`, params).subscribe((res) => { this.service.request(`${this.service.$api_get_operate_get}`, params).subscribe(res => {
this.detailData = res; this.detailData = res;
this.tempalateData = res; this.tempalateData = res;
}) });
} }
goBack() { goBack() {
window.history.go(-1); window.history.go(-1);
} }
handleCancel(name: any) { handleCancel(name: any) {}
}
/** /**
*查看评价 *查看评价
*/ */
viewEvaluate(item: any) { viewEvaluate(item: any) {
this.modal.createStatic(VehicleImgViewComponent, { i: item } ).subscribe(() => { this.modal.createStatic(VehicleImgViewComponent, { i: item }).subscribe(() => {
this.st.reload(); this.st.reload();
this.getDetailList(); this.getDetailList();
}); });
} }
/** /**
*查看评价 *查看评价
*/ */
updateEvaluate(item: any) { updateEvaluate(item: any) {
this.modal.createStatic(VehicleComponentsListEditComponent, { i: item }).subscribe(() => { this.modal.createStatic(VehicleComponentsListEditComponent, { i: item }).subscribe(() => {
this.st.reload(); this.st.reload();
this.getDetailList(); this.getDetailList();
}); });
} }
handleOK() { handleOK() {}
}
ratify() { ratify() {
this.isEdit = true; this.isEdit = true;
} }
@ -225,7 +222,7 @@ export class VehicleComponentsListDetailComponent implements OnInit {
} }
} }
deleteImg(key: string) { deleteImg(key: string) {
console.log(key) console.log(key);
this.nzModalService.warning({ this.nzModalService.warning({
nzTitle: '是否确认删除该图片', nzTitle: '是否确认删除该图片',
nzOnOk: () => { nzOnOk: () => {
@ -242,7 +239,8 @@ export class VehicleComponentsListDetailComponent implements OnInit {
imgList: [url], imgList: [url],
index: 0 index: 0
}; };
this.nzModalService.create({ nzContent: ImageViewComponent, nzComponentParams: { params } }); this.nzImageService.preview([{ src: url }]);
// this.nzModalService.create({ nzContent: ImageViewComponent, nzComponentParams: { params } });
} }
reset() { reset() {
@ -252,26 +250,26 @@ export class VehicleComponentsListDetailComponent implements OnInit {
save() { save() {
this.isEdit = false; this.isEdit = false;
console.log(this.detailData) console.log(this.detailData);
this.detailData.driverLicenseRegisterTime = EADateUtil.yearToDate(this.detailData?.driverLicenseRegisterTime) this.detailData.driverLicenseRegisterTime = EADateUtil.yearToDate(this.detailData?.driverLicenseRegisterTime);
this.detailData.driverLicenseEndTime = EADateUtil.yearToDate(this.detailData?.driverLicenseEndTime) this.detailData.driverLicenseEndTime = EADateUtil.yearToDate(this.detailData?.driverLicenseEndTime);
this.detailData.driverLicenseGetTime = EADateUtil.yearToDate(this.detailData?.driverLicenseGetTime) this.detailData.driverLicenseGetTime = EADateUtil.yearToDate(this.detailData?.driverLicenseGetTime);
this.detailData.roadTransportStartTime = EADateUtil.yearToDate(this.detailData?.roadTransportStartTime) this.detailData.roadTransportStartTime = EADateUtil.yearToDate(this.detailData?.roadTransportStartTime);
this.detailData.roadTransportEndTime = EADateUtil.yearToDate(this.detailData?.roadTransportEndTime) this.detailData.roadTransportEndTime = EADateUtil.yearToDate(this.detailData?.roadTransportEndTime);
console.log(this.detailData) console.log(this.detailData);
this.service.request(this.service.$api_get_update, this.detailData).subscribe((res)=>{ this.service.request(this.service.$api_get_update, this.detailData).subscribe(res => {
console.log(res) console.log(res);
if(res) { if (res) {
this.getDetailList() this.getDetailList();
this.service.msgSrv.success('修改成功!') this.service.msgSrv.success('修改成功!');
} }
}) });
} }
private initData() { private initData() {
return { return {
carNo: '', carNo: '',

View File

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

View File

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

View File

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

View File

@ -44,8 +44,9 @@ import { NzUploadModule } from 'ng-zorro-antd/upload';
import { NzCascaderModule } from 'ng-zorro-antd/cascader'; import { NzCascaderModule } from 'ng-zorro-antd/cascader';
import { NzAnchorModule } from 'ng-zorro-antd/anchor'; import { NzAnchorModule } from 'ng-zorro-antd/anchor';
import { NzAffixModule } from 'ng-zorro-antd/affix'; import { NzAffixModule } from 'ng-zorro-antd/affix';
import { NzTypographyModule } from 'ng-zorro-antd/typography'; import { NzTypographyModule } from 'ng-zorro-antd/typography';
import { NzSwitchModule } from 'ng-zorro-antd/switch'; import { NzSwitchModule } from 'ng-zorro-antd/switch';
import { NzImageModule } from 'ng-zorro-antd/image';
export const SHARED_ZORRO_MODULES = [ export const SHARED_ZORRO_MODULES = [
NzButtonModule, NzButtonModule,
NzGridModule, NzGridModule,
@ -85,5 +86,6 @@ export const SHARED_ZORRO_MODULES = [
NzAnchorModule, NzAnchorModule,
NzAffixModule, NzAffixModule,
NzTypographyModule, NzTypographyModule,
NzSwitchModule NzSwitchModule,
NzImageModule
]; ];