|
@@ -95,6 +95,10 @@ export class TabCustomComponent implements OnInit {
|
95
|
95
|
.getFetchDataList("simple/data", "tabPermission", data)
|
96
|
96
|
.subscribe((data) => {
|
97
|
97
|
this.loading1 = false;
|
|
98
|
+ data.list = data.list || [];
|
|
99
|
+ data.list.forEach(v => {
|
|
100
|
+ v.taskNames = v.taskTypeList.map(v=>v.taskTypeDTO.taskName).toString()
|
|
101
|
+ })
|
98
|
102
|
this.listOfData = data.list;
|
99
|
103
|
this.listLength = data.totalNum;
|
100
|
104
|
});
|
|
@@ -105,7 +109,7 @@ export class TabCustomComponent implements OnInit {
|
105
|
109
|
let hid = this.tool.getCurrentHospital().id;
|
106
|
110
|
let postData = {
|
107
|
111
|
taskType: {
|
108
|
|
- hosIds: hid,
|
|
112
|
+ cascadeHosId: hid,
|
109
|
113
|
taskName: keywords,
|
110
|
114
|
simpleQuery: true,
|
111
|
115
|
associationType: {
|
|
@@ -114,7 +118,7 @@ export class TabCustomComponent implements OnInit {
|
114
|
118
|
}
|
115
|
119
|
},
|
116
|
120
|
idx: 0,
|
117
|
|
- sum: 10,
|
|
121
|
+ sum: 9999,
|
118
|
122
|
};
|
119
|
123
|
this.isLoading = true;
|
120
|
124
|
this.mainService.getFetchDataList("configuration", "taskType", postData).subscribe((res) => {
|
|
@@ -153,22 +157,31 @@ export class TabCustomComponent implements OnInit {
|
153
|
157
|
}
|
154
|
158
|
if (this.validateForm.invalid) return;
|
155
|
159
|
this.btnLoading = true;
|
|
160
|
+ let taskTypeList = [];
|
|
161
|
+ this.validateForm.value.taskTypeList.forEach(v => {
|
|
162
|
+ this.otherTasktypeList.forEach(vv => {
|
|
163
|
+ if(v == vv.id){
|
|
164
|
+ taskTypeList.push({
|
|
165
|
+ taskTypeId: vv.id,
|
|
166
|
+ hosId: vv.hosId ? vv.hosId.id : undefined,
|
|
167
|
+ typeParentHosid: vv.hosId.parent ? vv.hosId.parent.id : undefined,
|
|
168
|
+ })
|
|
169
|
+ }
|
|
170
|
+ })
|
|
171
|
+ })
|
156
|
172
|
let data = {
|
157
|
|
- tabPermission: {
|
158
|
|
- title: this.validateForm.value.title,
|
159
|
|
- orders: this.validateForm.value.orders,
|
160
|
|
- hosId: this.hosId,
|
161
|
|
- deleteFlag: 0,
|
162
|
|
- // taskTypeList: this.validateForm.value.taskTypeList
|
163
|
|
- },
|
|
173
|
+ title: this.validateForm.value.title,
|
|
174
|
+ orders: this.validateForm.value.orders,
|
|
175
|
+ hosId: this.hosId,
|
|
176
|
+ deleteFlag: 0,
|
|
177
|
+ taskTypeList
|
164
|
178
|
};
|
165
|
179
|
if (!this.add) {
|
166
|
|
- data.tabPermission["id"] = this.coopId;
|
|
180
|
+ data = {...this.coopData, ...data};
|
167
|
181
|
}
|
168
|
182
|
console.log(data);
|
169
|
|
- return;
|
170
|
183
|
this.mainService
|
171
|
|
- .coopData("addData", "tabPermission", data)
|
|
184
|
+ .simplePost("addData", "tabPermission", data)
|
172
|
185
|
.subscribe((data) => {
|
173
|
186
|
this.btnLoading = false;
|
174
|
187
|
this.hideModal();
|
|
@@ -183,12 +196,16 @@ export class TabCustomComponent implements OnInit {
|
183
|
196
|
|
184
|
197
|
// 编辑
|
185
|
198
|
maskFlag: any = false;
|
|
199
|
+ coopData = {};
|
186
|
200
|
edit(data) {
|
187
|
201
|
this.validateForm.controls.title.setValue(data.title);
|
188
|
202
|
this.validateForm.controls.orders.setValue(data.orders);
|
|
203
|
+ this.validateForm.controls.taskTypeList.setValue(Array.isArray(data.taskTypeList) ? data.taskTypeList.map(v => +v.taskTypeId) : []);
|
189
|
204
|
this.modal = true;
|
190
|
205
|
this.add = false;
|
191
|
206
|
this.coopId = data.id;
|
|
207
|
+ this.coopData = data;
|
|
208
|
+ this.getOtherTasktype();
|
192
|
209
|
}
|
193
|
210
|
|
194
|
211
|
// 删除
|
|
@@ -199,10 +216,13 @@ export class TabCustomComponent implements OnInit {
|
199
|
216
|
}
|
200
|
217
|
// 确认删除
|
201
|
218
|
confirmDel() {
|
202
|
|
- return;
|
203
|
219
|
this.btnLoading = true;
|
204
|
220
|
this.mainService
|
205
|
|
- .rmvDataAndWeChatNum([this.coopId], true)
|
|
221
|
+ .simplePost(
|
|
222
|
+ "rmvData",
|
|
223
|
+ "tabPermission",
|
|
224
|
+ [this.coopId]
|
|
225
|
+ )
|
206
|
226
|
.subscribe((data) => {
|
207
|
227
|
this.btnLoading = false;
|
208
|
228
|
this.hideDelModal();
|