seimin 7 miesięcy temu
rodzic
commit
4dde731b16

+ 1 - 1
proxy.conf.json

@@ -1,6 +1,6 @@
1 1
 {
2 2
   "/service": {
3
-		"target": "http://192.168.3.108",
3
+		"target": "http://192.168.4.105",
4 4
     "logLevel": "debug",
5 5
     "changeOrigin": true,
6 6
     "pathRewrite": {

+ 90 - 0
src/app/components/order-scope/order-scope.component.html

@@ -0,0 +1,90 @@
1
+<!-- 工单范围 -->
2
+<div class="init recallOrder display_flex justify-content_flex-center align-items_center">
3
+  <div class="con modalBody">
4
+    <div class="title">
5
+      工单范围<i class="icon_transport transport-guanbi" (click)="cancelInit()"></i>
6
+    </div>
7
+    <div class="content">
8
+      <div class="scopeTab">
9
+        <div class="scopeTabItem" [ngClass]="{ active: item.value == activeScopeTabValue }" *ngFor="let item of scopeTabs" (click)="activeScopeTabValue = item.value">{{item.name}}</div>
10
+      </div>
11
+      <div class="conditions" *ngIf="activeScopeTabValue == 1">
12
+        <div nz-row>
13
+          <div nz-col nzSpan="3">院区:</div>
14
+          <div nz-col nzSpan="21">
15
+            <nz-checkbox-group class="w100" style="display: flex; flex-wrap: wrap; gap:8px;" [(ngModel)]="itsmCheckedHos" (ngModelChange)="changeItsmHospital($event)"></nz-checkbox-group>
16
+          </div>
17
+        </div>
18
+        <div nz-row>
19
+          <div nz-col nzSpan="3">人员分组:</div>
20
+          <div nz-col nzSpan="21">
21
+            <label class="checkAll mb8" nz-checkbox *ngIf="itsmCheckedGroup.length" [(ngModel)]="isAllItsmGroupChecked" (ngModelChange)="updateAllItsmGroupChecked()">
22
+              全选
23
+            </label>
24
+            <nz-checkbox-group class="w100" style="display: flex; flex-wrap: wrap; gap:8px;" [(ngModel)]="itsmCheckedGroup" (ngModelChange)="changeItsmGroup($event)"></nz-checkbox-group>
25
+          </div>
26
+        </div>
27
+        <div nz-row>
28
+          <div nz-col nzSpan="3">工单范围:</div>
29
+          <div nz-col nzSpan="21">
30
+            <nz-radio-group class="w100" [(ngModel)]="itsmOrderScopeRadio">
31
+              <label nz-radio nzValue="0">全工单</label>
32
+              <label nz-radio nzValue="1">急单</label>
33
+              <label nz-radio nzValue="2">急单以及超时工单</label>
34
+            </nz-radio-group>
35
+          </div>
36
+        </div>
37
+      </div>
38
+      <div class="conditions" *ngIf="activeScopeTabValue == 2">
39
+        <div nz-row>
40
+          <div nz-col nzSpan="3">院区:</div>
41
+          <div nz-col nzSpan="21">
42
+            <nz-radio-group class="w100" style="display: flex; flex-wrap: wrap; gap:8px;" [(ngModel)]="checkedHos">
43
+              <label *ngFor="let data of hosList" nz-radio [nzValue]="data.id">{{ data.hosName }}</label>
44
+            </nz-radio-group>
45
+          </div>
46
+        </div>
47
+        <div nz-row>
48
+          <div nz-col nzSpan="3">工单类型:</div>
49
+          <div nz-col nzSpan="21" *ngIf="hosTaskTypes && checkedHos && hosTaskTypes['hos' + checkedHos]">
50
+            <label class="checkAll mb8" nz-checkbox *ngIf="hosTaskTypes['hos' + checkedHos].length" [(ngModel)]="allTypeChecked" (ngModelChange)="updateAllTypeChecked()">
51
+              全选
52
+            </label>
53
+            <nz-checkbox-wrapper class="w100" style="display: flex; flex-wrap: wrap; gap:8px;" (nzOnChange)="changeTaskTypes($event)">
54
+              <label nz-checkbox [nzValue]="data.id" [ngModel]="initTypes[data.id]" *ngFor="let data of hosTaskTypes['hos' + checkedHos]">{{ data.taskName }}</label>
55
+            </nz-checkbox-wrapper>
56
+          </div>
57
+        </div>
58
+        <div nz-row>
59
+          <div nz-col nzSpan="3">人员分组:</div>
60
+          <div nz-col nzSpan="21" *ngIf="hosGroups && checkedHos && hosGroups['hos' + checkedHos]">
61
+            <label class="checkAll mb8" nz-checkbox *ngIf="hosGroups['hos' + checkedHos].length" [(ngModel)]="allGroupChecked" (ngModelChange)="updateAllGroupChecked()">
62
+              全选
63
+            </label>
64
+            <nz-checkbox-wrapper class="w100" style="display: flex; flex-wrap: wrap; gap:8px;" (nzOnChange)="changeGroups($event)">
65
+              <label nz-checkbox [nzValue]="data.id" [ngModel]="initGroups[data.id]" *ngFor="let data of hosGroups['hos' + checkedHos]">{{ data.groupName }}</label>
66
+            </nz-checkbox-wrapper>
67
+          </div>
68
+        </div>
69
+        <div nz-row>
70
+          <div nz-col nzSpan="3">工单范围:</div>
71
+          <div nz-col nzSpan="21">
72
+            <nz-radio-group class="w100" [(ngModel)]="orderScopeRadio">
73
+              <label nz-radio nzValue="0">全工单</label>
74
+              <label nz-radio nzValue="1">急单</label>
75
+              <label nz-radio nzValue="2">急单以及超时工单</label>
76
+            </nz-radio-group>
77
+          </div>
78
+        </div>
79
+      </div>
80
+    </div>
81
+    <div class="btns display_flex justify-content_flex-center">
82
+      <button class="btn" nz-button nzType="primary" [nzLoading]="saveLoading" (click)="saveOrderScope()">
83
+        保存
84
+      </button>
85
+      <button class="btn cancel" nz-button nzType="default" (click)="cancelInit()">
86
+        知道了
87
+      </button>
88
+    </div>
89
+  </div>
90
+</div>

+ 170 - 0
src/app/components/order-scope/order-scope.component.less

@@ -0,0 +1,170 @@
1
+@import "../../../../src/theme.less";
2
+:host {
3
+  ::ng-deep .ant-checkbox-wrapper + .ant-checkbox-wrapper{
4
+    margin-left: 0!important;
5
+  }
6
+  // 撤回工单
7
+  .recallOrder {
8
+    position: fixed;
9
+    left: 0;
10
+    top: 0;
11
+    width: 100%;
12
+    height: 100%;
13
+    background: rgba(0, 0, 0, 0.4);
14
+    z-index: 9999999;
15
+
16
+    .modalBody {
17
+      width: 350px;
18
+      height: 220px;
19
+      background: #fff;
20
+      border-radius: 5px;
21
+      padding: 10px 20px;
22
+      color: #333;
23
+
24
+      .title {
25
+        width: 100%;
26
+        text-align: center;
27
+        font-size: 18px;
28
+        position: relative;
29
+
30
+        i {
31
+          position: absolute;
32
+          right: 0;
33
+          top: 0;
34
+          font-size: 20px;
35
+          color: #666;
36
+          cursor: pointer;
37
+          padding: 0 5px;
38
+        }
39
+      }
40
+
41
+      .content {
42
+        width: 310px;
43
+        height: 117px;
44
+        background: #f9fafb;
45
+        border: 1px solid #e5e9ed;
46
+        border-radius: 5px;
47
+        overflow: hidden;
48
+        margin-top: 12px;
49
+
50
+        div {
51
+          text-align: center;
52
+          margin: 0;
53
+
54
+          &.icon {
55
+            margin-top: 17px;
56
+
57
+            i {
58
+              color: #ff3b53;
59
+              font-size: 30px !important;
60
+
61
+              &.transport-wenhao {
62
+                color: #f5a523;
63
+              }
64
+            }
65
+          }
66
+
67
+          &.defeat {
68
+            color: #333;
69
+            font-size: 18px;
70
+          }
71
+
72
+          &:nth-child(3) {
73
+            font-size: 14px;
74
+            color: #666;
75
+          }
76
+        }
77
+
78
+        .conditions {
79
+          height: 400px;
80
+          overflow: auto;
81
+          padding: 16px 20px;
82
+
83
+          div {
84
+            text-align: left;
85
+            margin-bottom: 8px;
86
+          }
87
+        }
88
+      }
89
+
90
+      .btns {
91
+        button {
92
+          margin-top: 10px;
93
+          margin-left: 5px;
94
+        }
95
+
96
+        .recDelBtn {
97
+          width: 115px;
98
+        }
99
+      }
100
+    }
101
+  }
102
+
103
+  // 初始化设置
104
+  .init {
105
+    position: fixed;
106
+    left: 0;
107
+    top: 0;
108
+    width: 100%;
109
+    height: 100%;
110
+    background: rgba(0, 0, 0, 0.4);
111
+    z-index: 99;
112
+
113
+    .con {
114
+      width: 832px;
115
+      height: auto;
116
+      background: #fff;
117
+      border-radius: 5px;
118
+      padding: 10px 20px;
119
+      color: #333;
120
+
121
+      .content {
122
+        width: 100%;
123
+        height: auto;
124
+
125
+        .scopeTab{
126
+          display: flex;
127
+          height: 60px;
128
+          border-bottom: 1px solid #D9D9D9;
129
+          .scopeTabItem{
130
+            flex: 1;
131
+            display: flex;
132
+            justify-content: center;
133
+            align-items: center;
134
+            border-right: 1px solid #D9D9D9;
135
+            background-color: #fff;
136
+            cursor: pointer;
137
+            &:last-of-type{
138
+              border-right: none;
139
+            }
140
+            &.active{
141
+              background-color: #F0F6ED;
142
+            }
143
+          }
144
+        }
145
+
146
+        .remin {
147
+          font-size: 14px;
148
+          color: #666;
149
+          line-height: 48px;
150
+          border-bottom: 1px solid #e5e9ed;
151
+        }
152
+
153
+        .boxes {
154
+          color: #333;
155
+          padding: 8px 12px;
156
+
157
+          & > div:nth-child(1) {
158
+            color: #333;
159
+            text-align: left;
160
+          }
161
+
162
+          & > div:nth-child(2) {
163
+            color: #666;
164
+            text-align: left;
165
+          }
166
+        }
167
+      }
168
+    }
169
+  }
170
+}

+ 348 - 0
src/app/components/order-scope/order-scope.component.ts

@@ -0,0 +1,348 @@
1
+import { Component, OnInit, Output, Input } from '@angular/core';
2
+import { EventEmitter } from '@angular/core';
3
+import { MainService } from 'src/app/services/main.service';
4
+import { ToolService } from 'src/app/services/tool.service';
5
+
6
+@Component({
7
+  selector: 'app-order-scope',
8
+  templateUrl: './order-scope.component.html',
9
+  styleUrls: ['./order-scope.component.less']
10
+})
11
+export class OrderScopeComponent implements OnInit {
12
+  @Input() hsmsData:any = {
13
+    checkedHos: undefined,
14
+    scopeGroups: [],
15
+    orderScopeRadio: undefined,
16
+  }
17
+  @Input() itsmData:any = {
18
+    checkedHos: undefined,
19
+    scopeGroups: [],
20
+    orderScopeRadio: undefined,
21
+  }
22
+  @Output() confirmModal = new EventEmitter();
23
+  @Output() cancelModal = new EventEmitter();
24
+  constructor(
25
+    private mainService: MainService,
26
+    private tool: ToolService,
27
+  ) { }
28
+
29
+  user = JSON.parse(localStorage.getItem("user")); //用户信息
30
+  checkedHos;//转运-院区
31
+  orderScopeRadio:any = '0';//转运-工单范围
32
+
33
+  itsmCheckedHos:any[] = [];//运维-院区
34
+  itsmCheckedGroup:any[] = [];//运维-分组
35
+  itsmOrderScopeRadio = '0';//运维-工单范围
36
+  isAllItsmGroupChecked:boolean = false;//运维-是否全选分组
37
+
38
+  ngOnInit() {
39
+    this.initHsms();
40
+    this.initItsm();
41
+  }
42
+
43
+  initHsms(){
44
+    this.checkedHos = this.hsmsData.checkedHos;
45
+    this.orderScopeRadio = this.hsmsData.orderScopeRadio;
46
+    this.initOrderScope();
47
+    this.getOrderScope();
48
+  }
49
+
50
+  initItsm(){
51
+    this.itsmOrderScopeRadio = this.itsmData.orderScopeRadio;
52
+    this.itsmGetOrderScope();
53
+  }
54
+
55
+    // 工单范选项卡
56
+    activeScopeTabValue = 1;
57
+    scopeTabs:any[] = [
58
+      { name: '运维', value: 1 },
59
+      { name: '配送', value: 2 },
60
+    ];
61
+
62
+    // =============================工单范围-运维start========================================
63
+    // 工单范围数据
64
+    itsmGetOrderScope() {
65
+      // 权限内的院区和组
66
+      let hosList = this.user.infoPermission.hospitals || [];
67
+      let groups = this.user.infoPermission.groups || [];
68
+
69
+      // 选中的院区和组
70
+      let itsmCheckedHos = this.itsmData.checkedHos || [];
71
+      let itsmCheckedGroup = this.itsmData.scopeGroups || [];
72
+
73
+      let hosIds = itsmCheckedHos.map(v => v.id);
74
+      let groupIds = itsmCheckedGroup.map(v => v.id);
75
+
76
+      this.itsmCheckedHos = hosList.map(v => ({ label: v.hosName, value: v.id, checked: hosIds.includes(v.id) }));
77
+      this.itsmCheckedGroup = groups.filter(v => hosIds.includes(v.hospital.id)).map(v => ({ label: v.hospital.hosName + '-' + v.groupName, value: v.id, checked: groupIds.includes(v.id) }));
78
+      this.isAllItsmGroupChecked = this.itsmCheckedGroup.length ? this.itsmCheckedGroup.every(v => v.checked) : false;
79
+    }
80
+
81
+    // 全选、全不选分组
82
+    updateAllItsmGroupChecked(){
83
+      this.isAllItsmGroupChecked = !this.isAllItsmGroupChecked;
84
+      let flag = this.itsmCheckedGroup.length ? this.itsmCheckedGroup.every(v => v.checked) : false;
85
+      this.itsmCheckedGroup.forEach(v => v.checked = !flag);
86
+    }
87
+    // 选择分组
88
+    changeItsmGroup(e){
89
+      this.isAllItsmGroupChecked = this.itsmCheckedGroup.length ? this.itsmCheckedGroup.every(v => v.checked) : false;
90
+    }
91
+    // 选择院区
92
+    changeItsmHospital(hospitalList){
93
+      // 权限内的院区和组
94
+      let groups = this.user.infoPermission.groups || [];
95
+
96
+      // 选中的院区和组
97
+      let itsmCheckedHos = this.itsmCheckedHos || [];
98
+      let itsmCheckedGroup = this.itsmCheckedGroup || [];
99
+
100
+      let hosIds = itsmCheckedHos.filter(v => v.checked).map(v => v.value);
101
+      let groupIds = itsmCheckedGroup.filter(v => v.checked).map(v => v.value);
102
+
103
+      this.itsmCheckedGroup = groups.filter(v => hosIds.includes(v.hospital.id)).map(v => ({ label: v.hospital.hosName + '-' + v.groupName, value: v.id, checked: groupIds.includes(v.id) }));
104
+      this.isAllItsmGroupChecked = this.itsmCheckedGroup.length ? this.itsmCheckedGroup.every(v => v.checked) : false;
105
+    }
106
+    // =============================工单范围-运维end========================================
107
+
108
+    // =============================工单范围-配送start========================================
109
+
110
+    // 工单范围数据
111
+    hosList = []; //院区
112
+    taskTypes = []; //当前权限下所有工单类型
113
+    userGroups = []; //当前权限下所有人员分组
114
+    hosTaskTypes = {}; //当前权限下所有院区对应的任务类型
115
+    hosGroups = {}; //当前权限下所有院区对应的人员分组
116
+    getOrderScope() {
117
+      this.hosList = this.user.infoPermission.hospitals;
118
+      this.taskTypes = this.user.infoPermission.taskTypes;
119
+      this.userGroups = this.user.infoPermission.groups;
120
+      this.hosList.forEach((e) => {
121
+        let arrT = [],
122
+          arrG = [];
123
+        this.taskTypes.forEach((el) => {
124
+          if (el.hosId.id == e.id) {
125
+            arrT.push(el);
126
+            this.hosTaskTypes["hos" + e.id] = arrT;
127
+          }
128
+        });
129
+
130
+        this.userGroups.forEach((ele) => {
131
+          if (ele.hospital.id == e.id) {
132
+            arrG.push(ele);
133
+            this.hosGroups["hos" + e.id] = arrG;
134
+          }
135
+        });
136
+      });
137
+      console.log(this.hosTaskTypes, this.hosGroups);
138
+
139
+      // 工单范围全选按钮是否选中
140
+      this.allTypeChecked = false;
141
+      if (this.user.user.scope && this.user.user.scope.typeIds) {
142
+        if (
143
+          this.user.user.scope.typeIds.length ==
144
+          this.hosTaskTypes["hos" + this.checkedHos].length
145
+        ) {
146
+          this.allTypeChecked = true;
147
+        }
148
+      }
149
+      this.allGroupChecked = false;
150
+      if (this.user.user.scope && this.user.user.scope.groupIds) {
151
+        if (
152
+          this.user.user.scope.groupIds.length ==
153
+          this.hosGroups["hos" + this.checkedHos].length
154
+        ) {
155
+          this.allGroupChecked = true;
156
+        }
157
+      }
158
+    }
159
+
160
+    // 工单类型全选
161
+    allTypeChecked: boolean = false; //工单类型全选框
162
+    updateAllTypeChecked() {
163
+      let arr = [];
164
+      this.hosTaskTypes["hos" + this.checkedHos].forEach((e) => {
165
+        arr.push(e.id);
166
+      });
167
+      this.changeTaskTypes(this.allTypeChecked ? arr : []);
168
+      let obj = {};
169
+      arr.forEach((e) => {
170
+        obj[e] = this.allTypeChecked;
171
+      });
172
+      this.initTypes = obj;
173
+    }
174
+
175
+    // 工单类型
176
+    checkedTypes = []; //已选中taskTypes的ID数组
177
+    changeType: boolean = false; //是否改变工单类型
178
+    hosTypesChecked = {}; //当前权限下所有院区下选中的工单类型
179
+    changeTaskTypes(val) {
180
+      this.checkedTypes = val;
181
+      this.changeType = true;
182
+      this.hosTypesChecked["hos" + this.checkedHos] = val;
183
+      console.log(this.hosTypesChecked);
184
+      if (val.length == this.hosTaskTypes["hos" + this.checkedHos].length) {
185
+        this.allTypeChecked = true;
186
+      } else {
187
+        this.allTypeChecked = false;
188
+      }
189
+    }
190
+
191
+    // 人员分组全选
192
+    allGroupChecked: boolean = false; //工单类型全选框
193
+    updateAllGroupChecked() {
194
+      let arr = [];
195
+      this.hosGroups["hos" + this.checkedHos].forEach((e) => {
196
+        arr.push(e.id);
197
+      });
198
+      this.changeGroups(this.allGroupChecked ? arr : []);
199
+      let obj = {};
200
+      arr.forEach((e) => {
201
+        obj[e] = this.allGroupChecked;
202
+      });
203
+      this.initGroups = obj;
204
+    }
205
+    // 人员分组
206
+    checkedGroups = [];
207
+    changeGroup: boolean = false; //是否改变分组
208
+    hosGroupsChecked = {}; //当前权限下所有院区下选中的人员分组
209
+    changeGroups(val) {
210
+      this.checkedGroups = val;
211
+      this.changeGroup = true;
212
+      this.hosGroupsChecked["hos" + this.checkedHos] = val;
213
+      console.log(this.hosGroupsChecked);
214
+      if (val.length == this.hosGroups["hos" + this.checkedHos].length) {
215
+        this.allGroupChecked = true;
216
+      } else {
217
+        this.allGroupChecked = false;
218
+      }
219
+    }
220
+
221
+    // 工单范围院区切换
222
+    getTypeAndGroup() {
223
+      this.allTypeChecked = false;
224
+      this.allGroupChecked = false;
225
+      for (let k1 in this.initTypes) {
226
+        this.initTypes[k1] = false;
227
+      }
228
+      for (let k1 in this.initGroups) {
229
+        this.initGroups[k1] = false;
230
+      }
231
+      this.orderScopeRadio = "0";
232
+    }
233
+
234
+    // 保存工单范围设置
235
+    saveLoading: boolean = false; //保存按钮loading状态
236
+    saveOrderScope() {
237
+      this.saveLoading = true;
238
+      let types = [];
239
+      if (!this.changeType) {
240
+        // 没有改变当前工单类型设置,取初始化设置,
241
+        for (var i in this.initTypes) {
242
+          if (this.initTypes[i]) {
243
+            types.push(Number(i));
244
+          }
245
+        }
246
+      } else {
247
+        let arr = this.hosTypesChecked["hos" + this.checkedHos] || [];
248
+        arr.forEach(function (val) {
249
+          types.push(Number(val));
250
+        });
251
+      }
252
+
253
+      let groups = [];
254
+      if (!this.changeGroup) {
255
+        // 没有改变当前分组设置,取初始化设置,
256
+        for (var k in this.initGroups) {
257
+          if (this.initGroups[k]) {
258
+            groups.push(Number(k));
259
+          }
260
+        }
261
+      } else {
262
+        let arr = this.hosGroupsChecked["hos" + this.checkedHos] || [];
263
+        arr.forEach(function (val) {
264
+          groups.push(Number(val));
265
+        });
266
+      }
267
+      types = [...new Set(types)];
268
+      groups = [...new Set(groups)];
269
+
270
+      let groupsId = [];
271
+      groups.forEach((e) => {
272
+        groupsId.push({ id: e });
273
+      });
274
+      let typesId = [];
275
+      types.forEach((e) => {
276
+        typesId.push({ id: e });
277
+      });
278
+
279
+      let postData = {
280
+        workerOrderScope: {
281
+          hospitalId: { id: this.checkedHos - 0 },
282
+          typeIds: typesId,
283
+          groupIds: groupsId,
284
+          range: this.orderScopeRadio - 0,
285
+          userId: this.user.user.id,
286
+        },
287
+      };
288
+      if (this.user.user.scope && this.user.user.scope.id) {
289
+        postData.workerOrderScope["id"] = this.user.user.scope.id;
290
+      }
291
+      console.log(postData);
292
+      return;
293
+      this.mainService
294
+        .coopTypeConfig("addData", "workerOrderScope", postData)
295
+        .subscribe((data) => {
296
+          this.saveLoading = false;
297
+          this.confirmModal.emit(data);
298
+        });
299
+    }
300
+
301
+    // 关闭弹窗
302
+    cancelInit() {
303
+      this.cancelModal.emit();
304
+    }
305
+
306
+    // 工单范围设置回显
307
+    initTypes = {}; //工单类型
308
+    initGroups = {}; //人员分组
309
+    initOrderScope() {
310
+      if (!this.user || !this.user.user || !this.user.user.scope) return;
311
+      let scopeInfo = this.user.user.scope;
312
+      if (!this.taskTypes.length) {
313
+        this.initTypes = {};
314
+      } else {
315
+        this.taskTypes.forEach((val, idx) => {
316
+          this.initTypes[val.id] = false;
317
+        });
318
+      }
319
+      if (!scopeInfo.typeIds) {
320
+        this.initTypes = {};
321
+        this.allTypeChecked = false;
322
+      } else {
323
+        scopeInfo.typeIds.forEach((val, idx) => {
324
+          this.initTypes[val.id] = true;
325
+        });
326
+      }
327
+
328
+      console.log(this.initTypes);
329
+
330
+      if (!this.userGroups || !this.userGroups.length) {
331
+        this.initGroups = {};
332
+      } else {
333
+        this.userGroups.forEach((val, idx) => {
334
+          this.initGroups[val.id] = false;
335
+        });
336
+      }
337
+      if (!scopeInfo.groupIds || !scopeInfo.groupIds.length) {
338
+        this.initGroups = {};
339
+      } else {
340
+        scopeInfo.groupIds.forEach((val, idx) => {
341
+          this.initGroups[val.id] = true;
342
+        });
343
+      }
344
+      console.log(this.initGroups);
345
+      console.log(this.initTypes);
346
+    }
347
+    // =============================工单范围-配送end========================================
348
+}

+ 20 - 0
src/app/components/order-scope/order-scope.module.ts

@@ -0,0 +1,20 @@
1
+import { NgModule } from '@angular/core';
2
+import { CommonModule } from '@angular/common';
3
+
4
+import { OrderScopeComponent } from './order-scope.component';
5
+import { ShareModule } from 'src/app/share/share.module';
6
+
7
+
8
+@NgModule({
9
+  declarations: [
10
+    OrderScopeComponent,
11
+  ],
12
+  imports: [
13
+    CommonModule,
14
+    ShareModule,
15
+  ],
16
+  exports: [
17
+    OrderScopeComponent,
18
+  ]
19
+})
20
+export class OrderScopeModule { }

+ 3 - 296
src/app/views/fuwutai/fuwutai.component.html

@@ -1451,142 +1451,6 @@
1451 1451
           </div>
1452 1452
         </div>
1453 1453
       </div>
1454
-      <!-- 工单范围 -->
1455
-      <div
1456
-        class="con"
1457
-        *ngIf="fixedTab == 'orderScope' && fixedTab != 'newOrder'"
1458
-      >
1459
-        <div class="title">工单范围</div>
1460
-        <overlay-scrollbars
1461
-          #9
1462
-          [ngStyle]="{ height: '206px' }"
1463
-          class="conditions"
1464
-        >
1465
-          <div nz-row>
1466
-            <div nz-col nzSpan="6">院区:</div>
1467
-            <div nz-col nzSpan="18">
1468
-              <nz-radio-group
1469
-                class="w100"
1470
-                [(ngModel)]="checkedHos"
1471
-                nzName="radioHos"
1472
-                (ngModelChange)="getTypeAndGroup()"
1473
-              >
1474
-                <label
1475
-                  *ngFor="let data of hosList"
1476
-                  nz-radio
1477
-                  [nzValue]="data.id"
1478
-                  >{{ data.hosName }}</label
1479
-                >
1480
-              </nz-radio-group>
1481
-            </div>
1482
-          </div>
1483
-          <div nz-row>
1484
-            <div nz-col nzSpan="6">工单类型:</div>
1485
-            <div
1486
-              nz-col
1487
-              nzSpan="18"
1488
-              *ngIf="
1489
-                hosTaskTypes && checkedHos && hosTaskTypes['hos' + checkedHos]
1490
-              "
1491
-            >
1492
-              <label
1493
-                class="checkAll"
1494
-                nz-checkbox
1495
-                *ngIf="hosTaskTypes['hos' + checkedHos].length"
1496
-                [(ngModel)]="allTypeChecked"
1497
-                (ngModelChange)="updateAllTypeChecked()"
1498
-              >
1499
-                全选
1500
-              </label>
1501
-              <div nz-row>
1502
-                <nz-checkbox-wrapper
1503
-                  class="w100"
1504
-                  (nzOnChange)="changeTaskTypes($event)"
1505
-                >
1506
-                  <div nz-row>
1507
-                    <div
1508
-                      *ngFor="let data of hosTaskTypes['hos' + checkedHos]"
1509
-                      nz-col
1510
-                      nzSpan="12"
1511
-                    >
1512
-                      <label
1513
-                        nz-checkbox
1514
-                        [nzValue]="data.id"
1515
-                        [ngModel]="initTypes[data.id]"
1516
-                        >{{ data.taskName }}</label
1517
-                      >
1518
-                    </div>
1519
-                  </div>
1520
-                </nz-checkbox-wrapper>
1521
-              </div>
1522
-            </div>
1523
-          </div>
1524
-          <div nz-row>
1525
-            <div nz-col nzSpan="6">人员分组:</div>
1526
-            <div
1527
-              nz-col
1528
-              nzSpan="18"
1529
-              *ngIf="hosGroups && checkedHos && hosGroups['hos' + checkedHos]"
1530
-            >
1531
-              <label
1532
-                class="checkAll"
1533
-                nz-checkbox
1534
-                *ngIf="hosGroups['hos' + checkedHos].length"
1535
-                [(ngModel)]="allGroupChecked"
1536
-                (ngModelChange)="updateAllGroupChecked()"
1537
-              >
1538
-                全选
1539
-              </label>
1540
-              <div nz-row>
1541
-                <nz-checkbox-wrapper
1542
-                  class="w100"
1543
-                  (nzOnChange)="changeGroups($event)"
1544
-                >
1545
-                  <div nz-row>
1546
-                    <div
1547
-                      *ngFor="let data of hosGroups['hos' + checkedHos]"
1548
-                      nz-col
1549
-                      nzSpan="12"
1550
-                    >
1551
-                      <label
1552
-                        nz-checkbox
1553
-                        [nzValue]="data.id"
1554
-                        [ngModel]="initGroups[data.id]"
1555
-                        >{{ data.groupName }}</label
1556
-                      >
1557
-                    </div>
1558
-                  </div>
1559
-                </nz-checkbox-wrapper>
1560
-              </div>
1561
-            </div>
1562
-          </div>
1563
-          <div nz-row>
1564
-            <div nz-col nzSpan="6">工单范围:</div>
1565
-            <div nz-col nzSpan="18">
1566
-              <nz-radio-group
1567
-                class="w100"
1568
-                [(ngModel)]="orderScopeRadio"
1569
-                nzName="radiogroup"
1570
-              >
1571
-                <label nz-radio nzValue="0">全工单</label>
1572
-                <label nz-radio nzValue="1">急单</label>
1573
-                <label nz-radio nzValue="2">急单以及超时工单</label>
1574
-              </nz-radio-group>
1575
-            </div>
1576
-          </div>
1577
-        </overlay-scrollbars>
1578
-        <div class="btns display_flex justify-content_flex-center">
1579
-          <button
1580
-            nz-button
1581
-            nzType="primary"
1582
-            nzValue="small"
1583
-            [nzLoading]="saveLoading"
1584
-            (click)="saveOrderScope()"
1585
-          >
1586
-            保存
1587
-          </button>
1588
-        </div>
1589
-      </div>
1590 1454
       <!-- 展示形式 -->
1591 1455
       <div class="con" *ngIf="fixedTab == 'colType' && fixedTab != 'newOrder'">
1592 1456
         <div class="title">展示形式</div>
@@ -1835,7 +1699,7 @@
1835 1699
             </div>
1836 1700
             <div
1837 1701
               [ngClass]="{ item: true, checked: fixedTab == 'orderScope' }"
1838
-              (click)="checkFixedTab('orderScope')"
1702
+              (click)="showOrderScope()"
1839 1703
             >
1840 1704
               工单范围
1841 1705
             </div>
@@ -3191,166 +3055,9 @@
3191 3055
     (confirmDelEvent)="confirmLogout()"
3192 3056
     content="您确认要退出系统吗?"
3193 3057
   ></app-dialog-delete>
3194
-
3195
-  <!-- 初始化范围设置 -->
3196
-  <div
3197
-    class="
3198
-      init
3199
-      recallOrder
3200
-      display_flex
3201
-      justify-content_flex-center
3202
-      align-items_center
3203
-    "
3204
-    *ngIf="showInitModal && (!user.user.scope || !user.user.scope.id)"
3205
-  >
3206
-    <div class="con modalBody">
3207
-      <div class="title">
3208
-        初始化范围设置<i
3209
-          class="icon_transport transport-guanbi"
3210
-          (click)="cancelInit()"
3211
-        ></i>
3212
-      </div>
3213
-      <div class="content">
3214
-        <div class="remin">
3215
-          提示:您第一次进入此调度,请您设置您调度范围后续也可修改
3216
-        </div>
3217
-        <div class="conditions">
3218
-          <div nz-row>
3219
-            <div nz-col nzSpan="6">院区:</div>
3220
-            <div nz-col nzSpan="18">
3221
-              <nz-radio-group
3222
-                class="w100"
3223
-                [(ngModel)]="checkedHos"
3224
-                nzName="radioHos"
3225
-              >
3226
-                <label
3227
-                  *ngFor="let data of hosList"
3228
-                  nz-radio
3229
-                  [nzValue]="data.id"
3230
-                  >{{ data.hosName }}</label
3231
-                >
3232
-              </nz-radio-group>
3233
-            </div>
3234
-          </div>
3235
-          <div nz-row>
3236
-            <div nz-col nzSpan="6">工单类型:</div>
3237
-            <div
3238
-              nz-col
3239
-              nzSpan="18"
3240
-              *ngIf="
3241
-                hosTaskTypes && checkedHos && hosTaskTypes['hos' + checkedHos]
3242
-              "
3243
-            >
3244
-              <label
3245
-                class="checkAll"
3246
-                nz-checkbox
3247
-                *ngIf="hosTaskTypes['hos' + checkedHos].length"
3248
-                [(ngModel)]="allTypeChecked"
3249
-                (ngModelChange)="updateAllTypeChecked()"
3250
-              >
3251
-                全选
3252
-              </label>
3253
-              <div nz-row>
3254
-                <nz-checkbox-wrapper
3255
-                  class="w100"
3256
-                  (nzOnChange)="changeTaskTypes($event)"
3257
-                >
3258
-                  <div nz-row>
3259
-                    <div
3260
-                      *ngFor="let data of hosTaskTypes['hos' + checkedHos]"
3261
-                      nz-col
3262
-                      nzSpan="12"
3263
-                    >
3264
-                      <label
3265
-                        nz-checkbox
3266
-                        [nzValue]="data.id"
3267
-                        [ngModel]="initTypes[data.id]"
3268
-                        >{{ data.taskName }}</label
3269
-                      >
3270
-                    </div>
3271
-                  </div>
3272
-                </nz-checkbox-wrapper>
3273
-              </div>
3274
-            </div>
3275
-          </div>
3276
-          <div nz-row>
3277
-            <div nz-col nzSpan="6">人员分组:</div>
3278
-            <div
3279
-              nz-col
3280
-              nzSpan="18"
3281
-              *ngIf="hosGroups && checkedHos && hosGroups['hos' + checkedHos]"
3282
-            >
3283
-              <label
3284
-                class="checkAll"
3285
-                nz-checkbox
3286
-                *ngIf="hosGroups['hos' + checkedHos].length"
3287
-                [(ngModel)]="allGroupChecked"
3288
-                (ngModelChange)="updateAllGroupChecked()"
3289
-              >
3290
-                全选
3291
-              </label>
3292
-              <div nz-row>
3293
-                <nz-checkbox-wrapper
3294
-                  class="w100"
3295
-                  (nzOnChange)="changeGroups($event)"
3296
-                >
3297
-                  <div nz-row>
3298
-                    <div
3299
-                      *ngFor="let data of hosGroups['hos' + checkedHos]"
3300
-                      nz-col
3301
-                      nzSpan="12"
3302
-                    >
3303
-                      <label
3304
-                        nz-checkbox
3305
-                        [nzValue]="data.id"
3306
-                        [ngModel]="initGroups[data.id]"
3307
-                        >{{ data.groupName }}</label
3308
-                      >
3309
-                    </div>
3310
-                  </div>
3311
-                </nz-checkbox-wrapper>
3312
-              </div>
3313
-            </div>
3314
-          </div>
3315
-          <div nz-row>
3316
-            <div nz-col nzSpan="6">工单范围:</div>
3317
-            <div nz-col nzSpan="18">
3318
-              <nz-radio-group
3319
-                class="w100"
3320
-                [(ngModel)]="orderScopeRadio"
3321
-                nzName="radiogroup"
3322
-              >
3323
-                <label nz-radio nzValue="0">全工单</label>
3324
-                <label nz-radio nzValue="1">急单</label>
3325
-                <label nz-radio nzValue="2">急单以及超时工单</label>
3326
-              </nz-radio-group>
3327
-            </div>
3328
-          </div>
3329
-        </div>
3330
-      </div>
3331
-      <div class="btns display_flex justify-content_flex-center">
3332
-        <button
3333
-          class="btn default"
3334
-          nz-button
3335
-          nzType="primary"
3336
-          [nzLoading]="saveLoading"
3337
-          (click)="saveOrderScope()"
3338
-        >
3339
-          保存
3340
-        </button>
3341
-        <button
3342
-          class="btn cancel"
3343
-          nz-button
3344
-          nzType="default"
3345
-          (click)="cancelInit()"
3346
-        >
3347
-          取消
3348
-        </button>
3349
-      </div>
3350
-    </div>
3351
-  </div>
3352 3058
 </div>
3353
-
3059
+<!-- 工单范围 -->
3060
+<app-order-scope *ngIf="showInitModal" [hsmsData]="hsmsData" [itsmData]="itsmData" (confirmModal)="confirmOrderScope($event)" (cancelModal)="cancelOrderScope($event)"></app-order-scope>
3354 3061
 <!-- 消息弹框模板 -->
3355 3062
 <ng-template #msgTemplate let-msg="data">
3356 3063
   <div class="msgTemBox ant-notification-notice-content">

+ 22 - 1
src/app/views/fuwutai/fuwutai.component.less

@@ -2061,7 +2061,7 @@
2061 2061
     z-index: 99;
2062 2062
 
2063 2063
     .con {
2064
-      width: 480px;
2064
+      width: 832px;
2065 2065
       height: auto;
2066 2066
       background: #fff;
2067 2067
       border-radius: 5px;
@@ -2072,6 +2072,27 @@
2072 2072
         width: 100%;
2073 2073
         height: auto;
2074 2074
 
2075
+        .scopeTab{
2076
+          display: flex;
2077
+          height: 60px;
2078
+          border-bottom: 1px solid #D9D9D9;
2079
+          .scopeTabItem{
2080
+            flex: 1;
2081
+            display: flex;
2082
+            justify-content: center;
2083
+            align-items: center;
2084
+            border-right: 1px solid #D9D9D9;
2085
+            background-color: #fff;
2086
+            cursor: pointer;
2087
+            &:last-of-type{
2088
+              border-right: none;
2089
+            }
2090
+            &.active{
2091
+              background-color: #F0F6ED;
2092
+            }
2093
+          }
2094
+        }
2095
+
2075 2096
         .remin {
2076 2097
           font-size: 14px;
2077 2098
           color: #666;

+ 69 - 345
src/app/views/fuwutai/fuwutai.component.ts

@@ -677,7 +677,6 @@ export class FuwutaiComponent implements OnInit {
677 677
     this.getOrderList(1);
678 678
     this.getOrderList(2);
679 679
     this.getOrderList(3);
680
-    this.getOrderScope();
681 680
     this.initControlView();
682 681
     this.moveMenu();
683 682
     this.getPhoneNum();
@@ -749,6 +748,75 @@ export class FuwutaiComponent implements OnInit {
749 748
     }
750 749
   }
751 750
 
751
+  // 工单范围设置回显
752
+  checkedHos;// 院区选择
753
+  scopeGroups = []; //当前所属人员分组
754
+  orderScopeRadio;// 工单范围
755
+
756
+  hsmsData: any = {
757
+    checkedHos: undefined,
758
+    scopeGroups: [],
759
+    orderScopeRadio: '0',
760
+  }; //转运工单范围相关信息
761
+
762
+  itsmData: any = {
763
+    checkedHos: [],
764
+    scopeGroups: [],
765
+    orderScopeRadio: '0',
766
+  }; //运维工单范围相关信息
767
+  initOrderScope() {
768
+    if (!this.user || !this.user.user || !this.user.user.scope){
769
+      this.showOrderScope();
770
+      return;
771
+    }
772
+    let scopeInfo = this.user.user.scope;
773
+    this.checkedHos = scopeInfo.hospitalId ? scopeInfo.hospitalId.id : null;
774
+    this.orderScopeRadio = scopeInfo.range + "";
775
+    this.scopeGroups = scopeInfo.groupIds || [];
776
+    this.hsmsData = {
777
+      checkedHos: this.checkedHos,
778
+      scopeGroups: this.scopeGroups,
779
+      orderScopeRadio: this.orderScopeRadio || '0',
780
+    }
781
+    this.itsmData = {
782
+      checkedHos: scopeInfo.hospitalId ? [scopeInfo.hospitalId] : [],
783
+      scopeGroups: this.scopeGroups,
784
+      orderScopeRadio: this.orderScopeRadio || '0',
785
+    }
786
+    this.getHospitalConfigList('allowNucleicAcidPrinting');
787
+  }
788
+
789
+  // 保存工单信息
790
+  confirmOrderScope(data){
791
+    if (data.status == 200) {
792
+      this.cancelOrderScope();
793
+      this.showPromptModal("保存", true, "");
794
+      // 关闭phone的websocket
795
+      this.phones.closeWs(true);
796
+      this.getPhoneNum(false);
797
+      this.user.user.scope = data.data;
798
+      localStorage.setItem("user", JSON.stringify(this.user));
799
+      this.initOrderScope();
800
+      this.initControlView();
801
+    } else {
802
+      this.showPromptModal("保存", false, data.msg);
803
+    }
804
+  }
805
+
806
+  // 第一次打开调度台页面初始化范围设置
807
+  showInitModal: boolean = false;
808
+  cancelOrderScope() {
809
+    this.showInitModal = false;
810
+  }
811
+
812
+  showOrderScope() {
813
+    if (!this.user || !this.user.user || !this.user.user.scope){
814
+      this.cancelOrderScope();
815
+      return;
816
+    }
817
+    this.showInitModal = true;
818
+  }
819
+
752 820
   // 连接websocket
753 821
   getWebsocketSer() {
754 822
     this.sers
@@ -2353,344 +2421,6 @@ export class FuwutaiComponent implements OnInit {
2353 2421
     this.deptFlag = true;
2354 2422
   }
2355 2423
 
2356
-  // 工单范围数据
2357
-  hosList = []; //院区
2358
-  taskTypes = []; //当前权限下所有工单类型
2359
-  userGroups = []; //当前权限下所有人员分组
2360
-  hosTaskTypes = {}; //当前权限下所有院区对应的任务类型
2361
-  hosGroups = {}; //当前权限下所有院区对应的人员分组
2362
-  getOrderScope() {
2363
-    this.hosList = this.user.infoPermission.hospitals;
2364
-    this.taskTypes = this.user.infoPermission.taskTypes;
2365
-    this.userGroups = this.user.infoPermission.groups;
2366
-    // this.checkedHos = this.user.infoPermission.hospitals ? this.user.infoPermission.hospitals[0].id : null;
2367
-    // this.orderScopeRadio = '0';
2368
-    this.hosList.forEach((e) => {
2369
-      let arrT = [],
2370
-        arrG = [];
2371
-      this.taskTypes.forEach((el) => {
2372
-        if (el.hosId.id == e.id) {
2373
-          arrT.push(el);
2374
-          this.hosTaskTypes["hos" + e.id] = arrT;
2375
-        }
2376
-      });
2377
-
2378
-      this.userGroups.forEach((ele) => {
2379
-        if (ele.hospital.id == e.id) {
2380
-          arrG.push(ele);
2381
-          this.hosGroups["hos" + e.id] = arrG;
2382
-        }
2383
-      });
2384
-    });
2385
-    console.log(this.hosTaskTypes, this.hosGroups);
2386
-
2387
-    // 工单范围全选按钮是否选中
2388
-    this.allTypeChecked = false;
2389
-    if (this.user.user.scope && this.user.user.scope.typeIds) {
2390
-      if (
2391
-        this.user.user.scope.typeIds.length ==
2392
-        this.hosTaskTypes["hos" + this.checkedHos].length
2393
-      ) {
2394
-        this.allTypeChecked = true;
2395
-      }
2396
-    }
2397
-    this.allGroupChecked = false;
2398
-    if (this.user.user.scope && this.user.user.scope.groupIds) {
2399
-      if (
2400
-        this.user.user.scope.groupIds.length ==
2401
-        this.hosGroups["hos" + this.checkedHos].length
2402
-      ) {
2403
-        this.allGroupChecked = true;
2404
-      }
2405
-    }
2406
-  }
2407
-  // 院区选择
2408
-  checkedHos;
2409
-
2410
-  // 工单类型全选
2411
-  allTypeChecked: boolean = false; //工单类型全选框
2412
-  updateAllTypeChecked() {
2413
-    let arr = [];
2414
-    this.hosTaskTypes["hos" + this.checkedHos].forEach((e) => {
2415
-      arr.push(e.id);
2416
-    });
2417
-    this.changeTaskTypes(this.allTypeChecked ? arr : []);
2418
-    let obj = {};
2419
-    arr.forEach((e) => {
2420
-      obj[e] = this.allTypeChecked;
2421
-    });
2422
-    this.initTypes = obj;
2423
-  }
2424
-
2425
-  // 工单类型
2426
-  checkedTypes = []; //已选中taskTypes的ID数组
2427
-  changeType: boolean = false; //是否改变工单类型
2428
-  hosTypesChecked = {}; //当前权限下所有院区下选中的工单类型
2429
-  changeTaskTypes(val) {
2430
-    this.checkedTypes = val;
2431
-    this.changeType = true;
2432
-    this.hosTypesChecked["hos" + this.checkedHos] = val;
2433
-    console.log(this.hosTypesChecked);
2434
-    if (val.length == this.hosTaskTypes["hos" + this.checkedHos].length) {
2435
-      this.allTypeChecked = true;
2436
-    } else {
2437
-      this.allTypeChecked = false;
2438
-    }
2439
-  }
2440
-
2441
-  // 人员分组全选
2442
-  allGroupChecked: boolean = false; //工单类型全选框
2443
-  updateAllGroupChecked() {
2444
-    let arr = [];
2445
-    this.hosGroups["hos" + this.checkedHos].forEach((e) => {
2446
-      arr.push(e.id);
2447
-    });
2448
-    this.changeGroups(this.allGroupChecked ? arr : []);
2449
-    let obj = {};
2450
-    arr.forEach((e) => {
2451
-      obj[e] = this.allGroupChecked;
2452
-    });
2453
-    this.initGroups = obj;
2454
-  }
2455
-  // 人员分组
2456
-  checkedGroups = [];
2457
-  changeGroup: boolean = false; //是否改变分组
2458
-  hosGroupsChecked = {}; //当前权限下所有院区下选中的人员分组
2459
-  changeGroups(val) {
2460
-    this.checkedGroups = val;
2461
-    this.changeGroup = true;
2462
-    this.hosGroupsChecked["hos" + this.checkedHos] = val;
2463
-    console.log(this.hosGroupsChecked);
2464
-    if (val.length == this.hosGroups["hos" + this.checkedHos].length) {
2465
-      this.allGroupChecked = true;
2466
-    } else {
2467
-      this.allGroupChecked = false;
2468
-    }
2469
-  }
2470
-
2471
-  // 工单范围
2472
-  orderScopeRadio;
2473
-  // 工单范围院区切换
2474
-  getTypeAndGroup() {
2475
-    this.allTypeChecked = false;
2476
-    this.allGroupChecked = false;
2477
-    for (let k1 in this.initTypes) {
2478
-      this.initTypes[k1] = false;
2479
-    }
2480
-    for (let k1 in this.initGroups) {
2481
-      this.initGroups[k1] = false;
2482
-    }
2483
-    this.orderScopeRadio = "0";
2484
-  }
2485
-
2486
-  // 保存工单范围设置
2487
-  saveOrderScope() {
2488
-    let that = this;
2489
-    that.saveLoading = true;
2490
-    let types = [];
2491
-    if (!this.changeType) {
2492
-      // 没有改变当前工单类型设置,取初始化设置,
2493
-      for (var i in that.initTypes) {
2494
-        if (that.initTypes[i]) {
2495
-          types.push(Number(i));
2496
-        }
2497
-      }
2498
-    } else {
2499
-      // that.checkedTypes.forEach(function (val) {
2500
-      //   types.push(Number(val))
2501
-      // })
2502
-      let arr = this.hosTypesChecked["hos" + this.checkedHos] || [];
2503
-      arr.forEach(function (val) {
2504
-        types.push(Number(val));
2505
-      });
2506
-    }
2507
-
2508
-    let groups = [];
2509
-    if (!this.changeGroup) {
2510
-      // 没有改变当前分组设置,取初始化设置,
2511
-      for (var k in that.initGroups) {
2512
-        if (that.initGroups[k]) {
2513
-          groups.push(Number(k));
2514
-        }
2515
-      }
2516
-    } else {
2517
-      // that.checkedGroups.forEach(function (val) {
2518
-      //   groups.push(Number(val))
2519
-      // })
2520
-      let arr = this.hosGroupsChecked["hos" + this.checkedHos] || [];
2521
-      arr.forEach(function (val) {
2522
-        groups.push(Number(val));
2523
-      });
2524
-    }
2525
-    types = [...new Set(types)];
2526
-    groups = [...new Set(groups)];
2527
-
2528
-    let groupsId = [];
2529
-    groups.forEach((e) => {
2530
-      groupsId.push({ id: e });
2531
-    });
2532
-    let typesId = [];
2533
-    types.forEach((e) => {
2534
-      typesId.push({ id: e });
2535
-    });
2536
-
2537
-    let postData = {
2538
-      workerOrderScope: {
2539
-        hospitalId: { id: that.checkedHos - 0 },
2540
-        typeIds: typesId,
2541
-        groupIds: groupsId,
2542
-        range: that.orderScopeRadio - 0,
2543
-        userId: that.user.user.id,
2544
-      },
2545
-    };
2546
-    if (that.user.user.scope && that.user.user.scope.id) {
2547
-      postData.workerOrderScope["id"] = that.user.user.scope.id;
2548
-    }
2549
-    console.log(postData);
2550
-    // return
2551
-    that.mainService
2552
-      .coopTypeConfig("addData", "workerOrderScope", postData)
2553
-      .subscribe((data) => {
2554
-        that.saveLoading = false;
2555
-        if (data.status == 200) {
2556
-          that.showPromptModal("保存", true, "");
2557
-          // 关闭phone的websocket
2558
-          this.phones.closeWs(true);
2559
-          this.getPhoneNum(false);
2560
-          that.user.user.scope = data.data;
2561
-          localStorage.setItem("user", JSON.stringify(that.user));
2562
-          that.initOrderScope();
2563
-          that.getOrderScope();
2564
-          that.initControlView();
2565
-        } else {
2566
-          that.showPromptModal("保存", false, data.msg);
2567
-        }
2568
-      });
2569
-  }
2570
-  // 确认工单范围设置
2571
-  confirmOrderScope() {
2572
-    let that = this;
2573
-    that.btnLoading = true;
2574
-    let types = [];
2575
-    if (!that.changeType) {
2576
-      // 没有改变当前工单类型设置,取初始化设置,
2577
-      for (var i in that.initTypes) {
2578
-        if (that.initTypes[i]) {
2579
-          types.push(Number(i));
2580
-        }
2581
-      }
2582
-    } else {
2583
-      that.hosTypesChecked["hos" + that.checkedHos].forEach(function (val) {
2584
-        types.push(Number(val));
2585
-      });
2586
-    }
2587
-
2588
-    let groups = [];
2589
-    if (!that.changeGroup) {
2590
-      // 没有改变当前分组设置,取初始化设置,
2591
-      for (var k in that.initGroups) {
2592
-        if (that.initGroups[k]) {
2593
-          groups.push(Number(k));
2594
-        }
2595
-      }
2596
-    } else {
2597
-      that.hosGroupsChecked["hos" + that.checkedHos].forEach(function (val) {
2598
-        groups.push(Number(val));
2599
-      });
2600
-    }
2601
-    types = [...new Set(types)];
2602
-    groups = [...new Set(groups)];
2603
-
2604
-    that.user.user.scope.range = that.orderScopeRadio - 0;
2605
-    that.hosList.forEach((e) => {
2606
-      if (e.id == that.checkedHos) {
2607
-        that.user.user.scope.hospitalId = e;
2608
-      }
2609
-    });
2610
-    let arrT = [],
2611
-      arrG = [];
2612
-    console.log(that.hosTaskTypes, types);
2613
-    that.hosTaskTypes["hos" + that.checkedHos].forEach((e) => {
2614
-      types.forEach((el) => {
2615
-        if (e.id == el) {
2616
-          arrT.push(e);
2617
-        }
2618
-      });
2619
-    });
2620
-    that.hosGroups["hos" + that.checkedHos].forEach((e) => {
2621
-      groups.forEach((el) => {
2622
-        if (e.id == el) {
2623
-          arrG.push(e);
2624
-        }
2625
-      });
2626
-    });
2627
-    that.user.user.scope.typeIds = arrT;
2628
-    that.user.user.scope.groupIds = arrG;
2629
-
2630
-    console.log(that.user);
2631
-    that.initOrderScope();
2632
-    that.getOrderList(1);
2633
-    that.getOrderList(2);
2634
-    that.getOrderList(3);
2635
-    that.getOrderScope();
2636
-    that.initControlView();
2637
-    that.msg.success("修改成功!", {
2638
-      nzDuration: 1000,
2639
-    });
2640
-    that.btnLoading = false;
2641
-
2642
-    that.fixedTab = "";
2643
-    that.fixedMenuShangla();
2644
-  }
2645
-  // 工单范围设置回显
2646
-  initTypes = {}; //工单类型
2647
-  initGroups = {}; //人员分组
2648
-  scopeGroups = []; //当前所属人员分组
2649
-  scopeTypes = []; //当前所属人员类型
2650
-  initOrderScope() {
2651
-    if (!this.user || !this.user.user || !this.user.user.scope) return;
2652
-    let scopeInfo = this.user.user.scope;
2653
-    this.checkedHos = scopeInfo.hospitalId ? scopeInfo.hospitalId.id : null;
2654
-    this.orderScopeRadio = scopeInfo.range + "";
2655
-    if (!this.taskTypes.length) {
2656
-      this.initTypes = {};
2657
-    } else {
2658
-      this.taskTypes.forEach((val, idx) => {
2659
-        this.initTypes[val.id] = false;
2660
-      });
2661
-    }
2662
-    if (!scopeInfo.typeIds) {
2663
-      this.initTypes = {};
2664
-      this.allTypeChecked = false;
2665
-    } else {
2666
-      scopeInfo.typeIds.forEach((val, idx) => {
2667
-        this.initTypes[val.id] = true;
2668
-      });
2669
-    }
2670
-
2671
-    console.log(this.initTypes);
2672
-
2673
-    if (!this.userGroups || !this.userGroups.length) {
2674
-      this.initGroups = {};
2675
-    } else {
2676
-      this.userGroups.forEach((val, idx) => {
2677
-        this.initGroups[val.id] = false;
2678
-      });
2679
-    }
2680
-    if (!scopeInfo.groupIds || !scopeInfo.groupIds.length) {
2681
-      this.initGroups = {};
2682
-    } else {
2683
-      scopeInfo.groupIds.forEach((val, idx) => {
2684
-        this.initGroups[val.id] = true;
2685
-      });
2686
-    }
2687
-    this.scopeGroups = scopeInfo.groupIds || [];
2688
-    this.scopeTypes = scopeInfo.typeIds || [];
2689
-    console.log(this.scopeGroups, this.initGroups);
2690
-    console.log(this.scopeTypes, this.initTypes);
2691
-    this.getHospitalConfigList('allowNucleicAcidPrinting');
2692
-  }
2693
-
2694 2424
   // 初始化展示形式
2695 2425
   controlView = {}; //展示形式
2696 2426
   initControlView() {
@@ -2773,12 +2503,6 @@ export class FuwutaiComponent implements OnInit {
2773 2503
       });
2774 2504
   }
2775 2505
 
2776
-  // 第一次打开调度台页面初始化范围设置
2777
-  showInitModal: boolean = true;
2778
-  cancelInit() {
2779
-    this.showInitModal = false;
2780
-  }
2781
-
2782 2506
   closeModel(e) {
2783 2507
     if (e === "close") {
2784 2508
       this.newOrderShowOpen = false; //此时可出现新的弹窗

+ 2 - 0
src/app/views/fuwutai/fuwutai.module.ts

@@ -6,6 +6,7 @@ import { FuwutaiComponent } from './fuwutai.component';
6 6
 import { ShareModule } from 'src/app/share/share.module';
7 7
 
8 8
 import { NgxPrintModule } from 'ngx-print';
9
+import { OrderScopeModule } from 'src/app/components/order-scope/order-scope.module';
9 10
 
10 11
 
11 12
 @NgModule({
@@ -17,6 +18,7 @@ import { NgxPrintModule } from 'ngx-print';
17 18
     ShareModule,
18 19
     FuwutaiRoutingModule,
19 20
     NgxPrintModule,
21
+    OrderScopeModule,
20 22
   ]
21 23
 })
22 24
 export class FuwutaiModule { }