This commit is contained in:
wangshiming
2022-03-24 14:20:58 +08:00
parent 5d60e80783
commit 0dd36d8c7f
2 changed files with 63 additions and 40 deletions

View File

@ -1,7 +1,17 @@
<!--
* @Description :
* @Version : 1.0
* @Author : Shiming
* @Date : 2022-03-14 14:17:38
* @LastEditors : Shiming
* @LastEditTime : 2022-03-24 14:17:55
* @FilePath : \\tms-obc-web\\src\\app\\routes\\usercenter\\components\\driver\\captain\\add\\add.component.html
* Copyright (C) 2022 huzhenhong. All rights reserved.
-->
<div class="modal-header">
<div class="modal-title">添加车队长</div>
</div>
<div>
<div [ngClass]="i.id || readFlag ? 'hideBtn' : ''">
<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">
@ -24,7 +34,6 @@
</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>
<button nz-button type="button" (click)="close()">取消</button>
<button nz-button type="button" nzType="primary" (click)="sure()" [disabled]="!sf?.valid" [nzLoading]="service.http.loading">确定</button>
</div>

View File

@ -90,12 +90,13 @@ export class CtcCaptatinAddComponent implements OnInit {
widget: this.i.id ? 'text' : '',
placeholder: '请输入手机号',
blur: () => {
if(this.sf?.value?.mobile) {
if(!this.sf.value.mobile) {
return
}
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,
@ -109,28 +110,41 @@ export class CtcCaptatinAddComponent implements OnInit {
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,
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 = {}
this.detailData = {
mobile: this.sf.value.mobile,
bankName: this.sf.value.bankName,
bankCardNo: this.sf.value.bankCardNo,
remark: this.sf.value.remark,
identityInfoDTO: {
certificatePhotoFrontWatermark: '',
certificatePhotoBackWatermark: '',
name: '',
certificateNumber: '',
certificatePhotoFront: '',
certificatePhotoBack: '',
}
}
this.initSF()
}
})
}
}
}
},
default: this.detailData.mobile
},
@ -138,7 +152,7 @@ export class CtcCaptatinAddComponent implements OnInit {
title: '姓名',
type: 'string',
ui: {
widget: this.i.id ? 'text' : '',
widget: this.i.id && (this.i.driverLicenseStatus === 10 || this.i.driverLicenseStatus === 20) ? 'text' : '',
placeholder: '请输入姓名',
},
readOnly: this.readFlag,
@ -147,12 +161,11 @@ export class CtcCaptatinAddComponent implements OnInit {
bankCardNo: {
title: '银行卡号',
type: 'string',
maxLength: 20,
ui: {
widget: this.i.id ? 'text' : '',
widget: '',
placeholder: '请输入银行卡号',
change: (val: any) =>{
const value = val.replace(/\D/g,'')
change: (val: any) => {
const value = val.replace(/\D/g, '')
this.sf.setValue('/bankCardNo', value)
},
errors: {
@ -164,9 +177,8 @@ export class CtcCaptatinAddComponent implements OnInit {
bankName: {
title: '开户行',
type: 'string',
maxLength: 35,
ui: {
widget: this.i.id ? 'text' : '',
widget: '',
placeholder: '请输入开户行',
},
default: this.detailData.bankName
@ -178,7 +190,7 @@ export class CtcCaptatinAddComponent implements OnInit {
ui: {
widget: 'textarea',
showRequired: true,
borderless:true,
borderless: true,
},
default: '请上传身份证原件的高清照片,若上传复印件,则需加盖公司印章及法人签字;上传后系统会自动识别并填写',
},
@ -193,11 +205,11 @@ export class CtcCaptatinAddComponent implements OnInit {
certificatePhotoFrontWatermark: {
type: 'string',
title: '',
readOnly: this.i.id || this.readFlag,
readOnly: (this.i.id && (this.i.driverLicenseStatus === 10 || this.i.driverLicenseStatus === 20)) || this.readFlag,
ui: {
offsetControl: 6,
action: apiConf.fileUpload,
fileType: 'image/png,image/jpeg,image/jpg,image/gif',
accept: 'image/png,image/jpeg,image/jpg,image/gif',
limit: 1,
limitFileCount: 1,
resReName: 'data.fullFileWatermarkPath',
@ -212,10 +224,10 @@ export class CtcCaptatinAddComponent implements OnInit {
listType: 'picture-card',
change: (args: any) => {
if (args.type === 'success') {
this.detailData.certificatePhotoFront = args.file.response.data.fullFilePath
this.detailData.identityInfoDTO.certificatePhotoFront = args.file.response.data.fullFilePath
this.checkIdCard(args.file.response.data.fullFilePath, 'front');
} else {
this.detailData.certificatePhotoFront = ''
this.detailData.identityInfoDTO.certificatePhotoFront = ''
}
},
beforeUpload: (file: any, _fileList: any) => {
@ -230,6 +242,7 @@ export class CtcCaptatinAddComponent implements OnInit {
observer.complete();
});
},
previewFile: (file: any) => { }
},
default: this.detailData.identityInfoDTO.certificatePhotoFrontWatermark
},
@ -244,11 +257,11 @@ export class CtcCaptatinAddComponent implements OnInit {
certificatePhotoBackWatermark: {
type: 'string',
title: '',
readOnly: this.i.id || this.readFlag,
readOnly: (this.i.id && (this.i.driverLicenseStatus === 10 || this.i.driverLicenseStatus === 20)) || this.readFlag,
ui: {
offsetControl: 6,
action: apiConf.fileUpload,
fileType: 'image/png,image/jpeg,image/jpg,image/gif',
accept: 'image/png,image/jpeg,image/jpg,image/gif',
limit: 1,
limitFileCount: 1,
resReName: 'data.fullFileWatermarkPath',
@ -263,9 +276,9 @@ export class CtcCaptatinAddComponent implements OnInit {
listType: 'picture-card',
change: (args: any) => {
if (args.type === 'success') {
this.detailData.certificatePhotoBack = args.file.response.data.fullFilePath
this.detailData.identityInfoDTO.certificatePhotoBack = args.file.response.data.fullFilePath
} else {
this.detailData.certificatePhotoBack = ''
this.detailData.identityInfoDTO.certificatePhotoBack = ''
}
},
beforeUpload: (file: any, _fileList: any) => {
@ -280,15 +293,16 @@ export class CtcCaptatinAddComponent implements OnInit {
observer.complete();
});
},
previewFile: (file: any) => { }
},
default: this.detailData.identityInfoDTO.certificatePhotoBackWatermark
},
certificateNumber: {
title: '身份证号',
type: 'string',
readOnly: this.readFlag,
readOnly: (this.i.id && (this.i.driverLicenseStatus === 10 || this.i.driverLicenseStatus === 20)) || this.readFlag,
ui: {
widget: this.i.id ? 'text' : '',
widget: this.i.id && (this.i.driverLicenseStatus !== 10 && this.i.driverLicenseStatus !== 20) ? 'text' : '',
placeholder: '请输入身份证号',
},
default: this.detailData.identityInfoDTO.certificateNumber
@ -298,7 +312,7 @@ export class CtcCaptatinAddComponent implements OnInit {
type: 'string',
maxLength: 100,
ui: {
widget: this.i.id ? 'text' : 'textarea',
widget: 'textarea',
placeholder: '请输入备注',
autosize: { minRows: 2, maxRows: 6 },
},