fix bug
This commit is contained in:
@ -4,14 +4,16 @@ 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 { UsermanageService } from '../../../services/vehicle.service';
|
||||
import { VehicleService } from '../../../services/vehicle.service';
|
||||
// import { VehicleComponentsListEditComponent } from '../edit/edit.component';
|
||||
// import { VehicleImgViewComponent } from '../img-view/img-view.component';
|
||||
|
||||
@Component({
|
||||
selector: 'app-supplier-components-list-view',
|
||||
selector: 'app-Vehicle-components-Audit-detail',
|
||||
templateUrl: './detail.component.html',
|
||||
styleUrls: ['./detail.component.less'],
|
||||
})
|
||||
export class VehicleComponentsListDetailComponent implements OnInit {
|
||||
export class VehicleComponentsAuditDetailComponent implements OnInit {
|
||||
i: any;
|
||||
url = `/rule?_allow_anonymous=true`;
|
||||
@ViewChild('st', { static: false }) st!: STComponent;
|
||||
@ -20,25 +22,8 @@ export class VehicleComponentsListDetailComponent implements OnInit {
|
||||
modalTitle = '有效期';
|
||||
modalName = '';
|
||||
ui!: SFUISchema;
|
||||
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' },
|
||||
];
|
||||
detailData: any = {
|
||||
goodsList: [
|
||||
{
|
||||
perPrice: '22323',
|
||||
goodsQuantity: '项目名称',
|
||||
totalPrice: '角色',
|
||||
},
|
||||
{
|
||||
perPrice: '2259595',
|
||||
goodsQuantity: '项目名称2',
|
||||
totalPrice: '角色',
|
||||
},
|
||||
]
|
||||
};
|
||||
columns!: STColumn[];
|
||||
detailData: any;
|
||||
schema!: SFSchema;
|
||||
@ViewChild('sf', { static: false }) sf!: SFComponent;
|
||||
schema1!: SFSchema;
|
||||
@ -49,19 +34,24 @@ export class VehicleComponentsListDetailComponent implements OnInit {
|
||||
constructor(
|
||||
private http: _HttpClient,
|
||||
private modal: ModalHelper,
|
||||
public service: UsermanageService,
|
||||
public service: VehicleService,
|
||||
private route: ActivatedRoute,
|
||||
private modalHelper: ModalHelper,
|
||||
private msgSrv: NzMessageService,
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
console.log(this.route.snapshot);
|
||||
// this.initData();
|
||||
this.getDetailList();
|
||||
this.initSF();
|
||||
this.initSF1();
|
||||
// this.launchSign();
|
||||
this.initST();
|
||||
}
|
||||
/**
|
||||
* 查询参数
|
||||
*/
|
||||
get reqParams() {
|
||||
return { id: this.route.snapshot?.params?.id };
|
||||
}
|
||||
/**
|
||||
* 初始化查询表单
|
||||
*/
|
||||
@ -83,6 +73,30 @@ export class VehicleComponentsListDetailComponent implements OnInit {
|
||||
};
|
||||
this.ui = { '*': { spanLabelFixed: 120, grid: { span: 24 } } };
|
||||
}
|
||||
initST() {
|
||||
this.columns =[
|
||||
{ title: '认证司机', index: 'name', width: 300, className: 'text-center' },
|
||||
{ title: '司机手机号', index: 'mobile', width: 300, className: 'text-center' },
|
||||
{ title: '是否挂靠', render: 'isSelf', width: 300, className: 'text-center' },
|
||||
{ title: '录入人员', index: 'totalPrice', width: 300, className: 'text-center' },
|
||||
{
|
||||
title: '车主申明/挂靠协议',
|
||||
fixed: 'right',
|
||||
width: '200px',
|
||||
className: 'text-left',
|
||||
buttons: [
|
||||
{
|
||||
text: '查看协议',
|
||||
click: (_record) => this.viewEvaluate(_record),
|
||||
},
|
||||
{
|
||||
text: '上传协议',
|
||||
click: (_record) => this.updateEvaluate(_record),
|
||||
},
|
||||
],
|
||||
},
|
||||
]
|
||||
}
|
||||
initSF1() {
|
||||
this.schema1 = {
|
||||
properties: {
|
||||
@ -122,152 +136,45 @@ export class VehicleComponentsListDetailComponent implements OnInit {
|
||||
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');
|
||||
|
||||
// 获取录单员
|
||||
getDetailList() {
|
||||
console.log( this.route.snapshot?.params?.id)
|
||||
const params = {
|
||||
tenantId: this.route.snapshot.params.id,
|
||||
// tenantId: this.route.snapshot.queryParams.tenantId,
|
||||
};
|
||||
const res = await this.service.asyncRequest(this.service.$api_get_supplier_info, 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,
|
||||
id: this.route.snapshot?.params?.id
|
||||
};
|
||||
this.service.request(`${this.service.$api_get_operate_get}`, params).subscribe((res) => {
|
||||
console.log(res)
|
||||
this.detailData = res;
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据地区code查询地区详情
|
||||
* @param code 地区代码
|
||||
*/
|
||||
async getRegionFullName(code: any) {
|
||||
const params = {
|
||||
regionCode: code,
|
||||
};
|
||||
const res = await this.service.asyncRequest(this.service.$api_get_region_detailByCode, 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_set_freezeOrResume, 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;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
*查看评价
|
||||
*/
|
||||
viewEvaluate(item: any) {
|
||||
// this.modal.createStatic(VehicleImgViewComponent, { i: { imgUrl: item } }).subscribe(() => {
|
||||
// // this.st.reload();
|
||||
// });
|
||||
}
|
||||
/**
|
||||
*查看评价
|
||||
*/
|
||||
updateEvaluate(item: any) {
|
||||
// this.modal.createStatic(VehicleComponentsListEditComponent, { i: { item }, infoData: item }).subscribe(() => {
|
||||
// // this.st.reload();
|
||||
// // this.getInfo();
|
||||
// });
|
||||
}
|
||||
handleOK() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user