|
@@ -30,6 +30,12 @@ export class BloodProductsConfigComponent implements OnInit {
|
30
|
30
|
autoDepts:any[] = [
|
31
|
31
|
{label:'是否根据开通科室建单',value: 0}
|
32
|
32
|
];
|
|
33
|
+ // 是否根据起点科室建单
|
|
34
|
+ autoDeptLimits:any[] = [
|
|
35
|
+ {label:'是否根据起点科室建单',value: 0}
|
|
36
|
+ ];
|
|
37
|
+ // 选择起点科室
|
|
38
|
+ limitDeptIds:any = [];
|
33
|
39
|
// 配置
|
34
|
40
|
configs:any = {};
|
35
|
41
|
// 血制品任务类型
|
|
@@ -43,6 +49,42 @@ export class BloodProductsConfigComponent implements OnInit {
|
43
|
49
|
this.getCheckInModes();
|
44
|
50
|
}
|
45
|
51
|
|
|
52
|
+ deptList = []; //科室列表
|
|
53
|
+ dLoading = false;
|
|
54
|
+ dSearchText = '';
|
|
55
|
+ //获取科室列表
|
|
56
|
+ getDeptList(flag?, search = "", isInit = false) {
|
|
57
|
+ if (!flag) {
|
|
58
|
+ return;
|
|
59
|
+ }
|
|
60
|
+ let hosIds = this.hosId;
|
|
61
|
+ let postData = {
|
|
62
|
+ idx: 0,
|
|
63
|
+ sum: 9999,
|
|
64
|
+ department: { hospital: { id: hosIds }, dept: search, searchType: 1 },
|
|
65
|
+ };
|
|
66
|
+ this.dLoading = true;
|
|
67
|
+ this.dSearchText = search;
|
|
68
|
+ this.mainService
|
|
69
|
+ .getFetchDataList("data", "department", postData)
|
|
70
|
+ .subscribe((data) => {
|
|
71
|
+ if (this.dSearchText == search) {
|
|
72
|
+ this.dLoading = false;
|
|
73
|
+ if (data.status == 200) {
|
|
74
|
+ this.deptList = data.list;
|
|
75
|
+ if(isInit){
|
|
76
|
+ this.limitDeptIds = this.configs.limitDeptIds ? this.configs.limitDeptIds.split(',') : [];
|
|
77
|
+ }
|
|
78
|
+ }
|
|
79
|
+ }
|
|
80
|
+ });
|
|
81
|
+ }
|
|
82
|
+
|
|
83
|
+ // 搜索科室列表
|
|
84
|
+ searchDeptList(e) {
|
|
85
|
+ this.getDeptList(true, e);
|
|
86
|
+ }
|
|
87
|
+
|
46
|
88
|
// 切换tab
|
47
|
89
|
tabModal(tabModalName:string){
|
48
|
90
|
this.tabModalName = tabModalName;
|
|
@@ -52,10 +94,20 @@ export class BloodProductsConfigComponent implements OnInit {
|
52
|
94
|
console.log(e);
|
53
|
95
|
if(!e[0].checked){
|
54
|
96
|
this.autoDepts[0].checked = false;
|
|
97
|
+ this.autoDeptLimits[0].checked = false;
|
|
98
|
+ this.limitDeptIds = [];
|
|
99
|
+ }
|
|
100
|
+ }
|
|
101
|
+ // 修改changeAutoDeptLimits
|
|
102
|
+ changeAutoDeptLimits(e){
|
|
103
|
+ console.log(e);
|
|
104
|
+ if(!e[0].checked){
|
|
105
|
+ this.limitDeptIds = [];
|
55
|
106
|
}
|
56
|
107
|
}
|
57
|
108
|
// 保存
|
58
|
109
|
submitForm() {
|
|
110
|
+ console.log(this.limitDeptIds)
|
59
|
111
|
if(!this.tasktype.id){
|
60
|
112
|
this.msg.create("warning", "请先配置血制品任务类型!");
|
61
|
113
|
return;
|
|
@@ -68,6 +120,10 @@ export class BloodProductsConfigComponent implements OnInit {
|
68
|
120
|
this.msg.create("warning", "请选择核对方式!");
|
69
|
121
|
return;
|
70
|
122
|
}
|
|
123
|
+ if(this.autoDeptLimits[0].checked && !this.limitDeptIds.length){
|
|
124
|
+ this.msg.create("warning", "请选择起点科室!");
|
|
125
|
+ return;
|
|
126
|
+ }
|
71
|
127
|
let signTypeIds = this.checkInModes.filter(v => v.checked).map(v => v.value).toString();
|
72
|
128
|
let closeTypeIds = this.automaticCustomsOrders.filter(v => v.checked).map(v => v.value).toString();
|
73
|
129
|
let postData:any = {
|
|
@@ -76,11 +132,14 @@ export class BloodProductsConfigComponent implements OnInit {
|
76
|
132
|
hosId: this.hosId,
|
77
|
133
|
autoCreate: this.autoCreateOrders[0].checked ? 1 : 0,
|
78
|
134
|
autoDept: this.autoDepts[0].checked ? 1 : 0,
|
|
135
|
+ autoDeptLimit: this.autoDeptLimits[0].checked ? 1 : 0,
|
|
136
|
+ limitDeptIds: String(this.limitDeptIds),
|
79
|
137
|
handoverType: {id: this.handoverMode},
|
80
|
138
|
checkType: {id: this.radioCheckModesValue},
|
81
|
139
|
signTypeIds: signTypeIds || undefined,
|
82
|
140
|
closeTypeIds: closeTypeIds || undefined,
|
83
|
141
|
};
|
|
142
|
+ console.log(postData);
|
84
|
143
|
this.btnLoading = true;
|
85
|
144
|
this.mainService
|
86
|
145
|
.simplePost("addData", "taskTypeConfig", postData)
|
|
@@ -174,6 +233,8 @@ export class BloodProductsConfigComponent implements OnInit {
|
174
|
233
|
this.radioCheckModesValue = this.configs.checkType.id;
|
175
|
234
|
this.autoCreateOrders[0].checked = this.configs.autoCreate == 1;
|
176
|
235
|
this.autoDepts[0].checked = this.configs.autoDept == 1;
|
|
236
|
+ this.autoDeptLimits[0].checked = this.configs.autoDeptLimit == 1;
|
|
237
|
+ this.getDeptList(true, '', true);
|
177
|
238
|
|
178
|
239
|
if(this.configs.signTypeIds){
|
179
|
240
|
let ids = this.configs.signTypeIds.split(',');
|