Browse Source

暂存问卷调查

seimin 2 years ago
parent
commit
19dbeac952

+ 8 - 0
src/app/services/main.service.ts

@@ -384,6 +384,14 @@ export class MainService {
384 384
       { headers: this.headers }
385 385
     );
386 386
   }
387
+  //api增删改查
388
+  apiPost(coop, type, data): any {
389
+    return this.http.post(
390
+      host.host + "/api/" + coop + "/" + type,
391
+      data,
392
+      { headers: this.headers }
393
+    );
394
+  }
387 395
   //获取工单详情里的历史记录
388 396
   getWorkOrderRecord(data): any {
389 397
     return this.http.post(host.host + "/workerOrder/getWorkOrderRecord", data, {

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

@@ -367,6 +367,14 @@ const routes: Routes = [
367 367
             "../tasktype-order-source-statistics/tasktype-order-source-statistics.module"
368 368
           ).then((m) => m.TasktypeOrderSourceStatisticsModule),
369 369
       },
370
+      {
371
+        // 问卷调查管理列表
372
+        path: "questionnaireManagement",
373
+        loadChildren: () =>
374
+          import("../questionnaire-management/questionnaire-management.module").then(
375
+            (m) => m.QuestionnaireManagementModule
376
+          ),
377
+      },
370 378
     ],
371 379
   },
372 380
 ];

+ 14 - 0
src/app/views/questionnaire-management/questionnaire-management-routing.module.ts

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

+ 125 - 0
src/app/views/questionnaire-management/questionnaire-management.component.html

