瀏覽代碼

手术通知页面

seimin 1 年之前
父節點
當前提交
6964caea6b

+ 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.240",
4 4
     "logLevel": "debug",
5 5
     "changeOrigin": true,
6 6
     "pathRewrite": {

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

@@ -68,6 +68,11 @@ const routes: Routes = [
68 68
         path: "taskTypeManagement",
69 69
         loadChildren: () => import("../task-type-management/task-type-management.module").then((m) => m.TaskTypeManagementModule),
70 70
       },
71
+      // 手术通知
72
+      {
73
+        path: "operationNotice",
74
+        loadChildren: () => import("../operation-notice/operation-notice.module").then((m) => m.OperationNoticeModule),
75
+      },
71 76
       // 血制品页面控制
72 77
       {
73 78
         path: "bloodProductsConfig",

+ 14 - 0
src/app/views/operation-notice/operation-notice-routing.module.ts

@@ -0,0 +1,14 @@
1
+import { NgModule } from '@angular/core';
2
+import { Routes, RouterModule } from '@angular/router';
3
+import { OperationNoticeComponent } from './operation-notice.component';
4
+
5
+
6
+const routes: Routes = [
7
+  { path: '', component: OperationNoticeComponent }
8
+];
9
+
10
+@NgModule({
11
+  imports: [RouterModule.forChild(routes)],
12
+  exports: [RouterModule]
13
+})
14
+export class OperationNoticeRoutingModule { }

+ 75 - 0
src/app/views/operation-notice/operation-notice.component.html

@@ -0,0 +1,75 @@
1
+<div class="TaskTypeManagement">
2
+  <div class="taskType">
3
+    <div class="title">通知类型</div>
4
+    <div class="taskTypes" *ngIf="!taskTypeLoading">
5
+      <overlay-scrollbars #osComponentRef1 [ngStyle]="{ height:'100%' }">
6
+        <div>
7
+          <div class="item" *ngFor="let data of allTaskType" (click)="itemChoice(data)"
8
+            [ngClass]="{'itemChoice':allTaskTypeShow == data.taskName}" [title]="data.taskName">
9
+            {{data.taskName}}</div>
10
+        </div>
11
+      </overlay-scrollbars>
12
+    </div>
13
+    <div class="taskTypes" *ngIf="taskTypeLoading">
14
+      <div class="loadingFull display_flex justify-content_flex-center align-items_center">
15
+        <div class="loadingFullInner">
16
+          <img src="../../../assets/images/loading.gif" alt="">
17
+          <div>加载中...</div>
18
+        </div>
19
+      </div>
20
+    </div>
21
+  </div>
22
+  <div class="taskTypeInfo">
23
+    <div class="top" id="itemDes">
24
+      <div *ngFor="let tab of tabs" class="item" (click)="tabModal(tab.role)" [ngClass]="{'items':tabModalName == tab.role}" [ngStyle]="{'pointer-events': allTaskType.length ? 'auto' : 'none'}">
25
+        {{tabNames[tab.role]}}
26
+      </div>
27
+    </div>
28
+    <div class="list" *ngIf="!taskTypeLoading && allTaskType.length">
29
+      <ng-container *ngFor="let tab of tabs">
30
+        <div *ngIf="tabModalName == tab.role">
31
+          <div class="tabContent">
32
+            <label class="tabContent_checkbox" nz-checkbox [(ngModel)]="tab.phoneFlag">短信通知内容</label>
33
+            <div class="tabContent_textarea">
34
+              <textarea rows="4" nz-input [(ngModel)]="tab.phoneContent"></textarea>
35
+              <p>备注:[$变量名称$]可添加<span *ngFor="let item of variableNames; let last = last;" (click)="writeIn(tab, item, $event, 'phoneContent')"><strong>{{item}}</strong><em *ngIf="!last">、</em><em *ngIf="last">。</em></span></p>
36
+            </div>
37
+          </div>
38
+
39
+          <div class="tabContent">
40
+            <label class="tabContent_checkbox" nz-checkbox [(ngModel)]="tab.wechatFlag">微信通知内容</label>
41
+            <div class="tabContent_textarea">
42
+              <textarea rows="4" nz-input [(ngModel)]="tab.wechatContent"></textarea>
43
+              <p>备注:[$变量名称$]可添加<span *ngFor="let item of variableNames; let last = last;" (click)="writeIn(tab, item, $event, 'wechatContent')"><strong>{{item}}</strong><em *ngIf="!last">、</em><em *ngIf="last">。</em></span></p>
44
+            </div>
45
+          </div>
46
+        </div>
47
+      </ng-container>
48
+
49
+      <div class="bottom">
50
+        <button class="login-form-button" nzType="primary" [nzLoading]="loading5" nz-button (click)="submitForm()"
51
+          *ngIf="coopBtns.edit">保存</button>
52
+      </div>
53
+    </div>
54
+    <div class="list" *ngIf="!taskTypeLoading && !allTaskType.length">
55
+      <div class="loadingFull display_flex justify-content_flex-center align-items_center">
56
+        <div class="loadingFullInner">
57
+          <nz-empty></nz-empty>
58
+        </div>
59
+      </div>
60
+    </div>
61
+    <div class="list" *ngIf="taskTypeLoading">
62
+      <div class="loadingFull display_flex justify-content_flex-center align-items_center">
63
+        <div class="loadingFullInner">
64
+          <img src="../../../assets/images/loading.gif" alt="">
65
+          <div>加载中...</div>
66
+        </div>
67
+      </div>
68
+    </div>
69
+  </div>
70
+</div>
71
+
72
+<!-- 操作成功/失败提示框 -->
73
+<app-prompt-modal *ngIf="promptModalShow" [content]="promptContent" [success]="ifSuccess" [show]="promptModalShow"
74
+  [info]="errorInfo"></app-prompt-modal>
75
+

File diff suppressed because it is too large
+ 1273 - 0
src/app/views/operation-notice/operation-notice.component.less


+ 155 - 0
src/app/views/operation-notice/operation-notice.component.ts

@@ -0,0 +1,155 @@
1
+import { Component, OnInit } from '@angular/core';
2
+import { ToolService } from 'src/app/services/tool.service';
3
+import { MainService } from 'src/app/services/main.service';
4
+import { ActivatedRoute } from '@angular/router';
5
+import { KeyValue } from '@angular/common';
6
+
7
+@Component({
8
+  selector: 'app-operation-notice',
9
+  templateUrl: './operation-notice.component.html',
10
+  styleUrls: ['./operation-notice.component.less']
11
+})
12
+export class OperationNoticeComponent implements OnInit {
13
+
14
+  hosId; //当前院区
15
+  allTaskType = []; //通知类型列表
16
+  allTaskTypeShow; //通知类型列表选择标识
17
+  taskTypeLoading = false; //通知类型加载中
18
+  tabModalName = ""; //详情tab字段
19
+  // 初始化增删改按钮
20
+  coopBtns: any = {};
21
+
22
+  variableNames = ['[$患者姓名$]', '[$主刀医生姓名$]', '[$麻醉医师姓名$]', '[$护士姓名$]', '[$助理医生姓名$]', '[$科室名称$]', '[$手术名称$]', '[$手术时间$]', '[$手术间名称$]'];
23
+
24
+  tabs:any[] = [];
25
+  tabNames = {
26
+    doctor: '主刀医生',
27
+    docAssistant: '助理医生',
28
+    anesthetist: '麻醉医师',
29
+    patient: '手术患者',
30
+  }
31
+
32
+  constructor(
33
+    private tool: ToolService,
34
+    private mainService: MainService,
35
+    private route: ActivatedRoute,
36
+  ) { }
37
+
38
+  ngOnInit() {
39
+    this.hosId = this.tool.getCurrentHospital().id;
40
+    this.coopBtns = this.tool.initCoopBtns(this.route);
41
+    this.getAllTaskType(); //通知类型列表
42
+  }
43
+
44
+  originalOrder = (a: KeyValue<number,string>, b: KeyValue<number,string>): number => {
45
+    return 0;
46
+  }
47
+
48
+  //通知类型列表
49
+  getAllTaskType() {
50
+    this.allTaskType = [{
51
+      id: 1,
52
+      taskName: '手术即将开始通知',
53
+      code: 'surgery_begin',
54
+    }];
55
+    if (this.allTaskType.length) {
56
+      this.itemChoice(this.allTaskType[0]);
57
+    }
58
+  }
59
+
60
+  // 选中通知类型
61
+  currentChoice;
62
+  itemChoice(data){
63
+    this.currentChoice = data;
64
+    this.allTaskTypeShow = data.taskName;
65
+    console.log(data);
66
+    let postData = {
67
+      idx: 0,
68
+      sum: 9999,
69
+      transportMessage: {
70
+        hosId: this.hosId,
71
+        code: data.code,
72
+      },
73
+    };
74
+    this.taskTypeLoading = true;
75
+    this.mainService
76
+      .getFetchDataList("simple/data", "transportMessage", postData)
77
+      .subscribe((data) => {
78
+        this.taskTypeLoading = false;
79
+        if (data.status == 200) {
80
+          data.list = data.list || [];
81
+          data.list.forEach(v => {
82
+            v.phoneFlag = v.phoneFlag === 1;
83
+            v.wechatFlag = v.wechatFlag === 1;
84
+          })
85
+          this.tabs = data.list || [];
86
+          // 没有选中则默认第一项
87
+          !this.tabModalName && this.tabModal(this.tabs[0].role);
88
+        }
89
+      });
90
+  }
91
+
92
+  //详情tab
93
+  tabModal(name) {
94
+    if (!this.allTaskType.length) {
95
+      return;
96
+    }
97
+    this.tabModalName = name;
98
+  }
99
+
100
+  // 写入
101
+  writeIn(tab, content, event, type){
102
+    var element = event.target.parentElement.parentElement.previousElementSibling;
103
+    if (element.selectionStart || element.selectionStart == '0') {
104
+        var startPos = element.selectionStart;
105
+        var endPos = element.selectionEnd;
106
+        tab[type] = element.value.substring(0, startPos) + content + element.value.substring(endPos);
107
+        element.focus();
108
+        setTimeout(() => {
109
+          element.setSelectionRange(startPos + content.length, startPos + content.length);
110
+        },0)
111
+    } else {
112
+        var val = element.value + content;
113
+        tab[type] = val;
114
+        element.focus();
115
+    }
116
+  }
117
+
118
+  // 展示信息提示框
119
+  promptContent: string; //操作提示框提示信息
120
+  ifSuccess: boolean; //操作成功/失败
121
+  errorInfo: string; //操作失败原因提示信息
122
+  promptModalShow: boolean; //操作提示框是否展示
123
+  showPromptModal(con, success, errorInfo?) {
124
+    this.promptModalShow = false;
125
+    this.promptContent = con;
126
+    this.ifSuccess = success;
127
+    if (errorInfo !== undefined) {
128
+      this.errorInfo = errorInfo;
129
+    }
130
+    setTimeout(() => {
131
+      this.promptModalShow = true;
132
+    }, 100);
133
+  }
134
+
135
+  //提交数据
136
+  loading5 = false; //保存按钮loading
137
+  submitForm() {
138
+    this.loading5 = true;
139
+    this.tabs.forEach(v => {
140
+      v.phoneFlag = v.phoneFlag ? 1 : 0;
141
+      v.wechatFlag = v.wechatFlag ? 1 : 0;
142
+    })
143
+    this.mainService
144
+      .simplePost("addListData", "transportMessage", this.tabs)
145
+      .subscribe((data) => {
146
+        this.loading5 = false;
147
+        if (data.status == 200) {
148
+          this.showPromptModal("保存", true, "成功");
149
+          this.itemChoice(this.currentChoice);
150
+        } else {
151
+          this.showPromptModal("保存", false, data.msg);
152
+        }
153
+      });
154
+  }
155
+}

+ 19 - 0
src/app/views/operation-notice/operation-notice.module.ts

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

+ 9 - 0
src/app/views/operation-notice/operation-notice.service.ts

@@ -0,0 +1,9 @@
1
+import { Injectable } from '@angular/core';
2
+
3
+@Injectable({
4
+  providedIn: 'root'
5
+})
6
+export class OperationNoticeService {
7
+
8
+  constructor() { }
9
+}

+ 1 - 1
src/main.ts

@@ -8,7 +8,7 @@ if (environment.production) {
8 8
   enableProdMode();
9 9
   if (window) {
10 10
     window.console.log = function () { };
11
-    console.info('v2.4.45');
11
+    console.info('v2.4.46');
12 12
   }
13 13
 }
14 14
 platformBrowserDynamic().bootstrapModule(AppModule)