|
@@ -0,0 +1,190 @@
|
|
1
|
+import { Component, OnInit } from "@angular/core";
|
|
2
|
+import { MainService } from 'src/app/services/main.service';
|
|
3
|
+import { ToolService } from 'src/app/services/tool.service';
|
|
4
|
+import { NzMessageService } from 'ng-zorro-antd';
|
|
5
|
+
|
|
6
|
+@Component({
|
|
7
|
+ selector: "app-inspect-and-patient-transport-config",
|
|
8
|
+ templateUrl: "./inspect-and-patient-transport-config.component.html",
|
|
9
|
+ styleUrls: ["./inspect-and-patient-transport-config.component.less"],
|
|
10
|
+})
|
|
11
|
+export class InspectAndPatientTransportConfigComponent implements OnInit {
|
|
12
|
+ loading:boolean = false; //页面加载的loading
|
|
13
|
+ btnLoading:boolean = false; //提交按钮的loading
|
|
14
|
+ tabModalName:string = 'characteristics'; //当前选中的tab
|
|
15
|
+ hosId = this.tool.getCurrentHospital().id; //当前院区
|
|
16
|
+ // 交接方式
|
|
17
|
+ // handoverMode:any;
|
|
18
|
+ // handoverModes:any[] = [];
|
|
19
|
+ // 核对方式
|
|
20
|
+ // checkModes:any[] = [];
|
|
21
|
+ // 签到方式
|
|
22
|
+ checkInModes:any[] = [];
|
|
23
|
+ // 自动关单
|
|
24
|
+ // automaticCustomsOrders:any[] = [];
|
|
25
|
+ // 自动建单
|
|
26
|
+ // autoCreateOrders:any[] = [
|
|
27
|
+ // {label:'是否开启',value: 0}
|
|
28
|
+ // ];
|
|
29
|
+ // 是否根据开通科室建单
|
|
30
|
+ // autoDepts:any[] = [
|
|
31
|
+ // {label:'是否根据开通科室建单',value: 0}
|
|
32
|
+ // ];
|
|
33
|
+ // 配置
|
|
34
|
+ configs:any = {};
|
|
35
|
+ // 任务类型
|
|
36
|
+ tasktype:any = {};
|
|
37
|
+ constructor(private mainService: MainService,private tool: ToolService,private msg: NzMessageService) {}
|
|
38
|
+
|
|
39
|
+ ngOnInit():void {
|
|
40
|
+ // todo
|
|
41
|
+ // this.getHandoverModes();
|
|
42
|
+ // this.getCheckModes();
|
|
43
|
+ this.getCheckInModes();
|
|
44
|
+ }
|
|
45
|
+
|
|
46
|
+ // 切换tab
|
|
47
|
+ tabModal(tabModalName:string){
|
|
48
|
+ this.tabModalName = tabModalName;
|
|
49
|
+ }
|
|
50
|
+ // 修改是否自动建单
|
|
51
|
+ // changeAutoCreateOrders(e){
|
|
52
|
+ // console.log(e);
|
|
53
|
+ // if(!e[0].checked){
|
|
54
|
+ // this.autoDepts[0].checked = false;
|
|
55
|
+ // }
|
|
56
|
+ // }
|
|
57
|
+ // 保存
|
|
58
|
+ submitForm() {
|
|
59
|
+ if(!this.tasktype.id){
|
|
60
|
+ this.msg.create("warning", "请先配置患者陪检任务类型!");
|
|
61
|
+ return;
|
|
62
|
+ }
|
|
63
|
+ // if(!this.handoverMode){
|
|
64
|
+ // this.msg.create("warning", "请选择交接方式!");
|
|
65
|
+ // return;
|
|
66
|
+ // }
|
|
67
|
+ // if(!this.radioCheckModesValue){
|
|
68
|
+ // this.msg.create("warning", "请选择核对方式!");
|
|
69
|
+ // return;
|
|
70
|
+ // }
|
|
71
|
+ let signTypeIds = this.checkInModes.filter(v => v.checked).map(v => v.value).toString();
|
|
72
|
+ // let closeTypeIds = this.automaticCustomsOrders.filter(v => v.checked).map(v => v.value).toString();
|
|
73
|
+ let postData:any = {
|
|
74
|
+ id: this.configs.id,
|
|
75
|
+ taskType: this.tasktype.id,
|
|
76
|
+ hosId: this.hosId,
|
|
77
|
+ // autoCreate: this.autoCreateOrders[0].checked ? 1 : 0,
|
|
78
|
+ // autoDept: this.autoDepts[0].checked ? 1 : 0,
|
|
79
|
+ // handoverType: {id: this.handoverMode},
|
|
80
|
+ // checkType: {id: this.radioCheckModesValue},
|
|
81
|
+ signTypeIds: signTypeIds || undefined,
|
|
82
|
+ // closeTypeIds: closeTypeIds || undefined,
|
|
83
|
+ };
|
|
84
|
+ this.btnLoading = true;
|
|
85
|
+ this.mainService
|
|
86
|
+ .simplePost("addData", "taskTypeConfig", postData)
|
|
87
|
+ .subscribe((result) => {
|
|
88
|
+ this.btnLoading = false;
|
|
89
|
+ if (result.status == 200) {
|
|
90
|
+ this.getConfig();
|
|
91
|
+ }
|
|
92
|
+ });
|
|
93
|
+ }
|
|
94
|
+
|
|
95
|
+ //获取交接方式
|
|
96
|
+ // getHandoverModes() {
|
|
97
|
+ // this.mainService.getDictionary("list", "ttconfig_handover_type").subscribe((data) => {
|
|
98
|
+ // this.handoverModes = data;
|
|
99
|
+ // this.handoverMode = data[0].id;
|
|
100
|
+ // });
|
|
101
|
+ // }
|
|
102
|
+ //获取核对方式
|
|
103
|
+ // getCheckModes() {
|
|
104
|
+ // this.mainService.getDictionary("list", "ttconfig_check_type").subscribe((data) => {
|
|
105
|
+ // this.checkModes = data.map(v => ({label:v.name, value: v.id}));
|
|
106
|
+ // });
|
|
107
|
+ // }
|
|
108
|
+ //获取签到方式
|
|
109
|
+ getCheckInModes() {
|
|
110
|
+ this.loading = true;
|
|
111
|
+ this.mainService.getDictionary("list", "inspect_config_sign_type").subscribe((data) => {
|
|
112
|
+ this.checkInModes = data.map(v => ({label:v.name, value: v.id}));
|
|
113
|
+ // this.getAutomaticCustomsOrders();
|
|
114
|
+ this.getTaskType();
|
|
115
|
+ });
|
|
116
|
+ }
|
|
117
|
+ //获取自动关单
|
|
118
|
+ // getAutomaticCustomsOrders() {
|
|
119
|
+ // this.mainService.getDictionary("list", "ttconfig_close_type").subscribe((data) => {
|
|
120
|
+ // this.automaticCustomsOrders = data.map(v => ({label:v.name, value: v.id}));
|
|
121
|
+ // this.getTaskType();
|
|
122
|
+ // });
|
|
123
|
+ // }
|
|
124
|
+ //获取任务类型
|
|
125
|
+ getTaskType() {
|
|
126
|
+ let postData = {
|
|
127
|
+ idx: 0,
|
|
128
|
+ sum: 10,
|
|
129
|
+ taskType: {
|
|
130
|
+ simpleQuery: true,
|
|
131
|
+ hosId: {
|
|
132
|
+ id: this.hosId
|
|
133
|
+ },
|
|
134
|
+ associationType: {
|
|
135
|
+ key:"association_types",
|
|
136
|
+ value: 'inspect'
|
|
137
|
+ }
|
|
138
|
+ }
|
|
139
|
+ };
|
|
140
|
+ this.mainService
|
|
141
|
+ .getFetchDataList("simple/data", "taskType", postData)
|
|
142
|
+ .subscribe((result) => {
|
|
143
|
+ if (result.status == 200) {
|
|
144
|
+ this.tasktype = result.list[0] || {};
|
|
145
|
+ this.getConfig();
|
|
146
|
+ }
|
|
147
|
+ });
|
|
148
|
+ }
|
|
149
|
+ // 获取配置
|
|
150
|
+ // radioCheckModesValue = '';
|
|
151
|
+ getConfig() {
|
|
152
|
+ this.loading = true;
|
|
153
|
+ let postData = {
|
|
154
|
+ idx: 0,
|
|
155
|
+ sum: 10,
|
|
156
|
+ taskTypeConfig: {
|
|
157
|
+ taskTypeDTO: {
|
|
158
|
+ hosId: {
|
|
159
|
+ id: this.hosId
|
|
160
|
+ },
|
|
161
|
+ associationType: this.tasktype.associationType
|
|
162
|
+ }
|
|
163
|
+ }
|
|
164
|
+ };
|
|
165
|
+ this.mainService
|
|
166
|
+ .getFetchDataList("simple/data", "taskTypeConfig", postData)
|
|
167
|
+ .subscribe((result) => {
|
|
168
|
+ this.loading = false;
|
|
169
|
+ if (result.status == 200) {
|
|
170
|
+ this.configs = result.list[0] || {};
|
|
171
|
+ // this.handoverMode = this.configs.handoverType?this.configs.handoverType.id:undefined;
|
|
172
|
+ // this.radioCheckModesValue = this.configs.checkType.id;
|
|
173
|
+ // this.autoCreateOrders[0].checked = this.configs.autoCreate == 1;
|
|
174
|
+ // this.autoDepts[0].checked = this.configs.autoDept == 1;
|
|
175
|
+
|
|
176
|
+ if(this.configs.signTypeIds){
|
|
177
|
+ let ids = this.configs.signTypeIds.split(',');
|
|
178
|
+ this.checkInModes = this.checkInModes.map(v => ({...v, checked: ids.includes(v.value.toString())}));
|
|
179
|
+ }
|
|
180
|
+
|
|
181
|
+ // if(this.configs.closeTypeIds){
|
|
182
|
+ // let ids = this.configs.closeTypeIds.split(',');
|
|
183
|
+ // this.automaticCustomsOrders = this.automaticCustomsOrders.map(v => ({...v, checked: ids.includes(v.value.toString())}));
|
|
184
|
+ // }
|
|
185
|
+ }
|
|
186
|
+ });
|
|
187
|
+ }
|
|
188
|
+}
|
|
189
|
+
|
|
190
|
+
|