@@ -0,0 +1,125 @@
1
+<div class="list-template">
2
+    <div class="list-template__content">
3
+      <div class="list-template__top" nz-row>
4
+        <div nz-col nzXl='18' class="list-template__searchBox"></div>
5
+        <div nz-col nzLg="6" class="list-template__btns">
6
+          <button nz-button *ngIf="coopBtns.add" class="btn default" (click)="addModal()">新增</button>
7
+        </div>
8
+      </div>
9
+      <div class="list-template__bottom">
10
+        <nz-table class="list-template__nzTable" [nzData]="listOfData" nzSize="middle" [nzShowPagination]="false"
11
+          [nzLoading]="loading1">
12
+          <thead>
13
+            <tr class="thead">
14
+              <th nzWidth="15%">问卷标题</th>
15
+              <th nzWidth="27%">调查目标</th>
16
+              <th nzWidth="7%">创建时间</th>
17
+              <th nzWidth="8%">状态</th>
18
+              <th nzWidth="15%">答题数量</th>
19
+              <th nzWidth="28%">操作</th>
20
+            </tr>
21
+          </thead>
22
+          <tbody>
23
+            <tr *ngFor="let data of listOfData;let i = index">
24
+              <td>{{data.name}}</td>
25
+              <td>{{data.describe}}</td>
26
+              <td>{{data.workType == 1?'综合排班':'自选排班'}}</td>
27
+              <td>{{data.status?'启用中':'停用中'}}</td>
28
+              <td>{{data.startTime?data.startTime:'-'}}</td>
29
+              <td>
30
+                <div class="coop">
31
+                  <span *ngIf="coopBtns.isStartUp"
32
+                    (click)="showDelModal(data,'启用【'+data.name+'】将会停用正在使用的方案,您是否确定启用【'+data.name+'】?','启用','switch',data.status)">启用</span>
33
+                  <span *ngIf="coopBtns.isTimedStartUp&&!data.status"
34
+                    (click)="addDateModal(data)">{{data.timingStatus?'关闭定时启用':'定时启用'}}</span>
35
+                  <span *ngIf="coopBtns.del&&!data.status" (click)="showDelModal(data,'您确认要删除此方案吗?','删除','del')">删除</span>
36
+                  <span *ngIf="coopBtns.copy" (click)="copy(data)">复制</span>
37
+                  <span *ngIf="coopBtns.edit" (click)="edit(data)">编辑</span>
38
+                </div>
39
+              </td>
40
+            </tr>
41
+          </tbody>
42
+        </nz-table>
43
+        <div class="list-template__pagination">
44
+          <nz-pagination [(nzPageIndex)]="pageIndex" [(nzTotal)]="listLength" [(nzPageSize)]="pageSize"
45
+            (nzPageIndexChange)="getList(0)" (nzPageSizeChange)="getList(0)">
46
+          </nz-pagination>
47
+        </div>
48
+      </div>
49
+    </div>
50
+  
51
+    <!-- 新增/编辑/复制模态框 -->
52
+    <div class="save display_flex justify-content_flex-center align-items_center add" *ngIf="modal">
53
+      <div class="modalBody">
54
+        <div class="title">{{modelName}}<i class="icon_transport transport-guanbi" (click)="hideAddModal()"></i></div>
55
+        <div class="content">
56
+          <form nz-form [formGroup]="validateForm" class="addForm">
57
+            <nz-form-item>
58
+              <nz-form-label [nzSpan]="24" nzRequired nzFor="title">问卷标题</nz-form-label>
59
+              <nz-form-control nzErrorTip="请输入问卷标题!">
60
+                <nz-input-group>
61
+                  <input nz-input formControlName="title" placeholder="请输入问卷标题" />
62
+                </nz-input-group>
63
+              </nz-form-control>
64
+            </nz-form-item>
65
+            <nz-form-item>
66
+              <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="surveyDescribe">问卷描述</nz-form-label>
67
+              <nz-form-control nzErrorTip="请输入问卷描述!">
68
+                <nz-input-group>
69
+                  <textarea class="surveyDescribe" formControlName="surveyDescribe" nz-input
70
+                    placeholder="请输入问卷描述"></textarea>
71
+                </nz-input-group>
72
+              </nz-form-control>
73
+            </nz-form-item>
74
+            <nz-form-item>
75
+              <nz-form-label [nzSpan]="6" [nzXs]="24" nzRequired nzFor="surveyTarget">调查目标</nz-form-label>
76
+              <nz-form-control nzErrorTip="请输入调查目标!">
77
+                <nz-select [nzDropdownMatchSelectWidth]="false" formControlName="surveyTarget" nzShowSearch nzPlaceHolder="请选择调研目标">
78
+                  <nz-option nzLabel="{{data.name}}" nzValue="{{data.id}}" *ngFor="let data of surveyTargets"></nz-option>
79
+                </nz-select>
80
+              </nz-form-control>
81
+            </nz-form-item>
82
+          </form>
83
+        </div>
84
+        <div class=" display_flex justify-content_flex-center">
85
+          <button nzType="primary" nz-button (click)="submitForm()" [nzLoading]="btnLoading">配置问题</button>
86
+          <!-- <button class="btn" nzGhost nzType="primary" nz-button (click)="submitForm(true)" [nzLoading]="btnLoading1"
87
+            *ngIf="copyModel||!add">完成配置</button> -->
88
+          <button class="btn cancel" nz-button nzType="default" (click)="hideAddModal()">取消</button>
89
+        </div>
90
+      </div>
91
+    </div>
92
+    <!-- 定时启用设置日期模态框 -->
93
+    <div class="save display_flex justify-content_flex-center align-items_center add" *ngIf="dateModal">
94
+      <div class="modalBody">
95
+        <div class="title">定时启用<i class="icon_transport transport-guanbi" (click)="hideDateModal()"></i>
96
+        </div>
97
+        <div class="content">
98
+          <form nz-form [formGroup]="validateDateForm" class="addForm" (ngSubmit)="submitDateForm()">
99
+            <nz-form-item>
100
+              <nz-form-label [nzSm]="24" [nzXs]="24" nzRequired nzFor="datePickerTime">选择日期</nz-form-label>
101
+              <nz-form-control [nzSm]="24" [nzXs]="24" nzErrorTip="请选择日期!">
102
+                <nz-date-picker [ngModel]="datePicker" (ngModelChange)="datePickerChange($event)"
103
+                  [nzShowTime]="{ nzDefaultOpenValue: timeDefaultValue }" formControlName="datePickerTime"
104
+                  [nzDisabledTime]="disabledDateTime"></nz-date-picker>
105
+              </nz-form-control>
106
+            </nz-form-item>
107
+          </form>
108
+        </div>
109
+        <div class=" display_flex justify-content_flex-center">
110
+          <button nzType="primary" nz-button (click)="submitDateForm()" [nzLoading]="btnLoading">确定</button>
111
+          <button class="btn cancel" nz-button nzType="default" (click)="hideDateModal()">取消</button>
112
+        </div>
113
+      </div>
114
+    </div>
115
+    <!-- 删除模态框 -->
116
+    <app-dialog-delete [delModal]="delModal" (hideDelModalEvent)="hideDelModal()" [btnLoading]="btnLoading"
117
+      (confirmDelEvent)="confirmDel()" [content]="tipsMsg1"></app-dialog-delete>
118
+  </div>
119
+  <!-- 操作成功/失败提示框 -->
120
+  <app-prompt-modal *ngIf="promptModalShow" [content]="promptContent" [success]="ifSuccess" [show]="promptModalShow"
121
+    [info]="promptInfo">
122
+  </app-prompt-modal>
123
+  <!-- 查看详情 -->
124
+  <router-outlet></router-outlet>
125
+  

