seimin 2 years ago
parent
commit
44ab4ea8d8
1 changed files with 13 additions and 0 deletions
  1. 13 0
      src/app/views/hushijiandan/hushijiandan.component.ts

+ 13 - 0
src/app/views/hushijiandan/hushijiandan.component.ts

@@ -1941,6 +1941,19 @@ export class HushijiandanComponent implements OnInit {
1941 1941
   }
1942 1942
   // 是否加急
1943 1943
   allowUrgentChange(e) {
1944
+    // this.urgentReasonValidator = (control: FormControl): { [s: string]: boolean } => {
1945
+    //   if (e == 1) {
1946
+    //     return { required: true };
1947
+    //   }
1948
+    // };
1949
+    if (e == 0) {
1950
+      this.patientForm.get('urgentReason')!.clearValidators();
1951
+      this.patientForm.get('urgentReason')!.markAsPristine();
1952
+    } else {
1953
+      this.patientForm.get('urgentReason')!.setValidators(Validators.required);
1954
+      this.patientForm.get('urgentReason')!.markAsDirty();
1955
+    }
1956
+    this.patientForm.get('urgentReason')!.updateValueAndValidity();
1944 1957
     if (this.isYyInspect) {
1945 1958
       this.isYyInspect = e == 0;
1946 1959
       if (!this.isYyInspect) {