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
   configs:any = {};
30
   configs:any = {};
31
+  // 血制品任务类型
32
+  tasktype:any = {};
31
   constructor(private mainService: MainService,private tool: ToolService,private msg: NzMessageService) {}
33
   constructor(private mainService: MainService,private tool: ToolService,private msg: NzMessageService) {}
32
 
34
 
33
   ngOnInit():void {
35
   ngOnInit():void {
@@ -35,7 +37,6 @@ export class BloodProductsConfigComponent implements OnInit {
35
     this.getHandoverModes();
37
     this.getHandoverModes();
36
     this.getCheckModes();
38
     this.getCheckModes();
37
     this.getCheckInModes();
39
     this.getCheckInModes();
38
-
39
   }
40
   }
40
 
41
 
41
   // 切换tab
42
   // 切换tab
@@ -44,6 +45,10 @@ export class BloodProductsConfigComponent implements OnInit {
44
   }
45
   }
45
   // 保存
46
   // 保存
46
   submitForm() {
47
   submitForm() {
48
+    if(!this.tasktype.id){
49
+      this.msg.create("warning", "请先配置血制品任务类型!");
50
+      return;
51
+    }
47
     if(!this.handoverMode){
52
     if(!this.handoverMode){
48
       this.msg.create("warning", "请选择交接方式!");
53
       this.msg.create("warning", "请选择交接方式!");
49
       return;
54
       return;
@@ -57,7 +62,7 @@ export class BloodProductsConfigComponent implements OnInit {
57
     let closeTypeIds = this.automaticCustomsOrders.filter(v => v.checked).map(v => v.value).toString();
62
     let closeTypeIds = this.automaticCustomsOrders.filter(v => v.checked).map(v => v.value).toString();
58
     let postData = {
63
     let postData = {
59
       id: this.configs.id,
64
       id: this.configs.id,
60
-      taskType: this.configs.taskType,
65
+      taskType: this.tasktype.id,
61
       hosId: this.hosId,
66
       hosId: this.hosId,
62
       autoCreate: this.autoCreateOrders[0].checked?1:0,
67
       autoCreate: this.autoCreateOrders[0].checked?1:0,
63
       handoverType: {id:this.handoverMode},
68
       handoverType: {id:this.handoverMode},
@@ -101,9 +106,33 @@ export class BloodProductsConfigComponent implements OnInit {
101
   getAutomaticCustomsOrders() {
106
   getAutomaticCustomsOrders() {
102
     this.mainService.getDictionary("list", "ttconfig_close_type").subscribe((data) => {
107
     this.mainService.getDictionary("list", "ttconfig_close_type").subscribe((data) => {
103
       this.automaticCustomsOrders = data.map(v => ({label:v.name, value: v.id}));
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
   getConfig() {
137
   getConfig() {
109
     this.loading = true;
138
     this.loading = true;