+ 167 - 0
src/app/views/questionnaire-management/questionnaire-management.component.less

@@ -0,0 +1,167 @@
1
+@import "../../../../src/theme.less";
2
+
3
+:host {
4
+  ::ng-deep .ant-calendar-picker {
5
+    width: 100% !important;
6
+  }
7
+}
8
+.save {
9
+  position: fixed;
10
+  left: 0;
11
+  top: 0;
12
+  width: 100%;
13
+  height: 100%;
14
+  background: rgba(0, 0, 0, 0.4);
15
+  z-index: 99;
16
+
17
+  .modalBody {
18
+    width: 350px;
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
+      background: #f9fafb;
44
+      border: 1px solid #e5e9ed;
45
+      border-radius: 5px;
46
+      overflow: hidden;
47
+      margin-top: 12px;
48
+      padding: 16px 0;
49
+
50
+      & > div {
51
+        text-align: center;
52
+        margin: 0;
53
+
54
+        &.icon {
55
+          // margin-top: 17px;
56
+
57
+          i {
58
+            color: #34b349;
59
+            font-size: 30px !important;
60
+
61
+            &.transport-wenhao {
62
+              color: #f5a523;
63
+            }
64
+
65
+            &.transport-shibai {
66
+              color: #ff3a52;
67
+            }
68
+          }
69
+        }
70
+
71
+        &.defeat {
72
+          color: #333;
73
+          font-size: 14px;
74
+        }
75
+
76
+        &:nth-child(3) {
77
+          font-size: 14px;
78
+          color: #666;
79
+        }
80
+      }
81
+      .workAssignmentTips {
82
+        font-size: 12px;
83
+      }
84
+    }
85
+
86
+    button {
87
+      margin-top: 10px;
88
+
89
+      &.btn {
90
+        margin-left: 8px;
91
+      }
92
+    }
93
+  }
94
+
95
+  // 新增
96
+  &.add {
97
+    .modalBody {
98
+      width: 480px;
99
+      height: auto;
100
+
101
+      .content {
102
+        width: 100%;
103
+        height: auto;
104
+        padding: 16px;
105
+        max-height: 497px;
106
+        overflow-y: auto;
107
+
108
+        .addForm {
109
+          .surveyDescribe {
110
+            margin-top: 8px;
111
+          }
112
+          .ant-form-item {
113
+            margin-bottom: 0;
114
+
115
+            .ant-form-item-label {
116
+              text-align: left;
117
+            }
118
+
119
+            .desc {
120
+              margin-top: 5px;
121
+            }
122
+          }
123
+
124
+          .datesControl {
125
+            margin-top: -16px;
126
+
127
+            .ant-form-item-label {
128
+              line-height: 40px;
129
+            }
130
+          }
131
+
132
+          .timer {
133
+            .ant-form-item-label {
134
+              width: 100%;
135
+              text-align: left;
136
+            }
137
+
138
+            .numInp {
139
+              margin-right: 5px;
140
+            }
141
+
142
+            .line {
143
+              margin-right: 5px;
144
+            }
145
+          }
146
+
147
+          .timer2 {
148
+            .ant-form-item-label {
149
+              line-height: 20px;
150
+            }
151
+          }
152
+        }
153
+
154
+        .editForm {
155
+          .ant-form-item {
156
+            margin-bottom: 15px;
157
+
158
+            .ant-form-item-label {
159
+              line-height: 14px;
160
+              text-align: left;
161
+            }
162
+          }
163
+        }
164
+      }
165
+    }
166
+  }
167
+}

