seimin hai 1 ano
pai
achega
6cac5b2839

+ 24 - 0
src/app/views/form-management-detail/form-management-detail-routing.module.ts

@@ -0,0 +1,24 @@
1
+import { NgModule } from '@angular/core';
2
+import { Routes, RouterModule } from '@angular/router';
3
+import { FormManagementDetailComponent } from './form-management-detail.component';
4
+import { AllocationWorkerComponent } from 'src/app/share/allocation-worker/allocation-worker.component';
5
+
6
+
7
+const routes: Routes = [
8
+  {
9
+    path: "",
10
+    component: FormManagementDetailComponent,
11
+    children: [
12
+      {
13
+        path: 'allotWorker/:id/:stateId/:flag/:hosId',
14
+        component: AllocationWorkerComponent
15
+      }
16
+    ]
17
+  },
18
+];
19
+
20
+@NgModule({
21
+  imports: [RouterModule.forChild(routes)],
22
+  exports: [RouterModule]
23
+})
24
+export class FormManagementDetailRoutingModule { }

+ 29 - 0
src/app/views/form-management-detail/form-management-detail.component.html

@@ -0,0 +1,29 @@
1
+<div class="detail">
2
+  <!-- 主体内容 -->
3
+  <div class="detail_content">
4
+    <div class="detail_item" *ngFor="let building of buildings">
5
+      <div class="detail_item_head">{{building.name}}</div>
6
+      <nz-list [nzDataSource]="building.departments" [nzRenderItem]="item" [nzGrid]="{ gutter: 16, xs: 24, sm: 12, md: 6, lg: 6, xl: 3 }">
7
+        <ng-template #item let-item>
8
+          <nz-list-item [nzContent]="nzContent">
9
+            <ng-template #nzContent>
10
+              <nz-card nzType="inner" [nzTitle]="item.name" [nzExtra]="extraTemplate">
11
+                <div *ngFor="let order of item.orders">{{order[11].slice(-4)}}-{{order[7]}} {{order[8]}}</div>
12
+                <ng-template #extraTemplate>
13
+                  <label nz-checkbox [(ngModel)]="item.checked" [nzDisabled]="!(item.orders[0][12] == 2 || (!item.orders[0][8] && item.orders[0][12] != 2))"></label>
14
+                </ng-template>
15
+              </nz-card>
16
+            </ng-template>
17
+          </nz-list-item>
18
+        </ng-template>
19
+      </nz-list>
20
+    </div>
21
+  </div>
22
+
23
+  <!-- 底部按钮 -->
24
+  <div class="foot_btns">
25
+    <button nz-button nzType="primary" (click)="batchDispatch()" class="mr8">批量派单</button>
26
+    <button nz-button (click)="toList()">返回列表</button>
27
+  </div>
28
+</div>
29
+<router-outlet (deactivate)="getList($event)"></router-outlet>

+ 43 - 0
src/app/views/form-management-detail/form-management-detail.component.less

@@ -0,0 +1,43 @@
1
+:host{
2
+  ::ng-deep .ant-card-body{
3
+    padding: 8px !important;
4
+  }
5
+  ::ng-deep .ant-card-head-title{
6
+    padding: 8px 0 !important;
7
+  }
8
+  ::ng-deep .ant-card-head{
9
+    padding: 0 8px !important;
10
+    min-height: auto !important;
11
+  }
12
+  .detail{
13
+    padding: 8px;
14
+  }
15
+  // 主体内容
16
+  .detail_content{
17
+    height: calc(100vh - 154px);
18
+    overflow-y: auto;
19
+    overflow-x: hidden;
20
+    .detail_item{
21
+      border-bottom: 1px solid #ccc;
22
+      .detail_item_head{
23
+        height: 66px;
24
+        display: flex;
25
+        justify-content: center;
26
+        align-items: center;
27
+        font-size: 30px;
28
+        font-weight: bold;
29
+      }
30
+    }
31
+  }
32
+
33
+  // 底部按钮
34
+  .foot_btns{
35
+    position: relative;
36
+    z-index: 9;
37
+    display: flex;
38
+    justify-content: center;
39
+    align-items: center;
40
+    height: 66px;
41
+    box-shadow: 0 -1px 4px rgba(0, 21, 41, 0.08);
42
+  }
43
+}

