remove demop
This commit is contained in:
@ -1,9 +1,12 @@
|
||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { apiConf } from '@conf/api.conf';
|
||||
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 { NzUploadFile } from 'ng-zorro-antd/upload';
|
||||
import { VehicleService } from '../../../services/vehicle.service';
|
||||
// import { VehicleComponentsListEditComponent } from '../edit/edit.component';
|
||||
// import { VehicleImgViewComponent } from '../img-view/img-view.component';
|
||||
@ -14,68 +17,25 @@ import { VehicleService } from '../../../services/vehicle.service';
|
||||
styleUrls: ['./detail.component.less']
|
||||
})
|
||||
export class VehicleComponentsAuditDetailComponent implements OnInit {
|
||||
i: any;
|
||||
url = `/rule?_allow_anonymous=true`;
|
||||
@ViewChild('st', { static: false }) st!: STComponent;
|
||||
isShow = false;
|
||||
isVisible = false;
|
||||
modalTitle = '有效期';
|
||||
modalName = '';
|
||||
ui!: SFUISchema;
|
||||
@ViewChild('redectModal', { static: false }) redectModal!: any;
|
||||
columns!: STColumn[];
|
||||
detailData: any = {
|
||||
carNo: '111'
|
||||
};
|
||||
schema!: SFSchema;
|
||||
@ViewChild('sf', { static: false }) sf!: SFComponent;
|
||||
schema1!: SFSchema;
|
||||
@ViewChild('sf1', { static: false }) sf1!: SFComponent;
|
||||
validData: any = ['suppliersType'];
|
||||
suppliersData: any = {};
|
||||
detailData: any = this.initData();
|
||||
tempalateData = { ...this.detailData };
|
||||
|
||||
isEdit = false;
|
||||
constructor(
|
||||
private http: _HttpClient,
|
||||
private modal: ModalHelper,
|
||||
public service: VehicleService,
|
||||
private route: ActivatedRoute,
|
||||
private modalHelper: ModalHelper,
|
||||
private msgSrv: NzMessageService
|
||||
) {}
|
||||
|
||||
approvalOpinion = '';
|
||||
|
||||
uploadURl = apiConf.waterFileUpload;
|
||||
carPhoto: any = [];
|
||||
constructor(public service: VehicleService, private route: ActivatedRoute, private nzModalService: NzModalService) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.getDetailList();
|
||||
this.initSF();
|
||||
this.initSF1();
|
||||
this.initST();
|
||||
}
|
||||
/**
|
||||
* 查询参数
|
||||
*/
|
||||
get reqParams() {
|
||||
return { id: this.route.snapshot?.params?.id };
|
||||
}
|
||||
/**
|
||||
* 初始化查询表单
|
||||
*/
|
||||
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 } } };
|
||||
}
|
||||
|
||||
initST() {
|
||||
this.columns = [
|
||||
{ title: '认证司机', index: 'name', width: 300, className: 'text-center' },
|
||||
@ -89,57 +49,18 @@ export class VehicleComponentsAuditDetailComponent implements OnInit {
|
||||
className: 'text-left',
|
||||
buttons: [
|
||||
{
|
||||
text: '查看协议',
|
||||
click: _record => this.viewEvaluate(_record)
|
||||
text: '查看协议'
|
||||
// click: _record => this.viewEvaluate(_record)
|
||||
},
|
||||
{
|
||||
text: '上传协议',
|
||||
click: _record => this.updateEvaluate(_record)
|
||||
text: '上传协议'
|
||||
// click: _record => this.updateEvaluate(_record)
|
||||
}
|
||||
]
|
||||
}
|
||||
];
|
||||
}
|
||||
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
|
||||
};
|
||||
}
|
||||
// 获取录单员
|
||||
|
||||
getDetailList() {
|
||||
console.log(this.route.snapshot?.params?.id);
|
||||
const params = {
|
||||
@ -151,32 +72,86 @@ export class VehicleComponentsAuditDetailComponent implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
goBack() {
|
||||
window.history.go(-1);
|
||||
approveDriver() {
|
||||
this.nzModalService.confirm({
|
||||
nzTitle: '审核通过',
|
||||
nzContent: `<p>车牌号:${this.detailData?.licenseNo}</p><p>是否确认通过审核`,
|
||||
nzOnOk: () => {
|
||||
this.adjuctUser(
|
||||
{
|
||||
auditStatus: 20
|
||||
},
|
||||
'审核成功'
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
handleCancel(name: any) {}
|
||||
rejectedDriver() {
|
||||
this.approvalOpinion = '';
|
||||
this.nzModalService.create({
|
||||
nzTitle: '审核驳回',
|
||||
nzContent: this.redectModal,
|
||||
nzOnOk: () => {
|
||||
if (!this.approvalOpinion) {
|
||||
return false;
|
||||
}
|
||||
this.adjuctUser(
|
||||
{
|
||||
auditStatus: 30,
|
||||
approvalOpinion: this.approvalOpinion
|
||||
},
|
||||
'审核驳回成功'
|
||||
);
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
*查看评价
|
||||
*/
|
||||
viewEvaluate(item: any) {
|
||||
// this.modal.createStatic(VehicleImgViewComponent, { i: { imgUrl: item } }).subscribe(() => {
|
||||
// // this.st.reload();
|
||||
// });
|
||||
reset() {
|
||||
this.detailData = { ...this.tempalateData };
|
||||
this.isEdit = false;
|
||||
}
|
||||
/**
|
||||
*查看评价
|
||||
*/
|
||||
updateEvaluate(item: any) {
|
||||
// this.modal.createStatic(VehicleComponentsListEditComponent, { i: { item }, infoData: item }).subscribe(() => {
|
||||
// // this.st.reload();
|
||||
// // this.getInfo();
|
||||
// });
|
||||
}
|
||||
handleOK() {}
|
||||
|
||||
ratify() {
|
||||
this.isEdit = true;
|
||||
}
|
||||
|
||||
changeUpload({ file, fileList, type }: any, key: string) {
|
||||
console.log({ file, fileList, type });
|
||||
if (type === 'success') {
|
||||
this.detailData[key] = file.response.data.fullFileWatermarkPath;
|
||||
}
|
||||
}
|
||||
|
||||
goBack() {
|
||||
window.history.go(-1);
|
||||
}
|
||||
|
||||
handlePreview = async (file: NzUploadFile): Promise<void> => {
|
||||
// if (!file.url && !file.preview) {
|
||||
// file.preview = await getBase64(file.originFileObj!);
|
||||
// }
|
||||
// this.previewImage = file.url || file.preview;
|
||||
// this.previewVisible = true;
|
||||
};
|
||||
|
||||
private adjuctUser(params: any, msg: string) {
|
||||
this.service.request(this.service.$api_get_operate_get, { ...params }).subscribe(res => {
|
||||
if (res) {
|
||||
this.service.msgSrv.success(msg);
|
||||
}
|
||||
this.getDetailList();
|
||||
});
|
||||
}
|
||||
|
||||
private initData() {
|
||||
return {
|
||||
carNo: '',
|
||||
carNoColor: '',
|
||||
carModel: '',
|
||||
carLength: '',
|
||||
isTrailer: null
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user