+ 466 - 0
src/app/views/questionnaire-management/questionnaire-management.component.ts

@@ -0,0 +1,466 @@
1
+import { Component, OnInit } from "@angular/core";
2
+import { ActivatedRoute, Router } from "@angular/router";
3
+import { FormBuilder, Validators, FormGroup } from "@angular/forms";
4
+import setSeconds from "date-fns/setSeconds";
5
+import setMinutes from "date-fns/setMinutes";
6
+import setHours from "date-fns/setHours";
7
+
8
+import { MainService } from "../../services/main.service";
9
+import { DisabledTimeFn } from "ng-zorro-antd/date-picker/standard-types";
10
+import { ToolService } from "../../services/tool.service";
11
+@Component({
12
+  selector: "app-questionnaire-management",
13
+  templateUrl: "./questionnaire-management.component.html",
14
+  styleUrls: ["./questionnaire-management.component.less"],
15
+})
16
+export class QuestionnaireManagementComponent implements OnInit {
17
+  constructor(
18
+    private fb: FormBuilder,
19
+    private mainService: MainService,
20
+    private route: ActivatedRoute,
21
+    private router: Router,
22
+    private tool: ToolService
23
+  ) {}
24
+
25
+  userInfo: any = JSON.parse(localStorage.getItem("user")) || {}; //登录用户信息
26
+  listOfData: any[] = []; //表格数据
27
+  pageIndex: number = 1; //表格当前页码
28
+  pageSize: number = 10; //表格每页展示条数
29
+  listLength: number = 10; //表格总数据量
30
+  tableHeight: number; //表格动态高
31
+  modal: boolean = false; //新增/编辑模态框
32
+  dateModal: boolean = false; //定时启用设置日期模态框
33
+  add: boolean; //true:新增;false:编辑
34
+  validateForm: FormGroup; //新增/编辑表单
35
+  validateDateForm: FormGroup; //定时启动设置日期表单
36
+  coopId: any; //当前操作列
37
+  currentHospital; //当前院区
38
+  timeDefaultValue = setHours(setMinutes(setSeconds(new Date(), 0), 0), 0);
39
+
40
+  btnLoading: boolean = false; //提交按钮loading状态
41
+
42
+  promptContent: string; //操作提示框提示信息
43
+  ifSuccess: boolean; //操作成功/失败
44
+  promptInfo: string; //操作结果提示信息
45
+  promptModalShow: boolean; //操作提示框是否展示
46
+  nextSchemeName = ""; //下一个开启的方案名称
47
+  modelName = ""; //模态框名称
48
+
49
+  ngOnInit() {
50
+    this.currentHospital = this.tool.getCurrentHospital();
51
+    this.coopBtns = this.tool.initCoopBtns(this.route);
52
+    this.initForm();
53
+    this.getList(1);
54
+    this.getSurveyTarget();
55
+  }
56
+
57
+  // 初始化增删改按钮
58
+  coopBtns: any = {};
59
+
60
+  // 获取字典数据-调查目标
61
+  surveyTargets: any[] = [];
62
+  getSurveyTarget() {
63
+    this.mainService
64
+      .getDictionary("list", "survey_target")
65
+      .subscribe((data) => {
66
+        this.surveyTargets = data;
67
+      });
68
+  }
69
+
70
+  // 表格数据
71
+  loading1 = false;
72
+  getList(type) {
73
+    if (type == 1) {
74
+      this.pageIndex = 1;
75
+    }
76
+    let data = {
77
+      idx: this.pageIndex - 1,
78
+      sum: this.pageSize,
79
+      workScheme: {
80
+        hosId: this.currentHospital.id,
81
+      },
82
+    };
83
+    this.loading1 = true;
84
+    this.mainService
85
+      .getFetchDataList("configuration", "workScheme", data)
86
+      .subscribe((data) => {
87
+        this.loading1 = false;
88
+        if (data.status == 200) {
89
+          this.listOfData = data.list;
90
+          this.listLength = data.totalNum;
91
+        }
92
+      });
93
+  }
94
+
95
+  // 新增弹框
96
+  addModal() {
97
+    this.modelName = "新增";
98
+    this.add = true; //新增
99
+    this.modal = true;
100
+    this.copyModel = false;
101
+    this.initForm();
102
+  }
103
+  //关闭新增/编辑弹框
104
+  hideAddModal() {
105
+    this.modal = false;
106
+    this.initForm();
107
+  }
108
+  // 新增/编辑弹框
109
+  timeFlag = ""; //open开启,close关闭
110
+  addDateModal(data) {
111
+    if (!data.timingStatus) {
112
+      this.datePicker = "";
113
+    }
114
+    this.timeFlag = data.timingStatus ? "close" : "open";
115
+    this.coopId = data;
116
+    if (this.timeFlag == "close") {
117
+      this.showDelModal(
118
+        data,
119
+        "是否确定关闭定时启用?确定后该方案将不会执行!",
120
+        "关闭定时启用",
121
+        "switchTime"
122
+      );
123
+    } else {
124
+      this.dateModal = true;
125
+    }
126
+    this.initDateForm();
127
+  }
128
+  //关闭定时启用设置日期弹框
129
+  hideDateModal() {
130
+    this.dateModal = false;
131
+    this.initDateForm();
132
+  }
133
+  // 初始化新增form表单
134
+  initForm() {
135
+    this.validateForm = this.fb.group({
136
+      title: [null, [Validators.required]],
137
+      surveyTarget: [null, [Validators.required]],
138
+      surveyDescribe: [null, [Validators.required]],
139
+    });
140
+  }
141
+  // 初始化新增form表单
142
+  initDateForm() {
143
+    this.validateDateForm = this.fb.group({
144
+      datePickerTime: [null, [Validators.required]],
145
+    });
146
+  }
147
+
148
+  // 新增/编辑表单提交
149
+  btnLoading1 = false; //完成
150
+  submitForm(noGoTo?): void {
151
+    for (const i in this.validateForm.controls) {
152
+      this.validateForm.controls[i].markAsDirty();
153
+      this.validateForm.controls[i].updateValueAndValidity();
154
+    }
155
+    if (this.validateForm.invalid) {
156
+      return;
157
+    }
158
+    if (noGoTo) {
159
+      this.btnLoading1 = true;
160
+    } else {
161
+      this.btnLoading = true;
162
+    }
163
+    let data = {};
164
+
165
+    if (this.add) {
166
+      //增加
167
+      data = {
168
+        questionnaireManagement: {
169
+          title: this.validateForm.value.title,
170
+          surveyTarget: { id: parseInt(this.validateForm.value.surveyTarget) },
171
+          surveyDescribe: this.validateForm.value.surveyDescribe,
172
+          hosId: this.currentHospital.id,
173
+        },
174
+      };
175
+    } else {
176
+      //编辑
177
+      data = {
178
+        questionnaireManagement: {
179
+          id: this.coopId.id,
180
+          title: this.validateForm.value.title,
181
+          surveyTarget: this.validateForm.value.surveyTarget,
182
+          surveyDescribe: this.validateForm.value.surveyDescribe,
183
+          hosId: this.currentHospital.id,
184
+        },
185
+      };
186
+    }
187
+    if (this.copyModel) {
188
+      //复制
189
+      data = {
190
+        workScheme: {
191
+          name: this.validateForm.value.title,
192
+          workType: this.validateForm.value.surveyTarget,
193
+          describe: this.validateForm.value.surveyDescribe,
194
+          status: 0,
195
+          copy: 1,
196
+          copySchemeId: this.coopId.id,
197
+          hosId: this.currentHospital.id,
198
+        },
199
+      };
200
+    }
201
+    this.mainService
202
+      .apiPost("addData", "questionnaireManagement", data)
203
+      .subscribe((result) => {
204
+        if (noGoTo) {
205
+          this.btnLoading1 = false;
206
+        } else {
207
+          this.btnLoading = false;
208
+        }
209
+        this.hideAddModal();
210
+        this.initForm();
211
+        if (result.status == 200) {
212
+          if (this.copyModel) {
213
+            //复制
214
+            this.listLength++;
215
+            this.showPromptModal("复制", true, "");
216
+            if (!noGoTo) {
217
+              this.router.navigateByUrl(
218
+                `/main/quickCombination?id=${result.data.id}&name=${result.data.name}&type=${result.data.workType}`
219
+              );
220
+            }
221
+            return;
222
+          }
223
+          if (!this.add) {
224
+            //编辑
225
+            this.showPromptModal("编辑", true, "");
226
+            if (!noGoTo) {
227
+              this.router.navigateByUrl(
228
+                `/main/quickCombination?id=${result.data.id}&name=${result.data.name}&type=${result.data.workType}`
229
+              );
230
+            }
231
+            return;
232
+          }
233
+          if (this.add) {
234
+            this.listLength++;
235
+          }
236
+          return;
237
+          this.router.navigateByUrl(
238
+            `/main/quickCombination?id=${result.data.id}&name=${result.data.name}&type=${result.data.workType}`
239
+          );
240
+        } else {
241
+          let msg = "";
242
+          if (this.add) {
243
+            msg = "新增";
244
+          } else {
245
+            msg = "修改";
246
+          }
247
+          if (this.copyModel) {
248
+            msg = "复制";
249
+          }
250
+          this.showPromptModal(msg, false, result.msg);
251
+        }
252
+      });
253
+  }
254
+  // 时间选择范围
255
+  disabledDateTime: DisabledTimeFn = () => {
256
+    return {
257
+      nzDisabledHours: () => [],
258
+      nzDisabledMinutes: () => [],
259
+      nzDisabledSeconds: () => this.range(1, 60),
260
+    };
261
+  };
262
+  range(start: number, end: number): number[] {
263
+    const result: number[] = [];
264
+    for (let i = start; i < end; i++) {
265
+      result.push(i);
266
+    }
267
+    return result;
268
+  }
269
+  // 选择日期表单提交
270
+  submitDateForm(): void {
271
+    this.btnLoading = true;
272
+    for (const i in this.validateDateForm.controls) {
273
+      this.validateDateForm.controls[i].markAsDirty();
274
+      this.validateDateForm.controls[i].updateValueAndValidity();
275
+    }
276
+    if (this.validateDateForm.invalid) {
277
+      this.btnLoading = false;
278
+      return;
279
+    }
280
+    let data = {};
281
+    let todayDate = new Date(this.validateDateForm.value.datePickerTime);
282
+    let year = todayDate.getFullYear();
283
+    let month = (todayDate.getMonth() + 1).toString().padStart(2, "0");
284
+    let date = todayDate.getDate().toString().padStart(2, "0");
285
+    let hour = todayDate.getHours().toString().padStart(2, "0");
286
+    let minutes = todayDate.getMinutes().toString().padStart(2, "0");
287
+    // 2020-07-28 16:45:00
288
+    data = {
289
+      workScheme: {
290
+        id: this.coopId.id,
291
+        timingStatus: 1,
292
+        startTime: `${year}-${month}-${date} ${hour}:${minutes}:00`,
293
+        hosId: this.currentHospital.id,
294
+      },
295
+    };
296
+    this.mainService
297
+      .coopTypeConfig("addData", "workScheme", data)
298
+      .subscribe((data) => {
299
+        this.btnLoading = false;
300
+        this.hideDateModal();
301
+        this.initDateForm();
302
+        if (data.status == 200) {
303
+          this.listLength++;
304
+          this.showPromptModal("定时启用时间设置", true, "");
305
+        } else {
306
+          this.showPromptModal("定时启用时间设置", false, data.msg);
307
+        }
308
+      });
309
+  }
310
+
311
+  // 编辑
312
+  edit(data) {
313
+    console.log(data);
314
+    this.modelName = "编辑";
315
+    this.add = false;
316
+    this.modal = true;
317
+    this.coopId = data;
318
+    this.copyModel = false;
319
+    this.validateForm.controls.title.setValue(data.name); //名称
320
+    this.validateForm.controls.surveyTarget.setValue(data.workType + ""); //类型
321
+    this.validateForm.controls.surveyDescribe.setValue(data.describe); //描述
322
+  }
323
+  //复制
324
+  copyModel = false; //复制
325
+  copy(data) {
326
+    this.modelName = "复制";
327
+    this.copyModel = true;
328
+    this.modal = true;
329
+    this.coopId = data;
330
+    this.validateForm.controls.title.setValue(data.name); //名称
331
+    this.validateForm.controls.surveyTarget.setValue(data.workType + ""); //类型
332
+    this.validateForm.controls.surveyDescribe.setValue(data.describe); //描述
333
+  }
334
+
335
+  // 展示信息提示框(con:提示信息,success:操作是否成功,promptInfo:操作结果提示信息)
336
+  // promptModalUrl = '';
337
+  showPromptModal(con, success, promptInfo?) {
338
+    this.promptModalShow = false;
339
+    this.promptContent = con;
340
+    this.ifSuccess = success;
341
+    this.promptInfo = promptInfo;
342
+    // this.promptModalUrl = url;
343
+    setTimeout(() => {
344
+      this.promptModalShow = true;
345
+    }, 100);
346
+    this.getList(0);
347
+  }
348
+
349
+  // 启用
350
+  delModal: boolean = false; //删除模态框
351
+  tipsMsg1: string; //提示框信息
352
+  tipsMsg2: string; //操作后信息
353
+  confirmDelType: string; //确认的类型(启用/停用,删除)
354
+  confirmDelIsSwitch: boolean; //启用/停用
355
+  showDelModal(
356
+    data,
357
+    tipsMsg1: string,
358
+    tipsMsg2: string,
359
+    type: string,
360
+    isSwitch?: boolean
361
+  ) {
362
+    this.confirmDelIsSwitch = isSwitch;
363
+    this.confirmDelType = type;
364
+    this.delModal = true;
365
+    this.coopId = data;
366
+    this.tipsMsg1 = tipsMsg1;
367
+    this.tipsMsg2 = tipsMsg2;
368
+  }
369
+  // 隐藏删除框
370
+  hideDelModal() {
371
+    this.delModal = false;
372
+  }
373
+  // 确认删除
374
+  confirmDel() {
375
+    this.btnLoading = true;
376
+    if (this.confirmDelType === "del") {
377
+      //删除
378
+      this.mainService
379
+        .coopTypeConfig("rmvData", "workScheme", [this.coopId.id])
380
+        .subscribe((data) => {
381
+          this.btnLoading = false;
382
+          this.delModal = false;
383
+          if (data.status == 200) {
384
+            if (
385
+              this.listOfData.length == 1 &&
386
+              this.pageIndex == Math.ceil(this.listLength / this.pageSize)
387
+            ) {
388
+              this.listLength--;
389
+              if (this.listLength === 0) {
390
+                this.pageIndex = 1;
391
+              } else {
392
+                this.pageIndex = Math.ceil(this.listLength / this.pageSize);
393
+              }
394
+            }
395
+            this.showPromptModal(this.tipsMsg2, true, "");
396
+          } else {
397
+            this.showPromptModal(this.tipsMsg2, false, data.msg);
398
+          }
399
+        });
400
+    } else if (this.confirmDelType === "switch") {
401
+      //启用
402
+      let data = {
403
+        workScheme: {
404
+          id: this.coopId.id,
405
+          hosId: this.currentHospital.id,
406
+          status: 1,
407
+          workType: this.coopId.workType,
408
+        },
409
+      };
410
+      this.mainService
411
+        .coopConfig("activeWorkScheme", data)
412
+        .subscribe((result) => {
413
+          this.btnLoading = false;
414
+          this.delModal = false;
415
+          if (result.status == 200) {
416
+            this.showPromptModal(this.tipsMsg2, true, "");
417
+          } else {
418
+            this.showPromptModal(this.tipsMsg2, false, result.msg);
419
+          }
420
+        });
421
+    } else if (this.confirmDelType === "switchTime") {
422
+      //关闭定时启用
423
+      let data = {
424
+        workScheme: {
425
+          id: this.coopId.id,
426
+          hosId: this.currentHospital.id,
427
+          timingStatus: 0,
428
+        },
429
+      };
430
+      this.mainService
431
+        .coopTypeConfig("addData", "workScheme", data)
432
+        .subscribe((result) => {
433
+          this.btnLoading = false;
434
+          this.delModal = false;
435
+          if (result.status == 200) {
436
+            this.showPromptModal(this.tipsMsg2, true, "");
437
+          } else {
438
+            this.showPromptModal(this.tipsMsg2, false, result.msg);
439
+          }
440
+        });
441
+    }
442
+  }
443
+
444
+  // 查看
445
+  detail(id) {
446
+    this.router.navigateByUrl(
447
+      "/main/workAssignment/workAssignmentDetail/" + id
448
+    );
449
+  }
450
+  //时间选择框相关
451
+  defaultTimePickerOpenValue = new Date();
452
+  // 更改日期
453
+  datePicker;
454
+  datePickerChange(e) {
455
+    if (!e) {
456
+      return;
457
+    }
458
+    let todayDate = new Date(e);
459
+    let year = todayDate.getFullYear();
460
+    let month = (todayDate.getMonth() + 1).toString().padStart(2, "0");
461
+    let date = todayDate.getDate().toString().padStart(2, "0");
462
+    let hour = todayDate.getHours().toString().padStart(2, "0");
463
+    let minutes = todayDate.getMinutes().toString().padStart(2, "0");
464
+    this.datePicker = `${year}-${month}-${date} ${hour}:${minutes}:00`;
465
+  }
466
+}

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

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