+ 100 - 0
src/app/views/form-management-detail/form-management-detail.component.ts

@@ -0,0 +1,100 @@
1
+import { Component, OnInit } from '@angular/core';
2
+import { Router, ActivatedRoute } from '@angular/router';
3
+import { MainService } from 'src/app/services/main.service';
4
+import { ToolService } from 'src/app/services/tool.service';
5
+import { NzMessageService } from 'ng-zorro-antd';
6
+
7
+@Component({
8
+  selector: 'app-form-management-detail',
9
+  templateUrl: './form-management-detail.component.html',
10
+  styleUrls: ['./form-management-detail.component.less']
11
+})
12
+export class FormManagementDetailComponent implements OnInit {
13
+
14
+  constructor(
15
+    private router: Router,
16
+    private mainService: MainService,
17
+    private route: ActivatedRoute,
18
+    private tool: ToolService,
19
+    private msg: NzMessageService,
20
+  ) { }
21
+
22
+  hosId; //院区
23
+  data = [];
24
+
25
+  ngOnInit() {
26
+    this.hosId = this.tool.getCurrentHospital().id;
27
+    this.getList();
28
+  }
29
+
30
+  // 返回列表
31
+  toList(){
32
+    this.router.navigateByUrl('/main/formManagement');
33
+  }
34
+
35
+  // 获取列表
36
+  buildings:any[] = [];
37
+  getList(){
38
+    let maskFlag = this.msg.loading("加载中", { nzDuration: 0 }).messageId;
39
+    this.mainService.listMsgByMain('reserveView', {
40
+      reserveFormId: +this.route.snapshot.paramMap.get('id')
41
+    }).subscribe((result: any) => {
42
+      this.msg.remove(maskFlag);
43
+      console.log(result);
44
+      const data = result.data || {};
45
+      console.log(data);
46
+      if(result.state == 200){
47
+        if(Object.keys(data).length > 0){
48
+          // 楼栋-楼层-科室-工单 转成前端可用的 楼栋-科室-工单
49
+          let buildings = Object.keys(data)
50
+          .map(v => ({
51
+            id: v,
52
+            name: Object.values(Object.values(data[v])[0])[0][0][3],
53
+            departments: (
54
+              Object.values(data[v]).map(vv => Object.keys(vv).map(vvv => ({id: vvv, name: vv[vvv][0][6], orders: vv[vvv]}))) as any
55
+            ).flat()
56
+          }));
57
+          console.log(buildings)
58
+          this.buildings = buildings;
59
+        }else{
60
+          this.buildings = [];
61
+        }
62
+      }else{
63
+        this.buildings = [];
64
+      }
65
+    })
66
+  }
67
+
68
+  // 批量分派
69
+  batchDispatch() {
70
+    console.log(this.buildings);
71
+    let arr = [];
72
+    this.buildings.forEach(v => {
73
+      v.departments.forEach(vv => {
74
+        if(vv.checked){
75
+          arr = arr.concat(vv.orders);
76
+        }
77
+      })
78
+    })
79
+    console.log(arr);
80
+    if(arr.length === 0){
81
+      this.msg.info('请勾选科室!');
82
+      return;
83
+    }
84
+    let ids_types = [];
85
+    let stateIds = [];
86
+    arr.forEach((item) => {
87
+      if (item[12] == 2) {
88
+        //普通派单
89
+        ids_types.push(`${item[9]}_assign`);
90
+      } else if (!item[8] && item[12] != 2) {
91
+        ids_types.push(`${item[9]}_reassign`);
92
+      }
93
+      stateIds.push(item[10]);
94
+    });
95
+    this.router.navigateByUrl(
96
+      `/main/formManagementDetail/${this.route.snapshot.paramMap.get('id')}/allotWorker/${ids_types.join("-")}/${stateIds.join("-")}/2/${this.hosId}`
97
+    );
98
+  }
99
+
100
+}

