seimin 2 年 前
コミット
f57fc8da0b
共有1 個のファイルを変更した32 個の追加3 個の削除を含む
  1. 32 3
      src/app/views/blood-products-config/blood-products-config.component.ts

+ 32 - 3
src/app/views/blood-products-config/blood-products-config.component.ts

@@ -28,6 +28,8 @@ export class BloodProductsConfigComponent implements OnInit {
28 28
   ];
29 29
   // 配置
30 30
   configs:any = {};
31
+  // 血制品任务类型
32
+  tasktype:any = {};
31 33
   constructor(private mainService: MainService,private tool: ToolService,private msg: NzMessageService) {}
32 34
 
33 35
   ngOnInit():void {
@@ -35,7 +37,6 @@ export class BloodProductsConfigComponent implements OnInit {
35 37
     this.getHandoverModes();
36 38
     this.getCheckModes();
37 39
     this.getCheckInModes();
38
-
39 40
   }
40 41
 
41 42
   // 切换tab
@@ -44,6 +45,10 @@ export class BloodProductsConfigComponent implements OnInit {
44 45
   }
45 46
   // 保存
46 47
   submitForm() {
48
+    if(!this.tasktype.id){
49
+      this.msg.create("warning", "请先配置血制品任务类型!");
50
+      return;
51
+    }
47 52
     if(!this.handoverMode){
48 53
       this.msg.create("warning", "请选择交接方式!");
49 54
       return;
@@ -57,7 +62,7 @@ export class BloodProductsConfigComponent implements OnInit {
57 62
     let closeTypeIds = this.automaticCustomsOrders.filter(v => v.checked).map(v => v.value).toString();
58 63
     let postData = {
59 64
       id: this.configs.id,
60
-      taskType: this.configs.taskType,
65
+      taskType: this.tasktype.id,
61 66
       hosId: this.hosId,
62 67
       autoCreate: this.autoCreateOrders[0].checked?1:0,
63 68
       handoverType: {id:this.handoverMode},
@@ -101,9 +106,33 @@ export class BloodProductsConfigComponent implements OnInit {
101 106
   getAutomaticCustomsOrders() {
102 107
     this.mainService.getDictionary("list", "ttconfig_close_type").subscribe((data) => {
103 108
       this.automaticCustomsOrders = data.map(v => ({label:v.name, value: v.id}));
104
-      this.getConfig();
109
+      this.getTaskType();
105 110
     });
106 111
   }
112
+  //获取任务类型
113
+  getTaskType() {
114
+    let postData = {
115
+      idx: 0,
116
+      sum: 10,
117
+      taskType: {
118
+        simpleQuery: true,
119
+        hosId: {
120
+          id: this.hosId
121
+        },
122
+        ordinaryField: {
123
+          value: 'blood'
124
+        }
125
+      }
126
+    };
127
+    this.mainService
128
+      .getFetchDataList("simple/data", "taskType", postData)
129
+      .subscribe((result) => {
130
+        if (result.status == 200) {
131
+          this.tasktype = result.list[0] || {};
132
+          this.getConfig();
133
+        }
134
+      });
135
+  }
107 136
   // 获取配置
108 137
   getConfig() {
109 138
     this.loading = true;