+ 6 - 6
src/app/views/specimen-view2/specimen-view2.component.html

@@ -76,8 +76,8 @@
76 76
                 <span>{{item.specimen_desc || '无'}}</span>
77 77
               </div>
78 78
               <div class="pharmacy-main__selectionItem">
79
-                <span>患者姓名</span>
80
-                <span>{{item.patientname || '无'}}</span>
79
+                <span>患者姓名(床号)</span>
80
+                <span>{{item.patientname || '无'}}<span *ngIf="item.patientname && item.bednum">({{item.bednum}})</span></span>
81 81
               </div>
82 82
               <div class="pharmacy-main__selectionItem">
83 83
                 <span>住院号</span>
@@ -525,7 +525,7 @@
525 525
 </div>
526 526
 
527 527
 <!-- 药房端科室切换提示框 -->
528
-<app-hs-prompt-modal
528
+<!-- <app-hs-prompt-modal
529 529
   [changeShow]="changeShow"
530 530
   [closeTime]="closeTime"
531 531
   [closeTimeFlag]="closeTimeFlag"
@@ -533,10 +533,10 @@
533 533
   (closeModelHs)="closeModelHs($event)"
534 534
   (clearModelHs)="clearModelHs($event)"
535 535
   deptType="pharmacy"
536
->
536
+> -->
537 537
   <!-- 返回系统按钮 -->
538 538
   <!-- 右侧悬浮框 -->
539
-  <div id="fixedMenu" class="fixed" *ngIf="mainRole">
539
+  <!-- <div id="fixedMenu" class="fixed" *ngIf="mainRole">
540 540
     <div class="right">
541 541
       <div class="fixedMenu hujiaozhongxin">
542 542
         <div class="menuItems">
@@ -578,7 +578,7 @@
578 578
       class="fixedMark"
579 579
     ></div>
580 580
   </div>
581
-</app-hs-prompt-modal>
581
+</app-hs-prompt-modal> -->
582 582
 
583 583
 <!-- 标本历史记录查看 -->
584 584
 <app-history-prompt-modal

+ 1 - 0
src/app/views/specimen-view2/specimen-view2.component.less

@@ -123,6 +123,7 @@
123 123
     }
124 124
   }
125 125
   .userInfo {
126
+    display: none;
126 127
     width: 336px;
127 128
     height: 100%;
128 129
     float: right;