+ 17 - 0
src/app/views/form-management-detail/form-management-detail.module.ts

@@ -0,0 +1,17 @@
1
+import { NgModule } from '@angular/core';
2
+import { CommonModule } from '@angular/common';
3
+
4
+import { FormManagementDetailRoutingModule } from './form-management-detail-routing.module';
5
+import { FormManagementDetailComponent } from './form-management-detail.component';
6
+import { ShareModule } from 'src/app/share/share.module';
7
+
8
+
9
+@NgModule({
10
+  declarations: [FormManagementDetailComponent],
11
+  imports: [
12
+    CommonModule,
13
+    FormManagementDetailRoutingModule,
14
+    ShareModule,
15
+  ]
16
+})
17
+export class FormManagementDetailModule { }

+ 4 - 1
src/app/views/form-management/form-management-routing.module.ts

@@ -4,7 +4,10 @@ import { FormManagementComponent } from './form-management.component';
4 4
 
5 5
 
6 6
 const routes: Routes = [
7
-  { path: '', component: FormManagementComponent }
7
+  {
8
+    path: '',
9
+    component: FormManagementComponent,
10
+  }
8 11
 ];
9 12
 
10 13
 @NgModule({

+ 1 - 1
src/app/views/form-management/form-management.component.html

@@ -28,7 +28,7 @@
28 28
             <td>{{data.total}}</td>
29 29
             <td>
30 30
               <div class="coop">
31
-                <button nz-button nzType="link" (click)="supplementPrint(data)">查看视图</button>
31
+                <button nz-button nzType="link" (click)="lookView(data)">查看视图</button>
32 32
               </div>
33 33
             </td>
34 34
           </tr>

+ 11 - 1
src/app/views/form-management/form-management.component.ts

@@ -1,5 +1,5 @@
1 1
 import { Component, OnInit, ViewChild, ElementRef } from "@angular/core";
2
-import { ActivatedRoute } from "@angular/router";
2
+import { ActivatedRoute, Router } from "@angular/router";
3 3
 
4 4
 import { MainService } from "../../services/main.service";
5 5
 import { ToolService } from "../../services/tool.service";
@@ -16,6 +16,7 @@ export class FormManagementComponent implements OnInit {
16 16
     private route: ActivatedRoute,
17 17
     private tool: ToolService,
18 18
     private msg: NzMessageService,
19
+    private router: Router,
19 20
   ) {}
20 21
 
21 22
   userInfo: any = JSON.parse(localStorage.getItem("user")) || {}; //登录用户信息
@@ -150,6 +151,7 @@ export class FormManagementComponent implements OnInit {
150 151
       sum: this.pageSize,
151 152
       reserveForm: {
152 153
         hosId: this.hosId,
154
+        deleteFlag: 0,
153 155
       },
154 156
     };
155 157
     this.loading1 = true;
@@ -170,6 +172,7 @@ export class FormManagementComponent implements OnInit {
170 172
     let postData:any = {
171 173
       taskType: this.tasktypeId,
172 174
       hosId: this.hosId,
175
+      deleteFlag: 0,
173 176
     };
174 177
     this.isOkLoading = true;
175 178
     this.mainService
@@ -186,6 +189,13 @@ export class FormManagementComponent implements OnInit {
186 189
         }
187 190
       });
188 191
   }
192
+
193
+  // 查看视图
194
+  lookView(data){
195
+    this.router.navigateByUrl(
196
+      `/main/formManagementDetail/${data.id}`
197
+    );
198
+  }
189 199
 }
190 200
 
191 201
 

+ 8 - 0
src/app/views/main/main-routing.module.ts

@@ -204,6 +204,14 @@ const routes: Routes = [
204 204
           ),
205 205
       },
206 206
       {
207
+        // 表单管理列表
208
+        path: "formManagementDetail/:id",
209
+        loadChildren: () =>
210
+          import("../form-management-detail/form-management-detail.module").then(
211
+            (m) => m.FormManagementDetailModule
212
+          ),
213
+      },
214
+      {
207 215
         // 统计分析-综合统计
208 216
         path: "compreStatistics",
209 217
         loadChildren: () =>