This commit is contained in:
wangshiming
2022-05-07 17:23:01 +08:00
parent 91bc1f23e7
commit 5206b4a0c2
7 changed files with 61 additions and 17 deletions

View File

@ -56,6 +56,7 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
maxTrainNumber: 99999,
maxFreight: 9999999
};
patternStr = `^((13[0-9])|(14[0-1,4-9])|(15([0-3,5-9]))|(17[0-8])|(18[0-9])|(19[0-3,5-9])|(16[2,5,6,7]))\\d{8}$`;
constructor(
private http: _HttpClient,
fb: FormBuilder,
@ -69,10 +70,10 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
this.validateForm1 = fb.group({
loadAddress0: [null, [Validators.required]],
loadName0: [null, [Validators.required]],
loadPhone0: [null, [Validators.required, Validators.pattern('^[0-9]*$')]],
loadPhone0: [null, [Validators.required, Validators.pattern(this.patternStr)]],
unloadAddress0: [null, [Validators.required]],
unloadName0: [null, [Validators.required]],
unloadPhone0: [null, [Validators.required, Validators.pattern('^[0-9]*$')]]
unloadPhone0: [null, [Validators.required, Validators.pattern(this.patternStr)]]
});
}
@ViewChild('sf1', { static: false }) sf1!: SFComponent;
@ -1170,4 +1171,17 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
}
});
}
onChangePhone(value: string): void {
console.log(value);
this.updateValue(value);
}
updateValue(value: string): void {
const reg = /^-?(0|[1-9][0-9]*)(\.[0-9]*)?$/;
// if ((!isNaN(+value) && reg.test(value)) || value === '' || value === '-') {
// this.value = value;
// }
// this.inputElement!.nativeElement.value = this.value;
// this.updateTitle();
}
}