Explorar o código

Merge branch 'develop' into lmm

seimin %!s(int64=3) %!d(string=hai) anos
pai
achega
859fe22902
Modificáronse 1 ficheiros con 5 adicións e 10 borrados
  1. 5 10
      src/app/views/hushijiandan/hushijiandan.component.ts

+ 5 - 10
src/app/views/hushijiandan/hushijiandan.component.ts

@@ -996,23 +996,18 @@ export class HushijiandanComponent implements OnInit {
996
       .subscribe((data) => {
996
       .subscribe((data) => {
997
         that.checkTypeLis = data.data;
997
         that.checkTypeLis = data.data;
998
         // 默认选中患者陪检,没有患者陪检,则选择第一个患者其他服务的任务类型
998
         // 默认选中患者陪检,没有患者陪检,则选择第一个患者其他服务的任务类型
999
-        for (let i = 0; i < that.checkTypeLis.length; i++) {
999
+        let id;
1000
+        for (let i = that.checkTypeLis.length - 1; i >= 0; i--) {
1000
           if (that.checkTypeLis[i].associationType.value == "inspect") {
1001
           if (that.checkTypeLis[i].associationType.value == "inspect") {
1001
-            that.patientForm.controls.checkedType.setValue(
1002
-              that.checkTypeLis[i].id
1003
-            );
1004
-            that.patientForm.value.checkedType = that.checkTypeLis[i].id;
1002
+            id = that.checkTypeLis[i].id;
1005
             break;
1003
             break;
1006
           } else if (
1004
           } else if (
1007
             that.checkTypeLis[i].associationType.value == "patientTransport"
1005
             that.checkTypeLis[i].associationType.value == "patientTransport"
1008
           ) {
1006
           ) {
1009
-            that.patientForm.controls.checkedType.setValue(
1010
-              that.checkTypeLis[i].id
1011
-            );
1012
-            that.patientForm.value.checkedType = that.checkTypeLis[i].id;
1013
-            break;
1007
+            id = that.checkTypeLis[i].id;
1014
           }
1008
           }
1015
         }
1009
         }
1010
+        that.patientForm.controls.checkedType.setValue(id);
1016
         this.changeCheckedType();
1011
         this.changeCheckedType();
1017
       });
1012
       });
1018
   }
1013
   }