Merge branch 'develop' of https://gitlab.eascs.com/tms-ui/tms-obc-web into develop
This commit is contained in:
@ -0,0 +1,30 @@
|
||||
<div class="modal-header">
|
||||
<div class="modal-title">添加车队长</div>
|
||||
</div>
|
||||
<div>
|
||||
<sf #sf [compact]="true" [ui]="ui" [schema]="schema" [button]="'none'">
|
||||
<ng-template sf-template="tipsA" let-me let-ui="ui" let-schema="schema">
|
||||
<div class="pr">
|
||||
<dl class="tips">
|
||||
<dt>正面照</dt>
|
||||
<dd>示例</dd>
|
||||
</dl>
|
||||
<div class="pa"><img height="104" src="/assets/images/eg01.png" /></div>
|
||||
</div>
|
||||
</ng-template>
|
||||
<ng-template sf-template="tipsB" let-me let-ui="ui" let-schema="schema">
|
||||
<div class="pr">
|
||||
<dl class="tips">
|
||||
<dt>背面照</dt>
|
||||
<dd>示例</dd>
|
||||
</dl>
|
||||
<div class="pa"><img height="104" src="/assets/images/eg02.png" /></div>
|
||||
</div>
|
||||
</ng-template>
|
||||
</sf>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button nz-button type="button" (click)="close()" *ngIf="i.id === ''">取消</button>
|
||||
<button nz-button type="button" (click)="close()" *ngIf="i.id">关闭</button>
|
||||
<button nz-button type="button" nzType="primary" (click)="sure()" [disabled]="!sf?.valid" *ngIf="i.id === ''">确定</button>
|
||||
</div>
|
||||
@ -0,0 +1,36 @@
|
||||
.pr {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.pa {
|
||||
position: absolute;
|
||||
top: 35px;
|
||||
left: 150px;
|
||||
img{border: solid 1px #ebf0fb;}
|
||||
}
|
||||
|
||||
.tips {
|
||||
display: flex;
|
||||
margin-bottom: 0;
|
||||
color: #333;
|
||||
|
||||
dt {
|
||||
width: 150px;
|
||||
}
|
||||
|
||||
dd {
|
||||
width: 190px;
|
||||
margin-bottom: 0;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
:host{
|
||||
::ng-deep {
|
||||
.ant-input-borderless{
|
||||
padding: 0;
|
||||
padding-top: 4px;
|
||||
color: black;
|
||||
resize:none;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,24 @@
|
||||
import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { CtcCaptatinAddComponent } from './add.component';
|
||||
|
||||
describe('CtcCaptatinAddComponent', () => {
|
||||
let component: CtcCaptatinAddComponent;
|
||||
let fixture: ComponentFixture<CtcCaptatinAddComponent>;
|
||||
|
||||
beforeEach(waitForAsync(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ CtcCaptatinAddComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(CtcCaptatinAddComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,384 @@
|
||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { apiConf } from '@conf/api.conf';
|
||||
import { SFComponent, SFSchema, SFUISchema, SFUploadWidgetSchema } from '@delon/form';
|
||||
import { _HttpClient } from '@delon/theme';
|
||||
import { EAEnvironmentService } from '@shared';
|
||||
import { NzModalRef } from 'ng-zorro-antd/modal';
|
||||
import { Observable, Observer } from 'rxjs';
|
||||
import { UsermanageService } from 'src/app/routes/usercenter/services/usercenter.service';
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'app-ctc-add',
|
||||
templateUrl: './add.component.html',
|
||||
styleUrls: ['./add.component.less']
|
||||
})
|
||||
export class CtcCaptatinAddComponent implements OnInit {
|
||||
@ViewChild('sf', { static: false })
|
||||
sf!: SFComponent;
|
||||
record: any = {};
|
||||
i: any;
|
||||
schema!: SFSchema;
|
||||
ui!: SFUISchema;
|
||||
readFlag = false;
|
||||
detailData: any = {
|
||||
bankCardNo: '',
|
||||
bankName: '',
|
||||
mobile: '',
|
||||
remark: '',
|
||||
identityInfoDTO: {
|
||||
certificatePhotoBackWatermark: '',
|
||||
certificatePhotoFrontWatermark: '',
|
||||
certificatePhotoFront: '',
|
||||
certificatePhotoBack: '',
|
||||
certificateNumber: '',
|
||||
name: '',
|
||||
}
|
||||
}
|
||||
|
||||
constructor(
|
||||
private modal: NzModalRef,
|
||||
private envSrv: EAEnvironmentService,
|
||||
public service: UsermanageService
|
||||
) { }
|
||||
|
||||
ngOnInit(): void {
|
||||
this.initData()
|
||||
this.initSF();
|
||||
}
|
||||
initData() {
|
||||
if (this.i && this.i.id) {
|
||||
this.service.request(this.service.$api_captainrDetail, { id: this.i.id }).subscribe(res => {
|
||||
if (res) {
|
||||
this.detailData = res
|
||||
this.detailData.identityInfoDTO.certificatePhotoFrontWatermark = [
|
||||
{
|
||||
uid: -1,
|
||||
name: 'LOGO',
|
||||
status: 'done',
|
||||
url: this.detailData.identityInfoDTO.certificatePhotoFrontWatermark,
|
||||
response: this.detailData.identityInfoDTO.certificatePhotoFrontWatermark,
|
||||
},
|
||||
];
|
||||
this.detailData.identityInfoDTO.certificatePhotoBackWatermark = [
|
||||
{
|
||||
uid: -1,
|
||||
name: 'LOGO',
|
||||
status: 'done',
|
||||
url: this.detailData.identityInfoDTO.certificatePhotoBackWatermark,
|
||||
response: this.detailData.identityInfoDTO.certificatePhotoBackWatermark,
|
||||
},
|
||||
];
|
||||
this.initSF();
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
initSF() {
|
||||
this.schema = {
|
||||
properties: {
|
||||
mobile: {
|
||||
title: '手机号',
|
||||
type: 'string',
|
||||
format: 'mobile',
|
||||
maxLength: 11,
|
||||
ui: {
|
||||
widget: this.i.id ? 'text' : '',
|
||||
placeholder: '请输入手机号',
|
||||
blur: () => {
|
||||
this.service.request(this.service.$api_getByMobile, { mobile: this.sf.value.mobile }).subscribe(res => {
|
||||
if (res.certificateNumber) {
|
||||
this.readFlag = true
|
||||
this.detailData = {
|
||||
...res,
|
||||
mobile: this.sf.value.mobile,
|
||||
bankName: this.sf.value.bankName,
|
||||
bankCardNo: this.sf.value.bankCardNo,
|
||||
remark: this.sf.value.remark,
|
||||
identityInfoDTO: {
|
||||
certificatePhotoFrontWatermark: [
|
||||
{
|
||||
uid: -1,
|
||||
name: 'LOGO',
|
||||
status: 'done',
|
||||
url: res.certificatePhotoFrontWatermark,
|
||||
response: res.certificatePhotoFrontWatermark,
|
||||
}],
|
||||
certificatePhotoBackWatermark: [
|
||||
{
|
||||
uid: -1,
|
||||
name: 'LOGO',
|
||||
status: 'done',
|
||||
url: res.certificatePhotoBackWatermark,
|
||||
response: res.certificatePhotoBackWatermark,
|
||||
}],
|
||||
name: res.name,
|
||||
certificateNumber: res.certificateNumber,
|
||||
certificatePhotoFront: res.certificatePhotoFront,
|
||||
certificatePhotoBack: res.certificatePhotoBack,
|
||||
}
|
||||
}
|
||||
this.initSF()
|
||||
} else {
|
||||
this.readFlag = false
|
||||
this.detailData = {}
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
default: this.detailData.mobile
|
||||
},
|
||||
name: {
|
||||
title: '姓名',
|
||||
type: 'string',
|
||||
ui: {
|
||||
widget: this.i.id ? 'text' : '',
|
||||
placeholder: '请输入姓名',
|
||||
},
|
||||
readOnly: this.readFlag,
|
||||
default: this.detailData.identityInfoDTO.name
|
||||
},
|
||||
bankCardNo: {
|
||||
title: '银行卡号',
|
||||
type: 'string',
|
||||
ui: {
|
||||
widget: this.i.id ? 'text' : '',
|
||||
placeholder: '请输入银行卡号',
|
||||
change: (val: any) =>{
|
||||
const value = val.replace(/\D/g,'')
|
||||
this.sf.setValue('/bankCardNo', value)
|
||||
},
|
||||
errors: {
|
||||
required: '请输入银行账号',
|
||||
},
|
||||
},
|
||||
default: this.detailData.bankCardNo
|
||||
},
|
||||
bankName: {
|
||||
title: '开户行',
|
||||
type: 'string',
|
||||
ui: {
|
||||
widget: this.i.id ? 'text' : '',
|
||||
placeholder: '请输入开户行',
|
||||
},
|
||||
default: this.detailData.bankName
|
||||
},
|
||||
showName: {
|
||||
title: '身份证照片',
|
||||
type: 'string',
|
||||
readOnly: true,
|
||||
ui: {
|
||||
widget: 'textarea',
|
||||
showRequired: true,
|
||||
borderless:true,
|
||||
},
|
||||
default: '请上传身份证原件的高清照片,若上传复印件,则需加盖公司印章及法人签字;上传后系统会自动识别并填写',
|
||||
},
|
||||
tipsA: {
|
||||
title: '',
|
||||
type: 'string',
|
||||
ui: {
|
||||
widget: 'custom',
|
||||
offsetControl: 6,
|
||||
},
|
||||
},
|
||||
certificatePhotoFrontWatermark: {
|
||||
type: 'string',
|
||||
title: '',
|
||||
readOnly: this.i.id || this.readFlag,
|
||||
ui: {
|
||||
offsetControl: 6,
|
||||
action: apiConf.fileUpload,
|
||||
fileType: 'image/png,image/jpeg,image/jpg,image/gif',
|
||||
limit: 1,
|
||||
limitFileCount: 1,
|
||||
resReName: 'data.fullFileWatermarkPath',
|
||||
urlReName: 'data.fullFileWatermarkPath',
|
||||
widget: 'upload',
|
||||
descriptionI18n: '图片支持jpg、jpeg、png、gif格式,大小不超过2M',
|
||||
data: {
|
||||
appId: this.envSrv.env.appId,
|
||||
},
|
||||
name: 'multipartFile',
|
||||
multiple: false,
|
||||
listType: 'picture-card',
|
||||
change: (args: any) => {
|
||||
if (args.type === 'success') {
|
||||
this.detailData.certificatePhotoFront = args.file.response.data.fullFilePath
|
||||
this.checkIdCard(args.file.response.data.fullFilePath, 'front');
|
||||
} else {
|
||||
this.detailData.certificatePhotoFront = ''
|
||||
}
|
||||
},
|
||||
beforeUpload: (file: any, _fileList: any) => {
|
||||
return new Observable((observer: Observer<boolean>) => {
|
||||
const isLt2M = file.size / 1024 / 1024 < 2;
|
||||
if (!isLt2M) {
|
||||
this.service.msgSrv.warning('图片大小超过2M!');
|
||||
observer.complete();
|
||||
return;
|
||||
}
|
||||
observer.next(isLt2M);
|
||||
observer.complete();
|
||||
});
|
||||
},
|
||||
previewFile: (file: any) => { }
|
||||
},
|
||||
default: this.detailData.identityInfoDTO.certificatePhotoFrontWatermark
|
||||
},
|
||||
tipsB: {
|
||||
title: '',
|
||||
type: 'string',
|
||||
ui: {
|
||||
widget: 'custom',
|
||||
offsetControl: 6,
|
||||
},
|
||||
},
|
||||
certificatePhotoBackWatermark: {
|
||||
type: 'string',
|
||||
title: '',
|
||||
readOnly: this.i.id || this.readFlag,
|
||||
ui: {
|
||||
offsetControl: 6,
|
||||
action: apiConf.fileUpload,
|
||||
fileType: 'image/png,image/jpeg,image/jpg,image/gif',
|
||||
limit: 1,
|
||||
limitFileCount: 1,
|
||||
resReName: 'data.fullFileWatermarkPath',
|
||||
urlReName: 'data.fullFileWatermarkPath',
|
||||
widget: 'upload',
|
||||
descriptionI18n: '图片支持jpg、jpeg、png、gif格式,大小不超过2M',
|
||||
data: {
|
||||
appId: this.envSrv.env.appId,
|
||||
},
|
||||
name: 'multipartFile',
|
||||
multiple: false,
|
||||
listType: 'picture-card',
|
||||
change: (args: any) => {
|
||||
if (args.type === 'success') {
|
||||
this.detailData.certificatePhotoBack = args.file.response.data.fullFilePath
|
||||
} else {
|
||||
this.detailData.certificatePhotoBack = ''
|
||||
}
|
||||
},
|
||||
beforeUpload: (file: any, _fileList: any) => {
|
||||
return new Observable((observer: Observer<boolean>) => {
|
||||
const isLt2M = file.size / 1024 / 1024 < 2;
|
||||
if (!isLt2M) {
|
||||
this.service.msgSrv.warning('图片大小超过2M!');
|
||||
observer.complete();
|
||||
return;
|
||||
}
|
||||
observer.next(isLt2M);
|
||||
observer.complete();
|
||||
});
|
||||
},
|
||||
previewFile: (file: any) => { }
|
||||
},
|
||||
default: this.detailData.identityInfoDTO.certificatePhotoBackWatermark
|
||||
},
|
||||
certificateNumber: {
|
||||
title: '身份证号',
|
||||
type: 'string',
|
||||
readOnly: this.readFlag,
|
||||
ui: {
|
||||
widget: this.i.id ? 'text' : '',
|
||||
placeholder: '请输入身份证号',
|
||||
},
|
||||
default: this.detailData.identityInfoDTO.certificateNumber
|
||||
},
|
||||
remark: {
|
||||
title: '备注',
|
||||
type: 'string',
|
||||
maxLength: 100,
|
||||
ui: {
|
||||
widget: this.i.id ? 'text' : 'textarea',
|
||||
placeholder: '请输入备注',
|
||||
autosize: { minRows: 2, maxRows: 6 },
|
||||
},
|
||||
default: this.detailData.remark
|
||||
},
|
||||
},
|
||||
required: ['name', 'mobile', 'bankCardNo', 'certificateNumber', 'certificatePhotoBackWatermark', 'certificatePhotoFrontWatermark'],
|
||||
};
|
||||
this.ui = {
|
||||
'*': {
|
||||
spanLabelFixed: 120,
|
||||
grid: { span: 24 },
|
||||
},
|
||||
};
|
||||
// setTimeout(() => {
|
||||
// if (this.readFlag) {
|
||||
// this.detailData.identityInfoDTO.certificatePhotoFrontWatermark = [
|
||||
// {
|
||||
// uid: -1,
|
||||
// name: 'LOGO',
|
||||
// status: 'done',
|
||||
// url: this.detailData.certificatePhotoFrontWatermark,
|
||||
// response: this.detailData.certificatePhotoFrontWatermark,
|
||||
// },
|
||||
// ];
|
||||
// this.detailData.identityInfoDTO.certificatePhotoBackWatermark = [
|
||||
// {
|
||||
// uid: -1,
|
||||
// name: 'LOGO',
|
||||
// status: 'done',
|
||||
// url: this.detailData.certificatePhotoBackWatermark,
|
||||
// response: this.detailData.certificatePhotoBackWatermark,
|
||||
// },
|
||||
// ];
|
||||
// this.sf.setValue('/mobile', this.detailData.mobile)
|
||||
// this.sf.setValue('/name', this.detailData.name)
|
||||
// this.sf.setValue('/certificateNumber', this.detailData.certificateNumber)
|
||||
// this.sf.setValue('/certificatePhotoFrontWatermark', this.detailData.identityInfoDTO.certificatePhotoFrontWatermark)
|
||||
// this.sf.setValue('/certificatePhotoBackWatermark', this.detailData.identityInfoDTO.certificatePhotoBackWatermark)
|
||||
// }
|
||||
// }, 500)
|
||||
|
||||
}
|
||||
|
||||
checkIdCard(imgurl: any, side: any) {
|
||||
// 识别身份证 参数side:0-正面、1-背面;type:0-申请人身份证,1-法定代表人身份证
|
||||
const params = {
|
||||
idCardUrl: imgurl,
|
||||
side,
|
||||
};
|
||||
this.service.request(this.service.$api_checkIdCard, params).subscribe((res) => {
|
||||
if (res) {
|
||||
this.sf.setValue('/name', res.name);
|
||||
this.sf.setValue('/certificateNumber', res.number);
|
||||
}
|
||||
});
|
||||
}
|
||||
close(): void {
|
||||
this.modal.destroy();
|
||||
}
|
||||
sure() {
|
||||
const params: any = {
|
||||
bankCardNo: this.sf.value.bankCardNo,
|
||||
bankName: this.sf.value.bankName,
|
||||
mobile: this.sf.value.mobile,
|
||||
remark: this.sf.value.remark,
|
||||
identityInfoDTO: {
|
||||
certificatePhotoBackWatermark: this.sf.value.certificatePhotoBackWatermark,
|
||||
certificatePhotoFrontWatermark: this.sf.value.certificatePhotoFrontWatermark,
|
||||
certificatePhotoFront: this.detailData.certificatePhotoFront,
|
||||
certificatePhotoBack: this.detailData.certificatePhotoBack,
|
||||
certificateNumber: this.sf.value.certificateNumber,
|
||||
name: this.sf.value.name,
|
||||
}
|
||||
}
|
||||
if (this.i.id) {
|
||||
params.id = this.i.id
|
||||
}
|
||||
delete params.showName
|
||||
this.service.request(this.service.$api_saveCaptainr, params).subscribe(res => {
|
||||
if (res) {
|
||||
this.service.msgSrv.success('保存成功')
|
||||
this.modal.close(true)
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
@ -1,10 +1,10 @@
|
||||
<!--
|
||||
* @Author: your name
|
||||
* @Date: 2021-11-29 15:22:34
|
||||
* @LastEditTime: 2021-11-30 20:39:39
|
||||
* @LastEditors: Please set LastEditors
|
||||
* @LastEditTime : 2022-02-16 09:58:52
|
||||
* @LastEditors : Shiming
|
||||
* @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
|
||||
* @FilePath : \\tms-obc-web\\src\\app\\routes\\usercenter\\components\\driver\\captain\\captain.component.html
|
||||
-->
|
||||
<!-- 页头 -->
|
||||
<page-header-wrapper></page-header-wrapper>
|
||||
@ -16,8 +16,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" [nzLoading]="service.http.loading" (click)="st?.load(1)" acl [acl-ability]="['USERCENTER-DRIVER-CAPTAIN-list']">查询</button>
|
||||
<button nz-button nzType="primary" [disabled]="service.http.loading" (click)="exportList()" acl [acl-ability]="['USERCENTER-DRIVER-CAPTAIN-export']">导出</button>
|
||||
<button
|
||||
nz-button
|
||||
nzType="primary"
|
||||
[nzLoading]="service.http.loading"
|
||||
(click)="st?.load(1)"
|
||||
acl
|
||||
[acl-ability]="['USERCENTER-DRIVER-CAPTAIN-list']"
|
||||
>查询</button
|
||||
>
|
||||
<button
|
||||
nz-button
|
||||
nzType="primary"
|
||||
[disabled]="service.http.loading"
|
||||
(click)="exportList()"
|
||||
acl
|
||||
[acl-ability]="['USERCENTER-DRIVER-CAPTAIN-export']"
|
||||
>导出</button
|
||||
>
|
||||
<button nz-button (click)="resetSF()" [disabled]="service.http.loading">重置</button>
|
||||
<button nz-button nzType="link" (click)="expandToggle()">
|
||||
{{ !_$expand ? '展开' : '收起' }}
|
||||
@ -28,22 +44,28 @@
|
||||
</nz-card>
|
||||
<nz-card>
|
||||
<!-- 数据列表 -->
|
||||
<!-- [data]="service.$api_get_supplier_page" -->
|
||||
|
||||
<st #st [columns]="columns" [data]='service.$api_get_user_expand'
|
||||
<!-- 工具栏 -->
|
||||
<div class="toolbar" style="float: right;
|
||||
padding-bottom: 15px;">
|
||||
<button nz-button nzType="primary" (click)="add()">添加车队长</button>
|
||||
</div>
|
||||
<st
|
||||
#st
|
||||
[columns]="columns"
|
||||
[data]="service.$api_get_user_expand"
|
||||
[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] }"
|
||||
[loading]="service.http.loading">
|
||||
[loading]="service.http.loading"
|
||||
>
|
||||
<ng-template st-row="promotersTelephone" let-item let-index="index">
|
||||
<a (click)="addPromoter(item)" acl [acl-ability]="['USERCENTER-DRIVER-CAPTAIN-promoter']">
|
||||
{{ item.promotersTelephone ||'添加' }}
|
||||
<a (click)="addPromoter(item)" acl [acl-ability]="['USERCENTER-DRIVER-CAPTAIN-promoter']">
|
||||
{{ item.promotersTelephone || '添加' }}
|
||||
</a>
|
||||
</ng-template>
|
||||
</st>
|
||||
</nz-card>
|
||||
|
||||
|
||||
<ng-template #promoterModal>
|
||||
<div nz-row nzGutter="8">
|
||||
<div nz-col nzSpan="24" se-container [labelWidth]="80">
|
||||
@ -52,4 +74,4 @@
|
||||
</se>
|
||||
</div>
|
||||
</div>
|
||||
</ng-template>
|
||||
</ng-template>
|
||||
|
||||
@ -2,9 +2,11 @@ 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 { ModalHelper } from '@delon/theme';
|
||||
import { DynamicSettingModalComponent } from '@shared';
|
||||
import { NzModalService } from 'ng-zorro-antd/modal';
|
||||
import { UsermanageService } from '../../../services/usercenter.service';
|
||||
import { CtcCaptatinAddComponent } from './add/add.component';
|
||||
@Component({
|
||||
selector: 'app-usercenter-components-driver-captain',
|
||||
templateUrl: './captain.component.html',
|
||||
@ -23,7 +25,7 @@ export class UserCenterComponentsDriverCaptainComponent implements OnInit {
|
||||
promoterModal!: any;
|
||||
promotersTelephone = '';
|
||||
|
||||
constructor(public service: UsermanageService, private modal: NzModalService, private router: Router, private ar: ActivatedRoute) {}
|
||||
constructor(public service: UsermanageService, private modal: NzModalService, private router: Router, private ar: ActivatedRoute, private modalHelper: ModalHelper,) {}
|
||||
|
||||
/**
|
||||
* 查询参数
|
||||
@ -218,15 +220,23 @@ export class UserCenterComponentsDriverCaptainComponent implements OnInit {
|
||||
click: item => {
|
||||
this.router.navigate(['/usercenter/driver/captain/detail', item.appUserId]);
|
||||
},
|
||||
acl: { ability: ['USERCENTER-DRIVER-CAPTAIN-view'] },
|
||||
acl: { ability: ['USERCENTER-DRIVER-CAPTAIN-view'] }
|
||||
},
|
||||
{
|
||||
text: '基础设置',
|
||||
click: item => this.settingAction(item),
|
||||
acl: { ability: ['USERCENTER-DRIVER-CAPTAIN-basicSetting'] },
|
||||
acl: { ability: ['USERCENTER-DRIVER-CAPTAIN-basicSetting'] }
|
||||
}
|
||||
]
|
||||
}
|
||||
];
|
||||
}
|
||||
/**
|
||||
* 新增单个实例
|
||||
*/
|
||||
add() {
|
||||
this.modalHelper.create(CtcCaptatinAddComponent, { i: { id: '' } }, { size: 900 }).subscribe(res => {
|
||||
this.st.reload();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
/*
|
||||
* @Author: your name
|
||||
* @Date: 2021-11-29 15:22:34
|
||||
* @LastEditTime: 2022-01-05 10:30:26
|
||||
* @LastEditors: Please set LastEditors
|
||||
* @LastEditTime : 2022-02-16 09:55:50
|
||||
* @LastEditors : Shiming
|
||||
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
||||
* @FilePath: \tms-obc-web\src\app\routes\usercenter\services\usercenter.service.ts
|
||||
* @FilePath : \\tms-obc-web\\src\\app\\routes\\usercenter\\services\\usercenter.service.ts
|
||||
*/
|
||||
import { Injectable, Injector } from '@angular/core';
|
||||
import { cacheConf } from '@conf/cache.conf';
|
||||
@ -115,6 +115,13 @@ export class UsermanageService extends ShipperBaseService {
|
||||
$api_getRegionByCode = '/api/mdc/pbc/region/getRegionByCode';
|
||||
// 新增熟车
|
||||
$api_enterpriseVehicleSave = `/api/mdc/cuc/enterpriseVehicle/save`;
|
||||
|
||||
// 结算单-新增车队长
|
||||
$api_saveCaptainr = '/api/mdc/cuc/enterpriseSettleDriver/saveCaptainr';
|
||||
// 结算单-车队长详情
|
||||
$api_captainrDetail = '/api/mdc/cuc/enterpriseSettleDriver/captainrDetail';
|
||||
// 根据手机号码查询结算单司机
|
||||
$api_getByMobile = '/api/mdc/cuc/identityInfo/getByMobile';
|
||||
constructor(public injector: Injector, private nzModalService: NzModalService, public eaCacheSrv: EACacheService) {
|
||||
super(injector, eaCacheSrv);
|
||||
}
|
||||
|
||||
@ -23,6 +23,7 @@ import { UsercenterRoutingModule } from './usercenter-routing.module';
|
||||
import { AuditAdminComponent } from './components/freight/enterprise-audit/audit-admin/audit-admin.component';
|
||||
import { CaptainDetailComponent } from './components/driver/captain/captain-detail/captain-detail.component';
|
||||
import { CarSettleAddDriverComponent } from './components/driver/add-driver/add-driver.component';
|
||||
import { CtcCaptatinAddComponent } from './components/driver/captain/add/add.component';
|
||||
|
||||
const COMPONENTS = [
|
||||
FreightComponentsListComponent,
|
||||
@ -38,7 +39,8 @@ const COMPONENTS = [
|
||||
UserCenterComponentsDriverCaptainComponent,
|
||||
CaptainDetailComponent,
|
||||
AuditAdminComponent,
|
||||
CarSettleAddDriverComponent
|
||||
CarSettleAddDriverComponent,
|
||||
CtcCaptatinAddComponent
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
|
||||
@ -0,0 +1,43 @@
|
||||
<!--
|
||||
* @Description :
|
||||
* @Version : 1.0
|
||||
* @Author : Shiming
|
||||
* @Date : 2022-02-16 10:09:23
|
||||
* @LastEditors : Shiming
|
||||
* @LastEditTime : 2022-02-16 10:14:29
|
||||
* @FilePath : \\tms-obc-web\\src\\app\\routes\\vehicle\\components\\list\\carauth\\carauth.component.html
|
||||
* Copyright (C) 2022 huzhenhong. All rights reserved.
|
||||
-->
|
||||
<div class="modal-header">
|
||||
<div class="modal-title">添加车辆</div>
|
||||
</div>
|
||||
<!-- <nz-spin *ngIf="!i" class="modal-spin"></nz-spin> -->
|
||||
<div class="sfBox">
|
||||
<sf #sf [compact]="true" [ui]="ui" [schema]="schema" [button]="'none'" *ngIf="schema" [formData]="detailData">
|
||||
<ng-template sf-template="tipsA" let-me let-ui="ui" let-schema="schema">
|
||||
<div class="pr">
|
||||
<dl class="tips">
|
||||
<dt>行驶证首页</dt>
|
||||
<dd>示例</dd>
|
||||
</dl>
|
||||
<div class="pa"><img width="190" src="/assets/images/vehicle/driverfront.png" /></div>
|
||||
</div>
|
||||
</ng-template>
|
||||
<ng-template sf-template="tipsB" let-me let-ui="ui" let-schema="schema">
|
||||
<div class="pr">
|
||||
<dl class="tips">
|
||||
<dt>行驶证副页</dt>
|
||||
<dd>示例</dd>
|
||||
</dl>
|
||||
<div class="pa"><img width="190" src="/assets/images/vehicle/driverback.png" /></div>
|
||||
</div>
|
||||
</ng-template>
|
||||
</sf>
|
||||
<img class="drivercard" height="104" src="/assets/images/vehicle/car.png" />
|
||||
<img class="agreement" height="104" src="/assets/images/vehicle/agreement.png" />
|
||||
<img class="jopcard" height="104" src="/assets/images/vehicle/road.png" />
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button nz-button type="button" (click)="close()">关闭</button>
|
||||
<button nz-button type="button" nzType="primary" (click)="submitForm()" [disabled]="!sf?.valid">确定</button>
|
||||
</div>
|
||||
@ -0,0 +1,123 @@
|
||||
.sfBox {
|
||||
position: relative;
|
||||
.example {
|
||||
position: absolute;
|
||||
top: 215px;
|
||||
right: 265px;
|
||||
color: #1890ff;
|
||||
cursor: pointer;
|
||||
.popBox {
|
||||
position: absolute;
|
||||
top: -170px;
|
||||
left: -125px;
|
||||
width: 300px;
|
||||
padding: 20px;
|
||||
text-align: center;
|
||||
background: #fff;
|
||||
border: solid 1px #eee;
|
||||
border-radius: 6px;
|
||||
box-shadow: 0 1px 5px 1px #ececec;
|
||||
&::before {
|
||||
position: absolute;
|
||||
bottom: -5px;
|
||||
left: 50%;
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
margin-left: -5px;
|
||||
background: #fff;
|
||||
box-shadow: 0 1px 5px 1px #ececec;
|
||||
transform: rotate(45deg);
|
||||
content: '';
|
||||
}
|
||||
&::after {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
z-index: 10;
|
||||
width: 100%;
|
||||
height: 10px;
|
||||
background: #fff;
|
||||
content: '';
|
||||
}
|
||||
img {
|
||||
max-width: 100%;
|
||||
max-height: 200px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.positionSet{
|
||||
top: 356px;
|
||||
right: 235px;
|
||||
}
|
||||
.positionSet01{
|
||||
top: 500px;
|
||||
right: 200px;
|
||||
}
|
||||
.positionSet02{
|
||||
top: 664px;
|
||||
right: 265px;
|
||||
}
|
||||
.positionSet03{
|
||||
top: 808px;
|
||||
right: 205px;
|
||||
|
||||
}
|
||||
}
|
||||
.exaA{
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 300px
|
||||
}
|
||||
.pr {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.pa {
|
||||
position: absolute;
|
||||
top: 35px;
|
||||
left: 150px;
|
||||
}
|
||||
|
||||
.tips {
|
||||
display: flex;
|
||||
margin-bottom: 0;
|
||||
color: #333;
|
||||
|
||||
dt {
|
||||
width: 150px;
|
||||
}
|
||||
|
||||
dd {
|
||||
width: 190px;
|
||||
margin-bottom: 0;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
.drivercard{
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 330px;
|
||||
border: solid 1px #ebf0fb;
|
||||
}
|
||||
.jopcard{
|
||||
position: absolute;
|
||||
top: 1356px;
|
||||
left: 330px;
|
||||
border: solid 1px #ebf0fb;
|
||||
}
|
||||
.agreement{
|
||||
position: absolute;
|
||||
top: 425px;
|
||||
left: 330px;
|
||||
border: solid 1px #ebf0fb;
|
||||
}
|
||||
:host{
|
||||
::ng-deep {
|
||||
.ant-input-borderless{
|
||||
padding: 0;
|
||||
padding-top: 4px;
|
||||
color: black;
|
||||
resize:none;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,24 @@
|
||||
import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { CarSettleCarauthComponent } from './carauth.component';
|
||||
|
||||
describe('CarSettleCarauthComponent', () => {
|
||||
let component: CarSettleCarauthComponent;
|
||||
let fixture: ComponentFixture<CarSettleCarauthComponent>;
|
||||
|
||||
beforeEach(waitForAsync(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ CarSettleCarauthComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(CarSettleCarauthComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,651 @@
|
||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { apiConf } from '@conf/api.conf';
|
||||
import { cacheConf } from '@conf/cache.conf';
|
||||
import { SFUISchema, SFSchema, SFUploadWidgetSchema, SFComponent, SFSelectWidgetSchema } from '@delon/form';
|
||||
import { _HttpClient } from '@delon/theme';
|
||||
import { EACacheService, EAEnvironmentService } from '@shared';
|
||||
import { NzModalRef } from 'ng-zorro-antd/modal';
|
||||
import { NzUploadFile } from 'ng-zorro-antd/upload';
|
||||
import { Observable, Observer, of } from 'rxjs';
|
||||
import { VehicleService } from '../../../services/vehicle.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-car-carauth',
|
||||
templateUrl: './carauth.component.html',
|
||||
styleUrls: ['./carauth.component.less']
|
||||
})
|
||||
export class CarSettleCarauthComponent implements OnInit {
|
||||
@ViewChild('sf', { static: false }) sf!: SFComponent;
|
||||
record: any = {};
|
||||
i: any;
|
||||
ui: SFUISchema = {};
|
||||
schema: SFSchema = {};
|
||||
showCardFlag = false;
|
||||
showJopFlag = false;
|
||||
companyData: any = {};
|
||||
detailData: any = {};
|
||||
carNo = '';
|
||||
|
||||
constructor(
|
||||
private modal: NzModalRef,
|
||||
public service: VehicleService,
|
||||
private envSrv: EAEnvironmentService,
|
||||
private eaCacheSrv: EACacheService
|
||||
) {}
|
||||
|
||||
ngOnInit(): void {
|
||||
console.log(this.i)
|
||||
this.initData();
|
||||
this.initSF();
|
||||
}
|
||||
initData() {
|
||||
if (this.i?.id) {
|
||||
this.companyData = this.eaCacheSrv.get(cacheConf.env);
|
||||
const params = {
|
||||
id: this.i?.id
|
||||
};
|
||||
this.service.request(this.service.$api_shipperCarGet, params).subscribe(res => {
|
||||
this.detailData = res;
|
||||
this.detailData.isSelf = res.isSelf ? 1 : 0;
|
||||
this.detailData.isTrailer = res.isTrailer ? 1 : 0;
|
||||
this.detailData.carFrontPhotoWatermark = [
|
||||
{
|
||||
uid: -1,
|
||||
name: 'LOGO',
|
||||
status: 'done',
|
||||
url: this.detailData.carFrontPhotoWatermark,
|
||||
response: this.detailData.carFrontPhotoWatermark
|
||||
}
|
||||
];
|
||||
this.detailData.carProtocalWatermark = [
|
||||
{
|
||||
uid: -1,
|
||||
name: 'LOGO',
|
||||
status: 'done',
|
||||
url: this.detailData.carProtocalWatermark,
|
||||
response: this.detailData.carProtocalWatermark
|
||||
}
|
||||
];
|
||||
this.detailData.certificatePhotoFrontWatermark = [
|
||||
{
|
||||
uid: -1,
|
||||
name: 'LOGO',
|
||||
status: 'done',
|
||||
url: this.detailData.certificatePhotoFrontWatermark,
|
||||
response: this.detailData.certificatePhotoFrontWatermark
|
||||
}
|
||||
];
|
||||
this.detailData.certificatePhotoBackWatermark = [
|
||||
{
|
||||
uid: -1,
|
||||
name: 'LOGO',
|
||||
status: 'done',
|
||||
url: this.detailData.certificatePhotoBackWatermark,
|
||||
response: this.detailData.certificatePhotoBackWatermark
|
||||
}
|
||||
];
|
||||
this.detailData.roadTransportPhotoWatermark = [
|
||||
{
|
||||
uid: -1,
|
||||
name: 'LOGO',
|
||||
status: 'done',
|
||||
url: this.detailData.roadTransportPhotoWatermark,
|
||||
response: this.detailData.roadTransportPhotoWatermark
|
||||
}
|
||||
];
|
||||
});
|
||||
}
|
||||
}
|
||||
initSF() {
|
||||
this.schema = {
|
||||
properties: {
|
||||
carFrontPhotoWatermark: {
|
||||
type: 'string',
|
||||
title: '车头照照片',
|
||||
ui: {
|
||||
action: apiConf.fileUpload,
|
||||
fileType: 'image/png,image/jpeg,image/jpg,image/gif',
|
||||
limit: 1,
|
||||
limitFileCount: 1,
|
||||
resReName: 'data.fullFileWatermarkPath',
|
||||
urlReName: 'data.fullFileWatermarkPath',
|
||||
widget: 'upload',
|
||||
descriptionI18n: '请上传车头照照片,支持JPG、PNG格式,文件小于5M。',
|
||||
data: {
|
||||
appId: this.envSrv.env.appId
|
||||
},
|
||||
name: 'multipartFile',
|
||||
multiple: false,
|
||||
listType: 'picture-card',
|
||||
change: (args: any) => {
|
||||
if (args.type === 'success') {
|
||||
this.detailData.carFrontPhoto = args.file.response.data.fullFilePath;
|
||||
}
|
||||
},
|
||||
beforeUpload: (file: any, _fileList: any) => {
|
||||
return new Observable((observer: Observer<boolean>) => {
|
||||
const isLt2M = file.size / 1024 / 1024 < 2;
|
||||
if (!isLt2M) {
|
||||
this.service.msgSrv.warning('图片大小超过2M!');
|
||||
observer.complete();
|
||||
return;
|
||||
}
|
||||
observer.next(isLt2M);
|
||||
observer.complete();
|
||||
});
|
||||
},
|
||||
// previewFile: (file: NzUploadFile) => of(file.url)
|
||||
}
|
||||
},
|
||||
carNo: {
|
||||
title: '车牌号',
|
||||
maxLength: 9,
|
||||
type: 'string',
|
||||
ui: {
|
||||
placeholder: '请输入'
|
||||
}
|
||||
},
|
||||
carNoColor: {
|
||||
title: '车牌颜色',
|
||||
type: 'string',
|
||||
ui: {
|
||||
widget: 'dict-select',
|
||||
params: { dictKey: 'car:color' },
|
||||
placeholder: '请选择车型',
|
||||
containsAllLabel: false
|
||||
} as SFSelectWidgetSchema
|
||||
},
|
||||
carModel: {
|
||||
title: '车型',
|
||||
type: 'string',
|
||||
ui: {
|
||||
widget: 'dict-select',
|
||||
params: { dictKey: 'car:model' },
|
||||
placeholder: '请选择车型',
|
||||
containsAllLabel: false
|
||||
} as SFSelectWidgetSchema
|
||||
},
|
||||
carLength: {
|
||||
title: '车长',
|
||||
type: 'string',
|
||||
ui: {
|
||||
widget: 'dict-select',
|
||||
params: { dictKey: 'car:length' },
|
||||
placeholder: '请选择车长',
|
||||
containsAllLabel: false
|
||||
} as SFSelectWidgetSchema
|
||||
},
|
||||
carLoad: {
|
||||
title: '载重',
|
||||
type: 'string',
|
||||
maxLength: 6,
|
||||
ui: {
|
||||
placeholder: '请输入',
|
||||
change: (val: any) => {
|
||||
const value = val.replace(/\D/g, '');
|
||||
this.sf.setValue('/carLoad', value);
|
||||
}
|
||||
}
|
||||
},
|
||||
isSelf: {
|
||||
title: '是否挂靠',
|
||||
type: 'string',
|
||||
enum: [
|
||||
{ label: '否', value: 0 },
|
||||
{ label: '是', value: 1 }
|
||||
],
|
||||
ui: {
|
||||
widget: 'select',
|
||||
placeholder: '请选择'
|
||||
}
|
||||
},
|
||||
isTrailer: {
|
||||
title: '是否为挂车',
|
||||
type: 'string',
|
||||
enum: [
|
||||
{ label: '否', value: 0 },
|
||||
{ label: '是', value: 1 }
|
||||
],
|
||||
ui: {
|
||||
widget: 'select',
|
||||
placeholder: '请选择'
|
||||
}
|
||||
},
|
||||
carProtocalWatermark: {
|
||||
type: 'string',
|
||||
title: '挂靠协议',
|
||||
ui: {
|
||||
action: apiConf.fileUpload,
|
||||
fileType: 'image/png,image/jpeg,image/jpg,image/gif',
|
||||
limit: 1,
|
||||
limitFileCount: 1,
|
||||
resReName: 'data.fullFileWatermarkPath',
|
||||
urlReName: 'data.fullFileWatermarkPath',
|
||||
widget: 'upload',
|
||||
descriptionI18n: '请上传挂靠协议,支持JPG、PNG格式,文件小于5M。',
|
||||
data: {
|
||||
appId: this.envSrv.env.appId
|
||||
},
|
||||
name: 'multipartFile',
|
||||
multiple: false,
|
||||
listType: 'picture-card',
|
||||
change: (args: any) => {
|
||||
if (args.type === 'success') {
|
||||
this.detailData.certificatePhotoFront = args.file.response.data.fullFilePath;
|
||||
}
|
||||
},
|
||||
beforeUpload: (file: any, _fileList: any) => {
|
||||
return new Observable((observer: Observer<boolean>) => {
|
||||
const isLt2M = file.size / 1024 / 1024 < 2;
|
||||
if (!isLt2M) {
|
||||
this.service.msgSrv.warning('图片大小超过2M!');
|
||||
observer.complete();
|
||||
return;
|
||||
}
|
||||
observer.next(isLt2M);
|
||||
observer.complete();
|
||||
});
|
||||
},
|
||||
// previewFile: (file: NzUploadFile) => of(file.url)
|
||||
}
|
||||
},
|
||||
titleA: {
|
||||
title: '行驶证信息(必填)',
|
||||
type: 'string',
|
||||
ui: {
|
||||
widget: 'text'
|
||||
},
|
||||
default: '照片上传后会自动识别文字并填充下列内容栏'
|
||||
},
|
||||
tipsA: {
|
||||
title: '',
|
||||
type: 'string',
|
||||
ui: {
|
||||
widget: 'custom',
|
||||
offsetControl: 6
|
||||
}
|
||||
},
|
||||
certificatePhotoFrontWatermark: {
|
||||
type: 'string',
|
||||
title: '行驶证首页照片',
|
||||
ui: {
|
||||
action: apiConf.fileUpload,
|
||||
fileType: 'image/png,image/jpeg,image/jpg,image/gif',
|
||||
limit: 1,
|
||||
limitFileCount: 1,
|
||||
resReName: 'data.fullFileWatermarkPath',
|
||||
urlReName: 'data.fullFileWatermarkPath',
|
||||
widget: 'upload',
|
||||
descriptionI18n: '请上传行驶证首页照片,支持JPG、PNG格式,文件小于5M。照片信息缺失、拼凑、过度PS、模糊不清,都不会通过审核。',
|
||||
data: {
|
||||
appId: this.envSrv.env.appId
|
||||
},
|
||||
name: 'multipartFile',
|
||||
multiple: false,
|
||||
listType: 'picture-card',
|
||||
change: (args: any) => {
|
||||
if (args.type === 'success') {
|
||||
this.detailData.certificatePhotoFront = args.file.response.data.fullFilePath;
|
||||
this.checkCarCard(args.file.response.data.fullFilePath, 'front');
|
||||
} else {
|
||||
this.detailData.certificatePhotoFront = '';
|
||||
}
|
||||
},
|
||||
beforeUpload: (file: any, _fileList: any) => {
|
||||
return new Observable((observer: Observer<boolean>) => {
|
||||
const isLt2M = file.size / 1024 / 1024 < 2;
|
||||
if (!isLt2M) {
|
||||
this.service.msgSrv.warning('图片大小超过2M!');
|
||||
observer.complete();
|
||||
return;
|
||||
}
|
||||
observer.next(isLt2M);
|
||||
observer.complete();
|
||||
});
|
||||
},
|
||||
// previewFile: (file: NzUploadFile) => of(file.url)
|
||||
}
|
||||
},
|
||||
tipsB: {
|
||||
title: '',
|
||||
type: 'string',
|
||||
ui: {
|
||||
widget: 'custom',
|
||||
offsetControl: 6
|
||||
}
|
||||
},
|
||||
certificatePhotoBackWatermark: {
|
||||
type: 'string',
|
||||
title: '行驶证副页照片',
|
||||
ui: {
|
||||
action: apiConf.fileUpload,
|
||||
fileType: 'image/png,image/jpeg,image/jpg,image/gif',
|
||||
limit: 1,
|
||||
limitFileCount: 1,
|
||||
resReName: 'data.fullFileWatermarkPath',
|
||||
urlReName: 'data.fullFileWatermarkPath',
|
||||
widget: 'upload',
|
||||
descriptionI18n: '请上传行驶证副业照片,支持JPG、PNG格式,文件小于5M。',
|
||||
data: {
|
||||
appId: this.envSrv.env.appId
|
||||
},
|
||||
name: 'multipartFile',
|
||||
multiple: false,
|
||||
listType: 'picture-card',
|
||||
change: (args: any) => {
|
||||
if (args.type === 'success') {
|
||||
this.detailData.certificatePhotoBack = args.file.response.data.fullFilePath;
|
||||
this.checkCarCard(args.file.response.data.fullFilePath, 'back');
|
||||
} else {
|
||||
this.detailData.certificatePhotoBack = '';
|
||||
}
|
||||
},
|
||||
beforeUpload: (file: any, _fileList: any) => {
|
||||
return new Observable((observer: Observer<boolean>) => {
|
||||
const isLt2M = file.size / 1024 / 1024 < 2;
|
||||
if (!isLt2M) {
|
||||
this.service.msgSrv.warning('图片大小超过2M!');
|
||||
observer.complete();
|
||||
return;
|
||||
}
|
||||
observer.next(isLt2M);
|
||||
observer.complete();
|
||||
});
|
||||
},
|
||||
// previewFile: (file: NzUploadFile) => of(file.url)
|
||||
}
|
||||
},
|
||||
driverLicenseRegisterTime: {
|
||||
title: '行驶证注册日期',
|
||||
type: 'string',
|
||||
format: 'date',
|
||||
ui: {
|
||||
placeholder: '请输入'
|
||||
}
|
||||
},
|
||||
driverLicenseGetTime: {
|
||||
title: '行驶证发证日期',
|
||||
type: 'string',
|
||||
format: 'date',
|
||||
ui: {
|
||||
placeholder: '请输入'
|
||||
}
|
||||
},
|
||||
driverLicenseEndTime: {
|
||||
title: '行驶证到期日期',
|
||||
type: 'string',
|
||||
format: 'date',
|
||||
maxLength: 30,
|
||||
ui: {
|
||||
placeholder: '请输入'
|
||||
}
|
||||
},
|
||||
driverLicenseSigningOrg: {
|
||||
title: '行驶证签发机关',
|
||||
type: 'string',
|
||||
maxLength: 30,
|
||||
ui: {
|
||||
placeholder: '请输入'
|
||||
}
|
||||
},
|
||||
carDistinguishCode: {
|
||||
title: '车辆识别代码',
|
||||
type: 'string',
|
||||
maxLength: 30,
|
||||
ui: {
|
||||
placeholder: '请输入'
|
||||
}
|
||||
},
|
||||
useNature: {
|
||||
title: '使用性质',
|
||||
type: 'string',
|
||||
maxLength: 30,
|
||||
enum: [
|
||||
{ label: '非营运', value: 0 },
|
||||
{ label: '营运', value: 1 }
|
||||
],
|
||||
ui: {
|
||||
widget: 'select',
|
||||
placeholder: '请选择'
|
||||
}
|
||||
},
|
||||
curbWeight: {
|
||||
title: '整备质量',
|
||||
type: 'string',
|
||||
ui: {
|
||||
placeholder: '请输入'
|
||||
}
|
||||
},
|
||||
carOwner: {
|
||||
title: '所有人',
|
||||
type: 'string',
|
||||
maxLength: 30,
|
||||
ui: {
|
||||
placeholder: '请输入'
|
||||
}
|
||||
},
|
||||
titleB: {
|
||||
title: '道运证(选填)',
|
||||
type: 'string',
|
||||
ui: {
|
||||
widget: 'text'
|
||||
},
|
||||
default: '照片上传后会自动识别文字并填充下列内容栏'
|
||||
},
|
||||
roadTransportPhotoWatermark: {
|
||||
type: 'string',
|
||||
title: '道运证照片',
|
||||
ui: {
|
||||
action: apiConf.fileUpload,
|
||||
fileType: 'image/png,image/jpeg,image/jpg,image/gif',
|
||||
limit: 1,
|
||||
limitFileCount: 1,
|
||||
resReName: 'data.fullFileWatermarkPath',
|
||||
urlReName: 'data.fullFileWatermarkPath',
|
||||
widget: 'upload',
|
||||
descriptionI18n: '请上传道运证照片,支持JPG、PNG格式,文件小于5M。蓝牌绿牌车辆,可不用传道运证',
|
||||
data: {
|
||||
appId: this.envSrv.env.appId
|
||||
},
|
||||
name: 'multipartFile',
|
||||
multiple: false,
|
||||
listType: 'picture-card',
|
||||
change: (args: any) => {
|
||||
if (args.type === 'success') {
|
||||
this.detailData.roadTransportPhoto = args.file.response.data.fullFilePath;
|
||||
this.checkTransCard(args.file.response.data.fullFilePath);
|
||||
} else {
|
||||
this.detailData.roadTransportPhoto = '';
|
||||
}
|
||||
},
|
||||
beforeUpload: (file: any, _fileList: any) => {
|
||||
return new Observable((observer: Observer<boolean>) => {
|
||||
const isLt2M = file.size / 1024 / 1024 < 2;
|
||||
if (!isLt2M) {
|
||||
this.service.msgSrv.warning('图片大小超过2M!');
|
||||
observer.complete();
|
||||
return;
|
||||
}
|
||||
observer.next(isLt2M);
|
||||
observer.complete();
|
||||
});
|
||||
},
|
||||
// previewFile: (file: NzUploadFile) => of(file.url)
|
||||
}
|
||||
},
|
||||
roadTransportNo: {
|
||||
title: '道运证号码',
|
||||
type: 'string',
|
||||
maxLength: 30,
|
||||
ui: {
|
||||
// widget: this.detailData.commitFlag !== 0 ? 'text' : '',
|
||||
placeholder: '请输入'
|
||||
}
|
||||
},
|
||||
roadTransportLicenceNo: {
|
||||
title: '经营许可证号',
|
||||
type: 'string',
|
||||
maxLength: 30,
|
||||
ui: {
|
||||
// widget: this.detailData.commitFlag !== 0 ? 'text' : '',
|
||||
placeholder: '请输入'
|
||||
}
|
||||
},
|
||||
roadTransportStartTime: {
|
||||
title: '发证日期',
|
||||
type: 'string',
|
||||
format: 'date',
|
||||
ui: {
|
||||
placeholder: '请输入'
|
||||
}
|
||||
},
|
||||
roadTransportEndTime: {
|
||||
title: '有效期至',
|
||||
type: 'string',
|
||||
format: 'date',
|
||||
ui: {
|
||||
placeholder: '请输入'
|
||||
}
|
||||
}
|
||||
},
|
||||
required: [
|
||||
'carFrontPhotoWatermark',
|
||||
'carNo',
|
||||
'carNoColor',
|
||||
'carModel',
|
||||
'carLength',
|
||||
'carLoad',
|
||||
'isSelf',
|
||||
'isTrailer',
|
||||
'certificatePhotoFrontWatermark',
|
||||
'certificatePhotoBackWatermark',
|
||||
'driverLicenseRegisterTime',
|
||||
'driverLicenseGetTime',
|
||||
'driverLicenseEndTime',
|
||||
'driverLicenseSigningOrg',
|
||||
'carDistinguishCode',
|
||||
'useNature',
|
||||
'carOwner'
|
||||
]
|
||||
};
|
||||
|
||||
this.ui = {
|
||||
'*': {
|
||||
spanLabelFixed: 180,
|
||||
grid: { span: 18 },
|
||||
width: 600
|
||||
},
|
||||
$title1: {
|
||||
spanLabelFixed: 0
|
||||
},
|
||||
$title2: {
|
||||
spanLabelFixed: 0
|
||||
},
|
||||
$title3: {
|
||||
spanLabelFixed: 0
|
||||
},
|
||||
$enterpriseRegistrationTime: {
|
||||
width: 680
|
||||
},
|
||||
$operatingEndTime: {
|
||||
grid: { span: 9 }
|
||||
},
|
||||
$dateType: {
|
||||
grid: { span: 4 }
|
||||
},
|
||||
$validEndTime: {
|
||||
grid: { span: 9 }
|
||||
},
|
||||
$dateType01: {
|
||||
grid: { span: 4 }
|
||||
},
|
||||
$registrationCapital: {
|
||||
grid: { span: 12 }
|
||||
},
|
||||
$unit: {
|
||||
spanLabelFixed: 20,
|
||||
grid: { span: 3 }
|
||||
}
|
||||
};
|
||||
}
|
||||
// 道路运输证识别
|
||||
checkTransCard(imgurl: any) {
|
||||
const params = {
|
||||
transportationLicenseUrl: imgurl
|
||||
};
|
||||
this.service.request(this.service.$api_recognizeTransportationLicense, params).subscribe(res => {
|
||||
if (res) {
|
||||
this.sf.setValue('/roadTransportNo', res.number);
|
||||
this.sf.setValue('/roadTransportLicenceNo', res.businessCertificate);
|
||||
this.sf.setValue('/roadTransportStartTime', res.issueDate);
|
||||
if (this.carNo === '') {
|
||||
this.carNo = res.number;
|
||||
} else if (this.carNo && res.vehicleNumber.indexOf(this.carNo) === -1) {
|
||||
this.service.msgSrv.warning('请上传同一认证车辆的相关证件');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
// 行驶证识别
|
||||
checkCarCard(imgurl: any, side: any) {
|
||||
const params = {
|
||||
vehicleLicenseUrl: imgurl,
|
||||
side
|
||||
};
|
||||
this.service.request(this.service.$api_recognizeVehicleLicense, params).subscribe(res => {
|
||||
if (res) {
|
||||
if (side === 'front') {
|
||||
// 正面
|
||||
this.sf.setValue('/driverLicenseRegisterTime', res.registerDate);
|
||||
this.sf.setValue('/carNo', res.number);
|
||||
this.sf.setValue('/driverLicenseGetTime', res.issueDate);
|
||||
this.sf.setValue('/driverLicenseSigningOrg', res.issuingAuthority);
|
||||
this.sf.setValue('/carDistinguishCode', res.vin);
|
||||
this.sf.setValue('/carOwner', res.name);
|
||||
this.sf.setValue('/useNature', res.useCharacter === '非营运' ? 0 : 1);
|
||||
} else {
|
||||
this.sf.setValue('/curbWeight', res.unladenMass);
|
||||
}
|
||||
if (this.carNo === '') {
|
||||
this.carNo = res.number;
|
||||
} else if (this.carNo && this.carNo !== res.number) {
|
||||
this.service.msgSrv.warning('请上传同一认证车辆的相关证件');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
close(): void {
|
||||
this.modal.destroy();
|
||||
}
|
||||
showExample() {
|
||||
this.showCardFlag = !this.showCardFlag;
|
||||
}
|
||||
showJopExample() {
|
||||
this.showJopFlag = !this.showJopFlag;
|
||||
}
|
||||
submitForm() {
|
||||
const params: any = {
|
||||
appUserId: this.i.appUserId,
|
||||
...this.sf.value
|
||||
};
|
||||
params.carFrontPhoto = this.detailData.carFrontPhoto;
|
||||
params.carProtocal = this.detailData.carProtocal;
|
||||
params.certificatePhotoFront = this.detailData.certificatePhotoFront;
|
||||
params.certificatePhotoBack = this.detailData.certificatePhotoBack;
|
||||
params.roadTransportPhoto = this.detailData.roadTransportPhoto;
|
||||
params.carFrontPhotoWatermark = this.sf.value.carFrontPhotoWatermark.data.fullFilePath
|
||||
params.carProtocalWatermark = this.sf.value.carProtocalWatermark.data.fullFilePath
|
||||
params.certificatePhotoBackWatermark = this.sf.value.certificatePhotoBackWatermark.data.fullFilePath
|
||||
params.certificatePhotoFrontWatermark = this.sf.value.certificatePhotoFrontWatermark.data.fullFilePath
|
||||
params.roadTransportPhotoWatermark = this.sf.value.roadTransportPhotoWatermark.data.fullFilePath
|
||||
delete params.titleA;
|
||||
delete params.titleB;
|
||||
this.service.request(this.service.$api_saveUpdateShipperCar, params).subscribe(res => {
|
||||
if (res) {
|
||||
this.service.msgSrv.success('添加成功');
|
||||
this.modal.close(true);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -37,8 +37,11 @@
|
||||
</nz-card>
|
||||
<nz-card>
|
||||
<!-- 数据列表 -->
|
||||
<!-- [data]="service.$api_get_supplier_page" -->
|
||||
|
||||
<!-- 工具栏 -->
|
||||
<div class="toolbar" style="float: right;
|
||||
padding-bottom: 15px;">
|
||||
<button nz-button nzType="primary" (click)="addModal()">添加车辆</button>
|
||||
</div>
|
||||
<st
|
||||
#st
|
||||
[bordered]="true"
|
||||
|
||||
@ -2,11 +2,13 @@ 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, SFSchemaEnum, SFSelectWidgetSchema, SFUISchema } from '@delon/form';
|
||||
import { ModalHelper } from '@delon/theme';
|
||||
import { NzModalService } from 'ng-zorro-antd/modal';
|
||||
import { format } from 'path';
|
||||
import { of } from 'rxjs';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { VehicleService } from '../../../vehicle/services/vehicle.service';
|
||||
import { CarSettleCarauthComponent } from './carauth/carauth.component';
|
||||
@Component({
|
||||
selector: 'app-Vehicle-components-list',
|
||||
templateUrl: './list.component.html'
|
||||
@ -20,7 +22,7 @@ export class VehicleComponentsListComponent implements OnInit {
|
||||
@ViewChild('st', { static: false }) st!: STComponent;
|
||||
@ViewChild('sf', { static: false }) sf!: SFComponent;
|
||||
|
||||
constructor(public service: VehicleService, private modal: NzModalService, private router: Router, private ar: ActivatedRoute) {}
|
||||
constructor(public service: VehicleService, private modal: NzModalService, private router: Router, private ar: ActivatedRoute, private modalHelper: ModalHelper) {}
|
||||
|
||||
/**
|
||||
* 查询参数
|
||||
@ -286,4 +288,12 @@ export class VehicleComponentsListComponent implements OnInit {
|
||||
exportFire() {
|
||||
this.service.downloadFile(this.service.$api_carLicense_export, this.reqParams);
|
||||
}
|
||||
addModal() {
|
||||
const i = {
|
||||
appUserId: '',
|
||||
}
|
||||
this.modalHelper.create(CarSettleCarauthComponent, {i}, { size: 900 }).subscribe((res) => {
|
||||
this.st.load()
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -13,7 +13,7 @@ import { BaseService } from 'src/app/shared/services/core/base.service';
|
||||
import { EAFileUtil } from 'src/app/shared/utils/file.util';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class VehicleService extends BaseService {
|
||||
// 查询车辆认证表
|
||||
@ -35,28 +35,35 @@ export class VehicleService extends BaseService {
|
||||
// 审核司机挂靠协议(审核列表)
|
||||
$api_get_auditCarProtocal_audit = `/api/mdc/cuc/carLicenseAudit/operate/auditCarProtocal`;
|
||||
|
||||
|
||||
// 更新司机车辆审核信息(审核列表)
|
||||
$api_get_update_audit = `/api/mdc/cuc/carLicenseAudit/operate/update`;
|
||||
// 更新司机车辆审核信息
|
||||
$api_get_update= `/api/mdc/cuc/carLicense/operate/update`;
|
||||
$api_get_update = `/api/mdc/cuc/carLicense/operate/update`;
|
||||
|
||||
// 上传司机挂靠协议
|
||||
$api_get_upLoadCarProtocal= `/api/mdc/cuc/carLicenseAudit/operate/upLoadCarProtocal`;
|
||||
$api_get_upLoadCarProtocal = `/api/mdc/cuc/carLicenseAudit/operate/upLoadCarProtocal`;
|
||||
|
||||
// 根据车牌号查询车辆信息(车辆认证表)
|
||||
$api_get_getCarLicenseListByCarNo= `/api/mdc/cuc/carLicense/findCarLicenseByCarNo`;
|
||||
$api_get_getCarLicenseListByCarNo = `/api/mdc/cuc/carLicense/findCarLicenseByCarNo`;
|
||||
// /api/mdc/cuc/carLicense/findCarLicenseByCarNo
|
||||
// 根据车牌号查询车辆信息(车辆审核认证表)
|
||||
$api_get_getCarLicenseListByCarNo_audit= `/api/mdc/cuc/carLicenseAudit/operate/findCarLicenseAuditListByCarNo`;
|
||||
$api_get_getCarLicenseListByCarNo_audit = `/api/mdc/cuc/carLicenseAudit/operate/findCarLicenseAuditListByCarNo`;
|
||||
|
||||
// 导出(车辆认证表)
|
||||
$api_carLicense_export= `/api/mdc/cuc/carLicense/operate/export`;
|
||||
$api_carLicense_export = `/api/mdc/cuc/carLicense/operate/export`;
|
||||
// 导出(车辆审核认证表)
|
||||
$api_carLicenseAudit_export= `/api/mdc/cuc/carLicenseAudit/operate/export`;
|
||||
|
||||
|
||||
$api_carLicenseAudit_export = `/api/mdc/cuc/carLicenseAudit/operate/export`;
|
||||
|
||||
// 获取货主车辆信息
|
||||
$api_shipperCarGet = '/api/mdc/shipperCar/get';
|
||||
// 根据地区code查询列表
|
||||
$api_getRegionByCode = '/api/mdc/pbc/region/getRegionByCode';
|
||||
// 道路运输证识别
|
||||
$api_recognizeTransportationLicense = '/api/mdc/pbc/hwc/ocr/recognizeTransportationLicense';
|
||||
// 行驶证识别
|
||||
$api_recognizeVehicleLicense = '/api/mdc/pbc/hwc/ocr/recognizeVehicleLicense';
|
||||
// 保存货主车辆关联表
|
||||
$api_saveUpdateShipperCar = '/api/mdc/shipperCar/saveUpdateShipperCar';
|
||||
constructor(public injector: Injector) {
|
||||
super(injector);
|
||||
}
|
||||
|
||||
@ -10,6 +10,7 @@ import { NgModule } from '@angular/core';
|
||||
import { SharedModule } from '@shared';
|
||||
import { VehicleComponentsAuditComponent } from './components/audit/audit.component';
|
||||
import { VehicleComponentsAuditDetailComponent } from './components/audit/detail/detail.component';
|
||||
import { CarSettleCarauthComponent } from './components/list/carauth/carauth.component';
|
||||
import { VehicleComponentsListDetailComponent } from './components/list/detail/detail.component';
|
||||
import { VehicleComponentsListEditComponent } from './components/list/edit/edit.component';
|
||||
import { VehicleImgViewComponent } from './components/list/img-view/img-view.component';
|
||||
@ -24,6 +25,7 @@ const COMPONENTS = [
|
||||
VehicleImgViewComponent,
|
||||
VehicleComponentsAuditComponent,
|
||||
VehicleComponentsAuditDetailComponent,
|
||||
CarSettleCarauthComponent
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
|
||||
BIN
src/assets/images/vehicle/agree.png
Normal file
BIN
src/assets/images/vehicle/agree.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 336 KiB |
BIN
src/assets/images/vehicle/agreement.png
Normal file
BIN
src/assets/images/vehicle/agreement.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.4 KiB |
BIN
src/assets/images/vehicle/car.png
Normal file
BIN
src/assets/images/vehicle/car.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
BIN
src/assets/images/vehicle/driverback.png
Normal file
BIN
src/assets/images/vehicle/driverback.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 26 KiB |
BIN
src/assets/images/vehicle/driverfront.png
Normal file
BIN
src/assets/images/vehicle/driverfront.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 34 KiB |
BIN
src/assets/images/vehicle/road.png
Normal file
BIN
src/assets/images/vehicle/road.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 23 KiB |
Reference in New Issue
Block a user