seimin 2 ヶ月 前
コミット
9676369c1e
共有1 個のファイルを変更した54 個の追加40 個の削除を含む
  1. 54 40
      src/app/views/hushijiandan/hushijiandan.component.ts

+ 54 - 40
src/app/views/hushijiandan/hushijiandan.component.ts

@@ -421,8 +421,10 @@ export class HushijiandanComponent implements OnInit {
421 421
 		  .getFetchDataList("simple/data", "taskTypeConfig", postData)
422 422
 		  .subscribe((result) => {
423 423
 		    if (result.status == 200) {
424
-					this.autoCreate = result.list[0].autoCreate;
425
-					this.pathologyFrozenSpecime = result.list[0].pathologyFrozenSpecimenNum;
424
+          if(Array.isArray(result.list) && result.list[0]){
425
+            this.autoCreate = result.list[0].autoCreate;
426
+					  this.pathologyFrozenSpecime = result.list[0].pathologyFrozenSpecimenNum;
427
+          }
426 428
 		    }
427 429
 		  });
428 430
 	}
@@ -1994,14 +1996,16 @@ export class HushijiandanComponent implements OnInit {
1994 1996
 				.subscribe((result) => {
1995 1997
 					let arr = result.start.start.list;
1996 1998
 					arr.forEach(i=>{
1997
-						i.inputcode = i.inputcode.toUpperCase()
1998
-						if(this.deptDisplay == 2){
1999
-							i.deptalias = i.deptalias + '('+i.inputcode+')'
2000
-						}else{
2001
-							i.dept = i.dept + '('+i.inputcode+')'
2002
-						}
1999
+            if(i.inputcode){
2000
+                i.inputcode = i.inputcode.toUpperCase()
2001
+              if(this.deptDisplay == 2){
2002
+                i.deptalias = i.deptalias + '('+i.inputcode+')'
2003
+              }else{
2004
+                i.dept = i.dept + '('+i.inputcode+')'
2005
+              }
2006
+            }
2003 2007
 					})
2004
-					
2008
+
2005 2009
 					if(key!=''){
2006 2010
 						if(this.deptDisplay ==2){
2007 2011
 							data = arr.filter(i=>i.deptalias.indexOf(key) !=-1)
@@ -2019,14 +2023,16 @@ export class HushijiandanComponent implements OnInit {
2019 2023
 				.subscribe((result) => {
2020 2024
 					let arr = result.end.end.list;
2021 2025
 					arr.forEach(i=>{
2022
-						i.inputcode = i.inputcode.toUpperCase()
2023
-						if(this.deptDisplay == 2){
2024
-							i.deptalias = i.deptalias + '('+i.inputcode+')'
2025
-						}else{
2026
-							i.dept = i.dept + '('+i.inputcode+')'
2027
-						}
2026
+            if(i.inputcode){
2027
+              i.inputcode = i.inputcode.toUpperCase()
2028
+              if(this.deptDisplay == 2){
2029
+                i.deptalias = i.deptalias + '('+i.inputcode+')'
2030
+              }else{
2031
+                i.dept = i.dept + '('+i.inputcode+')'
2032
+              }
2033
+            }
2028 2034
 					})
2029
-					
2035
+
2030 2036
 					if(key!=''){
2031 2037
 						if(this.deptDisplay ==2){
2032 2038
 							data = arr.filter(i=>i.deptalias.indexOf(key) !=-1)
@@ -2068,22 +2074,26 @@ export class HushijiandanComponent implements OnInit {
2068 2074
       .subscribe((data) => {
2069 2075
         if (type == "target") {
2070 2076
 					data.list.forEach(i=>{
2071
-						i.inputcode = i.inputcode.toUpperCase()
2072
-						if(this.deptDisplay == 2){
2073
-							i.deptalias = i.deptalias + '('+i.inputcode+')'
2074
-						}else{
2075
-							i.dept = i.dept + '('+i.inputcode+')'
2076
-						}
2077
+            if(i.inputcode){
2078
+              i.inputcode = i.inputcode.toUpperCase()
2079
+              if(this.deptDisplay == 2){
2080
+                i.deptalias = i.deptalias + '('+i.inputcode+')'
2081
+              }else{
2082
+                i.dept = i.dept + '('+i.inputcode+')'
2083
+              }
2084
+            }
2077 2085
 					})
2078 2086
           msg.end.end.list = data.list;
2079 2087
         } else if (type == "start") {
2080 2088
 					data.list.forEach(i=>{
2081
-						i.inputcode = i.inputcode.toUpperCase()
2082
-						if(this.deptDisplay == 2){
2083
-							i.deptalias = i.deptalias + '('+i.inputcode+')'
2084
-						}else{
2085
-							i.dept = i.dept + '('+i.inputcode+')'
2086
-						}
2089
+            if(i.inputcode){
2090
+              i.inputcode = i.inputcode.toUpperCase()
2091
+              if(this.deptDisplay == 2){
2092
+                i.deptalias = i.deptalias + '('+i.inputcode+')'
2093
+              }else{
2094
+                i.dept = i.dept + '('+i.inputcode+')'
2095
+              }
2096
+            }
2087 2097
 					})
2088 2098
           msg.start.start.list = data.list;
2089 2099
         }
@@ -3592,20 +3602,24 @@ export class HushijiandanComponent implements OnInit {
3592 3602
       .postCustom("nurse", "workOrder/buildTrip", postData)
3593 3603
       .subscribe((result) => {
3594 3604
 				result.start.start.list.forEach(i=>{
3595
-					i.inputcode = i.inputcode.toUpperCase()
3596
-					if(this.deptDisplay ==2){
3597
-						i.deptalias = i.deptalias + '('+i.inputcode+')'
3598
-					}else{
3599
-						i.dept = i.dept + '('+i.inputcode+')'
3600
-					}
3605
+          if(i.inputcode){
3606
+            i.inputcode = i.inputcode.toUpperCase()
3607
+            if(this.deptDisplay ==2){
3608
+              i.deptalias = i.deptalias + '('+i.inputcode+')'
3609
+            }else{
3610
+              i.dept = i.dept + '('+i.inputcode+')'
3611
+            }
3612
+          }
3601 3613
 				})
3602 3614
 				result.end.end.list.forEach(i=>{
3603
-					i.inputcode = i.inputcode.toUpperCase()
3604
-					if(this.deptDisplay ==2){
3605
-						i.deptalias = i.deptalias + '('+i.inputcode+')'
3606
-					}else{
3607
-						i.dept = i.dept + '('+i.inputcode+')'
3608
-					}
3615
+          if(i.inputcode){
3616
+            i.inputcode = i.inputcode.toUpperCase()
3617
+            if(this.deptDisplay ==2){
3618
+              i.deptalias = i.deptalias + '('+i.inputcode+')'
3619
+            }else{
3620
+              i.dept = i.dept + '('+i.inputcode+')'
3621
+            }
3622
+          }
3609 3623
 				})
3610 3624
         this.buildMsg = result;
3611 3625
 				if(result.end){